@unbrained/pm-cli 2026.8.9 → 2026.8.11
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 +142 -80
- package/dist/cli/commander-usage.js +94 -17
- package/dist/cli/error-guidance.d.ts +10 -0
- package/dist/cli/error-guidance.js +76 -25
- package/dist/cli/help-json-payload.js +51 -16
- package/dist/cli/main.js +11 -6
- 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-mutation.js +30 -9
- package/dist/cli/register-operations.js +16 -11
- package/dist/cli-bundle/bundle-manifest.json +163 -163
- package/dist/cli-bundle/chunks/{chunk-RJC7TPF4.js → chunk-2OOU2AFH.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-2RA2YTHJ.js +33 -0
- package/dist/cli-bundle/chunks/chunk-A2SJGHSI.js +3 -0
- package/dist/cli-bundle/chunks/chunk-DSKYD4LG.js +13 -0
- package/dist/cli-bundle/chunks/chunk-HC3GM6YY.js +194 -0
- package/dist/cli-bundle/chunks/chunk-IUNRVDAI.js +2 -0
- package/dist/cli-bundle/chunks/chunk-W7CPZGSB.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-YC3UF2IO.js → chunk-WMEZHCFI.js} +66 -60
- package/dist/cli-bundle/chunks/{chunk-GMX5YOI3.js → chunk-ZU34C3LH.js} +48 -48
- package/dist/cli-bundle/chunks/chunk-ZXOC6HG5.js +5 -0
- package/dist/cli-bundle/chunks/{register-list-query-BUE7PTCU.js → register-list-query-HAUXVUPY.js} +8 -8
- package/dist/cli-bundle/chunks/register-mutation-7Y5U7ABT.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-EQX3DLAZ.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-UQDTNTLJ.js → register-setup-NOCOOWQY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KNEHLPBF.js → chunk-23FTGO3W.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6DO4YQWZ.js → chunk-2DL3MRTD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3AYKXMYX.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-4AHEC74N.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-MRWVJ3ZG.js → chunk-4H5IA6AV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4SV3ZKG3.js +16 -0
- package/dist/cli-bundle/focused-chunks/chunk-55BIB6DV.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-6JW6Z2P5.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-BKPIY34S.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-D4PIWE6D.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-DPO7TEFX.js +31 -0
- package/dist/cli-bundle/focused-chunks/{chunk-3WVHTUAW.js → chunk-E3KCL7AY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ERAAFLPS.js +153 -0
- package/dist/cli-bundle/focused-chunks/chunk-F6E4JZKG.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-FPSYO5ZG.js +18 -0
- package/dist/cli-bundle/focused-chunks/{chunk-73FIJONU.js → chunk-J5EKAIVD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-KDH5OX3D.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-OJ3LVVIS.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-TL5M2PAY.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-UDAZWT25.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-VABB4L5Y.js +17 -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/diagnostics/remediation.js +9 -9
- package/dist/core/fs/fs-utils.d.ts +10 -0
- package/dist/core/fs/fs-utils.js +16 -4
- package/dist/core/item/item-format.js +3 -32
- package/dist/core/schema/fields-file.d.ts +1 -2
- package/dist/core/schema/fields-file.js +4 -11
- package/dist/core/schema/runtime-schema.js +3 -10
- package/dist/core/schema/status-defs-file.d.ts +1 -2
- package/dist/core/schema/status-defs-file.js +4 -32
- package/dist/core/schema/status-token.d.ts +2 -0
- package/dist/core/schema/status-token.js +32 -0
- package/dist/core/schema/type-workflows.d.ts +1 -2
- package/dist/core/schema/type-workflows.js +4 -11
- 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 +8 -2
- package/dist/core/shared/author.js +85 -52
- package/dist/core/shared/errors.d.ts +12 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/text-normalization.d.ts +1 -1
- package/dist/core/shared/text-normalization.js +2 -2
- package/dist/sdk/agent/command-recovery.d.ts +4 -0
- package/dist/sdk/agent/command-recovery.js +52 -0
- package/dist/sdk/agent/command-suggestions.d.ts +4 -0
- package/dist/sdk/agent/command-suggestions.js +67 -0
- package/dist/sdk/agent/create-option-policy.d.ts +12 -0
- package/dist/sdk/agent/create-option-policy.js +32 -0
- package/dist/sdk/agent/item-addressing.d.ts +19 -0
- package/dist/sdk/agent/item-addressing.js +208 -0
- 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 +9 -1
- package/dist/sdk/cli-bootstrap.js +25 -10
- package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -4
- package/dist/sdk/cli-contracts/completeness.js +13 -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 +77 -21
- package/dist/sdk/cli-contracts/registration-helpers.js +10 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +6 -3
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +513 -0
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +251 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +6 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +96 -4
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +49 -6
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/completion.js +9 -3
- 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-runtime.js +8 -5
- package/dist/sdk/context-signal-store.d.ts +34 -0
- package/dist/sdk/context-signal-store.js +24 -2
- package/dist/sdk/core-governance.d.ts +3 -1
- package/dist/sdk/core-governance.js +5 -3
- package/dist/sdk/core.d.ts +1 -1
- package/dist/sdk/core.js +2 -2
- package/dist/sdk/dependency-flag-validation.d.ts +15 -1
- package/dist/sdk/dependency-flag-validation.js +54 -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-error-code-catalog.js +104 -13
- 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 +198 -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-runtime.d.ts +20 -0
- package/dist/sdk/governance/assurance-runtime.js +131 -0
- package/dist/sdk/governance/assurance.d.ts +432 -0
- package/dist/sdk/governance/assurance.js +689 -0
- package/dist/sdk/governance/health.js +14 -7
- package/dist/sdk/governance/provenance-health.d.ts +13 -0
- package/dist/sdk/governance/provenance-health.js +63 -17
- package/dist/sdk/governance/validate-item-reader.d.ts +13 -0
- package/dist/sdk/governance/validate-item-reader.js +18 -0
- package/dist/sdk/governance/validate.d.ts +2 -2
- package/dist/sdk/governance/validate.js +15 -6
- package/dist/sdk/graph/run.js +8 -3
- package/dist/sdk/index.d.ts +10 -1
- package/dist/sdk/index.js +12 -3
- package/dist/sdk/lifecycle/claim.js +18 -3
- package/dist/sdk/lifecycle/close.js +17 -14
- package/dist/sdk/lifecycle/create.d.ts +2 -0
- package/dist/sdk/lifecycle/create.js +62 -9
- package/dist/sdk/lifecycle/focus.js +13 -3
- package/dist/sdk/lifecycle/plan.js +8 -3
- package/dist/sdk/lifecycle/update-many.js +39 -27
- package/dist/sdk/lifecycle/update.d.ts +6 -1
- package/dist/sdk/lifecycle/update.js +47 -10
- package/dist/sdk/merge/index.d.ts +1 -1
- package/dist/sdk/merge/index.js +3 -3
- package/dist/sdk/merge/install.d.ts +4 -0
- package/dist/sdk/merge/install.js +28 -16
- package/dist/sdk/merge/receipts.d.ts +3 -0
- package/dist/sdk/merge/receipts.js +81 -17
- package/dist/sdk/output-projection.js +24 -4
- package/dist/sdk/provenance.d.ts +38 -0
- package/dist/sdk/provenance.js +64 -2
- package/dist/sdk/query/context.d.ts +2 -0
- package/dist/sdk/query/context.js +24 -10
- package/dist/sdk/query/light-metadata.d.ts +3 -0
- package/dist/sdk/query/light-metadata.js +19 -0
- package/dist/sdk/runtime-extended-actions.js +22 -5
- package/dist/sdk/runtime-primitives.d.ts +2 -0
- package/dist/sdk/runtime-primitives.js +4 -2
- package/dist/sdk/runtime.d.ts +8 -1
- package/dist/sdk/runtime.js +37 -28
- package/dist/sdk/schema-migration.js +7 -9
- package/dist/sdk/similarity-scoring.d.ts +1 -2
- package/dist/sdk/similarity-scoring.js +4 -16
- package/dist/sdk/telemetry.js +7 -4
- 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/sdk/workspace-snapshot.d.ts +4 -0
- package/dist/sdk/workspace-snapshot.js +24 -11
- package/dist/types.d.ts +8 -2
- package/dist/types.js +2 -2
- package/docs/AGENT_GUIDE.md +3 -1
- package/docs/ASSURANCE.md +132 -0
- package/docs/COMMANDS.md +8 -5
- package/docs/MERGE_SAFETY.md +7 -5
- package/docs/README.md +3 -5
- package/docs/READ_OUTPUT_CONTRACTS.md +2 -2
- package/docs/RELEASING.md +9 -5
- package/docs/SDK.md +44 -8
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +43 -6
- package/docs/SDK_CONTEXT.md +97 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +18 -3
- package/docs/SDK_EVIDENCE_TRACEABILITY.md +39 -1
- package/docs/SDK_RUNTIME_BOUNDARIES.md +36 -1
- package/docs/TESTING.md +12 -9
- package/docs/agent-task-token-baseline.json +2 -2
- package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -0
- package/marketplace.json +2 -2
- package/package.json +7 -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/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 +1028 -48
- package/dist/cli-bundle/chunks/chunk-2DTCZXSD.js +0 -13
- package/dist/cli-bundle/chunks/chunk-5JO6R4BS.js +0 -3
- package/dist/cli-bundle/chunks/chunk-5KN4DZYV.js +0 -194
- package/dist/cli-bundle/chunks/chunk-EF43KODO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HUV2Z7IS.js +0 -28
- package/dist/cli-bundle/chunks/chunk-MHBVCUF2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PYO5GZU6.js +0 -5
- package/dist/cli-bundle/chunks/register-mutation-FC3XLVIK.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-YH2WAOXU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2VVP5RAA.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-3GSFUDAI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4H6MVCK3.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-54TZJ4BM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5NK5TJ5D.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-C3GCHDSQ.js +0 -31
- package/dist/cli-bundle/focused-chunks/chunk-JGRSQZJT.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-NL57J7BZ.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-P6BBIQRG.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-PZAGVQNN.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-QDAO3XEK.js +0 -14
- package/dist/cli-bundle/focused-chunks/chunk-T4IGQCSY.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-U46GQJNY.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-VRXJSGIT.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-XC2ZW3CJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZG54B4XG.js +0 -2
package/dist/sdk/extension.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm extension command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8b0fbe09-2221-5b8e-8712-90a83df19306")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { activateExtensions, createSerialQueue, loadExtensions, nextExtensionReloadToken, } from "../core/extensions/index.js";
|
|
@@ -20,6 +20,7 @@ import { nowIso } from "../core/shared/time.js";
|
|
|
20
20
|
import { resolveGlobalPmRoot, resolvePmRoot } from "../core/store/paths.js";
|
|
21
21
|
import { readSettings, writeSettings } from "../core/store/settings.js";
|
|
22
22
|
import { quoteCommandArg, renderPmCommand } from "./command-line.js";
|
|
23
|
+
import { createUnknownSubcommandError } from "./agent/subcommand-recovery.js";
|
|
23
24
|
import { ensureTypeFolderScaffold } from "./schema.js";
|
|
24
25
|
// Cohesive helper groups now live in ./extension/* sibling modules. They are
|
|
25
26
|
// imported for the command wiring that stays here and re-exported below so
|
|
@@ -321,21 +322,21 @@ const buildUnknownLifecycleActionError = (target, options) => {
|
|
|
321
322
|
return new PmCliError(`One action flag is required. Use one of: ${LIFECYCLE_ACTION_FLAG_HINT}. Bare \`pm package\` and \`pm extension\` default to --explore.`, EXIT_CODE.USAGE);
|
|
322
323
|
}
|
|
323
324
|
const command = `pm ${noun} ${suggestion.flag}`;
|
|
324
|
-
return
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
325
|
+
return createUnknownSubcommandError({
|
|
326
|
+
command_path: noun,
|
|
327
|
+
display_name: `${noun} lifecycle`,
|
|
328
|
+
token_kind: "action",
|
|
329
|
+
token: target,
|
|
330
|
+
allowed: Object.keys(IMPLICIT_EXTENSION_ACTIONS),
|
|
331
|
+
retry_command: command,
|
|
332
|
+
message_suffix: `. Did you mean "${suggestion.flag}"?`,
|
|
333
|
+
fallback_candidates: [
|
|
334
|
+
{
|
|
335
|
+
source: "lifecycle_action",
|
|
336
|
+
command,
|
|
337
|
+
reason: `nearest lifecycle action for "${target}"`,
|
|
338
|
+
},
|
|
339
|
+
],
|
|
339
340
|
});
|
|
340
341
|
};
|
|
341
342
|
// Maps each boolean action flag to the lifecycle action it selects. `scaffold`
|
|
@@ -2190,4 +2191,4 @@ export const _testOnly = {
|
|
|
2190
2191
|
withExtensionInstallLock,
|
|
2191
2192
|
};
|
|
2192
2193
|
//# sourceMappingURL=extension.js.map
|
|
2193
|
-
//# debugId=
|
|
2194
|
+
//# debugId=8b0fbe09-2221-5b8e-8712-90a83df19306
|
package/dist/sdk/files.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GlobalOptions } from "../core/shared/command-types.js";
|
|
2
2
|
import type { ItemDocument, LinkedFile, LinkScope } from "../types/index.js";
|
|
3
3
|
import { type LinkedPathValidation } from "./linked-artifacts.js";
|
|
4
|
+
import { type SourceLineRange, type SourceTraceabilityExplanation, type SourceTraceabilityReceipt } from "./traceability/source-traceability.js";
|
|
4
5
|
/** Documents the files command options payload exchanged by command, SDK, and package integrations. */
|
|
5
6
|
export interface FilesCommandOptions {
|
|
6
7
|
/** Value that configures or reports add for this contract. */
|
|
@@ -112,6 +113,12 @@ export interface FilesLookupOptions {
|
|
|
112
113
|
noTruncate?: boolean;
|
|
113
114
|
/** Fail when any authoritative item cannot be read. */
|
|
114
115
|
strictRead?: boolean;
|
|
116
|
+
/** Include rationale, governing-decision paths, and ambiguity receipts. */
|
|
117
|
+
explain?: boolean;
|
|
118
|
+
/** Optional inclusive line range; implies explain and requires one path. */
|
|
119
|
+
lineRange?: SourceLineRange;
|
|
120
|
+
/** Maximum relationship depth searched for a governing decision. */
|
|
121
|
+
decisionDepth?: number;
|
|
115
122
|
}
|
|
116
123
|
/** Token-efficient item identity returned by reverse linked-file lookup. */
|
|
117
124
|
export interface FilesLookupItem {
|
|
@@ -134,6 +141,8 @@ export interface FilesLookupMatch {
|
|
|
134
141
|
item: FilesLookupItem;
|
|
135
142
|
/** Matching linked-file evidence. */
|
|
136
143
|
files: LinkedFile[];
|
|
144
|
+
/** Optional bounded rationale and line-attribution explanation. */
|
|
145
|
+
traceability?: SourceTraceabilityExplanation;
|
|
137
146
|
}
|
|
138
147
|
/** Reverse linked-file lookup result with bounded output and read provenance. */
|
|
139
148
|
export interface FilesLookupResult {
|
|
@@ -160,6 +169,8 @@ export interface FilesLookupResult {
|
|
|
160
169
|
warnings: string[];
|
|
161
170
|
/** Ordered reverse-traceability matches. */
|
|
162
171
|
matches: FilesLookupMatch[];
|
|
172
|
+
/** Aggregate receipt for an explained source query. */
|
|
173
|
+
traceability_receipt?: SourceTraceabilityReceipt;
|
|
163
174
|
}
|
|
164
175
|
interface TextReference {
|
|
165
176
|
field: string;
|
package/dist/sdk/files.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm files command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="515cd35c-8e0e-51d4-8ad9-1cea5be8a572")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { pathExists } from "../core/fs/fs-utils.js";
|
|
@@ -20,6 +20,7 @@ import { readSettings } from "../core/store/settings.js";
|
|
|
20
20
|
import { resolveAuthor } from "../core/shared/author.js";
|
|
21
21
|
import { isPathWithinDirectory } from "../core/fs/path-utils.js";
|
|
22
22
|
import { dedupeLinkedArtifacts, normalizeLinkedPath, renameArtifactsResultKey, runLinkedArtifacts, sortLinkedArtifacts, } from "./linked-artifacts.js";
|
|
23
|
+
import { explainSourceTraceability, } from "./traceability/source-traceability.js";
|
|
23
24
|
/** Bounds fuzzy relative-path scanning while preserving full absolute-path discovery. */
|
|
24
25
|
const RELATIVE_REFERENCE_SCAN_MAX_CHARS = 32_768;
|
|
25
26
|
function normalizeCandidatePathForOutput(value) {
|
|
@@ -251,8 +252,51 @@ function projectFilesLookupItem(item) {
|
|
|
251
252
|
updated_at: item.updated_at,
|
|
252
253
|
};
|
|
253
254
|
}
|
|
255
|
+
function compareFilesLookupCandidates(left, right) {
|
|
256
|
+
const byPriority = left.item.priority - right.item.priority;
|
|
257
|
+
if (byPriority !== 0)
|
|
258
|
+
return byPriority;
|
|
259
|
+
const byUpdated = right.item.updated_at.localeCompare(left.item.updated_at);
|
|
260
|
+
return byUpdated === 0
|
|
261
|
+
? left.item.id.localeCompare(right.item.id)
|
|
262
|
+
: byUpdated;
|
|
263
|
+
}
|
|
264
|
+
function matchingFilesLookupCandidates(params) {
|
|
265
|
+
return params.metadata
|
|
266
|
+
.map((item) => ({
|
|
267
|
+
item,
|
|
268
|
+
files: (item.files ?? [])
|
|
269
|
+
.filter((file) => params.paths.includes(normalizeLinkedPath(file.path)) &&
|
|
270
|
+
(params.scope === undefined || file.scope === params.scope))
|
|
271
|
+
.sort((left, right) => {
|
|
272
|
+
const byPath = left.path.localeCompare(right.path);
|
|
273
|
+
return byPath === 0 ? left.scope.localeCompare(right.scope) : byPath;
|
|
274
|
+
}),
|
|
275
|
+
}))
|
|
276
|
+
.filter((match) => match.files.length > 0)
|
|
277
|
+
.sort(compareFilesLookupCandidates);
|
|
278
|
+
}
|
|
279
|
+
async function resolveFilesLookupTraceability(params) {
|
|
280
|
+
if (!params.explain)
|
|
281
|
+
return undefined;
|
|
282
|
+
return explainSourceTraceability({
|
|
283
|
+
workspaceRoot: params.workspaceRoot,
|
|
284
|
+
paths: params.paths,
|
|
285
|
+
candidates: params.matching,
|
|
286
|
+
corpus: params.metadata,
|
|
287
|
+
...(params.lineRange ? { lineRange: params.lineRange } : {}),
|
|
288
|
+
...(params.decisionDepth === undefined
|
|
289
|
+
? {}
|
|
290
|
+
: { decisionDepth: params.decisionDepth }),
|
|
291
|
+
});
|
|
292
|
+
}
|
|
254
293
|
async function queryFilesLookupIndex(params) {
|
|
255
|
-
if ([
|
|
294
|
+
if ([
|
|
295
|
+
params.strictRead,
|
|
296
|
+
params.noTruncate,
|
|
297
|
+
params.explain,
|
|
298
|
+
hasActiveOnReadHooks(),
|
|
299
|
+
].includes(true)) {
|
|
256
300
|
return null;
|
|
257
301
|
}
|
|
258
302
|
const indexState = await readItemMetadataDerivedIndexState(params.pmRoot, [
|
|
@@ -272,32 +316,34 @@ async function queryFilesLookupIndex(params) {
|
|
|
272
316
|
async function queryFilesLookupSource(params) {
|
|
273
317
|
const warnings = [];
|
|
274
318
|
const metadata = await listAllItemMetadata(params.pmRoot, params.settings.item_format, params.typeToFolder, warnings, params.settings.schema);
|
|
275
|
-
const matching =
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
.filter((file) => params.paths.includes(normalizeLinkedPath(file.path)) &&
|
|
280
|
-
(params.scope === undefined || file.scope === params.scope))
|
|
281
|
-
.sort((left, right) => {
|
|
282
|
-
const byPath = left.path.localeCompare(right.path);
|
|
283
|
-
return byPath === 0 ? left.scope.localeCompare(right.scope) : byPath;
|
|
284
|
-
}),
|
|
285
|
-
}))
|
|
286
|
-
.filter((match) => match.files.length > 0)
|
|
287
|
-
.sort((left, right) => {
|
|
288
|
-
const byPriority = left.item.priority - right.item.priority;
|
|
289
|
-
if (byPriority !== 0)
|
|
290
|
-
return byPriority;
|
|
291
|
-
const byUpdated = right.item.updated_at.localeCompare(left.item.updated_at);
|
|
292
|
-
return byUpdated === 0
|
|
293
|
-
? left.item.id.localeCompare(right.item.id)
|
|
294
|
-
: byUpdated;
|
|
319
|
+
const matching = matchingFilesLookupCandidates({
|
|
320
|
+
metadata,
|
|
321
|
+
paths: params.paths,
|
|
322
|
+
scope: params.scope,
|
|
295
323
|
});
|
|
296
324
|
const readWarnings = warnings.filter((warning) => /^item_list_(?:item|directory)_read_failed:/u.test(warning));
|
|
297
325
|
if (params.strictRead && readWarnings.length > 0) {
|
|
298
326
|
throw new PmCliError(`Files lookup could not read every item: ${readWarnings.join("; ")}`, EXIT_CODE.GENERIC_FAILURE);
|
|
299
327
|
}
|
|
300
|
-
const
|
|
328
|
+
const traceability = await resolveFilesLookupTraceability({
|
|
329
|
+
explain: params.explain,
|
|
330
|
+
workspaceRoot: params.workspaceRoot,
|
|
331
|
+
paths: params.paths,
|
|
332
|
+
matching,
|
|
333
|
+
metadata,
|
|
334
|
+
lineRange: params.lineRange,
|
|
335
|
+
decisionDepth: params.decisionDepth,
|
|
336
|
+
});
|
|
337
|
+
const ranked = traceability
|
|
338
|
+
? [...matching].sort((left, right) => {
|
|
339
|
+
const byScore = traceability.explanations.get(right.item.id).score -
|
|
340
|
+
traceability.explanations.get(left.item.id).score;
|
|
341
|
+
if (byScore !== 0)
|
|
342
|
+
return byScore;
|
|
343
|
+
return compareFilesLookupCandidates(left, right);
|
|
344
|
+
})
|
|
345
|
+
: matching;
|
|
346
|
+
const page = ranked.slice(params.offset, params.limit === undefined ? undefined : params.offset + params.limit);
|
|
301
347
|
return {
|
|
302
348
|
paths: params.paths,
|
|
303
349
|
total: matching.length,
|
|
@@ -314,7 +360,11 @@ async function queryFilesLookupSource(params) {
|
|
|
314
360
|
matches: page.map((match) => ({
|
|
315
361
|
item: projectFilesLookupItem(match.item),
|
|
316
362
|
files: match.files,
|
|
363
|
+
...(traceability
|
|
364
|
+
? { traceability: traceability.explanations.get(match.item.id) }
|
|
365
|
+
: {}),
|
|
317
366
|
})),
|
|
367
|
+
...(traceability ? { traceability_receipt: traceability.receipt } : {}),
|
|
318
368
|
};
|
|
319
369
|
}
|
|
320
370
|
/** Resolve the pm items that reference one or more source paths. */
|
|
@@ -325,6 +375,9 @@ export async function runFilesLookup(options, global) {
|
|
|
325
375
|
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
326
376
|
}
|
|
327
377
|
const paths = await normalizeFilesLookupPaths(options.paths, workspaceRoot);
|
|
378
|
+
if (options.lineRange && paths.length !== 1) {
|
|
379
|
+
throw new PmCliError("Files lookup line attribution requires exactly one source path.", EXIT_CODE.USAGE);
|
|
380
|
+
}
|
|
328
381
|
const settings = await readSettings(pmRoot);
|
|
329
382
|
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
330
383
|
const { offset, limit } = resolveFilesLookupWindow(options);
|
|
@@ -337,6 +390,7 @@ export async function runFilesLookup(options, global) {
|
|
|
337
390
|
offset,
|
|
338
391
|
strictRead: options.strictRead === true,
|
|
339
392
|
noTruncate: options.noTruncate === true,
|
|
393
|
+
explain: options.explain === true || options.lineRange !== undefined,
|
|
340
394
|
});
|
|
341
395
|
if (indexed) {
|
|
342
396
|
return {
|
|
@@ -364,6 +418,10 @@ export async function runFilesLookup(options, global) {
|
|
|
364
418
|
limit,
|
|
365
419
|
offset,
|
|
366
420
|
strictRead: options.strictRead === true,
|
|
421
|
+
workspaceRoot,
|
|
422
|
+
explain: options.explain === true || options.lineRange !== undefined,
|
|
423
|
+
lineRange: options.lineRange,
|
|
424
|
+
decisionDepth: options.decisionDepth,
|
|
367
425
|
});
|
|
368
426
|
}
|
|
369
427
|
/** Implements run files discover for the public runtime surface of this module. */
|
|
@@ -479,4 +537,4 @@ export async function runFilesDiscover(id, options, global) {
|
|
|
479
537
|
};
|
|
480
538
|
}
|
|
481
539
|
//# sourceMappingURL=files.js.map
|
|
482
|
-
//# debugId=
|
|
540
|
+
//# debugId=515cd35c-8e0e-51d4-8ad9-1cea5be8a572
|
|
@@ -4,10 +4,34 @@
|
|
|
4
4
|
* Generated by scripts/generate-error-code-catalog.mjs. Do not edit manually.
|
|
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]="07d93565-d5ef-5c3d-ae8a-214973e6ec20")}catch(e){}}();
|
|
8
8
|
import { definePmErrorCodeCatalog } from "./error-code-catalog.js";
|
|
9
9
|
/** Exhaustive catalog generated from literal error guidance declarations. */
|
|
10
10
|
export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
|
|
11
|
+
{
|
|
12
|
+
code: "acceptance_criteria_mutation_conflict",
|
|
13
|
+
meaning: "Acceptance criteria mutation conflict condition.",
|
|
14
|
+
stability: "provisional",
|
|
15
|
+
exit_code: 2,
|
|
16
|
+
class: "usage",
|
|
17
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
18
|
+
sources: ["sdk/lifecycle/update.ts"],
|
|
19
|
+
emitting_commands: ["update", "update-many"],
|
|
20
|
+
canonical_code: "acceptance_criteria_mutation_conflict",
|
|
21
|
+
aliases: [],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
code: "acceptance_criteria_remove_unmatched",
|
|
25
|
+
meaning: "Acceptance criteria remove unmatched condition.",
|
|
26
|
+
stability: "provisional",
|
|
27
|
+
exit_code: 3,
|
|
28
|
+
class: "not_found",
|
|
29
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
30
|
+
sources: ["sdk/lifecycle/update-many.ts", "sdk/lifecycle/update.ts"],
|
|
31
|
+
emitting_commands: ["update", "update-many"],
|
|
32
|
+
canonical_code: "acceptance_criteria_remove_unmatched",
|
|
33
|
+
aliases: [],
|
|
34
|
+
},
|
|
11
35
|
{
|
|
12
36
|
code: "acceptance_criteria_semicolon_forbidden",
|
|
13
37
|
meaning: "Acceptance criteria semicolon forbidden condition.",
|
|
@@ -92,6 +116,18 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
|
|
|
92
116
|
canonical_code: "append_empty_body",
|
|
93
117
|
aliases: [],
|
|
94
118
|
},
|
|
119
|
+
{
|
|
120
|
+
code: "assurance_registry_invalid",
|
|
121
|
+
meaning: "Assurance registry invalid condition.",
|
|
122
|
+
stability: "provisional",
|
|
123
|
+
exit_code: 1,
|
|
124
|
+
class: "generic_failure",
|
|
125
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
126
|
+
sources: ["sdk/governance/assurance.ts"],
|
|
127
|
+
emitting_commands: ["*"],
|
|
128
|
+
canonical_code: "assurance_registry_invalid",
|
|
129
|
+
aliases: [],
|
|
130
|
+
},
|
|
95
131
|
{
|
|
96
132
|
code: "body_file_conflicts_with_body",
|
|
97
133
|
meaning: "Body file conflicts with body condition.",
|
|
@@ -308,6 +344,42 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
|
|
|
308
344
|
canonical_code: "conflicting_lifecycle_owner",
|
|
309
345
|
aliases: [],
|
|
310
346
|
},
|
|
347
|
+
{
|
|
348
|
+
code: "context_signal_store_invalid",
|
|
349
|
+
meaning: "Context signal store invalid condition.",
|
|
350
|
+
stability: "provisional",
|
|
351
|
+
exit_code: 2,
|
|
352
|
+
class: "usage",
|
|
353
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
354
|
+
sources: ["sdk/context-signal-store.ts"],
|
|
355
|
+
emitting_commands: ["*"],
|
|
356
|
+
canonical_code: "context_signal_store_invalid",
|
|
357
|
+
aliases: [],
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
code: "context_signal_store_stale",
|
|
361
|
+
meaning: "Context signal store stale condition.",
|
|
362
|
+
stability: "provisional",
|
|
363
|
+
exit_code: 1,
|
|
364
|
+
class: "generic_failure",
|
|
365
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
366
|
+
sources: ["sdk/context-signal-store.ts"],
|
|
367
|
+
emitting_commands: ["*"],
|
|
368
|
+
canonical_code: "context_signal_store_stale",
|
|
369
|
+
aliases: [],
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
code: "context_signal_store_write_failed",
|
|
373
|
+
meaning: "Context signal store write failed condition.",
|
|
374
|
+
stability: "provisional",
|
|
375
|
+
exit_code: 1,
|
|
376
|
+
class: "generic_failure",
|
|
377
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
378
|
+
sources: ["sdk/context-signal-store.ts"],
|
|
379
|
+
emitting_commands: ["*"],
|
|
380
|
+
canonical_code: "context_signal_store_write_failed",
|
|
381
|
+
aliases: [],
|
|
382
|
+
},
|
|
311
383
|
{
|
|
312
384
|
code: "context_takes_no_item_argument",
|
|
313
385
|
meaning: "Context takes no item argument condition.",
|
|
@@ -356,6 +428,18 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
|
|
|
356
428
|
canonical_code: "dependency_edge_not_allowed",
|
|
357
429
|
aliases: [],
|
|
358
430
|
},
|
|
431
|
+
{
|
|
432
|
+
code: "dependency_target_not_found",
|
|
433
|
+
meaning: "Dependency target not found condition.",
|
|
434
|
+
stability: "provisional",
|
|
435
|
+
exit_code: 3,
|
|
436
|
+
class: "not_found",
|
|
437
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
438
|
+
sources: ["sdk/dependency-flag-validation.ts"],
|
|
439
|
+
emitting_commands: ["*"],
|
|
440
|
+
canonical_code: "dependency_target_not_found",
|
|
441
|
+
aliases: [],
|
|
442
|
+
},
|
|
359
443
|
{
|
|
360
444
|
code: "duplicate_command",
|
|
361
445
|
meaning: "Duplicate command condition.",
|
|
@@ -2174,13 +2258,16 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
|
|
|
2174
2258
|
code: "tracker_not_initialized",
|
|
2175
2259
|
meaning: "Tracker not initialized condition.",
|
|
2176
2260
|
stability: "stable",
|
|
2177
|
-
exit_code:
|
|
2178
|
-
class: "
|
|
2261
|
+
exit_code: 3,
|
|
2262
|
+
class: "not_found",
|
|
2179
2263
|
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
2180
2264
|
sources: ["cli/error-guidance.ts", "core/telemetry/observability.ts"],
|
|
2181
2265
|
emitting_commands: ["*"],
|
|
2182
2266
|
canonical_code: "tracker_not_initialized",
|
|
2183
2267
|
aliases: [],
|
|
2268
|
+
owned_states: [
|
|
2269
|
+
{ state: "selected_tracker_root_is_a_regular_file", probe_id: "tracker-root-regular-file", entrypoints: ["list"], expected_exit_class: "not_found" },
|
|
2270
|
+
],
|
|
2184
2271
|
},
|
|
2185
2272
|
{
|
|
2186
2273
|
code: "tracker_root_missing",
|
|
@@ -2313,9 +2400,9 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
|
|
|
2313
2400
|
exit_code: 2,
|
|
2314
2401
|
class: "usage",
|
|
2315
2402
|
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
2316
|
-
sources: ["sdk/
|
|
2403
|
+
sources: ["sdk/agent/subcommand-recovery.ts"],
|
|
2317
2404
|
emitting_commands: ["*"],
|
|
2318
|
-
canonical_code: "
|
|
2405
|
+
canonical_code: "unknown_subcommand",
|
|
2319
2406
|
aliases: [],
|
|
2320
2407
|
},
|
|
2321
2408
|
{
|
|
@@ -2329,6 +2416,9 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
|
|
|
2329
2416
|
emitting_commands: ["*"],
|
|
2330
2417
|
canonical_code: "unknown_option",
|
|
2331
2418
|
aliases: [],
|
|
2419
|
+
owned_states: [
|
|
2420
|
+
{ state: "declared_option_is_rejected_on_the_selected_command_path", probe_id: "cross-command-unknown-option", entrypoints: ["deps"], expected_exit_class: "usage" },
|
|
2421
|
+
],
|
|
2332
2422
|
},
|
|
2333
2423
|
{
|
|
2334
2424
|
code: "unknown_plan_template",
|
|
@@ -2373,15 +2463,16 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
|
|
|
2373
2463
|
exit_code: 2,
|
|
2374
2464
|
class: "usage",
|
|
2375
2465
|
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
2376
|
-
sources: [
|
|
2377
|
-
"cli/register-mutation.ts",
|
|
2378
|
-
"cli/register-operations.ts",
|
|
2379
|
-
"sdk/runtime-extended-actions.ts",
|
|
2380
|
-
"sdk/telemetry.ts",
|
|
2381
|
-
],
|
|
2466
|
+
sources: ["cli/error-guidance.ts", "sdk/agent/subcommand-recovery.ts"],
|
|
2382
2467
|
emitting_commands: ["*"],
|
|
2383
2468
|
canonical_code: "unknown_subcommand",
|
|
2384
|
-
aliases: [],
|
|
2469
|
+
aliases: ["unknown_lifecycle_action"],
|
|
2470
|
+
owned_states: [
|
|
2471
|
+
{ state: "config_action_token_is_not_declared", probe_id: "config-unknown-action", entrypoints: ["config"], expected_exit_class: "usage" },
|
|
2472
|
+
{ state: "graph_command_token_is_not_declared", probe_id: "graph-unknown-subcommand", entrypoints: ["graph"], expected_exit_class: "usage" },
|
|
2473
|
+
{ state: "nested_command_token_is_not_declared_by_its_family", probe_id: "schema-unknown-subcommand", entrypoints: ["schema"], expected_exit_class: "usage" },
|
|
2474
|
+
{ state: "package_lifecycle_token_is_not_declared", probe_id: "package-unknown-action", entrypoints: ["package"], expected_exit_class: "usage" },
|
|
2475
|
+
],
|
|
2385
2476
|
},
|
|
2386
2477
|
{
|
|
2387
2478
|
code: "unsupported_update_option",
|
|
@@ -3057,4 +3148,4 @@ export const PM_ERROR_CODE_CATALOG = definePmErrorCodeCatalog([
|
|
|
3057
3148
|
},
|
|
3058
3149
|
]);
|
|
3059
3150
|
//# sourceMappingURL=generated-error-code-catalog.js.map
|
|
3060
|
-
//# debugId=
|
|
3151
|
+
//# debugId=07d93565-d5ef-5c3d-ae8a-214973e6ec20
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/governance/assurance-action-contracts
|
|
3
|
+
*
|
|
4
|
+
* Exposes assurance action transport types without coupling callers to the
|
|
5
|
+
* governance implementation module.
|
|
6
|
+
*/
|
|
7
|
+
export type { AssuranceActionInput, AssuranceActionResult, } from "./assurance-action.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
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]="443beddb-37c9-5244-a157-e07624e4a6d2")}catch(e){}}();
|
|
3
|
+
export {};
|
|
4
|
+
//# sourceMappingURL=assurance-action-contracts.js.map
|
|
5
|
+
//# debugId=443beddb-37c9-5244-a157-e07624e4a6d2
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/assurance-action
|
|
3
|
+
*
|
|
4
|
+
* Normalizes the assurance action vocabulary once for CLI, SDK, and MCP hosts.
|
|
5
|
+
*/
|
|
6
|
+
import type { GlobalOptions } from "../../core/shared/command-types.js";
|
|
7
|
+
import { type AssuranceDeclaration, type AssuranceGateVerdict, type AssuranceMutationReceipt } from "./assurance.js";
|
|
8
|
+
/** Assurance registry and evaluation verbs shared by every transport. */
|
|
9
|
+
export declare const ASSURANCE_ACTIONS: readonly ["list", "show", "put", "remove", "run", "verdicts"];
|
|
10
|
+
/** Assurance declaration kinds shared by every transport. */
|
|
11
|
+
export declare const ASSURANCE_DECLARATION_KINDS: readonly ["measurement", "assertion", "gate"];
|
|
12
|
+
/** Assurance action verb. */
|
|
13
|
+
export type AssuranceAction = (typeof ASSURANCE_ACTIONS)[number];
|
|
14
|
+
/** Transport-neutral assurance action request. */
|
|
15
|
+
export interface AssuranceActionInput {
|
|
16
|
+
/** CRUD, evaluation, or verdict-history action. */
|
|
17
|
+
action: string;
|
|
18
|
+
/** Declaration kind for registry actions. */
|
|
19
|
+
kind?: string;
|
|
20
|
+
/** Declaration id, gate id, or verdict gate filter. */
|
|
21
|
+
id?: string;
|
|
22
|
+
/** JSON object or serialized JSON declaration for put. */
|
|
23
|
+
definition?: unknown;
|
|
24
|
+
/** Lifecycle trigger for gate evaluation. */
|
|
25
|
+
trigger?: string;
|
|
26
|
+
/** Explicit commit, tree, or snapshot identity. */
|
|
27
|
+
tree?: string;
|
|
28
|
+
/** Verdict-history gate filter when id is used by another host field. */
|
|
29
|
+
gate?: string;
|
|
30
|
+
/** Maximum newest durable verdicts returned. */
|
|
31
|
+
limit?: number | string;
|
|
32
|
+
/** Evaluate without appending an immutable verdict. */
|
|
33
|
+
dry_run?: boolean;
|
|
34
|
+
/** Retain the complete mutation receipt; assurance receipts are complete by default. */
|
|
35
|
+
fullChangedFields?: boolean;
|
|
36
|
+
/** Project declaration mutations to their stable id. */
|
|
37
|
+
idOnly?: boolean;
|
|
38
|
+
/** Explicit author override. */
|
|
39
|
+
author?: string;
|
|
40
|
+
/** Audited mutation rationale. */
|
|
41
|
+
message?: string;
|
|
42
|
+
}
|
|
43
|
+
/** Result union returned by transport-neutral assurance execution. */
|
|
44
|
+
export type AssuranceActionResult = AssuranceDeclaration | AssuranceMutationReceipt | AssuranceGateVerdict | {
|
|
45
|
+
id: string;
|
|
46
|
+
} | {
|
|
47
|
+
/** Registry declarations. */
|
|
48
|
+
items: AssuranceDeclaration[];
|
|
49
|
+
/** Number of declarations. */
|
|
50
|
+
count: number;
|
|
51
|
+
/** Stable row-selection contract. */
|
|
52
|
+
row_contract: {
|
|
53
|
+
row_keys: ["items"];
|
|
54
|
+
jq_selector: ".items[]";
|
|
55
|
+
};
|
|
56
|
+
} | {
|
|
57
|
+
/** Durable gate verdicts. */
|
|
58
|
+
items: AssuranceGateVerdict[];
|
|
59
|
+
/** Number of verdicts. */
|
|
60
|
+
count: number;
|
|
61
|
+
/** Stable row-selection contract. */
|
|
62
|
+
row_contract: {
|
|
63
|
+
row_keys: ["items"];
|
|
64
|
+
jq_selector: ".items[]";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/** Execute one assurance request through the public assurance SDK primitives. */
|
|
68
|
+
export declare function runAssuranceAction(input: AssuranceActionInput, global?: Pick<GlobalOptions, "path">): Promise<AssuranceActionResult>;
|
|
69
|
+
/** Normalize a generic SDK or MCP argument envelope into one assurance request. */
|
|
70
|
+
export declare function runAssuranceDispatch(args: Record<string, unknown>, options: Record<string, unknown>, global: GlobalOptions): Promise<AssuranceActionResult>;
|