@unbrained/pm-cli 2026.8.10 → 2026.8.12
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 +153 -100
- package/dist/cli/commander-usage.js +113 -15
- package/dist/cli/error-guidance.d.ts +12 -0
- package/dist/cli/error-guidance.js +147 -29
- package/dist/cli/main.js +38 -19
- package/dist/cli/register-annotations.js +56 -3
- package/dist/cli/register-assurance.d.ts +8 -0
- package/dist/cli/register-assurance.js +52 -0
- package/dist/cli/register-files-lookup.js +14 -3
- package/dist/cli/register-list-query.js +10 -7
- package/dist/cli/register-mutation.js +30 -9
- package/dist/cli/register-operations.js +30 -15
- package/dist/cli-bundle/bundle-manifest.json +155 -155
- package/dist/cli-bundle/chunks/{chunk-TRWXF476.js → chunk-3PS7X6GS.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7KL6KMWF.js +13 -0
- package/dist/cli-bundle/chunks/{chunk-EBO7OUUE.js → chunk-BM5YJ2UW.js} +69 -55
- package/dist/cli-bundle/chunks/chunk-D55A5AEN.js +33 -0
- package/dist/cli-bundle/chunks/chunk-KIKDWECH.js +196 -0
- package/dist/cli-bundle/chunks/{chunk-ETML5C6H.js → chunk-KOQMGCTA.js} +47 -47
- package/dist/cli-bundle/chunks/chunk-R76342NV.js +2 -0
- package/dist/cli-bundle/chunks/chunk-RBTK5EZV.js +5 -0
- package/dist/cli-bundle/chunks/chunk-VLUQOIDT.js +2 -0
- package/dist/cli-bundle/chunks/chunk-WLAHPSOX.js +3 -0
- package/dist/cli-bundle/chunks/register-list-query-XPCJRUUD.js +10 -0
- package/dist/cli-bundle/chunks/register-mutation-4RJCBKRS.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-2OGISOVR.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-S3KT2LTH.js → register-setup-LLHAKP2V.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2DALMVF7.js +5 -0
- package/dist/cli-bundle/focused-chunks/chunk-5OQIMELN.js +155 -0
- package/dist/cli-bundle/focused-chunks/chunk-5TAGTDRE.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-ECADZMVC.js +18 -0
- package/dist/cli-bundle/focused-chunks/chunk-EJGXRA6B.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-FFGSZCPK.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-IW43E4XL.js → chunk-GQW4BPUT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ISKOBJCM.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-75774JWP.js → chunk-JAFRIWVF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-2COZ67XT.js → chunk-KHM2CS2C.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-M6RPIXKC.js → chunk-KPSXVBDV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-34SX654S.js → chunk-KTLOKKCQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-LGYK3NUF.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-2EXI2DKR.js → chunk-NBLUKITQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-NYLOUPOB.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Q4T463SD.js +31 -0
- package/dist/cli-bundle/focused-chunks/chunk-QVZVY53N.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-DZGAHZZV.js → chunk-RWPAWUOT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-UTEWXDEQ.js +17 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7UN6BHHO.js → chunk-YIAXMC3T.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZMGWAYH7.js +2 -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 +41 -39
- 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/extensions/reserved-host-flags.js +3 -2
- package/dist/core/history/drift-scan.js +13 -8
- 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/output/output.d.ts +2 -0
- package/dist/core/output/output.js +46 -14
- package/dist/core/session/session-state.d.ts +47 -0
- package/dist/core/session/session-state.js +207 -6
- package/dist/core/shared/author.d.ts +7 -1
- package/dist/core/shared/author.js +66 -46
- 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 +13 -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 +14 -7
- package/dist/sdk/agent/refusal-reachability.d.ts +40 -0
- package/dist/sdk/agent/refusal-reachability.js +72 -0
- package/dist/sdk/agent/subcommand-recovery.d.ts +40 -0
- package/dist/sdk/agent/subcommand-recovery.js +84 -0
- package/dist/sdk/cli-bootstrap.d.ts +10 -0
- package/dist/sdk/cli-bootstrap.js +11 -7
- package/dist/sdk/cli-contracts/completeness.js +14 -3
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +3 -2
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +20 -2
- 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/runtime-contracts.js +4 -3
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +515 -0
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +252 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +99 -2
- package/dist/sdk/cli-contracts/tool-schema.d.ts +3 -3
- package/dist/sdk/cli-contracts/tool-schema.js +38 -5
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/cli-program.js +3 -2
- package/dist/sdk/completion.js +23 -8
- package/dist/sdk/config.js +9 -3
- package/dist/sdk/context/semantic-session-attribution.d.ts +32 -0
- package/dist/sdk/context/semantic-session-attribution.js +83 -0
- package/dist/sdk/context-intent-contracts.js +45 -4
- package/dist/sdk/core-governance.d.ts +3 -1
- package/dist/sdk/core-governance.js +5 -3
- package/dist/sdk/core.d.ts +2 -1
- package/dist/sdk/core.js +3 -2
- package/dist/sdk/error-code-catalog.d.ts +13 -0
- package/dist/sdk/error-code-catalog.js +35 -2
- package/dist/sdk/extension.js +18 -17
- package/dist/sdk/files.d.ts +11 -0
- package/dist/sdk/files.js +82 -24
- 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 +1585 -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 -3121
- package/dist/sdk/governance/assurance-action-contracts.d.ts +7 -0
- package/dist/sdk/governance/assurance-action-contracts.js +5 -0
- package/dist/sdk/governance/assurance-action.d.ts +70 -0
- package/dist/sdk/governance/assurance-action.js +200 -0
- package/dist/sdk/governance/assurance-limits.d.ts +7 -0
- package/dist/sdk/governance/assurance-limits.js +11 -0
- package/dist/sdk/governance/assurance-mutation-error.d.ts +7 -0
- package/dist/sdk/governance/assurance-mutation-error.js +35 -0
- package/dist/sdk/governance/assurance-runtime.d.ts +20 -0
- package/dist/sdk/governance/assurance-runtime.js +134 -0
- package/dist/sdk/governance/assurance.d.ts +438 -0
- package/dist/sdk/governance/assurance.js +804 -0
- package/dist/sdk/governance/health.d.ts +3 -1
- package/dist/sdk/governance/health.js +21 -4
- 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 +13 -3
- package/dist/sdk/graph/durable-cache.d.ts +1 -1
- package/dist/sdk/graph/durable-cache.js +98 -29
- package/dist/sdk/graph/governance.d.ts +14 -0
- package/dist/sdk/graph/governance.js +34 -9
- package/dist/sdk/graph/run.js +8 -3
- package/dist/sdk/index.d.ts +7 -2
- package/dist/sdk/index.js +9 -4
- package/dist/sdk/lifecycle/claim.js +26 -4
- package/dist/sdk/lifecycle/focus.js +13 -3
- package/dist/sdk/lifecycle/plan.js +8 -3
- package/dist/sdk/merge/driver.d.ts +2 -2
- package/dist/sdk/merge/driver.js +3 -3
- 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/provenance.d.ts +38 -0
- package/dist/sdk/provenance.js +64 -2
- package/dist/sdk/query/activity.d.ts +49 -2
- package/dist/sdk/query/activity.js +183 -37
- package/dist/sdk/query/context.js +19 -8
- 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/runtime-extended-actions.js +22 -5
- package/dist/sdk/runtime-primitives.d.ts +5 -3
- package/dist/sdk/runtime-primitives.js +7 -5
- package/dist/sdk/runtime-stats-options.js +3 -2
- package/dist/sdk/runtime.d.ts +4 -0
- package/dist/sdk/runtime.js +34 -34
- package/dist/sdk/stats.d.ts +36 -3
- package/dist/sdk/stats.js +55 -15
- package/dist/sdk/telemetry.js +7 -4
- package/dist/sdk/test/execution.d.ts +4 -0
- package/dist/sdk/test/execution.js +86 -21
- package/dist/sdk/traceability/runtime-files-lookup.d.ts +8 -0
- package/dist/sdk/traceability/runtime-files-lookup.js +33 -0
- package/dist/sdk/traceability/source-traceability.d.ts +102 -0
- package/dist/sdk/traceability/source-traceability.js +293 -0
- package/dist/types.d.ts +10 -2
- package/dist/types.js +2 -2
- package/docs/ASSURANCE.md +137 -0
- package/docs/COMMANDS.md +29 -8
- package/docs/CONFIGURATION.md +7 -0
- package/docs/DEPENDENCY_KIND_CONTRACT.md +10 -8
- package/docs/MERGE_SAFETY.md +3 -1
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +26 -13
- package/docs/README.md +3 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +17 -2
- package/docs/RELEASING.md +9 -5
- package/docs/SDK.md +12 -1
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +52 -5
- package/docs/SDK_CONTEXT_EVIDENCE_CONTRACTS.md +53 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +28 -1
- package/docs/SDK_EVIDENCE_TRACEABILITY.md +39 -1
- package/docs/SDK_RUNTIME_BOUNDARIES.md +36 -1
- package/docs/TESTING.md +12 -9
- package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +106 -0
- package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -0
- package/docs/performance/sdk-entrypoint-import-costs.md +6 -2
- package/marketplace.json +2 -2
- package/package.json +7 -7
- 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/extensions/templates/index.ts +9 -3
- 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 +1030 -67
- package/dist/cli-bundle/chunks/chunk-2QYH4QMI.js +0 -30
- package/dist/cli-bundle/chunks/chunk-JUDU4RO4.js +0 -194
- package/dist/cli-bundle/chunks/chunk-JZSNADRR.js +0 -5
- package/dist/cli-bundle/chunks/chunk-MENWVGJW.js +0 -2
- package/dist/cli-bundle/chunks/chunk-S4EITGLA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-TIGKWVLA.js +0 -13
- package/dist/cli-bundle/chunks/chunk-TSLDTJLQ.js +0 -2
- package/dist/cli-bundle/chunks/register-list-query-OJ6ZXKV4.js +0 -10
- package/dist/cli-bundle/chunks/register-mutation-DKI7QC7O.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-P5OGMT6I.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-36FTZ2NT.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3CQECMKR.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-CHIBMEZR.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-FF4MNAYB.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-GHTN2ILR.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-I4YM2I7S.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IMDTEN7K.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-JMVA4HKR.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-KR5RVXLQ.js +0 -31
- package/dist/cli-bundle/focused-chunks/chunk-KSNJG4KI.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-MXYSIQ56.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-RIIN5V4N.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-RKWSCYYN.js +0 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** Compare declared refusal states with real-entrypoint observations. */
|
|
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]="55318c8e-1fbd-5abd-b18f-f0cc1f81dd5c")}catch(e){}}();
|
|
4
|
+
export function verifyPmRefusalReachability(catalog, observations) {
|
|
5
|
+
const declarations = catalog.flatMap((contract) => (contract.owned_states ?? []).map((state) => ({ contract, state })));
|
|
6
|
+
const findings = [];
|
|
7
|
+
const observationsByProbe = new Map();
|
|
8
|
+
for (const observation of observations) {
|
|
9
|
+
if (observationsByProbe.has(observation.probe_id)) {
|
|
10
|
+
findings.push({
|
|
11
|
+
kind: "duplicate_probe",
|
|
12
|
+
probe_id: observation.probe_id,
|
|
13
|
+
detail: `Observation ${observation.probe_id} was supplied more than once.`,
|
|
14
|
+
});
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
observationsByProbe.set(observation.probe_id, observation);
|
|
18
|
+
}
|
|
19
|
+
const declaredProbeIds = new Set(declarations.map(({ state }) => state.probe_id));
|
|
20
|
+
for (const { contract, state } of declarations) {
|
|
21
|
+
const observation = observationsByProbe.get(state.probe_id);
|
|
22
|
+
if (!observation) {
|
|
23
|
+
findings.push({
|
|
24
|
+
kind: "missing_probe",
|
|
25
|
+
probe_id: state.probe_id,
|
|
26
|
+
detail: `No entrypoint observation was recorded for ${contract.code}.`,
|
|
27
|
+
});
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (observation.code !== contract.code) {
|
|
31
|
+
findings.push({
|
|
32
|
+
kind: "wrong_error_code",
|
|
33
|
+
probe_id: state.probe_id,
|
|
34
|
+
detail: `Expected ${contract.code}; observed ${observation.code}.`,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (observation.exit_class !== state.expected_exit_class) {
|
|
38
|
+
findings.push({
|
|
39
|
+
kind: "wrong_exit_class",
|
|
40
|
+
probe_id: state.probe_id,
|
|
41
|
+
detail: `Expected ${state.expected_exit_class}; observed ${observation.exit_class}.`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (!state.entrypoints.includes(observation.entrypoint)) {
|
|
45
|
+
findings.push({
|
|
46
|
+
kind: "wrong_entrypoint",
|
|
47
|
+
probe_id: state.probe_id,
|
|
48
|
+
detail: `Expected one of ${state.entrypoints.join(", ")}; observed ${observation.entrypoint}.`,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
for (const observation of observations) {
|
|
53
|
+
if (!declaredProbeIds.has(observation.probe_id)) {
|
|
54
|
+
findings.push({
|
|
55
|
+
kind: "undeclared_probe",
|
|
56
|
+
probe_id: observation.probe_id,
|
|
57
|
+
detail: `Observation ${observation.probe_id} has no catalog declaration.`,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
findings.sort((left, right) => left.probe_id !== right.probe_id
|
|
62
|
+
? left.probe_id.localeCompare(right.probe_id)
|
|
63
|
+
: left.kind.localeCompare(right.kind));
|
|
64
|
+
return {
|
|
65
|
+
ok: findings.length === 0,
|
|
66
|
+
declared_probe_count: declarations.length,
|
|
67
|
+
observed_probe_count: observations.length,
|
|
68
|
+
findings,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=refusal-reachability.js.map
|
|
72
|
+
//# debugId=55318c8e-1fbd-5abd-b18f-f0cc1f81dd5c
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PmCliError, type PmCliErrorRecoveryPayload } from "../../core/shared/errors.js";
|
|
2
|
+
/** Catalog-only alias retained for consumers of the former package lifecycle code. */
|
|
3
|
+
export declare const UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES: readonly [{
|
|
4
|
+
readonly code: "unknown_lifecycle_action";
|
|
5
|
+
}];
|
|
6
|
+
/** Inputs for constructing a portable unknown-subcommand refusal. */
|
|
7
|
+
export interface UnknownSubcommandErrorOptions {
|
|
8
|
+
/** Command family path without the rejected token. */
|
|
9
|
+
command_path: string;
|
|
10
|
+
/** Rejected positional token. */
|
|
11
|
+
token: string;
|
|
12
|
+
/** Complete declared subcommand vocabulary for the family. */
|
|
13
|
+
allowed: readonly string[];
|
|
14
|
+
/** Human-readable command family, defaulting to `pm <command_path>`. */
|
|
15
|
+
display_name?: string;
|
|
16
|
+
/** Positional token role used in the compatibility message. */
|
|
17
|
+
token_kind?: "subcommand" | "action" | "path";
|
|
18
|
+
/** Arguments that follow the rejected token and should survive a retry. */
|
|
19
|
+
trailing_args?: readonly string[];
|
|
20
|
+
/** Family-aware retry that takes precedence over edit-distance recovery. */
|
|
21
|
+
retry_command?: string;
|
|
22
|
+
/** Compatibility suffix appended after the allowed-value sentence. */
|
|
23
|
+
message_suffix?: string;
|
|
24
|
+
/** Additional ranked recovery candidates supplied by the command family. */
|
|
25
|
+
fallback_candidates?: PmCliErrorRecoveryPayload["fallback_candidates"];
|
|
26
|
+
/** Transport exit used by non-CLI protocol adapters. */
|
|
27
|
+
exit_code?: number;
|
|
28
|
+
/** Additional family-specific examples. */
|
|
29
|
+
examples?: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
declare function nearestSubcommand(token: string, allowed: readonly string[]): string | undefined;
|
|
32
|
+
declare function renderCommand(tokens: readonly string[]): string;
|
|
33
|
+
/** Build the shared typed refusal used by CLI, SDK, MCP, and packages. */
|
|
34
|
+
export declare function createUnknownSubcommandError(options: UnknownSubcommandErrorOptions): PmCliError;
|
|
35
|
+
/** Test-only access to deterministic nearest-match behavior. */
|
|
36
|
+
export declare const _testOnly: {
|
|
37
|
+
nearestSubcommand: typeof nearestSubcommand;
|
|
38
|
+
renderCommand: typeof renderCommand;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/agent/subcommand-recovery
|
|
3
|
+
*
|
|
4
|
+
* Provides one SDK-owned refusal contract for unknown positional subcommands.
|
|
5
|
+
*/
|
|
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]="a9b23a46-0bba-5174-8793-dfc37016d1fb")}catch(e){}}();
|
|
8
|
+
import { levenshteinDistanceWithinLimit } from "../../core/shared/levenshtein.js";
|
|
9
|
+
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
10
|
+
import { PmCliError, } from "../../core/shared/errors.js";
|
|
11
|
+
/** Catalog-only alias retained for consumers of the former package lifecycle code. */
|
|
12
|
+
export const UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES = [
|
|
13
|
+
{ code: "unknown_lifecycle_action" },
|
|
14
|
+
];
|
|
15
|
+
function nearestSubcommand(token, allowed) {
|
|
16
|
+
const normalized = token.trim().toLowerCase();
|
|
17
|
+
if (normalized.length === 0)
|
|
18
|
+
return undefined;
|
|
19
|
+
const maxDistance = Math.floor(normalized.length / 3);
|
|
20
|
+
return allowed
|
|
21
|
+
.map((candidate) => ({
|
|
22
|
+
candidate,
|
|
23
|
+
distance: levenshteinDistanceWithinLimit(normalized, candidate.toLowerCase(), maxDistance) ?? Number.POSITIVE_INFINITY,
|
|
24
|
+
}))
|
|
25
|
+
.filter(({ distance }) => Number.isFinite(distance))
|
|
26
|
+
.sort((left, right) => left.distance !== right.distance
|
|
27
|
+
? left.distance - right.distance
|
|
28
|
+
: left.candidate.localeCompare(right.candidate))[0]?.candidate;
|
|
29
|
+
}
|
|
30
|
+
function renderCommand(tokens) {
|
|
31
|
+
return ["pm", ...tokens]
|
|
32
|
+
.map((token) => /^[A-Za-z0-9_./:@=-]+$/u.test(token) ? token : JSON.stringify(token))
|
|
33
|
+
.join(" ");
|
|
34
|
+
}
|
|
35
|
+
/** Build the shared typed refusal used by CLI, SDK, MCP, and packages. */
|
|
36
|
+
export function createUnknownSubcommandError(options) {
|
|
37
|
+
const commandPath = options.command_path.trim().replaceAll(/\s+/gu, " ");
|
|
38
|
+
const normalizedToken = options.token.trim();
|
|
39
|
+
const token = normalizedToken.length === 0 ? "<empty>" : normalizedToken;
|
|
40
|
+
const allowed = [...new Set(options.allowed.map((value) => value.trim()))]
|
|
41
|
+
.filter(Boolean)
|
|
42
|
+
.sort((left, right) => left.localeCompare(right));
|
|
43
|
+
if (commandPath.length === 0 || token.length === 0 || allowed.length === 0) {
|
|
44
|
+
throw new TypeError("Unknown-subcommand contracts require a path, token, and allowed set");
|
|
45
|
+
}
|
|
46
|
+
const commandTokens = commandPath.split(" ");
|
|
47
|
+
const trailingArgs = options.trailing_args ?? [];
|
|
48
|
+
const displayName = options.display_name ?? `pm ${commandPath}`;
|
|
49
|
+
const tokenKind = options.token_kind ?? "subcommand";
|
|
50
|
+
const nearest = options.retry_command
|
|
51
|
+
? undefined
|
|
52
|
+
: nearestSubcommand(token, allowed);
|
|
53
|
+
const attemptedCommand = renderCommand([
|
|
54
|
+
...commandTokens,
|
|
55
|
+
token,
|
|
56
|
+
...trailingArgs,
|
|
57
|
+
]);
|
|
58
|
+
const suggestedRetry = options.retry_command ??
|
|
59
|
+
(nearest
|
|
60
|
+
? renderCommand([...commandTokens, nearest, ...trailingArgs])
|
|
61
|
+
: undefined);
|
|
62
|
+
return new PmCliError(`Unknown ${displayName} ${tokenKind} "${token}". Allowed: ${allowed.join(", ")}${options.message_suffix ?? ""}`, options.exit_code ?? EXIT_CODE.USAGE, {
|
|
63
|
+
code: "unknown_subcommand",
|
|
64
|
+
reason: "unknown_positional_token",
|
|
65
|
+
examples: [
|
|
66
|
+
...(suggestedRetry ? [suggestedRetry] : []),
|
|
67
|
+
...(options.examples ?? []),
|
|
68
|
+
`pm ${commandPath} --help`,
|
|
69
|
+
],
|
|
70
|
+
nextSteps: suggestedRetry
|
|
71
|
+
? [`Retry with the suggested command: ${suggestedRetry}`]
|
|
72
|
+
: ["Choose one value from recovery.allowed_values."],
|
|
73
|
+
recovery: {
|
|
74
|
+
attempted_command: attemptedCommand,
|
|
75
|
+
allowed_values: allowed,
|
|
76
|
+
suggested_retry: suggestedRetry,
|
|
77
|
+
fallback_candidates: options.fallback_candidates,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** Test-only access to deterministic nearest-match behavior. */
|
|
82
|
+
export const _testOnly = { nearestSubcommand, renderCommand };
|
|
83
|
+
//# sourceMappingURL=subcommand-recovery.js.map
|
|
84
|
+
//# debugId=a9b23a46-0bba-5174-8793-dfc37016d1fb
|
|
@@ -31,6 +31,8 @@ export interface BootstrapGlobalOptions {
|
|
|
31
31
|
outputFormat?: "toon" | "json";
|
|
32
32
|
/** Caller-carried cross-call budget and served-item state. */
|
|
33
33
|
outputSession?: string;
|
|
34
|
+
/** Whether machine-readable row discovery metadata is requested. */
|
|
35
|
+
outputRowContract?: boolean;
|
|
34
36
|
/** Invocation-wide mutation author override. */
|
|
35
37
|
author?: string;
|
|
36
38
|
/** Whether `--author` was present without its required value. */
|
|
@@ -49,6 +51,14 @@ export interface BootstrapHelpRequest {
|
|
|
49
51
|
}
|
|
50
52
|
/** Implements parse bootstrap help request for the public runtime surface of this module. */
|
|
51
53
|
export declare function parseBootstrapHelpRequest(argv: string[]): BootstrapHelpRequest;
|
|
54
|
+
/**
|
|
55
|
+
* Index of the command token in argv — the first non-flag token, skipping the
|
|
56
|
+
* value-consuming/global bootstrap flags. Returns undefined when there is none
|
|
57
|
+
* (bare invocation, only global flags, or a leading `--`). Single source of truth
|
|
58
|
+
* for command-position scanning shared by {@link parseBootstrapCommandName} and the
|
|
59
|
+
* command-alias rewrite so their precedence rules can never drift apart.
|
|
60
|
+
*/
|
|
61
|
+
export declare function findBootstrapCommandTokenIndex(argv: string[]): number | undefined;
|
|
52
62
|
/** Implements parse bootstrap command name for the public runtime surface of this module. */
|
|
53
63
|
export declare function parseBootstrapCommandName(argv: string[]): string | undefined;
|
|
54
64
|
/** Implements apply bootstrap pager policy for the public runtime surface of this module. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides public bootstrap argument normalization for embedded CLI hosts.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
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]="7b3209a8-8580-542c-9e80-21d04df3f61f")}catch(e){}}();
|
|
8
8
|
import { EXECUTABLE_COMMAND_ALIASES, resolveSubcommandFlagContractsForCommand, } from "./cli-contracts.js";
|
|
9
9
|
export { EXECUTABLE_COMMAND_ALIASES };
|
|
10
10
|
import { levenshteinDistanceWithinLimit } from "../core/shared/levenshtein.js";
|
|
@@ -47,6 +47,7 @@ const BOOTSTRAP_BOOLEAN_FLAGS = new Set([
|
|
|
47
47
|
"--quiet",
|
|
48
48
|
"--lean",
|
|
49
49
|
"--token-accounting",
|
|
50
|
+
"--output-row-contract",
|
|
50
51
|
]);
|
|
51
52
|
/** Consume one bootstrap-global token and update the accumulated parse state. */
|
|
52
53
|
function consumeBootstrapGlobalToken(argv, index, state) {
|
|
@@ -95,6 +96,9 @@ export function parseBootstrapGlobalOptions(argv) {
|
|
|
95
96
|
quiet: state.booleanFlags.has("--quiet"),
|
|
96
97
|
lean: state.booleanFlags.has("--lean"),
|
|
97
98
|
tokenAccounting: state.booleanFlags.has("--token-accounting"),
|
|
99
|
+
...(state.booleanFlags.has("--output-row-contract")
|
|
100
|
+
? { outputRowContract: true }
|
|
101
|
+
: {}),
|
|
98
102
|
...(state.outputValues.get("--output-include") === undefined
|
|
99
103
|
? {}
|
|
100
104
|
: { outputInclude: state.outputValues.get("--output-include") }),
|
|
@@ -194,7 +198,7 @@ export function parseBootstrapHelpRequest(argv) {
|
|
|
194
198
|
* for command-position scanning shared by {@link parseBootstrapCommandName} and the
|
|
195
199
|
* command-alias rewrite so their precedence rules can never drift apart.
|
|
196
200
|
*/
|
|
197
|
-
function
|
|
201
|
+
export function findBootstrapCommandTokenIndex(argv) {
|
|
198
202
|
for (let index = 0; index < argv.length; index += 1) {
|
|
199
203
|
const token = argv[index];
|
|
200
204
|
if (token === "--") {
|
|
@@ -220,7 +224,7 @@ function findCommandTokenIndex(argv) {
|
|
|
220
224
|
}
|
|
221
225
|
/** Implements parse bootstrap command name for the public runtime surface of this module. */
|
|
222
226
|
export function parseBootstrapCommandName(argv) {
|
|
223
|
-
const index =
|
|
227
|
+
const index = findBootstrapCommandTokenIndex(argv);
|
|
224
228
|
return index === undefined ? undefined : argv[index].trim().toLowerCase();
|
|
225
229
|
}
|
|
226
230
|
function shouldDisablePagerForInvocation(argv, bootstrapGlobal) {
|
|
@@ -279,7 +283,7 @@ const EXTENSION_ACTION_SYNTAX_TOKENS = new Set([
|
|
|
279
283
|
]);
|
|
280
284
|
/** Implements normalize legacy extension action syntax for the public runtime surface of this module. */
|
|
281
285
|
export function normalizeLegacyExtensionActionSyntax(argv) {
|
|
282
|
-
const extensionIndex =
|
|
286
|
+
const extensionIndex = findBootstrapCommandTokenIndex(argv);
|
|
283
287
|
if (extensionIndex === undefined || argv[extensionIndex] !== "extension") {
|
|
284
288
|
return [...argv];
|
|
285
289
|
}
|
|
@@ -310,7 +314,7 @@ const CLI_EXECUTABLE_ALIASES = new Set(["pm", "pm-cli"]);
|
|
|
310
314
|
* `bunx <package> pm-cli init` behave like direct executable invocations.
|
|
311
315
|
*/
|
|
312
316
|
function stripLeadingExecutableAlias(argv, trace) {
|
|
313
|
-
const index =
|
|
317
|
+
const index = findBootstrapCommandTokenIndex(argv);
|
|
314
318
|
if (index === undefined) {
|
|
315
319
|
return argv;
|
|
316
320
|
}
|
|
@@ -334,7 +338,7 @@ function stripLeadingExecutableAlias(argv, trace) {
|
|
|
334
338
|
* value-consuming global flag, mirroring {@link parseBootstrapCommandName}.
|
|
335
339
|
*/
|
|
336
340
|
function rewriteCommandAlias(argv, trace) {
|
|
337
|
-
const index =
|
|
341
|
+
const index = findBootstrapCommandTokenIndex(argv);
|
|
338
342
|
if (index === undefined) {
|
|
339
343
|
return argv;
|
|
340
344
|
}
|
|
@@ -886,4 +890,4 @@ export const _testOnly = {
|
|
|
886
890
|
resolveCanonicalFlag,
|
|
887
891
|
};
|
|
888
892
|
//# sourceMappingURL=cli-bootstrap.js.map
|
|
889
|
-
//# debugId=
|
|
893
|
+
//# debugId=7b3209a8-8580-542c-9e80-21d04df3f61f
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* a hand-picked test list.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
10
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="13847453-3016-5855-a816-2cadc2ca4870")}catch(e){}}();
|
|
11
11
|
import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
|
|
12
12
|
import { resolveSubcommandFlagContractsForCommand, } from "./flag-contracts.js";
|
|
13
13
|
import { pmToolActionParameterKeys } from "./tool-schema.js";
|
|
@@ -23,6 +23,7 @@ const CLI_TRANSPORT_FLAGS = new Set([
|
|
|
23
23
|
"--output-budget",
|
|
24
24
|
"--output-format",
|
|
25
25
|
"--output-session",
|
|
26
|
+
"--output-row-contract",
|
|
26
27
|
"--no-changed-fields",
|
|
27
28
|
"--no-extensions",
|
|
28
29
|
"--no-pager",
|
|
@@ -76,6 +77,11 @@ const CLI_POSITIONAL_PARAMETERS = new Set([
|
|
|
76
77
|
"text",
|
|
77
78
|
]);
|
|
78
79
|
const ACTION_POSITIONAL_PARAMETERS = {
|
|
80
|
+
assurance: {
|
|
81
|
+
id: "<id>",
|
|
82
|
+
kind: "<kind>",
|
|
83
|
+
subcommand: "<action>",
|
|
84
|
+
},
|
|
79
85
|
event: { title: "<title>" },
|
|
80
86
|
files: { lookupPath: "lookup <path...>" },
|
|
81
87
|
meet: { title: "<title>" },
|
|
@@ -89,6 +95,7 @@ const ACTION_POSITIONAL_PARAMETERS = {
|
|
|
89
95
|
},
|
|
90
96
|
};
|
|
91
97
|
const ACTION_FLAG_PARAMETER_OVERRIDES = {
|
|
98
|
+
assurance: { "--tree": "treeId" },
|
|
92
99
|
init: {
|
|
93
100
|
"--id-prefix": "idPrefix",
|
|
94
101
|
"--no-merge-fence": "mergeFence",
|
|
@@ -143,6 +150,9 @@ const ACTION_FLAG_PARAMETER_OVERRIDES = {
|
|
|
143
150
|
package: { "--gh": "github", "--scaffold": "init" },
|
|
144
151
|
install: { "--gh": "github" },
|
|
145
152
|
};
|
|
153
|
+
const GLOBAL_FLAG_PARAMETER_OVERRIDES = {
|
|
154
|
+
"--pm-path": "path",
|
|
155
|
+
};
|
|
146
156
|
const ACTION_STRUCTURED_FLAG_PARAMETERS = {
|
|
147
157
|
stats: {
|
|
148
158
|
"--analytics": [
|
|
@@ -174,7 +184,8 @@ function actionCommand(action) {
|
|
|
174
184
|
return action;
|
|
175
185
|
}
|
|
176
186
|
function parameterForFlag(action, flag) {
|
|
177
|
-
const override = ACTION_FLAG_PARAMETER_OVERRIDES[action]?.[flag]
|
|
187
|
+
const override = ACTION_FLAG_PARAMETER_OVERRIDES[action]?.[flag] ??
|
|
188
|
+
GLOBAL_FLAG_PARAMETER_OVERRIDES[flag];
|
|
178
189
|
if (override !== undefined)
|
|
179
190
|
return override;
|
|
180
191
|
return flag
|
|
@@ -366,4 +377,4 @@ export function analyzeSdkCliParameterCompleteness(source = {}) {
|
|
|
366
377
|
});
|
|
367
378
|
}
|
|
368
379
|
//# sourceMappingURL=completeness.js.map
|
|
369
|
-
//# debugId=
|
|
380
|
+
//# debugId=13847453-3016-5855-a816-2cadc2ca4870
|
|
@@ -23,7 +23,7 @@ export declare const PM_EXTENSION_POLICY_SURFACE_CONTRACTS: readonly ["commands.
|
|
|
23
23
|
/** Restricts pm extension policy surface contract values accepted by command, SDK, and storage contracts. */
|
|
24
24
|
export type PmExtensionPolicySurfaceContract = (typeof PM_EXTENSION_POLICY_SURFACE_CONTRACTS)[number];
|
|
25
25
|
/** Public contract for pm core command names, shared by SDK and presentation-layer consumers. */
|
|
26
|
-
export declare const PM_CORE_COMMAND_NAMES: readonly ["init", "config", "extension", "package", "packages", "install", "upgrade", "create", "item", "copy", "focus", "list", "list-all", "list-draft", "list-open", "list-in-progress", "list-blocked", "list-closed", "list-canceled", "aggregate", "context", "ctx", "get", "graph", "search", "duplicates", "eval", "next", "history", "events", "history-redact", "history-repair", "history-compact", "history-author-acknowledge", "merge", "schema", "profile", "activity", "restore", "update", "update-many", "close", "close-many", "delete", "append", "comments", "notes", "learnings", "files", "docs", "deps", "plan", "test", "test-all", "telemetry", "stats", "health", "validate", "gc", "workspace", "contracts", "claim", "release", "start-task", "pause-task", "close-task", "meet", "event", "remind", "help"];
|
|
26
|
+
export declare const PM_CORE_COMMAND_NAMES: readonly ["init", "config", "extension", "package", "packages", "install", "upgrade", "create", "item", "copy", "focus", "list", "list-all", "list-draft", "list-open", "list-in-progress", "list-blocked", "list-closed", "list-canceled", "aggregate", "context", "ctx", "get", "graph", "search", "duplicates", "eval", "next", "history", "events", "history-redact", "history-repair", "history-compact", "history-author-acknowledge", "merge", "schema", "profile", "activity", "restore", "update", "update-many", "close", "close-many", "delete", "append", "comments", "notes", "learnings", "files", "docs", "deps", "plan", "test", "test-all", "telemetry", "stats", "health", "validate", "assurance", "gc", "workspace", "contracts", "claim", "release", "start-task", "pause-task", "close-task", "meet", "event", "remind", "help"];
|
|
27
27
|
/** Supported values accepted by the graph subcommand contract across CLI, SDK, and MCP surfaces. */
|
|
28
28
|
export declare const GRAPH_SUBCOMMAND_VALUES: readonly ["ancestors", "descendants", "predecessors", "successors", "paths", "impact", "analyze", "audit", "communities", "redundancy", "dominators", "slack", "centrality", "articulation", "plan", "index"];
|
|
29
29
|
/** Restricts graph subcommand values accepted by command, SDK, and MCP contracts. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines SDK command-contract metadata for Enum Contracts.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="818ca284-2aaa-5d35-b280-8c963d443b0c")}catch(e){}}();
|
|
8
8
|
import { KNOWN_EXTENSION_CAPABILITIES, KNOWN_EXTENSION_POLICY_MODES, KNOWN_EXTENSION_POLICY_SURFACES, KNOWN_EXTENSION_SANDBOX_PROFILES, KNOWN_EXTENSION_SERVICE_NAMES, KNOWN_EXTENSION_TRUST_MODES, } from "../../core/extensions/extension-types.js";
|
|
9
9
|
/** Public contract for pm extension capability contracts, shared by SDK and presentation-layer consumers. */
|
|
10
10
|
export const PM_EXTENSION_CAPABILITY_CONTRACTS = [
|
|
@@ -90,6 +90,7 @@ export const PM_CORE_COMMAND_NAMES = [
|
|
|
90
90
|
"stats",
|
|
91
91
|
"health",
|
|
92
92
|
"validate",
|
|
93
|
+
"assurance",
|
|
93
94
|
"gc",
|
|
94
95
|
"workspace",
|
|
95
96
|
"contracts",
|
|
@@ -190,4 +191,4 @@ export function isPmExtensionPolicySurfaceContract(value) {
|
|
|
190
191
|
return PM_EXTENSION_POLICY_SURFACE_CONTRACTS.includes(value);
|
|
191
192
|
}
|
|
192
193
|
//# sourceMappingURL=enum-contracts.js.map
|
|
193
|
-
//# debugId=
|
|
194
|
+
//# debugId=818ca284-2aaa-5d35-b280-8c963d443b0c
|
|
@@ -168,6 +168,8 @@ export declare const DUPLICATES_FLAG_CONTRACTS: CliFlagContract[];
|
|
|
168
168
|
export declare const HEALTH_FLAG_CONTRACTS: CliFlagContract[];
|
|
169
169
|
/** Public contract for validate flag contracts, shared by SDK and presentation-layer consumers. */
|
|
170
170
|
export declare const VALIDATE_FLAG_CONTRACTS: CliFlagContract[];
|
|
171
|
+
/** Public assurance registry and gate-evaluation flag contracts. */
|
|
172
|
+
export declare const ASSURANCE_FLAG_CONTRACTS: CliFlagContract[];
|
|
171
173
|
/** Creates flag contracts using the validated operation inputs. */
|
|
172
174
|
export declare const CREATE_FLAG_CONTRACTS: CliFlagContract[];
|
|
173
175
|
/** Atomic item-batch flags shared by contracts, help, and completions. */
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* flag surface stays single-sourced across the CLI, SDK, and MCP boundaries.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
10
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="40309a44-7d45-5333-9003-6fc740e827c8")}catch(e){}}();
|
|
11
11
|
import { normalizeUniqueStringList } from "./string-lists.js";
|
|
12
12
|
import { RESERVED_EXTENSION_HOST_FLAGS } from "../../core/extensions/reserved-host-flags.js";
|
|
13
13
|
function normalizeFlagAliasKey(flag) {
|
|
@@ -279,6 +279,9 @@ export const FILES_FLAG_CONTRACTS = [
|
|
|
279
279
|
{ flag: "--offset" },
|
|
280
280
|
{ flag: "--no-truncate" },
|
|
281
281
|
{ flag: "--strict-read" },
|
|
282
|
+
{ flag: "--explain" },
|
|
283
|
+
{ flag: "--lines", value_name: "start:end" },
|
|
284
|
+
{ flag: "--decision-depth", value_name: "n", value_type: "number" },
|
|
282
285
|
{ flag: "--author" },
|
|
283
286
|
{ flag: "--message" },
|
|
284
287
|
{ flag: "--force" },
|
|
@@ -872,6 +875,7 @@ export const TEST_FLAG_CONTRACTS = [
|
|
|
872
875
|
{ flag: "--add" },
|
|
873
876
|
{ flag: "--add-json" },
|
|
874
877
|
{ flag: "--remove" },
|
|
878
|
+
{ flag: "--remove-index", repeatable: true },
|
|
875
879
|
{ flag: "--run" },
|
|
876
880
|
{ flag: "--match" },
|
|
877
881
|
{ flag: "--only-index" },
|
|
@@ -937,6 +941,7 @@ export const GC_FLAG_CONTRACTS = [
|
|
|
937
941
|
];
|
|
938
942
|
/** Public contract for stats flag contracts, shared by SDK and presentation-layer consumers. */
|
|
939
943
|
export const STATS_FLAG_CONTRACTS = [
|
|
944
|
+
{ flag: "--include-empty" },
|
|
940
945
|
{ flag: "--storage" },
|
|
941
946
|
{ flag: "--metadata-coverage" },
|
|
942
947
|
{ flag: "--field-utilization" },
|
|
@@ -1003,6 +1008,17 @@ export const VALIDATE_FLAG_CONTRACTS = [
|
|
|
1003
1008
|
{ flag: "--counts" },
|
|
1004
1009
|
{ flag: "--full" },
|
|
1005
1010
|
];
|
|
1011
|
+
/** Public assurance registry and gate-evaluation flag contracts. */
|
|
1012
|
+
export const ASSURANCE_FLAG_CONTRACTS = [
|
|
1013
|
+
{ flag: "--definition", value_name: "json" },
|
|
1014
|
+
{ flag: "--trigger", value_name: "value" },
|
|
1015
|
+
{ flag: "--tree", value_name: "value" },
|
|
1016
|
+
{ flag: "--gate", value_name: "id" },
|
|
1017
|
+
{ flag: "--limit", value_name: "number" },
|
|
1018
|
+
{ flag: "--dry-run" },
|
|
1019
|
+
{ flag: "--author", value_name: "value" },
|
|
1020
|
+
{ flag: "--message", value_name: "value" },
|
|
1021
|
+
];
|
|
1006
1022
|
const ITEM_OWNERSHIP_AND_ISSUE_FLAG_CONTRACTS = [
|
|
1007
1023
|
{ flag: "--assignee" },
|
|
1008
1024
|
{ flag: "--parent" },
|
|
@@ -1377,6 +1393,7 @@ export const ACTIVITY_FLAG_CONTRACTS = [
|
|
|
1377
1393
|
{ flag: "--limit" },
|
|
1378
1394
|
{ flag: "--unbounded" },
|
|
1379
1395
|
{ flag: "--compact" },
|
|
1396
|
+
{ flag: "--raw" },
|
|
1380
1397
|
{ flag: "--full" },
|
|
1381
1398
|
{ flag: "--provenance" },
|
|
1382
1399
|
{ flag: "--provenance-summary" },
|
|
@@ -1694,6 +1711,7 @@ const SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND = new Map([
|
|
|
1694
1711
|
["test-all", TEST_ALL_FLAG_CONTRACTS],
|
|
1695
1712
|
["telemetry", TELEMETRY_FLAG_CONTRACTS],
|
|
1696
1713
|
["health", HEALTH_FLAG_CONTRACTS],
|
|
1714
|
+
["assurance", ASSURANCE_FLAG_CONTRACTS],
|
|
1697
1715
|
["validate", VALIDATE_FLAG_CONTRACTS],
|
|
1698
1716
|
["gc", GC_FLAG_CONTRACTS],
|
|
1699
1717
|
["stats", STATS_FLAG_CONTRACTS],
|
|
@@ -1796,4 +1814,4 @@ export function toCompletionFlagString(flagContracts, includeGlobal = true) {
|
|
|
1796
1814
|
return normalizeUniqueStringList(all).join(" ");
|
|
1797
1815
|
}
|
|
1798
1816
|
//# sourceMappingURL=flag-contracts.js.map
|
|
1799
|
-
//# debugId=
|
|
1817
|
+
//# debugId=40309a44-7d45-5333-9003-6fc740e827c8
|
|
@@ -70,22 +70,39 @@ export declare function printActivityJsonStream(result: ActivityCommandResult, o
|
|
|
70
70
|
export declare function normalizeSearchOptions(options: Record<string, unknown>): Record<string, unknown>;
|
|
71
71
|
/** Implements normalize search keywords input for the public runtime surface of this module. */
|
|
72
72
|
export declare function normalizeSearchKeywordsInput(keywords: string[]): string;
|
|
73
|
-
/**
|
|
74
|
-
export
|
|
73
|
+
/** Canonical Commander-normalized activity query options. */
|
|
74
|
+
export interface NormalizedActivityOptions {
|
|
75
|
+
/** Exact item identifier filter. */
|
|
75
76
|
id?: string;
|
|
77
|
+
/** Exact immutable history operation filter. */
|
|
76
78
|
op?: string;
|
|
79
|
+
/** Exact recorded author filter. */
|
|
77
80
|
author?: string;
|
|
81
|
+
/** Inclusive activity window lower bound. */
|
|
78
82
|
from?: string;
|
|
83
|
+
/** Inclusive activity window upper bound. */
|
|
79
84
|
to?: string;
|
|
85
|
+
/** Maximum projected row count encoded as Commander text. */
|
|
80
86
|
limit?: string;
|
|
87
|
+
/** Select the compact raw-event projection. */
|
|
81
88
|
compact?: boolean;
|
|
89
|
+
/** Select a raw event projection instead of the item digest. */
|
|
90
|
+
raw?: boolean;
|
|
91
|
+
/** Disable the default projection row bound. */
|
|
82
92
|
unbounded?: boolean;
|
|
93
|
+
/** Select privacy-safe provenance event rows. */
|
|
83
94
|
provenance?: boolean;
|
|
95
|
+
/** Include constant-size provenance completeness metrics. */
|
|
84
96
|
provenanceSummary?: boolean;
|
|
97
|
+
/** Canonical harness filters supplied by Commander. */
|
|
85
98
|
harness?: string[];
|
|
99
|
+
/** Privacy-safe agent invocation fingerprint filters. */
|
|
86
100
|
agentInstance?: string[];
|
|
101
|
+
/** Exact provenance dimension predicates. */
|
|
87
102
|
provenanceFilter?: string[];
|
|
88
|
-
}
|
|
103
|
+
}
|
|
104
|
+
/** Implements normalize activity options for the public runtime surface of this module. */
|
|
105
|
+
export declare function normalizeActivityOptions(options: Record<string, unknown>): NormalizedActivityOptions;
|
|
89
106
|
/** Implements resolve activity stream mode for the public runtime surface of this module. */
|
|
90
107
|
export declare function resolveActivityStreamMode(raw: unknown): boolean;
|
|
91
108
|
/** Implements normalize context options for the public runtime surface of this module. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides CLI runtime support for Registration Helpers.
|
|
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]="daefefd1-3b0b-513d-8b8c-ab17f90b995a")}catch(e){}}();
|
|
8
8
|
import { Option } from "commander";
|
|
9
9
|
import { pathExists, refreshSearchArtifactsForMutation, shouldRunSearchRefreshInForeground, EXIT_CODE, PmCliError, printError, printResult, writeStdout, getSettingsPath, resolvePmRoot, readSettings, runActiveServiceOverride, setActiveCommandResult, } from "../runtime-primitives.js";
|
|
10
10
|
import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, readFirstValueFromCommanderOptions, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "../cli-contracts.js";
|
|
@@ -100,7 +100,7 @@ export function getGlobalOptions(command) {
|
|
|
100
100
|
: typeof reader.opts === "function"
|
|
101
101
|
? reader.opts()
|
|
102
102
|
: {};
|
|
103
|
-
|
|
103
|
+
const normalized = {
|
|
104
104
|
json: opts.json === true ? true : undefined,
|
|
105
105
|
quiet: Boolean(opts.quiet),
|
|
106
106
|
noChangedFields: opts.changedFields === false,
|
|
@@ -112,20 +112,19 @@ export function getGlobalOptions(command) {
|
|
|
112
112
|
outputLimit: readStringCommandOption(opts, "outputLimit"),
|
|
113
113
|
outputBudget: readStringCommandOption(opts, "outputBudget"),
|
|
114
114
|
outputSession: readStringCommandOption(opts, "outputSession"),
|
|
115
|
+
...(opts.outputRowContract === true ? { outputRowContract: true } : {}),
|
|
115
116
|
...(opts.outputFormat === "toon" || opts.outputFormat === "json"
|
|
116
117
|
? { outputFormat: opts.outputFormat }
|
|
117
118
|
: {}),
|
|
118
|
-
path:
|
|
119
|
-
|
|
120
|
-
: typeof opts.path === "string"
|
|
121
|
-
? opts.path
|
|
122
|
-
: undefined,
|
|
119
|
+
path: readStringCommandOption(opts, "pmPath") ??
|
|
120
|
+
readStringCommandOption(opts, "path"),
|
|
123
121
|
noExtensions: opts.extensions === false,
|
|
124
122
|
noPager: Boolean(opts.noPager),
|
|
125
123
|
profile: Boolean(opts.profile),
|
|
126
124
|
...(commandPath.length > 0 ? { command: commandPath } : {}),
|
|
127
125
|
...(typeof opts.author === "string" ? { author: opts.author } : {}),
|
|
128
126
|
};
|
|
127
|
+
return normalized;
|
|
129
128
|
}
|
|
130
129
|
/** Implements get command path for the public runtime surface of this module. */
|
|
131
130
|
export function getCommandPath(command) {
|
|
@@ -239,6 +238,7 @@ export function buildBackgroundTestCommandArgs(id, options) {
|
|
|
239
238
|
pushRepeatableValueFlag(args, "--add", options.add);
|
|
240
239
|
pushRepeatableValueFlag(args, "--add-json", options.addJson);
|
|
241
240
|
pushRepeatableValueFlag(args, "--remove", options.remove);
|
|
241
|
+
pushRepeatableValueFlag(args, "--remove-index", options.removeIndex);
|
|
242
242
|
pushOptionalValueFlag(args, "--match", options.match);
|
|
243
243
|
pushOptionalValueFlag(args, "--only-index", options.onlyIndex);
|
|
244
244
|
pushOptionalBooleanFlag(args, "--only-last", options.onlyLast);
|
|
@@ -792,7 +792,7 @@ export function normalizeSearchKeywordsInput(keywords) {
|
|
|
792
792
|
/** Implements normalize activity options for the public runtime surface of this module. */
|
|
793
793
|
export function normalizeActivityOptions(options) {
|
|
794
794
|
const readActivityString = (target) => readFirstStringFromCommanderOptions(options, resolveCommanderContract(ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, target));
|
|
795
|
-
|
|
795
|
+
const normalized = {
|
|
796
796
|
id: readActivityString("id"),
|
|
797
797
|
op: readActivityString("op"),
|
|
798
798
|
author: readActivityString("author"),
|
|
@@ -801,9 +801,14 @@ export function normalizeActivityOptions(options) {
|
|
|
801
801
|
limit: readActivityString("limit"),
|
|
802
802
|
compact: options.full === true || options.provenance === true
|
|
803
803
|
? false
|
|
804
|
-
: options.compact ===
|
|
805
|
-
?
|
|
806
|
-
:
|
|
804
|
+
: options.compact === true || options.raw === true
|
|
805
|
+
? true
|
|
806
|
+
: undefined,
|
|
807
|
+
...(options.raw === true ||
|
|
808
|
+
options.compact === true ||
|
|
809
|
+
options.full === true
|
|
810
|
+
? { raw: true }
|
|
811
|
+
: {}),
|
|
807
812
|
unbounded: optionTrue(options, "unbounded"),
|
|
808
813
|
provenance: optionTrue(options, "provenance"),
|
|
809
814
|
provenanceSummary: optionTrue(options, "provenanceSummary"),
|
|
@@ -817,6 +822,7 @@ export function normalizeActivityOptions(options) {
|
|
|
817
822
|
? options.provenanceFilter
|
|
818
823
|
: undefined,
|
|
819
824
|
};
|
|
825
|
+
return Object.fromEntries(Object.entries(normalized).filter(([, value]) => value !== undefined));
|
|
820
826
|
}
|
|
821
827
|
const ACTIVITY_STREAM_ENABLED_VALUES = new Set([
|
|
822
828
|
"",
|
|
@@ -978,4 +984,4 @@ export const _testOnly = {
|
|
|
978
984
|
collectMutationItemIds,
|
|
979
985
|
};
|
|
980
986
|
//# sourceMappingURL=registration-helpers.js.map
|
|
981
|
-
//# debugId=
|
|
987
|
+
//# debugId=daefefd1-3b0b-513d-8b8c-ab17f90b995a
|