passport-bridge 0.48.2 → 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 (111) hide show
  1. package/dist/cliHookAfter.js +10 -1
  2. package/dist/cliHookDecide.d.ts +9 -3
  3. package/dist/cliHookDecide.js +182 -28
  4. package/dist/cliHookSessionState.d.ts +4 -1
  5. package/dist/cliHookSessionState.js +1 -1
  6. package/dist/connectorKit/callEffects.generated.d.ts +36 -0
  7. package/dist/connectorKit/callEffects.generated.js +73 -0
  8. package/dist/connectorKit/cli.generated.js +5 -2
  9. package/dist/connectorKit/engine.generated.d.ts +1 -1
  10. package/dist/connectorKit/engine.generated.js +32 -13
  11. package/dist/connectorKit/githubIds.generated.d.ts +1 -1
  12. package/dist/connectorKit/githubIds.generated.js +3 -2
  13. package/dist/connectorKit/manifest.generated.d.ts +34 -14
  14. package/dist/connectorKit/manifests/cloudflare.generated.d.ts +2 -0
  15. package/dist/connectorKit/manifests/cloudflare.generated.js +186 -0
  16. package/dist/connectorKit/manifests/cloudflareApi.generated.d.ts +4 -0
  17. package/dist/connectorKit/manifests/cloudflareApi.generated.js +207 -0
  18. package/dist/connectorKit/manifests/cloudflareCatalog.generated.d.ts +18 -0
  19. package/dist/connectorKit/manifests/cloudflareCatalog.generated.js +83 -0
  20. package/dist/connectorKit/manifests/cloudflareCli.generated.d.ts +2 -0
  21. package/dist/connectorKit/manifests/cloudflareCli.generated.js +441 -0
  22. package/dist/connectorKit/manifests/githubCapture.generated.js +19 -1
  23. package/dist/connectorKit/manifests/githubReads.generated.js +0 -3
  24. package/dist/connectorKit/manifests/kubernetes.generated.d.ts +76 -0
  25. package/dist/connectorKit/manifests/kubernetes.generated.js +210 -0
  26. package/dist/connectorKit/manifests/kubernetesArgs.generated.d.ts +21 -0
  27. package/dist/connectorKit/manifests/kubernetesArgs.generated.js +82 -0
  28. package/dist/connectorKit/manifests/kubernetesCli.generated.d.ts +30 -0
  29. package/dist/connectorKit/manifests/kubernetesCli.generated.js +530 -0
  30. package/dist/connectorKit/manifests/kubernetesEffects.generated.d.ts +15 -0
  31. package/dist/connectorKit/manifests/kubernetesEffects.generated.js +111 -0
  32. package/dist/connectorKit/manifests/kubernetesObjects.generated.d.ts +24 -0
  33. package/dist/connectorKit/manifests/kubernetesObjects.generated.js +154 -0
  34. package/dist/connectorKit/manifests/railwayHooks.generated.js +11 -5
  35. package/dist/connectorKit/manifests/sentry.generated.d.ts +6 -0
  36. package/dist/connectorKit/manifests/sentry.generated.js +27 -0
  37. package/dist/connectorKit/manifests/sentryApi.generated.d.ts +6 -0
  38. package/dist/connectorKit/manifests/sentryApi.generated.js +282 -0
  39. package/dist/connectorKit/manifests/sentryCapture.generated.d.ts +2 -0
  40. package/dist/connectorKit/manifests/sentryCapture.generated.js +165 -0
  41. package/dist/connectorKit/manifests/sentryCatalog.generated.d.ts +5 -0
  42. package/dist/connectorKit/manifests/sentryCatalog.generated.js +70 -0
  43. package/dist/connectorKit/manifests/sentryCli.generated.d.ts +2 -0
  44. package/dist/connectorKit/manifests/sentryCli.generated.js +230 -0
  45. package/dist/connectorKit/manifests/sentryIssues.generated.d.ts +20 -0
  46. package/dist/connectorKit/manifests/sentryIssues.generated.js +204 -0
  47. package/dist/connectorKit/manifests/supabase.generated.js +3 -2
  48. package/dist/connectorKit/manifests/supabaseApi.generated.js +52 -52
  49. package/dist/connectorKit/manifests/supabaseCapture.generated.js +22 -21
  50. package/dist/connectorKit/manifests/supabaseCatalog.generated.d.ts +2 -2
  51. package/dist/connectorKit/manifests/supabaseCatalog.generated.js +8 -7
  52. package/dist/connectorKit/manifests/supabaseCli.generated.js +32 -32
  53. package/dist/connectorKit/manifests/supabaseProbes.generated.js +29 -29
  54. package/dist/connectorKit/manifests/terraform.generated.d.ts +5 -0
  55. package/dist/connectorKit/manifests/terraform.generated.js +214 -0
  56. package/dist/connectorKit/manifests/terraformLink.generated.d.ts +30 -0
  57. package/dist/connectorKit/manifests/terraformLink.generated.js +73 -0
  58. package/dist/connectorKit/manifests/terraformPlan.generated.d.ts +48 -0
  59. package/dist/connectorKit/manifests/terraformPlan.generated.js +192 -0
  60. package/dist/connectorKit/params.generated.js +2 -0
  61. package/dist/connectorKit/shell.generated.d.ts +5 -1
  62. package/dist/connectorKit/shell.generated.js +121 -20
  63. package/dist/connectorKit/sources/cloudflare/api-operations.generated.d.ts +37 -0
  64. package/dist/connectorKit/sources/cloudflare/api-operations.generated.js +2 -0
  65. package/dist/connectorKit/sources/cloudflare/cli-flags.generated.d.ts +617 -0
  66. package/dist/connectorKit/sources/cloudflare/cli-flags.generated.js +2 -0
  67. package/dist/connectorKit/sources/cloudflare/mcp-tools.generated.d.ts +16 -0
  68. package/dist/connectorKit/sources/cloudflare/mcp-tools.generated.js +2 -0
  69. package/dist/connectorKit/sources/sentry/api-operations.generated.d.ts +121 -0
  70. package/dist/connectorKit/sources/sentry/api-operations.generated.js +2 -0
  71. package/dist/connectorKit/sources/sentry/cli-commands.generated.d.ts +530 -0
  72. package/dist/connectorKit/sources/sentry/cli-commands.generated.js +2 -0
  73. package/dist/connectorKit/sources/sentry/mcp-tools.generated.d.ts +32 -0
  74. package/dist/connectorKit/sources/sentry/mcp-tools.generated.js +2 -0
  75. package/dist/connectorKit/template.generated.d.ts +8 -4
  76. package/dist/connectorKit/template.generated.js +19 -6
  77. package/dist/controlPlane.generated.d.ts +11 -2
  78. package/dist/controlPlaneActions.generated.d.ts +52 -12
  79. package/dist/controlPlaneActions.generated.js +40 -11
  80. package/dist/controlPlaneCloudflare.d.ts +70 -0
  81. package/dist/controlPlaneCloudflare.js +188 -0
  82. package/dist/controlPlaneKubernetes.d.ts +72 -0
  83. package/dist/controlPlaneKubernetes.js +260 -0
  84. package/dist/controlPlaneModel.generated.d.ts +6 -0
  85. package/dist/controlPlaneNpm.generated.d.ts +83 -0
  86. package/dist/controlPlaneNpm.generated.js +307 -0
  87. package/dist/controlPlaneNpmCommands.generated.d.ts +35 -0
  88. package/dist/controlPlaneNpmCommands.generated.js +567 -0
  89. package/dist/controlPlaneNpmGuard.d.ts +44 -0
  90. package/dist/controlPlaneNpmGuard.js +210 -0
  91. package/dist/controlPlaneOffline.d.ts +1 -1
  92. package/dist/controlPlaneRailway.generated.js +2 -2
  93. package/dist/controlPlaneRailwayCli.generated.js +13 -2
  94. package/dist/controlPlaneRailwayModel.generated.d.ts +5 -0
  95. package/dist/controlPlaneRailwayModel.generated.js +15 -1
  96. package/dist/controlPlaneSentry.d.ts +68 -0
  97. package/dist/controlPlaneSentry.js +205 -0
  98. package/dist/controlPlaneTerraform.d.ts +86 -0
  99. package/dist/controlPlaneTerraform.js +273 -0
  100. package/dist/controlPlaneUnnamed.generated.d.ts +41 -2
  101. package/dist/controlPlaneUnnamed.generated.js +148 -2
  102. package/dist/cpCli.d.ts +1 -1
  103. package/dist/cpCli.js +1 -1
  104. package/dist/pluginPin.d.ts +1 -1
  105. package/dist/pluginPin.js +1 -1
  106. package/dist/terraformPlans.d.ts +45 -0
  107. package/dist/terraformPlans.js +96 -0
  108. package/dist/version.d.ts +1 -1
  109. package/dist/version.js +1 -1
  110. package/npm-shrinkwrap.json +2 -2
  111. package/package.json +1 -1
@@ -51,6 +51,15 @@ async function heldKey(profile, vendor) {
51
51
  const marked = readExecVendors(profile).has(vendor);
52
52
  return { held: marked, rerouted: marked && !readKeysChoices(profile).kept[vendor] };
53
53
  }
54
+ /** A `terraform plan -out` that ran: its plan read now (counts and resource-type names only) and remembered for the
55
+ * session, so the apply that follows is decided on it at once (`terraformPlans.ts`). */
56
+ async function withTerraformPlans(context, state, failed) {
57
+ if (failed || !/(?:terraform|tofu)\b[^;&|]*\bplan\b[^;&|]*-out/.test(context.command))
58
+ return state;
59
+ const { rememberTerraformPlans } = await import("./controlPlaneTerraform.js");
60
+ const where = { cwd: workingFolder(context.input) ?? null, env: process.env };
61
+ return rememberTerraformPlans(context.command, where, state).catch(() => state);
62
+ }
54
63
  /** Each fact's code loads only when the command could carry it: a sign-in
55
64
  * only after a failure, resources and a pushed branch only after a success. */
56
65
  async function learn(context, state) {
@@ -62,7 +71,7 @@ async function learn(context, state) {
62
71
  const resources = failed || !context.findings.length
63
72
  ? { creates: [], removes: [] }
64
73
  : (await import("./cliHookCreates.js")).resourcesOf(context.findings);
65
- const retry = nextRetry(state, context.command, exitCode, context.now);
74
+ const retry = nextRetry(await withTerraformPlans(context, state, failed), context.command, exitCode, context.now);
66
75
  const program = retry.state.retry?.program;
67
76
  const pushes = context.findings.some((finding) => finding.vendor === "git" && finding.verb === "push");
68
77
  const pushed = failed || !pushes ? undefined : (await import("./cliHookPushed.js")).pushedOf(context.findings);
@@ -2,9 +2,15 @@
2
2
  * The guard's decision, only through the control plane (docs/design/control-plane.md). What it asks about, all at
3
3
  * once inside the hook's budget:
4
4
  *
5
- * - a consequential `gh`, `git push`, `railway` or `supabase` command on a connected platform (`GET /api/cp/cli`
6
- * `platforms`): `POST /api/cp/decide`, through the classifiers (`controlPlaneGuard.ts`,
7
- * `controlPlaneRailwayGuard.ts`, `controlPlaneSupabase.ts`);
5
+ * - a consequential `gh`, `git push`, `railway` or `supabase` command on a connected platform, or a `kubectl` or
6
+ * `helm` command (Kubernetes has nothing to connect) (`GET /api/cp/cli` `platforms`): `POST /api/cp/decide`,
7
+ * through the classifiers (`controlPlaneGuard.ts`, `controlPlaneRailwayGuard.ts`, `controlPlaneSupabase.ts`,
8
+ * `controlPlaneKubernetes.ts`); a `terraform` or `tofu` command (Terraform has no setup either), through
9
+ * `controlPlaneTerraform.ts`;
10
+ * - a `sentry-cli` command or a curl to Sentry's API (Sentry needs no setup either): the same, through
11
+ * `controlPlaneSentry.ts`;
12
+ * - an `npm`, `pnpm` or `yarn` command that acts on a registry (npm has nothing to connect): the same, through
13
+ * `controlPlaneNpmGuard.ts`;
8
14
  * - a recognized write or delete verb of a vendor CLI that is a basic platform for this person (`vendors`):
9
15
  * `POST /api/cp/decide/cli` with the verb only (`controlPlaneCli.ts`);
10
16
  * - a command that can't be undone on this computer (`localIrreversible.ts`): `POST /api/cp/decide/cli` as vendor
@@ -2,9 +2,15 @@
2
2
  * The guard's decision, only through the control plane (docs/design/control-plane.md). What it asks about, all at
3
3
  * once inside the hook's budget:
4
4
  *
5
- * - a consequential `gh`, `git push`, `railway` or `supabase` command on a connected platform (`GET /api/cp/cli`
6
- * `platforms`): `POST /api/cp/decide`, through the classifiers (`controlPlaneGuard.ts`,
7
- * `controlPlaneRailwayGuard.ts`, `controlPlaneSupabase.ts`);
5
+ * - a consequential `gh`, `git push`, `railway` or `supabase` command on a connected platform, or a `kubectl` or
6
+ * `helm` command (Kubernetes has nothing to connect) (`GET /api/cp/cli` `platforms`): `POST /api/cp/decide`,
7
+ * through the classifiers (`controlPlaneGuard.ts`, `controlPlaneRailwayGuard.ts`, `controlPlaneSupabase.ts`,
8
+ * `controlPlaneKubernetes.ts`); a `terraform` or `tofu` command (Terraform has no setup either), through
9
+ * `controlPlaneTerraform.ts`;
10
+ * - a `sentry-cli` command or a curl to Sentry's API (Sentry needs no setup either): the same, through
11
+ * `controlPlaneSentry.ts`;
12
+ * - an `npm`, `pnpm` or `yarn` command that acts on a registry (npm has nothing to connect): the same, through
13
+ * `controlPlaneNpmGuard.ts`;
8
14
  * - a recognized write or delete verb of a vendor CLI that is a basic platform for this person (`vendors`):
9
15
  * `POST /api/cp/decide/cli` with the verb only (`controlPlaneCli.ts`);
10
16
  * - a command that can't be undone on this computer (`localIrreversible.ts`): `POST /api/cp/decide/cli` as vendor
@@ -41,6 +47,16 @@ export function githubWord(command, hosts = []) {
41
47
  const railwayWord = (command) => /railway/i.test(command.replace(/["'\\]/g, ""));
42
48
  /** The same for `supabase` (and a `curl` to Supabase's API): the kit's resolver decides what is really Supabase. */
43
49
  const supabaseWord = (command) => /supabase/i.test(command.replace(/["'\\]/g, ""));
50
+ /** `kubectl` or `helm` anywhere: the classifier decides what really runs one. */
51
+ const kubernetesWord = (command) => /kubectl|helm/i.test(command.replace(/["'\\]/g, ""));
52
+ /** The same for `terraform` and `tofu`. */
53
+ const terraformWord = (command) => /terraform|tofu/i.test(command.replace(/["'\\]/g, ""));
54
+ /** The same for `sentry-cli` (and a call to Sentry's API, sentry.io). */
55
+ const sentryWord = (command) => /sentry/i.test(command.replace(/["'\\]/g, ""));
56
+ /** The same for `wrangler` (and a raw HTTP call to Cloudflare's API). */
57
+ const cloudflareWord = (command) => /wrangler|api\.cloudflare\.com/i.test(command.replace(/["'\\]/g, ""));
58
+ /** The same for `npm`, `pnpm` and `yarn`: the npm classifier decides what acts on a registry. */
59
+ const npmWord = (command) => /(?:^|[^a-z0-9_-])(?:npm|pnpm|yarn)(?:$|[^a-z0-9_-])/i.test(command.replace(/["'\\]/g, ""));
44
60
  /** A verb as the server reads it (`CLI_VERB` in server/src/controlPlane/cliRoutes.ts): never an argument. */
45
61
  const CLI_VERB = /^-{0,2}[a-z0-9][a-z0-9_:-]*(?: -{0,2}[a-z0-9][a-z0-9_:-]*){0,3}$/;
46
62
  const VERB_TOKEN = /^-{0,2}[A-Za-z0-9][A-Za-z0-9._:+-]{0,39}$/;
@@ -87,6 +103,11 @@ function asking(context, local) {
87
103
  github: Boolean(cp?.platforms.github) && githubWord(command, cp?.githubHosts),
88
104
  railway: Boolean(cp?.platforms.railway) && railwayWord(command),
89
105
  supabase: Boolean(cp?.platforms.supabase) && supabaseWord(command),
106
+ kubernetes: Boolean(cp?.platforms.kubernetes) && kubernetesWord(command),
107
+ terraform: Boolean(cp?.platforms.terraform) && terraformWord(command),
108
+ sentry: Boolean(cp?.platforms.sentry) && sentryWord(command),
109
+ cloudflare: Boolean(cp?.platforms.cloudflare) && cloudflareWord(command),
110
+ npm: Boolean(cp?.platforms.npm) && npmWord(command),
90
111
  verbs: [
91
112
  ...vendorVerbs(context.findings, cp?.vendors ?? []),
92
113
  ...local.map((verb) => [LOCAL_VENDOR, verb])
@@ -101,14 +122,15 @@ export async function planGuard(context) {
101
122
  });
102
123
  if (!context.canAsk)
103
124
  return local[0] ? refuse(local[0], "signed-out") : { output: null };
104
- const { github, railway, supabase, verbs } = asking(context, local);
125
+ const { github, railway, supabase, kubernetes, terraform, sentry, cloudflare, npm, verbs } = asking(context, local);
105
126
  const left = context.deadline - context.now();
106
127
  if (left <= 0) {
107
128
  if (local[0])
108
129
  return refuse(local[0], "unreachable");
109
- return { output: await whenUnreachable(context, { github, railway, supabase }, []) };
130
+ const asked = { github, railway, supabase, kubernetes, terraform, sentry, cloudflare, npm };
131
+ return { output: await whenUnreachable(context, asked, []) };
110
132
  }
111
- if (!github && !railway && !supabase && !verbs.length)
133
+ if (![github, railway, supabase, kubernetes, terraform, sentry, cloudflare, npm].some(Boolean) && !verbs.length)
112
134
  return { output: null };
113
135
  // The kit's shadow run (`kitShadow.ts`) stops before the guard's deadline.
114
136
  setShadowDeadline(context.deadline, context.now);
@@ -116,28 +138,36 @@ export async function planGuard(context) {
116
138
  const open = async () => (api ??= (await context.openApi()) ?? undefined) ?? null;
117
139
  const signal = AbortSignal.any([context.budget, AbortSignal.timeout(left)]);
118
140
  const extra = context.report?.sessionId ? { sessionId: context.report.sessionId } : {};
119
- // A step that fails is no answer from its platform (it counts as unreachable for the offline rules below); it never
120
- // drops another's block or a local refusal.
121
- const threw = { github: false, railway: false, supabase: false };
122
- const failed = (platform) => () => {
123
- threw[platform] = true;
124
- return null;
125
- };
126
- const [githubLine, railwayAnswer, supabaseAnswer, verbAnswers] = await Promise.all([
127
- github ? githubLinePlan(context, open, extra, signal).catch(failed("github")) : null,
128
- railway ? railwayLine(context, open, extra, signal).catch(failed("railway")) : null,
129
- supabase ? supabaseLine(context, open, extra, signal).catch(failed("supabase")) : null,
130
- askVerbs(verbs, open, extra, signal).catch(() => [])
131
- ]);
141
+ const asked = { github, railway, supabase, kubernetes, terraform, sentry, cloudflare, npm };
142
+ const { threw, githubLine, railwayAnswer, supabaseAnswer, kubernetesAnswer, terraformAnswer, sentryAnswer, cloudflareAnswer, npmAnswer, verbAnswers } = await askAll(context, asked, verbs, { open, extra, signal });
132
143
  // Decided: the kit's shadow run reads what was asked about, off the decision's path.
133
144
  shadowAfterDecision();
134
145
  const withApi = (output) => ({ output, ...(api ? { api } : {}) });
135
- const answers = [githubLine?.decided?.answer, railwayAnswer?.answer, supabaseAnswer?.answer, ...verbAnswers];
146
+ const answers = [
147
+ githubLine?.decided?.answer,
148
+ railwayAnswer?.answer,
149
+ supabaseAnswer?.answer,
150
+ kubernetesAnswer?.answer,
151
+ terraformAnswer?.answer,
152
+ sentryAnswer?.answer,
153
+ cloudflareAnswer?.answer,
154
+ npmAnswer?.answer,
155
+ ...verbAnswers
156
+ ];
136
157
  const blocked = answers.find((answer) => answer?.kind === "block");
137
158
  if (blocked)
138
159
  return withApi(denyOutput(context.client, blocked.message));
139
160
  const late = answers.flatMap((answer) => (answer?.kind === "unreachable" ? (answer.late ?? []) : []));
140
- const missed = missedPlatforms({ github, railway, supabase }, threw, githubLine, railwayAnswer?.answer, supabaseAnswer?.answer);
161
+ const others = {
162
+ railwayAnswer,
163
+ supabaseAnswer,
164
+ kubernetesAnswer,
165
+ terraformAnswer,
166
+ sentryAnswer,
167
+ cloudflareAnswer,
168
+ npmAnswer
169
+ };
170
+ const missed = missedPlatforms(asked, threw, githubLine, othersOf(others));
141
171
  const offline = await whenUnreachable(context, missed, late);
142
172
  if (offline)
143
173
  return withApi(offline);
@@ -148,9 +178,83 @@ export async function planGuard(context) {
148
178
  return withApi(refuse(unanswered, "unreachable").output);
149
179
  // The whole line is allowed: each decision is left for what spends it, and the unanswered ones for the after-hook.
150
180
  await supabaseAnswer?.leave();
151
- await leaveDecisions(githubLine?.decided ?? null, railwayAnswer, context, [supabaseAnswer?.answer, ...verbAnswers]);
181
+ await leaveDecisions(githubLine?.decided ?? null, railwayAnswer, context, [
182
+ supabaseAnswer?.answer,
183
+ kubernetesAnswer?.answer,
184
+ terraformAnswer?.answer,
185
+ sentryAnswer?.answer,
186
+ cloudflareAnswer?.answer,
187
+ npmAnswer?.answer,
188
+ ...verbAnswers
189
+ ]);
152
190
  return withApi(null);
153
191
  }
192
+ /** Each platform's answer but GitHub's (which is the line's), for the offline rules. */
193
+ function othersOf(answers) {
194
+ return {
195
+ railway: answers.railwayAnswer?.answer,
196
+ supabase: answers.supabaseAnswer?.answer,
197
+ kubernetes: answers.kubernetesAnswer?.answer,
198
+ terraform: answers.terraformAnswer?.answer,
199
+ sentry: answers.sentryAnswer?.answer,
200
+ cloudflare: answers.cloudflareAnswer?.answer,
201
+ npm: answers.npmAnswer?.answer
202
+ };
203
+ }
204
+ /** Every platform's part of a line, asked at once. A step that fails is no answer from its platform (it counts as
205
+ * unreachable for the offline rules); it never drops another's block or a local refusal. */
206
+ async function askAll(context, asked, verbs, how) {
207
+ const { open, extra, signal } = how;
208
+ const threw = {
209
+ github: false,
210
+ railway: false,
211
+ supabase: false,
212
+ kubernetes: false,
213
+ terraform: false,
214
+ sentry: false,
215
+ cloudflare: false,
216
+ npm: false
217
+ };
218
+ const failed = (platform) => () => {
219
+ threw[platform] = true;
220
+ return null;
221
+ };
222
+ const [githubLine, railwayAnswer, supabaseAnswer, kubernetesAnswer, terraformAnswer, sentryAnswer, cloudflareAnswer, npmAnswer, verbAnswers] = await Promise.all([
223
+ asked.github ? githubLinePlan(context, open, extra, signal).catch(failed("github")) : null,
224
+ asked.railway ? railwayLine(context, open, extra, signal).catch(failed("railway")) : null,
225
+ asked.supabase ? supabaseLine(context, open, extra, signal).catch(failed("supabase")) : null,
226
+ asked.kubernetes ? kubernetesLine(context, open, extra, signal).catch(failed("kubernetes")) : null,
227
+ asked.terraform ? terraformLine(context, open, extra, signal).catch(failed("terraform")) : null,
228
+ asked.sentry ? sentryLine(context, open, extra, signal).catch(failed("sentry")) : null,
229
+ asked.cloudflare ? cloudflareLine(context, open, extra, signal).catch(failed("cloudflare")) : null,
230
+ asked.npm ? npmLine(context, open, extra, signal).catch(failed("npm")) : null,
231
+ askVerbs(verbs, open, extra, signal).catch(() => [])
232
+ ]);
233
+ return {
234
+ threw,
235
+ githubLine,
236
+ railwayAnswer,
237
+ supabaseAnswer,
238
+ kubernetesAnswer,
239
+ terraformAnswer,
240
+ sentryAnswer,
241
+ cloudflareAnswer,
242
+ npmAnswer,
243
+ verbAnswers
244
+ };
245
+ }
246
+ async function npmLine(context, open, extra, signal) {
247
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env, home: homedir() };
248
+ return (await import("./controlPlaneNpmGuard.js")).npmLinePlan(context.command, where, open, extra, signal);
249
+ }
250
+ async function cloudflareLine(context, open, extra, signal) {
251
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env };
252
+ return (await import("./controlPlaneCloudflare.js")).cloudflareLinePlan(context.command, where, open, extra, signal);
253
+ }
254
+ async function sentryLine(context, open, extra, signal) {
255
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env };
256
+ return (await import("./controlPlaneSentry.js")).sentryLinePlan(context.command, where, open, extra, signal);
257
+ }
154
258
  async function railwayLine(context, open, extra, signal) {
155
259
  const where = { cwd: context.cwd, env: context.env ?? process.env, home: homedir() };
156
260
  return (await import("./controlPlaneRailwayGuard.js")).railwayLinePlan(context.command, where, open, extra, signal);
@@ -159,6 +263,29 @@ async function supabaseLine(context, open, extra, signal) {
159
263
  const where = { cwd: context.cwd ?? null, env: context.env ?? process.env };
160
264
  return (await import("./controlPlaneSupabase.js")).supabaseLinePlan(context.command, where, open, extra, signal);
161
265
  }
266
+ async function kubernetesLine(context, open, extra, signal) {
267
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env, home: homedir() };
268
+ return (await import("./controlPlaneKubernetes.js")).kubernetesLinePlan(context.command, where, open, extra, signal);
269
+ }
270
+ /** Terraform's part of a line, with the session's plans (`terraformPlans.ts`) and what is left of the budget for
271
+ * reading one. */
272
+ async function terraformLine(context, open, extra, signal) {
273
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env };
274
+ const [{ terraformLinePlan }, sessions] = await Promise.all([
275
+ import("./controlPlaneTerraform.js"),
276
+ import("./cliHookSessionState.js")
277
+ ]);
278
+ const runtime = context.report?.runtime;
279
+ const sessionId = context.report?.sessionId;
280
+ const state = runtime ? sessions.readSessionState(runtime, sessionId, context.now()) : {};
281
+ // Half of what is left reads a plan; the rest asks Passport.
282
+ const planMs = Math.max(0, Math.floor((context.deadline - context.now()) / 2));
283
+ const save = (next) => {
284
+ if (runtime)
285
+ sessions.writeSessionState(runtime, sessionId, next);
286
+ };
287
+ return terraformLinePlan(context.command, where, open, extra, signal, { state, planMs, save });
288
+ }
162
289
  async function askVerbs(verbs, open, extra, signal) {
163
290
  if (!verbs.length)
164
291
  return [];
@@ -200,13 +327,20 @@ async function leaveDecisions(github, railway, context, others) {
200
327
  /** The platforms asked and not answered: Passport couldn't be reached for them. Every non-answer counts: no response,
201
328
  * a 401, 403, 404, 429 or 5xx, a timeout, a 200 that isn't Passport's JSON (each reads as unreachable), or a step
202
329
  * that threw. An `undecided` from Passport itself is an answer. */
203
- function missedPlatforms(asked, threw, github, railway, supabase) {
330
+ function missedPlatforms(asked, threw, github, others) {
204
331
  // A real `undecided` (Passport answered, and doesn't decide this) keeps today's behavior: it isn't offline.
205
332
  const missed = (answer) => !answer || answer.kind === "unreachable";
206
333
  return {
207
334
  github: asked.github && (threw.github || (Boolean(github?.label) && missed(github?.decided?.answer))),
208
- railway: asked.railway && (threw.railway || missed(railway)),
209
- supabase: asked.supabase && (threw.supabase || missed(supabase))
335
+ railway: asked.railway && (threw.railway || missed(others.railway)),
336
+ supabase: asked.supabase && (threw.supabase || missed(others.supabase)),
337
+ // A line with no kubectl or helm write asks nothing: no answer to miss.
338
+ kubernetes: asked.kubernetes && (threw.kubernetes || (others.kubernetes !== null && missed(others.kubernetes))),
339
+ terraform: asked.terraform && (threw.terraform || missed(others.terraform)),
340
+ sentry: asked.sentry && (threw.sentry || missed(others.sentry)),
341
+ // A line with no consequential wrangler command asks nothing: no answer to miss.
342
+ cloudflare: asked.cloudflare && (threw.cloudflare || (others.cloudflare !== null && missed(others.cloudflare))),
343
+ npm: asked.npm && (threw.npm || missed(others.npm))
210
344
  };
211
345
  }
212
346
  /** What the line does on each platform Passport didn't answer for, classified on this computer. */
@@ -229,13 +363,33 @@ async function foundOffline(context, missed) {
229
363
  const where = { cwd: context.cwd ?? null, env: context.env ?? process.env };
230
364
  found.push(...(await import("./controlPlaneSupabase.js")).supabaseFound(context.command, where));
231
365
  }
366
+ if (missed.kubernetes) {
367
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env, home: homedir() };
368
+ found.push(...(await import("./controlPlaneKubernetes.js")).kubernetesFound(context.command, where));
369
+ }
370
+ if (missed.terraform) {
371
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env };
372
+ found.push(...(await (await import("./controlPlaneTerraform.js")).terraformFound(context.command, where)));
373
+ }
374
+ if (missed.sentry) {
375
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env };
376
+ found.push(...(await import("./controlPlaneSentry.js")).sentryFound(context.command, where));
377
+ }
378
+ if (missed.cloudflare) {
379
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env };
380
+ found.push(...(await import("./controlPlaneCloudflare.js")).cloudflareFound(context.command, where));
381
+ }
382
+ if (missed.npm) {
383
+ const where = { cwd: context.cwd ?? null, env: context.env ?? process.env, home: homedir() };
384
+ found.push(...(await import("./controlPlaneNpmGuard.js")).npmFound(context.command, where));
385
+ }
232
386
  return found;
233
387
  }
234
388
  /** The guard never got to ask (its budget ran out first, or something failed before it answered): every platform the
235
389
  * line would have asked about counts as unreachable, so a covered action is refused and the rest is recorded. */
236
390
  export async function planUnreachable(context) {
237
- const { github, railway, supabase } = asking(context, []);
238
- return whenUnreachable(context, { github, railway, supabase }, []);
391
+ const { github, railway, supabase, kubernetes, terraform, sentry, cloudflare, npm } = asking(context, []);
392
+ return whenUnreachable(context, { github, railway, supabase, kubernetes, terraform, sentry, cloudflare, npm }, []);
239
393
  }
240
394
  /** What the agent reads when the guard couldn't even classify a line Passport didn't answer for. */
241
395
  export const UNCHECKED_REFUSAL = "Passport couldn't be reached or check this command, so it didn't run.";
@@ -246,7 +400,7 @@ export const UNCHECKED_REFUSAL = "Passport couldn't be reached or check this com
246
400
  * (recorded as no rules known). Anything that throws here refuses: a covered action is never allowed by an error.
247
401
  */
248
402
  async function whenUnreachable(context, missed, late) {
249
- if (!missed.github && !missed.railway && !missed.supabase)
403
+ if (!Object.values(missed).some(Boolean))
250
404
  return null;
251
405
  try {
252
406
  const found = await foundOffline(context, missed);
@@ -6,6 +6,7 @@
6
6
  * Cursor on their next try. One small owner-only file per session, named by a
7
7
  * digest of the agent and session id; bounded in count and age. Never throws.
8
8
  */
9
+ import type { PlanMemo } from "./terraformPlans.js";
9
10
  /** A session quiet this long starts over. */
10
11
  export declare const STATE_MAX_AGE_MS: number;
11
12
  /** A sign-in failure is told to Codex or Cursor on a try within this long. */
@@ -21,11 +22,13 @@ export type SignInState = {
21
22
  held: boolean;
22
23
  at: number;
23
24
  };
24
- /** `created`: folders this session made itself (`sessionCreated.ts`), canonical paths. */
25
+ /** `created`: folders this session made itself (`sessionCreated.ts`), canonical paths. `terraformPlans`: the plans
26
+ * this session made or read, reduced to counts and resource-type names (`terraformPlans.ts`). */
25
27
  export type SessionState = {
26
28
  retry?: RetryState;
27
29
  signIn?: SignInState;
28
30
  created?: string[];
31
+ terraformPlans?: PlanMemo[];
29
32
  };
30
33
  /** The same command, however it was spaced, and the command inside a
31
34
  * `passport exec` rewrite, so the guard's and the after-hook's agree. */
@@ -70,7 +70,7 @@ export function writeSessionState(runtime, sessionId, state) {
70
70
  if (!path)
71
71
  return;
72
72
  try {
73
- if (!state.retry && !state.signIn && !state.created?.length) {
73
+ if (!state.retry && !state.signIn && !state.created?.length && !state.terraformPlans?.length) {
74
74
  rmSync(path, { force: true });
75
75
  return;
76
76
  }
@@ -0,0 +1,36 @@
1
+ import type { Effect, EffectVerb, ObjectType } from "../controlPlaneActions.generated.js";
2
+ /**
3
+ * Per-call effects for the kit's apps (docs/design/control-plane.md, "Action model", Layer 2 inputs): what the
4
+ * operation a classifier named does, from its summary template ("Restart {where}", "Delete branch {name}"), which the
5
+ * kit renders from the call's arguments and both sides send. The server reads them for the gateway and the guard
6
+ * alike, so no bridge release is needed for a new entry. A summary no template matches keeps its action's defaults.
7
+ */
8
+ /** One reviewed operation: the action key it is classified as (the classifier's own, before `REMOVED_ACTIONS`), its
9
+ * summary template, and its effects. */
10
+ export type CallEffectEntry = readonly [actionKey: string, template: string, effects: readonly Effect[]];
11
+ /** A summary template as a pattern: each `{param}` matches any text, and the kit's own asides (" (staged)", "(run SQL
12
+ * on project x)") may follow. */
13
+ export declare function templatePattern(template: string): RegExp;
14
+ export type CallEffectsOf = (keys: readonly string[], summary: string) => Effect[] | undefined;
15
+ /** A lookup over reviewed entries: the most specific template of one of `keys` (the classification's key and the
16
+ * catalog key it is recorded as) that matches the summary. */
17
+ export declare function callEffectsTable(entries: readonly CallEffectEntry[]): CallEffectsOf;
18
+ /** The verb an operation's first word says; anything else changes something. */
19
+ export declare function verbOf(words: string): EffectVerb;
20
+ export declare function objectOf(words: string): ObjectType;
21
+ /** The derivation: the words' verb on their object type, a run created when the words start code. */
22
+ export declare function deriveEffects(words: string): Effect[];
23
+ /** Something stops working: Destructive beside whatever else the call does. */
24
+ export declare const OUTAGE: Effect;
25
+ /** It may stop something working (a restart under load, a key some app may still use). */
26
+ export declare const MAY_OUTAGE: Effect;
27
+ /** Starts code running now. */
28
+ export declare const RUN: Effect;
29
+ /** May start code running later (a variable change Railway redeploys on, a trigger). */
30
+ export declare const MAY_RUN_LATER: Effect;
31
+ /** Reachable from the internet (a domain, a TCP proxy, a public bucket). */
32
+ export declare const PUBLIC_DATA: Effect;
33
+ /** An invitation emails the person invited. */
34
+ export declare const EMAILS_OUTSIDE: Effect;
35
+ /** It changes what the workspace pays (an add-on, compute, a usage limit). */
36
+ export declare const BILLING: Effect;
@@ -0,0 +1,73 @@
1
+ const escape = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2
+ /** A summary template as a pattern: each `{param}` matches any text, and the kit's own asides (" (staged)", "(run SQL
3
+ * on project x)") may follow. */
4
+ export function templatePattern(template) {
5
+ const literal = template.split(/\{[^}]*\}/).map(escape);
6
+ return new RegExp(`^${literal.join(".+?")}(?: \\(.*\\))?$`, "s");
7
+ }
8
+ /** How many literal characters a template has: the more, the more specific. */
9
+ const specificity = (template) => template.replace(/\{[^}]*\}/g, "").length;
10
+ /** A lookup over reviewed entries: the most specific template of one of `keys` (the classification's key and the
11
+ * catalog key it is recorded as) that matches the summary. */
12
+ export function callEffectsTable(entries) {
13
+ const compiled = [...entries]
14
+ .sort((a, b) => specificity(b[1]) - specificity(a[1]))
15
+ .map(([key, template, effects]) => ({ key, pattern: templatePattern(template), effects }));
16
+ return (keys, summary) => {
17
+ const text = summary.trim();
18
+ const found = compiled.find((entry) => keys.includes(entry.key) && entry.pattern.test(text));
19
+ return found ? found.effects.map((effect) => ({ ...effect })) : undefined;
20
+ };
21
+ }
22
+ const DELETE_WORDS = /^(delete|remove|drop|empty|purge|destroy)\b/i;
23
+ const CREATE_WORDS = /^(create|add|invite|upload|seed|import|accept|generate|define|record)\b/i;
24
+ /** The verb an operation's first word says; anything else changes something. */
25
+ export function verbOf(words) {
26
+ if (DELETE_WORDS.test(words))
27
+ return "delete";
28
+ if (CREATE_WORDS.test(words))
29
+ return "create";
30
+ return "change";
31
+ }
32
+ /** Object type by an operation's words, first match wins (shared by Railway and Supabase). */
33
+ const OBJECT_RULES = [
34
+ [
35
+ /secret|api key|jwt|signing key|token|password|role|privilege|grant|member|access|sign-in|sso|saml|auth|ssl|network|claim|encryption|variable|credential|sign-ups|policy/i,
36
+ "access"
37
+ ],
38
+ [/deploy|redeploy|restart|rollback|run |shell|ssh|session/i, "run"],
39
+ [/function|code|source/i, "code"],
40
+ [/notebook|history entry|migration history|from history/i, "record"],
41
+ [/table|rows|data|bucket|object|migration|backup|restore|branch|database|volume|dump|seed/i, "data"]
42
+ ];
43
+ export function objectOf(words) {
44
+ for (const [pattern, object] of OBJECT_RULES)
45
+ if (pattern.test(words))
46
+ return object;
47
+ return "service";
48
+ }
49
+ /** The derivation: the words' verb on their object type, a run created when the words start code. */
50
+ export function deriveEffects(words) {
51
+ const verb = verbOf(words);
52
+ const object = objectOf(words);
53
+ if (object === "run")
54
+ return verb === "delete" ? [{ verb: "change", object: "run" }] : [{ verb: "create", object }];
55
+ return [{ verb, object }];
56
+ }
57
+ /* ------------------------------------------------------------------ */
58
+ /* Effects the reviews reuse */
59
+ /* ------------------------------------------------------------------ */
60
+ /** Something stops working: Destructive beside whatever else the call does. */
61
+ export const OUTAGE = { verb: "change", object: "service", disrupts: true };
62
+ /** It may stop something working (a restart under load, a key some app may still use). */
63
+ export const MAY_OUTAGE = { verb: "change", object: "service", disrupts: true, possible: true };
64
+ /** Starts code running now. */
65
+ export const RUN = { verb: "create", object: "run" };
66
+ /** May start code running later (a variable change Railway redeploys on, a trigger). */
67
+ export const MAY_RUN_LATER = { verb: "create", object: "run", when: "later", possible: true };
68
+ /** Reachable from the internet (a domain, a TCP proxy, a public bucket). */
69
+ export const PUBLIC_DATA = { verb: "change", object: "data", audience: "public" };
70
+ /** An invitation emails the person invited. */
71
+ export const EMAILS_OUTSIDE = { verb: "create", object: "message", audience: "outside" };
72
+ /** It changes what the workspace pays (an add-on, compute, a usage limit). */
73
+ export const BILLING = { verb: "change", object: "money" };
@@ -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
  };
@@ -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;