@zackbart/connecta 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +98 -0
- package/README.md +95 -116
- package/SECURITY.md +1 -1
- package/bin/connecta.mjs +24 -6
- package/bin/version.mjs +1 -1
- package/dist/access-tokens.d.ts +167 -23
- package/dist/access-tokens.js +676 -140
- package/dist/activity.d.ts +3 -0
- package/dist/agent-identity.js +47 -0
- package/dist/auth/cloudflare-access.js +13 -5
- package/dist/branding.d.ts +7 -0
- package/dist/branding.js +76 -9
- package/dist/call-admission-context.js +15 -0
- package/dist/call-admission.js +30 -43
- package/dist/call-recovery.js +6 -2
- package/dist/catalog-service.js +15 -1
- package/dist/config-value-sources.js +16 -9
- package/dist/config.d.ts +48 -75
- package/dist/config.js +144 -36
- package/dist/connector-access.d.ts +4 -34
- package/dist/connector-access.js +15 -99
- package/dist/connector-caller.d.ts +7 -1
- package/dist/connector-caller.js +4 -2
- package/dist/connectors/api-connector.d.ts +27 -4
- package/dist/connectors/api-connector.js +2 -0
- package/dist/connectors/remote-mcp.js +2 -0
- package/dist/describe-config.d.ts +31 -7
- package/dist/describe-config.js +8 -17
- package/dist/execute.js +1 -11
- package/dist/fix-prompt.js +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +30 -10
- package/dist/invocation.js +5 -3
- package/dist/membership.d.ts +53 -0
- package/dist/membership.js +121 -0
- package/dist/module-contracts.d.ts +23 -6
- package/dist/oauth-callback-outcome.js +2 -2
- package/dist/operator-record.d.ts +2 -2
- package/dist/operator-record.js +2 -4
- package/dist/operator-ui/agents.d.ts +74 -0
- package/dist/operator-ui/agents.js +104 -0
- package/dist/operator-ui/config-summary.js +562 -0
- package/dist/operator-ui/connection-map.js +375 -0
- package/dist/operator-ui/contract.d.ts +149 -28
- package/dist/operator-ui/endpoints.js +221 -0
- package/dist/operator-ui/fix-prompts.js +5 -5
- package/dist/operator-ui/generated.js +5 -4
- package/dist/operator-ui/member-page.js +97 -0
- package/dist/operator-ui/model.d.ts +14 -6
- package/dist/operator-ui/overview.js +134 -0
- package/dist/operator-ui/view.d.ts +107 -37
- package/dist/operator-ui/view.js +163 -86
- package/dist/page-styles.js +5 -3
- package/dist/provider.d.ts +61 -8
- package/dist/provider.js +46 -7
- package/dist/providers/_shared/google/workspace.d.ts +56 -17
- package/dist/providers/_shared/google/workspace.js +34 -8
- package/dist/providers/_shared/rest/tools.js +2 -2
- package/dist/providers/_shared/rest/value-safety.d.ts +50 -0
- package/dist/providers/_shared/rest/value-safety.js +699 -7
- package/dist/providers/ccb/index.js +2 -2
- package/dist/providers/cloudflare/index.js +3 -3
- package/dist/providers/cloudflare/rest.js +25 -3
- package/dist/providers/cloudflare/skill.generated.js +1 -1
- package/dist/providers/cloudflare/value-safety.js +32 -0
- package/dist/providers/docs/index.js +4 -4
- package/dist/providers/docs/skill.generated.js +2 -2
- package/dist/providers/drive/index.js +4 -4
- package/dist/providers/drive/skill.generated.js +2 -2
- package/dist/providers/forms/index.js +4 -4
- package/dist/providers/forms/skill.generated.js +2 -2
- package/dist/providers/gmail/index.js +11 -9
- package/dist/providers/gmail/skill.generated.js +2 -2
- package/dist/providers/mixpanel/index.js +1 -1
- package/dist/providers/mixpanel/skill.generated.js +3 -3
- package/dist/providers/notion/index.d.ts +7 -0
- package/dist/providers/notion/index.js +100 -11
- package/dist/providers/notion/rest.js +45 -5
- package/dist/providers/notion/skill.generated.js +2 -2
- package/dist/providers/notion/value-safety.js +30 -5
- package/dist/providers/overflow/index.js +2 -2
- package/dist/providers/overflow/skill.generated.js +2 -2
- package/dist/providers/planning-center/index.js +2 -2
- package/dist/providers/planning-center/skill.generated.js +4 -4
- package/dist/providers/revenuecat/skill.generated.js +2 -2
- package/dist/providers/sheets/index.d.ts +3 -0
- package/dist/providers/sheets/index.js +7 -4
- package/dist/providers/sheets/skill.generated.js +2 -2
- package/dist/providers/slides/index.js +4 -4
- package/dist/providers/slides/skill.generated.js +2 -2
- package/dist/providers/stripe/rest.js +9 -2
- package/dist/providers/stripe/skill.generated.js +1 -1
- package/dist/providers/stripe/value-safety.js +22 -0
- package/dist/providers/tithely/index.js +1 -1
- package/dist/providers/vercel/index.js +1 -1
- package/dist/providers/vercel/rest.js +20 -2
- package/dist/providers/vercel/skill.generated.js +2 -2
- package/dist/providers/vercel/value-safety.js +22 -0
- package/dist/registry.d.ts +2 -3
- package/dist/registry.js +23 -9
- package/dist/routes/access-tokens.js +82 -75
- package/dist/routes/activity-disclosure.js +17 -18
- package/dist/routes/activity.js +34 -54
- package/dist/routes/actor-labels.js +33 -4
- package/dist/routes/agent-path.js +43 -0
- package/dist/routes/connect.js +16 -12
- package/dist/routes/credentials.js +16 -40
- package/dist/routes/mcp.js +161 -104
- package/dist/routes/oauth-management.js +11 -5
- package/dist/routes/oauth.js +5 -11
- package/dist/routes/operator.js +24 -23
- package/dist/routes/shared.d.ts +60 -20
- package/dist/routes/shared.js +187 -96
- package/dist/routes/ui-config.js +437 -97
- package/dist/routes/ui-data.js +2 -2
- package/dist/routes/ui.js +9 -16
- package/dist/runtime/call-admission.js +9 -0
- package/dist/server.js +5 -0
- package/dist/skills.js +10 -0
- package/dist/storage/keys.js +9 -1
- package/dist/storage/sql.js +5 -1
- package/dist/types.d.ts +29 -7
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +23 -16
- package/dist/usage-guide.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workspace-address.js +9 -0
- package/dist/workspace-subject.js +23 -0
- package/documentation/README.md +47 -23
- package/documentation/architecture.md +371 -61
- package/documentation/auth.md +897 -249
- package/documentation/code-mode.md +37 -16
- package/documentation/deploying.md +126 -25
- package/documentation/integrating.md +97 -23
- package/documentation/meta-tools.md +50 -31
- package/documentation/migration-0.33.md +352 -0
- package/documentation/migration-0.34.md +67 -0
- package/documentation/operating.md +3 -1
- package/documentation/operator-tests.md +147 -34
- package/documentation/operator-ui.md +519 -64
- package/documentation/provider-auth-migration.md +37 -23
- package/documentation/provider-migration-0.29.md +2 -2
- package/examples/worker/AGENTS.md +37 -9
- package/examples/worker/README.md +127 -61
- package/examples/worker/src/connecta.config.ts +40 -23
- package/examples/worker/wrangler.jsonc +4 -1
- package/package.json +19 -18
- package/templates/node/.env.example +3 -0
- package/templates/node/AGENTS.md +33 -6
- package/templates/node/Dockerfile +2 -2
- package/templates/node/README.md +80 -52
- package/templates/node/docker-compose.yml +3 -2
- package/templates/node/package.json +4 -3
- package/templates/node/src/adopt-token.ts +23 -0
- package/templates/node/src/connecta.config.ts +28 -12
- package/templates/node/src/rotate-token.ts +17 -0
- package/templates/node/src/provision-token.ts +0 -17
|
@@ -25,7 +25,7 @@ import { skill } from "./skill.generated.js";
|
|
|
25
25
|
*
|
|
26
26
|
* Drift is handled the Vercel way: `src/providers/ccb/drift.json` records
|
|
27
27
|
* every endpoint a named tool touches, and
|
|
28
|
-
* `
|
|
28
|
+
* `pnpm run providers:check --provider ccb` compares those rows with the
|
|
29
29
|
* published, credential-free OpenAPI document at
|
|
30
30
|
* https://docs.pushpay.io/chms-v2/openapi/chms-api-specs.json.
|
|
31
31
|
*/
|
|
@@ -1718,7 +1718,7 @@ function ccbConnector(id, options) {
|
|
|
1718
1718
|
summary: `${environment === "sandbox" ? "Sandbox" : "Production"} CCB, ${mode === "identity" ? "per person" : "church-wide"}: id resolution, sensitive data, paging, rate limits, hatches.`,
|
|
1719
1719
|
required: true,
|
|
1720
1720
|
},
|
|
1721
|
-
callAdmission: options.callAdmission
|
|
1721
|
+
callAdmission: options.callAdmission === undefined ? CCB_ADMISSION : options.callAdmission,
|
|
1722
1722
|
...(options.maxResultBytes !== undefined ? { maxResultBytes: options.maxResultBytes } : {}),
|
|
1723
1723
|
tools: tools(ccbTransport(endpoints.apiOrigin), defaultPerPage, writable),
|
|
1724
1724
|
});
|
|
@@ -10,7 +10,7 @@ import { skill } from "./skill.generated.js";
|
|
|
10
10
|
import { apiConnector } from "../../connectors/api-connector.js";
|
|
11
11
|
import { reviewedCatalog } from "../../catalog-drift.js";
|
|
12
12
|
import { keys, optionsOf, variants } from "../../config-schema.js";
|
|
13
|
-
import { defineProvider } from "../../provider.js";
|
|
13
|
+
import { CALL_ADMISSION, defineProvider } from "../../provider.js";
|
|
14
14
|
import { byAuth, hostedOAuth } from "../_shared/rest/dispatch.js";
|
|
15
15
|
import { restTools } from "../_shared/rest/tools.js";
|
|
16
16
|
import { CLOUDFLARE_API_BASE, cloudflareRest } from "./rest.js";
|
|
@@ -123,7 +123,7 @@ const PIN = optionsOf()(keys("accountIds", "zoneIds"));
|
|
|
123
123
|
const CLOUDFLARE_OPTIONS = variants(["auth", "type"], {
|
|
124
124
|
oauth: optionsOf()({
|
|
125
125
|
...COMMON,
|
|
126
|
-
|
|
126
|
+
callAdmission: CALL_ADMISSION,
|
|
127
127
|
auth: optionsOf()(keys("type")),
|
|
128
128
|
}).shape,
|
|
129
129
|
apiToken: optionsOf()({
|
|
@@ -145,7 +145,7 @@ function cloudflareOAuth(id, options, provider) {
|
|
|
145
145
|
url: CLOUDFLARE_MCP_ENDPOINT,
|
|
146
146
|
title: options.title ?? "Cloudflare (MCP)",
|
|
147
147
|
description: `Cloudflare's official whole-API MCP interface: ${options.purpose.trim()}`,
|
|
148
|
-
...(options.callAdmission ? { callAdmission: options.callAdmission } : {}),
|
|
148
|
+
...(options.callAdmission !== undefined ? { callAdmission: options.callAdmission } : {}),
|
|
149
149
|
usageGuide: {
|
|
150
150
|
content: oauthUsageGuide(options.purpose.trim(), options.instructions),
|
|
151
151
|
summary: "Hosted MCP over OAuth. Search the OpenAPI document; execute programs always classify as writes.",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { chargeConnectorCall } from "../../call-admission-context.js";
|
|
1
2
|
import { retryAfterMs } from "../../connectors/guarded-fetch.js";
|
|
2
3
|
import { ConnectorCallError } from "../../errors.js";
|
|
3
4
|
import { OperationIndex } from "../_shared/rest/operation-index.js";
|
|
4
5
|
import { callRest, restCall, restTransport, } from "../_shared/rest/tools.js";
|
|
5
6
|
import { inspectGraphqlQuery } from "./graphql.js";
|
|
6
|
-
import { valueSafety } from "../_shared/rest/value-safety.js";
|
|
7
|
+
import { valueSafety, withholdEmbeddedUrlsIn, refuseWithheldLinks, refuseWithheldUpload, refuseWithheldBase64, } from "../_shared/rest/value-safety.js";
|
|
7
8
|
import { CLOUDFLARE_VALUE_SAFETY } from "./value-safety.js";
|
|
8
9
|
import { openapi } from "./openapi.generated.js";
|
|
9
10
|
/** Cloudflare's v4 REST base. Override only for a proxy or a test double. */
|
|
@@ -253,7 +254,7 @@ const SAFETY = valueSafety(CLOUDFLARE_VALUE_SAFETY, () => cloudflareIndex());
|
|
|
253
254
|
* (it may echo a submitted secret); the status and numeric codes still route.
|
|
254
255
|
*/
|
|
255
256
|
function failureFor(status, headers, body, call) {
|
|
256
|
-
const errors = errorsOf(body);
|
|
257
|
+
const errors = errorsOf(withholdEmbeddedUrlsIn(body));
|
|
257
258
|
const ray = headers.get("cf-ray");
|
|
258
259
|
const codes = errorCodes(errors);
|
|
259
260
|
const withheld = call !== undefined && SAFETY.withholdsErrors(call.op);
|
|
@@ -472,6 +473,7 @@ export function cloudflareRest(options) {
|
|
|
472
473
|
let owner = owners.get(zone);
|
|
473
474
|
if (owner === undefined) {
|
|
474
475
|
chargeLookup(ctx);
|
|
476
|
+
await chargeConnectorCall(ctx);
|
|
475
477
|
owner = await send({ method: "GET", path: `/zones/${encodeURIComponent(zone)}` }, ctx, async (response) => {
|
|
476
478
|
const body = await response.jsonResult().catch(() => ({ value: undefined }));
|
|
477
479
|
const value = "value" in body ? body.value : undefined;
|
|
@@ -491,6 +493,24 @@ export function cloudflareRest(options) {
|
|
|
491
493
|
* neither is admitted only from the reviewed `PIN_SAFE_UNSCOPED` set.
|
|
492
494
|
*/
|
|
493
495
|
const admit = async (call, ctx) => {
|
|
496
|
+
if (call.method !== "GET" &&
|
|
497
|
+
call.method !== "HEAD" &&
|
|
498
|
+
!READ_POSTS.some(([method, path]) => method === call.method && path === call.op.path)) {
|
|
499
|
+
refuseWithheldLinks([call.query, call.path], "Cloudflare");
|
|
500
|
+
if (call.body instanceof RawUpload)
|
|
501
|
+
await refuseWithheldUpload(call.body.body, "Cloudflare");
|
|
502
|
+
else
|
|
503
|
+
refuseWithheldLinks(call.body, "Cloudflare");
|
|
504
|
+
if (call.method === "PUT" &&
|
|
505
|
+
call.op.path === "/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk" &&
|
|
506
|
+
Array.isArray(call.body)) {
|
|
507
|
+
for (const entry of call.body) {
|
|
508
|
+
// KV values support 25 MiB decoded; MAX_RESPONSE_BYTES only caps reads.
|
|
509
|
+
if (record(entry)["base64"] === true)
|
|
510
|
+
await refuseWithheldBase64(record(entry)["value"], "Cloudflare", 25 * 1024 * 1024);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
494
514
|
if (!pin)
|
|
495
515
|
return;
|
|
496
516
|
const { accounts, zones, template } = scopeIds(call);
|
|
@@ -632,7 +652,9 @@ export function cloudflareRest(options) {
|
|
|
632
652
|
const info = record(body["result_info"]);
|
|
633
653
|
if (Object.keys(info).length === 0)
|
|
634
654
|
return undefined;
|
|
635
|
-
const
|
|
655
|
+
const rawCursor = text(info["cursor"]) ?? text(record(info["cursors"])["after"]);
|
|
656
|
+
// Never echo or offer a modified cursor: it would not address the next page.
|
|
657
|
+
const cursor = rawCursor === undefined || withholdEmbeddedUrlsIn(rawCursor) === rawCursor ? rawCursor : undefined;
|
|
636
658
|
if (cursor !== undefined || "cursor" in info || "cursors" in info) {
|
|
637
659
|
const accepted = operations.contract(call.op).parameters.map((parameter) => parameter.name);
|
|
638
660
|
const param = accepted.includes("cursor") ? "cursor" : accepted.includes("after") ? "after" : "cursor";
|
|
@@ -6,7 +6,7 @@ export const skill = {
|
|
|
6
6
|
"oauth": "\n\n- The catalog is Cloudflare's own `search` and `execute`. `search` runs code against Cloudflare's OpenAPI document; `execute` runs code that may call any Cloudflare API endpoint the OAuth grant allows.\n- Connecta classifies `execute` as a write, even for a program that only reads, because one program can mix GET, POST, PUT, PATCH, and DELETE and no schema proves otherwise. A read-only endpoint therefore gets only `search` here. Deployments that need API reads from a read-only endpoint configure an API-token connector, whose `cloudflare_api_read` and named reads are reads.\n- Use `search` to find the exact method, path, and fields before writing an execute program. Do not guess an endpoint from product naming.\n- Keep returned values small. Filter and project inside the Cloudflare program, then reduce again inside Connecta's `execute_code` when several calls must be joined.\n- This connection has none of the REST connector's tools: no `cloudflare_api_*` validation against a pinned index, no `graphql_query`, no `cloudflare_api_upload`, and no account or zone pin. OAuth permissions are the boundary.\n",
|
|
7
7
|
"oauth_tail": "- An `auth_required` failure means this connector's Cloudflare authorization is missing or expired: run `authorize_connector` for this connector id, then retry the same call unchanged.\n",
|
|
8
8
|
"global_warning": "\n\nThis connector holds a Global API Key. It acts as its Cloudflare user with every permission that user has, in every account and zone the user belongs to, and nothing on Cloudflare's side narrows it. A mistaken write can reach production domains, billing, and members across all of them. Prefer reads, state the account and zone of every write, and stop when a request is ambiguous. Writes under `/user` and `/memberships` are refused. R2 accepts API tokens only, so R2 operations fail with this key.\n",
|
|
9
|
-
"key": "\n\n- This is Connecta's REST connector to the Cloudflare v4 API, holding one operator-managed credential. `cloudflare_api_search` finds API operations in a pinned index (not records) and names the tool that calls each; `cloudflare_api_details` returns one operation's parameters and body with types, enums, and required names. Neither sends a request.\n- `cloudflare_api_read` calls GET operations plus reviewed read-only POSTs: analytics queries, Analytics Engine and SQL API queries, Log Explorer SQL, Vectorize queries, KV bulk get, telemetry queries, and validation checks. `cloudflare_api_write` calls every other POST, PUT, PATCH, and DELETE with `method` and `path` stated. D1 `…/query` and `…/raw`, Durable Object queries, Workers AI `…/ai/run`, AI Search and AutoRAG search (query rewriting runs billed models), monetization checks, and flag evaluation are writes: they can change data, cost money, or activate something.\n- Paths are concrete: substitute ids into the template search returned (`/zones/<zone id>/dns_records/<record id>`). Pass `query` and `body` as JSON named as details lists them; text operations (Analytics Engine SQL, Log Explorer SQL, Worker scripts) take a string body, and Vectorize inserts a list of objects sent as NDJSON. R2 calls accept `headers` with `cf-r2-jurisdiction` or `cf-r2-storage-class`. Encode a `/` inside an R2 object key or KV key name as `%2F`.\n- Every call is checked against the pinned index before it is sent. An unknown path returns the nearest operations; an unknown or missing parameter returns `validation.issues` with the accepted names. Nothing reached Cloudflare, so fix the call from that answer.\n- Results arrive as `{ status, data, page? }` with Cloudflare's envelope unwrapped: `data` is the `result`. On a list, pass `page.next` as the `page.param` query argument (`page` for numbered lists, `cursor` for KV, R2, and other cursor lists). Lists belong inside `execute_code`; pass `select` (dot paths such as `id` and `name`) to keep only the fields the question needs.\n- `list_zones` and `list_accounts` resolve names to ids; `verify_credential` separates a bad credential from a missing permission. `graphql_query` runs read-only GraphQL Analytics queries (mutations are refused before sending); filter every `zones` or `accounts` field by `zoneTag` or `accountTag`. A pinned connector sends one query per document, with every fragment it defines used.\n- Multipart, binary, and file bodies go through `cloudflare_api_upload`: Worker scripts and versions, KV values, R2 objects, Pages deployments, Images, Stream, DNS zone-file import, and Snippets. It takes `textBody`, `base64Body`, or multipart `parts`, never a local file.\n- Refused by design: every operation that mints, rotates, or hands back a credential (API tokens, Access service tokens, R2 temporary credentials, tunnel and Mesh node tokens, signing keys, registry credentials, direct-upload URLs, deploy hooks, preview and participant tokens), payment client secrets, URL Scanner captures (results, HAR, DOM, raw responses: they hold the scanned session's cookies and headers; use the scan search for verdicts), and GETs that act (an email unsubscribe, a PagerDuty connect). Stored and embedded secrets (Turnstile, TSIG, webhook and identity-provider secrets, Stream keys, Logpush destination credentials, probe and custom-provider headers, BGP keys, Zaraz variables, Hyperdrive database passwords, RealtimeKit storage credentials, transform-rule header values) and every environment or plain-text binding value (Pages, Containers, Workers, Builds; names and types stay) come back as `\"[redacted]\"` on every method. Notification, RealtimeKit, and data security webhook destinations keep only their scheme and host. Workers KV values are application data and come back as stored. Reviewed operations, and operations that take credentials, report Cloudflare's error codes without its error text. Worker script content is readable: it is code, and secret bindings are not part of it.\n- An `auth_required` failure means the credential is missing, revoked, or malformed: an operator must replace it in this connection in the operator UI, and `authorize_connector` returns that handoff. `provider_permission_denied` means the credential works but lacks this permission or resource, or the call is outside the pin; ask rather than retry.\n",
|
|
9
|
+
"key": "\n\n- This is Connecta's REST connector to the Cloudflare v4 API, holding one operator-managed credential. `cloudflare_api_search` finds API operations in a pinned index (not records) and names the tool that calls each; `cloudflare_api_details` returns one operation's parameters and body with types, enums, and required names. Neither sends a request.\n- `cloudflare_api_read` calls GET operations plus reviewed read-only POSTs: analytics queries, Analytics Engine and SQL API queries, Log Explorer SQL, Vectorize queries, KV bulk get, telemetry queries, and validation checks. `cloudflare_api_write` calls every other POST, PUT, PATCH, and DELETE with `method` and `path` stated. D1 `…/query` and `…/raw`, Durable Object queries, Workers AI `…/ai/run`, AI Search and AutoRAG search (query rewriting runs billed models), monetization checks, and flag evaluation are writes: they can change data, cost money, or activate something.\n- Paths are concrete: substitute ids into the template search returned (`/zones/<zone id>/dns_records/<record id>`). Pass `query` and `body` as JSON named as details lists them; text operations (Analytics Engine SQL, Log Explorer SQL, Worker scripts) take a string body, and Vectorize inserts a list of objects sent as NDJSON. R2 calls accept `headers` with `cf-r2-jurisdiction` or `cf-r2-storage-class`. Encode a `/` inside an R2 object key or KV key name as `%2F`.\n- Every call is checked against the pinned index before it is sent. An unknown path returns the nearest operations; an unknown or missing parameter returns `validation.issues` with the accepted names. Nothing reached Cloudflare, so fix the call from that answer.\n- Under an account pin, each uncached zone-ownership check also spends the connector's call budget. Checks stay capped at three per call and 60 per five minutes per connector; an exhausted budget stops the check and the requested operation.\n- Results arrive as `{ status, data, page? }` with Cloudflare's envelope unwrapped: `data` is the `result`. On a list, pass `page.next` as the `page.param` query argument (`page` for numbered lists, `cursor` for KV, R2, and other cursor lists). Lists belong inside `execute_code`; pass `select` (dot paths such as `id` and `name`) to keep only the fields the question needs.\n- `list_zones` and `list_accounts` resolve names to ids; `verify_credential` separates a bad credential from a missing permission. `graphql_query` runs read-only GraphQL Analytics queries (mutations are refused before sending); filter every `zones` or `accounts` field by `zoneTag` or `accountTag`. A pinned connector sends one query per document, with every fragment it defines used.\n- Multipart, binary, and file bodies go through `cloudflare_api_upload`: Worker scripts and versions, KV values, R2 objects, Pages deployments, Images, Stream, DNS zone-file import, and Snippets. It takes `textBody`, `base64Body`, or multipart `parts`, never a local file.\n- Refused by design: every operation that mints, rotates, or hands back a credential (API tokens, Access service tokens, R2 temporary credentials, tunnel and Mesh node tokens, signing keys, registry credentials, direct-upload URLs, deploy hooks, preview and participant tokens), payment client secrets, URL Scanner captures (results, HAR, DOM, raw responses: they hold the scanned session's cookies and headers; use the scan search for verdicts), and GETs that act (an email unsubscribe, a PagerDuty connect). Stored and embedded secrets (Turnstile, TSIG, webhook and identity-provider secrets, Stream keys, Logpush destination credentials, probe and custom-provider headers, BGP keys, Zaraz variables, Hyperdrive database passwords, RealtimeKit storage credentials, transform-rule header values) and every environment or plain-text binding value (Pages, Containers, Workers, Builds; names and types stay) come back as `\"[redacted]\"` on every method. Notification, RealtimeKit, and data security webhook destinations keep only their scheme and host. Workers KV values are application data and come back as stored. Reviewed operations, and operations that take credentials, report Cloudflare's error codes without its error text. Worker script content is readable: it is code, and secret bindings are not part of it.\n- An `auth_required` failure means the credential is missing, revoked, or malformed: an operator must replace it in this connection in the operator UI, and `authorize_connector` returns that handoff. `provider_permission_denied` means the credential works but lacks this permission or resource, or the call is outside the pin; ask rather than retry.\n- Embedded URL safety uses reviewed paths plus global signing parameters. Generic credential-named query parameters (`code`, `key`, `token`, `sig`, etc.) and credential-looking fragments withhold the destination's entire query/fragment only in Workers build `lines`, Pages log `data.line`, and telemetry `$metadata.message`/`error` and raw string/object `source` payloads in both `events.events` and `invocations.*` on the reviewed log operations and vendor error text. Ordinary `code`/`key` links can therefore be false positives in these diagnostics. DNS TXT content, KV values, Access/Waiting Room custom HTML and other operator content keep those ordinary URL parameters byte for byte. Literal AWS SigV4/Google V4 `X-Amz-*`/`X-Goog-*` Signature, Credential and Security-Token values are withheld in every decoded string before projection. A withheld value is not the original: do not write it back. KV bulk writes also inspect decoded `value` fields with `base64: true` (up to Cloudflare's 25 MiB decoded value limit; malformed or oversized base64 is refused, and the host's inbound body cap still applies). All writes, including named writes and supported raw/base64/multipart uploads, reject URL destinations whose own query/fragment contains the exact `[redacted]` placeholder, plain or encoded, with `invalid_args` before dispatch. Admission iteratively checks every JSON key and value within the host's accepted request size, without separate depth or node-count ceilings; cyclic direct arguments are refused. A marker outside the destination remains ordinary text. Split strings, encoded host/signing names, bare hosts without `//`, and opaque bearer paths remain outside this scan. Binary responses represented as base64, including Worker JavaScript served as `application/javascript`, are returned unchanged and are not decoded/scanned. An envelope cursor that would change under URL sanitizing is omitted rather than echoed or reused.\n",
|
|
10
10
|
"shared": "- Resolve account and zone ids before acting; never guess one. Ids are 32-character hex strings, and a zone is found by its domain name. Defaults and pins route a connector; Cloudflare's permissions still decide what the credential may do.\n- Read state before replacing, rolling back, or purging. For DNS, PATCH changes the fields you send and PUT replaces the whole record, so read the record first and send its type, name, and content with the change. Prefer a targeted cache purge (files, tags, hosts, or prefixes) over purging everything.\n- Cloudflare reports failures in `errors` with numeric codes and returns `success: false`; read the message instead of retrying the same call.\n- Honor rate-limit waits. Cloudflare documents 1,200 requests per five minutes per user, counted across the dashboard and every token; Connecta's per-runtime window approximates it, and a limited user is blocked for the rest of the window.\n- Treat every create, update, delete, purge, deploy, and upload as a write. For guest calls, classification, and routing, fetch `skills({ name: \"usage\" })`.\n",
|
|
11
11
|
"key_tail": "- Cloudflare answers a rate limit with HTTP 429; the failure carries `retryAfterMs`. Failed authentication is limited separately (code 10502), so diagnose a credential once with `verify_credential` rather than retrying calls.\n"
|
|
12
12
|
}
|
|
@@ -15,6 +15,22 @@
|
|
|
15
15
|
// Paths are dot paths into the data a tool returns (Cloudflare's `result`,
|
|
16
16
|
// or the whole body when it is not an envelope); lists are traversed
|
|
17
17
|
// implicitly and `*` matches every key of an object.
|
|
18
|
+
// Embedded URL verdict (#812): reviewed paths + global signing parameters.
|
|
19
|
+
// Evidence: digest-verified schema revision 3fad73eb27c381031c09ccdfa28ef9352029cd5a:
|
|
20
|
+
// builds_BuildLogsResponse.lines (timestamp/log-message tuples),
|
|
21
|
+
// pages_deployment_log.data.line and workers-observability_query_results
|
|
22
|
+
// events.events and invocations.* -> telemetry_event.$metadata.message/error
|
|
23
|
+
// and source (raw string/object log payload). Exact operations
|
|
24
|
+
// and paths are below, after envelope unwrapping. All vendor error text is
|
|
25
|
+
// scanned too; ordinary code/key links can be false positives in diagnostics.
|
|
26
|
+
// DNS TXT content, KV values, Access custom_html, Waiting Room custom_page_html
|
|
27
|
+
// and other operator/application content retain generic query parameters.
|
|
28
|
+
// Literal X-Amz-/X-Goog- Signature/Credential/Security-Token values are withheld
|
|
29
|
+
// in every decoded string. Binary/base64 response bodies (including Worker
|
|
30
|
+
// JavaScript served as application/javascript) are not decoded or scanned.
|
|
31
|
+
// Recording/download/upload capabilities retain their structured-field rules.
|
|
32
|
+
// The review found no documented Cloudflare-minted links embedded in other
|
|
33
|
+
// free text and justifies no Cloudflare/R2/S3-wide file-host policy.
|
|
18
34
|
import { redact as reviewed, refuse, safe as reviewedSafe, } from "../_shared/rest/value-safety.js";
|
|
19
35
|
const MINT = "Connecta does not create, rotate, or return credentials; an operator manages this credential in the Cloudflare dashboard.";
|
|
20
36
|
const API_TOKENS = "Connecta does not create, roll, edit, or delete API tokens; an operator manages tokens in the Cloudflare dashboard.";
|
|
@@ -1152,6 +1168,22 @@ const OPERATIONS = {
|
|
|
1152
1168
|
* are reviewed metadata wherever they appear.
|
|
1153
1169
|
*/
|
|
1154
1170
|
export const CLOUDFLARE_VALUE_SAFETY = {
|
|
1171
|
+
embeddedUrls: {
|
|
1172
|
+
operations: {
|
|
1173
|
+
"GET /accounts/{account_id}/builds/builds/{build_uuid}/logs": ["lines"],
|
|
1174
|
+
"GET /accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/history/logs": [
|
|
1175
|
+
"data.line",
|
|
1176
|
+
],
|
|
1177
|
+
"POST /accounts/{account_id}/workers/observability/telemetry/query": [
|
|
1178
|
+
"events.events.$metadata.message",
|
|
1179
|
+
"events.events.$metadata.error",
|
|
1180
|
+
"events.events.source",
|
|
1181
|
+
"invocations.*.$metadata.message",
|
|
1182
|
+
"invocations.*.$metadata.error",
|
|
1183
|
+
"invocations.*.source",
|
|
1184
|
+
],
|
|
1185
|
+
},
|
|
1186
|
+
},
|
|
1155
1187
|
title: "Cloudflare",
|
|
1156
1188
|
operations: OPERATIONS,
|
|
1157
1189
|
fields: {
|
|
@@ -21,12 +21,12 @@ import { skill } from "./skill.generated.js";
|
|
|
21
21
|
*
|
|
22
22
|
* Drift. Google publishes a credential-free Discovery document per API.
|
|
23
23
|
* `src/providers/docs/drift.json` records the three methods the tools
|
|
24
|
-
* call, and `
|
|
24
|
+
* call, and `pnpm run providers:check --provider docs` reports a touched
|
|
25
25
|
* contract that moved or a method that stopped accepting the scope below.
|
|
26
26
|
*/
|
|
27
27
|
import { apiConnector as api, defined } from "../../connectors/api-connector.js";
|
|
28
28
|
import { ConnectorCallError } from "../../errors.js";
|
|
29
|
-
import { googleOutcomeOf, GOOGLE_WORKSPACE_OPTIONS, googleWorkspaceClient, workspaceConnection, } from "../_shared/google/workspace.js";
|
|
29
|
+
import { googleOutcomeOf, GOOGLE_WORKSPACE_OPTIONS, googleWorkspaceClient, workspaceConnection, workspaceConnector, } from "../_shared/google/workspace.js";
|
|
30
30
|
import { RESULT_BUDGET_BYTES, clampText, jsonBytes } from "../_shared/google/result-size.js";
|
|
31
31
|
import { asProviderFactory } from "../../provider.js";
|
|
32
32
|
/**
|
|
@@ -1218,7 +1218,7 @@ function docsConnector(id, options) {
|
|
|
1218
1218
|
notFound: "ambiguous",
|
|
1219
1219
|
connection,
|
|
1220
1220
|
});
|
|
1221
|
-
return api(id, {
|
|
1221
|
+
return workspaceConnector(connection, api(id, {
|
|
1222
1222
|
...defined({
|
|
1223
1223
|
callAdmission: options.callAdmission,
|
|
1224
1224
|
maxResultBytes: options.maxResultBytes,
|
|
@@ -1233,5 +1233,5 @@ function docsConnector(id, options) {
|
|
|
1233
1233
|
required: true,
|
|
1234
1234
|
},
|
|
1235
1235
|
tools: tools(client),
|
|
1236
|
-
});
|
|
1236
|
+
}));
|
|
1237
1237
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Generated by scripts/generate-providers.mjs; do not edit.
|
|
2
2
|
export const skill = {
|
|
3
|
-
"content": "# Google Docs usage\n\nReads and edits Google Docs as the signed-in person through Workspace delegation; it cannot search or list documents.\n\nConnection purpose: \n\n## Whose documents\n\nEvery call acts as the Workspace account deployment config maps the caller\nto, and reaches exactly the documents Drive shares with that person. No
|
|
3
|
+
"content": "# Google Docs usage\n\nReads and edits Google Docs as the signed-in person through Workspace delegation; it cannot search or list documents.\n\nConnection purpose: \n\n## Whose documents\n\nEvery call acts as the Workspace account deployment config maps the caller\nto, and reaches exactly the documents Drive shares with that person; an\nagent acts as the owner of the pool it came through, unless the deployment fixes one shared account that every caller, agent or person, acts as. No argument names an\naccount. A call with none mapped fails `auth_required`; only an operator can change\nthat.\n\n## Finding a document\n\nThere is no search or list tool. Take the id from a\ndocs.google.com URL (the part after `/d/`), from the person, or from a\nGoogle Drive connection's file search. A failure on an id may mean it does\nnot exist or is not shared with this person; Google does not say which.\n\n## Reading\n\n- `get_document` renders every tab as markdown-ish text: headings, lists,\n links, tables as pipe rows, footnotes after the body, images and other\n embeds as bracketed markers. Headers, footers, floating images, and\n comments are not rendered; a tab's `notRendered` names any it holds, and\n `suggestion_marks` there means the text mixes unmarked suggested\n insertions and deletions in (read with `suggestions` to preview). Text past `maxChars` (shared across tabs) ends with a marker;\n pass `tabId` to read one tab.\n- Before an index-based edit, read with `withIndexes: true` and target an\n element's `startIndex`/`endIndex`. A long document's rows page with\n `page.nextCursor`; send `maxChars: 0` on later pages, and start over if\n `revisionId` changed between them. Indexes are UTF-16 code units and\n shift after every edit. Keep `revisionId` and pass it as\n `requiredRevisionId`, so an edit against a document someone else has\n changed fails `conflict` with nothing applied; re-read and recompute. Indexes\n from a suggestions preview (`accepted`/`rejected`) are not valid for\n edits.\n- `raw: true` returns Google's document resource for the tabs instead of\n the rendering — styles, headers, footers, named ranges, list and segment ids\n that `batch_update_document` requests may need. It is large: pass\n `tabId`, and call it directly rather than inside `execute_code`,\n which carries at most 256 KiB per result.\n- The same holds for a `maxChars` above the default: a long rendering\n can pass here and still be refused inside `execute_code`, even when the\n program would only measure it. Read it with a direct `call_tool`, paged\n with `connecta.result`, or read one tab at a time.\n\n## Editing\n\n- `create_document` makes a new document in My Drive's root. Never create\n again after a failure that may have left one behind; the message says\n which. When the document exists but its starting text failed, the message\n names its id: append the text with `append_text` straight away only when\n Google refused it; otherwise read the document first and append only what\n is missing.\n- An edit sent with no answer back, answered with a server error, or\n redirected says its outcome is unknown: re-read before repeating it, or\n repeat it with the same `requiredRevisionId`, which Google refuses if the\n first attempt landed. One Google answered 2xx whose reply was unreadable\n says it was applied: do not repeat it.\n- `append_text` joins the last paragraph; begin with `\\n` for a new one.\n- `replace_all_text` changes every match at once; read first and make\n `find` specific.\n- `batch_update_document` takes raw Docs API requests (`deleteContentRange`,\n `updateTextStyle`, `insertTable`, `createParagraphBullets`, …) for what\n the named tools cannot do. It is always destructive, and requires the\n `requiredRevisionId` from the read it was planned against: up to 100\n requests, each exactly one generally available kind (the Developer Preview\n comment and suggestion kinds are refused). Several requests in one\n call apply atomically, and each sees the index shifts of those before it;\n order deletions from the end of the document backwards.\n",
|
|
4
4
|
"instructionsHeading": "Connection instructions",
|
|
5
5
|
"fragments": {
|
|
6
6
|
"guide_0": "# Google Docs usage\n\nReads and edits Google Docs as the signed-in person through Workspace delegation; it cannot search or list documents.\n\nConnection purpose: ",
|
|
7
|
-
"guide_1": "\n\n## Whose documents\n\nEvery call acts as the Workspace account deployment config maps the caller\nto, and reaches exactly the documents Drive shares with that person. No
|
|
7
|
+
"guide_1": "\n\n## Whose documents\n\nEvery call acts as the Workspace account deployment config maps the caller\nto, and reaches exactly the documents Drive shares with that person; an\nagent acts as the owner of the pool it came through, unless the deployment fixes one shared account that every caller, agent or person, acts as. No argument names an\naccount. A call with none mapped fails `auth_required`; only an operator can change\nthat.\n\n## Finding a document\n\nThere is no search or list tool. Take the id from a\ndocs.google.com URL (the part after `/d/`), from the person, or from a\nGoogle Drive connection's file search. A failure on an id may mean it does\nnot exist or is not shared with this person; Google does not say which.\n\n## Reading\n\n- `get_document` renders every tab as markdown-ish text: headings, lists,\n links, tables as pipe rows, footnotes after the body, images and other\n embeds as bracketed markers. Headers, footers, floating images, and\n comments are not rendered; a tab's `notRendered` names any it holds, and\n `suggestion_marks` there means the text mixes unmarked suggested\n insertions and deletions in (read with `suggestions` to preview). Text past `maxChars` (shared across tabs) ends with a marker;\n pass `tabId` to read one tab.\n- Before an index-based edit, read with `withIndexes: true` and target an\n element's `startIndex`/`endIndex`. A long document's rows page with\n `page.nextCursor`; send `maxChars: 0` on later pages, and start over if\n `revisionId` changed between them. Indexes are UTF-16 code units and\n shift after every edit. Keep `revisionId` and pass it as\n `requiredRevisionId`, so an edit against a document someone else has\n changed fails `conflict` with nothing applied; re-read and recompute. Indexes\n from a suggestions preview (`accepted`/`rejected`) are not valid for\n edits.\n- `raw: true` returns Google's document resource for the tabs instead of\n the rendering — styles, headers, footers, named ranges, list and segment ids\n that `batch_update_document` requests may need. It is large: pass\n `tabId`, and call it directly rather than inside `execute_code`,\n which carries at most 256 KiB per result.\n- The same holds for a `maxChars` above the default: a long rendering\n can pass here and still be refused inside `execute_code`, even when the\n program would only measure it. Read it with a direct `call_tool`, paged\n with `connecta.result`, or read one tab at a time.\n\n## Editing\n\n- `create_document` makes a new document in My Drive's root. Never create\n again after a failure that may have left one behind; the message says\n which. When the document exists but its starting text failed, the message\n names its id: append the text with `append_text` straight away only when\n Google refused it; otherwise read the document first and append only what\n is missing.\n- An edit sent with no answer back, answered with a server error, or\n redirected says its outcome is unknown: re-read before repeating it, or\n repeat it with the same `requiredRevisionId`, which Google refuses if the\n first attempt landed. One Google answered 2xx whose reply was unreadable\n says it was applied: do not repeat it.\n- `append_text` joins the last paragraph; begin with `\\n` for a new one.\n- `replace_all_text` changes every match at once; read first and make\n `find` specific.\n- `batch_update_document` takes raw Docs API requests (`deleteContentRange`,\n `updateTextStyle`, `insertTable`, `createParagraphBullets`, …) for what\n the named tools cannot do. It is always destructive, and requires the\n `requiredRevisionId` from the read it was planned against: up to 100\n requests, each exactly one generally available kind (the Developer Preview\n comment and suggestion kinds are refused). Several requests in one\n call apply atomically, and each sees the index shifts of those before it;\n order deletions from the end of the document backwards.\n"
|
|
8
8
|
}
|
|
9
9
|
};
|
|
@@ -26,14 +26,14 @@ import { skill } from "./skill.generated.js";
|
|
|
26
26
|
* changes sharing is destructive and crosses the host's approval prompt.
|
|
27
27
|
*
|
|
28
28
|
* Drift. `src/providers/drive/drift.json` records the eleven methods the
|
|
29
|
-
* tools call, and `
|
|
29
|
+
* tools call, and `pnpm run providers:check --provider drive` reports a
|
|
30
30
|
* touched contract that moved or a method that stopped accepting the scope
|
|
31
31
|
* below.
|
|
32
32
|
*/
|
|
33
33
|
import { apiConnector as api, defined } from "../../connectors/api-connector.js";
|
|
34
34
|
import { ConnectorCallError } from "../../errors.js";
|
|
35
35
|
import { RESULT_BUDGET_BYTES, clampText, jsonBytes } from "../_shared/google/result-size.js";
|
|
36
|
-
import { googleOutcomeOf, GOOGLE_WORKSPACE_OPTIONS, googleWorkspaceClient, workspaceConnection, } from "../_shared/google/workspace.js";
|
|
36
|
+
import { googleOutcomeOf, GOOGLE_WORKSPACE_OPTIONS, googleWorkspaceClient, workspaceConnection, workspaceConnector, } from "../_shared/google/workspace.js";
|
|
37
37
|
import { asProviderFactory } from "../../provider.js";
|
|
38
38
|
/**
|
|
39
39
|
* Drive's API root. Uploads use the same path beneath `/upload` on the same
|
|
@@ -1504,7 +1504,7 @@ function driveConnector(id, options) {
|
|
|
1504
1504
|
};
|
|
1505
1505
|
const client = googleWorkspaceClient({ ...shared, baseUrl });
|
|
1506
1506
|
const upload = googleWorkspaceClient({ ...shared, baseUrl: uploadBaseUrl(baseUrl) });
|
|
1507
|
-
return api(id, {
|
|
1507
|
+
return workspaceConnector(connection, api(id, {
|
|
1508
1508
|
...defined({
|
|
1509
1509
|
callAdmission: options.callAdmission,
|
|
1510
1510
|
maxResultBytes: options.maxResultBytes,
|
|
@@ -1519,5 +1519,5 @@ function driveConnector(id, options) {
|
|
|
1519
1519
|
required: true,
|
|
1520
1520
|
},
|
|
1521
1521
|
tools: guarded(tools(client, upload)),
|
|
1522
|
-
});
|
|
1522
|
+
}));
|
|
1523
1523
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Generated by scripts/generate-providers.mjs; do not edit.
|
|
2
2
|
export const skill = {
|
|
3
|
-
"content": "# Google Drive usage\n\nActs as the signed-in person's own Google Drive through Workspace delegation: what they can open, and nothing they cannot.\n\nConnection purpose: \n\n## Whose Drive\n\nEvery call acts as the Workspace address deployment config maps the caller\nto, and reaches exactly the files that person can open, shared drives\nincluded. No
|
|
3
|
+
"content": "# Google Drive usage\n\nActs as the signed-in person's own Google Drive through Workspace delegation: what they can open, and nothing they cannot.\n\nConnection purpose: \n\n## Whose Drive\n\nEvery call acts as the Workspace address deployment config maps the caller\nto, and reaches exactly the files that person can open, shared drives\nincluded; an agent acts as the owner of the pool it came through, unless the deployment fixes one shared account that every caller, agent or person, acts as. No\nargument names an account. A call with none mapped fails `auth_required`; only an operator can change\nthat. A missing file\nand one this person cannot see fail alike — Google does not distinguish them.\n\n## Finding files\n\n- `search_files` takes Drive query syntax: `name contains 'x'`,\n `fullText contains 'x'`, `mimeType = '…'`, `'<folderId>' in parents`,\n `modifiedTime > '2026-01-01T00:00:00'`. Quote values with single quotes.\n Trashed files are left out unless `includeTrashed`. `incompleteSearch:\n true` means Drive gave up before searching everything; narrow the query or\n the corpus. Shared drives: `list_shared_drives`, then `corpora: \"drive\"`\n with its `driveId`.\n- Page with `page.nextCursor` and the same arguments; a cursor from another\n tool or other arguments is refused. A page can stop short of `limit` to\n stay under `maxBytes`; the cursor resumes at the first row left out, and\n fails `conflict` if that page changed meanwhile — start over then.\n- Ids come from these reads or a Drive URL (`/d/<id>/`, `/folders/<id>`);\n never guess one.\n\n## Reading content\n\n- `get_file_content` exports Docs as Markdown, Sheets as CSV of the\n **first sheet only**, and Slides as plain text; reads text files as text;\n and returns other files as base64 when the encoded file fits the result. Anything else — a\n larger binary, a drawing, a form, a folder, a shortcut — comes back as\n `format: \"unavailable\"` with a `note`, never as an empty success.\n- Text is capped by `maxChars`; a cut ends with a truncation marker and\n `contentTruncated: true`. Drive exports at most 10 MB.\n- Every read stays under `maxBytes` of JSON. The default is what one result\n can carry into `execute_code`, so a program always receives it. A larger\n `maxBytes` (up to 4 MiB — a binary of up to 1 MiB) reaches only a direct\n `call_tool`, which pages it with `connecta.result`.\n\n## Writing\n\n- `create_folder` and `restore_file` add without losing or exposing\n anything.\n- A new file takes its folder's sharing, not its source's: `create_file`\n and `copy_file` into a shared folder disclose that content to everyone\n the folder is shared with, so both are approved like any destructive write.\n Check the destination with `list_permissions` first. `convertTo`\n imports content as a Google Doc, Sheet, or Slides file.\n- `update_file_content` replaces the whole content; send all of it.\n `update_file` renames; `move_file` changes the folder and with it who\n inherits access.\n- `trash_file` is recoverable for 30 days with `restore_file`. There is no\n permanent delete and no ownership transfer.\n- `share_file` emails no one unless `sendNotificationEmail: true`. Check\n `list_permissions` before and after changing access, and confirm with the\n person before sharing with `anyone` or a whole domain.\n",
|
|
4
4
|
"instructionsHeading": "Connection instructions",
|
|
5
5
|
"fragments": {
|
|
6
6
|
"guide_0": "# Google Drive usage\n\nActs as the signed-in person's own Google Drive through Workspace delegation: what they can open, and nothing they cannot.\n\nConnection purpose: ",
|
|
7
|
-
"guide_1": "\n\n## Whose Drive\n\nEvery call acts as the Workspace address deployment config maps the caller\nto, and reaches exactly the files that person can open, shared drives\nincluded. No
|
|
7
|
+
"guide_1": "\n\n## Whose Drive\n\nEvery call acts as the Workspace address deployment config maps the caller\nto, and reaches exactly the files that person can open, shared drives\nincluded; an agent acts as the owner of the pool it came through, unless the deployment fixes one shared account that every caller, agent or person, acts as. No\nargument names an account. A call with none mapped fails `auth_required`; only an operator can change\nthat. A missing file\nand one this person cannot see fail alike — Google does not distinguish them.\n\n## Finding files\n\n- `search_files` takes Drive query syntax: `name contains 'x'`,\n `fullText contains 'x'`, `mimeType = '…'`, `'<folderId>' in parents`,\n `modifiedTime > '2026-01-01T00:00:00'`. Quote values with single quotes.\n Trashed files are left out unless `includeTrashed`. `incompleteSearch:\n true` means Drive gave up before searching everything; narrow the query or\n the corpus. Shared drives: `list_shared_drives`, then `corpora: \"drive\"`\n with its `driveId`.\n- Page with `page.nextCursor` and the same arguments; a cursor from another\n tool or other arguments is refused. A page can stop short of `limit` to\n stay under `maxBytes`; the cursor resumes at the first row left out, and\n fails `conflict` if that page changed meanwhile — start over then.\n- Ids come from these reads or a Drive URL (`/d/<id>/`, `/folders/<id>`);\n never guess one.\n\n## Reading content\n\n- `get_file_content` exports Docs as Markdown, Sheets as CSV of the\n **first sheet only**, and Slides as plain text; reads text files as text;\n and returns other files as base64 when the encoded file fits the result. Anything else — a\n larger binary, a drawing, a form, a folder, a shortcut — comes back as\n `format: \"unavailable\"` with a `note`, never as an empty success.\n- Text is capped by `maxChars`; a cut ends with a truncation marker and\n `contentTruncated: true`. Drive exports at most 10 MB.\n- Every read stays under `maxBytes` of JSON. The default is what one result\n can carry into `execute_code`, so a program always receives it. A larger\n `maxBytes` (up to 4 MiB — a binary of up to 1 MiB) reaches only a direct\n `call_tool`, which pages it with `connecta.result`.\n\n## Writing\n\n- `create_folder` and `restore_file` add without losing or exposing\n anything.\n- A new file takes its folder's sharing, not its source's: `create_file`\n and `copy_file` into a shared folder disclose that content to everyone\n the folder is shared with, so both are approved like any destructive write.\n Check the destination with `list_permissions` first. `convertTo`\n imports content as a Google Doc, Sheet, or Slides file.\n- `update_file_content` replaces the whole content; send all of it.\n `update_file` renames; `move_file` changes the folder and with it who\n inherits access.\n- `trash_file` is recoverable for 30 days with `restore_file`. There is no\n permanent delete and no ownership transfer.\n- `share_file` emails no one unless `sendNotificationEmail: true`. Check\n `list_permissions` before and after changing access, and confirm with the\n person before sharing with `anyone` or a whole domain.\n"
|
|
8
8
|
}
|
|
9
9
|
};
|
|
@@ -22,13 +22,13 @@ import { skill } from "./skill.generated.js";
|
|
|
22
22
|
*
|
|
23
23
|
* Drift. Google publishes a credential-free Discovery document per API.
|
|
24
24
|
* `src/providers/forms/drift.json` records the five methods the tools
|
|
25
|
-
* call, and `
|
|
25
|
+
* call, and `pnpm run providers:check --provider forms` reports a touched
|
|
26
26
|
* contract that moved or a method that stopped accepting the scopes below.
|
|
27
27
|
*/
|
|
28
28
|
import { apiConnector as api, defined } from "../../connectors/api-connector.js";
|
|
29
29
|
import { ConnectorCallError } from "../../errors.js";
|
|
30
30
|
import { clampText, jsonBytes, RESULT_BUDGET_BYTES } from "../_shared/google/result-size.js";
|
|
31
|
-
import { googleOutcomeOf, GOOGLE_WORKSPACE_OPTIONS, googleWorkspaceClient, workspaceConnection, } from "../_shared/google/workspace.js";
|
|
31
|
+
import { googleOutcomeOf, GOOGLE_WORKSPACE_OPTIONS, googleWorkspaceClient, workspaceConnection, workspaceConnector, } from "../_shared/google/workspace.js";
|
|
32
32
|
import { asProviderFactory } from "../../provider.js";
|
|
33
33
|
/**
|
|
34
34
|
* The Forms API root. Every path the tools send sits beneath `/forms`; there
|
|
@@ -1198,7 +1198,7 @@ function formsConnector(id, options) {
|
|
|
1198
1198
|
notFound: "ambiguous",
|
|
1199
1199
|
connection,
|
|
1200
1200
|
});
|
|
1201
|
-
return api(id, {
|
|
1201
|
+
return workspaceConnector(connection, api(id, {
|
|
1202
1202
|
...defined({
|
|
1203
1203
|
callAdmission: options.callAdmission,
|
|
1204
1204
|
maxResultBytes: options.maxResultBytes,
|
|
@@ -1213,5 +1213,5 @@ function formsConnector(id, options) {
|
|
|
1213
1213
|
required: true,
|
|
1214
1214
|
},
|
|
1215
1215
|
tools: tools(client),
|
|
1216
|
-
});
|
|
1216
|
+
}));
|
|
1217
1217
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Generated by scripts/generate-providers.mjs; do not edit.
|
|
2
2
|
export const skill = {
|
|
3
|
-
"content": "# Google Forms usage\n\nActs as the signed-in person in Google Forms through Workspace delegation: read and edit their forms, read responses, never submit or delete.\n\nConnection purpose: \n\n## Whose forms\n\nEvery call reaches only the forms the Workspace user deployment config maps\nthe caller to can open. No argument names a user. A call with none mapped
|
|
3
|
+
"content": "# Google Forms usage\n\nActs as the signed-in person in Google Forms through Workspace delegation: read and edit their forms, read responses, never submit or delete.\n\nConnection purpose: \n\n## Whose forms\n\nEvery call reaches only the forms the Workspace user deployment config maps\nthe caller to can open; an agent acts as the owner of the pool it came through, unless the deployment fixes one shared account that every caller, agent or person, acts as. No argument names a user. A call with none mapped fails `auth_required`; only an operator can change\nthat. A form id\nthat does not exist and one not shared with that user fail alike, as\n`connector_call_failed`: Google does not say which.\n\n## Finding forms\n\nThere is no list or search here: the Forms API has none. Find a form in\nDrive, or take its id from an edit URL (`/forms/d/<formId>/edit`). The\n`/forms/d/e/…` responder link is not the form id.\n\n## Reading\n\n- Every result stays inside KiB, so it crosses into\n `execute_code` whole. A page that would outgrow that ends early with\n `page.hasMore`; follow `page.nextCursor` rather than raising `limit`.\n- `get_form` lists items with their `questions`: one for a question,\n one per row for a grid, none for sections and media. Answers are keyed by\n those `questionId`s. A large form pages its items (`itemCount` is the\n total), and a grid too large for one page continues on the next: the item\n repeats with `questionsFrom`, the index of its first row there, and\n `moreQuestions` counts rows still to come. A cursor from a form that has\n since changed fails `conflict`.\n Long text is cut with a marker; `raw: true` returns Google's whole Form\n resource, or refuses one too large for a result.\n- `list_responses` labels each answer with its question's title, in form\n order; an answer to a since-deleted question has no title. Answers longer\n than characters end with a truncation marker; `get_response`\n reads one whole. Page with `page.nextCursor` and the same\n `submittedAfter`. To read only new responses, pass the newest\n `lastSubmittedTime` already seen as `submittedAfter`. A cursor\n continues after the last response it returned; if Google's page has\n changed since (new, deleted, or reordered responses), it fails\n `conflict` — start again, or use `submittedAfter`.\n- A response too large for one result comes back cut, with the answers left\n out named in `omittedQuestionIds`; pass them to `get_response` as\n `questionIds`.\n\n## Editing\n\n- `create_form` makes an empty form: Google takes only its title and Drive\n file name at creation. Add a description and questions afterwards.\n- `update_form_info` replaces the title or description.\n- `batch_update_form` is the escape hatch for everything else, and always\n needs approval. It takes Google's own Request objects, applied all or none,\n with the form's current `revisionId` as `requiredRevisionId`: a form\n someone changed since you read it is refused as `conflict`, so re-read it\n and rebuild the edit. Its reply carries the new `revisionId` and each created item's id.\n A reply too large to return whole comes back with `truncated: true`: the\n batch still applied; read the rest with `get_form`. An `updateItem` needs an `updateMask`; read `raw: true` first so the\n item it replaces keeps its grading, images, and navigation.\n- Publishing, sharing, deleting, and watches are not in this connection; the\n owner does those in Forms or Drive. Responses are read-only.\n",
|
|
4
4
|
"instructionsHeading": "Connection instructions",
|
|
5
5
|
"fragments": {
|
|
6
6
|
"guide_0": "# Google Forms usage\n\nActs as the signed-in person in Google Forms through Workspace delegation: read and edit their forms, read responses, never submit or delete.\n\nConnection purpose: ",
|
|
7
|
-
"guide_1": "\n\n## Whose forms\n\nEvery call reaches only the forms the Workspace user deployment config maps\nthe caller to can open. No argument names a user. A call with none mapped
|
|
7
|
+
"guide_1": "\n\n## Whose forms\n\nEvery call reaches only the forms the Workspace user deployment config maps\nthe caller to can open; an agent acts as the owner of the pool it came through, unless the deployment fixes one shared account that every caller, agent or person, acts as. No argument names a user. A call with none mapped fails `auth_required`; only an operator can change\nthat. A form id\nthat does not exist and one not shared with that user fail alike, as\n`connector_call_failed`: Google does not say which.\n\n## Finding forms\n\nThere is no list or search here: the Forms API has none. Find a form in\nDrive, or take its id from an edit URL (`/forms/d/<formId>/edit`). The\n`/forms/d/e/…` responder link is not the form id.\n\n## Reading\n\n- Every result stays inside ",
|
|
8
8
|
"guide_2": " KiB, so it crosses into\n `execute_code` whole. A page that would outgrow that ends early with\n `page.hasMore`; follow `page.nextCursor` rather than raising `limit`.\n- `get_form` lists items with their `questions`: one for a question,\n one per row for a grid, none for sections and media. Answers are keyed by\n those `questionId`s. A large form pages its items (`itemCount` is the\n total), and a grid too large for one page continues on the next: the item\n repeats with `questionsFrom`, the index of its first row there, and\n `moreQuestions` counts rows still to come. A cursor from a form that has\n since changed fails `conflict`.\n Long text is cut with a marker; `raw: true` returns Google's whole Form\n resource, or refuses one too large for a result.\n- `list_responses` labels each answer with its question's title, in form\n order; an answer to a since-deleted question has no title. Answers longer\n than ",
|
|
9
9
|
"guide_3": " characters end with a truncation marker; `get_response`\n reads one whole. Page with `page.nextCursor` and the same\n `submittedAfter`. To read only new responses, pass the newest\n `lastSubmittedTime` already seen as `submittedAfter`. A cursor\n continues after the last response it returned; if Google's page has\n changed since (new, deleted, or reordered responses), it fails\n `conflict` — start again, or use `submittedAfter`.\n- A response too large for one result comes back cut, with the answers left\n out named in `omittedQuestionIds`; pass them to `get_response` as\n `questionIds`.\n\n## Editing\n\n- `create_form` makes an empty form: Google takes only its title and Drive\n file name at creation. Add a description and questions afterwards.\n- `update_form_info` replaces the title or description.\n- `batch_update_form` is the escape hatch for everything else, and always\n needs approval. It takes Google's own Request objects, applied all or none,\n with the form's current `revisionId` as `requiredRevisionId`: a form\n someone changed since you read it is refused as `conflict`, so re-read it\n and rebuild the edit. Its reply carries the new `revisionId` and each created item's id.\n A reply too large to return whole comes back with `truncated: true`: the\n batch still applied; read the rest with `get_form`. An `updateItem` needs an `updateMask`; read `raw: true` first so the\n item it replaces keeps its grading, images, and navigation.\n- Publishing, sharing, deleting, and watches are not in this connection; the\n owner does those in Forms or Drive. Responses are read-only.\n"
|
|
10
10
|
}
|
|
@@ -21,12 +21,12 @@ import { skill } from "./skill.generated.js";
|
|
|
21
21
|
*
|
|
22
22
|
* Drift. Google publishes a credential-free Discovery document per API.
|
|
23
23
|
* `src/providers/gmail/drift.json` records the nine methods the tools
|
|
24
|
-
* call, and `
|
|
24
|
+
* call, and `pnpm run providers:check --provider gmail` reports a touched
|
|
25
25
|
* contract that moved or a method that stopped accepting the scopes below.
|
|
26
26
|
*/
|
|
27
27
|
import { apiConnector as api, defined } from "../../connectors/api-connector.js";
|
|
28
28
|
import { ConnectorCallError } from "../../errors.js";
|
|
29
|
-
import { GOOGLE_WORKSPACE_OPTIONS, googleWorkspaceClient, workspaceConnection, } from "../_shared/google/workspace.js";
|
|
29
|
+
import { GOOGLE_WORKSPACE_OPTIONS, googleWorkspaceClient, workspaceConnection, workspaceConnector, } from "../_shared/google/workspace.js";
|
|
30
30
|
import { RESULT_BUDGET_BYTES, clampText, jsonBytes } from "../_shared/google/result-size.js";
|
|
31
31
|
import { asProviderFactory } from "../../provider.js";
|
|
32
32
|
/**
|
|
@@ -204,10 +204,6 @@ function walk(root, enterAttachmentRoot = false) {
|
|
|
204
204
|
function ownBody(own) {
|
|
205
205
|
return own.find((part) => mimeOf(part) === "text/plain") ?? own.find((part) => mimeOf(part) === "text/html");
|
|
206
206
|
}
|
|
207
|
-
function bodyText(part, decoded) {
|
|
208
|
-
const body = mimeOf(part) === "text/html" ? htmlToText(decoded.text) : decoded.text;
|
|
209
|
-
return decoded.note ? `${body}\n[${decoded.note}]` : body;
|
|
210
|
-
}
|
|
211
207
|
/** Gmail stores a large body apart from the message, behind an attachment id. */
|
|
212
208
|
const MAX_STORED_BODY_BYTES = 1024 * 1024;
|
|
213
209
|
/**
|
|
@@ -245,7 +241,11 @@ async function readBody(client, ctx, messageId, payload, max) {
|
|
|
245
241
|
}
|
|
246
242
|
const decoded = data ? decodeIn(chosen, data) : { text: "" };
|
|
247
243
|
// Uncut: the caller caps it, by characters and by the result's bytes.
|
|
248
|
-
return {
|
|
244
|
+
return {
|
|
245
|
+
text: format === "html" ? htmlToText(decoded.text) : decoded.text,
|
|
246
|
+
bodyFormat: format,
|
|
247
|
+
...(decoded.note ? { bodyNote: decoded.note } : {}),
|
|
248
|
+
};
|
|
249
249
|
}
|
|
250
250
|
/**
|
|
251
251
|
* Gmail's ids are short opaque tokens — message and thread ids are sixteen
|
|
@@ -530,6 +530,7 @@ async function projectMessage(client, ctx, value, maxBodyChars, budget = RESULT_
|
|
|
530
530
|
body: "",
|
|
531
531
|
bodyTruncated: false,
|
|
532
532
|
bodyFormat: read.bodyFormat,
|
|
533
|
+
bodyNote: read.bodyNote,
|
|
533
534
|
attachments: attachments.listed.length > 0 ? attachments.listed : undefined,
|
|
534
535
|
attachmentsOmitted: attachments.omitted > 0 ? attachments.omitted : undefined,
|
|
535
536
|
omittedIds,
|
|
@@ -1089,6 +1090,7 @@ const MESSAGE_PROPERTIES = {
|
|
|
1089
1090
|
body: { type: "string" },
|
|
1090
1091
|
bodyTruncated: { type: "boolean" },
|
|
1091
1092
|
bodyFormat: { type: "string", enum: ["text", "html", "none", "unavailable"] },
|
|
1093
|
+
bodyNote: { type: "string", description: "Decoding notice, preserved when the body is truncated." },
|
|
1092
1094
|
attachments: { type: "array", items: ATTACHMENT_SCHEMA },
|
|
1093
1095
|
attachmentsOmitted: { type: "integer" },
|
|
1094
1096
|
};
|
|
@@ -1662,7 +1664,7 @@ function gmailConnector(id, options) {
|
|
|
1662
1664
|
notFound: "absent",
|
|
1663
1665
|
connection,
|
|
1664
1666
|
});
|
|
1665
|
-
return api(id, {
|
|
1667
|
+
return workspaceConnector(connection, api(id, {
|
|
1666
1668
|
...defined({
|
|
1667
1669
|
callAdmission: options.callAdmission,
|
|
1668
1670
|
maxResultBytes: options.maxResultBytes,
|
|
@@ -1683,5 +1685,5 @@ function gmailConnector(id, options) {
|
|
|
1683
1685
|
? args["maxBytes"]
|
|
1684
1686
|
: RESULT_BUDGET_BYTES),
|
|
1685
1687
|
})),
|
|
1686
|
-
});
|
|
1688
|
+
}));
|
|
1687
1689
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Generated by scripts/generate-providers.mjs; do not edit.
|
|
2
2
|
export const skill = {
|
|
3
|
-
"content": "# Gmail usage (draft-only)\n\nActs as the signed-in person's own Gmail through Workspace delegation: read mail and write drafts, never send.\n\nConnection purpose: \n\n## Whose mailbox\n\nEvery call reads and writes the mailbox deployment config maps the caller\nto. No argument
|
|
3
|
+
"content": "# Gmail usage (draft-only)\n\nActs as the signed-in person's own Gmail through Workspace delegation: read mail and write drafts, never send.\n\nConnection purpose: \n\n## Whose mailbox\n\nEvery call reads and writes the mailbox deployment config maps the caller\nto; an agent acts as the owner of the pool it came through, unless the deployment fixes one shared mailbox that every caller, agent or person, acts as. No argument\nnames a mailbox. A call with none mapped fails `auth_required`; only an operator can change\nthat.\n\n## Reading\n\n- `search_threads` takes Gmail search syntax; reuse the person's own\n phrasing (`from:`, `subject:`, `newer_than:7d`, `is:unread`,\n `label:`). Page with `page.nextCursor` and the same query.\n- `get_thread` returns messages oldest first with bodies capped by\n `maxBodyChars`; a cut body ends with a truncation marker. A long thread\n pages: follow `page.nextCursor` until `hasMore` is false, with the same\n arguments. `conflict` means the thread changed under the cursor; read it\n again from the start. Reduce inside\n `execute_code` before returning a long thread.\n- Results default to at most 192 KiB; `list_labels` pages the same way.\n- `get_message` and `get_thread` list attachment metadata. An attached or\n forwarded email is an attachment, not the body.\n- `bodyFormat: \"unavailable\"` means Gmail stored the body apart from the\n message and it is too large to read here; say so rather than summarizing.\n- `get_message`, each `get_thread` message, and `get_draft` return `bodyNote`\n when decoding falls back to UTF-8 for an unsupported charset. The note\n survives character and result-byte truncation, including `maxBodyChars: 0`\n when inline body data is decoded. It counts toward the result's byte limit.\n\n## Attachments\n\n- `get_attachment` takes `messageId` and the listing's immutable `partId`.\n Prefer `partId`, which stays stable across message reads, including an\n empty id for a root attachment. `attachmentId` is an alternative that\n Gmail can rotate between reads. When both are supplied, `partId` wins and\n the fresh message's download id is used. Read the listing again after\n an unknown-id refusal; never store an attachmentId for later use.\n- Small attachments can have inline data and no attachmentId. Use their\n partId too. Only carried attachment parts can be read, never arbitrary\n message body parts or blind download ids.\n- Text, JSON, XML, calendar invites, CSV, and `message/rfc822` return\n `format: \"text\"` and `content` decoded in the declared charset. An unsupported\n charset produces an explicit `note` that decoding used UTF-8. Message bodies\n return the notice separately as `bodyNote`.\n Parsed forwarded emails render From, To, Date, Subject, and their own\n plain body, else HTML converted to text. Raw forwarded data is preferred\n when present. A forwarded email without readable text returns an\n `unavailable` note.\n `maxChars` defaults to 12,000 code points, at most 100,000. A character\n or byte cut ends with a truncation marker and `contentTruncated: true`.\n Reduce attachment text inside `execute_code` before returning it.\n- Binary attachments return `format: \"base64\"` and standard base64 in\n `content`. Pass it unchanged to Drive `create_file` as `contentBase64`,\n with `name: filename` and `mimeType`. File creation is a write: use\n `call_destructive_tool` or a program on a writable endpoint for that step.\n- Downloads, text and binary, are limited to 1 MiB. Declared size is\n checked before a separate download. Parsed forwarded emails check the sum\n of descendant sizes before downloading any stored body, and return that\n sum as `size`. Attachment data must match both the message part's declared\n size and the download response's size when supplied; inconsistent payloads\n fail rather than return incomplete files. Binary content must also fit the\n whole-result `maxBytes`, which defaults to 192 KiB. `format: \"unavailable\"`\n returns a note and no content when it cannot fit. Raising `maxChars`\n or `maxBytes` cannot bypass the download cap.\n- Raise `maxBytes` only for a direct `call_tool` read, from 64 KiB up to\n 4 MiB, as with Drive `get_file_content`. `execute_code` cannot receive\n large results; keep the default there. Direct-call results may be paged.\n\n## Drafting\n\n- `create_draft` saves a draft and never sends it; tell the person it is\n waiting in Drafts. There is no send, delete, or label tool.\n- To reply, pass `replyToMessageId`: the draft joins that thread with\n In-Reply-To and References set, and subject (Re: …) and `to` default\n from that message's Reply-To, else its From. Keep the Re: subject or Gmail\n may start a new thread.\n- `update_draft` replaces the body entirely; send the full new text.\n From, To, Cc, Bcc, Reply-To, Subject, the thread, and reply headers are\n kept unless restated; no other header is. A draft with attachments or\n inline images is refused, unchanged — Gmail's update would delete them.\n- Gmail sets From to the mailbox itself; there is no From argument.\n",
|
|
4
4
|
"instructionsHeading": "Connection instructions",
|
|
5
5
|
"fragments": {
|
|
6
6
|
"guide_0": "# Gmail usage (draft-only)\n\nActs as the signed-in person's own Gmail through Workspace delegation: read mail and write drafts, never send.\n\nConnection purpose: ",
|
|
7
|
-
"guide_1": "\n\n## Whose mailbox\n\nEvery call reads and writes the mailbox deployment config maps the caller\nto. No argument
|
|
7
|
+
"guide_1": "\n\n## Whose mailbox\n\nEvery call reads and writes the mailbox deployment config maps the caller\nto; an agent acts as the owner of the pool it came through, unless the deployment fixes one shared mailbox that every caller, agent or person, acts as. No argument\nnames a mailbox. A call with none mapped fails `auth_required`; only an operator can change\nthat.\n\n## Reading\n\n- `search_threads` takes Gmail search syntax; reuse the person's own\n phrasing (`from:`, `subject:`, `newer_than:7d`, `is:unread`,\n `label:`). Page with `page.nextCursor` and the same query.\n- `get_thread` returns messages oldest first with bodies capped by\n `maxBodyChars`; a cut body ends with a truncation marker. A long thread\n pages: follow `page.nextCursor` until `hasMore` is false, with the same\n arguments. `conflict` means the thread changed under the cursor; read it\n again from the start. Reduce inside\n `execute_code` before returning a long thread.\n- Results default to at most 192 KiB; `list_labels` pages the same way.\n- `get_message` and `get_thread` list attachment metadata. An attached or\n forwarded email is an attachment, not the body.\n- `bodyFormat: \"unavailable\"` means Gmail stored the body apart from the\n message and it is too large to read here; say so rather than summarizing.\n- `get_message`, each `get_thread` message, and `get_draft` return `bodyNote`\n when decoding falls back to UTF-8 for an unsupported charset. The note\n survives character and result-byte truncation, including `maxBodyChars: 0`\n when inline body data is decoded. It counts toward the result's byte limit.\n\n## Attachments\n\n- `get_attachment` takes `messageId` and the listing's immutable `partId`.\n Prefer `partId`, which stays stable across message reads, including an\n empty id for a root attachment. `attachmentId` is an alternative that\n Gmail can rotate between reads. When both are supplied, `partId` wins and\n the fresh message's download id is used. Read the listing again after\n an unknown-id refusal; never store an attachmentId for later use.\n- Small attachments can have inline data and no attachmentId. Use their\n partId too. Only carried attachment parts can be read, never arbitrary\n message body parts or blind download ids.\n- Text, JSON, XML, calendar invites, CSV, and `message/rfc822` return\n `format: \"text\"` and `content` decoded in the declared charset. An unsupported\n charset produces an explicit `note` that decoding used UTF-8. Message bodies\n return the notice separately as `bodyNote`.\n Parsed forwarded emails render From, To, Date, Subject, and their own\n plain body, else HTML converted to text. Raw forwarded data is preferred\n when present. A forwarded email without readable text returns an\n `unavailable` note.\n `maxChars` defaults to 12,000 code points, at most 100,000. A character\n or byte cut ends with a truncation marker and `contentTruncated: true`.\n Reduce attachment text inside `execute_code` before returning it.\n- Binary attachments return `format: \"base64\"` and standard base64 in\n `content`. Pass it unchanged to Drive `create_file` as `contentBase64`,\n with `name: filename` and `mimeType`. File creation is a write: use\n `call_destructive_tool` or a program on a writable endpoint for that step.\n- Downloads, text and binary, are limited to 1 MiB. Declared size is\n checked before a separate download. Parsed forwarded emails check the sum\n of descendant sizes before downloading any stored body, and return that\n sum as `size`. Attachment data must match both the message part's declared\n size and the download response's size when supplied; inconsistent payloads\n fail rather than return incomplete files. Binary content must also fit the\n whole-result `maxBytes`, which defaults to 192 KiB. `format: \"unavailable\"`\n returns a note and no content when it cannot fit. Raising `maxChars`\n or `maxBytes` cannot bypass the download cap.\n- Raise `maxBytes` only for a direct `call_tool` read, from 64 KiB up to\n 4 MiB, as with Drive `get_file_content`. `execute_code` cannot receive\n large results; keep the default there. Direct-call results may be paged.\n\n## Drafting\n\n- `create_draft` saves a draft and never sends it; tell the person it is\n waiting in Drafts. There is no send, delete, or label tool.\n- To reply, pass `replyToMessageId`: the draft joins that thread with\n In-Reply-To and References set, and subject (Re: …) and `to` default\n from that message's Reply-To, else its From. Keep the Re: subject or Gmail\n may start a new thread.\n- `update_draft` replaces the body entirely; send the full new text.\n From, To, Cc, Bcc, Reply-To, Subject, the thread, and reply headers are\n kept unless restated; no other header is. A draft with attachments or\n inline images is refused, unchanged — Gmail's update would delete them.\n- Gmail sets From to the mailbox itself; there is no From argument.\n"
|
|
8
8
|
}
|
|
9
9
|
};
|
|
@@ -455,7 +455,7 @@ function mixpanelApi(id, options, provider) {
|
|
|
455
455
|
placeholder: "username:secret",
|
|
456
456
|
},
|
|
457
457
|
testCredential: rest.testCredential,
|
|
458
|
-
callAdmission: options.callAdmission
|
|
458
|
+
callAdmission: options.callAdmission === undefined ? MIXPANEL_API_ADMISSION : options.callAdmission,
|
|
459
459
|
usageGuide: {
|
|
460
460
|
content: `# Mixpanel API usage\n\nService-account REST, ${region} residency. Account purpose: ${options.purpose}\n\nDefault project: ${options.defaultProjectId ?? "none; supply project_id"}.${skill.fragments.api}${instructions ? `\n## ${skill.instructionsHeading}\n\n${instructions}\n` : ""}`,
|
|
461
461
|
summary: `${REGION_COPY[region]} residency, service-account REST. Raw export, user activity, profiles, reports and event import.`,
|