@unbrained/pm-cli 2026.8.16 → 2026.8.18
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/AGENTS.md +4 -3
- package/CHANGELOG.md +65 -6
- package/README.md +16 -16
- package/dist/cli/error-guidance.js +7 -4
- package/dist/cli/public.d.ts +2 -0
- package/dist/cli/public.js +21 -0
- package/dist/cli/register-list-query.js +132 -51
- package/dist/cli/register-mutation.js +4 -4
- package/dist/cli-bundle/bundle-manifest.json +148 -148
- package/dist/cli-bundle/chunks/chunk-5UZZAJKR.js +3 -0
- package/dist/cli-bundle/chunks/chunk-ALDJGKAK.js +2 -0
- package/dist/cli-bundle/chunks/chunk-BSK2IN3C.js +8 -0
- package/dist/cli-bundle/chunks/chunk-DY4DMUMC.js +197 -0
- package/dist/cli-bundle/chunks/{chunk-73UGEBRS.js → chunk-GNFAFIJI.js} +10 -10
- package/dist/cli-bundle/chunks/chunk-L5Q2CLPE.js +35 -0
- package/dist/cli-bundle/chunks/{chunk-RIS565OA.js → chunk-PVRUN5ZS.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-RZQTVMRQ.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +3 -0
- package/dist/cli-bundle/chunks/chunk-UYCLQVL2.js +13 -0
- package/dist/cli-bundle/chunks/{chunk-URW4QRMI.js → chunk-YRGOLZA7.js} +59 -55
- package/dist/cli-bundle/chunks/register-list-query-I23LALEE.js +11 -0
- package/dist/cli-bundle/chunks/register-mutation-6YGU3GPH.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-KGDNRMCL.js → register-operations-4HTFC6J7.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-NVXBOD5I.js → register-setup-PPPEF3SN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2PN4TJXH.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-C7JUBRFP.js → chunk-3TKWMNKF.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-5AF3ZBNB.js +155 -0
- package/dist/cli-bundle/focused-chunks/chunk-C5IW2NDA.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-CODV5LUT.js → chunk-EUEGXZ2A.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-4JPEBFFC.js → chunk-EX6MKP2X.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SSNDYZTM.js → chunk-K43KKAFS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6ROKKT4X.js → chunk-M62NO7EI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-T46KLOIB.js → chunk-ODOVCP45.js} +47 -47
- package/dist/cli-bundle/focused-chunks/chunk-RNDNMARJ.js +16 -0
- package/dist/cli-bundle/focused-chunks/chunk-TN4AE665.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-TVV2DONO.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-UI6AJ5TD.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-V5XTGLK7.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-WGHQVU6P.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-XYNBXTDQ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Z56ECT7I.js +2 -0
- package/dist/cli-bundle/main.js +7 -7
- 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 +31 -31
- 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 +32 -32
- 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 +4 -2
- package/dist/core/config/nested-settings.js +8 -2
- package/dist/core/extensions/exporter-output-contract.d.ts +12 -0
- package/dist/core/extensions/exporter-output-contract.js +67 -0
- package/dist/core/extensions/extension-types.d.ts +36 -1
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/loader.js +43 -48
- package/dist/core/extensions/manifest-schema.d.ts +20 -0
- package/dist/core/extensions/manifest-schema.js +52 -0
- package/dist/core/history/event-index.d.ts +5 -0
- package/dist/core/history/event-index.js +133 -27
- package/dist/core/history/replay.js +32 -14
- package/dist/core/schema/fields-file.d.ts +1 -1
- package/dist/core/schema/fields-file.js +2 -2
- package/dist/core/schema/runtime-field-values.js +115 -9
- package/dist/core/schema/runtime-schema.d.ts +3 -1
- package/dist/core/schema/runtime-schema.js +124 -3
- package/dist/core/sentry/helpers.js +3 -3
- package/dist/core/shared/constants.js +5 -2
- package/dist/core/shared/errors.d.ts +10 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/time.d.ts +2 -0
- package/dist/core/shared/time.js +27 -2
- package/dist/core/store/settings-validator.d.ts +4 -0
- package/dist/core/store/settings-validator.js +3 -2
- package/dist/core/store/settings.js +8 -2
- package/dist/mcp/tool-definitions.js +12 -7
- package/dist/sdk/agent/refusal-reachability.d.ts +46 -6
- package/dist/sdk/agent/refusal-reachability.js +350 -8
- package/dist/sdk/authoring.d.ts +1 -1
- package/dist/sdk/authoring.js +2 -2
- package/dist/sdk/cli-bootstrap.d.ts +2 -2
- package/dist/sdk/cli-bootstrap.js +4 -4
- package/dist/sdk/cli-contracts/command-aliases.d.ts +34 -2
- package/dist/sdk/cli-contracts/command-aliases.js +64 -13
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
- package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
- package/dist/sdk/cli-contracts/flag-contracts.js +11 -7
- package/dist/sdk/cli-contracts/grammar-contracts.d.ts +70 -0
- package/dist/sdk/cli-contracts/grammar-contracts.js +345 -0
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +19 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +61 -14
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -4
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +20 -11
- package/dist/sdk/cli-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts.js +4 -4
- package/dist/sdk/completion.js +13 -15
- package/dist/sdk/compose.d.ts +9 -5
- package/dist/sdk/compose.js +33 -3
- package/dist/sdk/context-intent-contracts.d.ts +8 -4
- package/dist/sdk/context-intent-contracts.js +76 -31
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +3 -2
- package/dist/sdk/core.d.ts +1 -1
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/dependency-flag-validation.d.ts +9 -2
- package/dist/sdk/dependency-flag-validation.js +101 -35
- package/dist/sdk/environment/host-environment-errors.js +25 -7
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +78 -14
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +62 -14
- package/dist/sdk/governance/assurance-action.d.ts +3 -7
- package/dist/sdk/governance/assurance-action.js +97 -2
- package/dist/sdk/governance/boundary-fixtures.d.ts +86 -0
- package/dist/sdk/governance/boundary-fixtures.js +201 -0
- package/dist/sdk/governance/defect-recurrence-signals.d.ts +10 -0
- package/dist/sdk/governance/defect-recurrence-signals.js +25 -0
- package/dist/sdk/governance/defect-recurrence.d.ts +242 -0
- package/dist/sdk/governance/defect-recurrence.js +523 -0
- package/dist/sdk/governance.d.ts +2 -0
- package/dist/sdk/governance.js +4 -2
- package/dist/sdk/graph/governance.js +3 -2
- package/dist/sdk/guide-topics.js +193 -4
- package/dist/sdk/index.d.ts +7 -3
- package/dist/sdk/index.js +8 -5
- package/dist/sdk/init-agent-guidance.js +3 -3
- package/dist/sdk/lifecycle/create.js +4 -2
- package/dist/sdk/lifecycle/update-many.js +15 -2
- package/dist/sdk/lifecycle/update.js +5 -2
- package/dist/sdk/linked-artifacts.js +63 -14
- package/dist/sdk/mutation-events.d.ts +18 -2
- package/dist/sdk/mutation-events.js +59 -16
- package/dist/sdk/output.d.ts +44 -0
- package/dist/sdk/output.js +28 -2
- package/dist/sdk/query/complete-list.d.ts +94 -0
- package/dist/sdk/query/complete-list.js +173 -0
- package/dist/sdk/query/get.d.ts +2 -0
- package/dist/sdk/query/get.js +32 -7
- package/dist/sdk/query/list.js +5 -2
- package/dist/sdk/query.d.ts +1 -0
- package/dist/sdk/query.js +3 -2
- package/dist/sdk/read-output-contracts.d.ts +2 -2
- package/dist/sdk/read-output-contracts.js +36 -9
- package/dist/sdk/relationship-analytics.js +90 -14
- package/dist/sdk/relationship-kinds/contract.d.ts +4 -0
- package/dist/sdk/relationship-kinds/contract.js +3 -2
- package/dist/sdk/relationships.d.ts +1 -1
- package/dist/sdk/relationships.js +11 -2
- package/dist/sdk/runtime-extended-actions.js +10 -2
- package/dist/sdk/runtime.d.ts +8 -2
- package/dist/sdk/runtime.js +11 -8
- package/dist/sdk/schema.d.ts +1 -0
- package/dist/sdk/schema.js +2 -2
- package/dist/sdk/test/execution.d.ts +6 -2
- package/dist/sdk/test/execution.js +39 -13
- package/dist/types.d.ts +34 -2
- package/dist/types.js +4 -2
- package/docs/AGENT_GUIDE.md +25 -9
- package/docs/CLI_GRAMMAR.md +106 -0
- package/docs/COMMANDS.md +23 -23
- package/docs/CONFIGURATION.md +58 -1
- package/docs/CONTEXT_INTEGRITY_CONTRACTS.md +58 -0
- package/docs/DEFECT_RECURRENCE.md +134 -0
- package/docs/DEPENDENCY_KIND_CONTRACT.md +12 -2
- package/docs/ONBOARDING.md +4 -4
- package/docs/QUICKSTART.md +1 -1
- package/docs/README.md +4 -0
- package/docs/RELATIONSHIP_GRAPH.md +16 -2
- package/docs/RELEASING.md +30 -6
- package/docs/SDK.md +74 -7
- package/docs/SDK_ARTIFACT_OUTPUT.md +72 -0
- package/docs/SDK_CONTEXT_COORDINATION.md +46 -12
- package/docs/SDK_RUNTIME_BOUNDARIES.md +9 -1
- package/docs/TESTING.md +18 -1
- package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +1 -1
- package/docs/agent-task-token-baseline.json +5 -5
- package/marketplace.json +2 -2
- package/package.json +8 -5
- 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-claude/skills/pm-audit/SKILL.md +26 -0
- package/plugins/pm-claude/skills/pm-developer/SKILL.md +26 -0
- package/plugins/pm-claude/skills/pm-planner/SKILL.md +26 -0
- package/plugins/pm-claude/skills/pm-release/SKILL.md +26 -0
- package/plugins/pm-claude/skills/pm-workflow/SKILL.md +26 -0
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/skills/pm-auditor/SKILL.md +26 -0
- package/plugins/pm-codex/skills/pm-native/SKILL.md +26 -0
- package/plugins/pm-codex/skills/pm-release/SKILL.md +26 -0
- package/sdk/public-surface.json +1243 -54
- package/dist/cli-bundle/chunks/chunk-47OQEOQB.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HCIYWD6M.js +0 -35
- package/dist/cli-bundle/chunks/chunk-I2LUWWR5.js +0 -3
- package/dist/cli-bundle/chunks/chunk-IC5W2T34.js +0 -2
- package/dist/cli-bundle/chunks/chunk-OAC5NIV4.js +0 -3
- package/dist/cli-bundle/chunks/chunk-PANOOBIS.js +0 -13
- package/dist/cli-bundle/chunks/chunk-TK6N7HGM.js +0 -8
- package/dist/cli-bundle/chunks/chunk-TOFG2URD.js +0 -197
- package/dist/cli-bundle/chunks/register-list-query-EYCXHZAG.js +0 -10
- package/dist/cli-bundle/chunks/register-mutation-7YVIG54J.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-5NMFSX26.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-725JSCMP.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DQ6SMTBF.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HAACPSUW.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-J4UFYHOD.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-JX5Z344Q.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-L4RDYBIQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-NJ5RLEFD.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-QYZERYR5.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-TZATVC4G.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-WY3WRPVN.js +0 -2
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/agent/refusal-reachability
|
|
3
|
+
*
|
|
4
|
+
* Verifies real-entrypoint observations against refusal states declared by the
|
|
5
|
+
* generated public error-code catalog.
|
|
6
|
+
*/
|
|
2
7
|
|
|
3
|
-
!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]="
|
|
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]="7b488d32-9f92-5a80-965e-e2555cd49315")}catch(e){}}();
|
|
9
|
+
import * as nodeModule from "node:module";
|
|
10
|
+
/** Recovery-reference kinds emitted by structured refusal envelopes. */
|
|
4
11
|
export const PM_RECOVERY_REFERENCE_KINDS = [
|
|
5
12
|
"suggested_retry",
|
|
6
13
|
"candidate_command",
|
|
@@ -11,12 +18,20 @@ export const PM_RECOVERY_REFERENCE_KINDS = [
|
|
|
11
18
|
];
|
|
12
19
|
const RECOVERY_REFERENCE_FIELD_CONTRACTS = {
|
|
13
20
|
suggested_retry: { kind: "suggested_retry", semantics: "recovery" },
|
|
21
|
+
retry_command: { kind: "suggested_retry", semantics: "recovery" },
|
|
14
22
|
candidate_command: { kind: "candidate_command", semantics: "recovery" },
|
|
15
23
|
candidate_commands: { kind: "candidate_command", semantics: "recovery" },
|
|
24
|
+
fallback_candidates: {
|
|
25
|
+
kind: "candidate_command",
|
|
26
|
+
semantics: "recovery",
|
|
27
|
+
nested_value_field: "command",
|
|
28
|
+
},
|
|
29
|
+
next_best_command: { kind: "candidate_command", semantics: "recovery" },
|
|
16
30
|
example: { kind: "example", semantics: "recovery" },
|
|
17
31
|
examples: { kind: "example", semantics: "recovery" },
|
|
18
32
|
next_step: { kind: "next_step", semantics: "recovery" },
|
|
19
33
|
next_steps: { kind: "next_step", semantics: "recovery" },
|
|
34
|
+
suggested_next_steps: { kind: "next_step", semantics: "recovery" },
|
|
20
35
|
migration_hint: { kind: "migration_hint", semantics: "replacement" },
|
|
21
36
|
migration_hints: { kind: "migration_hint", semantics: "replacement" },
|
|
22
37
|
restore_with: {
|
|
@@ -24,6 +39,322 @@ const RECOVERY_REFERENCE_FIELD_CONTRACTS = {
|
|
|
24
39
|
semantics: "behavior_preserving",
|
|
25
40
|
},
|
|
26
41
|
};
|
|
42
|
+
/** Literal envelope fields recognized as recovery-reference producers. */
|
|
43
|
+
export const PM_RECOVERY_REFERENCE_FIELDS = Object.freeze(Object.keys(RECOVERY_REFERENCE_FIELD_CONTRACTS));
|
|
44
|
+
/** Resolve an own recovery-field contract without trusting object prototypes. */
|
|
45
|
+
function recoveryReferenceContract(field) {
|
|
46
|
+
if (!Object.hasOwn(RECOVERY_REFERENCE_FIELD_CONTRACTS, field))
|
|
47
|
+
return undefined;
|
|
48
|
+
return RECOVERY_REFERENCE_FIELD_CONTRACTS[field];
|
|
49
|
+
}
|
|
50
|
+
const SOURCE_REGEXP_PREFIX_PUNCTUATORS = new Set([
|
|
51
|
+
..."=([{,:;!?&|+-*%^~<>",
|
|
52
|
+
"=>",
|
|
53
|
+
]);
|
|
54
|
+
function compareCodeUnits(left, right) {
|
|
55
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
56
|
+
}
|
|
57
|
+
function skipQuotedSourceToken(source, index) {
|
|
58
|
+
const quote = source[index];
|
|
59
|
+
let next = index + 1;
|
|
60
|
+
let value = "";
|
|
61
|
+
while (next < source.length && source[next] !== quote) {
|
|
62
|
+
if (source[next] === "\\")
|
|
63
|
+
next += 2;
|
|
64
|
+
else {
|
|
65
|
+
value += source[next];
|
|
66
|
+
next += 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (source[next] === quote)
|
|
70
|
+
next += 1;
|
|
71
|
+
return { next, value };
|
|
72
|
+
}
|
|
73
|
+
function canStartRegularExpression(previous) {
|
|
74
|
+
return (previous === undefined ||
|
|
75
|
+
(previous.kind === "punctuator" &&
|
|
76
|
+
SOURCE_REGEXP_PREFIX_PUNCTUATORS.has(previous.value)) ||
|
|
77
|
+
(previous.kind === "identifier" &&
|
|
78
|
+
["return", "case", "throw", "else", "yield"].includes(previous.value)));
|
|
79
|
+
}
|
|
80
|
+
function sourceTriviaEnd(source, index) {
|
|
81
|
+
if (/\s/u.test(source[index]))
|
|
82
|
+
return index + 1;
|
|
83
|
+
if (source.startsWith("//", index)) {
|
|
84
|
+
const newline = source.indexOf("\n", index + 2);
|
|
85
|
+
return newline === -1 ? source.length : newline + 1;
|
|
86
|
+
}
|
|
87
|
+
if (!source.startsWith("/*", index))
|
|
88
|
+
return undefined;
|
|
89
|
+
// stripTypeScriptTypes validates block-comment termination before tokenization.
|
|
90
|
+
return source.indexOf("*/", index + 2) + 2;
|
|
91
|
+
}
|
|
92
|
+
function regularExpressionEnd(source, index, previous) {
|
|
93
|
+
if (source[index] !== "/" || !canStartRegularExpression(previous))
|
|
94
|
+
return undefined;
|
|
95
|
+
let next = index + 1;
|
|
96
|
+
let inClass = false;
|
|
97
|
+
while (next < source.length) {
|
|
98
|
+
if (source[next] === "\\")
|
|
99
|
+
next += 2;
|
|
100
|
+
else if (source[next] === "[") {
|
|
101
|
+
inClass = true;
|
|
102
|
+
next += 1;
|
|
103
|
+
}
|
|
104
|
+
else if (source[next] === "]") {
|
|
105
|
+
inClass = false;
|
|
106
|
+
next += 1;
|
|
107
|
+
}
|
|
108
|
+
else if (source[next] === "/" && !inClass) {
|
|
109
|
+
next += 1;
|
|
110
|
+
while (/[A-Za-z]/u.test(source.charAt(next)))
|
|
111
|
+
next += 1;
|
|
112
|
+
return next;
|
|
113
|
+
}
|
|
114
|
+
else
|
|
115
|
+
next += 1;
|
|
116
|
+
}
|
|
117
|
+
return next;
|
|
118
|
+
}
|
|
119
|
+
function readSourceSyntaxToken(source, index) {
|
|
120
|
+
const character = source[index];
|
|
121
|
+
if (character === "'" || character === '"' || character === "`") {
|
|
122
|
+
const quoted = skipQuotedSourceToken(source, index);
|
|
123
|
+
return character === "`"
|
|
124
|
+
? { next: quoted.next }
|
|
125
|
+
: {
|
|
126
|
+
next: quoted.next,
|
|
127
|
+
token: { kind: "string", value: quoted.value, offset: index + 1 },
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
if (/[A-Za-z_$]/u.test(character)) {
|
|
131
|
+
let next = index + 1;
|
|
132
|
+
while (/[A-Za-z0-9_$]/u.test(source[next] ?? ""))
|
|
133
|
+
next += 1;
|
|
134
|
+
return {
|
|
135
|
+
next,
|
|
136
|
+
token: {
|
|
137
|
+
kind: "identifier",
|
|
138
|
+
value: source.slice(index, next),
|
|
139
|
+
offset: index,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
const punctuator = source.startsWith("=>", index) ? "=>" : character;
|
|
144
|
+
return {
|
|
145
|
+
next: index + punctuator.length,
|
|
146
|
+
token: { kind: "punctuator", value: punctuator, offset: index },
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** Tokenize executable JavaScript while ignoring comments, templates, and regex bodies. */
|
|
150
|
+
function tokenizeExecutableSource(source) {
|
|
151
|
+
const tokens = [];
|
|
152
|
+
let index = 0;
|
|
153
|
+
while (index < source.length) {
|
|
154
|
+
const ignoredEnd = sourceTriviaEnd(source, index);
|
|
155
|
+
if (ignoredEnd !== undefined) {
|
|
156
|
+
index = ignoredEnd;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const regexEnd = regularExpressionEnd(source, index, tokens.at(-1));
|
|
160
|
+
if (regexEnd !== undefined) {
|
|
161
|
+
index = regexEnd;
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
const read = readSourceSyntaxToken(source, index);
|
|
165
|
+
if (read.token)
|
|
166
|
+
tokens.push(read.token);
|
|
167
|
+
index = read.next;
|
|
168
|
+
}
|
|
169
|
+
return tokens;
|
|
170
|
+
}
|
|
171
|
+
const SOURCE_BRACE_FRAME_KINDS = new Set([
|
|
172
|
+
"object",
|
|
173
|
+
"block",
|
|
174
|
+
"pattern",
|
|
175
|
+
]);
|
|
176
|
+
const SOURCE_PATTERN_DECLARATIONS = new Set(["const", "let", "var"]);
|
|
177
|
+
const SOURCE_CLOSING_TOKENS = new Set(["}", ")", "]"]);
|
|
178
|
+
const SOURCE_OBJECT_PRECEDERS = new Set([
|
|
179
|
+
"=",
|
|
180
|
+
"(",
|
|
181
|
+
"[",
|
|
182
|
+
",",
|
|
183
|
+
":",
|
|
184
|
+
"?",
|
|
185
|
+
"return",
|
|
186
|
+
]);
|
|
187
|
+
function objectFrameKind(tokens, index, stack) {
|
|
188
|
+
const enclosingBrace = [...stack]
|
|
189
|
+
.reverse()
|
|
190
|
+
.find((frame) => SOURCE_BRACE_FRAME_KINDS.has(frame.kind));
|
|
191
|
+
if (enclosingBrace?.kind === "pattern")
|
|
192
|
+
return "pattern";
|
|
193
|
+
if (stack.at(-1)?.kind === "paren" && stack.at(-1)?.parameter_list)
|
|
194
|
+
return "pattern";
|
|
195
|
+
const previous = tokens[index - 1];
|
|
196
|
+
if (previous?.kind === "identifier" &&
|
|
197
|
+
SOURCE_PATTERN_DECLARATIONS.has(previous.value)) {
|
|
198
|
+
return "pattern";
|
|
199
|
+
}
|
|
200
|
+
if (previous?.value === "=>" || previous?.value === ")")
|
|
201
|
+
return "block";
|
|
202
|
+
return previous && SOURCE_OBJECT_PRECEDERS.has(previous.value)
|
|
203
|
+
? "object"
|
|
204
|
+
: "block";
|
|
205
|
+
}
|
|
206
|
+
function openingSourceFrame(tokens, index, stack) {
|
|
207
|
+
const token = tokens[index];
|
|
208
|
+
if (token.value === "{") {
|
|
209
|
+
const kind = objectFrameKind(tokens, index, stack);
|
|
210
|
+
return {
|
|
211
|
+
kind,
|
|
212
|
+
...(kind === "object" ? { member_start: true, candidates: [] } : {}),
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
if (token.value === "[")
|
|
216
|
+
return { kind: "array" };
|
|
217
|
+
if (token.value !== "(")
|
|
218
|
+
return undefined;
|
|
219
|
+
const previous = tokens[index - 1];
|
|
220
|
+
const beforePrevious = tokens[index - 2];
|
|
221
|
+
const parameterList = previous?.value === "function" || beforePrevious?.value === "function";
|
|
222
|
+
return { kind: "paren", ...(parameterList ? { parameter_list: true } : {}) };
|
|
223
|
+
}
|
|
224
|
+
function staticObjectMember(frame, token, next) {
|
|
225
|
+
if (frame?.kind !== "object" ||
|
|
226
|
+
!frame.member_start ||
|
|
227
|
+
(token.kind !== "identifier" && token.kind !== "string") ||
|
|
228
|
+
next?.value !== ":" ||
|
|
229
|
+
!/^[A-Za-z][A-Za-z0-9_]*$/u.test(token.value)) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
return { field: token.value, offset: token.offset };
|
|
233
|
+
}
|
|
234
|
+
function isPatternLikeObjectClosure(tokens, index) {
|
|
235
|
+
return ((tokens[index + 1]?.value === ")" && tokens[index + 2]?.value === "=>") ||
|
|
236
|
+
tokens[index + 1]?.value === "=");
|
|
237
|
+
}
|
|
238
|
+
/** Parse static object-literal members without treating patterns or labels as producers. */
|
|
239
|
+
function scanSourcePropertyTokens(source) {
|
|
240
|
+
const tokens = tokenizeExecutableSource(nodeModule.stripTypeScriptTypes(source, { mode: "strip" }));
|
|
241
|
+
const properties = [];
|
|
242
|
+
const stack = [];
|
|
243
|
+
for (const [index, token] of tokens.entries()) {
|
|
244
|
+
const frame = stack.at(-1);
|
|
245
|
+
const property = staticObjectMember(frame, token, tokens[index + 1]);
|
|
246
|
+
if (property)
|
|
247
|
+
frame.candidates.push(property);
|
|
248
|
+
const opening = openingSourceFrame(tokens, index, stack);
|
|
249
|
+
if (opening) {
|
|
250
|
+
stack.push(opening);
|
|
251
|
+
}
|
|
252
|
+
else if (SOURCE_CLOSING_TOKENS.has(token.value)) {
|
|
253
|
+
const closed = stack.pop();
|
|
254
|
+
if (closed?.kind === "object" &&
|
|
255
|
+
!isPatternLikeObjectClosure(tokens, index)) {
|
|
256
|
+
properties.push(...closed.candidates);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
else if (token.value === "," && frame?.kind === "object") {
|
|
260
|
+
frame.member_start = true;
|
|
261
|
+
}
|
|
262
|
+
else if (frame?.kind === "object" && token.value !== ":") {
|
|
263
|
+
frame.member_start = false;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return properties;
|
|
267
|
+
}
|
|
268
|
+
function sourceLineStarts(source) {
|
|
269
|
+
const starts = [0];
|
|
270
|
+
for (let index = 0; index < source.length; index += 1) {
|
|
271
|
+
if (source[index] === "\n")
|
|
272
|
+
starts.push(index + 1);
|
|
273
|
+
}
|
|
274
|
+
return starts;
|
|
275
|
+
}
|
|
276
|
+
function sourceLineAtOffset(starts, offset) {
|
|
277
|
+
let low = 0;
|
|
278
|
+
let high = starts.length;
|
|
279
|
+
while (low < high) {
|
|
280
|
+
const middle = Math.floor((low + high) / 2);
|
|
281
|
+
if (starts[middle] <= offset)
|
|
282
|
+
low = middle + 1;
|
|
283
|
+
else
|
|
284
|
+
high = middle;
|
|
285
|
+
}
|
|
286
|
+
return low;
|
|
287
|
+
}
|
|
288
|
+
/** Census syntax-parsed structured-envelope producers without executing source code. */
|
|
289
|
+
export function censusPmRecoveryReferenceProducers(sources) {
|
|
290
|
+
const producers = [];
|
|
291
|
+
const findings = [];
|
|
292
|
+
for (const source of [...sources].sort((left, right) => compareCodeUnits(left.path, right.path))) {
|
|
293
|
+
const lineStarts = sourceLineStarts(source.content);
|
|
294
|
+
let properties;
|
|
295
|
+
try {
|
|
296
|
+
properties = scanSourcePropertyTokens(source.content);
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
findings.push({
|
|
300
|
+
kind: "invalid_source",
|
|
301
|
+
subject: source.path,
|
|
302
|
+
detail: `${source.path} could not be parsed for recovery producers: ${String(error)}.`,
|
|
303
|
+
});
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
for (const property of properties) {
|
|
307
|
+
const field = property.field;
|
|
308
|
+
const line = sourceLineAtOffset(lineStarts, property.offset);
|
|
309
|
+
const contract = recoveryReferenceContract(field);
|
|
310
|
+
if (contract) {
|
|
311
|
+
producers.push({
|
|
312
|
+
path: source.path,
|
|
313
|
+
line,
|
|
314
|
+
field: field,
|
|
315
|
+
kind: contract.kind,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
else if (/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(field) &&
|
|
319
|
+
!/(?:_total|_truncated)$/u.test(field)) {
|
|
320
|
+
findings.push({
|
|
321
|
+
kind: "unknown_recovery_field",
|
|
322
|
+
subject: `${source.path}:${line}:${field}`,
|
|
323
|
+
detail: `${field} resembles a recovery reference but has no typed field contract.`,
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
const producerCountByKind = Object.fromEntries(PM_RECOVERY_REFERENCE_KINDS.map((kind) => [
|
|
329
|
+
kind,
|
|
330
|
+
producers.filter((producer) => producer.kind === kind).length,
|
|
331
|
+
]));
|
|
332
|
+
for (const kind of PM_RECOVERY_REFERENCE_KINDS) {
|
|
333
|
+
if (producerCountByKind[kind] === 0) {
|
|
334
|
+
findings.push({
|
|
335
|
+
kind: "missing_kind_producer",
|
|
336
|
+
subject: kind,
|
|
337
|
+
detail: `No source producer emits the ${kind} recovery-reference kind.`,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
producers.sort((left, right) => left.path !== right.path
|
|
342
|
+
? compareCodeUnits(left.path, right.path)
|
|
343
|
+
: left.line !== right.line
|
|
344
|
+
? left.line - right.line
|
|
345
|
+
: compareCodeUnits(left.field, right.field));
|
|
346
|
+
findings.sort((left, right) => left.subject !== right.subject
|
|
347
|
+
? compareCodeUnits(left.subject, right.subject)
|
|
348
|
+
: compareCodeUnits(left.kind, right.kind));
|
|
349
|
+
return {
|
|
350
|
+
ok: findings.length === 0,
|
|
351
|
+
scanned_file_count: sources.length,
|
|
352
|
+
producer_count: producers.length,
|
|
353
|
+
producer_count_by_kind: producerCountByKind,
|
|
354
|
+
producers,
|
|
355
|
+
findings,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
27
358
|
/** Derive typed obligations from every recognized recovery field in an emitted envelope. */
|
|
28
359
|
export function derivePmRecoveryReferenceObligations(probeId, envelope) {
|
|
29
360
|
const obligations = [];
|
|
@@ -34,16 +365,27 @@ export function derivePmRecoveryReferenceObligations(probeId, envelope) {
|
|
|
34
365
|
}
|
|
35
366
|
if (typeof value !== "object" || value === null)
|
|
36
367
|
return;
|
|
37
|
-
for (const [key, entry] of Object.entries(value).sort(([left], [right]) => left
|
|
38
|
-
const baseContract =
|
|
368
|
+
for (const [key, entry] of Object.entries(value).sort(([left], [right]) => compareCodeUnits(left, right))) {
|
|
369
|
+
const baseContract = recoveryReferenceContract(key);
|
|
39
370
|
const contract = baseContract?.kind === "migration_hint" &&
|
|
40
371
|
value.semantics === "behavior_preserving"
|
|
41
372
|
? { ...baseContract, semantics: "behavior_preserving" }
|
|
42
373
|
: baseContract;
|
|
43
|
-
const entries =
|
|
374
|
+
const entries = [entry].flat();
|
|
44
375
|
if (contract !== undefined) {
|
|
45
376
|
entries.forEach((candidate, index) => {
|
|
46
|
-
|
|
377
|
+
const nestedValueField = "nested_value_field" in contract &&
|
|
378
|
+
typeof contract.nested_value_field === "string"
|
|
379
|
+
? contract.nested_value_field
|
|
380
|
+
: undefined;
|
|
381
|
+
const resolvedCandidate = nestedValueField &&
|
|
382
|
+
typeof candidate === "object" &&
|
|
383
|
+
candidate !== null &&
|
|
384
|
+
!Array.isArray(candidate)
|
|
385
|
+
? candidate[nestedValueField]
|
|
386
|
+
: candidate;
|
|
387
|
+
if (typeof resolvedCandidate !== "string" ||
|
|
388
|
+
resolvedCandidate.trim().length === 0)
|
|
47
389
|
return;
|
|
48
390
|
const coordinate = [...path, key, String(index)]
|
|
49
391
|
.map((segment) => encodeURIComponent(segment))
|
|
@@ -53,7 +395,7 @@ export function derivePmRecoveryReferenceObligations(probeId, envelope) {
|
|
|
53
395
|
probe_id: probeId,
|
|
54
396
|
kind: contract.kind,
|
|
55
397
|
semantics: contract.semantics,
|
|
56
|
-
value:
|
|
398
|
+
value: resolvedCandidate,
|
|
57
399
|
});
|
|
58
400
|
});
|
|
59
401
|
}
|
|
@@ -225,4 +567,4 @@ export function verifyPmRecoveryReferences(obligations, observations) {
|
|
|
225
567
|
};
|
|
226
568
|
}
|
|
227
569
|
//# sourceMappingURL=refusal-reachability.js.map
|
|
228
|
-
//# debugId=
|
|
570
|
+
//# debugId=7b488d32-9f92-5a80-965e-e2555cd49315
|
package/dist/sdk/authoring.d.ts
CHANGED
|
@@ -15,4 +15,4 @@ export { planProfileApplication, type ProfileApplicationPlan, type ProfileChange
|
|
|
15
15
|
export { EXTENSION_CAPABILITY_REGISTRATION_SURFACES, collectUsedExtensionCapabilities, reconcileExtensionCapabilityUsage, type CollectUsedExtensionCapabilitiesOptions, type ExtensionCapabilityUsageReconciliation, } from "../core/extensions/capability-usage.js";
|
|
16
16
|
export { renderExtensionSurfaceMarkdown, type ExtensionSurfaceMarkdownOptions, } from "../core/extensions/activation-summary-markdown.js";
|
|
17
17
|
export { createExtensionContributionInventory, normalizeExtensionContributionInventory, } from "../core/extensions/contribution-inventory.js";
|
|
18
|
-
export type { AfterCommandAffectedItem, AfterCommandHook, AfterCommandHookContext, BeforeCommandHook, BeforeCommandHookContext, BeforeMutationHook, BeforeMutationHookContext, BeforeMutationHookDecision, CommandDefinition, ExtensionCommandArgumentDefinition, CommandHandler, CommandHandlerContext, CommandHandlerResult, ExtensionCommandSdk, CommandOverride, CommandOverrideContext, ExtensionServiceName, Exporter, ExtensionActivationResult, ExtensionApi, ExtensionCommandRegistry, ExtensionDeactivationFailure, ExtensionDeactivationOptions, ExtensionDeactivationResult, ExtensionDiagnostic, ExtensionContributionInventory, ExtensionDiscoveryResult, ExtensionHookRegistry, ExtensionSelfIdentity, ExtensionLoadResult, ExtensionManifest, ExtensionManifestEngines, ExtensionMutationGuardSdk, ExtensionGovernancePolicy, ExtensionPolicyOverride, ExtensionProvenanceMetadata, ExtensionRuntimePermissionDeclaration, ExtensionSearchMode, ExtensionParserRegistry, ExtensionPreflightRegistry, ExtensionRegistrationRegistry, ExtensionRendererRegistry, ExtensionServiceRegistry, FlagValueType, FlagDefinition, ImportExportContext, ImportExportRegistrationOptions, Importer, OnIndexHook, OnIndexHookContext, OnReadHook, OnReadHookContext, OnWriteHook, OnWriteHookContext, OutputRendererFormat, ParserOverride, ParserOverrideContext, ParserOverrideDelta, PreflightOverride, PreflightOverrideContext, PreflightOverrideDelta, PreflightRuntimeDecision, RegisteredExtensionExporter, RegisteredExtensionFlagDefinitions, RegisteredExtensionHook, RegisteredExtensionImporter, RegisteredExtensionProjectProfile, RegisteredExtensionSchemaMigrationDefinition, RegisteredExtensionSearchProvider, RegisteredExtensionServiceOverride, RegisteredExtensionVectorStoreAdapter, RendererOverride, RendererOverrideContext, SchemaFieldDefinition, SchemaItemTypeCommandOptionPolicyDefinition, SchemaItemTypeOptionDefinition, SchemaItemTypeDefinition, SchemaMigrationDefinition, SchemaMigrationRunContext, SchemaMigrationRunner, SearchProviderEmbedBatchContext, SearchProviderEmbedContext, SearchProviderDefinition, SearchProviderHit, SearchProviderQueryContext, SearchProviderQueryResult, ServiceOverride, ServiceOverrideContext, ServiceOverrideDecision, VectorStoreAdapterDefinition, VectorStoreDeleteContext, VectorStoreQueryContext, VectorStoreQueryHit, VectorStoreUpsertContext, VectorStoreUpsertPoint, } from "../core/extensions/loader.js";
|
|
18
|
+
export type { AfterCommandAffectedItem, AfterCommandHook, AfterCommandHookContext, BeforeCommandHook, BeforeCommandHookContext, BeforeMutationHook, BeforeMutationHookContext, BeforeMutationHookDecision, CommandDefinition, ExtensionCommandArgumentDefinition, CommandHandler, CommandHandlerContext, CommandHandlerResult, ExtensionCommandSdk, CommandOverride, CommandOverrideContext, ExtensionServiceName, Exporter, ExporterArtifactOutputContract, ExporterRegistrationOptions, ExtensionActivationResult, ExtensionApi, ExtensionCommandRegistry, ExtensionDeactivationFailure, ExtensionDeactivationOptions, ExtensionDeactivationResult, ExtensionDiagnostic, ExtensionContributionInventory, ExtensionDiscoveryResult, ExtensionHookRegistry, ExtensionSelfIdentity, ExtensionLoadResult, ExtensionManifest, ExtensionManifestEngines, ExtensionMutationGuardSdk, ExtensionGovernancePolicy, ExtensionPolicyOverride, ExtensionProvenanceMetadata, ExtensionRuntimePermissionDeclaration, ExtensionSearchMode, ExtensionParserRegistry, ExtensionPreflightRegistry, ExtensionRegistrationRegistry, ExtensionRendererRegistry, ExtensionServiceRegistry, FlagValueType, FlagDefinition, ImportExportContext, ImportExportRegistrationOptions, Importer, OnIndexHook, OnIndexHookContext, OnReadHook, OnReadHookContext, OnWriteHook, OnWriteHookContext, OutputRendererFormat, ParserOverride, ParserOverrideContext, ParserOverrideDelta, PreflightOverride, PreflightOverrideContext, PreflightOverrideDelta, PreflightRuntimeDecision, RegisteredExtensionExporter, RegisteredExporterArtifactOutputContract, RegisteredExtensionFlagDefinitions, RegisteredExtensionHook, RegisteredExtensionImporter, RegisteredExtensionProjectProfile, RegisteredExtensionSchemaMigrationDefinition, RegisteredExtensionSearchProvider, RegisteredExtensionServiceOverride, RegisteredExtensionVectorStoreAdapter, RendererOverride, RendererOverrideContext, SchemaFieldDefinition, SchemaItemTypeCommandOptionPolicyDefinition, SchemaItemTypeOptionDefinition, SchemaItemTypeDefinition, SchemaMigrationDefinition, SchemaMigrationRunContext, SchemaMigrationRunner, SearchProviderEmbedBatchContext, SearchProviderEmbedContext, SearchProviderDefinition, SearchProviderHit, SearchProviderQueryContext, SearchProviderQueryResult, ServiceOverride, ServiceOverrideContext, ServiceOverrideDecision, VectorStoreAdapterDefinition, VectorStoreDeleteContext, VectorStoreQueryContext, VectorStoreQueryHit, VectorStoreUpsertContext, VectorStoreUpsertPoint, } from "../core/extensions/loader.js";
|
package/dist/sdk/authoring.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides the focused extension and package authoring surface.
|
|
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]="6260572c-1496-58ef-9377-0825f4183bc6")}catch(e){}}();
|
|
8
8
|
export * from "./compose.js";
|
|
9
9
|
export * from "./define.js";
|
|
10
10
|
export * from "./extension-contracts.js";
|
|
@@ -18,4 +18,4 @@ export { EXTENSION_CAPABILITY_REGISTRATION_SURFACES, collectUsedExtensionCapabil
|
|
|
18
18
|
export { renderExtensionSurfaceMarkdown, } from "../core/extensions/activation-summary-markdown.js";
|
|
19
19
|
export { createExtensionContributionInventory, normalizeExtensionContributionInventory, } from "../core/extensions/contribution-inventory.js";
|
|
20
20
|
//# sourceMappingURL=authoring.js.map
|
|
21
|
-
//# debugId=
|
|
21
|
+
//# debugId=6260572c-1496-58ef-9377-0825f4183bc6
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides public bootstrap argument normalization for embedded CLI hosts.
|
|
5
5
|
*/
|
|
6
|
-
import { EXECUTABLE_COMMAND_ALIASES, type CliFlagContract } from "./cli-contracts.js";
|
|
7
|
-
export { EXECUTABLE_COMMAND_ALIASES };
|
|
6
|
+
import { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, type CliFlagContract, type PmCommandAliasContract, type PmCommandAliasLifecycle, type PmCommandAliasRegistration } from "./cli-contracts.js";
|
|
7
|
+
export { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, type PmCommandAliasContract, type PmCommandAliasLifecycle, type PmCommandAliasRegistration, };
|
|
8
8
|
/** Documents the bootstrap global options payload exchanged by command, SDK, and package integrations. */
|
|
9
9
|
export interface BootstrapGlobalOptions {
|
|
10
10
|
/** Filesystem path used for path resolution. */
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Provides public bootstrap argument normalization for embedded CLI hosts.
|
|
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]="
|
|
8
|
-
import { EXECUTABLE_COMMAND_ALIASES, resolveSubcommandFlagContractsForCommand, } from "./cli-contracts.js";
|
|
9
|
-
export { EXECUTABLE_COMMAND_ALIASES };
|
|
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]="d45455ca-9496-5b8c-906c-d33d3d890e68")}catch(e){}}();
|
|
8
|
+
import { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, resolveSubcommandFlagContractsForCommand, } from "./cli-contracts.js";
|
|
9
|
+
export { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, };
|
|
10
10
|
import { levenshteinDistanceWithinLimit } from "../core/shared/levenshtein.js";
|
|
11
11
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
12
12
|
import { PmCliError } from "../core/shared/errors.js";
|
|
@@ -895,4 +895,4 @@ export const _testOnly = {
|
|
|
895
895
|
resolveCanonicalFlag,
|
|
896
896
|
};
|
|
897
897
|
//# sourceMappingURL=cli-bootstrap.js.map
|
|
898
|
-
//# debugId=
|
|
898
|
+
//# debugId=d45455ca-9496-5b8c-906c-d33d3d890e68
|
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module sdk/cli-contracts/command-aliases
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Declares command aliases once so CLI registration, bootstrap parsing,
|
|
5
|
+
* contracts, completions, and package authors can share one compatibility
|
|
6
|
+
* policy instead of maintaining parallel spelling lists.
|
|
5
7
|
*/
|
|
6
|
-
/**
|
|
8
|
+
/** Lifecycle policy applied to a command alias. */
|
|
9
|
+
export type PmCommandAliasLifecycle = "permanent" | "deprecated";
|
|
10
|
+
/** Registration mechanism used to preserve an alias invocation. */
|
|
11
|
+
export type PmCommandAliasRegistration = "bootstrap" | "commander";
|
|
12
|
+
/** Machine-readable compatibility contract for one executable command alias. */
|
|
13
|
+
export interface PmCommandAliasContract {
|
|
14
|
+
/** Legacy or ergonomic spelling accepted at the command root. */
|
|
15
|
+
alias: string;
|
|
16
|
+
/** Canonical command path agents should discover and generate. */
|
|
17
|
+
canonical: string;
|
|
18
|
+
/** Canonical tokens inserted before user-provided options and arguments. */
|
|
19
|
+
canonical_argv: readonly string[];
|
|
20
|
+
/** Whether the alias is permanent ergonomics or migration-only compatibility. */
|
|
21
|
+
lifecycle: PmCommandAliasLifecycle;
|
|
22
|
+
/** Whether default help and completion discovery omit the alias. */
|
|
23
|
+
hidden: boolean;
|
|
24
|
+
/** Runtime layer that keeps the alias executable. */
|
|
25
|
+
registration: PmCommandAliasRegistration;
|
|
26
|
+
/** PM item that owns the compatibility disposition. */
|
|
27
|
+
owner: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Public command-alias table. Deprecated aliases must remain executable but
|
|
31
|
+
* are intentionally absent from default help and completion discovery.
|
|
32
|
+
*/
|
|
33
|
+
export declare const PM_COMMAND_ALIAS_CONTRACTS: readonly PmCommandAliasContract[];
|
|
34
|
+
/** High-frequency executable aliases whose targets accept identical arguments. */
|
|
7
35
|
export declare const EXECUTABLE_COMMAND_ALIASES: Readonly<Record<string, string>>;
|
|
36
|
+
/** Resolve one declared command alias without inferring from its spelling. */
|
|
37
|
+
export declare function resolvePmCommandAlias(alias: string): PmCommandAliasContract | undefined;
|
|
38
|
+
/** Render the stable one-line migration hint emitted for deprecated aliases. */
|
|
39
|
+
export declare function renderPmCommandAliasMigrationHint(contract: PmCommandAliasContract): string;
|
|
@@ -1,19 +1,70 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module sdk/cli-contracts/command-aliases
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Declares command aliases once so CLI registration, bootstrap parsing,
|
|
5
|
+
* contracts, completions, and package authors can share one compatibility
|
|
6
|
+
* policy instead of maintaining parallel spelling lists.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Public command-alias table. Deprecated aliases must remain executable but
|
|
10
|
+
* are intentionally absent from default help and completion discovery.
|
|
5
11
|
*/
|
|
6
|
-
/** High-frequency executable aliases whose targets accept the same positional and flag contracts. */
|
|
7
12
|
|
|
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]="
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
!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]="cde15ba9-270e-5e05-baba-7dafbe1bd5da")}catch(e){}}();
|
|
14
|
+
export const PM_COMMAND_ALIAS_CONTRACTS = [
|
|
15
|
+
...[
|
|
16
|
+
["fetch", "get"],
|
|
17
|
+
["read", "get"],
|
|
18
|
+
["show", "get"],
|
|
19
|
+
["view", "get"],
|
|
20
|
+
["comment", "comments"],
|
|
21
|
+
["note", "notes"],
|
|
22
|
+
["learning", "learnings"],
|
|
23
|
+
].map(([alias, canonical]) => ({
|
|
24
|
+
alias,
|
|
25
|
+
canonical,
|
|
26
|
+
canonical_argv: [canonical],
|
|
27
|
+
lifecycle: "permanent",
|
|
28
|
+
hidden: false,
|
|
29
|
+
registration: "bootstrap",
|
|
30
|
+
owner: "pm-pbyu",
|
|
31
|
+
})),
|
|
32
|
+
{
|
|
33
|
+
alias: "list-all",
|
|
34
|
+
canonical: "list",
|
|
35
|
+
canonical_argv: ["list", "--all"],
|
|
36
|
+
lifecycle: "deprecated",
|
|
37
|
+
hidden: true,
|
|
38
|
+
registration: "commander",
|
|
39
|
+
owner: "pm-pfqi",
|
|
40
|
+
},
|
|
41
|
+
...[
|
|
42
|
+
["list-draft", "draft"],
|
|
43
|
+
["list-open", "open"],
|
|
44
|
+
["list-in-progress", "in_progress"],
|
|
45
|
+
["list-blocked", "blocked"],
|
|
46
|
+
["list-closed", "closed"],
|
|
47
|
+
["list-canceled", "canceled"],
|
|
48
|
+
].map(([alias, status]) => ({
|
|
49
|
+
alias,
|
|
50
|
+
canonical: "list",
|
|
51
|
+
canonical_argv: ["list", "--status", status],
|
|
52
|
+
lifecycle: "deprecated",
|
|
53
|
+
hidden: true,
|
|
54
|
+
registration: "commander",
|
|
55
|
+
owner: "pm-pfqi",
|
|
56
|
+
})),
|
|
57
|
+
];
|
|
58
|
+
/** High-frequency executable aliases whose targets accept identical arguments. */
|
|
59
|
+
export const EXECUTABLE_COMMAND_ALIASES = Object.fromEntries(PM_COMMAND_ALIAS_CONTRACTS.filter((contract) => contract.registration === "bootstrap").map((contract) => [contract.alias, contract.canonical]));
|
|
60
|
+
/** Resolve one declared command alias without inferring from its spelling. */
|
|
61
|
+
export function resolvePmCommandAlias(alias) {
|
|
62
|
+
const normalized = alias.trim().toLowerCase();
|
|
63
|
+
return PM_COMMAND_ALIAS_CONTRACTS.find((contract) => contract.alias === normalized);
|
|
64
|
+
}
|
|
65
|
+
/** Render the stable one-line migration hint emitted for deprecated aliases. */
|
|
66
|
+
export function renderPmCommandAliasMigrationHint(contract) {
|
|
67
|
+
return `Deprecated command \`${contract.alias}\`; use \`pm ${contract.canonical_argv.join(" ")}\`.`;
|
|
68
|
+
}
|
|
18
69
|
//# sourceMappingURL=command-aliases.js.map
|
|
19
|
-
//# debugId=
|
|
70
|
+
//# debugId=cde15ba9-270e-5e05-baba-7dafbe1bd5da
|
|
@@ -46,6 +46,10 @@ export type PmToolAction = Exclude<PmCoreCommandName, PmCliOnlyToolAction> | PmE
|
|
|
46
46
|
* package verbs are flattened for transports that expose one action string.
|
|
47
47
|
*/
|
|
48
48
|
export declare const PM_TOOL_ACTIONS: readonly PmToolAction[];
|
|
49
|
+
/** Deprecated compatibility actions accepted by the SDK but omitted from canonical MCP discovery. */
|
|
50
|
+
export declare const PM_DEPRECATED_TOOL_ACTIONS: readonly PmToolAction[];
|
|
51
|
+
/** Canonical actions presented to MCP clients and unscoped contract consumers. */
|
|
52
|
+
export declare const PM_DISCOVERABLE_TOOL_ACTIONS: readonly PmToolAction[];
|
|
49
53
|
/** Static CLI-to-tool action parity evidence used by quality gates and tests. */
|
|
50
54
|
export declare function analyzePmToolActionParity(cliCommands?: readonly string[], toolActions?: readonly string[], waivers?: Readonly<Record<string, string>>): {
|
|
51
55
|
missing_cli_actions: string[];
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Defines SDK command-contract metadata for Enum Contracts.
|
|
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]="d05ce92b-bee8-5cce-afc2-8c7901306a30")}catch(e){}}();
|
|
8
8
|
import { KNOWN_EXTENSION_CAPABILITIES, KNOWN_EXTENSION_POLICY_MODES, KNOWN_EXTENSION_POLICY_SURFACES, KNOWN_EXTENSION_SANDBOX_PROFILES, KNOWN_EXTENSION_SERVICE_NAMES, KNOWN_EXTENSION_TRUST_MODES, } from "../../core/extensions/extension-types.js";
|
|
9
|
+
import { PM_COMMAND_ALIAS_CONTRACTS } from "./command-aliases.js";
|
|
9
10
|
/** Public contract for pm extension capability contracts, shared by SDK and presentation-layer consumers. */
|
|
10
11
|
export const PM_EXTENSION_CAPABILITY_CONTRACTS = [
|
|
11
12
|
...KNOWN_EXTENSION_CAPABILITIES,
|
|
@@ -160,6 +161,12 @@ export const PM_TOOL_ACTIONS = Object.freeze(PM_CORE_COMMAND_NAMES.flatMap((comm
|
|
|
160
161
|
}
|
|
161
162
|
return [command];
|
|
162
163
|
}));
|
|
164
|
+
/** Deprecated compatibility actions accepted by the SDK but omitted from canonical MCP discovery. */
|
|
165
|
+
export const PM_DEPRECATED_TOOL_ACTIONS = Object.freeze(PM_COMMAND_ALIAS_CONTRACTS.filter((contract) => contract.lifecycle === "deprecated" &&
|
|
166
|
+
contract.registration === "commander" &&
|
|
167
|
+
PM_TOOL_ACTIONS.includes(contract.alias)).map((contract) => contract.alias));
|
|
168
|
+
/** Canonical actions presented to MCP clients and unscoped contract consumers. */
|
|
169
|
+
export const PM_DISCOVERABLE_TOOL_ACTIONS = Object.freeze(PM_TOOL_ACTIONS.filter((action) => !PM_DEPRECATED_TOOL_ACTIONS.includes(action)));
|
|
163
170
|
/** Static CLI-to-tool action parity evidence used by quality gates and tests. */
|
|
164
171
|
export function analyzePmToolActionParity(cliCommands = PM_CORE_COMMAND_NAMES, toolActions = PM_TOOL_ACTIONS, waivers = PM_CLI_ONLY_TOOL_ACTION_WAIVERS) {
|
|
165
172
|
const toolActionSet = new Set(toolActions);
|
|
@@ -191,4 +198,4 @@ export function isPmExtensionPolicySurfaceContract(value) {
|
|
|
191
198
|
return PM_EXTENSION_POLICY_SURFACE_CONTRACTS.includes(value);
|
|
192
199
|
}
|
|
193
200
|
//# sourceMappingURL=enum-contracts.js.map
|
|
194
|
-
//# debugId=
|
|
201
|
+
//# debugId=d05ce92b-bee8-5cce-afc2-8c7901306a30
|