@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements append-only history and replay behavior for History.
|
|
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]="2fc7f675-3500-5abb-8d5c-9ca9caa803b6")}catch(e){}}();
|
|
8
8
|
import jsonPatch from "fast-json-patch";
|
|
9
9
|
import { ITEM_METADATA_KEY_ORDER } from "../shared/constants.js";
|
|
10
10
|
import { runActiveServiceOverride } from "../extensions/index.js";
|
|
@@ -20,6 +20,42 @@ const EMPTY_LEGACY_HASH_DOCUMENT = {
|
|
|
20
20
|
front_matter: {},
|
|
21
21
|
body: "",
|
|
22
22
|
};
|
|
23
|
+
/** Hash epoch that preserves linked-test insertion order in immutable history. */
|
|
24
|
+
export const CURRENT_HISTORY_ITEM_HASH_VERSION = 2;
|
|
25
|
+
/** Hash epochs understood by this runtime. */
|
|
26
|
+
export const SUPPORTED_HISTORY_ITEM_HASH_VERSIONS = [1, 2];
|
|
27
|
+
function compareOptionalStrings(left, right) {
|
|
28
|
+
return (left ?? "").localeCompare(right ?? "");
|
|
29
|
+
}
|
|
30
|
+
function compareOptionalNumbers(left, right) {
|
|
31
|
+
return (left ?? 0) - (right ?? 0);
|
|
32
|
+
}
|
|
33
|
+
function compareJsonValues(left, right, fallback) {
|
|
34
|
+
// Preserve the original v1 comparator byte-for-byte: replacing JSON.stringify
|
|
35
|
+
// with stableStringify would invalidate immutable hashes from legacy streams.
|
|
36
|
+
return JSON.stringify(left ?? fallback).localeCompare(JSON.stringify(right ?? fallback));
|
|
37
|
+
}
|
|
38
|
+
function compareLegacyLinkedTests(left, right) {
|
|
39
|
+
const comparisons = [
|
|
40
|
+
left.scope.localeCompare(right.scope),
|
|
41
|
+
compareOptionalStrings(left.path, right.path),
|
|
42
|
+
compareOptionalStrings(left.command, right.command),
|
|
43
|
+
compareOptionalNumbers(left.timeout_seconds, right.timeout_seconds),
|
|
44
|
+
compareOptionalStrings(left.pm_context_mode, right.pm_context_mode),
|
|
45
|
+
Number(Boolean(left.shared_host_safe)) - Number(Boolean(right.shared_host_safe)),
|
|
46
|
+
compareJsonValues(left.env_clear, right.env_clear, []),
|
|
47
|
+
compareJsonValues(left.env_set, right.env_set, {}),
|
|
48
|
+
compareJsonValues(left.assert_stdout_contains, right.assert_stdout_contains, []),
|
|
49
|
+
compareJsonValues(left.assert_stdout_regex, right.assert_stdout_regex, []),
|
|
50
|
+
compareJsonValues(left.assert_stderr_contains, right.assert_stderr_contains, []),
|
|
51
|
+
compareJsonValues(left.assert_stderr_regex, right.assert_stderr_regex, []),
|
|
52
|
+
compareOptionalNumbers(left.assert_stdout_min_lines, right.assert_stdout_min_lines),
|
|
53
|
+
compareJsonValues(left.assert_json_field_equals, right.assert_json_field_equals, {}),
|
|
54
|
+
compareJsonValues(left.assert_json_field_gte, right.assert_json_field_gte, {}),
|
|
55
|
+
compareOptionalStrings(left.note, right.note),
|
|
56
|
+
];
|
|
57
|
+
return comparisons.find((comparison) => comparison !== 0) ?? 0;
|
|
58
|
+
}
|
|
23
59
|
function decodeJsonPointer(path) {
|
|
24
60
|
if (!path || path === "/") {
|
|
25
61
|
return [];
|
|
@@ -81,7 +117,7 @@ function normalizeHistoryPatchOps(beforeDocument, patch) {
|
|
|
81
117
|
}
|
|
82
118
|
return normalized;
|
|
83
119
|
}
|
|
84
|
-
function canonicalHashDocument(document) {
|
|
120
|
+
function canonicalHashDocument(document, version) {
|
|
85
121
|
const hasMetadata = document.metadata && Object.keys(document.metadata).length > 0;
|
|
86
122
|
if (!hasMetadata) {
|
|
87
123
|
return {
|
|
@@ -90,7 +126,13 @@ function canonicalHashDocument(document) {
|
|
|
90
126
|
};
|
|
91
127
|
}
|
|
92
128
|
const canonical = canonicalDocument(document);
|
|
93
|
-
const
|
|
129
|
+
const metadata = version === 1 && canonical.metadata.tests
|
|
130
|
+
? {
|
|
131
|
+
...canonical.metadata,
|
|
132
|
+
tests: [...canonical.metadata.tests].sort(compareLegacyLinkedTests),
|
|
133
|
+
}
|
|
134
|
+
: canonical.metadata;
|
|
135
|
+
const orderedMetadata = orderObject(toItemRecord(metadata), ITEM_METADATA_KEY_ORDER);
|
|
94
136
|
return {
|
|
95
137
|
front_matter: orderedMetadata,
|
|
96
138
|
body: canonical.body,
|
|
@@ -113,7 +155,14 @@ function canonicalPatchDocument(document) {
|
|
|
113
155
|
}
|
|
114
156
|
/** Implements hash document for the public runtime surface of this module. */
|
|
115
157
|
export function hashDocument(document) {
|
|
116
|
-
return
|
|
158
|
+
return hashDocumentForVersion(document, CURRENT_HISTORY_ITEM_HASH_VERSION);
|
|
159
|
+
}
|
|
160
|
+
/** Hash an item with an explicit canonicalization epoch for replay compatibility. */
|
|
161
|
+
export function hashDocumentForVersion(document, version) {
|
|
162
|
+
if (!SUPPORTED_HISTORY_ITEM_HASH_VERSIONS.some((supportedVersion) => supportedVersion === version)) {
|
|
163
|
+
throw new TypeError(`unsupported_item_hash_version:${String(version)}`);
|
|
164
|
+
}
|
|
165
|
+
return sha256Hex(stableStringify(canonicalHashDocument(document, version)));
|
|
117
166
|
}
|
|
118
167
|
/** Implements hash empty document for the public runtime surface of this module. */
|
|
119
168
|
export function hashEmptyDocument() {
|
|
@@ -121,8 +170,8 @@ export function hashEmptyDocument() {
|
|
|
121
170
|
}
|
|
122
171
|
/** Implements create history entry for the public runtime surface of this module. */
|
|
123
172
|
export function createHistoryEntry(params) {
|
|
124
|
-
const beforeHashCanonical = canonicalHashDocument(params.before);
|
|
125
|
-
const afterHashCanonical = canonicalHashDocument(params.after);
|
|
173
|
+
const beforeHashCanonical = canonicalHashDocument(params.before, CURRENT_HISTORY_ITEM_HASH_VERSION);
|
|
174
|
+
const afterHashCanonical = canonicalHashDocument(params.after, CURRENT_HISTORY_ITEM_HASH_VERSION);
|
|
126
175
|
const beforePatchCanonical = canonicalPatchDocument(params.before);
|
|
127
176
|
const afterPatchCanonical = canonicalPatchDocument(params.after);
|
|
128
177
|
const rawPatch = jsonPatch.compare(beforePatchCanonical, afterPatchCanonical);
|
|
@@ -159,6 +208,7 @@ export function createHistoryEntry(params) {
|
|
|
159
208
|
patch,
|
|
160
209
|
before_hash: sha256Hex(stableStringify(beforeHashCanonical)),
|
|
161
210
|
after_hash: sha256Hex(stableStringify(afterHashCanonical)),
|
|
211
|
+
item_hash_version: CURRENT_HISTORY_ITEM_HASH_VERSION,
|
|
162
212
|
message: params.message === undefined ? undefined : params.message,
|
|
163
213
|
...(context === undefined ? {} : { context }),
|
|
164
214
|
};
|
|
@@ -242,4 +292,4 @@ export const _testOnly = {
|
|
|
242
292
|
isDefinedPointerPath,
|
|
243
293
|
};
|
|
244
294
|
//# sourceMappingURL=history.js.map
|
|
245
|
-
//# debugId=
|
|
295
|
+
//# debugId=2fc7f675-3500-5abb-8d5c-9ca9caa803b6
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { canonicalDocument } from "../item/item-format.js";
|
|
2
|
+
import { type HistoryItemHashVersion } from "./history.js";
|
|
2
3
|
import type { HistoryEntry, HistoryPatchOp, ItemDocument } from "../../types/index.js";
|
|
3
4
|
/**
|
|
4
5
|
* Shared history replay/patch mechanics single-sourced for the history, restore,
|
|
@@ -19,7 +20,7 @@ export declare const EMPTY_REPLAY_DOCUMENT: ReplayDocument;
|
|
|
19
20
|
/** Implements clone empty replay document for the public runtime surface of this module. */
|
|
20
21
|
export declare function cloneEmptyReplayDocument(): ReplayDocument;
|
|
21
22
|
/** Implements replay hash for the public runtime surface of this module. */
|
|
22
|
-
export declare function replayHash(document: ReplayDocument): string;
|
|
23
|
+
export declare function replayHash(document: ReplayDocument, version?: HistoryItemHashVersion): string;
|
|
23
24
|
/** Implements replay to item document for the public runtime surface of this module. */
|
|
24
25
|
export declare function replayToItemDocument(document: ReplayDocument): ItemDocument;
|
|
25
26
|
/** Converts a materialized replay document into a canonical item document. Use this when callers have already rejected the empty/deleted replay state and need restored metadata validated through the normal item-metadata rules. */
|
|
@@ -41,6 +42,13 @@ export type ReplayApplyResult = {
|
|
|
41
42
|
/** Strictly apply a history patch (front_matter->metadata normalized) to a replay document. Returns a result envelope rather than throwing so each caller can format its own error contract. */
|
|
42
43
|
export declare function tryApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): ReplayApplyResult;
|
|
43
44
|
/** Deterministically verify a history chain: each entry's before_hash must equal the prior replayed after_hash, the patch must strictly apply, and the recorded after_hash must equal the replayed result. */
|
|
45
|
+
/** Verify a chain and report the explicit or auto-detected item hash epoch. */
|
|
46
|
+
export declare function verifyHistoryChainWithVersion(entries: HistoryEntry[]): {
|
|
47
|
+
ok: boolean;
|
|
48
|
+
errors: string[];
|
|
49
|
+
item_hash_version?: HistoryItemHashVersion;
|
|
50
|
+
};
|
|
51
|
+
/** Deterministically verify a history chain while preserving the legacy result shape. */
|
|
44
52
|
export declare function verifyHistoryChain(entries: HistoryEntry[]): {
|
|
45
53
|
ok: boolean;
|
|
46
54
|
errors: string[];
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Implements append-only history and replay behavior for Replay.
|
|
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]="a1283470-00c7-5e91-8676-e1c1a667537f")}catch(e){}}();
|
|
8
8
|
import jsonPatch from "fast-json-patch";
|
|
9
9
|
import { ITEM_METADATA_KEY_ORDER } from "../shared/constants.js";
|
|
10
10
|
import { canonicalDocument } from "../item/item-format.js";
|
|
11
11
|
import { toItemRecord } from "../item/item-record.js";
|
|
12
12
|
import { orderObject, sha256Hex, stableStringify, } from "../shared/serialization.js";
|
|
13
|
-
import {
|
|
13
|
+
import { CURRENT_HISTORY_ITEM_HASH_VERSION, SUPPORTED_HISTORY_ITEM_HASH_VERSIONS, hashDocumentForVersion, } from "./history.js";
|
|
14
14
|
/** Public contract for empty replay document, shared by SDK and presentation-layer consumers. */
|
|
15
15
|
export const EMPTY_REPLAY_DOCUMENT = {
|
|
16
16
|
metadata: {},
|
|
@@ -21,11 +21,11 @@ export function cloneEmptyReplayDocument() {
|
|
|
21
21
|
return structuredClone(EMPTY_REPLAY_DOCUMENT);
|
|
22
22
|
}
|
|
23
23
|
/** Implements replay hash for the public runtime surface of this module. */
|
|
24
|
-
export function replayHash(document) {
|
|
24
|
+
export function replayHash(document, version = CURRENT_HISTORY_ITEM_HASH_VERSION) {
|
|
25
25
|
if (Object.keys(document.metadata).length === 0 ||
|
|
26
26
|
Array.isArray(document.metadata.tags)) {
|
|
27
27
|
try {
|
|
28
|
-
return
|
|
28
|
+
return hashDocumentForVersion(replayToItemDocument(document), version);
|
|
29
29
|
}
|
|
30
30
|
catch {
|
|
31
31
|
// Fall through when another malformed legacy field cannot be canonicalized.
|
|
@@ -124,14 +124,20 @@ export function tryApplyReplayPatch(current, patch) {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
/** Deterministically verify a history chain: each entry's before_hash must equal the prior replayed after_hash, the patch must strictly apply, and the recorded after_hash must equal the replayed result. */
|
|
127
|
-
|
|
127
|
+
/** Verify a chain and report the explicit or auto-detected item hash epoch. */
|
|
128
|
+
export function verifyHistoryChainWithVersion(entries) {
|
|
128
129
|
let replay = cloneEmptyReplayDocument();
|
|
130
|
+
let detectedVersion;
|
|
129
131
|
for (let index = 0; index < entries.length; index += 1) {
|
|
130
132
|
const entry = entries[index];
|
|
131
|
-
|
|
133
|
+
const explicitVersion = entry.item_hash_version;
|
|
134
|
+
if (explicitVersion !== undefined &&
|
|
135
|
+
!SUPPORTED_HISTORY_ITEM_HASH_VERSIONS.includes(explicitVersion)) {
|
|
132
136
|
return {
|
|
133
137
|
ok: false,
|
|
134
|
-
errors: [
|
|
138
|
+
errors: [
|
|
139
|
+
`verify_failed:unsupported_item_hash_version:${String(explicitVersion)}:entry_${index + 1}`,
|
|
140
|
+
],
|
|
135
141
|
};
|
|
136
142
|
}
|
|
137
143
|
const applied = tryApplyReplayPatch(replay, entry.patch);
|
|
@@ -141,15 +147,38 @@ export function verifyHistoryChain(entries) {
|
|
|
141
147
|
errors: [`verify_failed:patch_apply_failed:entry_${index + 1}`],
|
|
142
148
|
};
|
|
143
149
|
}
|
|
144
|
-
|
|
145
|
-
|
|
150
|
+
const candidates = explicitVersion === undefined
|
|
151
|
+
? [CURRENT_HISTORY_ITEM_HASH_VERSION, 1]
|
|
152
|
+
: [explicitVersion];
|
|
153
|
+
const beforeMatches = candidates.filter((version) => replayHash(replay, version) === entry.before_hash);
|
|
154
|
+
if (beforeMatches.length === 0) {
|
|
155
|
+
return {
|
|
156
|
+
ok: false,
|
|
157
|
+
errors: [`verify_failed:before_hash_mismatch:entry_${index + 1}`],
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const version = beforeMatches.find((candidate) => replayHash(applied.document, candidate) === entry.after_hash);
|
|
161
|
+
if (version === undefined) {
|
|
146
162
|
return {
|
|
147
163
|
ok: false,
|
|
148
164
|
errors: [`verify_failed:after_hash_mismatch:entry_${index + 1}`],
|
|
149
165
|
};
|
|
150
166
|
}
|
|
167
|
+
replay = applied.document;
|
|
168
|
+
detectedVersion = version;
|
|
151
169
|
}
|
|
152
|
-
return {
|
|
170
|
+
return {
|
|
171
|
+
ok: true,
|
|
172
|
+
errors: [],
|
|
173
|
+
...(detectedVersion === undefined
|
|
174
|
+
? {}
|
|
175
|
+
: { item_hash_version: detectedVersion }),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/** Deterministically verify a history chain while preserving the legacy result shape. */
|
|
179
|
+
export function verifyHistoryChain(entries) {
|
|
180
|
+
const result = verifyHistoryChainWithVersion(entries);
|
|
181
|
+
return { ok: result.ok, errors: result.errors };
|
|
153
182
|
}
|
|
154
183
|
function tryApplySingleOp(document, op) {
|
|
155
184
|
try {
|
|
@@ -192,6 +221,11 @@ export function lenientApplyReplayPatch(current, patch) {
|
|
|
192
221
|
}
|
|
193
222
|
/** Re-anchor a drifted history chain: replay every entry from empty, recompute the before/after hashes, and only rewrite a patch when the original op set no longer strictly applies (legacy drift). Clean entries keep their patch verbatim so the on-disk diff stays minimal. The returned chain verifies via verifyHistoryChain. */
|
|
194
223
|
export function reanchorHistoryEntries(entries) {
|
|
224
|
+
const unsupportedIndex = entries.findIndex((entry) => entry.item_hash_version !== undefined &&
|
|
225
|
+
!SUPPORTED_HISTORY_ITEM_HASH_VERSIONS.includes(entry.item_hash_version));
|
|
226
|
+
if (unsupportedIndex >= 0) {
|
|
227
|
+
throw new TypeError(`unsupported_item_hash_version:${String(entries[unsupportedIndex]?.item_hash_version)}:entry_${unsupportedIndex + 1}`);
|
|
228
|
+
}
|
|
195
229
|
let replay = cloneEmptyReplayDocument();
|
|
196
230
|
const rewritten = [];
|
|
197
231
|
const details = [];
|
|
@@ -201,7 +235,7 @@ export function reanchorHistoryEntries(entries) {
|
|
|
201
235
|
let skippedOps = 0;
|
|
202
236
|
for (let index = 0; index < entries.length; index += 1) {
|
|
203
237
|
const entry = entries[index];
|
|
204
|
-
const beforeHash = replayHash(replay);
|
|
238
|
+
const beforeHash = replayHash(replay, CURRENT_HISTORY_ITEM_HASH_VERSION);
|
|
205
239
|
const strict = tryApplyReplayPatch(replay, entry.patch);
|
|
206
240
|
let next;
|
|
207
241
|
let outPatch;
|
|
@@ -223,7 +257,7 @@ export function reanchorHistoryEntries(entries) {
|
|
|
223
257
|
skippedOps += entrySkipped;
|
|
224
258
|
entriesPatchRepaired += 1;
|
|
225
259
|
}
|
|
226
|
-
const afterHash = replayHash(next);
|
|
260
|
+
const afterHash = replayHash(next, CURRENT_HISTORY_ITEM_HASH_VERSION);
|
|
227
261
|
const rehashed = beforeHash !== entry.before_hash || afterHash !== entry.after_hash;
|
|
228
262
|
if (rehashed) {
|
|
229
263
|
entriesRehashed += 1;
|
|
@@ -233,6 +267,7 @@ export function reanchorHistoryEntries(entries) {
|
|
|
233
267
|
patch: outPatch,
|
|
234
268
|
before_hash: beforeHash,
|
|
235
269
|
after_hash: afterHash,
|
|
270
|
+
item_hash_version: CURRENT_HISTORY_ITEM_HASH_VERSION,
|
|
236
271
|
});
|
|
237
272
|
details.push({
|
|
238
273
|
index: index + 1,
|
|
@@ -261,4 +296,4 @@ export function historyEntriesToRaw(entries) {
|
|
|
261
296
|
return `${entries.map((entry) => JSON.stringify(entry)).join("\n")}\n`;
|
|
262
297
|
}
|
|
263
298
|
//# sourceMappingURL=replay.js.map
|
|
264
|
-
//# debugId=
|
|
299
|
+
//# debugId=a1283470-00c7-5e91-8676-e1c1a667537f
|
|
@@ -24,6 +24,8 @@ export interface OutputOptions {
|
|
|
24
24
|
outputFormat?: "toon" | "json";
|
|
25
25
|
/** Caller-carried cross-call budget and served-item state. */
|
|
26
26
|
outputSession?: string;
|
|
27
|
+
/** Include machine-readable row location and row-encoding metadata. */
|
|
28
|
+
outputRowContract?: boolean;
|
|
27
29
|
/** Fallback output format used when callers do not provide an override. */
|
|
28
30
|
defaultOutputFormat?: "toon" | "json";
|
|
29
31
|
/** Value that configures or reports command for this contract. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Formats compact human and machine output for Output.
|
|
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]="5aaf8b90-5b95-5102-9ea4-b877c696d593")}catch(e){}}();
|
|
8
8
|
import { getActiveCommandContext, runActiveCommandOverride, runActiveRendererOverride, runActiveServiceOverrideSync, setActiveCommandResult, } from "../extensions/index.js";
|
|
9
9
|
import { EXIT_CODE } from "../shared/constants.js";
|
|
10
10
|
import { isHostOutputSuppressed } from "./output-control.js";
|
|
@@ -12,6 +12,7 @@ import { projectMutationResult } from "./mutation-projection.js";
|
|
|
12
12
|
import { attachReadOutputContracts } from "../../sdk/context-intent-contracts.js";
|
|
13
13
|
import { attachOutputTokenAccounting } from "../../sdk/output-token-accounting.js";
|
|
14
14
|
import { resolveReadOutputEncoding } from "../../sdk/read-output-contracts.js";
|
|
15
|
+
import { encode as encodeToon } from "@toon-format/toon";
|
|
15
16
|
const DECLARED_PROCESS_EXIT_CODES = new Set(Object.values(EXIT_CODE));
|
|
16
17
|
const NATIVE_OUTPUT_MARKER = "__pm_native_output";
|
|
17
18
|
let streamErrorHandlersInstalled = false;
|
|
@@ -114,6 +115,44 @@ function renderScalar(value) {
|
|
|
114
115
|
return "null";
|
|
115
116
|
return JSON.stringify(value);
|
|
116
117
|
}
|
|
118
|
+
function isToonPrimitive(value) {
|
|
119
|
+
return (value === null ||
|
|
120
|
+
typeof value === "string" ||
|
|
121
|
+
typeof value === "number" ||
|
|
122
|
+
typeof value === "boolean");
|
|
123
|
+
}
|
|
124
|
+
function tabularObjectArray(value) {
|
|
125
|
+
if (value.length === 0 || !value.every(isPlainObject))
|
|
126
|
+
return false;
|
|
127
|
+
const keys = Object.keys(value[0]);
|
|
128
|
+
return (keys.length > 0 &&
|
|
129
|
+
value.every((entry) => Object.keys(entry).length === keys.length &&
|
|
130
|
+
keys.every((key) => Object.hasOwn(entry, key) && isToonPrimitive(entry[key]))));
|
|
131
|
+
}
|
|
132
|
+
function indentToon(encoded, depth) {
|
|
133
|
+
const indent = " ".repeat(depth);
|
|
134
|
+
return encoded
|
|
135
|
+
.split("\n")
|
|
136
|
+
.map((line) => `${indent}${line}`)
|
|
137
|
+
.join("\n");
|
|
138
|
+
}
|
|
139
|
+
/** Render one object field while preserving nested and tabular TOON structure. */
|
|
140
|
+
function renderToonObjectEntry(key, entry, depth) {
|
|
141
|
+
const indent = " ".repeat(depth);
|
|
142
|
+
if (!isPlainObject(entry) && !Array.isArray(entry)) {
|
|
143
|
+
return `${indent}${key}: ${renderScalar(entry)}`;
|
|
144
|
+
}
|
|
145
|
+
if (Array.isArray(entry) && entry.length === 0) {
|
|
146
|
+
return `${indent}${key}: []`;
|
|
147
|
+
}
|
|
148
|
+
if (Array.isArray(entry) && tabularObjectArray(entry)) {
|
|
149
|
+
return indentToon(encodeToon({ [key]: entry }), depth);
|
|
150
|
+
}
|
|
151
|
+
if (isPlainObject(entry) && Object.keys(entry).length === 0) {
|
|
152
|
+
return `${indent}${key}: {}`;
|
|
153
|
+
}
|
|
154
|
+
return `${indent}${key}:\n${renderToonValue(entry, depth + 1)}`;
|
|
155
|
+
}
|
|
117
156
|
function compactToonValue(value) {
|
|
118
157
|
if (value === null || value === undefined) {
|
|
119
158
|
return undefined;
|
|
@@ -147,6 +186,9 @@ function renderToonValue(value, depth) {
|
|
|
147
186
|
if (Array.isArray(value)) {
|
|
148
187
|
if (value.length === 0)
|
|
149
188
|
return "[]";
|
|
189
|
+
if (tabularObjectArray(value)) {
|
|
190
|
+
return indentToon(encodeToon(value), depth);
|
|
191
|
+
}
|
|
150
192
|
return value
|
|
151
193
|
.map((entry) => {
|
|
152
194
|
if (!isPlainObject(entry) && !Array.isArray(entry)) {
|
|
@@ -167,18 +209,7 @@ function renderToonValue(value, depth) {
|
|
|
167
209
|
if (entries.length === 0)
|
|
168
210
|
return "{}";
|
|
169
211
|
return entries
|
|
170
|
-
.map(([key, entry]) =>
|
|
171
|
-
if (!isPlainObject(entry) && !Array.isArray(entry)) {
|
|
172
|
-
return `${indent}${key}: ${renderScalar(entry)}`;
|
|
173
|
-
}
|
|
174
|
-
if (Array.isArray(entry) && entry.length === 0) {
|
|
175
|
-
return `${indent}${key}: []`;
|
|
176
|
-
}
|
|
177
|
-
if (isPlainObject(entry) && Object.keys(entry).length === 0) {
|
|
178
|
-
return `${indent}${key}: {}`;
|
|
179
|
-
}
|
|
180
|
-
return `${indent}${key}:\n${renderToonValue(entry, depth + 1)}`;
|
|
181
|
-
})
|
|
212
|
+
.map(([key, entry]) => renderToonObjectEntry(key, entry, depth))
|
|
182
213
|
.join("\n");
|
|
183
214
|
}
|
|
184
215
|
return `${indent}${renderScalar(value)}`;
|
|
@@ -335,6 +366,7 @@ function formatEffectiveOutput(effectiveResult, nativeOutput, options) {
|
|
|
335
366
|
["outputBudget", options.outputBudget],
|
|
336
367
|
["outputFormat", options.outputFormat],
|
|
337
368
|
["outputSession", options.outputSession],
|
|
369
|
+
["outputRowContract", options.outputRowContract],
|
|
338
370
|
].filter((entry) => entry[1] !== undefined)),
|
|
339
371
|
};
|
|
340
372
|
const format = resolveReadOutputEncoding(command ?? "", commandOptions) ??
|
|
@@ -424,4 +456,4 @@ export const outputTestOnly = {
|
|
|
424
456
|
renderToonValue,
|
|
425
457
|
};
|
|
426
458
|
//# sourceMappingURL=output.js.map
|
|
427
|
-
//# debugId=
|
|
459
|
+
//# debugId=5aaf8b90-5b95-5102-9ea4-b877c696d593
|
|
@@ -9,11 +9,58 @@
|
|
|
9
9
|
export interface SessionState {
|
|
10
10
|
/** Value that configures or reports focused item for this contract. */
|
|
11
11
|
focused_item?: string;
|
|
12
|
+
/** Privacy-safe semantic work context partitioned by agent invocation. */
|
|
13
|
+
semantic_attribution?: Record<string, AgentSemanticAttribution>;
|
|
14
|
+
}
|
|
15
|
+
/** Bounded inferred work context consumed by mutation provenance. */
|
|
16
|
+
export interface AgentSemanticAttribution {
|
|
17
|
+
/** Controlled role inferred from the current work lifecycle. */
|
|
18
|
+
role: "implementer" | "planner" | "release-operator";
|
|
19
|
+
/** Stable item or workset identity, never prompt text. */
|
|
20
|
+
topic: string;
|
|
21
|
+
/** Confidence attached to the inferred observation. */
|
|
22
|
+
confidence: "high" | "medium";
|
|
23
|
+
/** Versioned inference rule understood by history consumers. */
|
|
24
|
+
rule_version: "v2";
|
|
25
|
+
/** Bounded item and lineage references supporting the inference. */
|
|
26
|
+
evidence: string[];
|
|
27
|
+
/** Claimed items currently contributing to the workset. */
|
|
28
|
+
active_item_ids: string[];
|
|
29
|
+
/** Explicitly focused item when focus takes precedence over claims. */
|
|
30
|
+
focused_item_id?: string;
|
|
12
31
|
}
|
|
13
32
|
/** Implements get session state path for the public runtime surface of this module. */
|
|
14
33
|
export declare function getSessionStatePath(pmRoot: string): string;
|
|
15
34
|
/** Implements read session state for the public runtime surface of this module. */
|
|
16
35
|
export declare function readSessionState(pmRoot: string): Promise<SessionState>;
|
|
36
|
+
/** Derive a non-secret state key from a claim principal. */
|
|
37
|
+
export declare function semanticAttributionKey(principal: string): string;
|
|
38
|
+
/** Record a successful claim as incremental semantic session evidence. */
|
|
39
|
+
export declare function recordClaimedWorkAttribution(params: {
|
|
40
|
+
pmRoot: string;
|
|
41
|
+
principal: string;
|
|
42
|
+
itemId: string;
|
|
43
|
+
lineageIds?: readonly string[];
|
|
44
|
+
}): Promise<void>;
|
|
45
|
+
/** Remove a released item from incremental semantic session evidence. */
|
|
46
|
+
export declare function releaseClaimedWorkAttribution(params: {
|
|
47
|
+
pmRoot: string;
|
|
48
|
+
principal: string;
|
|
49
|
+
itemId: string;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
/** Set or clear focus as the highest-confidence semantic topic. */
|
|
52
|
+
export declare function recordFocusedWorkAttribution(params: {
|
|
53
|
+
pmRoot: string;
|
|
54
|
+
principal: string;
|
|
55
|
+
itemId?: string;
|
|
56
|
+
lineageIds?: readonly string[];
|
|
57
|
+
}): Promise<void>;
|
|
58
|
+
/** Read one privacy-bounded inferred attribution without making mutations fail. */
|
|
59
|
+
export declare function readAgentSemanticAttributionSync(params: {
|
|
60
|
+
cwd: string;
|
|
61
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
62
|
+
key: string | undefined;
|
|
63
|
+
}): AgentSemanticAttribution | undefined;
|
|
17
64
|
/** Implements get focused item for the public runtime surface of this module. */
|
|
18
65
|
export declare function getFocusedItem(pmRoot: string): Promise<string | undefined>;
|
|
19
66
|
/** Implements set focused item for the public runtime surface of this module. */
|