@unbrained/pm-cli 2026.8.11 → 2026.8.13
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 +74 -21
- package/dist/cli/commander-usage.js +37 -11
- package/dist/cli/error-guidance.d.ts +2 -0
- package/dist/cli/error-guidance.js +82 -19
- package/dist/cli/main.js +35 -19
- package/dist/cli/register-annotations.js +56 -3
- package/dist/cli/register-assurance.js +28 -17
- package/dist/cli/register-list-query.js +10 -7
- package/dist/cli/register-operations.js +16 -6
- package/dist/cli-bundle/bundle-manifest.json +163 -163
- package/dist/cli-bundle/chunks/chunk-3ZMOWAFM.js +2 -0
- package/dist/cli-bundle/chunks/chunk-DEDU3DG7.js +196 -0
- package/dist/cli-bundle/chunks/chunk-DL5M5J3V.js +13 -0
- package/dist/cli-bundle/chunks/chunk-F7FJYGK3.js +8 -0
- package/dist/cli-bundle/chunks/chunk-HIUZVCMN.js +5 -0
- package/dist/cli-bundle/chunks/chunk-IMGIN7R6.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-A2SJGHSI.js → chunk-Q47C67TQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WMEZHCFI.js → chunk-QGTUPEU5.js} +62 -54
- package/dist/cli-bundle/chunks/chunk-TF3TPKPR.js +34 -0
- package/dist/cli-bundle/chunks/{chunk-ZU34C3LH.js → chunk-YLBAPY22.js} +50 -50
- package/dist/cli-bundle/chunks/register-list-query-4HIZ7EA3.js +10 -0
- package/dist/cli-bundle/chunks/register-mutation-W64FZ5HN.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-C44ET7R5.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-NOCOOWQY.js → register-setup-634MFRXU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-27N23W6M.js +31 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4H5IA6AV.js → chunk-2JP7W7GO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2RI2FESN.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-3BNVU6LC.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-2DL3MRTD.js → chunk-3DJSGWVB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-6MLIRBLV.js +5 -0
- package/dist/cli-bundle/focused-chunks/chunk-6XYLENDV.js +155 -0
- package/dist/cli-bundle/focused-chunks/chunk-CP4K4WFS.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TL5M2PAY.js → chunk-E3AVJ655.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EBTNSFYE.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-J5EKAIVD.js → chunk-HC2OL2H2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BKPIY34S.js → chunk-I75MANL7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-IIS2FRKL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-NFHFZH2Z.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OGC4XSBC.js +17 -0
- package/dist/cli-bundle/focused-chunks/{chunk-UDAZWT25.js → chunk-OOYYKQWX.js} +4 -4
- package/dist/cli-bundle/focused-chunks/{chunk-23FTGO3W.js → chunk-PKPOZXLL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QDZUABWL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QQX5TDFT.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-55BIB6DV.js → chunk-TEZIXMTH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-WEH6NSL6.js +18 -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 +1 -1
- package/dist/cli-bundle/sdk-core.js +42 -41
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +1 -1
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +2 -2
- package/dist/core/checkpoint/checkpoint-gc.js +7 -12
- package/dist/core/extensions/activation-summary-markdown.js +5 -4
- package/dist/core/extensions/activation-summary.d.ts +2 -0
- package/dist/core/extensions/activation-summary.js +6 -2
- package/dist/core/extensions/capability-usage.d.ts +1 -1
- package/dist/core/extensions/capability-usage.js +4 -3
- package/dist/core/extensions/contribution-inventory.d.ts +1 -0
- package/dist/core/extensions/contribution-inventory.js +6 -2
- package/dist/core/extensions/extension-registries.js +3 -2
- package/dist/core/extensions/extension-types.d.ts +83 -1
- package/dist/core/extensions/extension-types.js +3 -2
- package/dist/core/extensions/loader.d.ts +2 -8
- package/dist/core/extensions/loader.js +53 -144
- package/dist/core/extensions/registration-values.d.ts +43 -0
- package/dist/core/extensions/registration-values.js +210 -0
- package/dist/core/extensions/reserved-host-flags.js +3 -2
- package/dist/core/extensions/runtime-registrations.d.ts +3 -1
- package/dist/core/extensions/runtime-registrations.js +12 -2
- package/dist/core/fs/fs-utils.d.ts +2 -0
- package/dist/core/fs/fs-utils.js +7 -3
- package/dist/core/history/drift-cache.js +4 -3
- package/dist/core/history/drift-scan.js +16 -17
- package/dist/core/history/history.d.ts +8 -0
- package/dist/core/history/history.js +57 -7
- package/dist/core/history/replay.d.ts +9 -1
- package/dist/core/history/replay.js +48 -13
- package/dist/core/lock/lock-gc.js +8 -13
- package/dist/core/lock/lock.js +5 -4
- package/dist/core/output/output.d.ts +2 -0
- package/dist/core/output/output.js +46 -14
- package/dist/core/search/vector-stores.js +6 -11
- package/dist/core/shared/command-types.d.ts +2 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/errors.d.ts +5 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/store/item-metadata-cache.d.ts +1 -1
- package/dist/core/store/item-metadata-cache.js +16 -9
- package/dist/core/telemetry/runtime.d.ts +6 -0
- package/dist/core/telemetry/runtime.js +101 -30
- package/dist/sdk/agent/command-recovery.d.ts +2 -0
- package/dist/sdk/agent/command-recovery.js +10 -2
- package/dist/sdk/annotations.js +4 -4
- package/dist/sdk/cli-bootstrap.d.ts +2 -0
- package/dist/sdk/cli-bootstrap.js +6 -2
- package/dist/sdk/cli-contracts/completeness.js +10 -3
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +9 -3
- package/dist/sdk/cli-contracts/registration-helpers.d.ts +20 -3
- package/dist/sdk/cli-contracts/registration-helpers.js +18 -12
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +40 -6
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +27 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +55 -5
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +22 -4
- package/dist/sdk/cli-program.js +3 -2
- package/dist/sdk/comments.js +4 -3
- package/dist/sdk/compile-cache.js +4 -3
- package/dist/sdk/completion.js +16 -7
- package/dist/sdk/compose.d.ts +3 -1
- package/dist/sdk/compose.js +16 -2
- package/dist/sdk/context-intent-contracts.js +45 -4
- package/dist/sdk/context-signal-store.js +4 -3
- package/dist/sdk/core.d.ts +1 -0
- package/dist/sdk/core.js +3 -2
- package/dist/sdk/extension/install-runtime.js +4 -4
- package/dist/sdk/extension/managed-state.js +4 -3
- package/dist/sdk/extension-contracts.d.ts +1 -1
- package/dist/sdk/flag-invocation-contracts.js +5 -6
- package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +8 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1597 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +8 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1608 -0
- package/dist/sdk/generated-error-code-catalog.js +6 -3140
- package/dist/sdk/governance/assurance-action.d.ts +27 -3
- package/dist/sdk/governance/assurance-action.js +117 -31
- package/dist/sdk/governance/assurance-mutation-error.d.ts +14 -0
- package/dist/sdk/governance/assurance-mutation-error.js +58 -0
- package/dist/sdk/governance/assurance-presets.d.ts +54 -0
- package/dist/sdk/governance/assurance-presets.js +136 -0
- package/dist/sdk/governance/assurance-runtime.d.ts +4 -0
- package/dist/sdk/governance/assurance-runtime.js +118 -14
- package/dist/sdk/governance/assurance.d.ts +51 -6
- package/dist/sdk/governance/assurance.js +321 -67
- package/dist/sdk/governance/gc.js +5 -11
- package/dist/sdk/governance/health.d.ts +3 -1
- package/dist/sdk/governance/health.js +24 -7
- package/dist/sdk/governance/validate-item-reader.js +3 -3
- package/dist/sdk/governance/validate.d.ts +2 -0
- package/dist/sdk/governance/validate.js +15 -5
- package/dist/sdk/graph/durable-cache.d.ts +1 -1
- package/dist/sdk/graph/durable-cache.js +156 -29
- package/dist/sdk/graph/governance-contracts.d.ts +12 -0
- package/dist/sdk/graph/governance-contracts.js +27 -0
- package/dist/sdk/graph/governance.d.ts +44 -2
- package/dist/sdk/graph/governance.js +156 -12
- package/dist/sdk/guide.js +4 -4
- package/dist/sdk/index.d.ts +3 -2
- package/dist/sdk/index.js +5 -4
- package/dist/sdk/lifecycle/claim.js +10 -3
- package/dist/sdk/linked-artifacts.d.ts +2 -0
- package/dist/sdk/linked-artifacts.js +29 -4
- package/dist/sdk/merge/driver.d.ts +2 -2
- package/dist/sdk/merge/driver.js +3 -3
- package/dist/sdk/merge/install.js +5 -4
- package/dist/sdk/merge/receipts.d.ts +6 -4
- package/dist/sdk/merge/receipts.js +7 -5
- package/dist/sdk/merge/three-way.d.ts +2 -2
- package/dist/sdk/merge/three-way.js +3 -3
- package/dist/sdk/output-projection.d.ts +9 -1
- package/dist/sdk/output-projection.js +45 -9
- package/dist/sdk/query/activity.d.ts +49 -2
- package/dist/sdk/query/activity.js +185 -38
- package/dist/sdk/query/get.js +19 -2
- package/dist/sdk/read-output-contracts.d.ts +5 -1
- package/dist/sdk/read-output-contracts.js +17 -2
- package/dist/sdk/read-output-session.d.ts +2 -0
- package/dist/sdk/read-output-session.js +12 -5
- package/dist/sdk/relationship-history.js +5 -5
- package/dist/sdk/runtime-primitives.d.ts +3 -3
- package/dist/sdk/runtime-primitives.js +5 -5
- package/dist/sdk/runtime-stats-options.js +3 -2
- package/dist/sdk/runtime.js +5 -9
- package/dist/sdk/schema-migration.js +4 -4
- package/dist/sdk/stats.d.ts +36 -3
- package/dist/sdk/stats.js +55 -15
- package/dist/sdk/test/execution.d.ts +4 -0
- package/dist/sdk/test/execution.js +88 -23
- package/dist/sdk/workspace-memory.js +4 -4
- package/dist/sdk/workspace-snapshot.js +8 -14
- package/dist/sdk/workspace-transaction-gc.js +4 -9
- package/dist/sdk/workspace-transaction.js +4 -4
- package/dist/sdk/workspace.js +4 -3
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -2
- package/docs/ASSURANCE.md +170 -14
- package/docs/COMMANDS.md +29 -8
- package/docs/CONFIGURATION.md +9 -0
- package/docs/DEPENDENCY_KIND_CONTRACT.md +10 -8
- package/docs/EXTENSIONS.md +11 -12
- package/docs/MERGE_SAFETY.md +3 -1
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +26 -13
- package/docs/README.md +2 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +17 -2
- package/docs/RELATIONSHIP_GRAPH.md +15 -0
- package/docs/SDK.md +17 -3
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +12 -1
- package/docs/SDK_CONTEXT_EVIDENCE_CONTRACTS.md +53 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +28 -1
- package/docs/TESTING.md +24 -15
- package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +106 -0
- package/docs/performance/sdk-entrypoint-import-costs.md +6 -2
- package/marketplace.json +2 -2
- package/package.json +6 -6
- 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 +384 -83
- package/dist/cli-bundle/chunks/chunk-2OOU2AFH.js +0 -8
- package/dist/cli-bundle/chunks/chunk-2RA2YTHJ.js +0 -33
- package/dist/cli-bundle/chunks/chunk-DSKYD4LG.js +0 -13
- package/dist/cli-bundle/chunks/chunk-HC3GM6YY.js +0 -194
- package/dist/cli-bundle/chunks/chunk-IUNRVDAI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-W7CPZGSB.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ZXOC6HG5.js +0 -5
- package/dist/cli-bundle/chunks/register-list-query-HAUXVUPY.js +0 -10
- package/dist/cli-bundle/chunks/register-mutation-7Y5U7ABT.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-EQX3DLAZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3AYKXMYX.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4AHEC74N.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4SV3ZKG3.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-6JW6Z2P5.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-D4PIWE6D.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DPO7TEFX.js +0 -31
- package/dist/cli-bundle/focused-chunks/chunk-E3KCL7AY.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-ERAAFLPS.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-F6E4JZKG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-FPSYO5ZG.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-KDH5OX3D.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-OJ3LVVIS.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-VABB4L5Y.js +0 -17
|
@@ -1,5 +1,6 @@
|
|
|
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]="9ec35c35-f2dc-5f86-a166-cf0c80eab1bd")}catch(e){}}();
|
|
3
|
+
import { resolveRecoveryCommandName } from "../sdk/agent/command-recovery.js";
|
|
3
4
|
import { renderPmCommand } from "./argv-utils.js";
|
|
4
5
|
import { discoverNearbyPmRoot } from "../sdk/tracker-root-discovery.js";
|
|
5
6
|
/** Compact an error envelope to fields that change the caller's next action. */
|
|
@@ -125,7 +126,21 @@ function assignRecoveryString(normalized, key, value) {
|
|
|
125
126
|
normalized[key] = value.trim();
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function assignRecoveryCollection(normalized, key, value) {
|
|
130
|
+
if (key === "parsed_positionals") {
|
|
131
|
+
if (!Array.isArray(value))
|
|
132
|
+
return;
|
|
133
|
+
const parsedPositionals = value
|
|
134
|
+
.map((entry) => ({
|
|
135
|
+
role: typeof entry?.role === "string" ? entry.role.trim() : "",
|
|
136
|
+
value: typeof entry?.value === "string" ? entry.value.trim() : "",
|
|
137
|
+
}))
|
|
138
|
+
.filter((entry) => entry.role.length > 0 && entry.value.length > 0);
|
|
139
|
+
if (parsedPositionals.length > 0) {
|
|
140
|
+
normalized.parsed_positionals = parsedPositionals;
|
|
141
|
+
}
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
129
144
|
const values = normalizeStringArray(value);
|
|
130
145
|
if (values) {
|
|
131
146
|
normalized[key] = values;
|
|
@@ -140,13 +155,14 @@ function normalizeRecoveryPayload(payload) {
|
|
|
140
155
|
normalized.recovery_mode = "compact";
|
|
141
156
|
}
|
|
142
157
|
assignRecoveryString(normalized, "attempted_command", payload.attempted_command);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
158
|
+
assignRecoveryCollection(normalized, "normalized_args", payload.normalized_args);
|
|
159
|
+
assignRecoveryCollection(normalized, "parsed_positionals", payload.parsed_positionals);
|
|
160
|
+
assignRecoveryCollection(normalized, "provided_fields", payload.provided_fields);
|
|
161
|
+
assignRecoveryCollection(normalized, "missing", payload.missing);
|
|
162
|
+
assignRecoveryCollection(normalized, "missing_required_fields", payload.missing_required_fields);
|
|
163
|
+
assignRecoveryCollection(normalized, "suggested_flags", payload.suggested_flags);
|
|
164
|
+
assignRecoveryCollection(normalized, "allowed_values", payload.allowed_values);
|
|
165
|
+
assignRecoveryCollection(normalized, "candidate_commands", payload.candidate_commands);
|
|
150
166
|
if (typeof payload.candidate_commands_total === "number" &&
|
|
151
167
|
Number.isSafeInteger(payload.candidate_commands_total) &&
|
|
152
168
|
payload.candidate_commands_total >= 0) {
|
|
@@ -186,6 +202,13 @@ function renderRecoveryBundle(recovery) {
|
|
|
186
202
|
const lines = ["Recovery bundle:"];
|
|
187
203
|
appendRecoveryTextLine(lines, "attempted_command", normalized.attempted_command);
|
|
188
204
|
appendRecoveryListLine(lines, "normalized_args", normalized.normalized_args, " ");
|
|
205
|
+
if (normalized.parsed_positionals &&
|
|
206
|
+
normalized.parsed_positionals.length > 0) {
|
|
207
|
+
lines.push(" parsed_positionals:");
|
|
208
|
+
for (const positional of normalized.parsed_positionals) {
|
|
209
|
+
lines.push(` - ${positional.role}: ${positional.value}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
189
212
|
appendRecoveryListLine(lines, "provided_fields", normalized.provided_fields, ", ");
|
|
190
213
|
appendRecoveryListLine(lines, "missing", normalized.missing, ", ");
|
|
191
214
|
appendRecoveryListLine(lines, "missing_required_fields", normalized.missing_required_fields, ", ");
|
|
@@ -319,12 +342,7 @@ function dedupeStrings(values) {
|
|
|
319
342
|
return result;
|
|
320
343
|
}
|
|
321
344
|
function inferCommandNameFromRecovery(recovery) {
|
|
322
|
-
|
|
323
|
-
if (!Array.isArray(args) || args.length === 0) {
|
|
324
|
-
return undefined;
|
|
325
|
-
}
|
|
326
|
-
const firstCommandArg = args.find((arg) => arg.trim().length > 0 && !arg.startsWith("-"));
|
|
327
|
-
return firstCommandArg?.trim();
|
|
345
|
+
return resolveRecoveryCommandName(recovery?.normalized_args);
|
|
328
346
|
}
|
|
329
347
|
function inferAllowedValuesFromMessage(message) {
|
|
330
348
|
const match = message.match(/\bmust be one of:?\s+([A-Za-z0-9_.|,\- ]+)/i);
|
|
@@ -822,8 +840,7 @@ function buildUnknownOptionGuidance(message, commandName, context) {
|
|
|
822
840
|
return buildUnsupportedUpdateOptionGuidance(optionName, context, suggestions);
|
|
823
841
|
}
|
|
824
842
|
const otherCommands = normalizeContextList(guidanceContext.unknownOptionOtherCommands) ?? [];
|
|
825
|
-
const candidateTotal = guidanceContext.unknownOptionOtherCommandsTotal ??
|
|
826
|
-
otherCommands.length;
|
|
843
|
+
const candidateTotal = guidanceContext.unknownOptionOtherCommandsTotal ?? otherCommands.length;
|
|
827
844
|
const proseCommands = otherCommands.slice(0, 3);
|
|
828
845
|
const proseRemainder = candidateTotal - proseCommands.length;
|
|
829
846
|
let proseRemainderText = "";
|
|
@@ -842,7 +859,10 @@ function buildUnknownOptionGuidance(message, commandName, context) {
|
|
|
842
859
|
? `Replay with suggested correction: ${retryCommand}`
|
|
843
860
|
: undefined,
|
|
844
861
|
].filter((entry) => typeof entry === "string");
|
|
845
|
-
const examples = [
|
|
862
|
+
const examples = [
|
|
863
|
+
retryCommand,
|
|
864
|
+
`pm ${commandName ?? "<command>"} --help`,
|
|
865
|
+
].filter((entry) => typeof entry === "string");
|
|
846
866
|
return makeGuidanceMessage({
|
|
847
867
|
code: "unknown_option",
|
|
848
868
|
title: `Unknown option ${optionName}`,
|
|
@@ -966,6 +986,48 @@ function buildLinkedTestValueNotQuotedGuidance(message, commandName, context) {
|
|
|
966
986
|
recovery: buildCommanderRecoveryPayload(context, retryCommand ? { suggested_retry: retryCommand } : {}),
|
|
967
987
|
});
|
|
968
988
|
}
|
|
989
|
+
const TRANSPOSED_COLLECTION_COMMANDS = new Set([
|
|
990
|
+
"comments",
|
|
991
|
+
"docs",
|
|
992
|
+
"files",
|
|
993
|
+
"learnings",
|
|
994
|
+
"notes",
|
|
995
|
+
"test",
|
|
996
|
+
]);
|
|
997
|
+
function buildTransposedCollectionActionGuidance(message, commandName, context) {
|
|
998
|
+
if (!/too many arguments/i.test(message) ||
|
|
999
|
+
!TRANSPOSED_COLLECTION_COMMANDS.has(commandName ?? "")) {
|
|
1000
|
+
return null;
|
|
1001
|
+
}
|
|
1002
|
+
const argv = context?.normalizedInvocationArgs ?? [];
|
|
1003
|
+
const commandIndex = argv.findIndex((token) => token === commandName);
|
|
1004
|
+
const action = argv[commandIndex + 1];
|
|
1005
|
+
const parsedItemId = argv[commandIndex + 2];
|
|
1006
|
+
const itemId = context?.verifiedCollectionItemId?.trim();
|
|
1007
|
+
if (action?.toLowerCase() !== "add" ||
|
|
1008
|
+
!parsedItemId ||
|
|
1009
|
+
parsedItemId.startsWith("-") ||
|
|
1010
|
+
!itemId ||
|
|
1011
|
+
itemId.toLowerCase() !== parsedItemId.toLowerCase()) {
|
|
1012
|
+
return null;
|
|
1013
|
+
}
|
|
1014
|
+
const suggestedRetry = `pm ${commandName} ${itemId} --add <value>`;
|
|
1015
|
+
return makeGuidanceMessage({
|
|
1016
|
+
code: "collection_transposed_subcommand",
|
|
1017
|
+
title: `Transposed ${commandName} add syntax`,
|
|
1018
|
+
happened: `The positional token "add" occupied the item-id role and "${itemId}" occupied the next positional role. pm ${commandName} does not use an add subcommand.`,
|
|
1019
|
+
required: `Place the item id immediately after ${commandName}, then use --add for the value.`,
|
|
1020
|
+
why: "Collection mutations use object-first grammar: pm <collection> <item-id> --add <value>.",
|
|
1021
|
+
examples: [suggestedRetry, `pm ${commandName} --help`],
|
|
1022
|
+
recovery: buildCommanderRecoveryPayload(context, {
|
|
1023
|
+
parsed_positionals: [
|
|
1024
|
+
{ role: "transposed_subcommand", value: action },
|
|
1025
|
+
{ role: "item_id", value: itemId },
|
|
1026
|
+
],
|
|
1027
|
+
suggested_retry: suggestedRetry,
|
|
1028
|
+
}),
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
969
1031
|
const CONTEXT_GUIDANCE_VALUE_FLAGS = new Set([
|
|
970
1032
|
"--activity-limit",
|
|
971
1033
|
"--assignee",
|
|
@@ -1041,6 +1103,7 @@ function buildCommanderErrorGuidance(rawMessage, commandName, allowedTypes, cont
|
|
|
1041
1103
|
buildUnknownOptionGuidance(message, commandName, context) ??
|
|
1042
1104
|
buildUnknownCommandGuidance(message, context) ??
|
|
1043
1105
|
buildUnknownSubcommandGuidance(context) ??
|
|
1106
|
+
buildTransposedCollectionActionGuidance(message, commandName, context) ??
|
|
1044
1107
|
buildLinkedTestValueNotQuotedGuidance(message, commandName, context) ??
|
|
1045
1108
|
buildContextItemArgumentGuidance(message, commandName, context);
|
|
1046
1109
|
if (guidance) {
|
|
@@ -1134,4 +1197,4 @@ export const _testOnly = {
|
|
|
1134
1197
|
resolveKnownPackageCommandHint,
|
|
1135
1198
|
};
|
|
1136
1199
|
//# sourceMappingURL=error-guidance.js.map
|
|
1137
|
-
//# debugId=
|
|
1200
|
+
//# debugId=9ec35c35-f2dc-5f86-a166-cf0c80eab1bd
|
package/dist/cli/main.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module cli/main
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
!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]="
|
|
6
|
+
!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]="8aed7a8b-4c51-5aba-b27e-80f87f8f3d35")}catch(e){}}();
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import { activateExtensions, clearActiveExtensionHooks, createCoreCommandHookContext, resetActiveExtensionRuntimeState, createEmptyExtensionRegistrationRegistry, discoverExtensions, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, consumeAfterCommandAffectedItems, runActiveCommandHandler, runActiveParserOverride, runActivePreflightOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandResult, setActiveCommandContext, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, pathExists, resolvePmCliVersion, resolvePmPackageRootFromModule, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, EXIT_CODE, resolveTelemetryErrorCategory, PmCliError, asRecordOrNull, printError, printResult, maybeRunFirstUseTelemetryPrompt, emitTelemetryErrorEvent, startTelemetryCommand, deriveTelemetryCommandResolution, sentryCaptureCliError, sentryFinishCommandSpan, sentryFlush, sentryLogCliUsageError, sentrySetCommandContext, sentryStartCommandSpan, ensureSentryInit, getSettingsPath, resolvePmRoot, readSettings, readSettingsWithMetadata, runWithWorkspaceHarnessSignalDescriptors, createLazyModule, } from "../sdk/runtime-primitives.js";
|
|
9
9
|
import { resolveSubcommandFlagContractsForCommand } from "../sdk/cli-contracts.js";
|
|
@@ -846,15 +846,29 @@ function activationCommandMatchesProbe(command, probe) {
|
|
|
846
846
|
return false;
|
|
847
847
|
}
|
|
848
848
|
function extensionActivationCommands(extension) {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
849
|
+
const explicitCommands = extension.activation?.commands;
|
|
850
|
+
if (explicitCommands) {
|
|
851
|
+
return explicitCommands;
|
|
852
|
+
}
|
|
853
|
+
const contributions = extension.contributions;
|
|
854
|
+
if (!contributions) {
|
|
855
|
+
return [];
|
|
856
|
+
}
|
|
857
|
+
return [
|
|
858
|
+
...entriesOrEmpty(contributions.commands),
|
|
859
|
+
...entriesOrEmpty(contributions.command_handlers),
|
|
860
|
+
...entriesOrEmpty(contributions.command_overrides),
|
|
861
|
+
...entriesOrEmpty(contributions.flag_commands),
|
|
862
|
+
...entriesOrEmpty(contributions.parser_overrides),
|
|
863
|
+
...ownershipCommands(contributions.preflight_ownership),
|
|
864
|
+
...ownershipCommands(contributions.renderer_ownership),
|
|
865
|
+
];
|
|
866
|
+
}
|
|
867
|
+
function entriesOrEmpty(entries) {
|
|
868
|
+
return entries ?? [];
|
|
869
|
+
}
|
|
870
|
+
function ownershipCommands(entries) {
|
|
871
|
+
return entriesOrEmpty(entries).flatMap((entry) => entry.commands);
|
|
858
872
|
}
|
|
859
873
|
function extensionCapabilities(extension) {
|
|
860
874
|
/* c8 ignore next */
|
|
@@ -917,14 +931,16 @@ function matchesStaticExtensionCommand(commands, probe) {
|
|
|
917
931
|
/** Identify contribution surfaces that participate in global runtime behavior. */
|
|
918
932
|
function hasGlobalExtensionContributions(contributions) {
|
|
919
933
|
const contributionCounts = [
|
|
920
|
-
contributions.hooks
|
|
921
|
-
contributions.preflight_overrides ?? 0
|
|
922
|
-
|
|
923
|
-
contributions.
|
|
924
|
-
contributions.
|
|
925
|
-
contributions.
|
|
926
|
-
(contributions.
|
|
927
|
-
|
|
934
|
+
entriesOrEmpty(contributions.hooks).length,
|
|
935
|
+
(contributions.preflight_overrides ?? 0) -
|
|
936
|
+
entriesOrEmpty(contributions.preflight_ownership).length,
|
|
937
|
+
entriesOrEmpty(contributions.item_types).length,
|
|
938
|
+
entriesOrEmpty(contributions.item_fields).length,
|
|
939
|
+
entriesOrEmpty(contributions.relationship_kinds).length,
|
|
940
|
+
entriesOrEmpty(contributions.service_overrides).length,
|
|
941
|
+
entriesOrEmpty(contributions.assurance_providers).length,
|
|
942
|
+
entriesOrEmpty(contributions.renderer_overrides).length -
|
|
943
|
+
entriesOrEmpty(contributions.renderer_ownership).length,
|
|
928
944
|
];
|
|
929
945
|
return contributionCounts.some((count) => count > 0);
|
|
930
946
|
}
|
|
@@ -2459,4 +2475,4 @@ export const _testOnly = {
|
|
|
2459
2475
|
wrapThrownErrorForSentry,
|
|
2460
2476
|
};
|
|
2461
2477
|
//# sourceMappingURL=main.js.map
|
|
2462
|
-
//# debugId=
|
|
2478
|
+
//# debugId=8aed7a8b-4c51-5aba-b27e-80f87f8f3d35
|
|
@@ -1,10 +1,52 @@
|
|
|
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]="616fff4b-f86e-54e5-b569-0b9894da5221")}catch(e){}}();
|
|
3
3
|
import { EXIT_CODE, PmCliError, } from "../sdk/runtime-primitives.js";
|
|
4
|
+
import { renderPmCommand } from "../sdk/command-line.js";
|
|
4
5
|
import { runComments } from "./commands/comments.js";
|
|
5
6
|
import { runLearnings } from "./commands/learnings.js";
|
|
6
7
|
import { runNotes } from "./commands/notes.js";
|
|
7
8
|
import { addHiddenOption, getGlobalOptions, invalidateSearchCachesForMutation, printError, printResult, readOptionString, } from "./registration-helpers.js";
|
|
9
|
+
function assertNoTransposedAnnotationAction(collection, id, text, options) {
|
|
10
|
+
if (id.trim().toLowerCase() !== "add" || !text?.trim()) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const suppliedText = readOptionString(options, "add") ??
|
|
14
|
+
readOptionString(options, "note") ??
|
|
15
|
+
readOptionString(options, "body") ??
|
|
16
|
+
readOptionString(options, "comment");
|
|
17
|
+
const file = readOptionString(options, "file");
|
|
18
|
+
const retryArgs = [collection, text.trim()];
|
|
19
|
+
if (suppliedText !== undefined)
|
|
20
|
+
retryArgs.push("--add", suppliedText);
|
|
21
|
+
else if (options.stdin === true)
|
|
22
|
+
retryArgs.push("--stdin");
|
|
23
|
+
else if (file !== undefined)
|
|
24
|
+
retryArgs.push("--file", file);
|
|
25
|
+
else
|
|
26
|
+
retryArgs.push("--add", "-");
|
|
27
|
+
const suggestedRetry = renderPmCommand(retryArgs);
|
|
28
|
+
const stdinRetry = renderPmCommand([
|
|
29
|
+
collection,
|
|
30
|
+
text.trim(),
|
|
31
|
+
"--add",
|
|
32
|
+
"-",
|
|
33
|
+
]);
|
|
34
|
+
throw new PmCliError(`The positional token "add" was parsed as the item id, while "${text.trim()}" was parsed as annotation text. ${collection} does not use an add subcommand.`, EXIT_CODE.USAGE, {
|
|
35
|
+
code: "annotation_transposed_subcommand",
|
|
36
|
+
reason: "noun_verb_object_transposition",
|
|
37
|
+
required: `Place the item id immediately after ${collection}, then use --add for annotation text.`,
|
|
38
|
+
examples: [...new Set([suggestedRetry, stdinRetry])],
|
|
39
|
+
recovery: {
|
|
40
|
+
attempted_command: `pm ${collection} add ${text.trim()}`,
|
|
41
|
+
normalized_args: [collection, "add", text.trim()],
|
|
42
|
+
parsed_positionals: [
|
|
43
|
+
{ role: "transposed_subcommand", value: "add" },
|
|
44
|
+
{ role: "item_id", value: text.trim() },
|
|
45
|
+
],
|
|
46
|
+
suggested_retry: suggestedRetry,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
8
50
|
function resolveCommentSources(text, options) {
|
|
9
51
|
const editIndex = typeof options.edit === "number" ? options.edit : undefined;
|
|
10
52
|
const deleteIndex = typeof options.delete === "number" ? options.delete : undefined;
|
|
@@ -42,7 +84,14 @@ function resolveCommentSources(text, options) {
|
|
|
42
84
|
};
|
|
43
85
|
}
|
|
44
86
|
function resolveSingleTextSource(label, positional, options) {
|
|
45
|
-
const
|
|
87
|
+
const canonicalAdd = readOptionString(options, "add");
|
|
88
|
+
const aliasAdd = label === "note" ? readOptionString(options, "note") : undefined;
|
|
89
|
+
if (canonicalAdd !== undefined &&
|
|
90
|
+
aliasAdd !== undefined &&
|
|
91
|
+
canonicalAdd !== aliasAdd) {
|
|
92
|
+
throw new PmCliError("Specify note text with either --add or --note, not conflicting values for both aliases", EXIT_CODE.USAGE, { code: "annotation_alias_conflict" });
|
|
93
|
+
}
|
|
94
|
+
const addFromOption = canonicalAdd ?? aliasAdd;
|
|
46
95
|
const addFromPositional = typeof positional === "string" ? positional : undefined;
|
|
47
96
|
if (addFromOption !== undefined && addFromPositional !== undefined) {
|
|
48
97
|
throw new PmCliError(`Specify ${label} text either as positional [text] or with --add, not both`, EXIT_CODE.USAGE);
|
|
@@ -52,6 +101,7 @@ function resolveSingleTextSource(label, positional, options) {
|
|
|
52
101
|
async function runCommentsAction(id, text, options, command) {
|
|
53
102
|
const globalOptions = getGlobalOptions(command);
|
|
54
103
|
const startedAt = Date.now();
|
|
104
|
+
assertNoTransposedAnnotationAction("comments", id, text, options);
|
|
55
105
|
const sources = resolveCommentSources(text, options);
|
|
56
106
|
const result = await runComments(id, {
|
|
57
107
|
add: sources.add,
|
|
@@ -74,6 +124,7 @@ async function runCommentsAction(id, text, options, command) {
|
|
|
74
124
|
async function runNotesAction(id, text, options, command) {
|
|
75
125
|
const globalOptions = getGlobalOptions(command);
|
|
76
126
|
const startedAt = Date.now();
|
|
127
|
+
assertNoTransposedAnnotationAction("notes", id, text, options);
|
|
77
128
|
const add = resolveSingleTextSource("note", text, options);
|
|
78
129
|
const result = await runNotes(id, {
|
|
79
130
|
add,
|
|
@@ -105,6 +156,7 @@ async function runNotesAction(id, text, options, command) {
|
|
|
105
156
|
async function runLearningsAction(id, text, options, command) {
|
|
106
157
|
const globalOptions = getGlobalOptions(command);
|
|
107
158
|
const startedAt = Date.now();
|
|
159
|
+
assertNoTransposedAnnotationAction("learnings", id, text, options);
|
|
108
160
|
const add = resolveSingleTextSource("learning", text, options);
|
|
109
161
|
const result = await runLearnings(id, {
|
|
110
162
|
add,
|
|
@@ -159,6 +211,7 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
|
|
|
159
211
|
.argument("<id>", "Item id")
|
|
160
212
|
.argument("[text]", "Optional note text shorthand (equivalent to --add; use - for stdin)")
|
|
161
213
|
.option("--add <text>", "Add a text note (- reads stdin)")
|
|
214
|
+
.option("--note <text>", "Alias for --add")
|
|
162
215
|
.option("--add-json <json>", "Append a merge-safe JSON event")
|
|
163
216
|
.option("--stdin", "Read note text from stdin")
|
|
164
217
|
.option("--file <path>", "Read note text from a UTF-8 file")
|
|
@@ -192,4 +245,4 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
|
|
|
192
245
|
.action(runLearningsAction);
|
|
193
246
|
}
|
|
194
247
|
//# sourceMappingURL=register-annotations.js.map
|
|
195
|
-
//# debugId=
|
|
248
|
+
//# debugId=616fff4b-f86e-54e5-b569-0b9894da5221
|
|
@@ -1,16 +1,21 @@
|
|
|
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]="
|
|
3
|
-
import {
|
|
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]="41d01430-1e95-5f09-9a2f-7e7f8fad8184")}catch(e){}}();
|
|
3
|
+
import { runAssuranceAction } from "../sdk/governance/assurance-action.js";
|
|
4
4
|
import { printResult } from "../sdk/runtime-primitives.js";
|
|
5
5
|
import { getGlobalOptions, readOptionString } from "./registration-helpers.js";
|
|
6
6
|
async function runAssuranceCliAction(action, kindOrGate, id, options, command) {
|
|
7
7
|
const global = getGlobalOptions(command);
|
|
8
8
|
const isRun = action === "run";
|
|
9
9
|
const isVerdicts = action === "verdicts";
|
|
10
|
+
const isPresetAction = action === "presets" || action === "apply";
|
|
11
|
+
const isPromote = action === "promote";
|
|
10
12
|
const result = await runAssuranceAction({
|
|
11
13
|
action,
|
|
12
|
-
...(isRun || isVerdicts
|
|
13
|
-
|
|
14
|
+
...(isRun || isVerdicts || isPresetAction || isPromote
|
|
15
|
+
? {}
|
|
16
|
+
: { kind: kindOrGate }),
|
|
17
|
+
id: isRun || isVerdicts || isPromote ? (id ?? kindOrGate) : id,
|
|
18
|
+
preset: isPresetAction ? (id ?? kindOrGate) : undefined,
|
|
14
19
|
definition: readOptionString(options, "definition"),
|
|
15
20
|
trigger: readOptionString(options, "trigger"),
|
|
16
21
|
tree: readOptionString(options, "tree"),
|
|
@@ -21,6 +26,9 @@ async function runAssuranceCliAction(action, kindOrGate, id, options, command) {
|
|
|
21
26
|
idOnly: global.idOnly,
|
|
22
27
|
author: readOptionString(options, "author"),
|
|
23
28
|
message: readOptionString(options, "message"),
|
|
29
|
+
owner: readOptionString(options, "owner"),
|
|
30
|
+
apply: options.apply === true,
|
|
31
|
+
enforcement: readOptionString(options, "enforcement"),
|
|
24
32
|
}, global);
|
|
25
33
|
printResult(result, global);
|
|
26
34
|
if (typeof result === "object" &&
|
|
@@ -34,19 +42,22 @@ async function runAssuranceCliAction(action, kindOrGate, id, options, command) {
|
|
|
34
42
|
export function registerAssuranceCommand(program) {
|
|
35
43
|
program
|
|
36
44
|
.command("assurance")
|
|
37
|
-
.argument("<action>",
|
|
38
|
-
.argument("[kind]",
|
|
39
|
-
.argument("[id]", "Declaration
|
|
40
|
-
.description("
|
|
41
|
-
.option("--definition <json>", "
|
|
42
|
-
.option("--trigger <value>", "Gate
|
|
43
|
-
.option("--tree <value>", "
|
|
44
|
-
.option("--gate <id>", "
|
|
45
|
-
.option("--limit <number>", "
|
|
46
|
-
.option("--dry-run", "Evaluate
|
|
47
|
-
.option("--author <value>", "Mutation author
|
|
48
|
-
.option("--message <value>", "
|
|
45
|
+
.argument("<action>", "Action; inspect `pm contracts --command assurance`")
|
|
46
|
+
.argument("[kind]", "Declaration kind or run gate id")
|
|
47
|
+
.argument("[id]", "Declaration/gate id")
|
|
48
|
+
.description("Manage SDK-owned assurance contracts.")
|
|
49
|
+
.option("--definition <json>", "Put declaration JSON")
|
|
50
|
+
.option("--trigger <value>", "Gate trigger")
|
|
51
|
+
.option("--tree <value>", "Revision identity")
|
|
52
|
+
.option("--gate <id>", "Verdict gate filter")
|
|
53
|
+
.option("--limit <number>", "Verdict limit")
|
|
54
|
+
.option("--dry-run", "Evaluate without recording")
|
|
55
|
+
.option("--author <value>", "Mutation author")
|
|
56
|
+
.option("--message <value>", "Mutation rationale")
|
|
57
|
+
.option("--owner <item-id>", "Preset/derivation owner")
|
|
58
|
+
.option("--apply", "Persist derived proposals")
|
|
59
|
+
.option("--enforcement <level>", "Promote to warn or block")
|
|
49
60
|
.action(runAssuranceCliAction);
|
|
50
61
|
}
|
|
51
62
|
//# sourceMappingURL=register-assurance.js.map
|
|
52
|
-
//# debugId=
|
|
63
|
+
//# debugId=41d01430-1e95-5f09-9a2f-7e7f8fad8184
|
|
@@ -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]="0bcbdc33-3145-54cc-b4b6-10df50aef57a")}catch(e){}}();
|
|
3
3
|
import { EXIT_CODE, PmCliError, renderRowsAsCsv, renderRowsAsTable, } from "../sdk/runtime-primitives.js";
|
|
4
4
|
import { EVAL_QUERY_SET_SCHEMA_ID } from "../sdk/eval.js";
|
|
5
5
|
import { applyContextIntentProjection } from "../sdk/context-intent-contracts.js";
|
|
@@ -372,7 +372,7 @@ async function runGetAction(id, options, command) {
|
|
|
372
372
|
async function runHistoryAction(id, options, command) {
|
|
373
373
|
const globalOptions = getGlobalOptions(command);
|
|
374
374
|
const startedAt = Date.now();
|
|
375
|
-
if ([options.compact, options.full, options.provenance].filter((value) => value === true).length > 1) {
|
|
375
|
+
if ([options.compact, options.raw, options.full, options.provenance].filter((value) => value === true).length > 1) {
|
|
376
376
|
throw new PmCliError("History projection options are mutually exclusive. Use --compact, --provenance, or --full.", EXIT_CODE.USAGE);
|
|
377
377
|
}
|
|
378
378
|
const field = typeof options.field === "string" ? options.field : undefined;
|
|
@@ -472,15 +472,17 @@ async function runEventsAction(options, command) {
|
|
|
472
472
|
async function runActivityAction(options, command) {
|
|
473
473
|
const globalOptions = getGlobalOptions(command);
|
|
474
474
|
const startedAt = Date.now();
|
|
475
|
-
if ([options.compact, options.full, options.provenance].filter((value) => value === true).length > 1) {
|
|
476
|
-
throw new PmCliError("Activity projection options are mutually exclusive. Use --compact, --provenance, or --full.", EXIT_CODE.USAGE);
|
|
475
|
+
if ([options.raw, options.compact, options.full, options.provenance].filter((value) => value === true).length > 1) {
|
|
476
|
+
throw new PmCliError("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.", EXIT_CODE.USAGE);
|
|
477
477
|
}
|
|
478
|
-
const normalized = normalizeActivityOptions(options);
|
|
479
|
-
const result = await runActivity(normalized, globalOptions);
|
|
480
478
|
const streamMode = resolveActivityStreamMode(options.stream);
|
|
481
479
|
if (streamMode && !globalOptions.json) {
|
|
482
480
|
throw new PmCliError("--stream requires --json output mode.", EXIT_CODE.USAGE);
|
|
483
481
|
}
|
|
482
|
+
const normalized = normalizeActivityOptions(options);
|
|
483
|
+
const result = await runActivity(streamMode && options.full !== true && options.provenance !== true
|
|
484
|
+
? { ...normalized, raw: true, compact: true }
|
|
485
|
+
: normalized, globalOptions);
|
|
484
486
|
if (streamMode) {
|
|
485
487
|
printActivityJsonStream(result, normalized, globalOptions);
|
|
486
488
|
}
|
|
@@ -795,6 +797,7 @@ export function registerListQueryCommands(program, options) {
|
|
|
795
797
|
.option("--limit <n>", "Return only the latest n activity entries")
|
|
796
798
|
.option("--unbounded", "Explicitly return every matching activity entry (disables the default bound)")
|
|
797
799
|
.option("--compact", "Condensed output: show only id, op, ts, author, msg per entry")
|
|
800
|
+
.option("--raw", "Show the legacy compact per-event stream instead of the item digest")
|
|
798
801
|
.option("--full", "Show full activity entries with JSON Patch payloads")
|
|
799
802
|
.option("--provenance", "Show patch-free author, harness, instance, and extensible provenance")
|
|
800
803
|
.option("--provenance-summary", "Include bounded provenance completeness counts")
|
|
@@ -835,4 +838,4 @@ export const _testOnlyRegisterListQuery = {
|
|
|
835
838
|
parseListFormat,
|
|
836
839
|
};
|
|
837
840
|
//# sourceMappingURL=register-list-query.js.map
|
|
838
|
-
//# debugId=
|
|
841
|
+
//# debugId=0bcbdc33-3145-54cc-b4b6-10df50aef57a
|
|
@@ -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]="7796ea07-0de7-5db8-a3b5-a8021ceebc69")}catch(e){}}();
|
|
3
3
|
import { resolveRuntimeStatusRegistry, setActiveCommandResult, EXIT_CODE, PmCliError, createUnknownSubcommandError, resolveAuthor, resolvePmRoot, readSettings, } from "../sdk/runtime-primitives.js";
|
|
4
4
|
import { resolveStartTaskInProgressStatus } from "../sdk/start-task-status.js";
|
|
5
5
|
import { parseStatsAnalyticsJson } from "./stats-analytics-json.js";
|
|
@@ -54,6 +54,9 @@ function collectTestMutationValues(options) {
|
|
|
54
54
|
removeValues: Array.isArray(options.remove)
|
|
55
55
|
? options.remove
|
|
56
56
|
: [],
|
|
57
|
+
removeIndexValues: Array.isArray(options.removeIndex)
|
|
58
|
+
? options.removeIndex
|
|
59
|
+
: [],
|
|
57
60
|
};
|
|
58
61
|
}
|
|
59
62
|
function validateBackgroundTestOptions(options, values) {
|
|
@@ -65,8 +68,9 @@ function validateBackgroundTestOptions(options, values) {
|
|
|
65
68
|
}
|
|
66
69
|
if (values.addValues.length > 0 ||
|
|
67
70
|
values.addJsonValues.length > 0 ||
|
|
68
|
-
values.removeValues.length > 0
|
|
69
|
-
|
|
71
|
+
values.removeValues.length > 0 ||
|
|
72
|
+
values.removeIndexValues.length > 0) {
|
|
73
|
+
throw new PmCliError("--background does not support --add/--add-json/--remove/--remove-index; update linked tests first, then run in background", EXIT_CODE.USAGE);
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
async function runBackgroundLinkedTests(id, options, globalOptions, values) {
|
|
@@ -77,6 +81,7 @@ async function runBackgroundLinkedTests(id, options, globalOptions, values) {
|
|
|
77
81
|
add: values.addValues,
|
|
78
82
|
addJson: values.addJsonValues,
|
|
79
83
|
remove: values.removeValues,
|
|
84
|
+
removeIndex: values.removeIndexValues,
|
|
80
85
|
}),
|
|
81
86
|
targetId: id,
|
|
82
87
|
author: typeof options.author === "string" ? options.author : undefined,
|
|
@@ -89,6 +94,7 @@ function buildRunTestOptions(options, values) {
|
|
|
89
94
|
add: values.addValues,
|
|
90
95
|
addJson: values.addJsonValues,
|
|
91
96
|
remove: values.removeValues,
|
|
97
|
+
removeIndex: values.removeIndexValues,
|
|
92
98
|
list: Boolean(options.list),
|
|
93
99
|
run: Boolean(options.run),
|
|
94
100
|
match: typeof options.match === "string" ? options.match : undefined,
|
|
@@ -127,7 +133,8 @@ async function runForegroundLinkedTests(id, options, globalOptions, values) {
|
|
|
127
133
|
if (values.addValues.length > 0 ||
|
|
128
134
|
values.addJsonValues.length > 0 ||
|
|
129
135
|
values.removeValues.length > 0 ||
|
|
130
|
-
options.run === true
|
|
136
|
+
options.run === true ||
|
|
137
|
+
values.removeIndexValues.length > 0) {
|
|
131
138
|
await invalidateSearchCachesForMutation(globalOptions, result);
|
|
132
139
|
}
|
|
133
140
|
printResult(result, globalOptions);
|
|
@@ -236,6 +243,7 @@ async function runStatsAction(options, command) {
|
|
|
236
243
|
const startedAt = Date.now();
|
|
237
244
|
const analytics = parseStatsAnalyticsJson(readOptionString(options, "analytics"));
|
|
238
245
|
const result = await runStats(globalOptions, {
|
|
246
|
+
includeEmpty: options.includeEmpty === true,
|
|
239
247
|
storage: options.storage === true,
|
|
240
248
|
metadataCoverage: options.metadataCoverage === true,
|
|
241
249
|
byAssignee: options.byAssignee === true,
|
|
@@ -565,7 +573,8 @@ export function registerOperationCommands(program) {
|
|
|
565
573
|
.argument("<id>", "Item id")
|
|
566
574
|
.option("--add <value>", "Add linked test entry (CSV/markdown pairs or - for stdin)", collect)
|
|
567
575
|
.option("--add-json <value>", "Add linked test entry from JSON object/array (or - for stdin)", collect)
|
|
568
|
-
.option("--remove <value>", "Remove linked test entry by command/path (command=<value
|
|
576
|
+
.option("--remove <value>", "Remove linked test entry by exact command/path (command=<value> and path=<value> preserve commas and equals signs; or - for stdin)", collect)
|
|
577
|
+
.option("--remove-index <n>", "Remove the 1-based linked-test index from --list order (repeatable)", collect)
|
|
569
578
|
.option("--list", "List linked tests without mutating")
|
|
570
579
|
.option("--run", "Run linked test commands")
|
|
571
580
|
.option("--match <value>", "Run only linked tests whose command/path contains this substring")
|
|
@@ -613,6 +622,7 @@ export function registerOperationCommands(program) {
|
|
|
613
622
|
program
|
|
614
623
|
.command("stats")
|
|
615
624
|
.description("Show project tracker statistics.")
|
|
625
|
+
.option("--include-empty", "Restore zero-count registered item-type and lifecycle-status buckets")
|
|
616
626
|
.option("--storage", "Include aggregate history-stream storage metrics (total streams/lines/bytes, largest + deepest streams, oldest/newest entries)")
|
|
617
627
|
.option("--metadata-coverage", "Include metadata coverage % (acceptance_criteria, estimated_minutes, resolution, tags, parent) overall and by type")
|
|
618
628
|
.option("--by-assignee", "Include a lifecycle-bucketed item breakdown grouped by assignee")
|
|
@@ -863,4 +873,4 @@ function registerSchedulingShortcutCommands(program) {
|
|
|
863
873
|
});
|
|
864
874
|
}
|
|
865
875
|
//# sourceMappingURL=register-operations.js.map
|
|
866
|
-
//# debugId=
|
|
876
|
+
//# debugId=7796ea07-0de7-5db8-a3b5-a8021ceebc69
|