@intentius/chant 0.124.57 → 0.124.59

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 (163) hide show
  1. package/dist/ci-product-words.d.ts +47 -2
  2. package/dist/ci-product-words.d.ts.map +1 -1
  3. package/dist/ci-product-words.js +59 -1
  4. package/dist/ci-product.d.ts +26 -2
  5. package/dist/ci-product.d.ts.map +1 -1
  6. package/dist/ci-product.js +25 -2
  7. package/dist/cli/commands/init.d.ts +2 -0
  8. package/dist/cli/commands/init.d.ts.map +1 -1
  9. package/dist/cli/commands/init.js +1 -1
  10. package/dist/cli/handlers/build.d.ts.map +1 -1
  11. package/dist/cli/handlers/build.js +5 -1
  12. package/dist/cli/handlers/init.d.ts.map +1 -1
  13. package/dist/cli/handlers/init.js +16 -0
  14. package/dist/cli/handlers/lifecycle-drift.d.ts +2 -1
  15. package/dist/cli/handlers/lifecycle-drift.d.ts.map +1 -1
  16. package/dist/cli/handlers/lifecycle-drift.js +4 -2
  17. package/dist/cli/handlers/lock.d.ts.map +1 -1
  18. package/dist/cli/handlers/lock.js +45 -2
  19. package/dist/cli/handlers/serve.d.ts.map +1 -1
  20. package/dist/cli/handlers/serve.js +9 -0
  21. package/dist/cli/main.d.ts.map +1 -1
  22. package/dist/cli/main.js +11 -3
  23. package/dist/cli/mcp/product-tools.d.ts +40 -7
  24. package/dist/cli/mcp/product-tools.d.ts.map +1 -1
  25. package/dist/cli/mcp/product-tools.js +58 -15
  26. package/dist/cli/mcp/read-only.d.ts +2 -1
  27. package/dist/cli/mcp/read-only.d.ts.map +1 -1
  28. package/dist/cli/mcp/read-only.js +2 -1
  29. package/dist/cli/mcp/server.d.ts +11 -0
  30. package/dist/cli/mcp/server.d.ts.map +1 -1
  31. package/dist/cli/mcp/server.js +15 -3
  32. package/dist/cli/mcp-config.d.ts +4 -1
  33. package/dist/cli/mcp-config.d.ts.map +1 -1
  34. package/dist/cli/mcp-config.js +6 -2
  35. package/dist/cli/parse-args.d.ts.map +1 -1
  36. package/dist/cli/parse-args.js +27 -0
  37. package/dist/cli/registry.d.ts +14 -0
  38. package/dist/cli/registry.d.ts.map +1 -1
  39. package/dist/components/pr-pipeline.d.ts +56 -0
  40. package/dist/components/pr-pipeline.d.ts.map +1 -1
  41. package/dist/components/pr-pipeline.js +55 -2
  42. package/dist/components/product-pipeline.d.ts +18 -1
  43. package/dist/components/product-pipeline.d.ts.map +1 -1
  44. package/dist/components/product-pipeline.js +8 -2
  45. package/dist/drift-record.d.ts +5 -0
  46. package/dist/drift-record.d.ts.map +1 -1
  47. package/dist/e2e-harness/driver.d.ts.map +1 -1
  48. package/dist/e2e-harness/driver.js +97 -0
  49. package/dist/e2e-harness/forgejo.d.ts +5 -1
  50. package/dist/e2e-harness/forgejo.d.ts.map +1 -1
  51. package/dist/e2e-harness/forgejo.js +35 -0
  52. package/dist/e2e-harness/index.d.ts +7 -0
  53. package/dist/e2e-harness/index.d.ts.map +1 -1
  54. package/dist/e2e-harness/index.js +10 -1
  55. package/dist/e2e-harness/ports.d.ts +31 -0
  56. package/dist/e2e-harness/ports.d.ts.map +1 -1
  57. package/dist/e2e-harness/scenario.d.ts.map +1 -1
  58. package/dist/e2e-harness/scenario.js +9 -5
  59. package/dist/e2e-harness/schemas/e2e-scenario.schema.json +43 -3
  60. package/dist/e2e-harness/schemas/index.d.ts +22 -1
  61. package/dist/e2e-harness/schemas/index.d.ts.map +1 -1
  62. package/dist/e2e-harness/schemas/index.js +1 -1
  63. package/dist/e2e-harness/steps.d.ts.map +1 -1
  64. package/dist/e2e-harness/steps.js +4 -0
  65. package/dist/lifecycle/lock-beat.d.ts +27 -0
  66. package/dist/lifecycle/lock-beat.d.ts.map +1 -0
  67. package/dist/lifecycle/lock-beat.js +84 -0
  68. package/dist/lifecycle/resource-lock.d.ts +54 -1
  69. package/dist/lifecycle/resource-lock.d.ts.map +1 -1
  70. package/dist/lifecycle/resource-lock.js +128 -7
  71. package/dist/mcp/types.d.ts +9 -0
  72. package/dist/mcp/types.d.ts.map +1 -1
  73. package/dist/op/activities/activity-contracts.d.ts +4 -4
  74. package/dist/op/index.d.ts +1 -1
  75. package/dist/op/index.d.ts.map +1 -1
  76. package/dist/op/index.js +1 -1
  77. package/dist/op/op-waves-notify.d.ts.map +1 -1
  78. package/dist/op/op-waves-notify.js +11 -0
  79. package/dist/op/op-waves-run.d.ts +28 -1
  80. package/dist/op/op-waves-run.d.ts.map +1 -1
  81. package/dist/op/op-waves-run.js +92 -7
  82. package/dist/op/op-waves.d.ts +12 -1
  83. package/dist/op/op-waves.d.ts.map +1 -1
  84. package/dist/op/op-waves.js +9 -2
  85. package/dist/release-floors.d.ts +1 -1
  86. package/dist/release-floors.js +1 -1
  87. package/dist/template-request/index.d.ts +9 -0
  88. package/dist/template-request/index.d.ts.map +1 -0
  89. package/dist/template-request/index.js +8 -0
  90. package/dist/template-request/request-body.d.ts +21 -0
  91. package/dist/template-request/request-body.d.ts.map +1 -0
  92. package/dist/template-request/request-body.js +86 -0
  93. package/dist/template-request/template-request.d.ts +100 -0
  94. package/dist/template-request/template-request.d.ts.map +1 -0
  95. package/dist/template-request/template-request.js +149 -0
  96. package/dist/template-request/template-request.schema.json +100 -0
  97. package/dist/template-request/template-spec.d.ts +83 -0
  98. package/dist/template-request/template-spec.d.ts.map +1 -0
  99. package/dist/template-request/template-spec.js +146 -0
  100. package/dist/template-request/template.schema.json +114 -0
  101. package/dist/template-request/validate.d.ts +4 -0
  102. package/dist/template-request/validate.d.ts.map +1 -0
  103. package/dist/template-request/validate.js +21 -0
  104. package/dist/wave-runtime.mjs +298 -298
  105. package/dist/workspace/drift-cli.d.ts +13 -1
  106. package/dist/workspace/drift-cli.d.ts.map +1 -1
  107. package/dist/workspace/drift-cli.js +19 -3
  108. package/package.json +8 -1
  109. package/src/ci-product-words.test.ts +23 -0
  110. package/src/ci-product-words.ts +68 -3
  111. package/src/ci-product.ts +31 -1
  112. package/src/cli/commands/init.ts +3 -1
  113. package/src/cli/handlers/build.ts +5 -1
  114. package/src/cli/handlers/init.ts +18 -0
  115. package/src/cli/handlers/lifecycle-drift.test.ts +52 -0
  116. package/src/cli/handlers/lifecycle-drift.ts +4 -2
  117. package/src/cli/handlers/lock.ts +41 -2
  118. package/src/cli/handlers/serve.ts +9 -0
  119. package/src/cli/main.ts +11 -3
  120. package/src/cli/mcp/product-tools.test.ts +56 -1
  121. package/src/cli/mcp/product-tools.ts +66 -15
  122. package/src/cli/mcp/read-only.ts +2 -1
  123. package/src/cli/mcp/server.ts +20 -5
  124. package/src/cli/mcp-config.test.ts +52 -2
  125. package/src/cli/mcp-config.ts +6 -3
  126. package/src/cli/parse-args.ts +19 -0
  127. package/src/cli/registry.ts +14 -0
  128. package/src/components/pr-pipeline.ts +87 -2
  129. package/src/components/product-actions.test.ts +76 -0
  130. package/src/components/product-pipeline.ts +21 -2
  131. package/src/drift-record.ts +5 -0
  132. package/src/e2e-harness/driver.test.ts +163 -0
  133. package/src/e2e-harness/driver.ts +86 -1
  134. package/src/e2e-harness/forgejo.ts +42 -1
  135. package/src/e2e-harness/index.ts +11 -1
  136. package/src/e2e-harness/ports.ts +33 -0
  137. package/src/e2e-harness/scenario.ts +8 -6
  138. package/src/e2e-harness/schemas/README.md +11 -2
  139. package/src/e2e-harness/schemas/e2e-scenario.schema.json +43 -3
  140. package/src/e2e-harness/schemas/index.ts +5 -1
  141. package/src/e2e-harness/schemas.test.ts +44 -1
  142. package/src/e2e-harness/steps.ts +4 -0
  143. package/src/lifecycle/lock-beat.ts +99 -0
  144. package/src/lifecycle/resource-lock-liveness.test.ts +289 -0
  145. package/src/lifecycle/resource-lock.ts +143 -8
  146. package/src/mcp/types.ts +9 -0
  147. package/src/op/index.ts +1 -0
  148. package/src/op/op-waves-notify.ts +11 -0
  149. package/src/op/op-waves-preview.test.ts +167 -0
  150. package/src/op/op-waves-run.ts +116 -8
  151. package/src/op/op-waves.ts +20 -3
  152. package/src/release-floors.ts +1 -1
  153. package/src/template-request/__fixtures__/request-body.md +41 -0
  154. package/src/template-request/index.ts +8 -0
  155. package/src/template-request/request-body.ts +91 -0
  156. package/src/template-request/template-request.schema.json +100 -0
  157. package/src/template-request/template-request.test.ts +315 -0
  158. package/src/template-request/template-request.ts +234 -0
  159. package/src/template-request/template-spec.ts +176 -0
  160. package/src/template-request/template.schema.json +114 -0
  161. package/src/template-request/validate.ts +28 -0
  162. package/src/workspace/drift-cli.test.ts +35 -1
  163. package/src/workspace/drift-cli.ts +21 -3
@@ -26,8 +26,12 @@
26
26
  export type CiProductStage = "plan" | "apply" | "record" | "check" | "drift" | "lock" | "approval" | "control";
27
27
  /** Every stage slot, in the order {@link assertProductWords} reports them. */
28
28
  export declare const CI_PRODUCT_STAGES: readonly CiProductStage[];
29
- /** The commands a comment may name. Each one needs a job in the pipeline that answers it. */
30
- export type CiProductCommand = "plan" | "apply" | "lock" | "unlock" | "agent";
29
+ /**
30
+ * The commands a comment may name. Each one needs a job in the pipeline that
31
+ * answers it. `action` (#4653) asks for a day-2 action on one member, which
32
+ * runs under a gated request.
33
+ */
34
+ export type CiProductCommand = "plan" | "apply" | "lock" | "unlock" | "agent" | "action";
31
35
  export declare const CI_PRODUCT_COMMANDS: readonly CiProductCommand[];
32
36
  /**
33
37
  * What an approval of a product's waves binds to (ruling B, 2026-10-27).
@@ -276,6 +280,16 @@ export type ParsedProductComment =
276
280
  | {
277
281
  kind: "agent";
278
282
  ask: string;
283
+ }
284
+ /**
285
+ * A day-2 action (#4653): `<member> <action>`, such as `apps/orders
286
+ * module.app.action.aws_lambda_invoke.rotate` or a stack's action name.
287
+ * The engine's lexicon checks the action against the member's plan.
288
+ */
289
+ | {
290
+ kind: "action";
291
+ member: string;
292
+ address: string;
279
293
  } | {
280
294
  kind: "refused";
281
295
  reason: string;
@@ -293,4 +307,35 @@ export declare const PRODUCT_COMMENT_ASK_MAX = 2000;
293
307
  * `env` turns on an alias whose `when` variable is `1` there.
294
308
  */
295
309
  export declare function parseProductComment(words: CiProductWords, body: unknown, env?: Record<string, string | undefined>): ParsedProductComment | undefined;
310
+ /**
311
+ * The variables the generated action job (#4654) hands the product's action
312
+ * verb: the comment that started it, on a comment, and the dispatch's two
313
+ * inputs, on a dispatch. The values reach the job as variables and never as
314
+ * shell text; {@link productActionFromEnv} reads them.
315
+ */
316
+ export declare const PRODUCT_ACTION_ENV: {
317
+ readonly comment: "CHANT_ACTION_COMMENT";
318
+ readonly member: "CHANT_ACTION_MEMBER";
319
+ readonly action: "CHANT_ACTION";
320
+ };
321
+ /** The flag the generated action job passes the product's action verb, so it reads {@link PRODUCT_ACTION_ENV} (#4654). */
322
+ export declare const PRODUCT_ACTION_EVENT_FLAG = "--from-event";
323
+ /** What an action job was asked for (#4654): a member and an action, from a comment or a dispatch. */
324
+ export type ProductActionRequest = {
325
+ kind: "action";
326
+ member: string;
327
+ address: string;
328
+ from: "comment" | "dispatch";
329
+ } | {
330
+ kind: "refused";
331
+ reason: string;
332
+ };
333
+ /**
334
+ * The action an action job was started for (#4654), read from
335
+ * {@link PRODUCT_ACTION_ENV}: a comment, parsed as {@link parseProductComment}
336
+ * parses it, else the dispatch's member and action, checked by the same
337
+ * rules. A product's action verb calls this under
338
+ * {@link PRODUCT_ACTION_EVENT_FLAG}.
339
+ */
340
+ export declare function productActionFromEnv(words: CiProductWords, env: Record<string, string | undefined>): ProductActionRequest;
296
341
  //# sourceMappingURL=ci-product-words.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ci-product-words.d.ts","sourceRoot":"","sources":["../src/ci-product-words.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iGAAiG;AACjG,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/G,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAAiF,CAAC;AAEzI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AAS,CA2FxJ;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;aAAK,OAAO,EAAE,sBAAsB;aAAE,MAAM,EAAE,qBAAqB;aAAE,MAAM,EAAE,cAAc;CAAW,CAAC;AAEtI,0HAA0H;AAC1H,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AAExD,sGAAsG;AACtG,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3J;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,oBAAoB,CAiBzH"}
@@ -24,7 +24,7 @@
24
24
  */
25
25
  /** Every stage slot, in the order {@link assertProductWords} reports them. */
26
26
  export const CI_PRODUCT_STAGES = ["plan", "apply", "record", "check", "drift", "lock", "approval", "control"];
27
- export const CI_PRODUCT_COMMANDS = ["plan", "apply", "lock", "unlock", "agent"];
27
+ export const CI_PRODUCT_COMMANDS = ["plan", "apply", "lock", "unlock", "agent", "action"];
28
28
  export const CI_PRODUCT_APPLY_MODES = ["on-merge", "release", "before-merge"];
29
29
  /** chant's own wave label in a notify summary. */
30
30
  export const CHANT_NOTIFY_WAVE_TEMPLATE = "wave {k} ({name}) of {spec}";
@@ -280,6 +280,12 @@ const MEMBER = /^[A-Za-z0-9_][A-Za-z0-9_.\/-]{0,199}$/;
280
280
  * It never reaches a shell: the job reads the comment from a variable.
281
281
  */
282
282
  const TARGET = /^[A-Za-z0-9_][A-Za-z0-9_.:\/\[\]"*@=+$,-]{0,499}$/;
283
+ /**
284
+ * An action as a comment may name it (#4653): a Terraform action address,
285
+ * module steps and instance keys included, or a configured action's name.
286
+ * No leading dash, no spaces, no shell or glob syntax.
287
+ */
288
+ const ACTION = /^[A-Za-z_][A-Za-z0-9_.\[\]"-]{0,299}$/;
283
289
  /** The longest ask an agent comment may carry. */
284
290
  export const PRODUCT_COMMENT_ASK_MAX = 2000;
285
291
  /** Commands a comment never runs, named in the reply so nobody waits on them. */
@@ -360,6 +366,18 @@ export function parseProductComment(words, body, env = {}) {
360
366
  return { kind: "refused", reason: "an ask is plain text, with no control characters" };
361
367
  return { kind: "agent", ask };
362
368
  }
369
+ case "action": {
370
+ const usage = `${line} takes a ${words.noun[0]} and an action: \`${prefix} ${typed} <${words.noun[0]}> <action>\``;
371
+ if (parts.length !== 4)
372
+ return { kind: "refused", reason: usage };
373
+ const member = parts[2];
374
+ const address = parts[3];
375
+ if (!MEMBER.test(member) || member.split("/").some((s) => s === "" || s === "." || s === ".."))
376
+ return { kind: "refused", reason: `the ${words.noun[0]} is a name or a path from the repository root` };
377
+ if (!ACTION.test(address))
378
+ return { kind: "refused", reason: "an action is an action address or name, with no spaces or shell characters" };
379
+ return { kind: "action", member, address };
380
+ }
363
381
  case "apply": {
364
382
  if (parts.length === 2)
365
383
  return { kind: "apply" };
@@ -405,3 +423,43 @@ export function parseProductComment(words, body, env = {}) {
405
423
  }
406
424
  }
407
425
  }
426
+ /**
427
+ * The variables the generated action job (#4654) hands the product's action
428
+ * verb: the comment that started it, on a comment, and the dispatch's two
429
+ * inputs, on a dispatch. The values reach the job as variables and never as
430
+ * shell text; {@link productActionFromEnv} reads them.
431
+ */
432
+ export const PRODUCT_ACTION_ENV = { comment: "CHANT_ACTION_COMMENT", member: "CHANT_ACTION_MEMBER", action: "CHANT_ACTION" };
433
+ /** The flag the generated action job passes the product's action verb, so it reads {@link PRODUCT_ACTION_ENV} (#4654). */
434
+ export const PRODUCT_ACTION_EVENT_FLAG = "--from-event";
435
+ /**
436
+ * The action an action job was started for (#4654), read from
437
+ * {@link PRODUCT_ACTION_ENV}: a comment, parsed as {@link parseProductComment}
438
+ * parses it, else the dispatch's member and action, checked by the same
439
+ * rules. A product's action verb calls this under
440
+ * {@link PRODUCT_ACTION_EVENT_FLAG}.
441
+ */
442
+ export function productActionFromEnv(words, env) {
443
+ const typed = commandWord(words, "action");
444
+ if (typed === undefined)
445
+ return { kind: "refused", reason: `${words.product} names no action command, so no job answers one` };
446
+ const comment = env[PRODUCT_ACTION_ENV.comment]?.trim();
447
+ if (comment) {
448
+ const parsed = parseProductComment(words, comment, env);
449
+ if (parsed?.kind === "action")
450
+ return { ...parsed, from: "comment" };
451
+ if (parsed?.kind === "refused")
452
+ return parsed;
453
+ return { kind: "refused", reason: `the comment is not \`/${words.product} ${typed} <${words.noun[0]}> <action>\`` };
454
+ }
455
+ const member = env[PRODUCT_ACTION_ENV.member]?.trim() ?? "";
456
+ const action = env[PRODUCT_ACTION_ENV.action]?.trim() ?? "";
457
+ if (member === "" || action === "")
458
+ return { kind: "refused", reason: `a dispatched action names a ${words.noun[0]} and an action` };
459
+ if (/\s/.test(member) || /\s/.test(action))
460
+ return { kind: "refused", reason: `a ${words.noun[0]} and an action are one word each` };
461
+ const parsed = parseProductComment(words, `/${words.product} ${typed} ${member} ${action}`, {});
462
+ if (parsed?.kind === "action")
463
+ return { ...parsed, from: "dispatch" };
464
+ return parsed?.kind === "refused" ? parsed : { kind: "refused", reason: `a dispatched action names a ${words.noun[0]} and an action` };
465
+ }
@@ -18,7 +18,7 @@ import type { ProductWaveHook } from "./op/op-waves-after-plan.js";
18
18
  * note (#4573).
19
19
  */
20
20
  export declare const CI_PRODUCT_FLOOR = "0.124.55";
21
- export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, type ApproveLineInput, type CiProductAlias, type CiProductApplyMode, type CiProductApproval, type CiProductCommand, type CiProductNotifyWords, type CiProductNotifyWordsInput, type CiProductStage, type CiProductWords, type CiProductWordsInput, type OverrideLineInput, type ParsedProductComment, } from "./ci-product-words.js";
21
+ export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productActionFromEnv, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, type ApproveLineInput, type CiProductAlias, type CiProductApplyMode, type CiProductApproval, type CiProductCommand, type CiProductNotifyWords, type CiProductNotifyWordsInput, type CiProductStage, type CiProductWords, type CiProductWordsInput, type OverrideLineInput, type ParsedProductComment, type ProductActionRequest, } from "./ci-product-words.js";
22
22
  export { driftNotifyFields, productNotifySource, productNotifyWords, productSendOptions, type DriftNotifyInput } from "./notify-product.js";
23
23
  /** The first chant with `chant notify relay` and the notify relay buttons (#4611). */
24
24
  export declare const NOTIFY_RELAY_FLOOR = "0.124.55";
@@ -31,7 +31,18 @@ export declare const NOTIFY_RELAY_FLOOR = "0.124.55";
31
31
  export declare const PR_PREVIEW_FLOOR = "0.124.55";
32
32
  export { decideRelayClick, handleRelayRequest, relayPrincipalFor, RELAY_ENV, slackRelayClick, slackSignature, startRelayServer, teamsRelayClick, teamsSignature, verifySlackRequest, verifyTeamsRequest, type RelayAnswer, type RelayClick, type RelayDeps, type RelayPending, type RelayRequest, type RelayResponse, type RelaySettings, } from "./notify-relay.js";
33
33
  export { componentWaveOutputsFile, componentWaveSteps, componentWavesSpec, productAgentSpec, productCommand, productDriftAgent, productPipelineJobs, productWavesSpec, productWavesSpecFile, PRODUCT_WAVES_SPEC_DIR, type ComponentWaveStepOptions, type ComponentWaveSteps, type ComponentWavesSpecOptions, type ProductAgentOptions, type ProductPipelineJobs, type ProductPipelineOptions, } from "./components/product-pipeline.js";
34
- export { prApplyComment, prCommentLockJobs, prCommentPreviewJob, prLoopSetup, engineSetupLines, withProductBin, type PrCommentLockJob, type PrCommentPreviewJob } from "./components/pr-pipeline.js";
34
+ export { prActionJob, PR_ACTION_JOB, prApplyComment, prCommentLockJobs, prCommentPreviewJob, prLoopSetup, engineSetupLines, withProductBin, type PrActionJob, type PrActionJobOptions, type PrCommentLockJob, type PrCommentPreviewJob } from "./components/pr-pipeline.js";
35
+ /**
36
+ * Day-2 actions in the product pipeline (#4654): the `action` comment
37
+ * command counted as answered by the product's own workflow
38
+ * (`productPipelineJobs(forge, env, { words, actions: true })`), or the
39
+ * pipeline's own action job (`actionJob`, `build --pr-loop --action-job`),
40
+ * which answers the comment and a dispatch with a member and an action
41
+ * input, and runs the product's action verb with `--from-event`. The verb
42
+ * reads what was asked with `productActionFromEnv`. A product
43
+ * feature-detects on this floor.
44
+ */
45
+ export declare const PRODUCT_ACTIONS_FLOOR = "0.124.58";
35
46
  export { CI_SERVICES_FLOOR, engineServices, githubServices, gitlabServices, serviceWaitLine, servicesJobEnv, type CiService } from "./components/ci-services.js";
36
47
  export { renderPrNote, prStatusContext, prApproveCommand, prApproveCommands, prApproveTargets, prMergeSentence, type PrMemberDetail } from "./pr-loop.js";
37
48
  export { upsertPlanNote } from "./pr-post.js";
@@ -113,5 +124,18 @@ export { parseRequiresList, PR_APPLY_REQUIRES, type PrApplyRequire } from "./pr-
113
124
  */
114
125
  export declare const PRODUCT_MCP_HOOK_FLOOR = "0.124.55";
115
126
  export type { ProductMcpContext, ProductMcpHook } from "./cli/mcp/product-tools.js";
127
+ /**
128
+ * The `--propose` tier (chant#4655): `runChantInProcess(["serve", "mcp",
129
+ * "--read-only", "--propose"], words, { mcp: hook })`, or `propose: true` on
130
+ * the hook, serves the read-only server's tools plus the product tools that
131
+ * declare `forgeWrite: true` on their `McpToolContribution`, tools that open
132
+ * a pull request or a comment and do nothing else. A product's own tool and
133
+ * hook types widen from `readOnly: true` to `readOnly: true` or `forgeWrite:
134
+ * true` for these, and its hook gains `propose?: boolean`. Feature-detect on
135
+ * `PRODUCT_MCP_PROPOSE_FLOOR`: on an older chant the read-only server drops a
136
+ * `forgeWrite` tool, and `--propose` is not a flag it parses.
137
+ */
138
+ export { PRODUCT_MCP_PROPOSE_FLOOR, PRODUCT_TOOL_PROPOSE_WORDS } from "./cli/mcp/product-tools.js";
139
+ export type { McpToolContribution } from "./mcp/types.js";
116
140
  export { activeOtlp, configureOtlp, OTLP_EXPORTER_FLOOR, RunEventTrace, type CapabilityTraceFacts, type CapabilityTraceSpan, type OtlpExporter, } from "./otlp.js";
117
141
  //# sourceMappingURL=ci-product.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ci-product.d.ts","sourceRoot":"","sources":["../src/ci-product.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGhE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,WAAW,EACX,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,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;GAMG;AACH,eAAO,MAAM,sBAAsB,aAAsB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEjF;;;;;;;;;;GAUG;AACH,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAChG,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,QAAQ,CAAC"}
@@ -16,7 +16,7 @@ import { OTLP_EXPORTER_FLOOR } from "./otlp.js";
16
16
  * note (#4573).
17
17
  */
18
18
  export const CI_PRODUCT_FLOOR = "0.124.55";
19
- export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, } from "./ci-product-words.js";
19
+ export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productActionFromEnv, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, } from "./ci-product-words.js";
20
20
  export { driftNotifyFields, productNotifySource, productNotifyWords, productSendOptions } from "./notify-product.js";
21
21
  /** The first chant with `chant notify relay` and the notify relay buttons (#4611). */
22
22
  export const NOTIFY_RELAY_FLOOR = "0.124.55";
@@ -29,7 +29,18 @@ export const NOTIFY_RELAY_FLOOR = "0.124.55";
29
29
  export const PR_PREVIEW_FLOOR = "0.124.55";
30
30
  export { decideRelayClick, handleRelayRequest, relayPrincipalFor, RELAY_ENV, slackRelayClick, slackSignature, startRelayServer, teamsRelayClick, teamsSignature, verifySlackRequest, verifyTeamsRequest, } from "./notify-relay.js";
31
31
  export { componentWaveOutputsFile, componentWaveSteps, componentWavesSpec, productAgentSpec, productCommand, productDriftAgent, productPipelineJobs, productWavesSpec, productWavesSpecFile, PRODUCT_WAVES_SPEC_DIR, } from "./components/product-pipeline.js";
32
- export { prApplyComment, prCommentLockJobs, prCommentPreviewJob, prLoopSetup, engineSetupLines, withProductBin } from "./components/pr-pipeline.js";
32
+ export { prActionJob, PR_ACTION_JOB, prApplyComment, prCommentLockJobs, prCommentPreviewJob, prLoopSetup, engineSetupLines, withProductBin } from "./components/pr-pipeline.js";
33
+ /**
34
+ * Day-2 actions in the product pipeline (#4654): the `action` comment
35
+ * command counted as answered by the product's own workflow
36
+ * (`productPipelineJobs(forge, env, { words, actions: true })`), or the
37
+ * pipeline's own action job (`actionJob`, `build --pr-loop --action-job`),
38
+ * which answers the comment and a dispatch with a member and an action
39
+ * input, and runs the product's action verb with `--from-event`. The verb
40
+ * reads what was asked with `productActionFromEnv`. A product
41
+ * feature-detects on this floor.
42
+ */
43
+ export const PRODUCT_ACTIONS_FLOOR = "0.124.58";
33
44
  export { CI_SERVICES_FLOOR, engineServices, githubServices, gitlabServices, serviceWaitLine, servicesJobEnv } from "./components/ci-services.js";
34
45
  export { renderPrNote, prStatusContext, prApproveCommand, prApproveCommands, prApproveTargets, prMergeSentence } from "./pr-loop.js";
35
46
  export { upsertPlanNote } from "./pr-post.js";
@@ -109,4 +120,16 @@ export { parseRequiresList, PR_APPLY_REQUIRES } from "./pr-requires.js";
109
120
  * `PRODUCT_MCP_HOOK_FLOOR`: present means both are.
110
121
  */
111
122
  export const PRODUCT_MCP_HOOK_FLOOR = OTLP_EXPORTER_FLOOR;
123
+ /**
124
+ * The `--propose` tier (chant#4655): `runChantInProcess(["serve", "mcp",
125
+ * "--read-only", "--propose"], words, { mcp: hook })`, or `propose: true` on
126
+ * the hook, serves the read-only server's tools plus the product tools that
127
+ * declare `forgeWrite: true` on their `McpToolContribution`, tools that open
128
+ * a pull request or a comment and do nothing else. A product's own tool and
129
+ * hook types widen from `readOnly: true` to `readOnly: true` or `forgeWrite:
130
+ * true` for these, and its hook gains `propose?: boolean`. Feature-detect on
131
+ * `PRODUCT_MCP_PROPOSE_FLOOR`: on an older chant the read-only server drops a
132
+ * `forgeWrite` tool, and `--propose` is not a flag it parses.
133
+ */
134
+ export { PRODUCT_MCP_PROPOSE_FLOOR, PRODUCT_TOOL_PROPOSE_WORDS } from "./cli/mcp/product-tools.js";
112
135
  export { activeOtlp, configureOtlp, OTLP_EXPORTER_FLOOR, RunEventTrace, } from "./otlp.js";
@@ -16,6 +16,8 @@ export interface InitOptions {
16
16
  skipMcp?: boolean;
17
17
  /** Register `chant serve mcp --read-only` in `.mcp.json` (`--mcp-read-only`, chant#4543) */
18
18
  mcpReadOnly?: boolean;
19
+ /** With `mcpReadOnly`, register `chant serve mcp --read-only --propose` (`--propose`, chant#4655) */
20
+ mcpPropose?: boolean;
19
21
  /** Skip interactive install prompt */
20
22
  skipInstall?: boolean;
21
23
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AASA,wEAAwE;AACxE,wBAAgB,eAAe,IAAI,MAAM,CAQxC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2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288
  // chant #2383 for the three-way disagreement that came of writing it into
289
289
  // the user's home directory instead.
290
290
  if (!options.skipMcp) {
291
- writeIfNotExists(mcpConfigPath(targetDir), generateMcpConfig(detectPackageManager(targetDir), { readOnly: options.mcpReadOnly }), MCP_CONFIG_FILENAME, createdFiles, warnings);
291
+ writeIfNotExists(mcpConfigPath(targetDir), generateMcpConfig(detectPackageManager(targetDir), { readOnly: options.mcpReadOnly, propose: options.mcpPropose }), MCP_CONFIG_FILENAME, createdFiles, warnings);
292
292
  }
293
293
  // Install skills from the lexicon's plugin. With --skill, install only
294
294
  // the matching skill; without, install all.
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAiGlD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,kBAAkB,GAAG,OAAO,GAAG,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,aAAa,GAAG,kBAAkB,CAAC,GAAG,MAAM,GAAG,SAAS,CA6BvO;AAuOD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsJnE"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAqGlD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,kBAAkB,GAAG,OAAO,GAAG,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,aAAa,GAAG,kBAAkB,CAAC,GAAG,MAAM,GAAG,SAAS,CA6BvO;AAuOD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsJnE"}
@@ -52,7 +52,9 @@ async function engineSetupFor(path) {
52
52
  * `--apply-before-merge` (#4301) writes the apply job that applies an open
53
53
  * pull request before it merges, beside the record job.
54
54
  * `--preview-comment` (#4620) writes the jobs that answer the product's plan
55
- * comment with a preview of the pull request's head.
55
+ * comment with a preview of the pull request's head. `--action-job` (#4654)
56
+ * writes the job that answers the product's action comment and a dispatch
57
+ * with a member and an action.
56
58
  * `--pr-runner`, `--pr-variable`, `--pr-secret` and `--parallelism` (#4625)
57
59
  * set each stage's runner, the plan and apply jobs' variables and passed
58
60
  * secrets, and how many members the plan plans at once.
@@ -80,6 +82,8 @@ function prLoopOption(args, reportUrl, requireReview = false, requireRunnerStart
80
82
  ...(args.prEnv ? { prEnvironment: true } : {}),
81
83
  ...(args.applyBeforeMerge ? { applyBeforeMerge: true } : {}),
82
84
  ...(args.previewComment ? { previewComment: true } : {}),
85
+ // #4654: the job that answers the action comment and the action dispatch.
86
+ ...(args.actionJob ? { actionJob: true } : {}),
83
87
  // #4628: the note carries its target commit, and a push marks the open notes stale.
84
88
  ...(args.staleNotes ? { staleNotes: true } : {}),
85
89
  ...(args.requires ? { applyRequires: args.requires } : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/init.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAsB,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BlE;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBzE"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/init.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAsB,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA4ClE;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBzE"}
@@ -3,6 +3,21 @@ export async function runInit(ctx) {
3
3
  const { args } = ctx;
4
4
  if (args.migrateFrom !== undefined)
5
5
  return runInitFrom(ctx);
6
+ // chant#4655 — --propose registers the read-only server's propose tier, so it needs --mcp-read-only.
7
+ if (args.propose === true && args.mcpReadOnly !== true) {
8
+ console.error(formatError({
9
+ message: "chant init --propose needs --mcp-read-only",
10
+ hint: "Usage: chant init --mcp-read-only --propose (registers chant serve mcp --read-only --propose in .mcp.json)",
11
+ }));
12
+ return 1;
13
+ }
14
+ // chant#4655 — --dry-run prints the .mcp.json init would register and writes nothing.
15
+ if (args.dryRun === true) {
16
+ const { detectPackageManager, generateMcpConfig } = await import("../mcp-config.js");
17
+ const target = args.path === "." || args.path === undefined ? process.cwd() : args.path;
18
+ console.log(generateMcpConfig(detectPackageManager(target), { readOnly: args.mcpReadOnly, propose: args.propose }));
19
+ return 0;
20
+ }
6
21
  if (!args.lexicon) {
7
22
  console.error(formatError({
8
23
  message: "Missing --lexicon flag",
@@ -19,6 +34,7 @@ export async function runInit(ctx) {
19
34
  force: args.force,
20
35
  skipMcp: args.skipMcp,
21
36
  mcpReadOnly: args.mcpReadOnly,
37
+ mcpPropose: args.propose,
22
38
  skipInstall: true,
23
39
  });
24
40
  await printInitResult(result, { skipInstall: false, cwd: args.path });
@@ -12,7 +12,8 @@
12
12
  * never imports a lexicon to read drift.
13
13
  *
14
14
  * `--member` names the workspace member the records are for; it defaults to
15
- * the project directory's name. A lexicon that refuses the read (a read its
15
+ * the project directory's name. `--stack` names the stack to read, for a
16
+ * lexicon whose store holds one export per stack (pulumi). A lexicon that refuses the read (a read its
16
17
  * engine has not got, or one resource on an engine that cannot read one on
17
18
  * its own) makes the command print `{"refused": {code, message}}` as its
18
19
  * only stdout line and exit 3, so the workspace command can name the
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle-drift.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAoB,CAAC;AASpD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B5E"}
1
+ {"version":3,"file":"lifecycle-drift.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAoB,CAAC;AASpD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+B5E"}
@@ -12,7 +12,8 @@
12
12
  * never imports a lexicon to read drift.
13
13
  *
14
14
  * `--member` names the workspace member the records are for; it defaults to
15
- * the project directory's name. A lexicon that refuses the read (a read its
15
+ * the project directory's name. `--stack` names the stack to read, for a
16
+ * lexicon whose store holds one export per stack (pulumi). A lexicon that refuses the read (a read its
16
17
  * engine has not got, or one resource on an engine that cannot read one on
17
18
  * its own) makes the command print `{"refused": {code, message}}` as its
18
19
  * only stdout line and exit 3, so the workspace command can name the
@@ -29,7 +30,7 @@ import { formatError } from "../format.js";
29
30
  * reads that line, so the code carries nothing more.
30
31
  */
31
32
  export const DRIFT_REFUSED_EXIT = CHANT_EXIT.failed;
32
- const USAGE = "chant lifecycle drift [--member <name>] [--read <state|plan|refresh|live-read|ownership>] [--resource <addr>]";
33
+ const USAGE = "chant lifecycle drift [--member <name>] [--read <state|plan|refresh|live-read|ownership>] [--resource <addr>] [--stack <name>]";
33
34
  function refuse(code, message) {
34
35
  console.log(JSON.stringify({ refused: { code, message } }));
35
36
  return DRIFT_REFUSED_EXIT;
@@ -57,6 +58,7 @@ export async function runLifecycleDrift(ctx) {
57
58
  config: config,
58
59
  ...(read !== undefined ? { read: read } : {}),
59
60
  ...(args.resource !== undefined ? { resource: args.resource } : {}),
61
+ ...(args.carveStack !== undefined ? { stack: args.carveStack } : {}),
60
62
  observedAt,
61
63
  });
62
64
  if ("refused" in answer)
@@ -1 +1 @@
1
- {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lock.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkBlD,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,eAAe,CAAC;AA4DhD,iBAAiB;AACjB,wBAAsB,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAgHlE;AAED,mBAAmB;AACnB,wBAAsB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBpE"}
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lock.ts"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkBlD,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,eAAe,CAAC;AA4DhD,iBAAiB;AACjB,wBAAsB,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAgIlE;AAED,mBAAmB;AACnB,wBAAsB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoCpE"}
@@ -9,6 +9,7 @@
9
9
  * chant lock --list [--gate <name>] [--json]
10
10
  * chant lock --alive <run>
11
11
  * chant unlock --pr <n> [<target>...] [--gate <name>] [--json]
12
+ * chant unlock --run <id> [--gate <name>] [--json]
12
13
  * ```
13
14
  *
14
15
  * The targets are names: the components `chant components pr-plan` selects,
@@ -35,6 +36,11 @@
35
36
  * finished, `alive` while it runs or when nobody can say. The lock tag's
36
37
  * shell asks it before taking a lease over.
37
38
  *
39
+ * `chant unlock --run <id>` (#4660) frees every row run `<id>` holds on the
40
+ * gate and drops its place in the queue, for a hold whose run is gone and
41
+ * that no beat or forge answer has freed. `--beat <run> --parent <pid>` is
42
+ * the heartbeat side process of a hold (../../lifecycle/lock-beat.ts).
43
+ *
38
44
  * `--forge` reads which holders are still open, so a lock whose pull
39
45
  * request merged or closed is taken over, and, with `--head`, posts the
40
46
  * `chant/lock` status on that commit. Without it every lock counts as held.
@@ -124,6 +130,22 @@ export async function runLock(ctx) {
124
130
  console.log(verdict);
125
131
  return 0;
126
132
  }
133
+ if (args.beatRun !== undefined) {
134
+ if (args.parentPid === undefined)
135
+ return fail("--beat needs the process it beats for: --beat <run> --parent <pid>");
136
+ const { beatLockRows, lockBeatSeconds } = await import("../../lifecycle/resource-lock.js");
137
+ const { runBeatLoop } = await import("../../lifecycle/lock-beat.js");
138
+ const run = args.beatRun;
139
+ await runBeatLoop({
140
+ gate,
141
+ run,
142
+ parent: args.parentPid,
143
+ intervalMs: lockBeatSeconds(process.env) * 1000,
144
+ beat: (at) => beatLockRows(gate, run, at),
145
+ log: (line) => console.error(line),
146
+ });
147
+ return 0;
148
+ }
127
149
  if (args.list) {
128
150
  if (targetsOf(ctx).length > 0 || args.pr !== undefined)
129
151
  return fail("--list prints every lock; drop the targets and --pr");
@@ -154,7 +176,7 @@ export async function runLock(ctx) {
154
176
  if (leased.length === 0)
155
177
  console.error(formatInfo(`no apply rows held on ${gate}`));
156
178
  for (const { key, holder } of leased)
157
- console.log(`${key}\trun ${holder.run}\t${holder.at}${holder.url ? `\t${holder.url}` : ""}`);
179
+ console.log(`${key}\trun ${holder.run}\t${holder.at}${holder.url ? `\t${holder.url}` : ""}${holder.beat ? `\tbeat ${holder.beat}` : ""}`);
158
180
  return 0;
159
181
  }
160
182
  if (args.pr === undefined)
@@ -234,8 +256,29 @@ export async function runUnlock(ctx) {
234
256
  const gate = gateOf(ctx);
235
257
  if (typeof gate !== "string")
236
258
  return fail(gate.error);
259
+ if (args.unlockRun !== undefined) {
260
+ if (args.pr !== undefined || targetsOf(ctx).length > 0)
261
+ return fail("--run frees the rows of one run; drop --pr and the targets");
262
+ const { clearRunLockRows } = await import("../../lifecycle/resource-lock.js");
263
+ let cleared;
264
+ try {
265
+ cleared = await clearRunLockRows(gate, args.unlockRun);
266
+ }
267
+ catch (err) {
268
+ return fail(`could not clear run ${args.unlockRun} from ${gate}: ${err instanceof Error ? err.message : String(err)}`);
269
+ }
270
+ if (args.json) {
271
+ console.log(JSON.stringify({ gate, run: args.unlockRun, released: cleared.released, waited: cleared.waited, pushed: cleared.pushed }, null, 2));
272
+ return 0;
273
+ }
274
+ if (cleared.released.length === 0 && !cleared.waited)
275
+ console.error(formatInfo(`run ${args.unlockRun} holds no row and waits for none on ${gate}`));
276
+ else
277
+ console.error(formatSuccess(`freed ${cleared.released.length > 0 ? cleared.released.join(", ") : "no row"}${cleared.waited ? " and took run " + args.unlockRun + " out of the queue" : ""} on ${gate}`));
278
+ return 0;
279
+ }
237
280
  if (args.pr === undefined)
238
- return fail("chant unlock needs the pull or merge request whose locks it releases: --pr <n>");
281
+ return fail("chant unlock needs the pull or merge request whose locks it releases: --pr <n>, or the run whose rows it frees: --run <id>");
239
282
  const targets = targetsOf(ctx);
240
283
  let result;
241
284
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/serve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAMtE;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBtE;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM1E"}
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/serve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAMtE;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAkCtE;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM1E"}
@@ -7,6 +7,14 @@ export async function runServeLsp(ctx) {
7
7
  return 0; // unreachable
8
8
  }
9
9
  export async function runServeMcp(ctx) {
10
+ // chant#4655 — --propose is a tier of the read-only server, never of the ordinary one.
11
+ if (ctx.args.propose === true && ctx.args.readOnly !== true) {
12
+ console.error(formatError({
13
+ message: "chant serve mcp --propose needs --read-only",
14
+ hint: "Usage: chant serve mcp --read-only --propose (serves the read tools and a product's tools that open pull requests)",
15
+ }));
16
+ return 1;
17
+ }
10
18
  const { McpServer } = await import("../mcp/server.js");
11
19
  // #2700 — main() hands over no plugins only at a workspace root with no
12
20
  // lexicon of its own (anywhere else it refuses first). There the lexicons
@@ -26,6 +34,7 @@ export async function runServeMcp(ctx) {
26
34
  instructions,
27
35
  workspace: { cwd: process.cwd() },
28
36
  ...(ctx.args.readOnly === true ? { readOnly: true } : {}),
37
+ ...(ctx.args.propose === true ? { propose: true } : {}),
29
38
  ...(product ? { product } : {}),
30
39
  });
31
40
  await server.start();
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAEA,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,IAAI,CAAC,EAAE,OAAO,2BAA2B,EAAE,eAAe,CAAA;CAAO,GAC7K,OAAO,CAAC,MAAM,CAAC,CAuCjB;AAID;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,UAAU,EA8PvC,CAAC"}
package/dist/cli/main.js CHANGED
@@ -17,6 +17,7 @@ import { installCompiledCli } from "../ts-loader.js";
17
17
  import { dispatchCommandGroup, collectCommandGroups, formatCommandGroupsHelp } from "./command-group.js";
18
18
  import { parseArgs } from "./parse-args.js";
19
19
  import { flushAndExit, waitForStreamDrain } from "./flush.js";
20
+ import { setOwnChantCommand } from "../lifecycle/lock-beat.js";
20
21
  export { parseArgs, waitForStreamDrain };
21
22
  const handlerModules = new Map();
22
23
  function lazyHandler(load, pick) {
@@ -662,7 +663,8 @@ Ops:
662
663
  posts chant/lock on --head. Exits 3 when another open
663
664
  pull request holds a target. --list prints the locks
664
665
  unlock [<target>...] Release the locks a pull request holds (--pr <n>,
665
- --gate <name>, --json)
666
+ --gate <name>, --json). --run <id> frees the rows a
667
+ run holds or waits for on the gate instead
666
668
  graph Show Op dependency graph (--stacks for cross-stack order,
667
669
  --format ir|mermaid|dot|layout for the lint-gated graph IR,
668
670
  a Mermaid flowchart, Graphviz DOT, or node positions;
@@ -1349,7 +1351,9 @@ Local:
1349
1351
  Servers:
1350
1352
  serve lsp Start the LSP server (stdio)
1351
1353
  serve mcp Start the MCP server (stdio); --read-only serves only
1352
- the tools that read (ledger, graph, runs) and run nothing
1354
+ the tools that read (ledger, graph, runs) and run nothing;
1355
+ --read-only --propose also serves a product's tools that
1356
+ open pull requests and comments, and nothing that approves
1353
1357
 
1354
1358
  Project:
1355
1359
  update (alias: sync) Sync lexicon types into .chant/types/ (does not install
@@ -1376,7 +1380,9 @@ Options:
1376
1380
  records its lineage in .chant/workspace.lock.json
1377
1381
  --skill <name> Init: install only this skill from the lexicon
1378
1382
  --skip-mcp Init: scaffold without writing the project's .mcp.json
1379
- --mcp-read-only Init: register \`chant serve mcp --read-only\` in .mcp.json
1383
+ --mcp-read-only Init: register \`chant serve mcp --read-only\` in .mcp.json;
1384
+ with --propose, \`chant serve mcp --read-only --propose\`.
1385
+ Init --dry-run prints that .mcp.json and writes nothing
1380
1386
  --fix Auto-fix fixable issues (lint command)
1381
1387
  --force Force overwrite existing files (import command)
1382
1388
  -w, --watch Watch for changes and rebuild/re-lint (build, lint)
@@ -2158,6 +2164,8 @@ async function main() {
2158
2164
  // whole CLI through the npm .bin shim / a symlinked checkout).
2159
2165
  const isMain = isEntryPoint(process.argv[1], import.meta.url);
2160
2166
  if (isMain) {
2167
+ // #4660: a row hold starts its heartbeat as this chant, run again.
2168
+ setOwnChantCommand([process.execPath, ...process.execArgv, process.argv[1]]);
2161
2169
  main().catch(async (err) => {
2162
2170
  const verbose = process.argv.includes("--verbose") || process.argv.includes("-v");
2163
2171
  // #4116: a failure to import a package the project has not installed is named as such first.