passport-bridge 0.48.1 → 0.49.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.
Files changed (129) hide show
  1. package/dist/cliClient.js +46 -2
  2. package/dist/cliExec.js +34 -18
  3. package/dist/cliHookAfter.js +10 -1
  4. package/dist/cliHookDecide.d.ts +9 -3
  5. package/dist/cliHookDecide.js +182 -28
  6. package/dist/cliHookSessionState.d.ts +4 -1
  7. package/dist/cliHookSessionState.js +1 -1
  8. package/dist/connectorKit/callEffects.generated.d.ts +36 -0
  9. package/dist/connectorKit/callEffects.generated.js +73 -0
  10. package/dist/connectorKit/cli.generated.js +5 -2
  11. package/dist/connectorKit/engine.generated.d.ts +1 -1
  12. package/dist/connectorKit/engine.generated.js +32 -13
  13. package/dist/connectorKit/githubDecide.generated.d.ts +2 -1
  14. package/dist/connectorKit/githubDecide.generated.js +33 -2
  15. package/dist/connectorKit/githubIds.generated.d.ts +1 -1
  16. package/dist/connectorKit/githubIds.generated.js +3 -2
  17. package/dist/connectorKit/manifest.generated.d.ts +34 -14
  18. package/dist/connectorKit/manifests/cloudflare.generated.d.ts +2 -0
  19. package/dist/connectorKit/manifests/cloudflare.generated.js +186 -0
  20. package/dist/connectorKit/manifests/cloudflareApi.generated.d.ts +4 -0
  21. package/dist/connectorKit/manifests/cloudflareApi.generated.js +207 -0
  22. package/dist/connectorKit/manifests/cloudflareCatalog.generated.d.ts +18 -0
  23. package/dist/connectorKit/manifests/cloudflareCatalog.generated.js +83 -0
  24. package/dist/connectorKit/manifests/cloudflareCli.generated.d.ts +2 -0
  25. package/dist/connectorKit/manifests/cloudflareCli.generated.js +441 -0
  26. package/dist/connectorKit/manifests/githubCapture.generated.js +19 -1
  27. package/dist/connectorKit/manifests/githubHooks.generated.js +2 -2
  28. package/dist/connectorKit/manifests/githubReads.generated.js +0 -3
  29. package/dist/connectorKit/manifests/kubernetes.generated.d.ts +76 -0
  30. package/dist/connectorKit/manifests/kubernetes.generated.js +210 -0
  31. package/dist/connectorKit/manifests/kubernetesArgs.generated.d.ts +21 -0
  32. package/dist/connectorKit/manifests/kubernetesArgs.generated.js +82 -0
  33. package/dist/connectorKit/manifests/kubernetesCli.generated.d.ts +30 -0
  34. package/dist/connectorKit/manifests/kubernetesCli.generated.js +530 -0
  35. package/dist/connectorKit/manifests/kubernetesEffects.generated.d.ts +15 -0
  36. package/dist/connectorKit/manifests/kubernetesEffects.generated.js +111 -0
  37. package/dist/connectorKit/manifests/kubernetesObjects.generated.d.ts +24 -0
  38. package/dist/connectorKit/manifests/kubernetesObjects.generated.js +154 -0
  39. package/dist/connectorKit/manifests/railwayHooks.generated.js +11 -5
  40. package/dist/connectorKit/manifests/sentry.generated.d.ts +6 -0
  41. package/dist/connectorKit/manifests/sentry.generated.js +27 -0
  42. package/dist/connectorKit/manifests/sentryApi.generated.d.ts +6 -0
  43. package/dist/connectorKit/manifests/sentryApi.generated.js +282 -0
  44. package/dist/connectorKit/manifests/sentryCapture.generated.d.ts +2 -0
  45. package/dist/connectorKit/manifests/sentryCapture.generated.js +165 -0
  46. package/dist/connectorKit/manifests/sentryCatalog.generated.d.ts +5 -0
  47. package/dist/connectorKit/manifests/sentryCatalog.generated.js +70 -0
  48. package/dist/connectorKit/manifests/sentryCli.generated.d.ts +2 -0
  49. package/dist/connectorKit/manifests/sentryCli.generated.js +230 -0
  50. package/dist/connectorKit/manifests/sentryIssues.generated.d.ts +20 -0
  51. package/dist/connectorKit/manifests/sentryIssues.generated.js +204 -0
  52. package/dist/connectorKit/manifests/supabase.generated.js +3 -2
  53. package/dist/connectorKit/manifests/supabaseApi.generated.js +52 -52
  54. package/dist/connectorKit/manifests/supabaseCapture.generated.js +22 -21
  55. package/dist/connectorKit/manifests/supabaseCatalog.generated.d.ts +2 -2
  56. package/dist/connectorKit/manifests/supabaseCatalog.generated.js +8 -7
  57. package/dist/connectorKit/manifests/supabaseCli.generated.js +32 -32
  58. package/dist/connectorKit/manifests/supabaseProbes.generated.js +29 -29
  59. package/dist/connectorKit/manifests/terraform.generated.d.ts +5 -0
  60. package/dist/connectorKit/manifests/terraform.generated.js +214 -0
  61. package/dist/connectorKit/manifests/terraformLink.generated.d.ts +30 -0
  62. package/dist/connectorKit/manifests/terraformLink.generated.js +73 -0
  63. package/dist/connectorKit/manifests/terraformPlan.generated.d.ts +48 -0
  64. package/dist/connectorKit/manifests/terraformPlan.generated.js +192 -0
  65. package/dist/connectorKit/params.generated.js +2 -0
  66. package/dist/connectorKit/shell.generated.d.ts +5 -1
  67. package/dist/connectorKit/shell.generated.js +121 -20
  68. package/dist/connectorKit/sources/cloudflare/api-operations.generated.d.ts +37 -0
  69. package/dist/connectorKit/sources/cloudflare/api-operations.generated.js +2 -0
  70. package/dist/connectorKit/sources/cloudflare/cli-flags.generated.d.ts +617 -0
  71. package/dist/connectorKit/sources/cloudflare/cli-flags.generated.js +2 -0
  72. package/dist/connectorKit/sources/cloudflare/mcp-tools.generated.d.ts +16 -0
  73. package/dist/connectorKit/sources/cloudflare/mcp-tools.generated.js +2 -0
  74. package/dist/connectorKit/sources/github/actions.generated.d.ts +0 -1
  75. package/dist/connectorKit/sources/github/actions.generated.js +1 -1
  76. package/dist/connectorKit/sources/sentry/api-operations.generated.d.ts +121 -0
  77. package/dist/connectorKit/sources/sentry/api-operations.generated.js +2 -0
  78. package/dist/connectorKit/sources/sentry/cli-commands.generated.d.ts +530 -0
  79. package/dist/connectorKit/sources/sentry/cli-commands.generated.js +2 -0
  80. package/dist/connectorKit/sources/sentry/mcp-tools.generated.d.ts +32 -0
  81. package/dist/connectorKit/sources/sentry/mcp-tools.generated.js +2 -0
  82. package/dist/connectorKit/template.generated.d.ts +8 -4
  83. package/dist/connectorKit/template.generated.js +19 -6
  84. package/dist/controlPlane.generated.d.ts +13 -2
  85. package/dist/controlPlaneActions.generated.d.ts +68 -13
  86. package/dist/controlPlaneActions.generated.js +68 -17
  87. package/dist/controlPlaneCloudflare.d.ts +70 -0
  88. package/dist/controlPlaneCloudflare.js +188 -0
  89. package/dist/controlPlaneExec.d.ts +4 -0
  90. package/dist/controlPlaneExec.js +30 -0
  91. package/dist/controlPlaneGuard.d.ts +8 -2
  92. package/dist/controlPlaneGuard.js +38 -30
  93. package/dist/controlPlaneKubernetes.d.ts +72 -0
  94. package/dist/controlPlaneKubernetes.js +260 -0
  95. package/dist/controlPlaneModel.generated.d.ts +6 -0
  96. package/dist/controlPlaneNpm.generated.d.ts +83 -0
  97. package/dist/controlPlaneNpm.generated.js +307 -0
  98. package/dist/controlPlaneNpmCommands.generated.d.ts +35 -0
  99. package/dist/controlPlaneNpmCommands.generated.js +567 -0
  100. package/dist/controlPlaneNpmGuard.d.ts +44 -0
  101. package/dist/controlPlaneNpmGuard.js +210 -0
  102. package/dist/controlPlaneOffline.d.ts +1 -1
  103. package/dist/controlPlaneRailway.generated.js +3 -3
  104. package/dist/controlPlaneRailwayCli.generated.d.ts +1 -1
  105. package/dist/controlPlaneRailwayCli.generated.js +28 -9
  106. package/dist/controlPlaneRailwayGuard.d.ts +2 -0
  107. package/dist/controlPlaneRailwayGuard.js +5 -1
  108. package/dist/controlPlaneRailwayModel.generated.d.ts +5 -0
  109. package/dist/controlPlaneRailwayModel.generated.js +15 -1
  110. package/dist/controlPlaneSentry.d.ts +68 -0
  111. package/dist/controlPlaneSentry.js +205 -0
  112. package/dist/controlPlaneSupabase.d.ts +1 -0
  113. package/dist/controlPlaneSupabase.js +17 -5
  114. package/dist/controlPlaneTerraform.d.ts +86 -0
  115. package/dist/controlPlaneTerraform.js +273 -0
  116. package/dist/controlPlaneUnnamed.generated.d.ts +52 -2
  117. package/dist/controlPlaneUnnamed.generated.js +339 -1
  118. package/dist/cpCli.d.ts +1 -1
  119. package/dist/cpCli.js +1 -1
  120. package/dist/execGithubRepo.d.ts +8 -1
  121. package/dist/execGithubRepo.js +61 -13
  122. package/dist/pluginPin.d.ts +1 -1
  123. package/dist/pluginPin.js +1 -1
  124. package/dist/terraformPlans.d.ts +45 -0
  125. package/dist/terraformPlans.js +96 -0
  126. package/dist/version.d.ts +1 -1
  127. package/dist/version.js +1 -1
  128. package/npm-shrinkwrap.json +2 -2
  129. package/package.json +2 -2
@@ -80,9 +80,12 @@ function parseArgs(words, specs, strict, framework) {
80
80
  out.positional.push(...words.slice(i + 1));
81
81
  break;
82
82
  }
83
- if (word.startsWith("--")) {
83
+ // Go's flag package: one dash or two, never letters grouped (`-auto-approve`, `--out=plan`).
84
+ const go = framework === "go" && word.startsWith("-") && word.length > 1 && word !== "-";
85
+ if (word.startsWith("--") || go) {
86
+ const dashes = word.startsWith("--") ? 2 : 1;
84
87
  const eq = word.indexOf("=");
85
- const name = eq < 0 ? word.slice(2) : word.slice(2, eq);
88
+ const name = eq < 0 ? word.slice(dashes) : word.slice(dashes, eq);
86
89
  const spec = long.get(name);
87
90
  if (!spec) {
88
91
  if (strict)
@@ -18,7 +18,7 @@
18
18
  import { type Classification, type DiscoveredNode } from "../controlPlane.generated.js";
19
19
  import { type Manifest } from "./manifest.generated.js";
20
20
  import type { ClassifyContext, ConnectorHooks, Normalized, Request } from "./types.generated.js";
21
- export { at, fill, parseTemplate, placeholders, render, safeName } from "./template.generated.js";
21
+ export { at, fill, parseTemplate, placeholders, render, safeName, valuePlaceholders } from "./template.generated.js";
22
22
  export type * from "./types.generated.js";
23
23
  export declare function normalize(m: Manifest, request: Request): Normalized | null;
24
24
  export type Chain = {
@@ -17,13 +17,13 @@
17
17
  * or SQL the parser shows only reads returns null.
18
18
  */
19
19
  import { nodeId } from "../controlPlane.generated.js";
20
- import { unnamedApi, unnamedCli } from "../controlPlaneUnnamed.generated.js";
20
+ import { knowsCommandWords, unnamedApi, unnamedCli, unnamedMcp, unnamedSummary } from "../controlPlaneUnnamed.generated.js";
21
21
  import { knownOps, normalizeCli } from "./cli.generated.js";
22
22
  import { MANIFEST_SCHEMA } from "./manifest.generated.js";
23
23
  import { canonical, holds } from "./params.generated.js";
24
24
  import { classifySql, SQL_LABEL } from "./sql.generated.js";
25
- import { fill, placeholders, render, safeName } from "./template.generated.js";
26
- export { at, fill, parseTemplate, placeholders, render, safeName } from "./template.generated.js";
25
+ import { fill, render, safeName, valuePlaceholders } from "./template.generated.js";
26
+ export { at, fill, parseTemplate, placeholders, render, safeName, valuePlaceholders } from "./template.generated.js";
27
27
  /* ------------------------------------------------------------------ */
28
28
  /* Normalize */
29
29
  /* ------------------------------------------------------------------ */
@@ -85,12 +85,19 @@ function normalizeApi(m, method, url, body) {
85
85
  const path = parsed.pathname.replace(/\/{2,}/g, "/").replace(/(.)\/+$/, "$1");
86
86
  const verb = method.toUpperCase();
87
87
  const query = {};
88
+ const lists = new Set(m.capture.api.lists ?? []);
88
89
  let duplicate = false;
89
90
  parsed.searchParams.forEach((value, key) => {
91
+ const held = query[key];
92
+ // A key the vendor documents as repeatable (Sentry's `?id=1&id=2`) is a list.
93
+ if (lists.has(key))
94
+ query[key] = typeof held === "string" ? [held, value] : Array.isArray(held) ? [...held, value] : value;
90
95
  // The same key twice with different values: servers disagree on which wins, so neither can be trusted.
91
- if (query[key] !== undefined && query[key] !== value)
92
- duplicate = true;
93
- query[key] = value;
96
+ else {
97
+ if (held !== undefined && held !== value)
98
+ duplicate = true;
99
+ query[key] = value;
100
+ }
94
101
  });
95
102
  const { routes, byLength } = routesOf(m);
96
103
  const match = (route, whole) => {
@@ -147,7 +154,7 @@ function normalizeApi(m, method, url, body) {
147
154
  .split("/")
148
155
  .filter(Boolean)
149
156
  .slice(known ? known.split("/").filter(Boolean).length : 0);
150
- const route = `${known ?? ""}/${rest.map((part) => (/^[a-z][a-z_-]{0,40}$/.test(part) ? part : "…")).join("/")}`;
157
+ const route = `${(known ?? "").replace(/\/+$/, "")}/${rest.map((part) => (/^[a-z][a-z_-]{0,40}$/.test(part) ? part : "…")).join("/")}`;
151
158
  return {
152
159
  iface: "api",
153
160
  op: `${verb} ${path}`,
@@ -281,7 +288,7 @@ function listWhereOne(m, part, params, each) {
281
288
  ...(part.summaryElse ?? [])
282
289
  ].filter((t) => typeof t === "string");
283
290
  return templates
284
- .flatMap(placeholders)
291
+ .flatMap(valuePlaceholders)
285
292
  .some((name) => name !== each && Array.isArray(params[name]) && params[name].length > 1);
286
293
  }
287
294
  function buildSql(m, part, p, at, out) {
@@ -296,10 +303,11 @@ function buildSql(m, part, p, at, out) {
296
303
  if (seen.has(`${actionKey} ${finding.category} ${finding.table ?? ""}`))
297
304
  continue;
298
305
  seen.add(`${actionKey} ${finding.category} ${finding.table ?? ""}`);
299
- const label = actionKey === m.capture.unclassified
306
+ const label = actionKey === m.capture.unclassified || actionKey === m.capture.other
300
307
  ? SQL_LABEL[finding.category]
301
308
  : m.actions.find((a) => a.key === actionKey).label;
302
- const t = finding.table ? { type: "table", key: finding.table, name: finding.table } : undefined;
309
+ const table = m.capture.sqlDialect === "sqlite" ? finding.table?.replace(/^public\./, "") : finding.table;
310
+ const t = table ? { type: "table", key: table, name: table } : undefined;
303
311
  const where = part.summary ? summaryOf(part, part.summary, p) : "";
304
312
  out.push({
305
313
  nodeId: at.nodeId,
@@ -342,21 +350,27 @@ function summaryOf(part, summary, p) {
342
350
  return fill(all, p) ?? render(all[all.length - 1], p);
343
351
  }
344
352
  /** What an unnamed request hit, coarse (`controlPlaneUnnamed.ts`): an API call's method and path template, a command
345
- * line's program and the words the CLI itself uses, up to the first it doesn't. Nothing for an MCP tool. */
353
+ * line's program and the words the CLI itself uses, up to the first it doesn't, an MCP tool's name. */
346
354
  function unnamedOf(m, n, ops) {
355
+ if (n.iface === "mcp")
356
+ return unnamedMcp(n.op);
347
357
  if (n.iface === "api") {
348
358
  const [method, path] = n.op.split(" ");
349
359
  return unnamedApi(m.platform, method, path ?? "");
350
360
  }
351
361
  if (n.iface !== "cli")
352
362
  return undefined;
363
+ const program = m.capture.cli.programs[0] ?? m.platform;
364
+ // A CLI whose own words Passport knows keeps them even where the manifest names no command (`wrangler containers`).
365
+ if (knowsCommandWords(program))
366
+ return unnamedCli([program, ...n.op.split(" ")]);
353
367
  const words = [];
354
368
  for (const [i, part] of n.op.split(" ").entries()) {
355
369
  if (!ops.some((op) => op.split(" ")[i] === part))
356
370
  break;
357
371
  words.push(part);
358
372
  }
359
- return unnamedCli([m.capture.cli.programs[0] ?? m.platform, ...words]);
373
+ return unnamedCli([program, ...words]);
360
374
  }
361
375
  /** What a request that fails closed becomes: the Unclassified Action, on the most specific node it names. */
362
376
  function unclassified(m, n, params, context, hooks, problem = n.problem) {
@@ -380,7 +394,12 @@ function unclassified(m, n, params, context, hooks, problem = n.problem) {
380
394
  ? nodeId(m.platform, m.types.find((t) => t.type === action.appliesTo)?.service ?? m.services[0].key)
381
395
  : at.nodeId,
382
396
  actionKey: m.capture.unclassified,
383
- summary: `${action.label}: ${what}${problem ? ` (${safeName(problem) ?? "invalid flags"})` : ""}`,
397
+ summary: `${m.capture.unnamedSummary === "words"
398
+ ? unnamedSummary(m.label, unnamed, {
399
+ program: m.capture.cli.programs[0] ?? m.platform,
400
+ ...(n.iface === "mcp" ? { tool: safeName(n.op) ?? "…" } : {})
401
+ })
402
+ : `${action.label}: ${what}`}${problem ? ` (${safeName(problem) ?? "invalid flags"})` : ""}`,
384
403
  nodes: at.unresolved ? [] : at.chain,
385
404
  ...(unnamed ? { unnamed } : {})
386
405
  };
@@ -47,7 +47,8 @@ export declare const lastValue: (parsed: Parsed, ...names: string[]) => string |
47
47
  export declare const hasFlag: (parsed: Parsed, ...names: string[]) => boolean;
48
48
  /**
49
49
  * How `gh api` is read when only its method matters: GET or HEAD (no method, or one of those, and with no method no
50
- * fields, as gh then sends a POST) is a read; any other method, or a body from `--input`, is a write.
50
+ * fields, as gh then sends a POST), or a GraphQL read query (`POST graphql` with no `mutation` and no body file), is
51
+ * a read; any other method, or a body from `--input`, is a write.
51
52
  */
52
53
  export declare function ghApiMethod(parsed: Parsed): {
53
54
  method: string;
@@ -233,16 +233,47 @@ export function parseArgs(args, valueFlags) {
233
233
  export const values = (parsed, ...names) => parsed.opts.flatMap(([name, value]) => (names.includes(name) && value !== true ? [value] : []));
234
234
  export const lastValue = (parsed, ...names) => values(parsed, ...names).pop();
235
235
  export const hasFlag = (parsed, ...names) => parsed.opts.some(([name]) => names.includes(name));
236
+ /**
237
+ * Whether a `gh api` call is a GraphQL query (read): endpoint is `graphql`, method is POST, no `--input` body file,
238
+ * and at least one readable `query=` field with no GraphQL `mutation` outside comments and string literals (and no
239
+ * `-F query=@file`, whose body lives on disk).
240
+ */
241
+ const GRAPHQL_STRIP = /"""(?:\\(?:"""|[\s\S])|"(?!"")|[^"\\])*"""|"(?:[^"\\]|\\[\s\S])*"|#[^\n]*/g;
242
+ function isGraphqlRead(parsed, method, input) {
243
+ if (input || method !== "POST")
244
+ return false;
245
+ const endpoint = parsed.pos[1];
246
+ if (!endpoint || apiSegments(endpoint).join("/") !== "graphql")
247
+ return false;
248
+ let queries = 0;
249
+ for (const [flag, val] of parsed.opts) {
250
+ if (val === true)
251
+ continue;
252
+ if (flag !== "-f" && flag !== "--raw-field" && flag !== "-F" && flag !== "--field")
253
+ continue;
254
+ if (!val.startsWith("query="))
255
+ continue;
256
+ const query = val.slice("query=".length);
257
+ if (!query.trim() || ((flag === "-F" || flag === "--field") && query.startsWith("@")))
258
+ return false;
259
+ if (/\bmutation\b/.test(query.replace(GRAPHQL_STRIP, " ")))
260
+ return false;
261
+ queries += 1;
262
+ }
263
+ return queries > 0;
264
+ }
236
265
  /**
237
266
  * How `gh api` is read when only its method matters: GET or HEAD (no method, or one of those, and with no method no
238
- * fields, as gh then sends a POST) is a read; any other method, or a body from `--input`, is a write.
267
+ * fields, as gh then sends a POST), or a GraphQL read query (`POST graphql` with no `mutation` and no body file), is
268
+ * a read; any other method, or a body from `--input`, is a write.
239
269
  */
240
270
  export function ghApiMethod(parsed) {
241
271
  const explicit = lastValue(parsed, "-X", "--method")?.toUpperCase();
242
272
  const fields = hasFlag(parsed, "-f", "--raw-field", "-F", "--field");
243
273
  const input = hasFlag(parsed, "--input");
244
274
  const method = explicit ?? (fields || input ? "POST" : "GET");
245
- return { method, read: (method === "GET" || method === "HEAD") && !input };
275
+ const read = ((method === "GET" || method === "HEAD") && !input) || isGraphqlRead(parsed, method, input);
276
+ return { method, read };
246
277
  }
247
278
  /** A REST path's segments, decoded, without the host, query or fragment. */
248
279
  export function apiSegments(path) {
@@ -1,6 +1,6 @@
1
1
  /** GitHub node ids, branch matching, and the builders the webhook mapping writes summaries with (`manifests/githubEvents.ts`). Requests are classified by the kit (`githubDecide.ts`). */
2
2
  import type { Effect } from "../controlPlaneActions.generated.js";
3
- import type { UnnamedHit } from "../controlPlaneUnnamed.generated.js";
3
+ import { type UnnamedHit } from "../controlPlaneUnnamed.generated.js";
4
4
  export declare const lower: (value: string) => string;
5
5
  export declare const githubNodeIds: {
6
6
  platform: string;
@@ -1,6 +1,7 @@
1
1
  // Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
2
2
  /** GitHub node ids, branch matching, and the builders the webhook mapping writes summaries with (`manifests/githubEvents.ts`). Requests are classified by the kit (`githubDecide.ts`). */
3
3
  import { nodeId } from "../controlPlane.generated.js";
4
+ import { unnamedSummary } from "../controlPlaneUnnamed.generated.js";
4
5
  /* ------------------------------------------------------------------ */
5
6
  /* Node ids */
6
7
  /* ------------------------------------------------------------------ */
@@ -132,12 +133,12 @@ export const unclassifiedGh = (r, unnamed) => ({
132
133
  ? {
133
134
  nodeId: repoNode(r.owner, r.repo),
134
135
  actionKey: "github.unclassified",
135
- summary: `Run a gh command Passport can't name in ${slug(r)}`
136
+ summary: unnamedSummary("GitHub", undefined, { program: "gh", where: slug(r) })
136
137
  }
137
138
  : {
138
139
  nodeId: githubNodeIds.repos,
139
140
  actionKey: "github.unclassified",
140
- summary: "Run a gh command Passport can't name"
141
+ summary: unnamedSummary("GitHub", undefined, { program: "gh" })
141
142
  }),
142
143
  ...(unnamed ? { unnamed } : {})
143
144
  });
@@ -39,13 +39,16 @@ export type NodeSpec = {
39
39
  } | "service";
40
40
  };
41
41
  /** Param conditions: true = present and truthy, false = absent or falsy, a string or list = equals one of,
42
- * { match } = a string value matching the regex, { present } = the field is sent at all (even as null).
42
+ * { match } = a string value matching the regex, { present } = the field is sent at all (even as null),
43
+ * { many } = the param holds several values (a bulk call's list of ids) or not.
43
44
  * Under the name "*": { keys } = the body (API) or arguments (MCP) send a top-level field whose name matches
44
45
  * the regex (Supabase's auth config: a provider field among 200 settings). */
45
46
  export type When = Readonly<Record<string, boolean | string | readonly string[] | {
46
47
  match: string;
47
48
  } | {
48
49
  present: boolean;
50
+ } | {
51
+ many: boolean;
49
52
  } | {
50
53
  keys: string;
51
54
  }>>;
@@ -115,12 +118,26 @@ export type FlagSpec = {
115
118
  * or "none": not decided at all, for a platform whose lists don't yet cover its vendor's sources (GitHub's `gh`
116
119
  * commands and REST routes until its generated catalog). A known one with a bad flag or field still fails closed. */
117
120
  export type UnknownOp = "unclassified" | "none";
121
+ /** A folder's link file. "text": the file is the value of `param`. "json": `fields` maps the file's top-level keys to
122
+ * params ("jsonc" also allows comments and trailing commas). "toml": the same, from the file's top-level `key = "value"`
123
+ * lines before its first table (Wrangler's `name`, `account_id`). "ini": `fields` maps "section.key" to params (Sentry's
124
+ * `.sentryclirc`, `[defaults] org = acme`). */
125
+ export type LinkSpec = {
126
+ file: string;
127
+ format: "text";
128
+ param: string;
129
+ } | {
130
+ file: string;
131
+ format: "json" | "jsonc" | "toml" | "ini";
132
+ fields: Readonly<Record<string, string>>;
133
+ };
118
134
  export type CliSpec = {
119
135
  programs: readonly string[];
120
136
  unknown?: UnknownOp;
121
137
  /** How the CLI parses flags. cobra: booleans take =1/t/T/true/TRUE/True or =0/f/F/false/FALSE/False.
122
- * arg (Vercel's parser): a boolean takes no value at all; `--flag=x` on a boolean is an error. */
123
- framework: "cobra" | "arg";
138
+ * arg (Vercel's parser): a boolean takes no value at all; `--flag=x` on a boolean is an error.
139
+ * go (Go's flag package, Terraform): one dash or two, no grouped letters; booleans take =true or =false. */
140
+ framework: "cobra" | "arg" | "go";
124
141
  /** Other spellings of commands ("env rm" → "env remove", "ls" → "list"), from the vendor's spec. */
125
142
  aliases?: Readonly<Record<string, string>>;
126
143
  /** What the program does with no command, or with a first word that isn't one (`vercel` deploys). */
@@ -134,17 +151,9 @@ export type CliSpec = {
134
151
  envPrefixes?: readonly string[];
135
152
  /** Variables with those prefixes that never change the target (a token). Their values are never read. */
136
153
  envIgnore?: readonly string[];
137
- /** Where a folder's link lives, relative to the folder; the guard looks in the folder and its parents.
138
- * "text": the file is the value of `param`; "json": `fields` maps the file's keys to params. */
139
- link?: {
140
- file: string;
141
- format: "text";
142
- param: string;
143
- } | {
144
- file: string;
145
- format: "json";
146
- fields: Readonly<Record<string, string>>;
147
- };
154
+ /** Where a folder's link lives, relative to the folder; the guard looks in the folder and its parents. Several:
155
+ * the first that a folder has wins (`wrangler.toml`, then `wrangler.json`). */
156
+ link?: LinkSpec | readonly LinkSpec[];
148
157
  /** Commands that change the link (`link`, `unlink`): later commands in the same line have no link. */
149
158
  linkCommands?: readonly string[];
150
159
  /** Flags that only print (help, version): the command doesn't run. */
@@ -198,6 +207,9 @@ export type CaptureSpec = {
198
207
  unknown?: UnknownOp;
199
208
  /** Query keys that name what a call acts on (Vercel's teamId); no other query key can set a node param. */
200
209
  query?: readonly string[];
210
+ /** Query keys the vendor documents as repeatable (Sentry's bulk `?id=1&id=2`): their values are a list. Any
211
+ * other key given twice with two values fails closed. */
212
+ lists?: readonly string[];
201
213
  };
202
214
  /** What each MCP tool and API route declares it takes, generated from the vendor's own schemas
203
215
  * (`sourcegen.ts`), never written by hand. When an operation has one, a param is read only from a field
@@ -206,10 +218,18 @@ export type CaptureSpec = {
206
218
  mcp?: Readonly<Record<string, OpInputs>>;
207
219
  api?: Readonly<Record<string, OpInputs>>;
208
220
  };
221
+ /** "words": an action Passport can't name says so in `unnamedSummary`'s shape ("Run a wrangler command Passport can't
222
+ * name: containers delete"), as GitHub's do; absent: "<Unclassified action's label>: <op>" (older manifests). */
223
+ unnamedSummary?: "words";
224
+ /** "sqlite" (D1): the parser is Postgres's, so a table it names "public.x" is just "x". */
225
+ sqlDialect?: "postgres" | "sqlite";
209
226
  /** SQL categories (sql.ts) → Action keys; a category not listed is a read. */
210
227
  sql: Readonly<Partial<Record<SqlCategory, string>>>;
211
228
  /** What anything unnamed becomes: an Action of kind Unclassified (2026-11-17), never assumed to be a Delete. */
212
229
  unclassified: string;
230
+ /** The catch-all write ("Other change"): SQL mapped to it keeps its category's words ("Empty a table"), as
231
+ * Unclassified does; its effects come call by call from those words (the action model, 2026-11-20). */
232
+ other?: string;
213
233
  };
214
234
  export type SqlCategory = "drop_database" | "drop_schema" | "drop_table" | "truncate" | "delete_all" | "rls_off" | "grant" | "ddl" | "write" | "export" | "opaque"
215
235
  /** Drops what holds data or what data depends on: a column, a view, a type, an extension, a function. */
@@ -0,0 +1,2 @@
1
+ import { type Manifest } from "../manifest.generated.js";
2
+ export declare const CLOUDFLARE: Manifest;
@@ -0,0 +1,186 @@
1
+ // Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
2
+ import { MANIFEST_SCHEMA } from "../manifest.generated.js";
3
+ import { inputsOf } from "../sourcegen.generated.js";
4
+ import API from "../sources/cloudflare/api-operations.generated.js";
5
+ import MCP from "../sources/cloudflare/mcp-tools.generated.js";
6
+ import { CLOUDFLARE_API_POST_READS, CLOUDFLARE_API_RULES } from "./cloudflareApi.generated.js";
7
+ import { CLOUDFLARE_ACTIONS, CLOUDFLARE_NODES, CLOUDFLARE_SERVICES, CLOUDFLARE_TYPES } from "./cloudflareCatalog.generated.js";
8
+ import { CLOUDFLARE_CLI } from "./cloudflareCli.generated.js";
9
+ /**
10
+ * Cloudflare at Level 1 (2026-11-21): what an agent asks Cloudflare to do through Wrangler, the API v4 (a `curl` line
11
+ * or `passport exec`) and Cloudflare's MCP servers, named from Cloudflare's own references. No App setup yet, so no
12
+ * feed: Cloudflare's own dashboard and other tools are outside activity Passport doesn't see.
13
+ */
14
+ const OTHER = "cloudflare.account.change";
15
+ /** Every GET the sources list is a read, as are the POSTs that only read. */
16
+ const apiReads = {
17
+ ...Object.fromEntries(API.items.filter((op) => op.method === "GET").map((op) => [`GET ${op.path}`, "get"])),
18
+ ...CLOUDFLARE_API_POST_READS
19
+ };
20
+ export const CLOUDFLARE = {
21
+ schema: MANIFEST_SCHEMA,
22
+ platform: "cloudflare",
23
+ label: "Cloudflare",
24
+ version: 1,
25
+ plans: ["free", "pro", "business", "enterprise"],
26
+ identity: "member",
27
+ services: CLOUDFLARE_SERVICES,
28
+ types: CLOUDFLARE_TYPES,
29
+ nodes: CLOUDFLARE_NODES,
30
+ actions: CLOUDFLARE_ACTIONS,
31
+ capture: {
32
+ params: {
33
+ script: { cli: ["name", "@linked.script"], mcp: ["scriptName"], api: ["script_name"] },
34
+ env: { cli: ["env"] },
35
+ account: { cli: ["@linked.account"], api: ["account_id"] },
36
+ zone: { cli: ["zone-id"], mcp: ["zone"], api: ["zone_id"] },
37
+ record: { api: ["dns_record_id"] },
38
+ recordName: { api: ["name"] },
39
+ name: { mcp: ["name"], api: ["name"] },
40
+ title: { mcp: ["title"], api: ["title"] },
41
+ namespace: { cli: ["namespace-id"], mcp: ["namespace_id"], api: ["namespace_id"] },
42
+ binding: { cli: ["binding"] },
43
+ bucket: { mcp: ["name"], api: ["bucket_name"] },
44
+ database: { mcp: ["name"] },
45
+ databaseId: { mcp: ["database_id"], api: ["database_id"] },
46
+ query: { cli: ["command"], mcp: ["sql"], api: ["sql"] },
47
+ file: { cli: ["file"] },
48
+ project: { cli: ["project-name"], api: ["project_name"] },
49
+ queue: { api: ["queue_id"] },
50
+ queueName: { api: ["queue_name"] },
51
+ secret: { api: ["secret_name", "name"] },
52
+ setting: { api: ["setting_id"] },
53
+ phase: { api: ["ruleset_phase"] },
54
+ token: { api: ["token_id"] },
55
+ status: { api: ["status"] },
56
+ routeScript: { api: ["script"] },
57
+ mode: { api: ["mode"] },
58
+ enabled: { api: ["enabled"] },
59
+ paused: { api: ["paused"] },
60
+ purge_everything: { api: ["purge_everything"] },
61
+ hyperdrive: { mcp: ["hyperdrive_id"] }
62
+ },
63
+ split: [
64
+ // `r2 object <bucket>/<key>`: the bucket names the node; the key is the target (two segments kept).
65
+ { from: "objectPath", cases: [{ match: "^([^/]+)/(.+)$", as: ["bucket", "object"] }] }
66
+ ],
67
+ cli: CLOUDFLARE_CLI,
68
+ mcp: {
69
+ prefixes: [
70
+ "mcp__cloudflare-bindings__",
71
+ "mcp__cloudflare-observability__",
72
+ "mcp__cloudflare-dns-analytics__",
73
+ "mcp__cloudflare-api__",
74
+ "mcp__cloudflare__",
75
+ "cloudflare__",
76
+ "cloudflare.",
77
+ "cloudflare_"
78
+ ],
79
+ rules: [
80
+ { match: "kv_namespace_create", action: OTHER, on: "platform", summary: "Create KV namespace {title}" },
81
+ {
82
+ match: "kv_namespace_delete",
83
+ action: "cloudflare.kv.delete",
84
+ on: "kv_namespace",
85
+ summary: "Delete KV namespace {namespace}"
86
+ },
87
+ { match: "kv_namespace_update", action: OTHER, on: "kv_namespace", summary: "Rename KV namespace {namespace}" },
88
+ { match: "r2_bucket_create", action: OTHER, on: "bucket", summary: "Create R2 bucket {bucket}" },
89
+ {
90
+ match: "r2_bucket_delete",
91
+ action: "cloudflare.r2.delete",
92
+ on: "bucket",
93
+ summary: "Delete R2 bucket {bucket}"
94
+ },
95
+ { match: "d1_database_create", action: OTHER, on: "d1_database", summary: "Create D1 database {database}" },
96
+ {
97
+ match: "d1_database_delete",
98
+ action: "cloudflare.d1.delete",
99
+ on: "d1_database",
100
+ summary: "Delete D1 database {databaseId}"
101
+ },
102
+ {
103
+ match: "d1_database_query",
104
+ action: "sql:query",
105
+ on: "d1_database",
106
+ summary: "Run SQL on D1 database {databaseId}"
107
+ },
108
+ {
109
+ match: "hyperdrive_config_edit",
110
+ action: OTHER,
111
+ on: "platform",
112
+ summary: "Change Hyperdrive config {hyperdrive}"
113
+ },
114
+ {
115
+ match: "hyperdrive_config_delete",
116
+ action: OTHER,
117
+ on: "platform",
118
+ summary: "Delete Hyperdrive config {hyperdrive}"
119
+ },
120
+ // Code that runs against Cloudflare's API: Passport can't read what it does.
121
+ {
122
+ match: "execute",
123
+ action: "cloudflare.unclassified",
124
+ on: "platform",
125
+ summary: "Use a Cloudflare tool Passport can't name: execute"
126
+ }
127
+ ],
128
+ reads: {
129
+ accounts_list: "Lists accounts; changes nothing",
130
+ set_active_account: "Picks the account later calls use; changes nothing on Cloudflare",
131
+ kv_namespaces_list: "Lists namespaces; changes nothing",
132
+ kv_namespace_get: "Shows a namespace",
133
+ workers_list: "Lists Workers; changes nothing",
134
+ workers_get_worker: "Shows a Worker",
135
+ workers_get_worker_code: "Shows a Worker's code",
136
+ r2_buckets_list: "Lists buckets; changes nothing",
137
+ r2_bucket_get: "Shows a bucket",
138
+ d1_databases_list: "Lists databases; changes nothing",
139
+ d1_database_get: "Shows a database",
140
+ hyperdrive_configs_list: "Lists configs; changes nothing",
141
+ hyperdrive_config_get: "Shows a config",
142
+ search_cloudflare_documentation: "Searches the docs",
143
+ migrate_pages_to_workers_guide: "Returns a guide",
144
+ query_worker_observability: "Queries Worker logs",
145
+ observability_keys: "Lists log keys",
146
+ observability_values: "Lists log values",
147
+ dns_report: "Reports DNS analytics",
148
+ show_your_zone_dns_settings: "Shows DNS settings",
149
+ search: "Searches Cloudflare's API spec; calls nothing"
150
+ }
151
+ },
152
+ api: {
153
+ base: "https://api.cloudflare.com",
154
+ rules: CLOUDFLARE_API_RULES,
155
+ reads: apiReads
156
+ },
157
+ inputs: inputsOf(API.items, MCP.items),
158
+ // D1 is SQLite: what each statement does, in its own words, recorded as "Run SQL on a D1 database" (`other` keeps
159
+ // the words); SQL Passport can't read (always, on this computer) may be destructive.
160
+ unnamedSummary: "words",
161
+ sqlDialect: "sqlite",
162
+ sql: {
163
+ drop_database: "cloudflare.d1.write",
164
+ drop_schema: "cloudflare.d1.write",
165
+ drop_table: "cloudflare.d1.write",
166
+ truncate: "cloudflare.d1.write",
167
+ delete_all: "cloudflare.d1.write",
168
+ drop_object: "cloudflare.d1.write",
169
+ rls_off: "cloudflare.d1.write",
170
+ grant: "cloudflare.d1.write",
171
+ ddl: "cloudflare.d1.write",
172
+ write: "cloudflare.d1.write",
173
+ export: "cloudflare.d1.write",
174
+ code: "cloudflare.d1.write",
175
+ policy: "cloudflare.d1.write",
176
+ protected: "cloudflare.d1.write",
177
+ bucket_public: "cloudflare.d1.write",
178
+ auth_provider: "cloudflare.d1.write",
179
+ opaque: "cloudflare.d1.write"
180
+ },
181
+ unclassified: "cloudflare.unclassified",
182
+ other: "cloudflare.d1.write"
183
+ },
184
+ probes: [],
185
+ logs: []
186
+ };
@@ -0,0 +1,4 @@
1
+ import type { CaptureRule } from "../manifest.generated.js";
2
+ export declare const CLOUDFLARE_API_RULES: readonly CaptureRule[];
3
+ /** POST routes that only read (a tail, a bulk read, an export to the caller). */
4
+ export declare const CLOUDFLARE_API_POST_READS: Readonly<Record<string, string>>;