@unbrained/pm-cli 2026.8.11 → 2026.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +74 -21
- package/dist/cli/commander-usage.js +37 -11
- package/dist/cli/error-guidance.d.ts +2 -0
- package/dist/cli/error-guidance.js +82 -19
- package/dist/cli/main.js +35 -19
- package/dist/cli/register-annotations.js +56 -3
- package/dist/cli/register-assurance.js +28 -17
- package/dist/cli/register-list-query.js +10 -7
- package/dist/cli/register-operations.js +16 -6
- package/dist/cli-bundle/bundle-manifest.json +163 -163
- package/dist/cli-bundle/chunks/chunk-3ZMOWAFM.js +2 -0
- package/dist/cli-bundle/chunks/chunk-DEDU3DG7.js +196 -0
- package/dist/cli-bundle/chunks/chunk-DL5M5J3V.js +13 -0
- package/dist/cli-bundle/chunks/chunk-F7FJYGK3.js +8 -0
- package/dist/cli-bundle/chunks/chunk-HIUZVCMN.js +5 -0
- package/dist/cli-bundle/chunks/chunk-IMGIN7R6.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-A2SJGHSI.js → chunk-Q47C67TQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WMEZHCFI.js → chunk-QGTUPEU5.js} +62 -54
- package/dist/cli-bundle/chunks/chunk-TF3TPKPR.js +34 -0
- package/dist/cli-bundle/chunks/{chunk-ZU34C3LH.js → chunk-YLBAPY22.js} +50 -50
- package/dist/cli-bundle/chunks/register-list-query-4HIZ7EA3.js +10 -0
- package/dist/cli-bundle/chunks/register-mutation-W64FZ5HN.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-C44ET7R5.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-NOCOOWQY.js → register-setup-634MFRXU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-27N23W6M.js +31 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4H5IA6AV.js → chunk-2JP7W7GO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2RI2FESN.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-3BNVU6LC.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-2DL3MRTD.js → chunk-3DJSGWVB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-6MLIRBLV.js +5 -0
- package/dist/cli-bundle/focused-chunks/chunk-6XYLENDV.js +155 -0
- package/dist/cli-bundle/focused-chunks/chunk-CP4K4WFS.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TL5M2PAY.js → chunk-E3AVJ655.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EBTNSFYE.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-J5EKAIVD.js → chunk-HC2OL2H2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BKPIY34S.js → chunk-I75MANL7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-IIS2FRKL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-NFHFZH2Z.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OGC4XSBC.js +17 -0
- package/dist/cli-bundle/focused-chunks/{chunk-UDAZWT25.js → chunk-OOYYKQWX.js} +4 -4
- package/dist/cli-bundle/focused-chunks/{chunk-23FTGO3W.js → chunk-PKPOZXLL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QDZUABWL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QQX5TDFT.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-55BIB6DV.js → chunk-TEZIXMTH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-WEH6NSL6.js +18 -0
- package/dist/cli-bundle/main.js +13 -13
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +42 -41
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +1 -1
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +2 -2
- package/dist/core/checkpoint/checkpoint-gc.js +7 -12
- package/dist/core/extensions/activation-summary-markdown.js +5 -4
- package/dist/core/extensions/activation-summary.d.ts +2 -0
- package/dist/core/extensions/activation-summary.js +6 -2
- package/dist/core/extensions/capability-usage.d.ts +1 -1
- package/dist/core/extensions/capability-usage.js +4 -3
- package/dist/core/extensions/contribution-inventory.d.ts +1 -0
- package/dist/core/extensions/contribution-inventory.js +6 -2
- package/dist/core/extensions/extension-registries.js +3 -2
- package/dist/core/extensions/extension-types.d.ts +83 -1
- package/dist/core/extensions/extension-types.js +3 -2
- package/dist/core/extensions/loader.d.ts +2 -8
- package/dist/core/extensions/loader.js +53 -144
- package/dist/core/extensions/registration-values.d.ts +43 -0
- package/dist/core/extensions/registration-values.js +210 -0
- package/dist/core/extensions/reserved-host-flags.js +3 -2
- package/dist/core/extensions/runtime-registrations.d.ts +3 -1
- package/dist/core/extensions/runtime-registrations.js +12 -2
- package/dist/core/fs/fs-utils.d.ts +2 -0
- package/dist/core/fs/fs-utils.js +7 -3
- package/dist/core/history/drift-cache.js +4 -3
- package/dist/core/history/drift-scan.js +16 -17
- package/dist/core/history/history.d.ts +8 -0
- package/dist/core/history/history.js +57 -7
- package/dist/core/history/replay.d.ts +9 -1
- package/dist/core/history/replay.js +48 -13
- package/dist/core/lock/lock-gc.js +8 -13
- package/dist/core/lock/lock.js +5 -4
- package/dist/core/output/output.d.ts +2 -0
- package/dist/core/output/output.js +46 -14
- package/dist/core/search/vector-stores.js +6 -11
- package/dist/core/shared/command-types.d.ts +2 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/errors.d.ts +5 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/store/item-metadata-cache.d.ts +1 -1
- package/dist/core/store/item-metadata-cache.js +16 -9
- package/dist/core/telemetry/runtime.d.ts +6 -0
- package/dist/core/telemetry/runtime.js +101 -30
- package/dist/sdk/agent/command-recovery.d.ts +2 -0
- package/dist/sdk/agent/command-recovery.js +10 -2
- package/dist/sdk/annotations.js +4 -4
- package/dist/sdk/cli-bootstrap.d.ts +2 -0
- package/dist/sdk/cli-bootstrap.js +6 -2
- package/dist/sdk/cli-contracts/completeness.js +10 -3
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +9 -3
- package/dist/sdk/cli-contracts/registration-helpers.d.ts +20 -3
- package/dist/sdk/cli-contracts/registration-helpers.js +18 -12
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +40 -6
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +27 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +55 -5
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +22 -4
- package/dist/sdk/cli-program.js +3 -2
- package/dist/sdk/comments.js +4 -3
- package/dist/sdk/compile-cache.js +4 -3
- package/dist/sdk/completion.js +16 -7
- package/dist/sdk/compose.d.ts +3 -1
- package/dist/sdk/compose.js +16 -2
- package/dist/sdk/context-intent-contracts.js +45 -4
- package/dist/sdk/context-signal-store.js +4 -3
- package/dist/sdk/core.d.ts +1 -0
- package/dist/sdk/core.js +3 -2
- package/dist/sdk/extension/install-runtime.js +4 -4
- package/dist/sdk/extension/managed-state.js +4 -3
- package/dist/sdk/extension-contracts.d.ts +1 -1
- package/dist/sdk/flag-invocation-contracts.js +5 -6
- package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +8 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1597 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +8 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1608 -0
- package/dist/sdk/generated-error-code-catalog.js +6 -3140
- package/dist/sdk/governance/assurance-action.d.ts +27 -3
- package/dist/sdk/governance/assurance-action.js +117 -31
- package/dist/sdk/governance/assurance-mutation-error.d.ts +14 -0
- package/dist/sdk/governance/assurance-mutation-error.js +58 -0
- package/dist/sdk/governance/assurance-presets.d.ts +54 -0
- package/dist/sdk/governance/assurance-presets.js +136 -0
- package/dist/sdk/governance/assurance-runtime.d.ts +4 -0
- package/dist/sdk/governance/assurance-runtime.js +118 -14
- package/dist/sdk/governance/assurance.d.ts +51 -6
- package/dist/sdk/governance/assurance.js +321 -67
- package/dist/sdk/governance/gc.js +5 -11
- package/dist/sdk/governance/health.d.ts +3 -1
- package/dist/sdk/governance/health.js +24 -7
- package/dist/sdk/governance/validate-item-reader.js +3 -3
- package/dist/sdk/governance/validate.d.ts +2 -0
- package/dist/sdk/governance/validate.js +15 -5
- package/dist/sdk/graph/durable-cache.d.ts +1 -1
- package/dist/sdk/graph/durable-cache.js +156 -29
- package/dist/sdk/graph/governance-contracts.d.ts +12 -0
- package/dist/sdk/graph/governance-contracts.js +27 -0
- package/dist/sdk/graph/governance.d.ts +44 -2
- package/dist/sdk/graph/governance.js +156 -12
- package/dist/sdk/guide.js +4 -4
- package/dist/sdk/index.d.ts +3 -2
- package/dist/sdk/index.js +5 -4
- package/dist/sdk/lifecycle/claim.js +10 -3
- package/dist/sdk/linked-artifacts.d.ts +2 -0
- package/dist/sdk/linked-artifacts.js +29 -4
- package/dist/sdk/merge/driver.d.ts +2 -2
- package/dist/sdk/merge/driver.js +3 -3
- package/dist/sdk/merge/install.js +5 -4
- package/dist/sdk/merge/receipts.d.ts +6 -4
- package/dist/sdk/merge/receipts.js +7 -5
- package/dist/sdk/merge/three-way.d.ts +2 -2
- package/dist/sdk/merge/three-way.js +3 -3
- package/dist/sdk/output-projection.d.ts +9 -1
- package/dist/sdk/output-projection.js +45 -9
- package/dist/sdk/query/activity.d.ts +49 -2
- package/dist/sdk/query/activity.js +185 -38
- package/dist/sdk/query/get.js +19 -2
- package/dist/sdk/read-output-contracts.d.ts +5 -1
- package/dist/sdk/read-output-contracts.js +17 -2
- package/dist/sdk/read-output-session.d.ts +2 -0
- package/dist/sdk/read-output-session.js +12 -5
- package/dist/sdk/relationship-history.js +5 -5
- package/dist/sdk/runtime-primitives.d.ts +3 -3
- package/dist/sdk/runtime-primitives.js +5 -5
- package/dist/sdk/runtime-stats-options.js +3 -2
- package/dist/sdk/runtime.js +5 -9
- package/dist/sdk/schema-migration.js +4 -4
- package/dist/sdk/stats.d.ts +36 -3
- package/dist/sdk/stats.js +55 -15
- package/dist/sdk/test/execution.d.ts +4 -0
- package/dist/sdk/test/execution.js +88 -23
- package/dist/sdk/workspace-memory.js +4 -4
- package/dist/sdk/workspace-snapshot.js +8 -14
- package/dist/sdk/workspace-transaction-gc.js +4 -9
- package/dist/sdk/workspace-transaction.js +4 -4
- package/dist/sdk/workspace.js +4 -3
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -2
- package/docs/ASSURANCE.md +170 -14
- package/docs/COMMANDS.md +29 -8
- package/docs/CONFIGURATION.md +9 -0
- package/docs/DEPENDENCY_KIND_CONTRACT.md +10 -8
- package/docs/EXTENSIONS.md +11 -12
- package/docs/MERGE_SAFETY.md +3 -1
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +26 -13
- package/docs/README.md +2 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +17 -2
- package/docs/RELATIONSHIP_GRAPH.md +15 -0
- package/docs/SDK.md +17 -3
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +12 -1
- package/docs/SDK_CONTEXT_EVIDENCE_CONTRACTS.md +53 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +28 -1
- package/docs/TESTING.md +24 -15
- package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +106 -0
- package/docs/performance/sdk-entrypoint-import-costs.md +6 -2
- package/marketplace.json +2 -2
- package/package.json +6 -6
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +384 -83
- package/dist/cli-bundle/chunks/chunk-2OOU2AFH.js +0 -8
- package/dist/cli-bundle/chunks/chunk-2RA2YTHJ.js +0 -33
- package/dist/cli-bundle/chunks/chunk-DSKYD4LG.js +0 -13
- package/dist/cli-bundle/chunks/chunk-HC3GM6YY.js +0 -194
- package/dist/cli-bundle/chunks/chunk-IUNRVDAI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-W7CPZGSB.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ZXOC6HG5.js +0 -5
- package/dist/cli-bundle/chunks/register-list-query-HAUXVUPY.js +0 -10
- package/dist/cli-bundle/chunks/register-mutation-7Y5U7ABT.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-EQX3DLAZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3AYKXMYX.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4AHEC74N.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4SV3ZKG3.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-6JW6Z2P5.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-D4PIWE6D.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DPO7TEFX.js +0 -31
- package/dist/cli-bundle/focused-chunks/chunk-E3KCL7AY.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-ERAAFLPS.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-F6E4JZKG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-FPSYO5ZG.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-KDH5OX3D.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-OJ3LVVIS.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-VABB4L5Y.js +0 -17
package/dist/sdk/query/get.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the SDK-owned item query shared by every surface.
|
|
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]="89176e36-40ea-5ec2-b291-d1cf042c4140")}catch(e){}}();
|
|
8
8
|
import { pathExists, getActiveExtensionRegistrations, toItemRecord, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, ITEM_METADATA_KEY_ORDER, TYPE_TO_FOLDER, PmCliError, buildItemNotFoundError, listAllItemMetadataLight, locateItem, readLocatedItem, getHistoryPath, getSettingsPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
|
|
9
9
|
import { readHistoryEntries } from "../history-read.js";
|
|
10
10
|
import { recordContextUsageTouches } from "../context-usage.js";
|
|
@@ -13,6 +13,7 @@ import { buildItemSchedule, } from "../item-schedule.js";
|
|
|
13
13
|
import { getItemAt } from "../history-read.js";
|
|
14
14
|
import { parseIntegerLimit } from "./parsers.js";
|
|
15
15
|
import { runList } from "./list.js";
|
|
16
|
+
import { registerOutputMaterialFieldGroups } from "../output-projection.js";
|
|
16
17
|
const GET_DEPTH_VALUES = ["brief", "standard", "deep"];
|
|
17
18
|
const AUTOMATIC_CHILD_ROLLUP_TYPES = new Set([
|
|
18
19
|
"epic",
|
|
@@ -38,6 +39,21 @@ function itemCollectionCounts(item) {
|
|
|
38
39
|
]));
|
|
39
40
|
return lengths;
|
|
40
41
|
}
|
|
42
|
+
function itemMaterialFieldGroups(item, body) {
|
|
43
|
+
const collectionCounts = itemCollectionCounts(item);
|
|
44
|
+
return [
|
|
45
|
+
...(body.length > 0 ? ["body"] : []),
|
|
46
|
+
...Object.entries(collectionCounts).flatMap(([name, count]) => count > 0 ? [name] : []),
|
|
47
|
+
...(collectionCounts.files + collectionCounts.tests + collectionCounts.docs > 0
|
|
48
|
+
? ["linked"]
|
|
49
|
+
: []),
|
|
50
|
+
"children",
|
|
51
|
+
...(typeof item.assignee === "string" && item.assignee.trim().length > 0
|
|
52
|
+
? ["claim_state"]
|
|
53
|
+
: []),
|
|
54
|
+
...(buildItemSchedule(item) ? ["schedule"] : []),
|
|
55
|
+
];
|
|
56
|
+
}
|
|
41
57
|
/** Decide whether a normal read should pay for a workspace-wide child projection. */
|
|
42
58
|
function shouldAutoIncludeGetChildren(itemType) {
|
|
43
59
|
const normalizedType = itemType.trim().toLowerCase();
|
|
@@ -414,6 +430,7 @@ export async function runGet(id, global, options = {}) {
|
|
|
414
430
|
// Derived usage feedback must never make the source-of-truth read fail.
|
|
415
431
|
}
|
|
416
432
|
}
|
|
433
|
+
registerOutputMaterialFieldGroups(result, itemMaterialFieldGroups(context.metadata, context.body));
|
|
417
434
|
return result;
|
|
418
435
|
}
|
|
419
436
|
/** Public contract for test-only get command policy helpers. */
|
|
@@ -421,4 +438,4 @@ export const _testOnlyGetCommand = {
|
|
|
421
438
|
shouldAutoIncludeGetChildren,
|
|
422
439
|
};
|
|
423
440
|
//# sourceMappingURL=get.js.map
|
|
424
|
-
//# debugId=
|
|
441
|
+
//# debugId=89176e36-40ea-5ec2-b291-d1cf042c4140
|
|
@@ -19,6 +19,8 @@ export interface PmReadOutputOptions {
|
|
|
19
19
|
outputFormat?: "json" | "toon";
|
|
20
20
|
/** Caller-carried cross-call budget and served-fact state. */
|
|
21
21
|
outputSession?: string | PmReadOutputSessionState;
|
|
22
|
+
/** Include row selector and encoding discovery metadata. */
|
|
23
|
+
outputRowContract?: boolean;
|
|
22
24
|
}
|
|
23
25
|
/** Compatibility spelling retained for a command-specific output control. */
|
|
24
26
|
export interface PmReadOutputLegacyAlias {
|
|
@@ -130,7 +132,7 @@ export type PmReadOutputResultFor<Result, Options> = "outputBudget" extends keyo
|
|
|
130
132
|
/** Canonical CLI flags that opt a read invocation into universal output shaping. */
|
|
131
133
|
export declare const PM_READ_OUTPUT_OPTION_FLAGS: readonly string[];
|
|
132
134
|
/** Canonical control that composes the four per-call dimensions across reads. */
|
|
133
|
-
export declare const PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS: readonly ["--output-session"];
|
|
135
|
+
export declare const PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS: readonly ["--output-session", "--output-row-contract"];
|
|
134
136
|
/** Universal output contract for every built-in read surface. */
|
|
135
137
|
export declare const PM_READ_OUTPUT_SURFACE_CONTRACTS: readonly PmReadOutputSurfaceContract[];
|
|
136
138
|
/** Resolve a command or list/context alias to its canonical read-output surface. */
|
|
@@ -139,6 +141,8 @@ export declare function resolveReadOutputSurface(command: string): PmReadOutputS
|
|
|
139
141
|
export declare function validateReadOutputOptions(command: string, options: Record<string, unknown>): void;
|
|
140
142
|
/** Resolve canonical and compatibility controls into the universal dimension set. */
|
|
141
143
|
export declare function resolveReadOutputDimensions(command: string, options: Record<string, unknown>): PmResolvedReadOutputDimensions | undefined;
|
|
144
|
+
/** Recompute read and optional session receipts after a final envelope projection. */
|
|
145
|
+
export declare function stabilizeReadOutputReceiptEstimates(result: Record<string, unknown>, options: Record<string, unknown>): Record<string, unknown>;
|
|
142
146
|
/** Apply universal field, row, and token bounds and attach an exact receipt. */
|
|
143
147
|
export declare function applyReadOutputDimensions<Result extends Record<string, unknown>>(command: string, options: Record<string, unknown>, result: Result): PmReadOutputResult<Result>;
|
|
144
148
|
/** Narrow a universal read result to its budget-omission branch. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* surface without coupling package authors to command-specific option names.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!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]="
|
|
8
|
+
!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]="0ab0c72c-cac0-5670-93d1-7a446f8a2301")}catch(e){}}();
|
|
9
9
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
10
10
|
import { PmCliError } from "../core/shared/errors.js";
|
|
11
11
|
import { compactReadOutputToBudget, updateReadOutputReceiptEstimate, } from "./read-output-budget.js";
|
|
@@ -58,6 +58,7 @@ export const PM_READ_OUTPUT_OPTION_FLAGS = Object.freeze(PM_READ_OUTPUT_DIMENSIO
|
|
|
58
58
|
/** Canonical control that composes the four per-call dimensions across reads. */
|
|
59
59
|
export const PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS = Object.freeze([
|
|
60
60
|
"--output-session",
|
|
61
|
+
"--output-row-contract",
|
|
61
62
|
]);
|
|
62
63
|
const LEGACY_FLAGS_BY_COMMAND = {
|
|
63
64
|
list: {
|
|
@@ -216,6 +217,8 @@ const CANONICAL_OPTION_KEYS = [
|
|
|
216
217
|
"output_format",
|
|
217
218
|
"outputSession",
|
|
218
219
|
"output_session",
|
|
220
|
+
"outputRowContract",
|
|
221
|
+
"output_row_contract",
|
|
219
222
|
];
|
|
220
223
|
const HYBRID_READ_MUTATION_KEYS = {
|
|
221
224
|
comments: ["add", "body", "stdin", "file", "edit", "delete"],
|
|
@@ -580,6 +583,18 @@ function attachReadOutputSessionContracts(result, state, receipt) {
|
|
|
580
583
|
}
|
|
581
584
|
return withSession;
|
|
582
585
|
}
|
|
586
|
+
/** Recompute read and optional session receipts after a final envelope projection. */
|
|
587
|
+
export function stabilizeReadOutputReceiptEstimates(result, options) {
|
|
588
|
+
if (!isRecord(result.read_output))
|
|
589
|
+
return result;
|
|
590
|
+
const receipt = result.read_output;
|
|
591
|
+
const session = parseReadOutputSession(options.outputSession ?? options.output_session);
|
|
592
|
+
if (session === undefined) {
|
|
593
|
+
updateReadOutputReceiptEstimate(result, receipt);
|
|
594
|
+
return result;
|
|
595
|
+
}
|
|
596
|
+
return attachReadOutputSessionContracts(result, session, receipt);
|
|
597
|
+
}
|
|
583
598
|
/** Apply field, amount, and repeat projections to every declared row path. */
|
|
584
599
|
function projectReadOutputRows(result, resolved, session) {
|
|
585
600
|
let projected = { ...result };
|
|
@@ -695,4 +710,4 @@ export function resolveReadOutputEncoding(command, options) {
|
|
|
695
710
|
: undefined;
|
|
696
711
|
}
|
|
697
712
|
//# sourceMappingURL=read-output-contracts.js.map
|
|
698
|
-
//# debugId=
|
|
713
|
+
//# debugId=0ab0c72c-cac0-5670-93d1-7a446f8a2301
|
|
@@ -46,6 +46,8 @@ export interface PmReadOutputSessionReceipt {
|
|
|
46
46
|
seen_before_count: number;
|
|
47
47
|
/** Number of newly delivered item facts retained in this envelope. */
|
|
48
48
|
new_item_count: number;
|
|
49
|
+
/** Newly delivered identities omitted from next_state after its capacity filled. */
|
|
50
|
+
seen_item_overflow_count?: number;
|
|
49
51
|
/** Number of repeated item rows replaced by references. */
|
|
50
52
|
suppressed_repeat_count: number;
|
|
51
53
|
/** Stable reference syntax used by suppressed rows. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* budgets and resolvable references to item facts served by earlier reads.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!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]="
|
|
8
|
+
!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]="642f6dec-c0b2-5377-a401-dfa4f8ef6a2a")}catch(e){}}();
|
|
9
9
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
10
10
|
import { PmCliError } from "../core/shared/errors.js";
|
|
11
11
|
import { mapReadOutputRows, readOutputRowCollections, } from "./read-output-rows.js";
|
|
@@ -141,9 +141,13 @@ export function applyReadOutputSessionReferences(result, state) {
|
|
|
141
141
|
/** Attach a fixed-point session receipt and return the exact charged tokens. */
|
|
142
142
|
export function attachReadOutputSessionReceipt(result, state) {
|
|
143
143
|
const { deliveredIds, suppressedRepeatCount } = summarizeReadOutputSessionRows(result);
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
const alreadySeen = new Set(state.seen_item_ids);
|
|
145
|
+
const newlySeen = [...deliveredIds]
|
|
146
|
+
.filter((id) => !alreadySeen.has(id))
|
|
147
|
+
.sort();
|
|
148
|
+
const retainedNewIds = newlySeen.slice(0, PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS - state.seen_item_ids.length);
|
|
149
|
+
const nextSeen = [...state.seen_item_ids, ...retainedNewIds].sort();
|
|
150
|
+
const seenItemOverflowCount = newlySeen.length - retainedNewIds.length;
|
|
147
151
|
const receipt = {
|
|
148
152
|
contract_version: 1,
|
|
149
153
|
id: state.id,
|
|
@@ -158,6 +162,9 @@ export function attachReadOutputSessionReceipt(result, state) {
|
|
|
158
162
|
exhausted: false,
|
|
159
163
|
seen_before_count: state.seen_item_ids.length,
|
|
160
164
|
new_item_count: deliveredIds.size,
|
|
165
|
+
...(seenItemOverflowCount === 0
|
|
166
|
+
? {}
|
|
167
|
+
: { seen_item_overflow_count: seenItemOverflowCount }),
|
|
161
168
|
suppressed_repeat_count: suppressedRepeatCount,
|
|
162
169
|
reference_format: "session:<session-id>:<item-id>",
|
|
163
170
|
restore_reference_with: "pm get <item-id> --brief",
|
|
@@ -197,4 +204,4 @@ export function readOutputSessionRemainingTokens(state) {
|
|
|
197
204
|
return Math.max(0, state.token_budget - state.spent_tokens);
|
|
198
205
|
}
|
|
199
206
|
//# sourceMappingURL=read-output-session.js.map
|
|
200
|
-
//# debugId=
|
|
207
|
+
//# debugId=642f6dec-c0b2-5377-a401-dfa4f8ef6a2a
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* optimistic concurrency, deterministic replay, snapshots, and cursor pages.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!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]="
|
|
8
|
+
!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]="bb5dfa6f-b60f-55f2-ae17-3dbcaaff1b47")}catch(e){}}();
|
|
9
9
|
import { createQueryFingerprint, decodeQueryCursorState, paginateQueryRows, } from "./pagination.js";
|
|
10
10
|
import { constants } from "node:fs";
|
|
11
11
|
import { lstat, mkdir, open } from "node:fs/promises";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { acquireLock } from "../core/lock/lock.js";
|
|
14
|
-
import { writeFileAtomic } from "../core/fs/fs-utils.js";
|
|
14
|
+
import { isFileMissingError, writeFileAtomic } from "../core/fs/fs-utils.js";
|
|
15
15
|
import { stableStringify } from "../core/shared/serialization.js";
|
|
16
16
|
import { RelationshipGraph, createRelationshipKindRegistry, } from "./relationships.js";
|
|
17
17
|
function requiredText(value, field) {
|
|
@@ -298,7 +298,7 @@ async function resolveRelationshipEventStorePath(pmRoot, relativePath = "relatio
|
|
|
298
298
|
throw new TypeError("Relationship event path must not contain symbolic links");
|
|
299
299
|
}
|
|
300
300
|
catch (error) {
|
|
301
|
-
if (error
|
|
301
|
+
if (isFileMissingError(error))
|
|
302
302
|
break;
|
|
303
303
|
throw error;
|
|
304
304
|
}
|
|
@@ -314,7 +314,7 @@ async function loadRelationshipEventLog(target, nodes, registry) {
|
|
|
314
314
|
raw = await handle.readFile("utf8");
|
|
315
315
|
}
|
|
316
316
|
catch (error) {
|
|
317
|
-
if (error
|
|
317
|
+
if (isFileMissingError(error))
|
|
318
318
|
return { log, raw: "" };
|
|
319
319
|
throw error;
|
|
320
320
|
}
|
|
@@ -517,4 +517,4 @@ export class RelationshipEventStore {
|
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
//# sourceMappingURL=relationship-history.js.map
|
|
520
|
-
//# debugId=
|
|
520
|
+
//# debugId=bb5dfa6f-b60f-55f2-ae17-3dbcaaff1b47
|
|
@@ -16,10 +16,10 @@ export { resolveRegisteredSearchProvider, resolveRegisteredVectorStoreAdapter, }
|
|
|
16
16
|
export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic, } from "../core/fs/fs-utils.js";
|
|
17
17
|
export { type HistoryDiffValueEntry, computeHistoryDiff, patchPathToChangedField, } from "../core/history/history-diff.js";
|
|
18
18
|
export { enforceHistoryStreamPolicyForItem, enforceHistoryStreamPolicyForItems, } from "../core/history/history-stream-policy.js";
|
|
19
|
-
export { appendHistoryEntry, createHistoryEntry, hashDocument, hashEmptyDocument, } from "../core/history/history.js";
|
|
19
|
+
export { appendHistoryEntry, CURRENT_HISTORY_ITEM_HASH_VERSION, createHistoryEntry, hashDocument, hashDocumentForVersion, hashEmptyDocument, SUPPORTED_HISTORY_ITEM_HASH_VERSIONS, type HistoryItemHashVersion, } from "../core/history/history.js";
|
|
20
20
|
export { readHistoryEntries } from "../core/history/read.js";
|
|
21
21
|
export { appendWorkspaceAuditEvent, appendWorkspaceHistoryChange, getWorkspaceHistoryPath, mutateWorkspaceJsonWithHistory, WORKSPACE_HISTORY_ID, writeWorkspaceJsonWithHistory, type WorkspaceAuditEventOptions, type WorkspaceHistoryChange, type WorkspaceJsonMutation, type WorkspaceJsonMutationOptions, type WorkspaceJsonWriteOptions, } from "../core/history/workspace-history.js";
|
|
22
|
-
export { normalizeReplayPatchOps, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, verifyHistoryChain, } from "../core/history/replay.js";
|
|
22
|
+
export { normalizeReplayPatchOps, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, verifyHistoryChain, verifyHistoryChainWithVersion, } from "../core/history/replay.js";
|
|
23
23
|
export { resolveBodyFileContent } from "../core/io/body-file.js";
|
|
24
24
|
export { generateItemId, normalizeItemId, normalizeRawItemId, } from "../core/item/id.js";
|
|
25
25
|
export { canonicalDocument, normalizeItemMetadata, parseItemDocument, serializeItemDocument, } from "../core/item/item-format.js";
|
|
@@ -72,7 +72,7 @@ export { splitCommaList } from "../core/shared/split-comma-list.js";
|
|
|
72
72
|
export { compareTimestampStrings, nowIso, resolveIsoOrRelative, } from "../core/shared/time.js";
|
|
73
73
|
export { migrateItemFilesToFormat } from "../core/store/item-format-migration.js";
|
|
74
74
|
export { type CachedDocumentCandidate, listAllDocumentCandidatesCached, } from "../core/store/item-metadata-cache.js";
|
|
75
|
-
export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
75
|
+
export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadata, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
76
76
|
export { isTerminalPlanMode, shouldCompletePlanOnClose, } from "../core/item/plan-lifecycle.js";
|
|
77
77
|
export { getHistoryPath, getItemPath, getSettingsPath, resolveImplicitPmRoot, resolvePmRoot, } from "../core/store/paths.js";
|
|
78
78
|
export { persistSelectedItemFormat, readSettings, readSettingsWithMetadata, writeSettings, } from "../core/store/settings.js";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* prefer the typed operations exported by the main SDK barrel.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
10
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="78779372-1987-54d0-9ae4-775b52641a26")}catch(e){}}();
|
|
11
11
|
export { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, } from "../core/checkpoint/mutation-checkpoint.js";
|
|
12
12
|
export { flattenFlagListValue, resolveFlagValueKind, } from "../core/extensions/flag-value-types.js";
|
|
13
13
|
export { createUnknownSubcommandError, } from "./agent/subcommand-recovery.js";
|
|
@@ -18,10 +18,10 @@ export { resolveRegisteredSearchProvider, resolveRegisteredVectorStoreAdapter, }
|
|
|
18
18
|
export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic, } from "../core/fs/fs-utils.js";
|
|
19
19
|
export { computeHistoryDiff, patchPathToChangedField, } from "../core/history/history-diff.js";
|
|
20
20
|
export { enforceHistoryStreamPolicyForItem, enforceHistoryStreamPolicyForItems, } from "../core/history/history-stream-policy.js";
|
|
21
|
-
export { appendHistoryEntry, createHistoryEntry, hashDocument, hashEmptyDocument, } from "../core/history/history.js";
|
|
21
|
+
export { appendHistoryEntry, CURRENT_HISTORY_ITEM_HASH_VERSION, createHistoryEntry, hashDocument, hashDocumentForVersion, hashEmptyDocument, SUPPORTED_HISTORY_ITEM_HASH_VERSIONS, } from "../core/history/history.js";
|
|
22
22
|
export { readHistoryEntries } from "../core/history/read.js";
|
|
23
23
|
export { appendWorkspaceAuditEvent, appendWorkspaceHistoryChange, getWorkspaceHistoryPath, mutateWorkspaceJsonWithHistory, WORKSPACE_HISTORY_ID, writeWorkspaceJsonWithHistory, } from "../core/history/workspace-history.js";
|
|
24
|
-
export { normalizeReplayPatchOps, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, verifyHistoryChain, } from "../core/history/replay.js";
|
|
24
|
+
export { normalizeReplayPatchOps, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, verifyHistoryChain, verifyHistoryChainWithVersion, } from "../core/history/replay.js";
|
|
25
25
|
export { resolveBodyFileContent } from "../core/io/body-file.js";
|
|
26
26
|
export { generateItemId, normalizeItemId, normalizeRawItemId, } from "../core/item/id.js";
|
|
27
27
|
export { canonicalDocument, normalizeItemMetadata, parseItemDocument, serializeItemDocument, } from "../core/item/item-format.js";
|
|
@@ -73,7 +73,7 @@ export { splitCommaList } from "../core/shared/split-comma-list.js";
|
|
|
73
73
|
export { compareTimestampStrings, nowIso, resolveIsoOrRelative, } from "../core/shared/time.js";
|
|
74
74
|
export { migrateItemFilesToFormat } from "../core/store/item-format-migration.js";
|
|
75
75
|
export { listAllDocumentCandidatesCached, } from "../core/store/item-metadata-cache.js";
|
|
76
|
-
export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
76
|
+
export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadata, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
77
77
|
export { isTerminalPlanMode, shouldCompletePlanOnClose, } from "../core/item/plan-lifecycle.js";
|
|
78
78
|
export { getHistoryPath, getItemPath, getSettingsPath, resolveImplicitPmRoot, resolvePmRoot, } from "../core/store/paths.js";
|
|
79
79
|
export { persistSelectedItemFormat, readSettings, readSettingsWithMetadata, writeSettings, } from "../core/store/settings.js";
|
|
@@ -81,4 +81,4 @@ export { maybeRunFirstUseTelemetryPrompt } from "../core/telemetry/consent.js";
|
|
|
81
81
|
export { deriveTelemetryCommandResolution, } from "../core/telemetry/observability.js";
|
|
82
82
|
export { emitTelemetryErrorEvent, finishTelemetryCommand, startTelemetryCommand, } from "../core/telemetry/runtime.js";
|
|
83
83
|
//# sourceMappingURL=runtime-primitives.js.map
|
|
84
|
-
//# debugId=
|
|
84
|
+
//# debugId=78779372-1987-54d0-9ae4-775b52641a26
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0e63298a-d2d7-5217-af50-a206348b4cd4")}catch(e){}}();
|
|
3
3
|
import { readRuntimeString, readRuntimeStringArray } from "./runtime-input.js";
|
|
4
4
|
/** Convert a flat runtime option bag into the canonical typed stats payload. */
|
|
5
5
|
export function statsCommandOptionsFromRuntime(options) {
|
|
6
6
|
return {
|
|
7
|
+
includeEmpty: options.includeEmpty === true,
|
|
7
8
|
storage: options.storage === true,
|
|
8
9
|
metadataCoverage: options.metadataCoverage === true,
|
|
9
10
|
fieldUtilization: options.fieldUtilization === true,
|
|
@@ -35,4 +36,4 @@ export function statsCommandOptionsFromRuntime(options) {
|
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
//# sourceMappingURL=runtime-stats-options.js.map
|
|
38
|
-
//# debugId=
|
|
39
|
+
//# debugId=0e63298a-d2d7-5217-af50-a206348b4cd4
|
package/dist/sdk/runtime.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines public SDK APIs and package-author helpers for Runtime.
|
|
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]="7c27b516-1714-5f2b-8304-98e8372280be")}catch(e){}}();
|
|
8
8
|
export { PM_GITIGNORE_END, PM_GITIGNORE_START, ensurePmGitignore, getPmGitignoreBlock, } from "./workspace.js";
|
|
9
9
|
export { SEARCH_EXTENSION_FLAG_DEFINITIONS } from "./extension-contracts.js";
|
|
10
10
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -33,7 +33,7 @@ import { applyContextIntentProjection, attachReadOutputContracts, } from "./cont
|
|
|
33
33
|
import { runWithDiscoveredContextIntentContracts, } from "./context-intent-runtime.js";
|
|
34
34
|
import { validateReadOutputOptions, } from "./read-output-contracts.js";
|
|
35
35
|
export { clearWorkspaceContractsCache } from "./workspace-contracts-cache.js";
|
|
36
|
-
import { runActivity } from "./query/activity.js";
|
|
36
|
+
import { normalizeActivityProjectionOptions, runActivity, } from "./query/activity.js";
|
|
37
37
|
import { runAssuranceDispatch } from "./governance/assurance-action.js";
|
|
38
38
|
import { runAggregate, } from "./query/aggregate.js";
|
|
39
39
|
import { runAppend } from "./lifecycle/append.js";
|
|
@@ -1456,12 +1456,8 @@ function runMcpConfigAction(ctx) {
|
|
|
1456
1456
|
"project", configAction, readString(ctx.args, "key") ?? readString(ctx.options, "key"), ctx.options, ctx.global, readString(ctx.args, "value") ?? readString(ctx.options, "value"));
|
|
1457
1457
|
}
|
|
1458
1458
|
function runMcpActivityAction(ctx) {
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
activityOptions.compact = activityOptions.full === true ? false : true;
|
|
1462
|
-
}
|
|
1463
|
-
delete activityOptions.full;
|
|
1464
|
-
return runActivity(activityOptions, ctx.global);
|
|
1459
|
+
const options = ctx.options;
|
|
1460
|
+
return runActivity(normalizeActivityProjectionOptions(options), ctx.global);
|
|
1465
1461
|
}
|
|
1466
1462
|
function parseMcpIntegerPrefix(value, label) {
|
|
1467
1463
|
if (typeof value === "number") {
|
|
@@ -1934,4 +1930,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
|
|
|
1934
1930
|
}
|
|
1935
1931
|
}
|
|
1936
1932
|
//# sourceMappingURL=runtime.js.map
|
|
1937
|
-
//# debugId=
|
|
1933
|
+
//# debugId=7c27b516-1714-5f2b-8304-98e8372280be
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* guarantees.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
10
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cd777de3-665f-5e01-ac98-8986f2a5a4c2")}catch(e){}}();
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
12
|
import fs from "node:fs/promises";
|
|
13
13
|
import path from "node:path";
|
|
14
|
-
import { pathExists, readFileIfExists, writeFileAtomic, } from "../core/fs/fs-utils.js";
|
|
14
|
+
import { isFileMissingError, pathExists, readFileIfExists, writeFileAtomic, } from "../core/fs/fs-utils.js";
|
|
15
15
|
import { appendWorkspaceHistoryChange } from "../core/history/workspace-history.js";
|
|
16
16
|
import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
|
|
17
17
|
import { parseFieldsFile, serializeFieldsFile, } from "../core/schema/fields-file.js";
|
|
@@ -681,7 +681,7 @@ async function collectSchemaReferenceState(params) {
|
|
|
681
681
|
if (typeof error !== "object" ||
|
|
682
682
|
error === null ||
|
|
683
683
|
!("code" in error) ||
|
|
684
|
-
error
|
|
684
|
+
!isFileMissingError(error)) {
|
|
685
685
|
throw error;
|
|
686
686
|
}
|
|
687
687
|
}
|
|
@@ -855,4 +855,4 @@ export const schemaMigrationTestOnly = {
|
|
|
855
855
|
validateAndStoreMigrationPlan,
|
|
856
856
|
};
|
|
857
857
|
//# sourceMappingURL=schema-migration.js.map
|
|
858
|
-
//# debugId=
|
|
858
|
+
//# debugId=cd777de3-665f-5e01-ac98-8986f2a5a4c2
|
package/dist/sdk/stats.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ContentFieldUtilizationReport } from "../core/governance/content-fields.js";
|
|
2
|
-
import { type GroupedBreakdown, type MetadataCoverageReport } from "../core/governance/metadata-coverage.js";
|
|
2
|
+
import { type CoverageItem, type GroupedBreakdown, type LifecycleClassifier, type MetadataCoverageReport } from "../core/governance/metadata-coverage.js";
|
|
3
3
|
import { type HistoryStorageStats } from "../core/history/history-storage-stats.js";
|
|
4
4
|
import type { GlobalOptions } from "../core/shared/command-types.js";
|
|
5
5
|
import type { ItemStatus, ItemType } from "../types/index.js";
|
|
@@ -7,6 +7,8 @@ import { type ImprovementDirection, type ImprovementLedgerResult, type RecordImp
|
|
|
7
7
|
import { type FleetAttributionAnalytics, type ProvenanceCoverageAnalytics } from "./history-analytics.js";
|
|
8
8
|
/** Documents the stats command options payload exchanged by command, SDK, and package integrations. */
|
|
9
9
|
export interface StatsCommandOptions {
|
|
10
|
+
/** Restore zero-count item-type and status buckets for schema-governance dashboards. */
|
|
11
|
+
includeEmpty?: boolean;
|
|
10
12
|
/** Include aggregate per-stream history storage metrics (sizes, depth, oldest/newest). */
|
|
11
13
|
storage?: boolean;
|
|
12
14
|
/** Include metadata coverage percentages (AC, estimates, resolution, tags, parent) overall and by type. */
|
|
@@ -52,6 +54,29 @@ export interface StatsCommandOptions {
|
|
|
52
54
|
/** Minimum close or explicit-value denominator required for rates. */
|
|
53
55
|
minimumSample?: number;
|
|
54
56
|
}
|
|
57
|
+
/** Compact, tabular lifecycle row used by the default stats type distribution. */
|
|
58
|
+
export interface StatsTypeLifecycleRow {
|
|
59
|
+
/** Item type represented by this row. */
|
|
60
|
+
type: string;
|
|
61
|
+
/** Total items of this type across every lifecycle bucket. */
|
|
62
|
+
total: number;
|
|
63
|
+
/** Items in the default open lifecycle bucket. */
|
|
64
|
+
open: number;
|
|
65
|
+
/** Items in active non-default lifecycle states. */
|
|
66
|
+
in_progress: number;
|
|
67
|
+
/** Items in blocked lifecycle states. */
|
|
68
|
+
blocked: number;
|
|
69
|
+
/** Items in draft lifecycle states. */
|
|
70
|
+
draft: number;
|
|
71
|
+
/** Items in completed lifecycle states. */
|
|
72
|
+
closed: number;
|
|
73
|
+
/** Items in canceled lifecycle states. */
|
|
74
|
+
canceled: number;
|
|
75
|
+
/** Items whose custom status is outside the recognized lifecycle buckets. */
|
|
76
|
+
other: number;
|
|
77
|
+
}
|
|
78
|
+
/** Screen-sized type distribution rendered as one canonical TOON table. */
|
|
79
|
+
export type StatsTypeBreakdown = StatsTypeLifecycleRow[];
|
|
55
80
|
/** Documents the stats result payload exchanged by command, SDK, and package integrations. */
|
|
56
81
|
export interface StatsResult {
|
|
57
82
|
/** Value that configures or reports totals for this contract. */
|
|
@@ -61,9 +86,11 @@ export interface StatsResult {
|
|
|
61
86
|
history_entries: number;
|
|
62
87
|
};
|
|
63
88
|
/** Schema type that determines the shape and validation rules for this value. */
|
|
64
|
-
by_type:
|
|
89
|
+
by_type: StatsTypeBreakdown;
|
|
65
90
|
/** Item counts grouped by lifecycle status. */
|
|
66
|
-
by_status: Record<ItemStatus, number
|
|
91
|
+
by_status: Partial<Record<ItemStatus, number>>;
|
|
92
|
+
/** Total zero-count type and status buckets omitted from the default projection. */
|
|
93
|
+
omitted_zero_buckets: number;
|
|
67
94
|
/** Present only with --metadata-coverage: per-field coverage overall and by type. */
|
|
68
95
|
metadata_coverage?: MetadataCoverageReport;
|
|
69
96
|
/** Present only with --by-assignee/--by-tag/--by-priority: lifecycle-bucketed group breakdowns. */
|
|
@@ -89,6 +116,11 @@ export interface StatsResult {
|
|
|
89
116
|
}
|
|
90
117
|
declare function zeroByType(itemTypes: string[]): Record<ItemType, number>;
|
|
91
118
|
declare function zeroByStatus(statuses: string[]): Record<ItemStatus, number>;
|
|
119
|
+
declare function projectStatsDistributions(items: readonly CoverageItem[], itemTypes: readonly string[], statuses: readonly string[], classifier: LifecycleClassifier, includeEmpty: boolean): {
|
|
120
|
+
byType: StatsTypeBreakdown;
|
|
121
|
+
byStatus: Partial<Record<ItemStatus, number>>;
|
|
122
|
+
omitted: number;
|
|
123
|
+
};
|
|
92
124
|
declare function countNonEmptyLines(raw: string): number;
|
|
93
125
|
declare function readHistoryStreamContents(pmRoot: string): Promise<Array<{
|
|
94
126
|
id: string;
|
|
@@ -100,6 +132,7 @@ export declare const _testOnly: {
|
|
|
100
132
|
zeroByStatus: typeof zeroByStatus;
|
|
101
133
|
countNonEmptyLines: typeof countNonEmptyLines;
|
|
102
134
|
readHistoryStreamContents: typeof readHistoryStreamContents;
|
|
135
|
+
projectStatsDistributions: typeof projectStatsDistributions;
|
|
103
136
|
};
|
|
104
137
|
/** Implements run stats for the public runtime surface of this module. */
|
|
105
138
|
export declare function runStats(global: GlobalOptions, options?: StatsCommandOptions): Promise<StatsResult>;
|
package/dist/sdk/stats.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm stats 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]="d28c7ac7-9801-5b0c-84c9-51deede398be")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { getActiveExtensionRegistrations, runActiveOnReadHooks, } from "../core/extensions/index.js";
|
|
@@ -36,6 +36,53 @@ function zeroByStatus(statuses) {
|
|
|
36
36
|
return acc;
|
|
37
37
|
}, {});
|
|
38
38
|
}
|
|
39
|
+
function projectStatsDistributions(items, itemTypes, statuses, classifier, includeEmpty) {
|
|
40
|
+
const grouped = groupItemsByDimension(items, "type", classifier);
|
|
41
|
+
const presentTypes = new Set(grouped.rows.map((row) => row.key));
|
|
42
|
+
const missingTypes = itemTypes.filter((type) => !presentTypes.has(type));
|
|
43
|
+
const groupedRows = includeEmpty
|
|
44
|
+
? [
|
|
45
|
+
...grouped.rows,
|
|
46
|
+
...missingTypes.map((type) => ({
|
|
47
|
+
label: type,
|
|
48
|
+
key: type,
|
|
49
|
+
total: 0,
|
|
50
|
+
buckets: {
|
|
51
|
+
open: 0,
|
|
52
|
+
in_progress: 0,
|
|
53
|
+
blocked: 0,
|
|
54
|
+
draft: 0,
|
|
55
|
+
closed: 0,
|
|
56
|
+
canceled: 0,
|
|
57
|
+
other: 0,
|
|
58
|
+
},
|
|
59
|
+
})),
|
|
60
|
+
]
|
|
61
|
+
: grouped.rows;
|
|
62
|
+
const byType = groupedRows.map((row) => ({
|
|
63
|
+
type: row.key ?? row.label,
|
|
64
|
+
total: row.total,
|
|
65
|
+
open: row.buckets.open,
|
|
66
|
+
in_progress: row.buckets.in_progress,
|
|
67
|
+
blocked: row.buckets.blocked,
|
|
68
|
+
draft: row.buckets.draft,
|
|
69
|
+
closed: row.buckets.closed,
|
|
70
|
+
canceled: row.buckets.canceled,
|
|
71
|
+
other: row.buckets.other,
|
|
72
|
+
}));
|
|
73
|
+
const counts = zeroByStatus([...statuses]);
|
|
74
|
+
for (const item of items)
|
|
75
|
+
counts[item.status] += 1;
|
|
76
|
+
const byStatus = Object.fromEntries(Object.entries(counts).filter(([, count]) => includeEmpty || count > 0));
|
|
77
|
+
return {
|
|
78
|
+
byType,
|
|
79
|
+
byStatus,
|
|
80
|
+
omitted: includeEmpty
|
|
81
|
+
? 0
|
|
82
|
+
: missingTypes.length +
|
|
83
|
+
Object.values(counts).filter((count) => count === 0).length,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
39
86
|
function countNonEmptyLines(raw) {
|
|
40
87
|
if (raw.trim().length === 0) {
|
|
41
88
|
return 0;
|
|
@@ -75,6 +122,7 @@ export const _testOnly = {
|
|
|
75
122
|
zeroByStatus,
|
|
76
123
|
countNonEmptyLines,
|
|
77
124
|
readHistoryStreamContents,
|
|
125
|
+
projectStatsDistributions,
|
|
78
126
|
};
|
|
79
127
|
async function recordStatsObservations(global, options) {
|
|
80
128
|
const recorded = [];
|
|
@@ -129,12 +177,13 @@ async function requestedHistoryAnalytics(pmRoot, items, settings, terminalStatus
|
|
|
129
177
|
: undefined,
|
|
130
178
|
};
|
|
131
179
|
}
|
|
132
|
-
function assembleStatsResult(totals, byType, byStatus, optional) {
|
|
180
|
+
function assembleStatsResult(totals, byType, byStatus, omittedZeroBuckets, optional) {
|
|
133
181
|
const hasBreakdowns = Object.keys(optional.breakdowns).length > 0;
|
|
134
182
|
return {
|
|
135
183
|
totals,
|
|
136
184
|
by_type: byType,
|
|
137
185
|
by_status: byStatus,
|
|
186
|
+
omitted_zero_buckets: omittedZeroBuckets,
|
|
138
187
|
...(optional.metadataCoverage
|
|
139
188
|
? { metadata_coverage: optional.metadataCoverage }
|
|
140
189
|
: {}),
|
|
@@ -180,16 +229,8 @@ export async function runStats(global, options = {}) {
|
|
|
180
229
|
itemIds: items.map((item) => item.id),
|
|
181
230
|
commandLabel: "stats",
|
|
182
231
|
});
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
// zeroByType/zeroByStatus pre-seed a bucket for every registry type/status, and
|
|
186
|
-
// the light item-metadata reader drops any item whose type/status falls outside
|
|
187
|
-
// the active registry (parse rejects them) — so every item's bucket is already
|
|
188
|
-
// present here and no on-the-fly initialization is reachable.
|
|
189
|
-
for (const item of items) {
|
|
190
|
-
byType[item.type] += 1;
|
|
191
|
-
byStatus[item.status] += 1;
|
|
192
|
-
}
|
|
232
|
+
const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);
|
|
233
|
+
const distributions = projectStatsDistributions(items, typeRegistry.types, statusRegistry.definitions.map((definition) => definition.id), classifier, options.includeEmpty === true);
|
|
193
234
|
const streams = await readHistoryStreamContents(pmRoot);
|
|
194
235
|
let historyEntries = 0;
|
|
195
236
|
for (const stream of streams) {
|
|
@@ -198,7 +239,6 @@ export async function runStats(global, options = {}) {
|
|
|
198
239
|
const storage = options.storage
|
|
199
240
|
? computeHistoryStorageStats(streams)
|
|
200
241
|
: undefined;
|
|
201
|
-
const classifier = lifecycleClassifierFromStatusRegistry(statusRegistry);
|
|
202
242
|
const metadataCoverage = options.metadataCoverage
|
|
203
243
|
? computeMetadataCoverage(items, classifier)
|
|
204
244
|
: undefined;
|
|
@@ -219,7 +259,7 @@ export async function runStats(global, options = {}) {
|
|
|
219
259
|
items: items.length,
|
|
220
260
|
history_streams: streams.length,
|
|
221
261
|
history_entries: historyEntries,
|
|
222
|
-
}, byType, byStatus, {
|
|
262
|
+
}, distributions.byType, distributions.byStatus, distributions.omitted, {
|
|
223
263
|
metadataCoverage,
|
|
224
264
|
breakdowns,
|
|
225
265
|
storage,
|
|
@@ -231,4 +271,4 @@ export async function runStats(global, options = {}) {
|
|
|
231
271
|
});
|
|
232
272
|
}
|
|
233
273
|
//# sourceMappingURL=stats.js.map
|
|
234
|
-
//# debugId=
|
|
274
|
+
//# debugId=d28c7ac7-9801-5b0c-84c9-51deede398be
|
|
@@ -35,6 +35,8 @@ export interface TestCommandOptions {
|
|
|
35
35
|
addJson?: string[];
|
|
36
36
|
/** Value that configures or reports remove for this contract. */
|
|
37
37
|
remove?: string[];
|
|
38
|
+
/** Remove linked tests by their stable 1-based list position. */
|
|
39
|
+
removeIndex?: Array<string | number>;
|
|
38
40
|
/** Value that configures or reports list for this contract. */
|
|
39
41
|
list?: boolean;
|
|
40
42
|
/** Value that configures or reports run for this contract. */
|
|
@@ -146,6 +148,8 @@ export interface TestResult {
|
|
|
146
148
|
changed: boolean;
|
|
147
149
|
/** Value that configures or reports count for this contract. */
|
|
148
150
|
count: number;
|
|
151
|
+
/** Number of linked-test entries removed by this mutation. */
|
|
152
|
+
removed?: number;
|
|
149
153
|
/** Measurements supplied for the current producing run. */
|
|
150
154
|
measurements?: TestRunMeasurement[];
|
|
151
155
|
/** Existing and current measurements below the selected threshold. */
|