@unbrained/pm-cli 2026.8.20 → 2026.8.22
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 +38 -0
- package/dist/cli/error-guidance.d.ts +29 -4
- package/dist/cli/error-guidance.js +43 -43
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +40 -7
- package/dist/cli-bundle/bundle-manifest.json +150 -150
- package/dist/cli-bundle/chunks/{chunk-L4LGPBJU.js → chunk-BWX4SK46.js} +58 -58
- package/dist/cli-bundle/chunks/chunk-EMWDM5FI.js +13 -0
- package/dist/cli-bundle/chunks/chunk-HYG6LRL4.js +200 -0
- package/dist/cli-bundle/chunks/{chunk-TSMWLCHS.js → chunk-MYYI3ZOA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4GB2LTOQ.js → chunk-MZTZQTMS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7BRF2BX2.js → chunk-QI2CT3IX.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-SMWXHMVB.js +35 -0
- package/dist/cli-bundle/chunks/{chunk-US2ZQW2M.js → chunk-U6GQ4VMV.js} +47 -47
- package/dist/cli-bundle/chunks/{chunk-K3EN3LK2.js → chunk-VMMIL3SI.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-WG4STC36.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-XYDDWBZN.js → chunk-YBPJAOQQ.js} +3 -3
- package/dist/cli-bundle/chunks/{register-list-query-JSAQCVOC.js → register-list-query-HZKBQNWW.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-XJPAW63D.js → register-mutation-HTKEEGRD.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-DSOSB2XQ.js → register-operations-6EMRWJJY.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-QUR6QL2C.js → register-setup-QK4OTOXN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TDR5OGG3.js → chunk-2ARQGDDW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-AZBACT5T.js → chunk-2AZT5WXZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-M32HFIQB.js → chunk-2POVTNLY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3LKU6PTJ.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-5SHSBMX2.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-UGSS4F5X.js → chunk-6S2MO3Q3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5L7M4AI7.js → chunk-A2BC5PQL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-C4S4A4JJ.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OM65KHGF.js → chunk-D6RBZEJJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-E2EWYPY6.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-G3C5ERXG.js → chunk-GMYPD4FX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-L5LDSRO2.js +155 -0
- package/dist/cli-bundle/focused-chunks/{chunk-BLJCGGID.js → chunk-MB37AYN6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-MCOR37QK.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FUREQLQN.js → chunk-PH2OXXVZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-325UXIO7.js → chunk-PMGJUFNQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-R6SR45XU.js +50 -0
- package/dist/cli-bundle/focused-chunks/chunk-WZE4LIPW.js +8 -0
- package/dist/cli-bundle/main.js +13 -13
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +40 -40
- 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 +5 -5
- package/dist/core/extensions/extension-hook-runtime.js +22 -20
- package/dist/core/extensions/extension-types.d.ts +8 -1
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/loader.js +7 -3
- package/dist/core/extensions/service-ownership.d.ts +8 -0
- package/dist/core/extensions/service-ownership.js +20 -0
- package/dist/core/item/id.js +20 -5
- package/dist/core/item/item-format.js +27 -2
- package/dist/core/shared/errors.d.ts +20 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/store/item-store.js +6 -91
- package/dist/core/store/tracker-preflight.d.ts +7 -0
- package/dist/core/store/tracker-preflight.js +142 -0
- package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
- package/dist/sdk/agent/tracker-preflight-contracts.d.ts +63 -0
- package/dist/sdk/agent/tracker-preflight-contracts.js +127 -0
- package/dist/sdk/annotations.js +6 -7
- package/dist/sdk/authoring.d.ts +1 -1
- package/dist/sdk/authoring.js +2 -2
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +77 -0
- package/dist/sdk/cli-contracts/agent-output-contracts.js +324 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -3
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +4 -3
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/config.d.ts +5 -0
- package/dist/sdk/config.js +5 -5
- package/dist/sdk/context-intent-runtime.js +7 -4
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +3 -2
- package/dist/sdk/dependencies.js +5 -7
- package/dist/sdk/dependency-flag-validation.d.ts +1 -1
- package/dist/sdk/dependency-flag-validation.js +10 -4
- package/dist/sdk/environment/tracker-preflight.d.ts +6 -0
- package/dist/sdk/environment/tracker-preflight.js +10 -0
- package/dist/sdk/eval.js +5 -7
- package/dist/sdk/extension/install-sources.d.ts +1 -1
- package/dist/sdk/extension/install-sources.js +6 -3
- package/dist/sdk/extension/output-ownership.d.ts +1 -0
- package/dist/sdk/extension/output-ownership.js +3 -2
- package/dist/sdk/files.js +6 -10
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +75 -15
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +81 -8
- package/dist/sdk/governance/assurance.d.ts +36 -2
- package/dist/sdk/governance/assurance.js +184 -10
- package/dist/sdk/governance/gc.js +5 -6
- package/dist/sdk/governance/health.d.ts +3 -0
- package/dist/sdk/governance/health.js +42 -11
- package/dist/sdk/governance/hierarchy-validation.d.ts +29 -0
- package/dist/sdk/governance/hierarchy-validation.js +109 -0
- package/dist/sdk/governance/reindex.js +5 -6
- package/dist/sdk/governance/validate.d.ts +2 -9
- package/dist/sdk/governance/validate.js +51 -109
- package/dist/sdk/graph/assembly.d.ts +6 -1
- package/dist/sdk/graph/assembly.js +16 -22
- package/dist/sdk/graph/governance-contracts.d.ts +1 -1
- package/dist/sdk/graph/governance-contracts.js +8 -2
- package/dist/sdk/graph/governance.d.ts +7 -5
- package/dist/sdk/graph/governance.js +76 -16
- package/dist/sdk/graph/hierarchy-integrity.d.ts +94 -0
- package/dist/sdk/graph/hierarchy-integrity.js +311 -0
- package/dist/sdk/graph/index.d.ts +2 -1
- package/dist/sdk/graph/index.js +3 -2
- package/dist/sdk/graph/remediation.js +32 -2
- package/dist/sdk/graph/run.d.ts +31 -2
- package/dist/sdk/graph/run.js +83 -36
- package/dist/sdk/graph/traversal.js +14 -5
- package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +8 -0
- package/dist/sdk/graph/workspace-relationship-kind-registry.js +28 -0
- package/dist/sdk/history-compact.js +6 -9
- package/dist/sdk/history-read.js +5 -7
- package/dist/sdk/history-redact.js +5 -6
- package/dist/sdk/history-repair.js +6 -9
- package/dist/sdk/improvement-ledger.js +7 -10
- package/dist/sdk/index.d.ts +4 -2
- package/dist/sdk/index.js +5 -3
- package/dist/sdk/item-children.js +21 -8
- package/dist/sdk/lifecycle/append.d.ts +0 -5
- package/dist/sdk/lifecycle/append.js +5 -6
- package/dist/sdk/lifecycle/claim.d.ts +0 -5
- package/dist/sdk/lifecycle/claim.js +6 -9
- package/dist/sdk/lifecycle/close-many.d.ts +0 -5
- package/dist/sdk/lifecycle/close-many.js +5 -6
- package/dist/sdk/lifecycle/close.d.ts +0 -5
- package/dist/sdk/lifecycle/close.js +5 -6
- package/dist/sdk/lifecycle/copy.d.ts +0 -5
- package/dist/sdk/lifecycle/copy.js +5 -6
- package/dist/sdk/lifecycle/create.d.ts +0 -5
- package/dist/sdk/lifecycle/create.js +127 -102
- package/dist/sdk/lifecycle/delete.js +5 -6
- package/dist/sdk/lifecycle/focus.d.ts +0 -5
- package/dist/sdk/lifecycle/focus.js +5 -6
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +15 -0
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +25 -0
- package/dist/sdk/lifecycle/plan.d.ts +0 -5
- package/dist/sdk/lifecycle/plan.js +5 -6
- package/dist/sdk/lifecycle/restore.js +5 -6
- package/dist/sdk/lifecycle/update-many.d.ts +0 -5
- package/dist/sdk/lifecycle/update-many.js +5 -6
- package/dist/sdk/lifecycle/update.d.ts +2 -5
- package/dist/sdk/lifecycle/update.js +211 -84
- package/dist/sdk/linked-artifacts.js +6 -7
- package/dist/sdk/merge/install.js +5 -6
- package/dist/sdk/mutation-events.js +5 -7
- package/dist/sdk/package-import-adapters.js +6 -8
- package/dist/sdk/profile.js +6 -7
- package/dist/sdk/query/activity.js +5 -6
- package/dist/sdk/query/calendar.js +5 -6
- package/dist/sdk/query/complete-list.d.ts +3 -3
- package/dist/sdk/query/complete-list.js +46 -3
- package/dist/sdk/query/get.d.ts +0 -5
- package/dist/sdk/query/get.js +5 -6
- package/dist/sdk/query/history.d.ts +0 -5
- package/dist/sdk/query/history.js +5 -6
- package/dist/sdk/query/list.d.ts +4 -3
- package/dist/sdk/query/list.js +92 -54
- package/dist/sdk/query/search.js +5 -7
- package/dist/sdk/read-output-contracts.d.ts +5 -1
- package/dist/sdk/read-output-contracts.js +87 -22
- package/dist/sdk/relationship-context.js +3 -4
- package/dist/sdk/relationship-kinds/contract.d.ts +8 -0
- package/dist/sdk/relationship-kinds/contract.js +13 -13
- package/dist/sdk/relationships.d.ts +1 -1
- package/dist/sdk/relationships.js +27 -2
- package/dist/sdk/runtime.d.ts +3 -2
- package/dist/sdk/runtime.js +3 -2
- package/dist/sdk/schema-migration.js +6 -7
- package/dist/sdk/schema.js +5 -6
- package/dist/sdk/stats.js +5 -8
- package/dist/sdk/templates.js +5 -6
- package/dist/sdk/test/batch.js +15 -9
- package/dist/sdk/test/execution.js +12 -5
- package/dist/sdk/test/runs.js +5 -7
- package/dist/types.d.ts +11 -0
- package/dist/types.js +2 -2
- package/docs/AGENT_UX_CONTRACTS.md +24 -1
- package/docs/COMMANDS.md +29 -14
- package/docs/DEPENDENCY_KIND_CONTRACT.md +40 -1
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +98 -0
- package/docs/EXTENSIONS.md +2 -1
- package/docs/README.md +1 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +9 -2
- package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +37 -0
- package/docs/RELATIONSHIP_GRAPH.md +97 -12
- package/docs/SDK_PRIMITIVE_INVENTORY.md +15 -1
- package/docs/TESTING.md +15 -0
- package/marketplace.json +2 -2
- package/package.json +1 -1
- 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 +848 -56
- package/dist/cli-bundle/chunks/chunk-2RDVGYWE.js +0 -13
- package/dist/cli-bundle/chunks/chunk-BLVQHFSY.js +0 -35
- package/dist/cli-bundle/chunks/chunk-CU25EQVV.js +0 -5
- package/dist/cli-bundle/chunks/chunk-RS3IV2R6.js +0 -197
- package/dist/cli-bundle/focused-chunks/chunk-6AHG2YW7.js +0 -50
- package/dist/cli-bundle/focused-chunks/chunk-GXWQBE3T.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-JWKEDZJI.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-KYZ6JGPL.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-Q47EX4DI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-RIHDMCUM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-T4ZFY7ZJ.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-Z3PLWSGM.js +0 -2
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* output policy without coupling package authors to pm's renderer.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
9
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b3f5a4bc-d853-530e-8f5e-d682d8b93c9d")}catch(e){}}();
|
|
10
10
|
import { PM_CORE_COMMAND_NAMES } from "./enum-contracts.js";
|
|
11
11
|
/** Stable degradation stages applied when an output exceeds its token budget. */
|
|
12
12
|
export const PM_OUTPUT_DEGRADATION_STEPS = [
|
|
@@ -23,6 +23,21 @@ export const PM_OUTPUT_BUDGET_CLASSES = [
|
|
|
23
23
|
"discovery",
|
|
24
24
|
"governance",
|
|
25
25
|
];
|
|
26
|
+
/** Stable diagnostic families that require independent output ceilings. */
|
|
27
|
+
export const PM_DIAGNOSTIC_OUTPUT_CLASSES = [
|
|
28
|
+
"error",
|
|
29
|
+
"warning",
|
|
30
|
+
"validation_summary",
|
|
31
|
+
"recovery_bundle",
|
|
32
|
+
];
|
|
33
|
+
/** Deterministic diagnostic degradation stages, from richest to smallest. */
|
|
34
|
+
export const PM_DIAGNOSTIC_DEGRADATION_STEPS = [
|
|
35
|
+
"full",
|
|
36
|
+
"omit_explanation",
|
|
37
|
+
"limit_collections",
|
|
38
|
+
"compact_recovery",
|
|
39
|
+
"action_only",
|
|
40
|
+
];
|
|
26
41
|
const MUTATION_COMMANDS = new Set([
|
|
27
42
|
"append",
|
|
28
43
|
"claim",
|
|
@@ -84,6 +99,29 @@ const DEFAULT_MAX_ESTIMATED_TOKENS = {
|
|
|
84
99
|
};
|
|
85
100
|
const JSON_BUDGET_NUMERATOR = 3;
|
|
86
101
|
const JSON_BUDGET_DENOMINATOR = 2;
|
|
102
|
+
const MINIMUM_DIAGNOSTIC_BUDGET = 192;
|
|
103
|
+
const DIAGNOSTIC_DEFAULT_BUDGETS = {
|
|
104
|
+
error: { text: 768, json: 2_000 },
|
|
105
|
+
warning: { text: 768, json: 2_000 },
|
|
106
|
+
validation_summary: { text: 1_500, json: 3_000 },
|
|
107
|
+
recovery_bundle: { text: 768, json: 2_000 },
|
|
108
|
+
};
|
|
109
|
+
/** Public default contract for every diagnostic family. */
|
|
110
|
+
export const PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS = PM_DIAGNOSTIC_OUTPUT_CLASSES.map((diagnosticClass) => ({
|
|
111
|
+
diagnostic_class: diagnosticClass,
|
|
112
|
+
default_max_estimated_tokens_by_format: DIAGNOSTIC_DEFAULT_BUDGETS[diagnosticClass],
|
|
113
|
+
minimum_max_estimated_tokens: MINIMUM_DIAGNOSTIC_BUDGET,
|
|
114
|
+
degradation_ladder: PM_DIAGNOSTIC_DEGRADATION_STEPS,
|
|
115
|
+
corrective_action_paths: [
|
|
116
|
+
"required",
|
|
117
|
+
"recovery.suggested_retry",
|
|
118
|
+
"recovery.suggested_retry_args",
|
|
119
|
+
"recovery.next_best_command",
|
|
120
|
+
"next_steps[0]",
|
|
121
|
+
],
|
|
122
|
+
token_estimate: "ceil(utf8_bytes / 4)",
|
|
123
|
+
}));
|
|
124
|
+
const DIAGNOSTIC_BUDGET_BY_CLASS = new Map(PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS.map((contract) => [contract.diagnostic_class, contract]));
|
|
87
125
|
/** Infer the conservative workload class for a core or package command. */
|
|
88
126
|
export function inferPmOutputBudgetClass(command) {
|
|
89
127
|
const [rootCommand = ""] = command.trim().split(/\s+/u);
|
|
@@ -150,5 +188,289 @@ export function resolvePmCommandOutputBudget(command, options = {}) {
|
|
|
150
188
|
export function estimatePmOutputTokens(utf8Bytes) {
|
|
151
189
|
return Math.ceil(Math.max(0, utf8Bytes) / 4);
|
|
152
190
|
}
|
|
191
|
+
/** Resolve the binding output contract for one diagnostic family. */
|
|
192
|
+
export function resolvePmDiagnosticOutputBudget(diagnosticClass) {
|
|
193
|
+
const contract = DIAGNOSTIC_BUDGET_BY_CLASS.get(diagnosticClass);
|
|
194
|
+
if (contract === undefined) {
|
|
195
|
+
throw new TypeError(`diagnosticClass must be one of: ${PM_DIAGNOSTIC_OUTPUT_CLASSES.join(", ")}`);
|
|
196
|
+
}
|
|
197
|
+
return contract;
|
|
198
|
+
}
|
|
199
|
+
function estimateJsonDiagnosticTokens(value) {
|
|
200
|
+
return estimatePmOutputTokens(Buffer.byteLength(JSON.stringify(value, null, 2), "utf8"));
|
|
201
|
+
}
|
|
202
|
+
function isDiagnosticRecord(value) {
|
|
203
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
204
|
+
}
|
|
205
|
+
function compactDiagnosticRecovery(value) {
|
|
206
|
+
if (!isDiagnosticRecord(value))
|
|
207
|
+
return undefined;
|
|
208
|
+
const compact = {};
|
|
209
|
+
for (const key of [
|
|
210
|
+
"suggested_retry",
|
|
211
|
+
"suggested_retry_args",
|
|
212
|
+
"next_best_command",
|
|
213
|
+
"allowed_values",
|
|
214
|
+
"candidate_commands",
|
|
215
|
+
"missing",
|
|
216
|
+
"missing_required_fields",
|
|
217
|
+
"option_scope",
|
|
218
|
+
"retry_after_ms",
|
|
219
|
+
]) {
|
|
220
|
+
const candidate = value[key];
|
|
221
|
+
if (Array.isArray(candidate))
|
|
222
|
+
compact[key] = candidate.slice(0, 3);
|
|
223
|
+
else if (candidate !== undefined)
|
|
224
|
+
compact[key] = candidate;
|
|
225
|
+
}
|
|
226
|
+
return Object.keys(compact).length > 0 ? compact : undefined;
|
|
227
|
+
}
|
|
228
|
+
function truncateDiagnosticString(value, maximum) {
|
|
229
|
+
if (typeof value !== "string" || value.length <= maximum)
|
|
230
|
+
return value;
|
|
231
|
+
return `${value.slice(0, Math.max(1, maximum - 3))}...`;
|
|
232
|
+
}
|
|
233
|
+
function truncateDiagnosticUtf8Text(value, maximumBytes) {
|
|
234
|
+
if (Buffer.byteLength(value, "utf8") <= maximumBytes)
|
|
235
|
+
return value;
|
|
236
|
+
const suffix = "...";
|
|
237
|
+
const codePoints = Array.from(value);
|
|
238
|
+
let lower = 0;
|
|
239
|
+
let upper = codePoints.length;
|
|
240
|
+
while (lower < upper) {
|
|
241
|
+
const middle = Math.ceil((lower + upper) / 2);
|
|
242
|
+
const candidate = `${codePoints.slice(0, middle).join("")}${suffix}`;
|
|
243
|
+
if (Buffer.byteLength(candidate, "utf8") <= maximumBytes)
|
|
244
|
+
lower = middle;
|
|
245
|
+
else
|
|
246
|
+
upper = middle - 1;
|
|
247
|
+
}
|
|
248
|
+
return `${codePoints.slice(0, lower).join("")}${suffix}`;
|
|
249
|
+
}
|
|
250
|
+
function prioritizeDiagnosticFields(diagnostic) {
|
|
251
|
+
const prioritized = {};
|
|
252
|
+
for (const key of [
|
|
253
|
+
"code",
|
|
254
|
+
"required",
|
|
255
|
+
"recovery",
|
|
256
|
+
"next_steps",
|
|
257
|
+
"exit_code",
|
|
258
|
+
"type",
|
|
259
|
+
"title",
|
|
260
|
+
"detail",
|
|
261
|
+
"why",
|
|
262
|
+
"examples",
|
|
263
|
+
]) {
|
|
264
|
+
if (Object.hasOwn(diagnostic, key) && diagnostic[key] !== undefined) {
|
|
265
|
+
prioritized[key] = diagnostic[key];
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
for (const [key, value] of Object.entries(diagnostic)) {
|
|
269
|
+
if (key !== "__proto__" && !Object.hasOwn(prioritized, key)) {
|
|
270
|
+
prioritized[key] = value;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return prioritized;
|
|
274
|
+
}
|
|
275
|
+
const DIAGNOSTIC_COLLECTION_LIMIT_STAGES = new Set(["limit_collections", "compact_recovery", "action_only"]);
|
|
276
|
+
const DIAGNOSTIC_RECOVERY_COMPACTION_STAGES = new Set(["compact_recovery", "action_only"]);
|
|
277
|
+
function actionOnlyDiagnostic(candidate) {
|
|
278
|
+
const actionOnly = {
|
|
279
|
+
code: typeof candidate.code === "string" ? candidate.code : "diagnostic",
|
|
280
|
+
required: truncateDiagnosticString(candidate.required, 160) ??
|
|
281
|
+
"Inspect the diagnostic code and retry with corrected input.",
|
|
282
|
+
};
|
|
283
|
+
const recovery = compactDiagnosticRecovery(candidate.recovery);
|
|
284
|
+
if (recovery !== undefined) {
|
|
285
|
+
actionOnly.recovery = recovery;
|
|
286
|
+
}
|
|
287
|
+
else if (Array.isArray(candidate.next_steps)) {
|
|
288
|
+
actionOnly.next_steps = candidate.next_steps.slice(0, 1);
|
|
289
|
+
}
|
|
290
|
+
if (candidate.exit_code !== undefined)
|
|
291
|
+
actionOnly.exit_code = candidate.exit_code;
|
|
292
|
+
if (candidate.type !== undefined)
|
|
293
|
+
actionOnly.type = candidate.type;
|
|
294
|
+
return actionOnly;
|
|
295
|
+
}
|
|
296
|
+
function diagnosticCandidate(diagnostic, stage) {
|
|
297
|
+
const candidate = structuredClone(diagnostic);
|
|
298
|
+
if (stage !== "full") {
|
|
299
|
+
delete candidate.why;
|
|
300
|
+
delete candidate.examples;
|
|
301
|
+
}
|
|
302
|
+
if (DIAGNOSTIC_COLLECTION_LIMIT_STAGES.has(stage)) {
|
|
303
|
+
for (const [key, value] of Object.entries(candidate)) {
|
|
304
|
+
if (Array.isArray(value))
|
|
305
|
+
candidate[key] = value.slice(0, 3);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (DIAGNOSTIC_RECOVERY_COMPACTION_STAGES.has(stage)) {
|
|
309
|
+
const recovery = compactDiagnosticRecovery(candidate.recovery);
|
|
310
|
+
if (recovery)
|
|
311
|
+
candidate.recovery = recovery;
|
|
312
|
+
else
|
|
313
|
+
delete candidate.recovery;
|
|
314
|
+
}
|
|
315
|
+
if (stage !== "action_only")
|
|
316
|
+
return prioritizeDiagnosticFields(candidate);
|
|
317
|
+
return actionOnlyDiagnostic(candidate);
|
|
318
|
+
}
|
|
319
|
+
function attachDiagnosticReceipt(candidate, receipt) {
|
|
320
|
+
const projected = {
|
|
321
|
+
...candidate,
|
|
322
|
+
diagnostic_output: { ...receipt, estimated_tokens: 0 },
|
|
323
|
+
};
|
|
324
|
+
for (let attempt = 0; attempt < 4; attempt += 1) {
|
|
325
|
+
const estimatedTokens = estimateJsonDiagnosticTokens(projected);
|
|
326
|
+
const outputReceipt = projected.diagnostic_output;
|
|
327
|
+
if (outputReceipt.estimated_tokens === estimatedTokens)
|
|
328
|
+
break;
|
|
329
|
+
outputReceipt.estimated_tokens = estimatedTokens;
|
|
330
|
+
}
|
|
331
|
+
return projected;
|
|
332
|
+
}
|
|
333
|
+
function shrinkMinimalDiagnosticCandidate(candidate, receipt, budget) {
|
|
334
|
+
let fallback = attachDiagnosticReceipt(candidate, receipt);
|
|
335
|
+
for (const optionalField of ["recovery", "exit_code"]) {
|
|
336
|
+
if (estimateJsonDiagnosticTokens(fallback) <= budget ||
|
|
337
|
+
candidate[optionalField] === undefined) {
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
delete candidate[optionalField];
|
|
341
|
+
fallback = attachDiagnosticReceipt(candidate, receipt);
|
|
342
|
+
}
|
|
343
|
+
let maximumActionBytes = 40;
|
|
344
|
+
while (estimateJsonDiagnosticTokens(fallback) > budget &&
|
|
345
|
+
maximumActionBytes > 4) {
|
|
346
|
+
maximumActionBytes -= 4;
|
|
347
|
+
candidate.code = truncateDiagnosticUtf8Text(String(candidate.code), maximumActionBytes);
|
|
348
|
+
candidate.required = truncateDiagnosticUtf8Text(String(candidate.required), maximumActionBytes);
|
|
349
|
+
fallback = attachDiagnosticReceipt(candidate, receipt);
|
|
350
|
+
}
|
|
351
|
+
return fallback;
|
|
352
|
+
}
|
|
353
|
+
function createMinimalDiagnosticFallback(projected, budget) {
|
|
354
|
+
const receipt = projected.diagnostic_output;
|
|
355
|
+
const { estimated_tokens: _estimatedTokens, ...receiptWithoutEstimate } = receipt;
|
|
356
|
+
const boundedOmittedFields = receiptWithoutEstimate.omitted_fields
|
|
357
|
+
.slice(0, 8)
|
|
358
|
+
.map((field) => truncateDiagnosticUtf8Text(field, 32));
|
|
359
|
+
const boundedReceipt = {
|
|
360
|
+
...receiptWithoutEstimate,
|
|
361
|
+
omitted_fields: boundedOmittedFields,
|
|
362
|
+
...(receiptWithoutEstimate.omitted_fields.length >
|
|
363
|
+
boundedOmittedFields.length
|
|
364
|
+
? {
|
|
365
|
+
omitted_fields_overflow_count: receiptWithoutEstimate.omitted_fields.length -
|
|
366
|
+
boundedOmittedFields.length,
|
|
367
|
+
}
|
|
368
|
+
: {}),
|
|
369
|
+
};
|
|
370
|
+
const recoveryCandidate = compactDiagnosticRecovery(projected.recovery);
|
|
371
|
+
const recovery = recoveryCandidate && estimateJsonDiagnosticTokens(recoveryCandidate) <= 48
|
|
372
|
+
? recoveryCandidate
|
|
373
|
+
: undefined;
|
|
374
|
+
const candidate = {
|
|
375
|
+
code: truncateDiagnosticUtf8Text(String(projected.code), 320),
|
|
376
|
+
required: truncateDiagnosticUtf8Text(String(projected.required), 320),
|
|
377
|
+
...(recovery ? { recovery } : {}),
|
|
378
|
+
...(projected.exit_code !== undefined
|
|
379
|
+
? { exit_code: projected.exit_code }
|
|
380
|
+
: {}),
|
|
381
|
+
};
|
|
382
|
+
let fallback = attachDiagnosticReceipt(candidate, boundedReceipt);
|
|
383
|
+
while (estimateJsonDiagnosticTokens(fallback) > budget &&
|
|
384
|
+
boundedReceipt.omitted_fields.length > 0) {
|
|
385
|
+
boundedReceipt.omitted_fields.pop();
|
|
386
|
+
boundedReceipt.omitted_fields_overflow_count =
|
|
387
|
+
receiptWithoutEstimate.omitted_fields.length -
|
|
388
|
+
boundedReceipt.omitted_fields.length;
|
|
389
|
+
fallback = attachDiagnosticReceipt(candidate, boundedReceipt);
|
|
390
|
+
}
|
|
391
|
+
fallback = shrinkMinimalDiagnosticCandidate(candidate, boundedReceipt, budget);
|
|
392
|
+
return fallback;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Bind a JSON diagnostic to its declared ceiling while preserving the first
|
|
396
|
+
* corrective action and reporting every top-level omission.
|
|
397
|
+
*/
|
|
398
|
+
export function projectPmDiagnosticOutput(diagnostic, options = {}) {
|
|
399
|
+
const diagnosticRecord = diagnostic;
|
|
400
|
+
const diagnosticClass = options.diagnosticClass ?? "error";
|
|
401
|
+
const contract = resolvePmDiagnosticOutputBudget(diagnosticClass);
|
|
402
|
+
const explicitBudget = options.maxEstimatedTokens;
|
|
403
|
+
if (explicitBudget !== undefined &&
|
|
404
|
+
(!Number.isSafeInteger(explicitBudget) ||
|
|
405
|
+
explicitBudget < contract.minimum_max_estimated_tokens)) {
|
|
406
|
+
throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${contract.minimum_max_estimated_tokens}`);
|
|
407
|
+
}
|
|
408
|
+
const budget = explicitBudget ?? contract.default_max_estimated_tokens_by_format.json;
|
|
409
|
+
const originalEstimatedTokens = estimateJsonDiagnosticTokens(diagnosticRecord);
|
|
410
|
+
const originalFields = Object.keys(diagnosticRecord);
|
|
411
|
+
if (originalEstimatedTokens <= budget) {
|
|
412
|
+
return prioritizeDiagnosticFields(structuredClone(diagnosticRecord));
|
|
413
|
+
}
|
|
414
|
+
let projected;
|
|
415
|
+
for (const [index, stage] of contract.degradation_ladder.entries()) {
|
|
416
|
+
const candidate = diagnosticCandidate(diagnosticRecord, stage);
|
|
417
|
+
const omittedFields = originalFields.filter((field) => !Object.hasOwn(candidate, field));
|
|
418
|
+
const withReceipt = attachDiagnosticReceipt(candidate, {
|
|
419
|
+
diagnostic_class: diagnosticClass,
|
|
420
|
+
format: "json",
|
|
421
|
+
budget,
|
|
422
|
+
budget_source: explicitBudget === undefined ? "default" : "explicit",
|
|
423
|
+
original_estimated_tokens: originalEstimatedTokens,
|
|
424
|
+
truncated: index > 0,
|
|
425
|
+
degradation_steps: contract.degradation_ladder.slice(0, index + 1),
|
|
426
|
+
omitted_fields: omittedFields,
|
|
427
|
+
});
|
|
428
|
+
projected = withReceipt;
|
|
429
|
+
if (estimateJsonDiagnosticTokens(withReceipt) <= budget)
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
if (estimateJsonDiagnosticTokens(projected) > budget) {
|
|
433
|
+
projected = createMinimalDiagnosticFallback(projected, budget);
|
|
434
|
+
}
|
|
435
|
+
return projected;
|
|
436
|
+
}
|
|
437
|
+
/** Bind human-readable diagnostics without ever truncating the corrective action away. */
|
|
438
|
+
export function projectPmDiagnosticText(output, correctiveAction, options = {}) {
|
|
439
|
+
const diagnosticClass = options.diagnosticClass ?? "error";
|
|
440
|
+
const contract = resolvePmDiagnosticOutputBudget(diagnosticClass);
|
|
441
|
+
const explicitBudget = options.maxEstimatedTokens;
|
|
442
|
+
if (explicitBudget !== undefined &&
|
|
443
|
+
(!Number.isSafeInteger(explicitBudget) ||
|
|
444
|
+
explicitBudget < contract.minimum_max_estimated_tokens)) {
|
|
445
|
+
throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${contract.minimum_max_estimated_tokens}`);
|
|
446
|
+
}
|
|
447
|
+
const budget = explicitBudget ?? contract.default_max_estimated_tokens_by_format.text;
|
|
448
|
+
const originalEstimatedTokens = estimatePmOutputTokens(Buffer.byteLength(output, "utf8"));
|
|
449
|
+
const truncated = originalEstimatedTokens > budget;
|
|
450
|
+
const actionPrefix = "What is required:\n ";
|
|
451
|
+
const actionSuffix = `\n\nDiagnostic output exceeded its declared ${budget}-token ceiling; rerun with structured JSON for the bounded recovery envelope.`;
|
|
452
|
+
const correctiveActionText = correctiveAction.trim() ||
|
|
453
|
+
"Inspect the diagnostic code and retry with corrected input.";
|
|
454
|
+
const availableActionBytes = Math.max(1, budget * 4 - Buffer.byteLength(`${actionPrefix}${actionSuffix}`, "utf8"));
|
|
455
|
+
const projectedOutput = truncated
|
|
456
|
+
? `${actionPrefix}${truncateDiagnosticUtf8Text(correctiveActionText, availableActionBytes)}${actionSuffix}`
|
|
457
|
+
: output;
|
|
458
|
+
return {
|
|
459
|
+
output: projectedOutput,
|
|
460
|
+
diagnostic_output: {
|
|
461
|
+
diagnostic_class: diagnosticClass,
|
|
462
|
+
format: "text",
|
|
463
|
+
budget,
|
|
464
|
+
budget_source: explicitBudget === undefined ? "default" : "explicit",
|
|
465
|
+
original_estimated_tokens: originalEstimatedTokens,
|
|
466
|
+
estimated_tokens: estimatePmOutputTokens(Buffer.byteLength(projectedOutput, "utf8")),
|
|
467
|
+
truncated,
|
|
468
|
+
degradation_steps: truncated
|
|
469
|
+
? [...contract.degradation_ladder]
|
|
470
|
+
: ["full"],
|
|
471
|
+
omitted_fields: truncated ? ["explanation", "collections"] : [],
|
|
472
|
+
},
|
|
473
|
+
};
|
|
474
|
+
}
|
|
153
475
|
//# sourceMappingURL=agent-output-contracts.js.map
|
|
154
|
-
//# debugId=
|
|
476
|
+
//# debugId=b3f5a4bc-d853-530e-8f5e-d682d8b93c9d
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Creates commander option registration contracts using the validated operation inputs. */
|
|
2
2
|
|
|
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]="
|
|
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]="be7e506f-c48f-5dfb-9fed-ba1e74fa60ff")}catch(e){}}();
|
|
4
4
|
export const CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS = [
|
|
5
5
|
{
|
|
6
6
|
target: "title",
|
|
@@ -969,7 +969,7 @@ export const UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS = [
|
|
|
969
969
|
target: "depRemove",
|
|
970
970
|
keys: ["depRemove", "dep_remove"],
|
|
971
971
|
option: "--dep-remove <value>",
|
|
972
|
-
description: "Remove
|
|
972
|
+
description: "Remove by dependency id or exact row signature (repeatable)",
|
|
973
973
|
repeatable: true,
|
|
974
974
|
aliasOptions: [
|
|
975
975
|
{
|
|
@@ -1079,4 +1079,4 @@ export const UPDATE_COMMANDER_STRING_OPTION_CONTRACTS = UPDATE_COMMANDER_OPTION_
|
|
|
1079
1079
|
/** Public contract for update commander repeatable option contracts, shared by SDK and presentation-layer consumers. */
|
|
1080
1080
|
export const UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS = UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter((entry) => entry.repeatable === true).map((entry) => ({ target: entry.target, keys: entry.keys }));
|
|
1081
1081
|
//# sourceMappingURL=commander-mutation-options.js.map
|
|
1082
|
-
//# debugId=
|
|
1082
|
+
//# debugId=be7e506f-c48f-5dfb-9fed-ba1e74fa60ff
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type GlobalOptions, type ExtensionRegistrationRegistry, type RegisteredExtensionCommandDefinition, type RegisteredExtensionFlagDefinitions, type RuntimeFieldRegistry, readSettings } from "../runtime-primitives.js";
|
|
7
7
|
import { type McpToolContract } from "../../mcp/tool-definitions.js";
|
|
8
|
-
import { PM_TOOL_ACTIONS, type CliFlagContract, type CommanderOptionAliasContract, type PmCommandOutputBudgetContract, type PmCommandAliasContract } from "../cli-contracts.js";
|
|
8
|
+
import { PM_TOOL_ACTIONS, type CliFlagContract, type CommanderOptionAliasContract, type PmCommandOutputBudgetContract, type PmDiagnosticOutputBudgetContract, type PmCommandAliasContract } from "../cli-contracts.js";
|
|
9
9
|
import { type ListCommandName, type ListProjectionMode } from "../query/list.js";
|
|
10
10
|
import { type PmContextIntentContract } from "../context-intent-contracts.js";
|
|
11
11
|
import { type PmReadOutputSurfaceContract } from "../read-output-contracts.js";
|
|
@@ -187,6 +187,8 @@ export interface ContractsResult {
|
|
|
187
187
|
budget: PmCommandOutputBudgetContract;
|
|
188
188
|
envelope: PmCommandOutputEnvelopeContract;
|
|
189
189
|
}>;
|
|
190
|
+
/** Binding ceilings and action-preserving degradation for diagnostic families. */
|
|
191
|
+
diagnostic_output_contracts?: readonly PmDiagnosticOutputBudgetContract[];
|
|
190
192
|
/** Stable outcome vocabulary and exhaustive per-command process exit sets. */
|
|
191
193
|
command_exit_contracts?: {
|
|
192
194
|
vocabulary: readonly PmCommandExitOutcomeContract[];
|
|
@@ -4,10 +4,10 @@
|
|
|
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]="e8f1efca-4e83-570f-8c33-96f0405035b0")}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
|
-
import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, ASSURANCE_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, COPY_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, FOCUS_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, ITEM_REOPEN_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_DEPRECATED_TOOL_ACTIONS, 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, PM_COMMAND_ALIAS_CONTRACTS, resolvePmCommandOutputBudget, } from "../cli-contracts.js";
|
|
10
|
+
import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, ASSURANCE_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, COPY_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, FOCUS_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, ITEM_REOPEN_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_DEPRECATED_TOOL_ACTIONS, 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, PM_COMMAND_ALIAS_CONTRACTS, PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS, resolvePmCommandOutputBudget, } from "../cli-contracts.js";
|
|
11
11
|
import { PM_POSITIONAL_ACTION_FLAG_CONTRACTS } from "./flag-contracts.js";
|
|
12
12
|
import { GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES, GOVERNANCE_CREATE_MODE_DEFAULT_VALUES, GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES, GOVERNANCE_WORKFLOW_ENFORCEMENT_VALUES, } from "../../types.js";
|
|
13
13
|
import { BRIEF_LIST_FIELDS, DEFAULT_COMPACT_LIST_FIELDS, LIST_COMMAND_DEFAULT_PROJECTIONS, } from "../query/list.js";
|
|
@@ -2023,6 +2023,7 @@ export async function runContracts(options, global) {
|
|
|
2023
2023
|
result.error_codes = PM_ERROR_CODE_CATALOG;
|
|
2024
2024
|
result.command_output_contracts =
|
|
2025
2025
|
buildCommandOutputContracts(outputCommands);
|
|
2026
|
+
result.diagnostic_output_contracts = PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS;
|
|
2026
2027
|
result.command_exit_contracts = {
|
|
2027
2028
|
vocabulary: PM_COMMAND_EXIT_OUTCOME_CONTRACTS,
|
|
2028
2029
|
command_sets: buildCommandExitContractGroups(outputCommands),
|
|
@@ -2064,4 +2065,4 @@ export const _testOnlyContractsCommand = {
|
|
|
2064
2065
|
toRuntimeShortFlagToken,
|
|
2065
2066
|
};
|
|
2066
2067
|
//# sourceMappingURL=runtime-contracts.js.map
|
|
2067
|
-
//# debugId=
|
|
2068
|
+
//# debugId=e8f1efca-4e83-570f-8c33-96f0405035b0
|
|
@@ -25,4 +25,4 @@ export type { PmActionSchemaContract } from "./cli-contracts/tool-schema.js";
|
|
|
25
25
|
export { buildPmActionToolInputSchema, PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES, resolvePmToolCustomFieldCollision, CLOSE_ACTION_OPTION_KEYS, PLAN_CREATE_METADATA_PARAMETER_KEYS, PM_TOOL_ACTION_PARAMETER_CONTRACTS, PM_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_PARAMETERS_SCHEMA_MAJOR, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_PARAMETERS_SCHEMA, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA, _testOnlyCliContracts, } from "./cli-contracts/tool-schema.js";
|
|
26
26
|
export type { PmActionToolInputSchemaOptions, PmToolCustomFieldCollision, } from "./cli-contracts/tool-schema.js";
|
|
27
27
|
export { analyzeSdkCliParameterCompleteness, type SdkCliActionParameterCoverage, type SdkCliCompletenessContractSource, type SdkCliParameterCoverageEntry, type SdkCliParameterDisposition, } from "./cli-contracts/completeness.js";
|
|
28
|
-
export { PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, resolvePmCommandOutputBudget, type PmCommandOutputBudgetContract, type PmOutputBudgetClass, type PmOutputDegradationStep, } from "./cli-contracts/agent-output-contracts.js";
|
|
28
|
+
export { PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_DIAGNOSTIC_DEGRADATION_STEPS, PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS, PM_DIAGNOSTIC_OUTPUT_CLASSES, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, projectPmDiagnosticOutput, projectPmDiagnosticText, resolvePmDiagnosticOutputBudget, resolvePmCommandOutputBudget, type PmCommandOutputBudgetContract, type PmDiagnosticDegradationStep, type PmDiagnosticOutputBudgetContract, type PmDiagnosticOutputClass, type PmDiagnosticOutputReceipt, type PmOutputBudgetClass, type PmOutputDegradationStep, type PmProjectedDiagnostic, type PmProjectedTextDiagnostic, } from "./cli-contracts/agent-output-contracts.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="8f665958-197a-5f20-8904-0a59a623f30f")}catch(e){}}();
|
|
3
3
|
export { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, } from "./cli-contracts/command-aliases.js";
|
|
4
4
|
export { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, readFirstValueFromCommanderOptions, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "./cli-contracts/commander-types.js";
|
|
5
5
|
export { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, } from "./cli-contracts/commander-mutation-options.js";
|
|
@@ -13,6 +13,6 @@ export { PM_POSITIONAL_ACTION_CONTRACTS, } from "./cli-contracts/grammar-contrac
|
|
|
13
13
|
export { withFlagAliasMetadata, compactFlagAliasContracts, resolvePmPositionalActionFlagContracts, SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, PROFILE_FLAG_CONTRACTS, PLAN_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_SCOPE_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_MIGRATE_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, REINDEX_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, EVENT_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, ASSURANCE_FLAG_CONTRACTS, CREATE_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_REOPEN_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, CALENDAR_FLAG_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, CONTEXT_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, EVAL_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, hasSubcommandFlagContractsForCommand, resolveSubcommandFlagContractsForCommand, toCompletionFlagString, } from "./cli-contracts/flag-contracts.js";
|
|
14
14
|
export { buildPmActionToolInputSchema, PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES, resolvePmToolCustomFieldCollision, CLOSE_ACTION_OPTION_KEYS, PLAN_CREATE_METADATA_PARAMETER_KEYS, PM_TOOL_ACTION_PARAMETER_CONTRACTS, PM_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_PARAMETERS_SCHEMA_MAJOR, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_PARAMETERS_SCHEMA, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA, _testOnlyCliContracts, } from "./cli-contracts/tool-schema.js";
|
|
15
15
|
export { analyzeSdkCliParameterCompleteness, } from "./cli-contracts/completeness.js";
|
|
16
|
-
export { PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, resolvePmCommandOutputBudget, } from "./cli-contracts/agent-output-contracts.js";
|
|
16
|
+
export { PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_DIAGNOSTIC_DEGRADATION_STEPS, PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS, PM_DIAGNOSTIC_OUTPUT_CLASSES, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, projectPmDiagnosticOutput, projectPmDiagnosticText, resolvePmDiagnosticOutputBudget, resolvePmCommandOutputBudget, } from "./cli-contracts/agent-output-contracts.js";
|
|
17
17
|
//# sourceMappingURL=cli-contracts.js.map
|
|
18
|
-
//# debugId=
|
|
18
|
+
//# debugId=8f665958-197a-5f20-8904-0a59a623f30f
|
package/dist/sdk/config.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/config
|
|
3
|
+
*
|
|
4
|
+
* Implements the pm config command surface and its agent-facing runtime behavior.
|
|
5
|
+
*/
|
|
1
6
|
import { type ConfigKey } from "../core/config/positional-value.js";
|
|
2
7
|
import { type NestedSettingDescriptor } from "../core/config/nested-settings.js";
|
|
3
8
|
import type { GlobalOptions } from "../core/shared/command-types.js";
|
package/dist/sdk/config.js
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* Implements the pm config 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]="
|
|
8
|
-
import { pathExists } from "../core/fs/fs-utils.js";
|
|
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]="5918331a-46e9-5699-b85d-89f49a27d341")}catch(e){}}();
|
|
9
8
|
import { resolveConfigPositionalValue, } from "../core/config/positional-value.js";
|
|
10
9
|
import { NESTED_SETTING_DESCRIPTORS, parseNestedSettingValue, readNestedSettingValue, resolveNestedSettingDescriptor, writeNestedSettingValue, } from "../core/config/nested-settings.js";
|
|
11
10
|
import { getActiveExtensionRegistrations } from "../core/extensions/index.js";
|
|
@@ -17,6 +16,7 @@ import { resolveItemTypesFilePath } from "../core/schema/runtime-schema.js";
|
|
|
17
16
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
18
17
|
import { PmCliError } from "../core/shared/errors.js";
|
|
19
18
|
import { createUnknownSubcommandError } from "./agent/subcommand-recovery.js";
|
|
19
|
+
import { assertInitializedTracker } from "./environment/tracker-preflight.js";
|
|
20
20
|
import { migrateItemFilesToFormat } from "../core/store/item-format-migration.js";
|
|
21
21
|
import { getSettingsPath, resolveGlobalPmRoot, resolvePmRoot, } from "../core/store/paths.js";
|
|
22
22
|
import { readSettingsWithMetadata, writeSettings, } from "../core/store/settings.js";
|
|
@@ -503,8 +503,8 @@ async function resolveSettingsTarget(scope, global) {
|
|
|
503
503
|
? resolvePmRoot(cwd, global.path)
|
|
504
504
|
: resolveGlobalPmRoot(cwd);
|
|
505
505
|
const settingsPath = getSettingsPath(pmRoot);
|
|
506
|
-
if (scope === "project"
|
|
507
|
-
|
|
506
|
+
if (scope === "project") {
|
|
507
|
+
await assertInitializedTracker(pmRoot);
|
|
508
508
|
}
|
|
509
509
|
return { pmRoot, settingsPath };
|
|
510
510
|
}
|
|
@@ -1097,4 +1097,4 @@ export const _testOnlyConfigCommand = {
|
|
|
1097
1097
|
normalizeWarnings,
|
|
1098
1098
|
};
|
|
1099
1099
|
//# sourceMappingURL=config.js.map
|
|
1100
|
-
//# debugId=
|
|
1100
|
+
//# debugId=5918331a-46e9-5699-b85d-89f49a27d341
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* SDK entrypoint.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
9
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1a7548f2-93a0-5dfc-9d9a-c5aef4656c7c")}catch(e){}}();
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { isFileAbsentError } from "../core/fs/fs-utils.js";
|
|
13
|
+
import { assertReadableTrackerRoot } from "./environment/tracker-preflight.js";
|
|
13
14
|
import { runWithContextIntentContracts, } from "./context-intent-contracts.js";
|
|
14
15
|
/** Conventional workspace declaration file relative to the tracker root. */
|
|
15
16
|
export const PM_CONTEXT_INTENTS_FILE = "context-intents.json";
|
|
@@ -59,11 +60,13 @@ export async function readWorkspaceContextIntentContracts(pmRoot) {
|
|
|
59
60
|
catch (error) {
|
|
60
61
|
// Absent declarations are the norm. `ENOTDIR` counts as absent too: when
|
|
61
62
|
// the tracker root is a regular file the declaration cannot exist, and the
|
|
62
|
-
// authoritative root guard downstream owns that refusal
|
|
63
|
-
//
|
|
63
|
+
// authoritative root guard downstream owns that refusal. Other read
|
|
64
|
+
// failures first pass through the same root guard so permissions failures
|
|
65
|
+
// cannot pre-empt it with an unclassified runtime fault.
|
|
64
66
|
if (isFileAbsentError(error)) {
|
|
65
67
|
return [];
|
|
66
68
|
}
|
|
69
|
+
await assertReadableTrackerRoot(pmRoot);
|
|
67
70
|
throw error;
|
|
68
71
|
}
|
|
69
72
|
let parsed;
|
|
@@ -110,4 +113,4 @@ export async function runWithDiscoveredContextIntentContracts(options, run) {
|
|
|
110
113
|
return await runWithContextIntentContracts(layers, run);
|
|
111
114
|
}
|
|
112
115
|
//# sourceMappingURL=context-intent-runtime.js.map
|
|
113
|
-
//# debugId=
|
|
116
|
+
//# debugId=1a7548f2-93a0-5dfc-9d9a-c5aef4656c7c
|
package/dist/sdk/contracts.d.ts
CHANGED
|
@@ -16,4 +16,5 @@ export * from "./output-contracts.js";
|
|
|
16
16
|
export * from "./read-output-contracts.js";
|
|
17
17
|
export * from "./agent/refusal-closure.js";
|
|
18
18
|
export * from "./agent/closed-domain-contracts.js";
|
|
19
|
+
export * from "./agent/tracker-preflight-contracts.js";
|
|
19
20
|
export type { PmReadOutputSessionReceipt, PmReadOutputSessionState, } from "./read-output-session.js";
|
package/dist/sdk/contracts.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Exposes command and action contract data without loading SDK runtime code.
|
|
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]="8bdc03e5-c5cd-5842-b438-cf7bc79863f0")}catch(e){}}();
|
|
8
8
|
export * from "./cli-contracts.js";
|
|
9
9
|
export * from "./cli-contracts/grammar-contracts.js";
|
|
10
10
|
export * from "./cli-contracts/command-exit-contracts.js";
|
|
@@ -18,5 +18,6 @@ export * from "./output-contracts.js";
|
|
|
18
18
|
export * from "./read-output-contracts.js";
|
|
19
19
|
export * from "./agent/refusal-closure.js";
|
|
20
20
|
export * from "./agent/closed-domain-contracts.js";
|
|
21
|
+
export * from "./agent/tracker-preflight-contracts.js";
|
|
21
22
|
//# sourceMappingURL=contracts.js.map
|
|
22
|
-
//# debugId=
|
|
23
|
+
//# debugId=8bdc03e5-c5cd-5842-b438-cf7bc79863f0
|
package/dist/sdk/dependencies.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Implements the pm deps 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]="74a825f3-1301-5dc5-a887-c6ff68f6d7ec")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "./environment/tracker-preflight.js";
|
|
8
9
|
import { getActiveExtensionRegistrations } from "../core/extensions/index.js";
|
|
9
|
-
import { pathExists } from "../core/fs/fs-utils.js";
|
|
10
10
|
import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
|
|
11
11
|
import { isTerminalStatus } from "../core/item/status.js";
|
|
12
12
|
import { resolveRuntimeStatusRegistry } from "../core/schema/runtime-schema.js";
|
|
@@ -14,7 +14,7 @@ import { EXIT_CODE } from "../core/shared/constants.js";
|
|
|
14
14
|
import { PmCliError } from "../core/shared/errors.js";
|
|
15
15
|
import { formatBuiltInOutput } from "../core/output/output.js";
|
|
16
16
|
import { listAllItemMetadataLight, locateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
17
|
-
import {
|
|
17
|
+
import { resolvePmRoot } from "../core/store/paths.js";
|
|
18
18
|
import { readSettings } from "../core/store/settings.js";
|
|
19
19
|
import { estimatePmOutputTokens } from "./cli-contracts/agent-output-contracts.js";
|
|
20
20
|
import { assertProjectionModeChoice, attachOutputOmissionReceipt, } from "./output-projection.js";
|
|
@@ -659,9 +659,7 @@ function attachDepsProjection(result, summaryOnly, legacyAliasCounts = {}) {
|
|
|
659
659
|
/** Implements run deps for the public runtime surface of this module. */
|
|
660
660
|
export async function runDeps(id, options, global) {
|
|
661
661
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
662
|
-
|
|
663
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
664
|
-
}
|
|
662
|
+
await assertInitializedTracker(pmRoot);
|
|
665
663
|
const format = parseFormat(options.format);
|
|
666
664
|
const maxDepth = parseMaxDepth(options.maxDepth);
|
|
667
665
|
const collapse = parseCollapse(options.collapse);
|
|
@@ -718,4 +716,4 @@ export async function runDeps(id, options, global) {
|
|
|
718
716
|
return attachDepsProjection(buildTreeOrGraphDepsResult(id, format, options, index, maxDepth, collapse, global.json === true ? "json" : "toon"), false, Object.fromEntries(Object.entries(assembleWorkspaceRelationshipGraph(items, (status) => isTerminalStatus(status, statusRegistry)).legacyAliasCounts)));
|
|
719
717
|
}
|
|
720
718
|
//# sourceMappingURL=dependencies.js.map
|
|
721
|
-
//# debugId=
|
|
719
|
+
//# debugId=74a825f3-1301-5dc5-a887-c6ff68f6d7ec
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Dependency, ItemFormat, RuntimeSchemaSettings } from "../types/index.js";
|
|
2
2
|
import { type RelationshipKindRegistry } from "./relationships.js";
|
|
3
3
|
/** Reject malformed shorthand before item-id prefix normalization can create a dangling graph node. */
|
|
4
|
-
export declare function assertValidBareDependencyFlagValue(value: string, structured: boolean): void;
|
|
4
|
+
export declare function assertValidBareDependencyFlagValue(value: string, structured: boolean, flag?: string): void;
|
|
5
5
|
/**
|
|
6
6
|
* Validate prospective stored dependencies against the active relationship
|
|
7
7
|
* ontology before a create or update mutation writes item or history state.
|