@unbrained/pm-cli 2026.8.13 → 2026.8.15
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 +165 -113
- package/dist/cli/commander-usage.js +17 -4
- package/dist/cli/error-guidance.d.ts +2 -0
- package/dist/cli/error-guidance.js +52 -25
- package/dist/cli/main.js +40 -3
- package/dist/cli/register-mutation.js +4 -2
- package/dist/cli/register-operations.js +5 -5
- package/dist/cli-bundle/bundle-manifest.json +146 -178
- package/dist/cli-bundle/chunks/{chunk-F7FJYGK3.js → chunk-24GAV7XL.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-AIM6VT2N.js +13 -0
- package/dist/cli-bundle/chunks/chunk-DSWDLTDR.js +197 -0
- package/dist/cli-bundle/chunks/{chunk-Q47C67TQ.js → chunk-J42EGKDK.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-KIEGUBYQ.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-3ZMOWAFM.js → chunk-KLKYLSDX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QGTUPEU5.js → chunk-LJHOAVGI.js} +59 -59
- package/dist/cli-bundle/chunks/chunk-MEM2ZS3O.js +5 -0
- package/dist/cli-bundle/chunks/chunk-QHPCJWEJ.js +35 -0
- package/dist/cli-bundle/chunks/{chunk-YLBAPY22.js → chunk-WLPDLNEZ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-4HIZ7EA3.js → register-list-query-CT3LFDDN.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-W64FZ5HN.js → register-mutation-NWEVA5YS.js} +3 -3
- package/dist/cli-bundle/chunks/register-operations-AHIAG5KM.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-634MFRXU.js → register-setup-ZJZFVAKE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4X57RE4U.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-6XKF3PGV.js +18 -0
- package/dist/cli-bundle/focused-chunks/chunk-7NJ4QYQ2.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-I75MANL7.js → chunk-EXZA4257.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ITAUHSO6.js +50 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OOYYKQWX.js → chunk-KLVUMNXJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-2RI2FESN.js → chunk-KT5XMYSX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-E3AVJ655.js → chunk-KTKH4IMG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-M67F5AIN.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-3DJSGWVB.js → chunk-NSPYTG6G.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-OKA6ELTL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-PUISBOPP.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QLNMCESQ.js +155 -0
- package/dist/cli-bundle/focused-chunks/{chunk-IIS2FRKL.js → chunk-SLKC6QLJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-U65UC4G3.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-WTSER4WJ.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-2JP7W7GO.js → chunk-ZMFXQ7VF.js} +2 -2
- 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 -41
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +110 -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 +7 -2
- package/dist/core/extensions/reserved-host-flags.js +3 -2
- package/dist/core/history/drift-scan.d.ts +6 -0
- package/dist/core/history/drift-scan.js +74 -50
- package/dist/core/history/replay.d.ts +14 -1
- package/dist/core/history/replay.js +45 -8
- package/dist/core/history/workspace-history.d.ts +59 -0
- package/dist/core/history/workspace-history.js +197 -10
- package/dist/core/output/output.d.ts +2 -0
- package/dist/core/output/output.js +13 -4
- 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 +12 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/mcp/tool-definitions.js +9 -5
- package/dist/sdk/agent/refusal-reachability.d.ts +61 -0
- package/dist/sdk/agent/refusal-reachability.js +91 -3
- package/dist/sdk/cli-bootstrap.d.ts +2 -0
- package/dist/sdk/cli-bootstrap.js +7 -2
- package/dist/sdk/cli-contracts/completeness.js +3 -2
- package/dist/sdk/cli-contracts/flag-contracts.js +3 -2
- package/dist/sdk/cli-contracts/registration-helpers.js +3 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +11 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +176 -65
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -5
- package/dist/sdk/cli-contracts/tool-schema.js +10 -3
- package/dist/sdk/cli-program.js +4 -3
- package/dist/sdk/context-relevance.js +12 -4
- package/dist/sdk/core.d.ts +2 -2
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +26 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +50 -26
- package/dist/sdk/governance/assurance-action.d.ts +7 -1
- package/dist/sdk/governance/assurance-action.js +7 -6
- package/dist/sdk/governance/assurance-mutation-error.d.ts +42 -1
- package/dist/sdk/governance/assurance-mutation-error.js +27 -3
- package/dist/sdk/governance/assurance-runtime.js +12 -11
- package/dist/sdk/governance/assurance.d.ts +9 -0
- package/dist/sdk/governance/assurance.js +82 -16
- package/dist/sdk/governance/extension-host-version.d.ts +25 -0
- package/dist/sdk/governance/extension-host-version.js +105 -0
- package/dist/sdk/governance/health.d.ts +32 -1
- package/dist/sdk/governance/health.js +132 -28
- package/dist/sdk/governance/provenance-health.d.ts +27 -0
- package/dist/sdk/governance/provenance-health.js +95 -3
- package/dist/sdk/governance/validate-history-drift.d.ts +7 -0
- package/dist/sdk/governance/validate-history-drift.js +68 -0
- package/dist/sdk/governance/validate.js +9 -52
- package/dist/sdk/governance.d.ts +6 -0
- package/dist/sdk/governance.js +8 -2
- package/dist/sdk/graph/assembly.d.ts +23 -0
- package/dist/sdk/graph/assembly.js +54 -2
- package/dist/sdk/graph/durable-cache.js +50 -20
- package/dist/sdk/graph/governance-contracts.d.ts +1 -1
- package/dist/sdk/graph/governance-contracts.js +4 -2
- package/dist/sdk/graph/governance.d.ts +21 -1
- package/dist/sdk/graph/governance.js +94 -32
- package/dist/sdk/graph/index.d.ts +2 -2
- package/dist/sdk/graph/index.js +4 -4
- package/dist/sdk/graph/mutation-advisory.js +15 -7
- package/dist/sdk/graph/remediation.js +12 -2
- package/dist/sdk/history-read.d.ts +8 -0
- package/dist/sdk/history-read.js +2 -2
- package/dist/sdk/history-repair.d.ts +13 -1
- package/dist/sdk/history-repair.js +62 -18
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/linked-artifacts.js +16 -5
- package/dist/sdk/pagination.d.ts +15 -0
- package/dist/sdk/pagination.js +9 -5
- package/dist/sdk/query/context.d.ts +5 -1
- package/dist/sdk/query/context.js +14 -5
- package/dist/sdk/query/history.js +20 -3
- package/dist/sdk/read-output/continuation.d.ts +11 -0
- package/dist/sdk/read-output/continuation.js +132 -0
- package/dist/sdk/read-output-budget.d.ts +3 -1
- package/dist/sdk/read-output-budget.js +24 -13
- package/dist/sdk/read-output-contracts.d.ts +127 -7
- package/dist/sdk/read-output-contracts.js +381 -35
- package/dist/sdk/read-output-rows.d.ts +13 -0
- package/dist/sdk/read-output-rows.js +60 -2
- package/dist/sdk/runtime-input.js +4 -2
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/dist/sdk/runtime.js +5 -3
- package/docs/ASSURANCE.md +68 -2
- package/docs/COMMANDS.md +39 -4
- package/docs/READ_OUTPUT_CONTRACTS.md +85 -8
- package/docs/RELATIONSHIP_GRAPH.md +20 -5
- package/docs/RELEASING.md +42 -5
- package/docs/SDK.md +12 -5
- package/docs/SDK_CONTEXT_INTEGRITY.md +94 -1
- package/docs/TESTING.md +23 -1
- package/docs/performance/sdk-entrypoint-import-costs.md +20 -13
- package/marketplace.json +2 -2
- package/package.json +7 -7
- package/packages/pm-beads/extensions/beads/index.ts +1 -0
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/extensions/calendar/index.ts +1 -0
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/extensions/digital-twin/index.ts +7 -0
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +4 -0
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +5 -0
- 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/extensions/linked-test-adapters/index.ts +6 -0
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +2 -0
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/extensions/templates/index.ts +4 -0
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/extensions/todos/index.ts +2 -0
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/extensions/vcs/index.ts +7 -0
- 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/scripts/bundle-cli.mjs +17 -4
- package/sdk/public-surface.json +1283 -157
- package/dist/cli-bundle/chunks/chunk-DEDU3DG7.js +0 -196
- package/dist/cli-bundle/chunks/chunk-DL5M5J3V.js +0 -13
- package/dist/cli-bundle/chunks/chunk-HIUZVCMN.js +0 -5
- package/dist/cli-bundle/chunks/chunk-IMGIN7R6.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TF3TPKPR.js +0 -34
- package/dist/cli-bundle/chunks/register-operations-C44ET7R5.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-27N23W6M.js +0 -31
- package/dist/cli-bundle/focused-chunks/chunk-3BNVU6LC.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-6MLIRBLV.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-6XYLENDV.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-CP4K4WFS.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-EBTNSFYE.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HC2OL2H2.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-NFHFZH2Z.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-OGC4XSBC.js +0 -17
- package/dist/cli-bundle/focused-chunks/chunk-PKPOZXLL.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-QDZUABWL.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-QQX5TDFT.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-TEZIXMTH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-WEH6NSL6.js +0 -18
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export { decodeReadOutputContinuationCursor, encodeReadOutputContinuationCursor, } from "./read-output/continuation.js";
|
|
1
2
|
import { type PmReadOutputSessionReceipt, type PmReadOutputSessionState } from "./read-output-session.js";
|
|
2
3
|
/** Stable output dimensions shared by every read surface. */
|
|
3
4
|
export declare const PM_READ_OUTPUT_DIMENSIONS: readonly ["include", "amount", "cost", "encoding"];
|
|
4
5
|
/** One member of the universal read-output dimension set. */
|
|
5
6
|
export type PmReadOutputDimension = (typeof PM_READ_OUTPUT_DIMENSIONS)[number];
|
|
6
7
|
/** Built-in command roots whose primary operation is a read. */
|
|
7
|
-
export declare const PM_READ_OUTPUT_SURFACES: readonly ["list", "context", "search", "get", "next", "health", "deps", "graph", "history", "activity", "validate", "events", "contracts", "comments", "notes", "files", "docs", "stats", "aggregate", "package-manage"];
|
|
8
|
+
export declare const PM_READ_OUTPUT_SURFACES: readonly ["list", "context", "search", "get", "next", "health", "deps", "graph", "history", "activity", "validate", "events", "contracts", "comments", "notes", "files", "docs", "stats", "aggregate", "package-manage", "comments-audit", "assurance"];
|
|
8
9
|
/** Built-in read command supported by the universal output contract. */
|
|
9
10
|
export type PmReadOutputSurface = (typeof PM_READ_OUTPUT_SURFACES)[number];
|
|
10
11
|
/** Canonical output controls accepted by every built-in read action. */
|
|
@@ -13,12 +14,14 @@ export interface PmReadOutputOptions {
|
|
|
13
14
|
outputInclude?: string | string[];
|
|
14
15
|
/** Maximum rows retained, or `unbounded` to disable the shared row ceiling. */
|
|
15
16
|
outputLimit?: string | number | "unbounded";
|
|
16
|
-
/** Maximum estimated result tokens. */
|
|
17
|
-
outputBudget?: string | number;
|
|
17
|
+
/** Maximum estimated result tokens, or `unbounded` to disable the default ceiling. */
|
|
18
|
+
outputBudget?: string | number | "unbounded";
|
|
18
19
|
/** Requested static renderer encoding; streaming remains a command behavior. */
|
|
19
20
|
outputFormat?: "json" | "toon";
|
|
20
21
|
/** Caller-carried cross-call budget and served-fact state. */
|
|
21
22
|
outputSession?: string | PmReadOutputSessionState;
|
|
23
|
+
/** Opaque continuation returned after a budget-compacted declared row path. */
|
|
24
|
+
outputCursor?: string;
|
|
22
25
|
/** Include row selector and encoding discovery metadata. */
|
|
23
26
|
outputRowContract?: boolean;
|
|
24
27
|
}
|
|
@@ -26,6 +29,8 @@ export interface PmReadOutputOptions {
|
|
|
26
29
|
export interface PmReadOutputLegacyAlias {
|
|
27
30
|
/** Historical CLI spelling. */
|
|
28
31
|
flag: string;
|
|
32
|
+
/** Strength of the migration promise carried by this alias. */
|
|
33
|
+
semantics?: "replacement" | "behavior_preserving";
|
|
29
34
|
/** One-line migration instruction for agents and help generators. */
|
|
30
35
|
migration_hint: string;
|
|
31
36
|
/** Compatibility aliases are accepted but omitted from the canonical vocabulary. */
|
|
@@ -52,6 +57,8 @@ export interface PmReadOutputSurfaceContract {
|
|
|
52
57
|
dimensions: Record<PmReadOutputDimension, PmReadOutputDimensionContract>;
|
|
53
58
|
/** Deterministic precedence from strongest caller declaration to fallback. */
|
|
54
59
|
precedence: readonly ["canonical", "legacy", "intent", "default"];
|
|
60
|
+
/** Stable policy used before budget compaction selects retained rows. */
|
|
61
|
+
budget_retention_policy: "ordered_prefix" | "verdict_priority";
|
|
55
62
|
}
|
|
56
63
|
/** Source that selected an effective output dimension. */
|
|
57
64
|
export type PmReadOutputDimensionSource = "canonical" | "legacy" | "intent" | "default";
|
|
@@ -70,8 +77,8 @@ export interface PmResolvedReadOutputDimensions {
|
|
|
70
77
|
include?: PmResolvedReadOutputDimension<string[]>;
|
|
71
78
|
/** Requested row ceiling. */
|
|
72
79
|
amount?: PmResolvedReadOutputDimension<number | "unbounded">;
|
|
73
|
-
/** Requested estimated-token ceiling. */
|
|
74
|
-
cost?: PmResolvedReadOutputDimension<number>;
|
|
80
|
+
/** Requested estimated-token ceiling or explicit opt-out. */
|
|
81
|
+
cost?: PmResolvedReadOutputDimension<number | "unbounded">;
|
|
75
82
|
/** Requested static encoding or a retained legacy streaming behavior. */
|
|
76
83
|
encoding?: PmResolvedReadOutputDimension<"json" | "toon" | "stream">;
|
|
77
84
|
/** Compatibility flags observed on the invocation. */
|
|
@@ -89,6 +96,10 @@ export interface PmReadOutputReceipt {
|
|
|
89
96
|
command: PmReadOutputSurface;
|
|
90
97
|
/** Dimensions explicitly or compatibly requested by the invocation. */
|
|
91
98
|
requested_dimensions: PmReadOutputDimension[];
|
|
99
|
+
/** Layer that supplied an automatically applied token ceiling. */
|
|
100
|
+
budget_source?: "default";
|
|
101
|
+
/** Automatically applied token ceiling; explicit/session budgets already disclose their value. */
|
|
102
|
+
budget_tokens?: number;
|
|
92
103
|
/** Deterministic precedence used during resolution. */
|
|
93
104
|
precedence: readonly ["canonical", "legacy", "intent", "default"];
|
|
94
105
|
/** Compatibility options observed on the invocation. */
|
|
@@ -103,8 +114,82 @@ export interface PmReadOutputReceipt {
|
|
|
103
114
|
strings_compacted: boolean;
|
|
104
115
|
/** Whether row collections were reduced while satisfying the cost ceiling. */
|
|
105
116
|
rows_compacted: boolean;
|
|
117
|
+
/** Declared or nested collection paths reduced by budget degradation. */
|
|
118
|
+
compacted_row_paths?: string[];
|
|
106
119
|
/** Whether the requested cost ceiling forced the useful result to be omitted. */
|
|
107
120
|
result_omitted: boolean;
|
|
121
|
+
/** Estimated tokens in the useful result immediately before whole-result omission. */
|
|
122
|
+
omitted_result_estimated_tokens?: number;
|
|
123
|
+
}
|
|
124
|
+
/** Machine-readable explanation of budget-driven row degradation. */
|
|
125
|
+
export interface PmReadOutputTruncationDisclosure {
|
|
126
|
+
/** Stable reason for dropping rows. */
|
|
127
|
+
reason: "output_budget_reached";
|
|
128
|
+
/** Layer that supplied the binding ceiling. */
|
|
129
|
+
budget_source: PmReadOutputDimensionSource | "session";
|
|
130
|
+
/** Binding estimated-token ceiling. */
|
|
131
|
+
budget_tokens: number;
|
|
132
|
+
/** Explicit dimensions whose unbounded request was overridden by the ceiling. */
|
|
133
|
+
overridden_dimensions: PmReadOutputDimension[];
|
|
134
|
+
/** Declared or nested collection paths reduced by budget degradation. */
|
|
135
|
+
compacted_row_paths: string[];
|
|
136
|
+
/** Whether next_cursor was moved back to the last row that survived compaction. */
|
|
137
|
+
continuation_cursor_rebased: boolean;
|
|
138
|
+
/** Whether at least one declared row collection can be resumed within the budget. */
|
|
139
|
+
continuation_available: boolean;
|
|
140
|
+
/** Maximum next-page useful-result budget relative to the current budget. */
|
|
141
|
+
recovery_budget_multiplier: 1;
|
|
142
|
+
/** Bounded continuation instructions for every compacted declared row path. */
|
|
143
|
+
continuations: PmReadOutputContinuation[];
|
|
144
|
+
/** Executable recovery instruction for retrieving the complete result. */
|
|
145
|
+
restore_with: string;
|
|
146
|
+
/** Transport-specific machine recovery options. */
|
|
147
|
+
recovery: {
|
|
148
|
+
/** Opaque value supplied through each declared transport binding. */
|
|
149
|
+
cursor: string;
|
|
150
|
+
/** CLI option accepting cursor. */
|
|
151
|
+
cli: "--output-cursor";
|
|
152
|
+
/** SDK option field accepting cursor. */
|
|
153
|
+
sdk: "outputCursor";
|
|
154
|
+
/** MCP input field accepting cursor. */
|
|
155
|
+
mcp: "outputCursor";
|
|
156
|
+
} | {
|
|
157
|
+
cli: string;
|
|
158
|
+
sdk: {
|
|
159
|
+
outputBudget: number;
|
|
160
|
+
};
|
|
161
|
+
mcp: {
|
|
162
|
+
outputBudget: number;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** One resumable declared-row collection withheld by budget compaction. */
|
|
167
|
+
export interface PmReadOutputContinuation {
|
|
168
|
+
/** Dot-delimited declared row path being resumed. */
|
|
169
|
+
path: string;
|
|
170
|
+
/** Opaque cursor accepted by CLI, SDK, and MCP outputCursor inputs. */
|
|
171
|
+
cursor: string;
|
|
172
|
+
/** Rows retained from this path in the current response. */
|
|
173
|
+
retained_rows: number;
|
|
174
|
+
/** Rows remaining after the current response. */
|
|
175
|
+
remaining_rows: number;
|
|
176
|
+
/** Total rows in the stable collection snapshot. */
|
|
177
|
+
total_rows: number;
|
|
178
|
+
}
|
|
179
|
+
/** Versioned, command-bound cursor payload for one stable declared row collection. */
|
|
180
|
+
export interface PmReadOutputCursorEnvelope {
|
|
181
|
+
/** Serialized cursor format version. */
|
|
182
|
+
version: 1;
|
|
183
|
+
/** Canonical read surface that produced the cursor. */
|
|
184
|
+
command: PmReadOutputSurface;
|
|
185
|
+
/** Dot-delimited declared row path being continued. */
|
|
186
|
+
path: string;
|
|
187
|
+
/** Zero-based index of the first withheld row. */
|
|
188
|
+
offset: number;
|
|
189
|
+
/** Stable pre-projection denominator for the row collection. */
|
|
190
|
+
total_rows: number;
|
|
191
|
+
/** Stable identity fingerprint used to refuse stale continuation. */
|
|
192
|
+
fingerprint: string;
|
|
108
193
|
}
|
|
109
194
|
/** Result returned when the requested cost ceiling cannot fit useful content. */
|
|
110
195
|
export interface PmReadOutputBudgetExceeded {
|
|
@@ -116,6 +201,10 @@ export interface PmReadOutputBudgetExceeded {
|
|
|
116
201
|
reason: "requested_budget_infeasible";
|
|
117
202
|
/** Human- and agent-readable recovery instruction. */
|
|
118
203
|
restore_with: string;
|
|
204
|
+
/** Transport-specific machine recovery options. */
|
|
205
|
+
recovery: {
|
|
206
|
+
outputBudget: "unbounded";
|
|
207
|
+
};
|
|
119
208
|
};
|
|
120
209
|
/** Exact receipt for the bounded omission envelope. */
|
|
121
210
|
read_output: PmReadOutputReceipt;
|
|
@@ -124,21 +213,52 @@ export interface PmReadOutputBudgetExceeded {
|
|
|
124
213
|
export type PmReadOutputResult<Result> = (Result & {
|
|
125
214
|
read_output?: PmReadOutputReceipt;
|
|
126
215
|
read_session?: PmReadOutputSessionReceipt;
|
|
216
|
+
output_budget_truncation?: PmReadOutputTruncationDisclosure;
|
|
127
217
|
}) | (PmReadOutputBudgetExceeded & {
|
|
128
218
|
read_session?: PmReadOutputSessionReceipt;
|
|
129
219
|
});
|
|
130
220
|
/** Select the omission-aware result type when an option shape can request a budget. */
|
|
131
|
-
export type PmReadOutputResultFor<Result, Options> = "outputBudget" extends keyof Options ? PmReadOutputResult<Result> : "outputSession" extends keyof Options ? PmReadOutputResult<Result> : Result;
|
|
221
|
+
export type PmReadOutputResultFor<Result, Options> = "outputBudget" extends keyof Options ? PmReadOutputResult<Result> : "outputSession" extends keyof Options ? PmReadOutputResult<Result> : "outputCursor" extends keyof Options ? PmReadOutputResult<Result> : Result;
|
|
132
222
|
/** Canonical CLI flags that opt a read invocation into universal output shaping. */
|
|
133
223
|
export declare const PM_READ_OUTPUT_OPTION_FLAGS: readonly string[];
|
|
134
224
|
/** Canonical control that composes the four per-call dimensions across reads. */
|
|
135
|
-
export declare const PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS: readonly ["--output-session", "--output-row-contract"];
|
|
225
|
+
export declare const PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS: readonly ["--output-session", "--output-cursor", "--output-row-contract"];
|
|
136
226
|
/** Universal output contract for every built-in read surface. */
|
|
137
227
|
export declare const PM_READ_OUTPUT_SURFACE_CONTRACTS: readonly PmReadOutputSurfaceContract[];
|
|
138
228
|
/** Resolve a command or list/context alias to its canonical read-output surface. */
|
|
139
229
|
export declare function resolveReadOutputSurface(command: string): PmReadOutputSurface | undefined;
|
|
140
230
|
/** Reject malformed or mutation-scoped universal output controls before command execution. */
|
|
141
231
|
export declare function validateReadOutputOptions(command: string, options: Record<string, unknown>): void;
|
|
232
|
+
/**
|
|
233
|
+
* Map every canonical `--output-include` token that names a projection mode
|
|
234
|
+
* rather than a row field onto the command-local option that mode already owns.
|
|
235
|
+
*
|
|
236
|
+
* The include dimension folds two kinds of legacy alias into one canonical
|
|
237
|
+
* spelling: value-bearing selectors (`--fields`, `--section`) that name row
|
|
238
|
+
* fields, and mode flags (`--brief`, `--full`, `--summary`, ...) that select a
|
|
239
|
+
* whole declared projection. Only the first kind can be honoured by projecting
|
|
240
|
+
* an already-computed result, so mode tokens have to reach the command itself.
|
|
241
|
+
*/
|
|
242
|
+
export declare function readOutputIncludeModeOptions(command: string): ReadonlyMap<string, string>;
|
|
243
|
+
/**
|
|
244
|
+
* Translate canonical projection-mode tokens into the command-local options
|
|
245
|
+
* they alias, so the spelling the migration hints recommend is behaviour
|
|
246
|
+
* identical to the legacy flag it replaces, and return the field selectors that
|
|
247
|
+
* remain for post-execution projection.
|
|
248
|
+
*/
|
|
249
|
+
export declare function applyReadOutputIncludeModes(command: string, includeValue: unknown, commandOptions: Record<string, unknown>): {
|
|
250
|
+
selectors: string[];
|
|
251
|
+
modes: string[];
|
|
252
|
+
};
|
|
253
|
+
/**
|
|
254
|
+
* Resolve canonical include modes against one combined options bag, rewriting
|
|
255
|
+
* the include value in place to the selectors that remain.
|
|
256
|
+
*
|
|
257
|
+
* Used by dispatch paths that carry command options and universal output
|
|
258
|
+
* controls in a single record, so an action honours a mode token exactly as the
|
|
259
|
+
* CLI does.
|
|
260
|
+
*/
|
|
261
|
+
export declare function normalizeReadOutputIncludeModeOptions(command: string, options: Record<string, unknown>): void;
|
|
142
262
|
/** Resolve canonical and compatibility controls into the universal dimension set. */
|
|
143
263
|
export declare function resolveReadOutputDimensions(command: string, options: Record<string, unknown>): PmResolvedReadOutputDimensions | undefined;
|
|
144
264
|
/** Recompute read and optional session receipts after a final envelope projection. */
|