@unbrained/pm-cli 2026.8.22 → 2026.8.24

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 (229) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +42 -1
  3. package/dist/cli/description-stdin.js +5 -4
  4. package/dist/cli/error-guidance.d.ts +13 -0
  5. package/dist/cli/error-guidance.js +62 -6
  6. package/dist/cli/extension-command-help.d.ts +5 -0
  7. package/dist/cli/extension-command-help.js +6 -2
  8. package/dist/cli/help-content.d.ts +5 -0
  9. package/dist/cli/help-content.js +56 -3
  10. package/dist/cli/help-json-payload.d.ts +5 -2
  11. package/dist/cli/help-json-payload.js +57 -17
  12. package/dist/cli/main.d.ts +3 -0
  13. package/dist/cli/main.js +39 -5
  14. package/dist/cli/register-annotations.js +5 -5
  15. package/dist/cli/register-mutation.js +77 -31
  16. package/dist/cli/register-operations.d.ts +73 -0
  17. package/dist/cli/register-operations.js +39 -14
  18. package/dist/cli/register-setup.js +3 -3
  19. package/dist/cli/schema-registration-helpers.d.ts +8 -1
  20. package/dist/cli/schema-registration-helpers.js +14 -5
  21. package/dist/cli-bundle/bundle-manifest.json +155 -155
  22. package/dist/cli-bundle/chunks/chunk-AGUL3HUT.js +3 -0
  23. package/dist/cli-bundle/chunks/{chunk-WG4STC36.js → chunk-DJNJBWAQ.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-MYYI3ZOA.js → chunk-I5Q7QSZX.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-IW72J5FW.js +2 -0
  26. package/dist/cli-bundle/chunks/{chunk-BWX4SK46.js → chunk-L22NP5MA.js} +66 -66
  27. package/dist/cli-bundle/chunks/chunk-MKE6MD2K.js +36 -0
  28. package/dist/cli-bundle/chunks/{chunk-MZTZQTMS.js → chunk-NXBFO63A.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-TEQDR5KI.js +202 -0
  30. package/dist/cli-bundle/chunks/chunk-X7WWQDYQ.js +2 -0
  31. package/dist/cli-bundle/chunks/chunk-YOLLRCLY.js +13 -0
  32. package/dist/cli-bundle/chunks/{chunk-U6GQ4VMV.js → chunk-ZAVCS2GH.js} +4 -4
  33. package/dist/cli-bundle/chunks/{register-list-query-HZKBQNWW.js → register-list-query-37A4P6O4.js} +2 -2
  34. package/dist/cli-bundle/chunks/register-mutation-TBJDHYIT.js +20 -0
  35. package/dist/cli-bundle/chunks/register-operations-WRZNEBUM.js +2 -0
  36. package/dist/cli-bundle/chunks/{register-setup-QK4OTOXN.js → register-setup-H4PDLACD.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-GMYPD4FX.js → chunk-4WP7LNE3.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-6MUTDXMP.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-6Z24ZMU3.js +2 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-2ARQGDDW.js → chunk-BFA6KKCI.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-CWCN5RLO.js +26 -0
  42. package/dist/cli-bundle/focused-chunks/chunk-FCTT4CZU.js +5 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-GJR6YEMR.js +156 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-2POVTNLY.js → chunk-IMWTYKII.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-D6RBZEJJ.js → chunk-IZNRRCU3.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-PMGJUFNQ.js → chunk-MNPECIRL.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-A2BC5PQL.js → chunk-O4ZXNJMT.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-Q63PSLO4.js +2 -0
  49. package/dist/cli-bundle/focused-chunks/chunk-QBP5FSBX.js +4 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-R6SR45XU.js → chunk-QV5UP27O.js} +48 -47
  51. package/dist/cli-bundle/focused-chunks/chunk-RASVBJX5.js +8 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-E2EWYPY6.js → chunk-RPRLENVA.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-TOFVXBWA.js +19 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-6S2MO3Q3.js → chunk-WZLSSGEU.js} +2 -2
  55. package/dist/cli-bundle/main.js +18 -17
  56. package/dist/cli-bundle/sdk-authoring.js +1 -1
  57. package/dist/cli-bundle/sdk-contracts.js +2 -2
  58. package/dist/cli-bundle/sdk-core.js +41 -41
  59. package/dist/cli-bundle/sdk-governance.js +1 -1
  60. package/dist/cli-bundle/sdk-graph.js +1 -1
  61. package/dist/cli-bundle/sdk-merge.js +33 -32
  62. package/dist/cli-bundle/sdk-query.js +1 -1
  63. package/dist/cli-bundle/sdk-runtime.js +1 -1
  64. package/dist/cli-bundle/sdk-testing.js +1 -1
  65. package/dist/cli-bundle/sdk.js +6 -5
  66. package/dist/core/config/nested-settings.js +8 -2
  67. package/dist/core/config/positional-value.d.ts +1 -1
  68. package/dist/core/config/positional-value.js +5 -2
  69. package/dist/core/extensions/command-metadata-contract.d.ts +10 -0
  70. package/dist/core/extensions/command-metadata-contract.js +23 -0
  71. package/dist/core/extensions/command-visibility-tier.js +12 -2
  72. package/dist/core/extensions/extension-types.d.ts +6 -0
  73. package/dist/core/extensions/extension-types.js +2 -2
  74. package/dist/core/extensions/loader.js +4 -3
  75. package/dist/core/history/history.js +3 -3
  76. package/dist/core/io/body-file.js +7 -2
  77. package/dist/core/io/bulk-ids-input.d.ts +24 -0
  78. package/dist/core/io/bulk-ids-input.js +113 -0
  79. package/dist/core/item/item-format.js +66 -12
  80. package/dist/core/item/parse.d.ts +22 -2
  81. package/dist/core/item/parse.js +97 -4
  82. package/dist/core/reproducibility/context.d.ts +4 -0
  83. package/dist/core/reproducibility/context.js +14 -8
  84. package/dist/core/shared/author.d.ts +55 -1
  85. package/dist/core/shared/author.js +333 -16
  86. package/dist/core/shared/constants.js +3 -2
  87. package/dist/core/store/settings-validator.d.ts +1 -0
  88. package/dist/core/store/settings-validator.js +6 -3
  89. package/dist/core/store/settings.js +5 -2
  90. package/dist/mcp/server.d.ts +4 -3
  91. package/dist/mcp/server.js +44 -16
  92. package/dist/sdk/agent/identity-config.d.ts +63 -0
  93. package/dist/sdk/agent/identity-config.js +107 -0
  94. package/dist/sdk/agent/refusal-closure-census.d.ts +66 -0
  95. package/dist/sdk/agent/refusal-closure-census.js +144 -0
  96. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +76 -0
  97. package/dist/sdk/agent/refusal-corpus-contracts.js +194 -0
  98. package/dist/sdk/agent-capability-contracts.d.ts +34 -1
  99. package/dist/sdk/agent-capability-contracts.js +104 -6
  100. package/dist/sdk/annotations.d.ts +2 -0
  101. package/dist/sdk/annotations.js +25 -7
  102. package/dist/sdk/cli-contracts/agent-output-contracts.js +6 -4
  103. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  104. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  105. package/dist/sdk/cli-contracts/flag-contracts.js +9 -2
  106. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +4 -4
  107. package/dist/sdk/cli-contracts/registration-helpers.js +5 -2
  108. package/dist/sdk/cli-contracts/tool-parameter-tables.js +58 -2
  109. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  110. package/dist/sdk/cli-contracts/tool-schema.js +14 -3
  111. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +4 -1
  112. package/dist/sdk/cli-contracts/typed-action-inputs.js +2 -2
  113. package/dist/sdk/cli-contracts.d.ts +3 -3
  114. package/dist/sdk/cli-contracts.js +4 -4
  115. package/dist/sdk/comments.js +15 -7
  116. package/dist/sdk/config.d.ts +6 -1
  117. package/dist/sdk/config.js +119 -14
  118. package/dist/sdk/context-intent-contracts.js +4 -2
  119. package/dist/sdk/core-governance.d.ts +1 -1
  120. package/dist/sdk/core-governance.js +3 -3
  121. package/dist/sdk/extension/scaffold.js +11 -5
  122. package/dist/sdk/flag-invocation-contracts.d.ts +2 -0
  123. package/dist/sdk/flag-invocation-contracts.js +30 -3
  124. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +83 -2
  125. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +87 -2
  126. package/dist/sdk/governance/assurance-action.js +30 -10
  127. package/dist/sdk/governance/validate.d.ts +2 -2
  128. package/dist/sdk/governance/validate.js +39 -14
  129. package/dist/sdk/guide-topics.d.ts +0 -5
  130. package/dist/sdk/guide-topics.js +28 -2
  131. package/dist/sdk/history-compact.d.ts +2 -1
  132. package/dist/sdk/history-compact.js +24 -5
  133. package/dist/sdk/history-mcp.js +11 -10
  134. package/dist/sdk/index.d.ts +8 -2
  135. package/dist/sdk/index.js +9 -3
  136. package/dist/sdk/item-transaction.js +19 -12
  137. package/dist/sdk/lifecycle/append.js +4 -4
  138. package/dist/sdk/lifecycle/close-many.js +16 -7
  139. package/dist/sdk/lifecycle/create.js +33 -22
  140. package/dist/sdk/lifecycle/plan.js +24 -6
  141. package/dist/sdk/lifecycle/update-many.js +15 -8
  142. package/dist/sdk/lifecycle/update.d.ts +2 -0
  143. package/dist/sdk/lifecycle/update.js +37 -25
  144. package/dist/sdk/merge/three-way.js +105 -26
  145. package/dist/sdk/read-output-budget.d.ts +21 -0
  146. package/dist/sdk/read-output-budget.js +39 -2
  147. package/dist/sdk/read-output-contracts.d.ts +5 -3
  148. package/dist/sdk/read-output-contracts.js +20 -12
  149. package/dist/sdk/reproducibility/process.d.ts +19 -0
  150. package/dist/sdk/reproducibility/process.js +88 -0
  151. package/dist/sdk/runtime-extended-actions.js +5 -3
  152. package/dist/sdk/runtime-input.d.ts +4 -0
  153. package/dist/sdk/runtime-input.js +98 -23
  154. package/dist/sdk/runtime-primitives.d.ts +3 -2
  155. package/dist/sdk/runtime-primitives.js +5 -4
  156. package/dist/sdk/runtime.js +11 -23
  157. package/dist/sdk/scheduling-shortcuts.js +5 -3
  158. package/dist/sdk/structured-mutations.js +10 -3
  159. package/dist/sdk/test/batch.d.ts +6 -0
  160. package/dist/sdk/test/batch.js +15 -3
  161. package/dist/sdk/test/entry.d.ts +1 -1
  162. package/dist/sdk/test/entry.js +3 -2
  163. package/dist/sdk/test/execution.d.ts +28 -3
  164. package/dist/sdk/test/execution.js +193 -34
  165. package/dist/sdk/test/parsers.d.ts +6 -0
  166. package/dist/sdk/test/parsers.js +21 -2
  167. package/dist/sdk/test/trust.d.ts +33 -0
  168. package/dist/sdk/test/trust.js +207 -0
  169. package/dist/sdk/workspace-contracts.d.ts +3 -0
  170. package/dist/sdk/workspace-contracts.js +3 -2
  171. package/dist/types.d.ts +23 -0
  172. package/dist/types.js +2 -2
  173. package/docs/AGENT_PROVENANCE_ADR.md +41 -5
  174. package/docs/CONFIGURATION.md +4 -0
  175. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +19 -2
  176. package/docs/MERGE_SAFETY.md +15 -1
  177. package/docs/README.md +2 -0
  178. package/docs/READ_OUTPUT_CONTRACTS.md +11 -1
  179. package/docs/RELEASING.md +40 -21
  180. package/docs/REPRODUCIBLE_WORKSPACES.md +42 -8
  181. package/docs/SCRIPTING.md +62 -3
  182. package/docs/SDK.md +17 -0
  183. package/docs/SDK_AGENT_SESSION_CONTEXT.md +6 -4
  184. package/docs/SDK_EVIDENCE_TRACEABILITY.md +1 -1
  185. package/docs/TESTING.md +75 -8
  186. package/docs/agent-task-token-baseline.json +2 -2
  187. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +17 -0
  188. package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
  189. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  190. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +355 -0
  191. package/marketplace.json +2 -2
  192. package/package.json +2 -2
  193. package/packages/pm-beads/package.json +1 -1
  194. package/packages/pm-calendar/package.json +1 -1
  195. package/packages/pm-command-kit/README.md +9 -11
  196. package/packages/pm-command-kit/extensions/command-kit/index.ts +3 -1
  197. package/packages/pm-command-kit/package.json +1 -1
  198. package/packages/pm-digital-twin/package.json +1 -1
  199. package/packages/pm-governance-audit/package.json +1 -1
  200. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +10 -0
  201. package/packages/pm-guide-shell/package.json +1 -1
  202. package/packages/pm-kanban/package.json +1 -1
  203. package/packages/pm-lifecycle-hooks/package.json +1 -1
  204. package/packages/pm-linked-test-adapters/package.json +1 -1
  205. package/packages/pm-search-advanced/package.json +1 -1
  206. package/packages/pm-templates/package.json +1 -1
  207. package/packages/pm-todos/package.json +1 -1
  208. package/packages/pm-vcs/package.json +1 -1
  209. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  210. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  211. package/scripts/generate-agent-capability-surfaces.mjs +27 -1
  212. package/sdk/public-surface.json +642 -28
  213. package/dist/cli-bundle/chunks/chunk-EMWDM5FI.js +0 -13
  214. package/dist/cli-bundle/chunks/chunk-HYG6LRL4.js +0 -200
  215. package/dist/cli-bundle/chunks/chunk-QI2CT3IX.js +0 -2
  216. package/dist/cli-bundle/chunks/chunk-SMWXHMVB.js +0 -35
  217. package/dist/cli-bundle/chunks/chunk-VMMIL3SI.js +0 -2
  218. package/dist/cli-bundle/chunks/chunk-YBPJAOQQ.js +0 -3
  219. package/dist/cli-bundle/chunks/register-mutation-HTKEEGRD.js +0 -20
  220. package/dist/cli-bundle/chunks/register-operations-6EMRWJJY.js +0 -2
  221. package/dist/cli-bundle/focused-chunks/chunk-2AZT5WXZ.js +0 -2
  222. package/dist/cli-bundle/focused-chunks/chunk-3LKU6PTJ.js +0 -4
  223. package/dist/cli-bundle/focused-chunks/chunk-5SHSBMX2.js +0 -2
  224. package/dist/cli-bundle/focused-chunks/chunk-C4S4A4JJ.js +0 -5
  225. package/dist/cli-bundle/focused-chunks/chunk-L5LDSRO2.js +0 -155
  226. package/dist/cli-bundle/focused-chunks/chunk-MB37AYN6.js +0 -26
  227. package/dist/cli-bundle/focused-chunks/chunk-MCOR37QK.js +0 -2
  228. package/dist/cli-bundle/focused-chunks/chunk-PH2OXXVZ.js +0 -18
  229. package/dist/cli-bundle/focused-chunks/chunk-WZE4LIPW.js +0 -8
@@ -4,7 +4,7 @@
4
4
  * Defines item parsing, formatting, and lifecycle helpers for Parse.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d5003dd5-f208-5734-9711-dff935d8c851")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2252cfb9-37ea-57f1-b7ea-2b0c0f87ecb2")}catch(e){}}();
8
8
  import { PmCliError } from "../shared/errors.js";
9
9
  import { EXIT_CODE } from "../shared/constants.js";
10
10
  const STDIN_TOKEN = "-";
@@ -416,6 +416,95 @@ async function readStdinText(optionName) {
416
416
  });
417
417
  });
418
418
  }
419
+ const ALL_MUTATION_STDIN_FIELDS = Symbol("all-mutation-stdin-fields");
420
+ const literalStdinTokenFields = new WeakMap();
421
+ /** Mark transport-decoded options whose dash values are data, not stdin tokens. */
422
+ export function preserveMutationStdinTokenLiterals(options) {
423
+ literalStdinTokenFields.set(options, ALL_MUTATION_STDIN_FIELDS);
424
+ return options;
425
+ }
426
+ /** Mark selected mutation fields whose dash values are literal transport data. */
427
+ export function preserveMutationStdinTokenFields(options, fields) {
428
+ const current = literalStdinTokenFields.get(options);
429
+ if (current === ALL_MUTATION_STDIN_FIELDS)
430
+ return options;
431
+ literalStdinTokenFields.set(options, new Set([...(current ?? []), ...fields]));
432
+ return options;
433
+ }
434
+ /** Copy the complete mutation stdin-token policy across an option clone. */
435
+ export function transferMutationStdinTokenPolicy(source, target) {
436
+ const policy = literalStdinTokenFields.get(source);
437
+ if (policy === undefined)
438
+ return target;
439
+ literalStdinTokenFields.set(target, policy === ALL_MUTATION_STDIN_FIELDS ? policy : new Set(policy));
440
+ return target;
441
+ }
442
+ /** Add a source mutation stdin-token policy without weakening the target. */
443
+ export function overlayMutationStdinTokenPolicy(source, target) {
444
+ const sourcePolicy = literalStdinTokenFields.get(source);
445
+ const targetPolicy = literalStdinTokenFields.get(target);
446
+ if (sourcePolicy === undefined ||
447
+ targetPolicy === ALL_MUTATION_STDIN_FIELDS) {
448
+ return target;
449
+ }
450
+ if (sourcePolicy === ALL_MUTATION_STDIN_FIELDS) {
451
+ literalStdinTokenFields.set(target, sourcePolicy);
452
+ return target;
453
+ }
454
+ literalStdinTokenFields.set(target, new Set([...(targetPolicy ?? []), ...sourcePolicy]));
455
+ return target;
456
+ }
457
+ /** Report whether lifecycle input should interpret dash values as stdin tokens. */
458
+ export function shouldResolveMutationStdinTokens(options) {
459
+ return literalStdinTokenFields.get(options) !== ALL_MUTATION_STDIN_FIELDS;
460
+ }
461
+ /** Report whether one mutation field should interpret dash as a stdin token. */
462
+ export function shouldResolveMutationStdinTokenField(options, field) {
463
+ const literalFields = literalStdinTokenFields.get(options);
464
+ return (literalFields !== ALL_MUTATION_STDIN_FIELDS && !literalFields?.has(field));
465
+ }
466
+ /** Refuse competing stdin-token fields before any resolver starts reading. */
467
+ export function assertSingleStdinTokenConsumer(candidates) {
468
+ let stdinConsumerOption;
469
+ for (const candidate of candidates) {
470
+ if (candidate.resolveToken === false || candidate.value === undefined) {
471
+ continue;
472
+ }
473
+ const values = Array.isArray(candidate.value)
474
+ ? candidate.value
475
+ : [candidate.value];
476
+ const tokenCount = values.filter((value) => value.trim() === STDIN_TOKEN).length;
477
+ if (tokenCount > 1) {
478
+ throw new PmCliError(`${candidate.optionName} accepts "${STDIN_TOKEN}" stdin token at most once per command invocation`, EXIT_CODE.USAGE);
479
+ }
480
+ if (tokenCount === 0)
481
+ continue;
482
+ if (stdinConsumerOption !== undefined &&
483
+ stdinConsumerOption !== candidate.optionName) {
484
+ throw new PmCliError(`Only one option may use "${STDIN_TOKEN}" stdin token per command invocation. Already used by ${stdinConsumerOption}.`, EXIT_CODE.USAGE);
485
+ }
486
+ stdinConsumerOption = candidate.optionName;
487
+ }
488
+ }
489
+ /** Resolve a typed mutation option bag only after its complete stdin plan is conflict-free. */
490
+ export async function resolveMutationStdinTokenFields(options, scalarFields, listFields) {
491
+ const source = options;
492
+ const definitions = [...scalarFields, ...listFields];
493
+ assertSingleStdinTokenConsumer(definitions.map(([field, optionName]) => ({
494
+ value: source[field],
495
+ optionName,
496
+ resolveToken: shouldResolveMutationStdinTokenField(options, field),
497
+ })));
498
+ const stdinResolver = createStdinTokenResolver();
499
+ const resolved = { ...source };
500
+ for (const [field, optionName] of scalarFields) {
501
+ resolved[field] = await stdinResolver.resolveValue(source[field], optionName, shouldResolveMutationStdinTokenField(options, field));
502
+ }
503
+ for (const [field, optionName] of listFields) {
504
+ resolved[field] = await stdinResolver.resolveList(source[field], optionName, shouldResolveMutationStdinTokenField(options, field));
505
+ }
506
+ return preserveMutationStdinTokenLiterals(resolved);
507
+ }
419
508
  /** Implements create stdin token resolver for the public runtime surface of this module. */
420
509
  export function createStdinTokenResolver() {
421
510
  let stdinValuePromise;
@@ -430,7 +519,9 @@ export function createStdinTokenResolver() {
430
519
  }
431
520
  return await stdinValuePromise;
432
521
  };
433
- const resolveValue = async (value, optionName) => {
522
+ const resolveValue = async (value, optionName, resolveToken = true) => {
523
+ if (!resolveToken)
524
+ return value;
434
525
  if (value === undefined) {
435
526
  return undefined;
436
527
  }
@@ -439,7 +530,9 @@ export function createStdinTokenResolver() {
439
530
  }
440
531
  return await consumeStdin(optionName);
441
532
  };
442
- const resolveList = async (values, optionName) => {
533
+ const resolveList = async (values, optionName, resolveToken = true) => {
534
+ if (!resolveToken)
535
+ return values;
443
536
  if (!values) {
444
537
  return undefined;
445
538
  }
@@ -486,4 +579,4 @@ export const _testOnly = {
486
579
  parseMarkdownKeyValueLines,
487
580
  };
488
581
  //# sourceMappingURL=parse.js.map
489
- //# debugId=d5003dd5-f208-5734-9711-dff935d8c851
582
+ //# debugId=2252cfb9-37ea-57f1-b7ea-2b0c0f87ecb2
@@ -7,8 +7,12 @@ export interface ReproducibleExecutionSettings {
7
7
  /** Milliseconds advanced after each clock read. */
8
8
  tickMs: number;
9
9
  }
10
+ /** Runs async operations against one shared deterministic sequence. */
11
+ export type ReproducibleExecutionRunner = <T>(operation: () => Promise<T>) => Promise<T>;
10
12
  /** Validate and normalize deterministic execution settings before work starts. */
11
13
  export declare function validateReproducibleExecutionSettings(settings: ReproducibleExecutionSettings): ReproducibleExecutionSettings;
14
+ /** Create a runner whose serial operations share deterministic clock and entropy state. */
15
+ export declare function createReproducibleExecutionRunner(settings: ReproducibleExecutionSettings): ReproducibleExecutionRunner;
12
16
  /** Run an isolated async operation with deterministic clock and entropy state. */
13
17
  export declare function runWithReproducibleExecution<T>(settings: ReproducibleExecutionSettings, operation: () => Promise<T>): Promise<T>;
14
18
  /** Return the next deterministic clock value, or undefined outside a recipe. */
@@ -2,10 +2,11 @@
2
2
  * @module core/reproducibility/context
3
3
  *
4
4
  * Provides opt-in deterministic time and identifier entropy for reproducible
5
- * workspace executions. The default CLI path never installs this context.
5
+ * workspace executions. SDK recipes and supported process adapters install
6
+ * this context explicitly; default execution remains nondeterministic.
6
7
  */
7
8
 
8
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cc84ae55-6dc4-57d4-b7de-c43ae1fb4603")}catch(e){}}();
9
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aacc48ae-e9b2-5c8e-945f-89d05aff48e8")}catch(e){}}();
9
10
  import crypto from "node:crypto";
10
11
  import { AsyncLocalStorage } from "node:async_hooks";
11
12
  const executionStorage = new AsyncLocalStorage();
@@ -19,7 +20,7 @@ export function validateReproducibleExecutionSettings(settings) {
19
20
  if (!Number.isSafeInteger(settings.tickMs) || settings.tickMs < 0) {
20
21
  throw new Error("Reproducible workspace tickMs must be a non-negative integer");
21
22
  }
22
- if (settings.seed.length === 0) {
23
+ if (settings.seed.trim().length === 0) {
23
24
  throw new Error("Reproducible workspace seed must not be empty");
24
25
  }
25
26
  return {
@@ -27,14 +28,19 @@ export function validateReproducibleExecutionSettings(settings) {
27
28
  clock: new Date(clockMs).toISOString(),
28
29
  };
29
30
  }
30
- /** Run an isolated async operation with deterministic clock and entropy state. */
31
- export async function runWithReproducibleExecution(settings, operation) {
31
+ /** Create a runner whose serial operations share deterministic clock and entropy state. */
32
+ export function createReproducibleExecutionRunner(settings) {
32
33
  const normalized = validateReproducibleExecutionSettings(settings);
33
- return executionStorage.run({
34
+ const state = {
34
35
  ...normalized,
35
36
  clockReads: 0,
36
37
  tokenReads: 0,
37
- }, operation);
38
+ };
39
+ return (operation) => executionStorage.run(state, operation);
40
+ }
41
+ /** Run an isolated async operation with deterministic clock and entropy state. */
42
+ export async function runWithReproducibleExecution(settings, operation) {
43
+ return createReproducibleExecutionRunner(settings)(operation);
38
44
  }
39
45
  /** Return the next deterministic clock value, or undefined outside a recipe. */
40
46
  export function nextReproducibleTimestamp() {
@@ -74,4 +80,4 @@ export function nextReproducibleToken(length) {
74
80
  return token;
75
81
  }
76
82
  //# sourceMappingURL=context.js.map
77
- //# debugId=cc84ae55-6dc4-57d4-b7de-c43ae1fb4603
83
+ //# debugId=aacc48ae-e9b2-5c8e-945f-89d05aff48e8
@@ -6,7 +6,7 @@ export type AgentModelSource = "override" | "environment" | "mcp_client" | "argv
6
6
  /** Stable built-in provenance dimensions understood by the default runtime. */
7
7
  export declare const AGENT_PROVENANCE_DIMENSIONS: readonly ["model", "effort", "role", "topic", "version"];
8
8
  /** Built-in, bounded local resolver names accepted by harness descriptors. */
9
- export type AgentProvenanceResolver = "ai_agent_version" | "claude_session_file";
9
+ export type AgentProvenanceResolver = "ai_agent_version" | "claude_session_file" | "codex_session_file";
10
10
  /** One bounded provenance value and the signal class that supplied it. */
11
11
  export interface AgentProvenanceObservation {
12
12
  /** Bounded descriptive value retained in local history. */
@@ -74,6 +74,49 @@ export interface HarnessSignalDescriptor {
74
74
  /** Literal, case-insensitive MCP client-name markers. */
75
75
  client_names?: readonly string[];
76
76
  }
77
+ /** Versioned package-replaceable provenance contract for one agent harness. */
78
+ export interface AgentProvenanceAdapter {
79
+ /** Public adapter contract revision. */
80
+ contract_version: 1;
81
+ /** Adapter implementation revision supplied by pm or a package. */
82
+ adapter_version: string;
83
+ /** Explicit replacement precedence; built-ins use zero. */
84
+ priority: number;
85
+ /** Stable lowercase harness namespace. */
86
+ harness: string;
87
+ /** Executable detection and provenance descriptor. */
88
+ descriptor: HarnessSignalDescriptor;
89
+ /** Provenance dimensions intentionally covered by the adapter. */
90
+ supported_dimensions: readonly string[];
91
+ /** Privacy classes the adapter may inspect. */
92
+ native_sources: readonly ("environment" | "argv" | "mcp_client" | "session_file")[];
93
+ /** Hard bounds shared by runtime probes and package review. */
94
+ probe_policy: {
95
+ max_bytes: number;
96
+ max_lines: number;
97
+ network_access: false;
98
+ subprocess_access: false;
99
+ };
100
+ /** Stable normalization vocabulary declarations. */
101
+ normalization: {
102
+ model_family: "v1";
103
+ effort: "v1";
104
+ preserve_raw: true;
105
+ };
106
+ /** Confidence of a value read directly from the declared sources. */
107
+ confidence: "high" | "medium" | "low";
108
+ /** Bounded reasons for intentionally uncovered dimensions. */
109
+ waivers?: Readonly<Record<string, string>>;
110
+ }
111
+ /** One raw and normalized adapter value with its stable vocabulary revision. */
112
+ export interface NormalizedAgentProvenanceAdapterValue {
113
+ /** Bounded value retained exactly as observed. */
114
+ raw: string;
115
+ /** Stable cross-harness family or vocabulary value. */
116
+ normalized: string;
117
+ /** Normalization vocabulary revision. */
118
+ vocabulary: "v1";
119
+ }
77
120
  /** Public, privacy-safe agent observation shared by CLI, SDK, and MCP hosts. */
78
121
  export interface DetectedAgentIdentity {
79
122
  /** Normalized harness namespace when automatic detection succeeded. */
@@ -128,6 +171,8 @@ export interface HarnessDetectionSignals {
128
171
  }
129
172
  /** Built-in agent descriptors evaluated before package and workspace additions. */
130
173
  export declare const BUILTIN_HARNESS_SIGNAL_DESCRIPTORS: readonly HarnessSignalDescriptor[];
174
+ /** Built-in versioned adapters for supported interactive agent harnesses. */
175
+ export declare const BUILTIN_AGENT_PROVENANCE_ADAPTERS: readonly AgentProvenanceAdapter[];
131
176
  /**
132
177
  * Register package-provided harness signals until the returned disposer runs.
133
178
  *
@@ -136,6 +181,15 @@ export declare const BUILTIN_HARNESS_SIGNAL_DESCRIPTORS: readonly HarnessSignalD
136
181
  * repeated extension activation remains idempotent.
137
182
  */
138
183
  export declare function registerHarnessSignalDescriptors(descriptors: readonly HarnessSignalDescriptor[]): () => void;
184
+ /** Return the effective built-in or explicitly higher-priority package adapters. */
185
+ export declare function listAgentProvenanceAdapters(): readonly AgentProvenanceAdapter[];
186
+ /**
187
+ * Register package adapters until disposal. Replacing a built-in requires an
188
+ * explicitly greater priority; equal-priority ambiguity fails closed.
189
+ */
190
+ export declare function registerAgentProvenanceAdapters(adapters: readonly AgentProvenanceAdapter[]): () => void;
191
+ /** Normalize model-family or effort vocabulary while retaining the raw value. */
192
+ export declare function normalizeAgentProvenanceAdapterValue(dimension: "model" | "effort", value: string): NormalizedAgentProvenanceAdapterValue;
139
193
  /** Run one invocation with host-provided detection signals available downstream. */
140
194
  export declare function runWithHarnessDetectionSignals<T>(signals: HarnessDetectionSignals, callback: () => T): T;
141
195
  /** Run one invocation with workspace-provided descriptors available downstream. */