mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-26 01:39:51 +01:00
Merge origin/master into feat/antigravity-swarm-command
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * origin/master: refactor(plugin-sdk): remove archivedState from the resume result (#22443) refactor(runner): let the provider decide whether a released Runner relaunches (#22442) fix(connections): drop MCP wording and the MCP guide link from Google Workspace setup (#22793) fix(ui): defer the Connectors announcement until a return visit (#22790) fix(connections): show only the privacy policy link in the Google Workspace picker (#22795) Add count, newest-first and lean run reads to customer-success inspection (#22781) fix(connections): keep a finished setup checklist on screen when the app refreshes queries (#22715) perf(ci): Phase 2 PR CI under 4 minutes (dynamic workers, fast E2E boot, typecheck overlap, test-budget gate) (#22729) fix(plan-mode): open the plan review card when a Plan-mode run settles without one (#22732)
This commit is contained in:
commit
3cbfa500f4
142 files changed
+5552
-11636
No files matched your search
@@ -16,7 +16,6 @@
|
||||
"urlPatterns": [
|
||||
"https://workspace.google.com/*"
|
||||
],
|
||||
"docsUrl": "https://developers.google.com/workspace/guides/configure-mcp-servers",
|
||||
"setupPrerequisite": {
|
||||
"title": "Google Developer Preview access required",
|
||||
"description": "Google must register the Workspace email and the Cloud project that owns the OAuth client before these services can be used.",
|
||||
@@ -111,10 +110,10 @@
|
||||
"prompt": "consent"
|
||||
}
|
||||
},
|
||||
"guidanceMd": "Enable the Google Workspace MCP APIs and register Paperclip's callback URI. Choose which permissions to grant on Google's consent screen; declined permissions disable only the corresponding actions.",
|
||||
"guidanceMd": "Enable the Gmail, Drive, Docs, Sheets, Slides, and Calendar APIs in your Google Cloud project and register Paperclip's callback URI. Choose which permissions to grant on Google's consent screen; declined permissions disable only the corresponding actions.",
|
||||
"consoleLinks": {
|
||||
"register": "https://console.cloud.google.com/auth/clients",
|
||||
"docs": "https://developers.google.com/workspace/guides/configure-mcp-servers"
|
||||
"docs": "https://developers.google.com/workspace/guides/create-credentials#oauth-client-id"
|
||||
},
|
||||
"riskTier": "S4"
|
||||
}
|
||||
|
||||
@@ -65,10 +65,28 @@ export const INSPECTION_RESOURCES = [
|
||||
"threads",
|
||||
] as const;
|
||||
export type InspectionResource = (typeof INSPECTION_RESOURCES)[number];
|
||||
export const INSPECTION_ORDERS = ["newest", "oldest"] as const;
|
||||
export type InspectionOrder = (typeof INSPECTION_ORDERS)[number];
|
||||
export const INSPECTION_VIEWS = ["summary"] as const;
|
||||
export type InspectionView = (typeof INSPECTION_VIEWS)[number];
|
||||
/** The tenant path for queries that use only the original (version 1) features. */
|
||||
export const INSPECTION_READ_PATH = "/read";
|
||||
/**
|
||||
* The tenant path for queries that use `count`, `order` or `view`. A tenant
|
||||
* that predates them answers 404 here, so Cloud fails closed with
|
||||
* `tenant_inspection_version_unsupported` instead of misreading the query.
|
||||
*/
|
||||
export const INSPECTION_EXTENDED_READ_PATH = "/read-v2";
|
||||
export interface InspectionCount {
|
||||
total: number;
|
||||
/** Counts grouped by the resource's `status` column, or null when it has none. */
|
||||
byStatus: Record<string, number> | null;
|
||||
}
|
||||
export interface InspectionQuery {
|
||||
operation:
|
||||
| "list"
|
||||
| "get"
|
||||
| "count"
|
||||
| "instructions.file"
|
||||
| "skills.file"
|
||||
| "runs.log"
|
||||
@@ -85,6 +103,10 @@ export interface InspectionQuery {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
range?: { start: number; end: number };
|
||||
/** `list` only: order by creation time instead of by id. */
|
||||
order?: InspectionOrder;
|
||||
/** `list`/`get` on `runs` only: leave out the large JSON columns. */
|
||||
view?: InspectionView;
|
||||
context?: {
|
||||
projectId?: string;
|
||||
workspaceId?: string;
|
||||
@@ -129,6 +151,11 @@ export function canonicalJson(value: unknown): string {
|
||||
}
|
||||
throw new Error("Invalid JSON value");
|
||||
}
|
||||
export function inspectionReadPath(query: InspectionQuery): string {
|
||||
return query.operation === "count" || query.order !== undefined || query.view !== undefined
|
||||
? INSPECTION_EXTENDED_READ_PATH
|
||||
: INSPECTION_READ_PATH;
|
||||
}
|
||||
export function parseInspectionQuery(value: unknown): InspectionQuery {
|
||||
if (!value || typeof value !== "object" || Array.isArray(value))
|
||||
throw new Error("Invalid inspection query");
|
||||
@@ -144,6 +171,8 @@ export function parseInspectionQuery(value: unknown): InspectionQuery {
|
||||
"limit",
|
||||
"offset",
|
||||
"range",
|
||||
"order",
|
||||
"view",
|
||||
"context",
|
||||
]);
|
||||
if (Object.keys(q).some((k) => !allowed.has(k)))
|
||||
@@ -152,6 +181,7 @@ export function parseInspectionQuery(value: unknown): InspectionQuery {
|
||||
![
|
||||
"list",
|
||||
"get",
|
||||
"count",
|
||||
"instructions.file",
|
||||
"skills.file",
|
||||
"runs.log",
|
||||
@@ -169,11 +199,21 @@ export function parseInspectionQuery(value: unknown): InspectionQuery {
|
||||
if (q.resource !== undefined && !INSPECTION_RESOURCES.includes(q.resource))
|
||||
throw new Error("Unsupported inspection resource");
|
||||
if (q.operation === "get" && !q.resourceId) throw new Error("resourceId required");
|
||||
if (["get", "list"].includes(q.operation) && !q.resource) throw new Error("resource required");
|
||||
if (["get", "list", "count"].includes(q.operation) && !q.resource)
|
||||
throw new Error("resource required");
|
||||
if (!(q.operation === "list" && q.resource === "companies") && !q.companyId)
|
||||
throw new Error("companyId required");
|
||||
if (!["get", "list"].includes(q.operation) && !q.resourceId)
|
||||
if (!["get", "list", "count"].includes(q.operation) && !q.resourceId)
|
||||
throw new Error("resourceId required");
|
||||
if (q.operation === "count" && q.resourceId !== undefined)
|
||||
throw new Error("count does not take resourceId");
|
||||
if (q.order !== undefined && (q.operation !== "list" || !INSPECTION_ORDERS.includes(q.order)))
|
||||
throw new Error("Invalid order");
|
||||
if (
|
||||
q.view !== undefined &&
|
||||
(!["list", "get"].includes(q.operation) || q.resource !== "runs" || !INSPECTION_VIEWS.includes(q.view))
|
||||
)
|
||||
throw new Error("Invalid view");
|
||||
if (
|
||||
q.path !== undefined &&
|
||||
(typeof q.path !== "string" || q.path.length > 1024 || q.path.includes("\0"))
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { getConnectableAppDefinition } from "./app-definitions.js";
|
||||
|
||||
const MCP_SERVERS_GUIDE = "configure-mcp-servers";
|
||||
const OAUTH_CLIENT_GUIDE = "https://developers.google.com/workspace/guides/create-credentials#oauth-client-id";
|
||||
|
||||
describe("Google Workspace setup links and copy", () => {
|
||||
const app = getConnectableAppDefinition("google-workspace")!;
|
||||
const method = (key: string) => app.methods.find((candidate) => candidate.key === key)!;
|
||||
|
||||
it("never sends a user to Google's MCP servers guide", () => {
|
||||
expect(JSON.stringify(app)).not.toContain(MCP_SERVERS_GUIDE);
|
||||
});
|
||||
|
||||
it("gives the Paperclip-managed sign-in no requirements link", () => {
|
||||
expect(app.docsUrl).toBeUndefined();
|
||||
expect(method("paperclip-workspace").consoleLinks?.docs).toBeUndefined();
|
||||
});
|
||||
|
||||
it("links the customer-owned client method to Google's OAuth client guide", () => {
|
||||
expect(method("customer-workspace-oauth").consoleLinks?.docs).toBe(OAUTH_CLIENT_GUIDE);
|
||||
});
|
||||
|
||||
it("does not mention MCP in user-facing method text", () => {
|
||||
for (const entry of app.methods) {
|
||||
for (const text of [entry.label, entry.whenToUse, entry.guidanceMd, ...(entry.warnings ?? [])]) {
|
||||
expect(text ?? "").not.toMatch(/\bMCP\b/);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user