@unbrained/pm-cli 2026.8.7 → 2026.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +35 -0
- package/dist/cli/main.js +4 -3
- package/dist/cli/register-annotations.d.ts +11 -0
- package/dist/cli/register-annotations.js +195 -0
- package/dist/cli/register-history-author.js +7 -30
- package/dist/cli/register-mutation.js +25 -206
- package/dist/cli/runtime-compatibility-boundary.d.ts +17 -0
- package/dist/cli/runtime-compatibility-boundary.js +43 -0
- package/dist/cli-bundle/bundle-manifest.json +155 -691
- package/dist/cli-bundle/chunks/chunk-2ZMXX3Q6.js +2068 -0
- package/dist/cli-bundle/chunks/chunk-ALDHXLPS.js +3 -0
- package/dist/cli-bundle/chunks/chunk-CBLA33YK.js +8 -0
- package/dist/cli-bundle/chunks/chunk-GKA54IJM.js +5 -0
- package/dist/cli-bundle/chunks/chunk-KRY7SRUO.js +2 -0
- package/dist/cli-bundle/chunks/chunk-MNJ4NNSY.js +26 -0
- package/dist/cli-bundle/chunks/chunk-NUXRRNAB.js +77 -0
- package/dist/cli-bundle/chunks/chunk-OJPCFDDY.js +13 -0
- package/dist/cli-bundle/chunks/chunk-PFSD3DAN.js +194 -0
- package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SQ7QZFQ6.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-FJZCJ67O.js → register-list-query-WFZAMJHZ.js} +8 -8
- package/dist/cli-bundle/chunks/register-mutation-SOKKOTHQ.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-5XQETS6E.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-2HL5ZHMK.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-54EU2UVO.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-VZFU2R4M.js → chunk-5FLBTZJQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5GJ57YKN.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-HNL6IFGS.js → chunk-ANTMGYLI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-CMDS3KYT.js +14 -0
- package/dist/cli-bundle/focused-chunks/{chunk-NBJKQP4S.js → chunk-DMKOMTTY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CIXVQPB7.js → chunk-F5B3HBEZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-R2LEMEV5.js → chunk-FI6DWU2M.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-3K4XV2BF.js → chunk-FNOKJG6N.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-RW5IYD4J.js → chunk-FPDYXZBK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QHRTT7WT.js → chunk-GWI6YIKJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MHMTKV5V.js → chunk-HCUC62AB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MOTJFQ3F.js → chunk-HGNKPSCB.js} +12 -12
- package/dist/cli-bundle/focused-chunks/{chunk-4VJQTS3P.js → chunk-IAS7PMLG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TIKDBG4D.js → chunk-PL2EYDJK.js} +27 -27
- package/dist/cli-bundle/focused-chunks/chunk-SM2PJGP3.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RPNYG5MO.js → chunk-TCSAPH33.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-U646T7Z6.js +18 -0
- package/dist/cli-bundle/focused-chunks/chunk-YKPE4PPY.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YZEZAPJK.js → chunk-YSAHYUXX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-73JUDYXT.js → chunk-ZOLDTUU7.js} +2 -2
- package/dist/cli-bundle/main.js +13 -13
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +38 -38
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +1 -1
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +2 -1
- package/dist/cli.js +14 -4
- package/dist/core/output/output.js +9 -2
- package/dist/core/sentry/helpers.d.ts +10 -0
- package/dist/core/sentry/helpers.js +59 -4
- package/dist/core/shared/constants.d.ts +2 -0
- package/dist/core/shared/constants.js +4 -2
- package/dist/sdk/annotations.d.ts +40 -0
- package/dist/sdk/annotations.js +61 -9
- package/dist/sdk/author-attribution.d.ts +12 -0
- package/dist/sdk/author-attribution.js +73 -11
- package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +118 -0
- package/dist/sdk/cli-contracts/command-exit-contracts.js +152 -0
- package/dist/sdk/cli-contracts/completeness.js +5 -3
- package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +11 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +29 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -2
- package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +6 -3
- package/dist/sdk/comments.d.ts +7 -0
- package/dist/sdk/comments.js +2 -2
- package/dist/sdk/completion.js +9 -5
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +3 -2
- package/dist/sdk/environment/host-environment-errors.d.ts +27 -0
- package/dist/sdk/environment/host-environment-errors.js +124 -0
- package/dist/sdk/environment/project-runtime-compatibility.d.ts +65 -0
- package/dist/sdk/environment/project-runtime-compatibility.js +385 -0
- package/dist/sdk/environment/source-context.d.ts +23 -0
- package/dist/sdk/environment/source-context.js +29 -0
- package/dist/sdk/error-code-catalog.d.ts +6 -0
- package/dist/sdk/error-code-catalog.js +62 -8
- package/dist/sdk/generated-error-code-catalog.js +629 -3
- package/dist/sdk/governance/health.d.ts +11 -3
- package/dist/sdk/governance/health.js +5 -5
- package/dist/sdk/index.d.ts +7 -3
- package/dist/sdk/index.js +9 -5
- package/dist/sdk/learnings.d.ts +15 -0
- package/dist/sdk/learnings.js +2 -2
- package/dist/sdk/lifecycle/close-many.d.ts +6 -1
- package/dist/sdk/lifecycle/close-many.js +43 -5
- package/dist/sdk/lifecycle/update-many.d.ts +2 -1
- package/dist/sdk/lifecycle/update-many.js +29 -5
- package/dist/sdk/merge/index.d.ts +1 -1
- package/dist/sdk/merge/index.js +3 -3
- package/dist/sdk/merge/install.d.ts +21 -0
- package/dist/sdk/merge/install.js +50 -20
- package/dist/sdk/notes.d.ts +7 -0
- package/dist/sdk/notes.js +2 -2
- package/dist/sdk/read-output-contracts.js +83 -4
- package/dist/sdk/runtime.d.ts +1 -1
- package/dist/sdk/runtime.js +9 -25
- package/dist/sdk/test/execution.js +4 -2
- package/dist/sdk/test/parsers.js +5 -2
- package/dist/sdk/workspace-snapshot.d.ts +9 -0
- package/dist/sdk/workspace-snapshot.js +48 -16
- package/docs/AGENT_RUNTIME_PRIMITIVES.md +11 -4
- package/docs/README.md +1 -0
- package/docs/RELEASING.md +27 -2
- package/docs/SCRIPTING.md +27 -1
- package/docs/SDK_CONTEXT_INTEGRITY.md +66 -0
- package/docs/SDK_RUNTIME_BOUNDARIES.md +58 -0
- package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
- package/docs/TESTING.md +17 -0
- package/marketplace.json +2 -2
- package/package.json +5 -3
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +529 -34
- package/dist/cli-bundle/chunks/append-7BXBFDGD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2AXF3VSK.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2XS43CCV.js +0 -2
- package/dist/cli-bundle/chunks/chunk-3A6KWB72.js +0 -8
- package/dist/cli-bundle/chunks/chunk-3ISTDB42.js +0 -8
- package/dist/cli-bundle/chunks/chunk-4MTI7XOV.js +0 -5
- package/dist/cli-bundle/chunks/chunk-6BX5UDCN.js +0 -3
- package/dist/cli-bundle/chunks/chunk-6QPO7KLR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-7MXHZHSQ.js +0 -5
- package/dist/cli-bundle/chunks/chunk-7ZPMJW4U.js +0 -2
- package/dist/cli-bundle/chunks/chunk-A6KGKEWT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-AGYNSNCI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-B4H7FEFH.js +0 -5
- package/dist/cli-bundle/chunks/chunk-B4KLBBMN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-BXCSXK4J.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CALJHNBL.js +0 -23
- package/dist/cli-bundle/chunks/chunk-CFIGP5LY.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CHOQ2VAW.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CS6MRHG7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CUGNQQKH.js +0 -2
- package/dist/cli-bundle/chunks/chunk-D4FPS43D.js +0 -164
- package/dist/cli-bundle/chunks/chunk-E2ZSLTOP.js +0 -2
- package/dist/cli-bundle/chunks/chunk-FB7G2HY2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H5Y5YE6A.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H5Y6UV6E.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H7KGWPDF.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HFSD77TQ.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HX2GTA6L.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J2IEKAVR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-JC6FKIFM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-K44PYFXH.js +0 -2
- package/dist/cli-bundle/chunks/chunk-K4KGEEBT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KFLK5TRH.js +0 -21
- package/dist/cli-bundle/chunks/chunk-KL6IEBV2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KWQZDZSS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KZ4X3DGU.js +0 -3
- package/dist/cli-bundle/chunks/chunk-LD77HJMQ.js +0 -13
- package/dist/cli-bundle/chunks/chunk-LEPJJ6QC.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ME2JJ4LA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-NE5VRDAI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NFLJ3FHD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NG6OXIBR.js +0 -19
- package/dist/cli-bundle/chunks/chunk-NYIGHWQY.js +0 -8
- package/dist/cli-bundle/chunks/chunk-NZ75GNSA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PCJWJNC2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PD3225AM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PDEGKG7P.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PIE5HBNA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PW2H7YJR.js +0 -56
- package/dist/cli-bundle/chunks/chunk-RSIC5OPE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TPKN3S7S.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TPXAXTCO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-UFWUJO4V.js +0 -2
- package/dist/cli-bundle/chunks/chunk-UQLZQVFW.js +0 -55
- package/dist/cli-bundle/chunks/chunk-VT3Z5G7D.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WOD3WWUN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WSJEIGJF.js +0 -3
- package/dist/cli-bundle/chunks/chunk-WYNUU7ZW.js +0 -2008
- package/dist/cli-bundle/chunks/chunk-YGPNCCXZ.js +0 -2
- package/dist/cli-bundle/chunks/close-CMY3BAUG.js +0 -2
- package/dist/cli-bundle/chunks/close-many-SA4XZCTK.js +0 -2
- package/dist/cli-bundle/chunks/comments-EZ556ZD3.js +0 -2
- package/dist/cli-bundle/chunks/copy-ZSGPA52X.js +0 -2
- package/dist/cli-bundle/chunks/create-I5DVV4YG.js +0 -2
- package/dist/cli-bundle/chunks/delete-RL3JACSW.js +0 -2
- package/dist/cli-bundle/chunks/deps-S7UBCECS.js +0 -2
- package/dist/cli-bundle/chunks/docs-ZZNVBBYO.js +0 -2
- package/dist/cli-bundle/chunks/files-27C337VT.js +0 -2
- package/dist/cli-bundle/chunks/focus-5Z2SG7LU.js +0 -2
- package/dist/cli-bundle/chunks/history-compact-HJQK67CZ.js +0 -2
- package/dist/cli-bundle/chunks/history-redact-PWC6PDWA.js +0 -2
- package/dist/cli-bundle/chunks/history-repair-N3CY4WBF.js +0 -2
- package/dist/cli-bundle/chunks/learnings-4FH23XDT.js +0 -2
- package/dist/cli-bundle/chunks/profile-5Y5XXH5N.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-YGYPW3BL.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-WMDSUMQF.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-DL7FFABC.js +0 -2
- package/dist/cli-bundle/chunks/restore-6KYBV5BY.js +0 -2
- package/dist/cli-bundle/chunks/schema-EQGKBYXJ.js +0 -2
- package/dist/cli-bundle/chunks/update-QVTYOD6I.js +0 -2
- package/dist/cli-bundle/chunks/update-many-DJSBU525.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2ECLECMK.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-4EX25PXM.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-DLTS3IHM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DQ6FKGL3.js +0 -14
- package/dist/cli-bundle/focused-chunks/chunk-JLG2C4EQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZJIMJHDB.js +0 -2
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/** Stable numeric exit codes emitted by core pm commands. */
|
|
2
|
+
export type PmCommandExitCode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
3
|
+
/** Effect-oriented outcome vocabulary shared by shells and structured output. */
|
|
4
|
+
export type PmCommandExitOutcome = "effect" | "internal_failure" | "refused_input" | "refused_tracker_state" | "conflict" | "dependency_failed" | "no_effect" | "partial_effect";
|
|
5
|
+
/** Meaning and success semantics for one stable process exit. */
|
|
6
|
+
export interface PmCommandExitOutcomeContract {
|
|
7
|
+
/** Stable process exit visible without parsing stdout. */
|
|
8
|
+
exit_code: PmCommandExitCode;
|
|
9
|
+
/** Effect-oriented result independent of implementation details. */
|
|
10
|
+
outcome: PmCommandExitOutcome;
|
|
11
|
+
/** Whether the command completed its requested control flow successfully. */
|
|
12
|
+
success: boolean;
|
|
13
|
+
/** Concise operator-facing meaning. */
|
|
14
|
+
meaning: string;
|
|
15
|
+
}
|
|
16
|
+
/** Declared numeric exits for one core command path. */
|
|
17
|
+
export interface PmCommandExitContract {
|
|
18
|
+
/** Normalized command path. */
|
|
19
|
+
command: string;
|
|
20
|
+
/** Exhaustive exits the command may emit. */
|
|
21
|
+
exit_codes: readonly PmCommandExitCode[];
|
|
22
|
+
}
|
|
23
|
+
/** One replay observation used to verify command exit declarations. */
|
|
24
|
+
export interface PmCommandExitObservation {
|
|
25
|
+
/** Command path executed by the replay. */
|
|
26
|
+
command: string;
|
|
27
|
+
/** Process exit observed from the real command boundary. */
|
|
28
|
+
exit_code: number;
|
|
29
|
+
/** Stable replay case identifier for diagnostics. */
|
|
30
|
+
replay_id: string;
|
|
31
|
+
}
|
|
32
|
+
/** Drift report produced by exit-contract replay conformance. */
|
|
33
|
+
export interface PmCommandExitConformanceReport {
|
|
34
|
+
/** Whether all declaration and observation checks passed. */
|
|
35
|
+
ok: boolean;
|
|
36
|
+
/** Expected commands without a declaration. */
|
|
37
|
+
missing_commands: string[];
|
|
38
|
+
/** Observations whose command or numeric exit is undeclared. */
|
|
39
|
+
undeclared_observations: PmCommandExitObservation[];
|
|
40
|
+
/** Declared numeric outcomes not reached anywhere in the replay corpus. */
|
|
41
|
+
unreachable_exit_codes: PmCommandExitCode[];
|
|
42
|
+
}
|
|
43
|
+
/** Canonical effect vocabulary for all stable CLI process exits. */
|
|
44
|
+
export declare const PM_COMMAND_EXIT_OUTCOME_CONTRACTS: readonly [{
|
|
45
|
+
readonly exit_code: 0;
|
|
46
|
+
readonly outcome: "effect";
|
|
47
|
+
readonly success: true;
|
|
48
|
+
readonly meaning: "The requested operation completed with its intended effect.";
|
|
49
|
+
}, {
|
|
50
|
+
readonly exit_code: 1;
|
|
51
|
+
readonly outcome: "internal_failure";
|
|
52
|
+
readonly success: false;
|
|
53
|
+
readonly meaning: "An unexpected runtime or internal failure prevented completion.";
|
|
54
|
+
}, {
|
|
55
|
+
readonly exit_code: 2;
|
|
56
|
+
readonly outcome: "refused_input";
|
|
57
|
+
readonly success: false;
|
|
58
|
+
readonly meaning: "The invocation was refused because its input or composition was invalid.";
|
|
59
|
+
}, {
|
|
60
|
+
readonly exit_code: 3;
|
|
61
|
+
readonly outcome: "refused_tracker_state";
|
|
62
|
+
readonly success: false;
|
|
63
|
+
readonly meaning: "The requested tracker, item, or resource was not present.";
|
|
64
|
+
}, {
|
|
65
|
+
readonly exit_code: 4;
|
|
66
|
+
readonly outcome: "conflict";
|
|
67
|
+
readonly success: false;
|
|
68
|
+
readonly meaning: "Current state or concurrency prevented the requested effect.";
|
|
69
|
+
}, {
|
|
70
|
+
readonly exit_code: 5;
|
|
71
|
+
readonly outcome: "dependency_failed";
|
|
72
|
+
readonly success: false;
|
|
73
|
+
readonly meaning: "A required dependency operation failed.";
|
|
74
|
+
}, {
|
|
75
|
+
readonly exit_code: 6;
|
|
76
|
+
readonly outcome: "no_effect";
|
|
77
|
+
readonly success: true;
|
|
78
|
+
readonly meaning: "The request was valid and completed, but matched nothing to change.";
|
|
79
|
+
}, {
|
|
80
|
+
readonly exit_code: 7;
|
|
81
|
+
readonly outcome: "partial_effect";
|
|
82
|
+
readonly success: true;
|
|
83
|
+
readonly meaning: "The request completed and changed some, but not all, selected targets.";
|
|
84
|
+
}];
|
|
85
|
+
/** Exhaustive core command exit declarations generated from the command registry. */
|
|
86
|
+
export declare const PM_COMMAND_EXIT_CONTRACTS: readonly PmCommandExitContract[];
|
|
87
|
+
/** Stable successful process exits, including machine-distinct effect states. */
|
|
88
|
+
export declare const PM_SUCCESS_EXIT_CODES: readonly [0, 6, 7];
|
|
89
|
+
/** Portable success effect reported by command result envelopes. */
|
|
90
|
+
export type PmCommandEffect = "effect" | "no_effect" | "partial_effect" | "dependency_failed";
|
|
91
|
+
/** Shell and envelope representation of one command effect or collected failure. */
|
|
92
|
+
export interface PmCommandEffectReceipt {
|
|
93
|
+
/** Semantic effect observed after command execution. */
|
|
94
|
+
outcome: PmCommandEffect;
|
|
95
|
+
/** Stable shell exit paired with the effect. */
|
|
96
|
+
exit_code: 0 | 5 | 6 | 7;
|
|
97
|
+
}
|
|
98
|
+
/** Counts used to derive one bulk mutation's effect without parsing prose. */
|
|
99
|
+
export interface PmBulkMutationEffectCounts {
|
|
100
|
+
/** Rows that completed the requested mutation. */
|
|
101
|
+
applied: number;
|
|
102
|
+
/** Rows deliberately left unchanged. */
|
|
103
|
+
skipped: number;
|
|
104
|
+
/** Rows whose attempted mutation failed. */
|
|
105
|
+
failed: number;
|
|
106
|
+
/** Explicit requested identifiers that did not exist. */
|
|
107
|
+
unmatched: number;
|
|
108
|
+
}
|
|
109
|
+
/** Return whether an exit represents a successful command outcome. */
|
|
110
|
+
export declare function isPmSuccessfulExitCode(exitCode: number): boolean;
|
|
111
|
+
/** Return whether an exit belongs to the declared pm process vocabulary. */
|
|
112
|
+
export declare function isPmKnownExitCode(exitCode: number): exitCode is PmCommandExitCode;
|
|
113
|
+
/** Resolve an exact command contract, falling back to its declared root path. */
|
|
114
|
+
export declare function resolvePmCommandExitContract(commandPath: string): PmCommandExitContract | undefined;
|
|
115
|
+
/** Verify command coverage, observed exits, and vocabulary reachability for a replay corpus. */
|
|
116
|
+
export declare function analyzePmCommandExitConformance(observations: readonly PmCommandExitObservation[], expectedCommands?: readonly string[], contracts?: readonly PmCommandExitContract[]): PmCommandExitConformanceReport;
|
|
117
|
+
/** Derive deterministic full, empty, partial, or failed semantics for a bulk mutation. */
|
|
118
|
+
export declare function derivePmBulkMutationEffect(counts: PmBulkMutationEffectCounts): PmCommandEffectReceipt;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/command-exit-contracts
|
|
3
|
+
*
|
|
4
|
+
* Declares shell-visible command outcomes and derives effect receipts shared by
|
|
5
|
+
* CLI, SDK, MCP, packages, telemetry, and conformance gates.
|
|
6
|
+
*/
|
|
7
|
+
|
|
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]="5bbc21f0-f517-571a-8ecf-45f20f0e793d")}catch(e){}}();
|
|
9
|
+
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
10
|
+
import { PM_CORE_COMMAND_NAMES } from "./enum-contracts.js";
|
|
11
|
+
/** Canonical effect vocabulary for all stable CLI process exits. */
|
|
12
|
+
export const PM_COMMAND_EXIT_OUTCOME_CONTRACTS = [
|
|
13
|
+
{
|
|
14
|
+
exit_code: EXIT_CODE.SUCCESS,
|
|
15
|
+
outcome: "effect",
|
|
16
|
+
success: true,
|
|
17
|
+
meaning: "The requested operation completed with its intended effect.",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
exit_code: EXIT_CODE.GENERIC_FAILURE,
|
|
21
|
+
outcome: "internal_failure",
|
|
22
|
+
success: false,
|
|
23
|
+
meaning: "An unexpected runtime or internal failure prevented completion.",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
exit_code: EXIT_CODE.USAGE,
|
|
27
|
+
outcome: "refused_input",
|
|
28
|
+
success: false,
|
|
29
|
+
meaning: "The invocation was refused because its input or composition was invalid.",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
exit_code: EXIT_CODE.NOT_FOUND,
|
|
33
|
+
outcome: "refused_tracker_state",
|
|
34
|
+
success: false,
|
|
35
|
+
meaning: "The requested tracker, item, or resource was not present.",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
exit_code: EXIT_CODE.CONFLICT,
|
|
39
|
+
outcome: "conflict",
|
|
40
|
+
success: false,
|
|
41
|
+
meaning: "Current state or concurrency prevented the requested effect.",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
exit_code: EXIT_CODE.DEPENDENCY_FAILED,
|
|
45
|
+
outcome: "dependency_failed",
|
|
46
|
+
success: false,
|
|
47
|
+
meaning: "A required dependency operation failed.",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
exit_code: EXIT_CODE.NO_EFFECT,
|
|
51
|
+
outcome: "no_effect",
|
|
52
|
+
success: true,
|
|
53
|
+
meaning: "The request was valid and completed, but matched nothing to change.",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
exit_code: EXIT_CODE.PARTIAL_EFFECT,
|
|
57
|
+
outcome: "partial_effect",
|
|
58
|
+
success: true,
|
|
59
|
+
meaning: "The request completed and changed some, but not all, selected targets.",
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
const STANDARD_COMMAND_EXIT_CODES = [
|
|
63
|
+
EXIT_CODE.SUCCESS,
|
|
64
|
+
EXIT_CODE.GENERIC_FAILURE,
|
|
65
|
+
EXIT_CODE.USAGE,
|
|
66
|
+
EXIT_CODE.NOT_FOUND,
|
|
67
|
+
EXIT_CODE.CONFLICT,
|
|
68
|
+
EXIT_CODE.DEPENDENCY_FAILED,
|
|
69
|
+
];
|
|
70
|
+
const EFFECT_AWARE_BULK_COMMANDS = new Set(["close-many", "update-many"]);
|
|
71
|
+
/** Exhaustive core command exit declarations generated from the command registry. */
|
|
72
|
+
export const PM_COMMAND_EXIT_CONTRACTS = PM_CORE_COMMAND_NAMES.map((command) => ({
|
|
73
|
+
command,
|
|
74
|
+
exit_codes: EFFECT_AWARE_BULK_COMMANDS.has(command)
|
|
75
|
+
? [
|
|
76
|
+
...STANDARD_COMMAND_EXIT_CODES,
|
|
77
|
+
EXIT_CODE.NO_EFFECT,
|
|
78
|
+
EXIT_CODE.PARTIAL_EFFECT,
|
|
79
|
+
]
|
|
80
|
+
: [...STANDARD_COMMAND_EXIT_CODES],
|
|
81
|
+
}));
|
|
82
|
+
const COMMAND_EXIT_CONTRACT_BY_PATH = new Map(PM_COMMAND_EXIT_CONTRACTS.map((contract) => [contract.command, contract]));
|
|
83
|
+
/** Stable successful process exits, including machine-distinct effect states. */
|
|
84
|
+
export const PM_SUCCESS_EXIT_CODES = [
|
|
85
|
+
EXIT_CODE.SUCCESS,
|
|
86
|
+
EXIT_CODE.NO_EFFECT,
|
|
87
|
+
EXIT_CODE.PARTIAL_EFFECT,
|
|
88
|
+
];
|
|
89
|
+
/** Return whether an exit represents a successful command outcome. */
|
|
90
|
+
export function isPmSuccessfulExitCode(exitCode) {
|
|
91
|
+
return PM_SUCCESS_EXIT_CODES.includes(exitCode);
|
|
92
|
+
}
|
|
93
|
+
/** Return whether an exit belongs to the declared pm process vocabulary. */
|
|
94
|
+
export function isPmKnownExitCode(exitCode) {
|
|
95
|
+
return PM_COMMAND_EXIT_OUTCOME_CONTRACTS.some((contract) => contract.exit_code === exitCode);
|
|
96
|
+
}
|
|
97
|
+
/** Resolve an exact command contract, falling back to its declared root path. */
|
|
98
|
+
export function resolvePmCommandExitContract(commandPath) {
|
|
99
|
+
const normalized = commandPath
|
|
100
|
+
.trim()
|
|
101
|
+
.toLowerCase()
|
|
102
|
+
.split(/\s+/u)
|
|
103
|
+
.filter(Boolean)
|
|
104
|
+
.join(" ");
|
|
105
|
+
return (COMMAND_EXIT_CONTRACT_BY_PATH.get(normalized) ??
|
|
106
|
+
COMMAND_EXIT_CONTRACT_BY_PATH.get(normalized.split(" ")[0]));
|
|
107
|
+
}
|
|
108
|
+
/** Verify command coverage, observed exits, and vocabulary reachability for a replay corpus. */
|
|
109
|
+
export function analyzePmCommandExitConformance(observations, expectedCommands = PM_CORE_COMMAND_NAMES, contracts = PM_COMMAND_EXIT_CONTRACTS) {
|
|
110
|
+
const contractsByCommand = new Map(contracts.map((contract) => [contract.command, contract]));
|
|
111
|
+
const missingCommands = expectedCommands.filter((command) => !contractsByCommand.has(command));
|
|
112
|
+
const undeclaredObservations = observations.filter((observation) => {
|
|
113
|
+
const contract = contractsByCommand.get(observation.command) ??
|
|
114
|
+
contractsByCommand.get(observation.command.split(" ")[0]);
|
|
115
|
+
return (contract === undefined ||
|
|
116
|
+
!contract.exit_codes.includes(observation.exit_code));
|
|
117
|
+
});
|
|
118
|
+
const observedExitCodes = new Set(observations.map((entry) => entry.exit_code));
|
|
119
|
+
const declaredExitCodes = new Set(contracts.flatMap((contract) => contract.exit_codes));
|
|
120
|
+
const unreachableExitCodes = [...declaredExitCodes]
|
|
121
|
+
.filter((exitCode) => !observedExitCodes.has(exitCode))
|
|
122
|
+
.sort((left, right) => left - right);
|
|
123
|
+
return {
|
|
124
|
+
ok: missingCommands.length === 0 &&
|
|
125
|
+
undeclaredObservations.length === 0 &&
|
|
126
|
+
unreachableExitCodes.length === 0,
|
|
127
|
+
missing_commands: missingCommands,
|
|
128
|
+
undeclared_observations: undeclaredObservations,
|
|
129
|
+
unreachable_exit_codes: unreachableExitCodes,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** Derive deterministic full, empty, partial, or failed semantics for a bulk mutation. */
|
|
133
|
+
export function derivePmBulkMutationEffect(counts) {
|
|
134
|
+
if (counts.applied === 0 && counts.failed > 0) {
|
|
135
|
+
return {
|
|
136
|
+
outcome: "dependency_failed",
|
|
137
|
+
exit_code: EXIT_CODE.DEPENDENCY_FAILED,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (counts.applied === 0) {
|
|
141
|
+
return { outcome: "no_effect", exit_code: EXIT_CODE.NO_EFFECT };
|
|
142
|
+
}
|
|
143
|
+
if (counts.skipped > 0 || counts.failed > 0 || counts.unmatched > 0) {
|
|
144
|
+
return {
|
|
145
|
+
outcome: "partial_effect",
|
|
146
|
+
exit_code: EXIT_CODE.PARTIAL_EFFECT,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return { outcome: "effect", exit_code: EXIT_CODE.SUCCESS };
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=command-exit-contracts.js.map
|
|
152
|
+
//# debugId=5bbc21f0-f517-571a-8ecf-45f20f0e793d
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* a hand-picked test list.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!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]="
|
|
10
|
+
!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]="0fd4d2b0-725f-53ed-8b2b-2eeb19406cb7")}catch(e){}}();
|
|
11
11
|
import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
|
|
12
12
|
import { resolveSubcommandFlagContractsForCommand, } from "./flag-contracts.js";
|
|
13
13
|
import { pmToolActionParameterKeys } from "./tool-schema.js";
|
|
@@ -120,7 +120,9 @@ const ACTION_FLAG_PARAMETER_OVERRIDES = {
|
|
|
120
120
|
},
|
|
121
121
|
files: { "--note": "addNote" },
|
|
122
122
|
docs: { "--note": "addNote" },
|
|
123
|
-
|
|
123
|
+
comments: { "--full-history": "full" },
|
|
124
|
+
notes: { "--file": "text", "--full-history": "full" },
|
|
125
|
+
learnings: { "--full-history": "full" },
|
|
124
126
|
gc: { "--scope": "gcScope" },
|
|
125
127
|
contracts: { "--action": "contractAction" },
|
|
126
128
|
schema: {
|
|
@@ -364,4 +366,4 @@ export function analyzeSdkCliParameterCompleteness(source = {}) {
|
|
|
364
366
|
});
|
|
365
367
|
}
|
|
366
368
|
//# sourceMappingURL=completeness.js.map
|
|
367
|
-
//# debugId=
|
|
369
|
+
//# debugId=0fd4d2b0-725f-53ed-8b2b-2eeb19406cb7
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* flag surface stays single-sourced across the CLI, SDK, and MCP boundaries.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!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]="
|
|
10
|
+
!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]="932a6144-c4b4-5153-b8ff-0ef29e308bd0")}catch(e){}}();
|
|
11
11
|
import { normalizeUniqueStringList } from "./string-lists.js";
|
|
12
12
|
import { RESERVED_EXTENSION_HOST_FLAGS } from "../../core/extensions/reserved-host-flags.js";
|
|
13
13
|
function normalizeFlagAliasKey(flag) {
|
|
@@ -222,6 +222,7 @@ export const COMMENTS_FLAG_CONTRACTS = [
|
|
|
222
222
|
{ flag: "--edit" },
|
|
223
223
|
{ flag: "--delete" },
|
|
224
224
|
{ flag: "--limit" },
|
|
225
|
+
{ flag: "--full-history" },
|
|
225
226
|
{ flag: "--author" },
|
|
226
227
|
{ flag: "--message" },
|
|
227
228
|
{ flag: "--force" },
|
|
@@ -243,6 +244,7 @@ export const NOTES_FLAG_CONTRACTS = [
|
|
|
243
244
|
{ flag: "--since" },
|
|
244
245
|
{ flag: "--event-type" },
|
|
245
246
|
{ flag: "--include-meta" },
|
|
247
|
+
{ flag: "--full-history" },
|
|
246
248
|
{ flag: "--author" },
|
|
247
249
|
{ flag: "--message" },
|
|
248
250
|
{ flag: "--force" },
|
|
@@ -251,6 +253,7 @@ export const NOTES_FLAG_CONTRACTS = [
|
|
|
251
253
|
export const LEARNINGS_FLAG_CONTRACTS = [
|
|
252
254
|
{ flag: "--add", aliases: ["--learning"] },
|
|
253
255
|
{ flag: "--limit" },
|
|
256
|
+
{ flag: "--full-history" },
|
|
254
257
|
{ flag: "--author" },
|
|
255
258
|
{ flag: "--message" },
|
|
256
259
|
{ flag: "--force" },
|
|
@@ -1752,4 +1755,4 @@ export function toCompletionFlagString(flagContracts, includeGlobal = true) {
|
|
|
1752
1755
|
return normalizeUniqueStringList(all).join(" ");
|
|
1753
1756
|
}
|
|
1754
1757
|
//# sourceMappingURL=flag-contracts.js.map
|
|
1755
|
-
//# debugId=
|
|
1758
|
+
//# debugId=932a6144-c4b4-5153-b8ff-0ef29e308bd0
|
|
@@ -13,6 +13,7 @@ import { type CliFlagInvocationContract } from "../flag-invocation-contracts.js"
|
|
|
13
13
|
import { type PmCommandVisibilityTier } from "../agent-capability-contracts.js";
|
|
14
14
|
import type { PmErrorCodeContract } from "../error-code-catalog.js";
|
|
15
15
|
import { type PmCommandOutputEnvelopeContract } from "../output-contracts.js";
|
|
16
|
+
import { type PmCommandExitContract, type PmCommandExitOutcomeContract } from "./command-exit-contracts.js";
|
|
16
17
|
/** Documents the contracts command options payload exchanged by command, SDK, and package integrations. */
|
|
17
18
|
export interface ContractsCommandOptions {
|
|
18
19
|
/** Value that configures or reports action for this contract. */
|
|
@@ -152,6 +153,14 @@ export interface ContractsResult {
|
|
|
152
153
|
budget: PmCommandOutputBudgetContract;
|
|
153
154
|
envelope: PmCommandOutputEnvelopeContract;
|
|
154
155
|
}>;
|
|
156
|
+
/** Stable outcome vocabulary and exhaustive per-command process exit sets. */
|
|
157
|
+
command_exit_contracts?: {
|
|
158
|
+
vocabulary: readonly PmCommandExitOutcomeContract[];
|
|
159
|
+
command_sets: Array<{
|
|
160
|
+
commands: string[];
|
|
161
|
+
exit_codes: PmCommandExitContract["exit_codes"];
|
|
162
|
+
}>;
|
|
163
|
+
};
|
|
155
164
|
}
|
|
156
165
|
type PmToolAction = (typeof PM_TOOL_ACTIONS)[number];
|
|
157
166
|
/** Documents the contracts action availability payload exchanged by command, SDK, and package integrations. */
|
|
@@ -260,6 +269,7 @@ declare function attachCreateRequiredOptionContracts(schema: Record<string, unkn
|
|
|
260
269
|
declare function readContractsSettings(pmRoot: string, readSettingsFn?: typeof readSettings): Promise<Awaited<ReturnType<typeof readSettings>>>;
|
|
261
270
|
declare function buildCommandSummarySurface(commands: readonly string[]): CommandSummarySurface[];
|
|
262
271
|
declare function buildCommandOutputContracts(commands: readonly string[]): NonNullable<ContractsResult["command_output_contracts"]>;
|
|
272
|
+
declare function buildCommandExitContractGroups(commands: readonly string[]): NonNullable<ContractsResult["command_exit_contracts"]>["command_sets"];
|
|
263
273
|
/** Implements run contracts for the public runtime surface of this module. */
|
|
264
274
|
export declare function runContracts(options: ContractsCommandOptions, global: GlobalOptions): Promise<ContractsResult>;
|
|
265
275
|
/** Public contract for test only contracts command, shared by SDK and presentation-layer consumers. */
|
|
@@ -269,6 +279,7 @@ export declare const _testOnlyContractsCommand: {
|
|
|
269
279
|
buildExtensionActionSchemaBranch: typeof buildExtensionActionSchemaBranch;
|
|
270
280
|
buildCommandSummarySurface: typeof buildCommandSummarySurface;
|
|
271
281
|
buildCommandOutputContracts: typeof buildCommandOutputContracts;
|
|
282
|
+
buildCommandExitContractGroups: typeof buildCommandExitContractGroups;
|
|
272
283
|
buildRuntimeFieldFlagContracts: typeof buildRuntimeFieldFlagContracts;
|
|
273
284
|
collectActionContractDescriptors: typeof collectActionContractDescriptors;
|
|
274
285
|
collectExtensionCommandContracts: typeof collectExtensionCommandContracts;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm contracts command surface and its agent-facing runtime behavior.
|
|
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]="
|
|
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]="adf76b7b-fc29-5b35-b33a-5ae008cbc8e7")}catch(e){}}();
|
|
8
8
|
import { EXIT_CODE, SETTINGS_DEFAULTS, PmCliError, activateExtensions, getActiveExtensionRegistrations, loadExtensions, pathExists, commandOptionFlagLabel, resolveCommandOptionPolicyState, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, getSettingsPath, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
|
|
9
9
|
import { buildMcpToolContracts, } from "../../mcp/tool-definitions.js";
|
|
10
10
|
import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_MIGRATE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_OUTPUT_DEGRADATION_STEPS, PLAN_FLAG_CONTRACTS, PM_CORE_COMMAND_NAMES, PM_TOOL_ACTIONS, PM_TOOL_PARAMETERS_SCHEMA, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, PROFILE_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, EVAL_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, compactFlagAliasContracts, resolvePmCommandOutputBudget, } from "../cli-contracts.js";
|
|
@@ -16,6 +16,7 @@ import { enrichCliFlagInvocationContracts, } from "../flag-invocation-contracts.
|
|
|
16
16
|
import { resolvePmCommandVisibilityTier, } from "../agent-capability-contracts.js";
|
|
17
17
|
import { PM_ERROR_CODE_CATALOG } from "../generated-error-code-catalog.js";
|
|
18
18
|
import { resolvePmCommandOutputEnvelope, } from "../output-contracts.js";
|
|
19
|
+
import { PM_COMMAND_EXIT_OUTCOME_CONTRACTS, resolvePmCommandExitContract, } from "./command-exit-contracts.js";
|
|
19
20
|
const AGENT_BOOTSTRAP_FLAGS = new Map([
|
|
20
21
|
[
|
|
21
22
|
"claim",
|
|
@@ -1619,6 +1620,27 @@ function buildCommandOutputContracts(commands) {
|
|
|
1619
1620
|
envelope: resolvePmCommandOutputEnvelope(command),
|
|
1620
1621
|
}));
|
|
1621
1622
|
}
|
|
1623
|
+
function buildCommandExitContractGroups(commands) {
|
|
1624
|
+
const groups = new Map();
|
|
1625
|
+
for (const command of commands) {
|
|
1626
|
+
const contract = resolvePmCommandExitContract(command);
|
|
1627
|
+
const exitCodes = contract === undefined
|
|
1628
|
+
? [
|
|
1629
|
+
EXIT_CODE.SUCCESS,
|
|
1630
|
+
EXIT_CODE.GENERIC_FAILURE,
|
|
1631
|
+
EXIT_CODE.USAGE,
|
|
1632
|
+
EXIT_CODE.NOT_FOUND,
|
|
1633
|
+
EXIT_CODE.CONFLICT,
|
|
1634
|
+
EXIT_CODE.DEPENDENCY_FAILED,
|
|
1635
|
+
]
|
|
1636
|
+
: contract.exit_codes;
|
|
1637
|
+
const key = exitCodes.join(",");
|
|
1638
|
+
const group = groups.get(key) ?? { commands: [], exit_codes: exitCodes };
|
|
1639
|
+
group.commands.push(command);
|
|
1640
|
+
groups.set(key, group);
|
|
1641
|
+
}
|
|
1642
|
+
return [...groups.values()];
|
|
1643
|
+
}
|
|
1622
1644
|
function resolveExtensionCommandContracts(selection, runtime, outputCommands) {
|
|
1623
1645
|
if (selection.selectedCommand) {
|
|
1624
1646
|
return runtime.extensionContracts.filter((entry) => splitCommandPathAliases(entry.command).includes(selection.selectedCommand));
|
|
@@ -1791,6 +1813,10 @@ export async function runContracts(options, global) {
|
|
|
1791
1813
|
result.error_codes = PM_ERROR_CODE_CATALOG;
|
|
1792
1814
|
result.command_output_contracts =
|
|
1793
1815
|
buildCommandOutputContracts(outputCommands);
|
|
1816
|
+
result.command_exit_contracts = {
|
|
1817
|
+
vocabulary: PM_COMMAND_EXIT_OUTCOME_CONTRACTS,
|
|
1818
|
+
command_sets: buildCommandExitContractGroups(outputCommands),
|
|
1819
|
+
};
|
|
1794
1820
|
}
|
|
1795
1821
|
return result;
|
|
1796
1822
|
}
|
|
@@ -1801,6 +1827,7 @@ export const _testOnlyContractsCommand = {
|
|
|
1801
1827
|
buildExtensionActionSchemaBranch,
|
|
1802
1828
|
buildCommandSummarySurface,
|
|
1803
1829
|
buildCommandOutputContracts,
|
|
1830
|
+
buildCommandExitContractGroups,
|
|
1804
1831
|
buildRuntimeFieldFlagContracts,
|
|
1805
1832
|
collectActionContractDescriptors,
|
|
1806
1833
|
collectExtensionCommandContracts,
|
|
@@ -1827,4 +1854,4 @@ export const _testOnlyContractsCommand = {
|
|
|
1827
1854
|
toRuntimeShortFlagToken,
|
|
1828
1855
|
};
|
|
1829
1856
|
//# sourceMappingURL=runtime-contracts.js.map
|
|
1830
|
-
//# debugId=
|
|
1857
|
+
//# debugId=adf76b7b-fc29-5b35-b33a-5ae008cbc8e7
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines SDK command-contract metadata for Tool Parameter Tables.
|
|
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]="
|
|
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]="35c4b819-02d6-582a-a7eb-fe3f4a4903d9")}catch(e){}}();
|
|
8
8
|
import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
|
|
9
9
|
import { PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS } from "../read-output-session.js";
|
|
10
10
|
/** Public contract for pm tool parameter properties, shared by SDK and presentation-layer consumers. */
|
|
@@ -1804,12 +1804,25 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
|
|
|
1804
1804
|
examples: [600, "1200"],
|
|
1805
1805
|
},
|
|
1806
1806
|
},
|
|
1807
|
+
comments: {
|
|
1808
|
+
full: {
|
|
1809
|
+
description: "Return the complete post-mutation comment history instead of the bounded mutation receipt projection.",
|
|
1810
|
+
},
|
|
1811
|
+
},
|
|
1807
1812
|
notes: {
|
|
1813
|
+
full: {
|
|
1814
|
+
description: "Return the complete post-mutation note history instead of the bounded mutation receipt projection.",
|
|
1815
|
+
},
|
|
1808
1816
|
since: {
|
|
1809
1817
|
description: "Inclusive ISO 8601 creation timestamp lower bound for structured note event filtering.",
|
|
1810
1818
|
examples: ["2026-01-01T00:00:00.000Z"],
|
|
1811
1819
|
},
|
|
1812
1820
|
},
|
|
1821
|
+
learnings: {
|
|
1822
|
+
full: {
|
|
1823
|
+
description: "Return the complete post-mutation learning history instead of the bounded mutation receipt projection.",
|
|
1824
|
+
},
|
|
1825
|
+
},
|
|
1813
1826
|
next: {
|
|
1814
1827
|
tag: {
|
|
1815
1828
|
description: "Only recommend items carrying this exact tag.",
|
|
@@ -1894,4 +1907,4 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
|
|
|
1894
1907
|
},
|
|
1895
1908
|
};
|
|
1896
1909
|
//# sourceMappingURL=tool-parameter-tables.js.map
|
|
1897
|
-
//# debugId=
|
|
1910
|
+
//# debugId=35c4b819-02d6-582a-a7eb-fe3f4a4903d9
|
|
@@ -91,7 +91,7 @@ export interface PmActionToolInputSchemaOptions {
|
|
|
91
91
|
*/
|
|
92
92
|
export declare function buildPmActionToolInputSchema(action: PmToolAction, options?: PmActionToolInputSchemaOptions): Record<string, unknown>;
|
|
93
93
|
/** Canonical version of the action-scoped strict MCP tool-parameters schema (`PM_TOOL_PARAMETERS_SCHEMA`). Exported as the single source of truth so the MCP server, the `pm contracts` command, SDK consumers, and the contract tests all bind to one constant instead of re-typing the `"4.0.2"` literal (pm-r9sz). Bump the patch/minor for additive, backward-compatible schema changes; bump the MAJOR for breaking changes — the major also drives the `$id` `tool-parameters-v{major}` slug, so the two never drift. */
|
|
94
|
-
export declare const PM_TOOL_PARAMETERS_SCHEMA_VERSION: "4.4.
|
|
94
|
+
export declare const PM_TOOL_PARAMETERS_SCHEMA_VERSION: "4.4.1";
|
|
95
95
|
/**
|
|
96
96
|
* Major component of {@link PM_TOOL_PARAMETERS_SCHEMA_VERSION}, used to build the
|
|
97
97
|
* schema `$id` slug so a breaking version bump renames the document in lockstep.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* consumers from a single source of truth.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!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]="
|
|
10
|
+
!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]="d9f01e68-6b54-5861-a4b5-ae40613c2047")}catch(e){}}();
|
|
11
11
|
import { normalizeUniqueStringList } from "./string-lists.js";
|
|
12
12
|
import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
|
|
13
13
|
import { TOOL_CREATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, } from "./tool-option-contracts.js";
|
|
@@ -811,6 +811,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
811
811
|
"edit",
|
|
812
812
|
"delete",
|
|
813
813
|
"limit",
|
|
814
|
+
"full",
|
|
814
815
|
...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
|
|
815
816
|
],
|
|
816
817
|
},
|
|
@@ -827,6 +828,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
827
828
|
"since",
|
|
828
829
|
"eventType",
|
|
829
830
|
"includeMeta",
|
|
831
|
+
"full",
|
|
830
832
|
...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
|
|
831
833
|
],
|
|
832
834
|
mutuallyExclusive: [
|
|
@@ -846,6 +848,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
846
848
|
"edit",
|
|
847
849
|
"delete",
|
|
848
850
|
"limit",
|
|
851
|
+
"full",
|
|
849
852
|
...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
|
|
850
853
|
],
|
|
851
854
|
},
|
|
@@ -1427,7 +1430,7 @@ function createLazyContractSchema(build) {
|
|
|
1427
1430
|
});
|
|
1428
1431
|
}
|
|
1429
1432
|
/** Canonical version of the action-scoped strict MCP tool-parameters schema (`PM_TOOL_PARAMETERS_SCHEMA`). Exported as the single source of truth so the MCP server, the `pm contracts` command, SDK consumers, and the contract tests all bind to one constant instead of re-typing the `"4.0.2"` literal (pm-r9sz). Bump the patch/minor for additive, backward-compatible schema changes; bump the MAJOR for breaking changes — the major also drives the `$id` `tool-parameters-v{major}` slug, so the two never drift. */
|
|
1430
|
-
export const PM_TOOL_PARAMETERS_SCHEMA_VERSION = "4.4.
|
|
1433
|
+
export const PM_TOOL_PARAMETERS_SCHEMA_VERSION = "4.4.1";
|
|
1431
1434
|
/**
|
|
1432
1435
|
* Major component of {@link PM_TOOL_PARAMETERS_SCHEMA_VERSION}, used to build the
|
|
1433
1436
|
* schema `$id` slug so a breaking version bump renames the document in lockstep.
|
|
@@ -1509,4 +1512,4 @@ export const _testOnlyCliContracts = {
|
|
|
1509
1512
|
withFlagAliasMetadata,
|
|
1510
1513
|
};
|
|
1511
1514
|
//# sourceMappingURL=tool-schema.js.map
|
|
1512
|
-
//# debugId=
|
|
1515
|
+
//# debugId=d9f01e68-6b54-5861-a4b5-ae40613c2047
|
package/dist/sdk/comments.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type GlobalOptions } from "./runtime-primitives.js";
|
|
2
2
|
import type { Comment } from "../types/index.js";
|
|
3
|
+
import { type AnnotationMutationReceipt, type AnnotationOmissionReceipt } from "./annotations.js";
|
|
3
4
|
/** Documents the comments command options payload exchanged by command, SDK, and package integrations. */
|
|
4
5
|
export interface CommentsCommandOptions {
|
|
5
6
|
/** Value that configures or reports add for this contract. */
|
|
@@ -16,6 +17,8 @@ export interface CommentsCommandOptions {
|
|
|
16
17
|
limit?: string;
|
|
17
18
|
/** Value that configures or reports include meta for this contract. */
|
|
18
19
|
includeMeta?: boolean;
|
|
20
|
+
/** Return complete comment history after a mutation instead of a bounded receipt. */
|
|
21
|
+
fullHistory?: boolean;
|
|
19
22
|
/** Value that configures or reports author for this contract. */
|
|
20
23
|
author?: string;
|
|
21
24
|
/** Human-readable explanation suitable for logs and agent-facing output. */
|
|
@@ -39,6 +42,10 @@ export interface CommentsResult {
|
|
|
39
42
|
has_more?: boolean;
|
|
40
43
|
/** Value that configures or reports limit for this contract. */
|
|
41
44
|
limit?: number;
|
|
45
|
+
/** Mutation identity when this result changed the collection. */
|
|
46
|
+
mutation_receipt?: AnnotationMutationReceipt;
|
|
47
|
+
/** Declares whether older comments were withheld from a mutation response. */
|
|
48
|
+
omission_receipt?: AnnotationOmissionReceipt;
|
|
42
49
|
}
|
|
43
50
|
/** Implements run comments for the public runtime surface of this module. */
|
|
44
51
|
export declare function runComments(id: string, options: CommentsCommandOptions, global: GlobalOptions): Promise<CommentsResult>;
|
package/dist/sdk/comments.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm comments command surface and its agent-facing runtime behavior.
|
|
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]="
|
|
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]="667218ac-866c-59b1-8309-18ad92434fca")}catch(e){}}();
|
|
8
8
|
import { readFile } from "node:fs/promises";
|
|
9
9
|
import { EXIT_CODE, PmCliError, createStdinTokenResolver, } from "./runtime-primitives.js";
|
|
10
10
|
import { isErrnoError, parseAnnotationTextInput, runAnnotationCommand, } from "./annotations.js";
|
|
@@ -122,4 +122,4 @@ export async function runComments(id, options, global) {
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
//# sourceMappingURL=comments.js.map
|
|
125
|
-
//# debugId=
|
|
125
|
+
//# debugId=667218ac-866c-59b1-8309-18ad92434fca
|