@unbrained/pm-cli 2026.10.11 → 2026.10.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 +1 -1
- package/CHANGELOG.md +45 -0
- package/dist/cli/after-command-context-usage.d.ts +8 -8
- package/dist/cli/bundle-integrity.d.ts +23 -23
- package/dist/cli/commander-usage.d.ts +31 -31
- package/dist/cli/commander-usage.js +3 -3
- package/dist/cli/error-guidance.d.ts +158 -161
- package/dist/cli/error-guidance.js +2 -2
- package/dist/cli/extension-command-help.d.ts +68 -68
- package/dist/cli/extension-command-options.d.ts +20 -20
- package/dist/cli/extension-recovery.d.ts +20 -20
- package/dist/cli/help-content.d.ts +16 -16
- package/dist/cli/help-content.js +2 -2
- package/dist/cli/help-json-payload.d.ts +40 -40
- package/dist/cli/help-json-payload.js +1 -1
- package/dist/cli/invocation-profile.d.ts +8 -8
- package/dist/cli/main.d.ts +166 -165
- package/dist/cli/main.js +4 -4
- package/dist/cli/migration-gates.d.ts +20 -20
- package/dist/cli/register-list-query.d.ts +4 -4
- package/dist/cli/register-mutation-options.d.ts +2 -2
- package/dist/cli/register-operations.d.ts +68 -63
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli/register-setup.d.ts +1 -1
- package/dist/cli/register-structured-mutation.d.ts +3 -3
- package/dist/cli/register-structured-mutation.js +1 -1
- package/dist/cli/runtime/activation.d.ts +3 -3
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli/runtime/selection.d.ts +6 -6
- package/dist/cli/runtime-compatibility-boundary.d.ts +12 -12
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-K2UTE75T.js → chunk-AM2XOZKE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-S445XEYT.js → chunk-APWPC4ZZ.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-DJDRHJBP.js +234 -0
- package/dist/cli-bundle/chunks/{chunk-RUT3CCAG.js → chunk-DUK5DHI6.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-HXHFKXLV.js +2 -0
- package/dist/cli-bundle/chunks/chunk-IFPJDJUM.js +20 -0
- package/dist/cli-bundle/chunks/{chunk-OBLO45UM.js → chunk-LBDWFWPK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZWRLAOA4.js → chunk-N5EXRYCZ.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-PSNS537F.js +30 -0
- package/dist/cli-bundle/chunks/{chunk-2JYTSTQP.js → chunk-RL45OYTL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ESRACL6K.js → chunk-UBTYYZIE.js} +49 -49
- package/dist/cli-bundle/chunks/chunk-WYZGZV2M.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-SSY4OSJR.js → chunk-YH6H3UVE.js} +10 -10
- package/dist/cli-bundle/chunks/{register-list-query-T6BOR67M.js → register-list-query-BJ742QOR.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-6NXR7SAJ.js → register-mutation-GGGBRIH2.js} +3 -3
- package/dist/cli-bundle/chunks/register-operations-E6HXYHNM.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-MAYFPKBX.js → register-setup-4ZVTVEPY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-EIOQNLBQ.js → chunk-3LQEBXU5.js} +12 -12
- package/dist/cli-bundle/focused-chunks/{chunk-PLTTMQAW.js → chunk-6BTUISKV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-73UNAJHD.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-WAOXID5J.js → chunk-DVK7VKZL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SIEGIPNT.js → chunk-F5J3ATMV.js} +16 -16
- package/dist/cli-bundle/focused-chunks/chunk-IIKFTJVC.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IOTNG6CN.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-AU6VJGTY.js → chunk-KGFRQ34R.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-NNW5BS5L.js +3 -0
- package/dist/cli-bundle/focused-chunks/{chunk-KNJR2WUO.js → chunk-QMNAY25P.js} +62 -62
- package/dist/cli-bundle/focused-chunks/{chunk-W5AE7GKZ.js → chunk-R23T7GFZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-RAA7SVRA.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-52UJEHEV.js → chunk-RU6GCFN3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-JGFSSR3G.js → chunk-S6ITXQ5T.js} +5 -5
- package/dist/cli-bundle/focused-chunks/{chunk-DMSADMEU.js → chunk-SOB7X4FJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-UPJA45K7.js +26 -0
- package/dist/cli-bundle/main.js +22 -22
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +31 -31
- 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 +51 -51
- 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 +8 -8
- package/dist/cli.d.ts +4 -4
- package/dist/core/checkpoint/checkpoint-gc.d.ts +32 -32
- package/dist/core/checkpoint/mutation-checkpoint.d.ts +34 -34
- package/dist/core/config/nested-settings.d.ts +26 -26
- package/dist/core/config/positional-value.d.ts +16 -16
- package/dist/core/diagnostics/remediation.d.ts +6 -6
- package/dist/core/diagnostics/remediation.js +1 -1
- package/dist/core/extensions/activation-summary-markdown.d.ts +6 -6
- package/dist/core/extensions/activation-summary.d.ts +54 -54
- package/dist/core/extensions/activation-transaction.d.ts +7 -7
- package/dist/core/extensions/capability-usage.d.ts +26 -26
- package/dist/core/extensions/command-hook-context.d.ts +26 -26
- package/dist/core/extensions/contribution-inventory.d.ts +21 -21
- package/dist/core/extensions/extension-candidate.d.ts +14 -14
- package/dist/core/extensions/extension-capability-aliases.d.ts +2 -2
- package/dist/core/extensions/extension-policy.d.ts +80 -80
- package/dist/core/extensions/extension-types.d.ts +1294 -1285
- package/dist/core/extensions/extension-types.js +1 -1
- package/dist/core/extensions/flag-definition-validation.d.ts +4 -4
- package/dist/core/extensions/item-fields.d.ts +3 -2
- package/dist/core/extensions/item-fields.js +1 -1
- package/dist/core/extensions/loader.d.ts +36 -36
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/manifest-schema.d.ts +16 -16
- package/dist/core/extensions/module-graph-snapshot.d.ts +8 -8
- package/dist/core/extensions/read-output-contract.d.ts +5 -0
- package/dist/core/extensions/read-output-contract.js +2 -0
- package/dist/core/extensions/registration-values.d.ts +1 -1
- package/dist/core/extensions/reserved-host-flags.d.ts +6 -6
- package/dist/core/extensions/version-compat.d.ts +10 -10
- package/dist/core/fs/fs-utils.d.ts +1 -1
- package/dist/core/fs/host-environment-errors.d.ts +14 -14
- package/dist/core/governance/content-fields.d.ts +31 -31
- package/dist/core/governance/issue-codes.d.ts +27 -27
- package/dist/core/governance/metadata-coverage.d.ts +91 -91
- package/dist/core/history/drift-scan.d.ts +26 -26
- package/dist/core/history/event-classification.d.ts +1 -1
- package/dist/core/history/event-classification.js +1 -1
- package/dist/core/history/event-index.d.ts +41 -41
- package/dist/core/history/history-compact-bulk.d.ts +22 -22
- package/dist/core/history/history-diff.d.ts +22 -22
- package/dist/core/history/history-rewrite.d.ts +66 -66
- package/dist/core/history/history-storage-stats.d.ts +31 -31
- package/dist/core/history/history-stream-policy.d.ts +12 -12
- package/dist/core/history/history.d.ts +22 -22
- package/dist/core/history/identity.d.ts +6 -6
- package/dist/core/history/operation-contract.d.ts +9 -9
- package/dist/core/history/projection.d.ts +15 -15
- package/dist/core/history/read.d.ts +4 -4
- package/dist/core/history/replay.d.ts +51 -49
- package/dist/core/history/replay.js +1 -1
- package/dist/core/history/workspace-history.d.ts +101 -101
- package/dist/core/io/bulk-ids-input.d.ts +4 -4
- package/dist/core/item/actionability.d.ts +40 -40
- package/dist/core/item/id.d.ts +3 -3
- package/dist/core/item/item-format-version.d.ts +8 -8
- package/dist/core/item/item-format.d.ts +37 -35
- package/dist/core/item/item-format.js +2 -2
- package/dist/core/item/item-type-definition.d.ts +2 -2
- package/dist/core/item/parent-reference-policy.d.ts +1 -1
- package/dist/core/item/parse.d.ts +12 -12
- package/dist/core/item/sprint-release-format.d.ts +2 -2
- package/dist/core/item/status-filter.d.ts +4 -4
- package/dist/core/item/toon-decode.d.ts +9 -9
- package/dist/core/item/type-registry.d.ts +40 -40
- package/dist/core/lock/lock-gc.d.ts +50 -50
- package/dist/core/lock/lock.d.ts +37 -37
- package/dist/core/output/mutation-projection.d.ts +6 -6
- package/dist/core/output/output-control.d.ts +4 -4
- package/dist/core/output/output.d.ts +40 -40
- package/dist/core/output/query-summary.d.ts +5 -5
- package/dist/core/packages/manifest.d.ts +50 -50
- package/dist/core/policy/workflow-policy-schema.d.ts +306 -306
- package/dist/core/policy/workflow-policy-store.d.ts +7 -7
- package/dist/core/policy/workflow-policy.d.ts +81 -81
- package/dist/core/profile/profile-describe.d.ts +40 -40
- package/dist/core/profile/profile-lint.d.ts +20 -20
- package/dist/core/profile/profile-plan.d.ts +84 -84
- package/dist/core/profile/profile-presets.d.ts +52 -52
- package/dist/core/reproducibility/context.d.ts +6 -6
- package/dist/core/schema/fields-file.d.ts +54 -54
- package/dist/core/schema/item-types-file.d.ts +36 -36
- package/dist/core/schema/runtime-field-values.d.ts +2 -2
- package/dist/core/schema/runtime-schema.d.ts +86 -86
- package/dist/core/schema/status-defs-file.d.ts +36 -36
- package/dist/core/schema/type-inference.d.ts +14 -14
- package/dist/core/schema/type-workflows.d.ts +22 -22
- package/dist/core/search/background-refresh.d.ts +9 -9
- package/dist/core/search/bm25.d.ts +19 -19
- package/dist/core/search/cache.d.ts +35 -35
- package/dist/core/search/corpus.d.ts +12 -12
- package/dist/core/search/embedding-batches.d.ts +48 -48
- package/dist/core/search/eval.d.ts +49 -49
- package/dist/core/search/http-client.d.ts +38 -38
- package/dist/core/search/providers.d.ts +41 -41
- package/dist/core/search/relevance.d.ts +20 -20
- package/dist/core/search/semantic-defaults.d.ts +8 -8
- package/dist/core/search/staleness.d.ts +4 -4
- package/dist/core/search/vector-stores.d.ts +78 -78
- package/dist/core/search/vectorization-metadata.d.ts +6 -6
- package/dist/core/sentry/helpers.d.ts +15 -15
- package/dist/core/sentry/instrument.d.ts +40 -40
- package/dist/core/session/session-state.d.ts +32 -32
- package/dist/core/shared/agent-session-context.d.ts +14 -14
- package/dist/core/shared/author.d.ts +128 -128
- package/dist/core/shared/command-types.d.ts +40 -40
- package/dist/core/shared/conflict-markers.d.ts +6 -6
- package/dist/core/shared/constants.d.ts +13 -13
- package/dist/core/shared/errors.d.ts +194 -183
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/shared/secret-rules.d.ts +97 -97
- package/dist/core/shared/serial-queue.d.ts +8 -8
- package/dist/core/shared/split-comma-list.d.ts +6 -6
- package/dist/core/shared/time.d.ts +23 -23
- package/dist/core/store/item-format-migration.d.ts +10 -10
- package/dist/core/store/item-metadata-cache.d.ts +38 -38
- package/dist/core/store/item-metadata-query-index.d.ts +79 -79
- package/dist/core/store/item-metadata-read-work.d.ts +6 -6
- package/dist/core/store/item-store.d.ts +110 -110
- package/dist/core/store/paths.d.ts +2 -2
- package/dist/core/store/settings-read-cache.d.ts +12 -12
- package/dist/core/store/settings-validator.d.ts +165 -165
- package/dist/core/store/settings.d.ts +59 -59
- package/dist/core/telemetry/observability.d.ts +17 -17
- package/dist/core/telemetry/policy.d.ts +3 -3
- package/dist/core/telemetry/runtime.d.ts +242 -242
- package/dist/core/telemetry/runtime.js +2 -2
- package/dist/core/test/background-runs.d.ts +186 -185
- package/dist/core/test/background-runs.js +2 -2
- package/dist/core/test/item-test-run-tracking.d.ts +6 -6
- package/dist/core/test/run-selectors.d.ts +18 -18
- package/dist/core/validate/fix-planning.d.ts +50 -50
- package/dist/core/validate/missing-by-type.d.ts +4 -4
- package/dist/core/validate/missing-link-owners.d.ts +30 -30
- package/dist/core/validate/stale-file-classification.d.ts +8 -8
- package/dist/mcp/http-server.d.ts +28 -28
- package/dist/mcp/legacy-adapter.d.ts +33 -33
- package/dist/mcp/runtime-capabilities.d.ts +16 -16
- package/dist/mcp/server.d.ts +50 -50
- package/dist/mcp/tool-definitions.d.ts +36 -36
- package/dist/sdk/agent/closed-domain-contracts.d.ts +18 -18
- package/dist/sdk/agent/command-recovery.d.ts +4 -0
- package/dist/sdk/agent/command-recovery.js +1 -1
- package/dist/sdk/agent/command-suggestions.d.ts +2 -0
- package/dist/sdk/agent/command-suggestions.js +1 -1
- package/dist/sdk/agent/identity-config.d.ts +32 -32
- package/dist/sdk/agent/item-addressing.d.ts +8 -8
- package/dist/sdk/agent/refusal-closure-census.d.ts +34 -34
- package/dist/sdk/agent/refusal-closure.d.ts +42 -42
- package/dist/sdk/agent/refusal-corpus-contracts.d.ts +46 -46
- package/dist/sdk/agent/refusal-reachability.d.ts +112 -112
- package/dist/sdk/agent/subcommand-recovery.d.ts +25 -25
- package/dist/sdk/agent/task-transcript-contracts.d.ts +30 -30
- package/dist/sdk/agent/tracker-preflight-contracts.d.ts +38 -38
- package/dist/sdk/agent-capability-contracts.d.ts +37 -37
- package/dist/sdk/annotations.d.ts +106 -106
- package/dist/sdk/author-attribution.d.ts +76 -76
- package/dist/sdk/authoring.d.ts +1 -1
- package/dist/sdk/authoring.js +1 -1
- package/dist/sdk/cli-bootstrap.d.ts +70 -70
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +63 -63
- package/dist/sdk/cli-contracts/command-aliases.d.ts +14 -14
- package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +70 -70
- package/dist/sdk/cli-contracts/commander-types.d.ts +17 -17
- package/dist/sdk/cli-contracts/completeness.d.ts +26 -26
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +5 -5
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +32 -32
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +42 -42
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
- package/dist/sdk/cli-contracts/grammar-contracts.d.ts +84 -84
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/registration-helpers.d.ts +37 -40
- package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +290 -294
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +793 -793
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +391 -391
- package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +6 -6
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +55 -55
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +24 -24
- package/dist/sdk/comments.d.ts +44 -44
- package/dist/sdk/compile-cache.d.ts +4 -4
- package/dist/sdk/completion/shared.d.ts +22 -22
- package/dist/sdk/compose.d.ts +156 -156
- package/dist/sdk/config.d.ts +123 -123
- package/dist/sdk/context/semantic-session-attribution.d.ts +14 -14
- package/dist/sdk/context/usage-ledger.d.ts +20 -20
- package/dist/sdk/context-intent-contracts.d.ts +50 -50
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/context-intent-runtime.d.ts +8 -8
- package/dist/sdk/context-packing.d.ts +78 -78
- package/dist/sdk/context-relevance.d.ts +189 -180
- package/dist/sdk/context-relevance.js +1 -1
- package/dist/sdk/context-signal-store.d.ts +84 -84
- package/dist/sdk/context-usage.d.ts +92 -92
- package/dist/sdk/core.d.ts +1 -0
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/corpus-shape.d.ts +101 -101
- package/dist/sdk/define.d.ts +2 -2
- package/dist/sdk/dependencies.d.ts +116 -116
- package/dist/sdk/dependency-flag-validation.d.ts +14 -12
- package/dist/sdk/dependency-flag-validation.js +1 -1
- package/dist/sdk/dependency-provenance.d.ts +30 -30
- package/dist/sdk/docs.d.ts +32 -32
- package/dist/sdk/duplicates.d.ts +21 -21
- package/dist/sdk/environment/agent-environment.d.ts +196 -196
- package/dist/sdk/environment/project-runtime-compatibility.d.ts +56 -56
- package/dist/sdk/environment/source-context.d.ts +6 -6
- package/dist/sdk/error-code-catalog.d.ts +40 -40
- package/dist/sdk/errors.d.ts +29 -29
- package/dist/sdk/eval.d.ts +45 -45
- package/dist/sdk/extension/author-manifest.d.ts +14 -14
- package/dist/sdk/extension/bundled-catalog.d.ts +7 -7
- package/dist/sdk/extension/describe.d.ts +36 -36
- package/dist/sdk/extension/doctor.d.ts +29 -29
- package/dist/sdk/extension/install-plan.d.ts +55 -55
- package/dist/sdk/extension/install-receipts.d.ts +2 -2
- package/dist/sdk/extension/install-runtime.d.ts +8 -8
- package/dist/sdk/extension/install-snapshot.d.ts +14 -14
- package/dist/sdk/extension/install-sources.d.ts +96 -96
- package/dist/sdk/extension/managed-state.d.ts +66 -66
- package/dist/sdk/extension/migrations.d.ts +82 -82
- package/dist/sdk/extension/output-ownership.d.ts +24 -24
- package/dist/sdk/extension/runtime-summary.d.ts +5 -5
- package/dist/sdk/extension/scaffold.d.ts +12 -12
- package/dist/sdk/extension/shared.d.ts +15 -15
- package/dist/sdk/extension/source-resolution.d.ts +30 -30
- package/dist/sdk/extension/static-inventory.d.ts +42 -42
- package/dist/sdk/extension/update-check.d.ts +10 -10
- package/dist/sdk/extension.d.ts +320 -320
- package/dist/sdk/files.d.ts +157 -157
- package/dist/sdk/flag-invocation-contracts.d.ts +44 -44
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance/artifact-ledgers.d.ts +35 -35
- package/dist/sdk/governance/artifact-ledgers.js +1 -1
- package/dist/sdk/governance/assurance-action.d.ts +68 -68
- package/dist/sdk/governance/assurance-action.js +1 -1
- package/dist/sdk/governance/assurance-mutation-error.d.ts +36 -36
- package/dist/sdk/governance/assurance-presets.d.ts +24 -24
- package/dist/sdk/governance/assurance-runtime.d.ts +14 -14
- package/dist/sdk/governance/assurance.d.ts +353 -353
- package/dist/sdk/governance/boundary-fixtures.d.ts +60 -60
- package/dist/sdk/governance/closure-timestamps.d.ts +9 -9
- package/dist/sdk/governance/coverage-assurance.d.ts +10 -10
- package/dist/sdk/governance/defect-recurrence-coverage.d.ts +75 -75
- package/dist/sdk/governance/defect-recurrence-graph.d.ts +18 -18
- package/dist/sdk/governance/defect-recurrence.d.ts +186 -181
- package/dist/sdk/governance/defect-recurrence.js +1 -1
- package/dist/sdk/governance/extension-host-version.d.ts +16 -16
- package/dist/sdk/governance/gc.d.ts +48 -48
- package/dist/sdk/governance/health-merge-evidence.d.ts +5 -5
- package/dist/sdk/governance/health.d.ts +188 -188
- package/dist/sdk/governance/hierarchy-validation.d.ts +13 -13
- package/dist/sdk/governance/linked-file-report.d.ts +26 -26
- package/dist/sdk/governance/merge-receipt-history.d.ts +36 -36
- package/dist/sdk/governance/provenance-health.d.ts +64 -64
- package/dist/sdk/governance/reindex.d.ts +89 -89
- package/dist/sdk/governance/reliability.d.ts +56 -56
- package/dist/sdk/governance/stale-work.d.ts +22 -22
- package/dist/sdk/governance/status-role-diagnostics.d.ts +12 -12
- package/dist/sdk/governance/storage-integrity.d.ts +54 -54
- package/dist/sdk/governance/tracked-runtime-cache.d.ts +10 -10
- package/dist/sdk/governance/upgrade.d.ts +104 -104
- package/dist/sdk/governance/validate-history-drift.d.ts +2 -2
- package/dist/sdk/governance/validate-item-reader.d.ts +6 -6
- package/dist/sdk/governance/validate.d.ts +191 -191
- package/dist/sdk/governance/workflow-completeness.d.ts +15 -15
- package/dist/sdk/governance/workflow-policy.d.ts +28 -28
- package/dist/sdk/governance/workspace-position.d.ts +46 -46
- package/dist/sdk/graph/adapter.d.ts +66 -66
- package/dist/sdk/graph/analytics.d.ts +54 -54
- package/dist/sdk/graph/assembly.d.ts +80 -80
- package/dist/sdk/graph/cache.d.ts +29 -29
- package/dist/sdk/graph/cardinality-integrity.d.ts +13 -0
- package/dist/sdk/graph/cardinality-integrity.js +2 -0
- package/dist/sdk/graph/centrality.d.ts +34 -34
- package/dist/sdk/graph/conformance.d.ts +33 -33
- package/dist/sdk/graph/deadline-scheduling.d.ts +58 -58
- package/dist/sdk/graph/durable-cache.d.ts +26 -26
- package/dist/sdk/graph/governance.d.ts +165 -165
- package/dist/sdk/graph/hierarchy-integrity.d.ts +52 -52
- package/dist/sdk/graph/index.d.ts +1 -0
- package/dist/sdk/graph/index.js +1 -1
- package/dist/sdk/graph/lifecycle-coverage.d.ts +17 -17
- package/dist/sdk/graph/mutation-advisory.d.ts +11 -11
- package/dist/sdk/graph/query-contracts.d.ts +10 -10
- package/dist/sdk/graph/remediation.d.ts +25 -25
- package/dist/sdk/graph/run.d.ts +392 -392
- package/dist/sdk/graph/scheduling.d.ts +38 -38
- package/dist/sdk/graph/traversal.d.ts +14 -14
- package/dist/sdk/guide-topics.d.ts +32 -32
- package/dist/sdk/guide.d.ts +62 -62
- package/dist/sdk/history/attestation-command.d.ts +12 -12
- package/dist/sdk/history/attestation-contract.d.ts +78 -78
- package/dist/sdk/history/attestation-scan.d.ts +6 -6
- package/dist/sdk/history/maintenance.d.ts +46 -46
- package/dist/sdk/history/salvage.d.ts +18 -18
- package/dist/sdk/history/subject.d.ts +9 -9
- package/dist/sdk/history-analytics.d.ts +84 -84
- package/dist/sdk/history-compact.d.ts +103 -103
- package/dist/sdk/history-mcp.d.ts +8 -8
- package/dist/sdk/history-provenance.d.ts +59 -59
- package/dist/sdk/history-read.d.ts +36 -36
- package/dist/sdk/history-redact.d.ts +78 -78
- package/dist/sdk/history-repair.d.ts +158 -158
- package/dist/sdk/history-repair.js +1 -1
- package/dist/sdk/improvement-ledger.d.ts +102 -102
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/init-agent-guidance.d.ts +70 -70
- package/dist/sdk/init.d.ts +152 -152
- package/dist/sdk/item-children.d.ts +28 -28
- package/dist/sdk/item-schedule.d.ts +12 -12
- package/dist/sdk/item-transaction.d.ts +100 -100
- package/dist/sdk/learnings.d.ts +42 -42
- package/dist/sdk/lifecycle/append.d.ts +14 -14
- package/dist/sdk/lifecycle/claim.d.ts +60 -60
- package/dist/sdk/lifecycle/close-many.d.ts +94 -94
- package/dist/sdk/lifecycle/close.d.ts +27 -27
- package/dist/sdk/lifecycle/copy.d.ts +18 -18
- package/dist/sdk/lifecycle/core-field-recovery.d.ts +7 -0
- package/dist/sdk/lifecycle/core-field-recovery.js +2 -0
- package/dist/sdk/lifecycle/create.d.ts +82 -82
- package/dist/sdk/lifecycle/create.js +1 -1
- package/dist/sdk/lifecycle/delete.d.ts +28 -28
- package/dist/sdk/lifecycle/focus.d.ts +10 -10
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +10 -10
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
- package/dist/sdk/lifecycle/legacy-none-tokens.d.ts +54 -54
- package/dist/sdk/lifecycle/lifecycle-transitions.d.ts +4 -4
- package/dist/sdk/lifecycle/mcp-actions.d.ts +10 -10
- package/dist/sdk/lifecycle/mutation-command-options.d.ts +116 -116
- package/dist/sdk/lifecycle/mutation-facet-contracts.d.ts +6 -0
- package/dist/sdk/lifecycle/mutation-facet-contracts.js +2 -0
- package/dist/sdk/lifecycle/plan-mutation-receipt.d.ts +42 -42
- package/dist/sdk/lifecycle/plan.d.ts +217 -217
- package/dist/sdk/lifecycle/reopen.d.ts +29 -24
- package/dist/sdk/lifecycle/reopen.js +1 -1
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.d.ts +3 -3
- package/dist/sdk/lifecycle/restore.d.ts +33 -33
- package/dist/sdk/lifecycle/shared-unset-fields.d.ts +19 -19
- package/dist/sdk/lifecycle/task-composition.d.ts +4 -4
- package/dist/sdk/lifecycle/update-many.d.ts +79 -79
- package/dist/sdk/lifecycle/update.d.ts +131 -132
- package/dist/sdk/lifecycle/update.js +2 -2
- package/dist/sdk/lifecycle-completion.d.ts +22 -22
- package/dist/sdk/lifecycle-policy.d.ts +52 -52
- package/dist/sdk/linked-artifacts.d.ts +69 -69
- package/dist/sdk/mcp/apps.d.ts +32 -32
- package/dist/sdk/mcp/authorization.d.ts +76 -76
- package/dist/sdk/mcp/discovery.d.ts +111 -111
- package/dist/sdk/mcp/interactions.d.ts +61 -61
- package/dist/sdk/mcp/protocol.d.ts +78 -78
- package/dist/sdk/mcp/skills.d.ts +88 -88
- package/dist/sdk/mcp/subscriptions.d.ts +39 -39
- package/dist/sdk/mcp/tasks.d.ts +75 -75
- package/dist/sdk/mcp/transport.d.ts +11 -11
- package/dist/sdk/merge/abandoned-receipts.d.ts +6 -6
- package/dist/sdk/merge/driver.d.ts +60 -60
- package/dist/sdk/merge/install.d.ts +64 -64
- package/dist/sdk/merge/receipt-file-boundary.d.ts +5 -5
- package/dist/sdk/merge/receipt-operation.d.ts +6 -6
- package/dist/sdk/merge/receipt-schema.d.ts +2 -2
- package/dist/sdk/merge/receipts.d.ts +156 -156
- package/dist/sdk/merge/reconcile.d.ts +36 -36
- package/dist/sdk/merge/reconcile.js +1 -1
- package/dist/sdk/merge/three-way.d.ts +77 -76
- package/dist/sdk/merge/three-way.js +1 -1
- package/dist/sdk/mutation-events.d.ts +84 -84
- package/dist/sdk/mutation-guard.d.ts +106 -106
- package/dist/sdk/notes.d.ts +52 -52
- package/dist/sdk/output/table-rows.d.ts +8 -8
- package/dist/sdk/output-contracts.d.ts +38 -38
- package/dist/sdk/output-projection.d.ts +142 -142
- package/dist/sdk/output-token-accounting.d.ts +27 -27
- package/dist/sdk/output.d.ts +28 -28
- package/dist/sdk/package-import-adapters.d.ts +54 -54
- package/dist/sdk/pagination.d.ts +29 -29
- package/dist/sdk/profile.d.ts +123 -123
- package/dist/sdk/provenance.d.ts +58 -58
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.d.ts +118 -118
- package/dist/sdk/query/aggregate.d.ts +140 -140
- package/dist/sdk/query/calendar.d.ts +144 -144
- package/dist/sdk/query/complete-list.d.ts +53 -53
- package/dist/sdk/query/context.d.ts +395 -395
- package/dist/sdk/query/duplicate-candidates.d.ts +1 -1
- package/dist/sdk/query/get.d.ts +77 -77
- package/dist/sdk/query/history.d.ts +72 -72
- package/dist/sdk/query/item-filter-options.d.ts +79 -79
- package/dist/sdk/query/list-filter-shared.d.ts +1 -1
- package/dist/sdk/query/list.d.ts +188 -188
- package/dist/sdk/query/multi-value-filters.d.ts +4 -4
- package/dist/sdk/query/next-ready-budget.d.ts +14 -14
- package/dist/sdk/query/next.d.ts +137 -137
- package/dist/sdk/query/projection-contracts.d.ts +8 -8
- package/dist/sdk/query/search/corpus.d.ts +8 -8
- package/dist/sdk/query/search/filters.d.ts +5 -5
- package/dist/sdk/query/search/input.d.ts +4 -4
- package/dist/sdk/query/search/response.d.ts +8 -8
- package/dist/sdk/query/search/semantic.d.ts +106 -106
- package/dist/sdk/query/search/types.d.ts +85 -85
- package/dist/sdk/query/search-contracts.d.ts +65 -65
- package/dist/sdk/query/search-pagination.d.ts +19 -19
- package/dist/sdk/query/search-rendering.d.ts +25 -25
- package/dist/sdk/query/search.d.ts +46 -46
- package/dist/sdk/read-output/continuation.d.ts +8 -8
- package/dist/sdk/read-output/continuation.js +1 -1
- package/dist/sdk/read-output/extension.d.ts +7 -0
- package/dist/sdk/read-output/extension.js +2 -0
- package/dist/sdk/read-output/options.d.ts +6 -4
- package/dist/sdk/read-output/options.js +1 -1
- package/dist/sdk/read-output/provenance.d.ts +8 -8
- package/dist/sdk/read-output-budget.d.ts +10 -10
- package/dist/sdk/read-output-contracts.d.ts +192 -186
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.d.ts +6 -6
- package/dist/sdk/read-output-session.d.ts +50 -50
- package/dist/sdk/relationship-analytics.d.ts +78 -78
- package/dist/sdk/relationship-context.d.ts +81 -81
- package/dist/sdk/relationship-history.d.ts +109 -109
- package/dist/sdk/relationship-kinds/contract.d.ts +34 -34
- package/dist/sdk/relationship-migration.d.ts +26 -26
- package/dist/sdk/relationships.d.ts +78 -78
- package/dist/sdk/reproducibility/process.d.ts +3 -3
- package/dist/sdk/runtime/context.d.ts +11 -11
- package/dist/sdk/runtime-action-aliases.d.ts +2 -2
- package/dist/sdk/runtime-extended-actions.d.ts +8 -8
- package/dist/sdk/runtime-input.d.ts +3 -3
- package/dist/sdk/runtime-public-contracts.d.ts +78 -78
- package/dist/sdk/runtime.d.ts +305 -305
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/scheduling-shortcuts.d.ts +32 -32
- package/dist/sdk/schema-migration.d.ts +86 -86
- package/dist/sdk/schema.d.ts +355 -355
- package/dist/sdk/similarity-scoring.d.ts +10 -10
- package/dist/sdk/similarity.d.ts +113 -113
- package/dist/sdk/stats.d.ts +108 -108
- package/dist/sdk/structured-mutations.d.ts +16 -16
- package/dist/sdk/structured-mutations.js +1 -1
- package/dist/sdk/telemetry.d.ts +53 -53
- package/dist/sdk/templates.d.ts +39 -39
- package/dist/sdk/test/batch.d.ts +85 -85
- package/dist/sdk/test/batch.js +1 -1
- package/dist/sdk/test/command-args.d.ts +4 -0
- package/dist/sdk/test/command-args.js +2 -0
- package/dist/sdk/test/entry.d.ts +3 -0
- package/dist/sdk/test/entry.js +1 -1
- package/dist/sdk/test/execution-receipts.d.ts +3 -3
- package/dist/sdk/test/execution.d.ts +279 -268
- package/dist/sdk/test/execution.js +2 -2
- package/dist/sdk/test/json-path.d.ts +2 -2
- package/dist/sdk/test/linked-command-detection.d.ts +10 -10
- package/dist/sdk/test/measurements.d.ts +11 -11
- package/dist/sdk/test/parsers.d.ts +1 -1
- package/dist/sdk/test/parsers.js +1 -1
- package/dist/sdk/test/prerequisites.d.ts +6 -0
- package/dist/sdk/test/prerequisites.js +2 -0
- package/dist/sdk/test/runs.d.ts +52 -52
- package/dist/sdk/test/trust.d.ts +12 -12
- package/dist/sdk/test/trust.js +1 -1
- package/dist/sdk/test/update.d.ts +55 -0
- package/dist/sdk/test/update.js +2 -0
- package/dist/sdk/testing.d.ts +319 -319
- package/dist/sdk/traceability/source-traceability.d.ts +65 -65
- package/dist/sdk/workspace-contracts.d.ts +37 -37
- package/dist/sdk/workspace-memory.d.ts +60 -60
- package/dist/sdk/workspace-recipe.d.ts +9 -9
- package/dist/sdk/workspace-snapshot.d.ts +97 -97
- package/dist/sdk/workspace-transaction-gc.d.ts +32 -32
- package/dist/sdk/workspace-transaction.d.ts +47 -47
- package/dist/sdk/workspace.d.ts +6 -6
- package/dist/types.d.ts +978 -974
- package/dist/types.js +1 -1
- package/docs/BUILD_AND_RELEASE_ACCEPTANCE.md +5 -2
- package/docs/DEFECT_RECURRENCE.md +12 -0
- package/docs/EXTENSIONS.md +2 -2
- package/docs/LINKED_TEST_EDITS.md +79 -0
- package/docs/MERGE_SAFETY.md +27 -1
- package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +17 -4
- package/docs/RELATIONSHIP_GRAPH.md +26 -0
- package/docs/RELEASING.md +25 -8
- package/docs/SDK.md +204 -637
- package/docs/SDK_CONSUMER_RECEIPTS.md +67 -0
- package/docs/SDK_EVIDENCE_TRACEABILITY.md +4 -0
- package/docs/TESTING.md +13 -0
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +11 -3
- package/docs/performance/runner-qualification.md +36 -0
- package/marketplace.json +1 -1
- package/node_modules/@opentelemetry/core/build/esm/version.d.ts +1 -1
- package/node_modules/@opentelemetry/core/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/core/build/esnext/version.d.ts +1 -1
- package/node_modules/@opentelemetry/core/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/core/build/src/version.d.ts +1 -1
- package/node_modules/@opentelemetry/core/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/core/package.json +2 -2
- package/node_modules/@opentelemetry/resources/build/esm/version.d.ts +1 -1
- package/node_modules/@opentelemetry/resources/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/resources/build/esnext/version.d.ts +1 -1
- package/node_modules/@opentelemetry/resources/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/resources/build/src/version.d.ts +1 -1
- package/node_modules/@opentelemetry/resources/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/resources/package.json +3 -3
- package/node_modules/@opentelemetry/sdk-trace/build/esm/StackContextManager.d.ts +57 -0
- package/node_modules/@opentelemetry/sdk-trace/build/esm/StackContextManager.js +105 -0
- package/node_modules/@opentelemetry/sdk-trace/build/esm/index.d.ts +1 -0
- package/node_modules/@opentelemetry/sdk-trace/build/esm/index.js +1 -0
- package/node_modules/@opentelemetry/sdk-trace/build/esm/version.d.ts +1 -1
- package/node_modules/@opentelemetry/sdk-trace/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/StackContextManager.d.ts +57 -0
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/StackContextManager.js +105 -0
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/index.d.ts +1 -0
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/index.js +1 -0
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/version.d.ts +1 -1
- package/node_modules/@opentelemetry/sdk-trace/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace/build/src/StackContextManager.d.ts +57 -0
- package/node_modules/@opentelemetry/sdk-trace/build/src/StackContextManager.js +109 -0
- package/node_modules/@opentelemetry/sdk-trace/build/src/index.d.ts +1 -0
- package/node_modules/@opentelemetry/sdk-trace/build/src/index.js +3 -1
- package/node_modules/@opentelemetry/sdk-trace/build/src/version.d.ts +1 -1
- package/node_modules/@opentelemetry/sdk-trace/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace/package.json +5 -5
- package/node_modules/@opentelemetry/sdk-trace-base/build/esm/version.d.ts +1 -1
- package/node_modules/@opentelemetry/sdk-trace-base/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace-base/build/esnext/version.d.ts +1 -1
- package/node_modules/@opentelemetry/sdk-trace-base/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace-base/build/src/version.d.ts +1 -1
- package/node_modules/@opentelemetry/sdk-trace-base/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/sdk-trace-base/package.json +7 -7
- package/node_modules/@sentry/core/build/cjs/browser.js +3 -0
- package/node_modules/@sentry/core/build/cjs/fetch.js +10 -9
- package/node_modules/@sentry/core/build/cjs/index.js +3 -0
- package/node_modules/@sentry/core/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js +2 -1
- package/node_modules/@sentry/core/build/cjs/integrations/http/get-outgoing-span-data.js +3 -2
- package/node_modules/@sentry/core/build/cjs/integrations/http/server-subscription.js +7 -3
- package/node_modules/@sentry/core/build/cjs/integrations/requestdata.js +23 -9
- package/node_modules/@sentry/core/build/cjs/server.js +3 -0
- package/node_modules/@sentry/core/build/cjs/utils/data-collection/filterCollectedUrl.js +24 -0
- package/node_modules/@sentry/core/build/cjs/utils/data-collection/filterKeyValueData.js +17 -23
- package/node_modules/@sentry/core/build/cjs/utils/data-collection/filterQueryParams.js +8 -15
- package/node_modules/@sentry/core/build/cjs/utils/data-collection/filterUrlQuery.js +20 -0
- package/node_modules/@sentry/core/build/cjs/utils/url.js +4 -3
- package/node_modules/@sentry/core/build/cjs/utils/version.js +1 -1
- package/node_modules/@sentry/core/build/esm/browser.js +1 -0
- package/node_modules/@sentry/core/build/esm/fetch.js +10 -9
- package/node_modules/@sentry/core/build/esm/index.js +1 -0
- package/node_modules/@sentry/core/build/esm/integrations/http/add-outgoing-request-breadcrumb.js +2 -1
- package/node_modules/@sentry/core/build/esm/integrations/http/get-outgoing-span-data.js +3 -2
- package/node_modules/@sentry/core/build/esm/integrations/http/server-subscription.js +7 -3
- package/node_modules/@sentry/core/build/esm/integrations/requestdata.js +23 -9
- package/node_modules/@sentry/core/build/esm/package.json +1 -1
- package/node_modules/@sentry/core/build/esm/server.js +1 -0
- package/node_modules/@sentry/core/build/esm/utils/data-collection/filterCollectedUrl.js +21 -0
- package/node_modules/@sentry/core/build/esm/utils/data-collection/filterKeyValueData.js +18 -25
- package/node_modules/@sentry/core/build/esm/utils/data-collection/filterQueryParams.js +9 -16
- package/node_modules/@sentry/core/build/esm/utils/data-collection/filterUrlQuery.js +18 -0
- package/node_modules/@sentry/core/build/esm/utils/url.js +4 -3
- package/node_modules/@sentry/core/build/esm/utils/version.js +1 -1
- package/node_modules/@sentry/core/build/types/shared-exports.d.ts +1 -0
- package/node_modules/@sentry/core/build/types/utils/data-collection/filterCollectedUrl.d.ts +21 -0
- package/node_modules/@sentry/core/build/types/utils/data-collection/filterKeyValueData.d.ts +1 -0
- package/node_modules/@sentry/core/build/types/utils/data-collection/filterQueryParams.d.ts +2 -3
- package/node_modules/@sentry/core/build/types/utils/data-collection/filterUrlQuery.d.ts +13 -0
- package/node_modules/@sentry/core/build/types/utils/url.d.ts +4 -1
- package/node_modules/@sentry/core/build/types-ts3.8/shared-exports.d.ts +1 -0
- package/node_modules/@sentry/core/build/types-ts3.8/utils/data-collection/filterCollectedUrl.d.ts +21 -0
- package/node_modules/@sentry/core/build/types-ts3.8/utils/data-collection/filterKeyValueData.d.ts +1 -0
- package/node_modules/@sentry/core/build/types-ts3.8/utils/data-collection/filterQueryParams.d.ts +2 -3
- package/node_modules/@sentry/core/build/types-ts3.8/utils/data-collection/filterUrlQuery.d.ts +13 -0
- package/node_modules/@sentry/core/build/types-ts3.8/utils/url.d.ts +4 -1
- package/node_modules/@sentry/core/package.json +3 -2
- package/node_modules/@sentry/node/build/cjs/integrations/tracing/vercelai/instrumentation.js +3 -0
- package/node_modules/@sentry/node/build/esm/integrations/tracing/vercelai/instrumentation.js +3 -0
- package/node_modules/@sentry/node/build/esm/package.json +1 -1
- package/node_modules/@sentry/node/package.json +7 -6
- package/node_modules/@sentry/node-core/build/cjs/integrations/anr/index.js +1 -1
- package/node_modules/@sentry/node-core/build/cjs/integrations/http/httpServerSpansIntegration.js +6 -3
- package/node_modules/@sentry/node-core/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
- package/node_modules/@sentry/node-core/build/cjs/integrations/node-fetch/undici-instrumentation.js +2 -2
- package/node_modules/@sentry/node-core/build/cjs/light/client.js +7 -0
- package/node_modules/@sentry/node-core/build/cjs/sdk/client.js +7 -0
- package/node_modules/@sentry/node-core/build/cjs/utils/outgoingFetchRequest.js +1 -1
- package/node_modules/@sentry/node-core/build/esm/integrations/anr/index.js +1 -1
- package/node_modules/@sentry/node-core/build/esm/integrations/anr/worker-script.js +2 -2
- package/node_modules/@sentry/node-core/build/esm/integrations/http/httpServerSpansIntegration.js +7 -4
- package/node_modules/@sentry/node-core/build/esm/integrations/local-variables/local-variables-async.js +1 -1
- package/node_modules/@sentry/node-core/build/esm/integrations/local-variables/worker-script.js +1 -1
- package/node_modules/@sentry/node-core/build/esm/integrations/node-fetch/undici-instrumentation.js +3 -3
- package/node_modules/@sentry/node-core/build/esm/light/client.js +8 -1
- package/node_modules/@sentry/node-core/build/esm/package.json +1 -1
- package/node_modules/@sentry/node-core/build/esm/sdk/client.js +8 -1
- package/node_modules/@sentry/node-core/build/esm/utils/outgoingFetchRequest.js +2 -2
- package/node_modules/@sentry/node-core/build/types/light/client.d.ts +1 -0
- package/node_modules/@sentry/node-core/build/types/sdk/client.d.ts +1 -0
- package/node_modules/@sentry/node-core/build/types-ts3.8/light/client.d.ts +1 -0
- package/node_modules/@sentry/node-core/build/types-ts3.8/sdk/client.d.ts +1 -0
- package/node_modules/@sentry/node-core/package.json +5 -4
- package/node_modules/@sentry/opentelemetry/build/cjs/{asyncContextStrategy-BJ5buq_A.js → asyncContextStrategy-BR-l9zjD.js} +8 -6
- package/node_modules/@sentry/opentelemetry/build/cjs/index.browser.js +1 -1
- package/node_modules/@sentry/opentelemetry/build/cjs/index.js +1 -1
- package/node_modules/@sentry/opentelemetry/build/esm/{asyncContextStrategy-Bx5F5tCX.js → asyncContextStrategy-BQfM_LMv.js} +9 -7
- package/node_modules/@sentry/opentelemetry/build/esm/index.browser.js +1 -1
- package/node_modules/@sentry/opentelemetry/build/esm/index.js +2 -2
- package/node_modules/@sentry/opentelemetry/build/esm/package.json +1 -1
- package/node_modules/@sentry/opentelemetry/package.json +4 -3
- package/node_modules/@sentry/server-utils/build/cjs/tracing-channel.js +1 -0
- package/node_modules/@sentry/server-utils/build/esm/package.json +1 -1
- package/node_modules/@sentry/server-utils/build/esm/tracing-channel.js +1 -0
- package/node_modules/@sentry/server-utils/build/types/tracing-channel.d.ts +3 -1
- package/node_modules/@sentry/server-utils/build/types-ts3.8/tracing-channel.d.ts +3 -1
- package/node_modules/@sentry/server-utils/package.json +4 -3
- package/node_modules/cjs-module-lexer/README.md +8 -3
- package/node_modules/cjs-module-lexer/dist/lexer.js +1 -1
- package/node_modules/cjs-module-lexer/dist/lexer.mjs +2 -2
- package/node_modules/cjs-module-lexer/lexer.js +48 -9
- package/node_modules/cjs-module-lexer/package.json +3 -2
- package/node_modules/es-module-lexer/dist/lexer.asm.js +2 -2
- package/node_modules/es-module-lexer/dist/lexer.cjs +1 -1
- package/node_modules/es-module-lexer/dist/lexer.js +2 -2
- package/node_modules/es-module-lexer/dist/lexer.minimal.asm.js +2 -2
- package/node_modules/es-module-lexer/dist/lexer.minimal.cjs +1 -1
- package/node_modules/es-module-lexer/dist/lexer.minimal.js +2 -2
- package/node_modules/es-module-lexer/package.json +1 -1
- package/node_modules/import-in-the-middle/CHANGELOG.md +7 -0
- package/node_modules/import-in-the-middle/lib/get-esm-exports.mjs +7 -0
- package/node_modules/import-in-the-middle/package.json +1 -1
- package/package.json +2 -2
- package/packages/pm-beads/extensions/beads/runtime.ts +2 -2
- 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-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/scripts/finalize-build.mjs +37 -0
- package/dist/cli-bundle/chunks/chunk-BXSXT5Z6.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KNW3RSLS.js +0 -30
- package/dist/cli-bundle/chunks/chunk-MEWBSWE3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-RBPOO46D.js +0 -20
- package/dist/cli-bundle/chunks/chunk-YMLF6QT7.js +0 -234
- package/dist/cli-bundle/chunks/register-operations-PDOBQZUJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2CJWTLQG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-B3YW6H2I.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-GVGFUD52.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-MJQ253F3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PBCYGO7X.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-WOEZJUA2.js +0 -2
package/dist/sdk/config.d.ts
CHANGED
|
@@ -18,119 +18,119 @@ type GovernanceForceRequiredForStaleLockPolicy = "enabled" | "disabled";
|
|
|
18
18
|
type GovernanceRequireCloseReasonPolicy = "enabled" | "disabled";
|
|
19
19
|
type ConfigValue = string | string[] | ItemFormat | HistoryMissingStreamPolicy | SprintReleaseFormatPolicy | ParentReferencePolicy | ValidateMetadataProfile | GovernancePreset | GovernanceOwnershipEnforcement | GovernanceCreateModeDefault | GovernanceCloseValidationDefault | GovernanceRequireCloseReasonPolicy | GovernanceWorkflowEnforcement | GovernanceForceRequiredForStaleLockPolicy | TestResultTrackingPolicy | TelemetryTrackingPolicy | AgentIdentityVocabularySummary | ContextConfigValue;
|
|
20
20
|
interface ContextConfigValue {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
default_depth: string;
|
|
22
|
+
activity_limit: number;
|
|
23
|
+
stale_threshold_days: number;
|
|
24
|
+
sections: Record<string, boolean>;
|
|
25
25
|
}
|
|
26
26
|
interface ConfigKeyDescriptor {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
key: ConfigKey;
|
|
28
|
+
aliases: string[];
|
|
29
|
+
value_kind: "string_array" | "enum" | "object";
|
|
30
|
+
set_flags: string[];
|
|
31
|
+
summary: string;
|
|
32
|
+
value: ConfigValue;
|
|
33
33
|
}
|
|
34
34
|
/** Documents the config command options payload exchanged by command, SDK, and package integrations. */
|
|
35
35
|
export interface ConfigCommandOptions {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
36
|
+
/** Value that configures or reports criterion for this contract. */
|
|
37
|
+
criterion?: string[];
|
|
38
|
+
/** Value that configures or reports format for this contract. */
|
|
39
|
+
format?: string;
|
|
40
|
+
/** Value that configures or reports policy for this contract. */
|
|
41
|
+
policy?: string;
|
|
42
|
+
/** Value that configures or reports value for this contract. */
|
|
43
|
+
value?: string;
|
|
44
|
+
/** Value that configures or reports clear criteria for this contract. */
|
|
45
|
+
clearCriteria?: boolean;
|
|
46
|
+
/** Fallback depth used when callers do not provide an override. */
|
|
47
|
+
defaultDepth?: string;
|
|
48
|
+
/** Value that configures or reports activity limit for this contract. */
|
|
49
|
+
activityLimit?: string;
|
|
50
|
+
/** Value that configures or reports stale threshold days for this contract. */
|
|
51
|
+
staleThresholdDays?: string;
|
|
52
|
+
/** Value that configures or reports section hierarchy for this contract. */
|
|
53
|
+
sectionHierarchy?: string;
|
|
54
|
+
/** Value that configures or reports section activity for this contract. */
|
|
55
|
+
sectionActivity?: string;
|
|
56
|
+
/** Value that configures or reports section progress for this contract. */
|
|
57
|
+
sectionProgress?: string;
|
|
58
|
+
/** Value that configures or reports section blockers for this contract. */
|
|
59
|
+
sectionBlockers?: string;
|
|
60
|
+
/** Value that configures or reports section files for this contract. */
|
|
61
|
+
sectionFiles?: string;
|
|
62
|
+
/** Value that configures or reports section workload for this contract. */
|
|
63
|
+
sectionWorkload?: string;
|
|
64
|
+
/** Value that configures or reports section staleness for this contract. */
|
|
65
|
+
sectionStaleness?: string;
|
|
66
|
+
/** Value that configures or reports section tests for this contract. */
|
|
67
|
+
sectionTests?: string;
|
|
68
68
|
}
|
|
69
69
|
/** Documents the nested setting result value payload exchanged by command, SDK, and package integrations. */
|
|
70
70
|
export interface NestedSettingResultValue {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
/** Value that configures or reports key for this contract. */
|
|
72
|
+
key: string;
|
|
73
|
+
/** Preferred kebab-case CLI spelling for copy/paste-safe configuration. */
|
|
74
|
+
canonical_key?: string;
|
|
75
|
+
/** Filesystem path used for path resolution. */
|
|
76
|
+
path: string;
|
|
77
|
+
/** Value that configures or reports kind for this contract. */
|
|
78
|
+
kind: NestedSettingDescriptor["kind"];
|
|
79
|
+
/** Value that configures or reports value for this contract. */
|
|
80
|
+
value: string | number | boolean | null;
|
|
81
|
+
/** Short operator-facing explanation of the setting. */
|
|
82
|
+
summary?: string;
|
|
83
|
+
/** Closed value domain when the setting accepts a fixed vocabulary. */
|
|
84
|
+
choices?: string[];
|
|
85
|
+
/** Inclusive numeric lower bound when one is declared. */
|
|
86
|
+
min?: number;
|
|
87
|
+
/** Inclusive numeric upper bound when one is declared. */
|
|
88
|
+
max?: number;
|
|
89
89
|
}
|
|
90
90
|
/** Documents the config result payload exchanged by command, SDK, and package integrations. */
|
|
91
91
|
export interface ConfigResult {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
92
|
+
/** Value that configures or reports scope for this contract. */
|
|
93
|
+
scope: ConfigScope;
|
|
94
|
+
/** Value that configures or reports key for this contract. */
|
|
95
|
+
key?: ConfigKey | string;
|
|
96
|
+
/** Value that configures or reports criteria for this contract. */
|
|
97
|
+
criteria?: string[];
|
|
98
|
+
/** Value that configures or reports format for this contract. */
|
|
99
|
+
format?: ItemFormat;
|
|
100
|
+
/** Value that configures or reports policy for this contract. */
|
|
101
|
+
policy?: HistoryMissingStreamPolicy | SprintReleaseFormatPolicy | ParentReferencePolicy | ValidateMetadataProfile | GovernancePreset | GovernanceOwnershipEnforcement | GovernanceCreateModeDefault | GovernanceCloseValidationDefault | GovernanceRequireCloseReasonPolicy | GovernanceWorkflowEnforcement | GovernanceForceRequiredForStaleLockPolicy | TestResultTrackingPolicy | TelemetryTrackingPolicy | string;
|
|
102
|
+
/** Value that configures or reports nested setting for this contract. */
|
|
103
|
+
nested_setting?: NestedSettingResultValue;
|
|
104
|
+
/** Configuration controlling nested behavior. */
|
|
105
|
+
nested_settings?: NestedSettingResultValue[];
|
|
106
|
+
/** Value that configures or reports keys for this contract. */
|
|
107
|
+
keys?: ConfigKeyDescriptor[];
|
|
108
|
+
/** Value that configures or reports values for this contract. */
|
|
109
|
+
values?: Record<ConfigKey, ConfigValue>;
|
|
110
|
+
/** Value that configures or reports count for this contract. */
|
|
111
|
+
count?: number;
|
|
112
|
+
/** Configuration controlling context behavior. */
|
|
113
|
+
context_settings?: ContextConfigValue;
|
|
114
|
+
/** Privacy-safe revision/count projection for legacy author interpretation. */
|
|
115
|
+
identity_vocabulary?: AgentIdentityVocabularySummary;
|
|
116
|
+
/** Dry-run or committed vocabulary mutation receipt without alias spellings. */
|
|
117
|
+
vocabulary_mutation?: AgentIdentityVocabularyMutationPreview;
|
|
118
|
+
/** Whether explicit item format applies to this operation. */
|
|
119
|
+
has_explicit_item_format?: boolean;
|
|
120
|
+
/** Value that configures or reports migration for this contract. */
|
|
121
|
+
migration?: {
|
|
122
|
+
target_format: ItemFormat;
|
|
123
|
+
scanned: number;
|
|
124
|
+
migrated: string[];
|
|
125
|
+
removed: string[];
|
|
126
|
+
warnings: string[];
|
|
127
|
+
};
|
|
128
|
+
/** Filesystem path used for settings resolution. */
|
|
129
|
+
settings_path: string;
|
|
130
|
+
/** Value that configures or reports changed for this contract. */
|
|
131
|
+
changed: boolean;
|
|
132
|
+
/** Value that configures or reports warnings for this contract. */
|
|
133
|
+
warnings?: string[];
|
|
134
134
|
}
|
|
135
135
|
declare function normalizeScope(value: string): ConfigScope;
|
|
136
136
|
declare function normalizeAction(value: string): ConfigAction;
|
|
@@ -158,26 +158,26 @@ declare function hasGovernanceValidationMirrorChange<T extends ParentReferencePo
|
|
|
158
158
|
export declare function runConfig(scopeValue: string, actionValue: string, keyValue: string | undefined, options: ConfigCommandOptions, global: GlobalOptions, valueValue?: string): Promise<ConfigResult>;
|
|
159
159
|
/** Public contract for test only config command, shared by SDK and presentation-layer consumers. */
|
|
160
160
|
export declare const _testOnlyConfigCommand: {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
161
|
+
hasGovernanceValidationMirrorChange: typeof hasGovernanceValidationMirrorChange;
|
|
162
|
+
applyPositionalValue: typeof applyPositionalValue;
|
|
163
|
+
normalizeAction: typeof normalizeAction;
|
|
164
|
+
normalizeCriteria: typeof normalizeCriteria;
|
|
165
|
+
normalizeGovernanceCloseValidationDefault: typeof normalizeGovernanceCloseValidationDefault;
|
|
166
|
+
normalizeGovernanceCreateModeDefault: typeof normalizeGovernanceCreateModeDefault;
|
|
167
|
+
normalizeGovernanceForceRequiredForStaleLockPolicy: typeof normalizeGovernanceForceRequiredForStaleLockPolicy;
|
|
168
|
+
normalizeGovernanceOwnershipEnforcement: typeof normalizeGovernanceOwnershipEnforcement;
|
|
169
|
+
normalizeGovernancePreset: typeof normalizeGovernancePreset;
|
|
170
|
+
normalizeGovernanceRequireCloseReasonPolicy: typeof normalizeGovernanceRequireCloseReasonPolicy;
|
|
171
|
+
normalizeGovernanceWorkflowEnforcement: typeof normalizeGovernanceWorkflowEnforcement;
|
|
172
|
+
normalizeHistoryMissingStreamPolicy: typeof normalizeHistoryMissingStreamPolicy;
|
|
173
|
+
normalizeItemFormat: typeof normalizeItemFormat;
|
|
174
|
+
normalizeKey: typeof normalizeKey;
|
|
175
|
+
normalizeMetadataRequiredFields: typeof normalizeMetadataRequiredFields;
|
|
176
|
+
normalizePolicyForConflict: typeof normalizePolicyForConflict;
|
|
177
|
+
normalizeScope: typeof normalizeScope;
|
|
178
|
+
normalizeTelemetryTrackingPolicy: typeof normalizeTelemetryTrackingPolicy;
|
|
179
|
+
normalizeTestResultTrackingPolicy: typeof normalizeTestResultTrackingPolicy;
|
|
180
|
+
normalizeValidateMetadataProfile: typeof normalizeValidateMetadataProfile;
|
|
181
|
+
normalizeWarnings: typeof normalizeWarnings;
|
|
182
182
|
};
|
|
183
183
|
export {};
|
|
@@ -4,29 +4,29 @@ import { readSettings } from "../../core/store/settings.js";
|
|
|
4
4
|
export declare function resolveSemanticLineageIds(pmRoot: string, settings: Awaited<ReturnType<typeof readSettings>>, itemId: string): Promise<string[]>;
|
|
5
5
|
/** Record one successful claim and its bounded canonical lineage. */
|
|
6
6
|
export declare function recordClaimSemanticAttribution(params: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
pmRoot: string;
|
|
8
|
+
settings: Awaited<ReturnType<typeof readSettings>>;
|
|
9
|
+
principal: string;
|
|
10
|
+
itemId: string;
|
|
11
11
|
}): Promise<void>;
|
|
12
12
|
/** Remove one released claim from the active semantic workset. */
|
|
13
13
|
export declare function recordReleaseSemanticAttribution(params: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
pmRoot: string;
|
|
15
|
+
principal: string;
|
|
16
|
+
itemId: string;
|
|
17
17
|
}): Promise<void>;
|
|
18
18
|
/** Set or clear focused semantic work with canonical lineage evidence. */
|
|
19
19
|
export declare function recordFocusSemanticAttribution(params: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
pmRoot: string;
|
|
21
|
+
settings: Awaited<ReturnType<typeof readSettings>>;
|
|
22
|
+
principal: string;
|
|
23
|
+
itemId?: string;
|
|
24
24
|
}): Promise<void>;
|
|
25
25
|
/** Public constants used by scale and negative-control tests. */
|
|
26
26
|
export declare const SEMANTIC_ATTRIBUTION_LIMITS: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
readonly lineage_depth: 16;
|
|
28
|
+
readonly active_items: 64;
|
|
29
|
+
readonly evidence_rows: 32;
|
|
30
30
|
};
|
|
31
31
|
/** Convert bounded claim/focus evidence into normalized context affinity. */
|
|
32
32
|
export declare function semanticAttributionAffinity(attribution: AgentSemanticAttribution | undefined): Readonly<Record<string, number>> | undefined;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import type { ContextUsageEvent, ContextUsageLedgerOptions } from "../context-usage.js";
|
|
2
2
|
/** Public storage and sampling ceilings shared by every feedback producer. */
|
|
3
3
|
export declare const CONTEXT_USAGE_LIMITS: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
readonly max_serving_rows: 256;
|
|
5
|
+
readonly max_bytes: 262144;
|
|
6
|
+
readonly max_event_bytes: 32768;
|
|
7
|
+
readonly retained_byte_fraction: 0.5;
|
|
8
|
+
readonly max_events: 2048;
|
|
9
|
+
readonly retention_days: 30;
|
|
10
10
|
};
|
|
11
11
|
/** Measured persistence work for one lock-protected feedback write. */
|
|
12
12
|
export interface ContextUsageWriteReceipt {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
/** Bytes written to the append or replacement file; excludes lock metadata. */
|
|
14
|
+
written_bytes: number;
|
|
15
|
+
/** Physical ledger size at the end of the protected write. */
|
|
16
|
+
ledger_bytes: number;
|
|
17
|
+
/** Whether this write replaced the ledger with a retained suffix. */
|
|
18
|
+
compacted: boolean;
|
|
19
|
+
/** Wall-clock time waiting to acquire the cross-process ledger lock. */
|
|
20
|
+
lock_wait_ms: number;
|
|
21
21
|
}
|
|
22
22
|
/** Named validation failure emitted by context-usage SDK inputs. */
|
|
23
23
|
export declare class ContextUsageValidationError extends TypeError {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
/** Stable code for package and CLI hosts. */
|
|
25
|
+
readonly code = "context_usage_validation_failed";
|
|
26
|
+
/** Reject invalid feedback controls without exposing ledger contents. */
|
|
27
|
+
constructor(message: string);
|
|
28
28
|
}
|
|
29
29
|
/** Normalize one timestamp so filtering and serialization share the same clock. */
|
|
30
30
|
export declare function resolveNow(options: ContextUsageLedgerOptions): {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
iso: string;
|
|
32
|
+
ms: number;
|
|
33
33
|
};
|
|
34
34
|
/** Read only a bounded file suffix, dropping a partial first JSONL row. */
|
|
35
35
|
export declare function readEvents(options: ContextUsageLedgerOptions): Promise<ContextUsageEvent[]>;
|
|
@@ -4,60 +4,60 @@ export type PmContextIntentCommand = "context" | "get" | "list" | "next" | "sear
|
|
|
4
4
|
export type PmContextIntentSource = "core" | "package" | "workspace";
|
|
5
5
|
/** One named, bounded projection of a command's context. */
|
|
6
6
|
export interface PmContextIntentContract {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
/** Command that accepts the intent. */
|
|
8
|
+
command: PmContextIntentCommand;
|
|
9
|
+
/** Stable intent identifier used by CLI, SDK, and MCP callers. */
|
|
10
|
+
intent: string;
|
|
11
|
+
/** Agent-facing explanation of the projection's purpose. */
|
|
12
|
+
description: string;
|
|
13
|
+
/** Declared output field groups retained by the projection. */
|
|
14
|
+
included_field_groups: string[];
|
|
15
|
+
/** Default maximum estimated tokens before normal degradation applies. */
|
|
16
|
+
token_budget: number;
|
|
17
|
+
/** Layer that supplied the resolved declaration. */
|
|
18
|
+
source?: PmContextIntentSource;
|
|
19
19
|
}
|
|
20
20
|
/** Machine-readable proof of the intent projection resolved for one read result. */
|
|
21
21
|
export interface PmContextIntentReceipt {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
22
|
+
/** Canonical read command that resolved the intent. */
|
|
23
|
+
command: string;
|
|
24
|
+
/** Stable selected intent name. */
|
|
25
|
+
intent: string;
|
|
26
|
+
/** Layer that supplied the resolved declaration. */
|
|
27
|
+
source: PmContextIntentSource;
|
|
28
|
+
/** Field groups the selected intent promises to retain. */
|
|
29
|
+
included_field_groups: string[];
|
|
30
|
+
/** Effective token ceiling after an explicit caller override is applied. */
|
|
31
|
+
token_budget: number;
|
|
32
|
+
/** Ceiling declared by the selected intent before caller overrides. */
|
|
33
|
+
declared_token_budget: number;
|
|
34
|
+
/** Signed difference between the effective and declared ceilings. */
|
|
35
|
+
token_budget_override: number;
|
|
36
|
+
/** Deterministic JSON-size estimate for the useful result before any receipt-only omission. */
|
|
37
|
+
estimated_tokens: number;
|
|
38
|
+
/** Whether the measured result fits the effective ceiling after caller overrides. */
|
|
39
|
+
within_budget: boolean;
|
|
40
|
+
/** Projection strategy applied before the result was measured. */
|
|
41
|
+
degradation: "bounded_fields_and_rows" | "bounded_ranked_rows" | "bounded_sections" | "budget_row_compaction" | "recursive_budget_compaction" | "budget_receipt_only" | "standard_item" | "none";
|
|
42
|
+
/** Whether the declared ceiling can carry the measured useful projection, independent of an override. */
|
|
43
|
+
declaration_feasible: boolean;
|
|
44
|
+
/** True only when no useful result survived the effective ceiling. */
|
|
45
|
+
result_omitted: boolean;
|
|
46
|
+
/** Row ceiling calculated from the selected intent's effective token budget. */
|
|
47
|
+
budget_derived_limit?: number;
|
|
48
|
+
/** Constraint that selected the effective page size for row-oriented reads. */
|
|
49
|
+
binding_constraint?: "explicit_limit" | "token_budget";
|
|
50
|
+
/** Machine-readable explanation for the selected row ceiling. */
|
|
51
|
+
limit_reason?: string;
|
|
52
52
|
}
|
|
53
53
|
/** Built-in intent projections shared by CLI, SDK, MCP, and package authors. */
|
|
54
54
|
export declare const PM_CONTEXT_INTENT_CONTRACTS: readonly PmContextIntentContract[];
|
|
55
55
|
/** Runtime declaration layers applied to one asynchronous SDK or CLI execution. */
|
|
56
56
|
export interface PmContextIntentRuntimeLayers {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
/** Workspace declarations, which may override a core or package declaration. */
|
|
58
|
+
workspaceContracts?: readonly PmContextIntentContract[];
|
|
59
|
+
/** Package declarations, which may add but not replace earlier declarations. */
|
|
60
|
+
packageContracts?: readonly PmContextIntentContract[];
|
|
61
61
|
}
|
|
62
62
|
/** Return the request-scoped intent registry, or the immutable built-in registry outside a configured scope. */
|
|
63
63
|
export declare function getActiveContextIntentContracts(): readonly PmContextIntentContract[];
|
|
@@ -70,9 +70,9 @@ export declare function resolveContextIntentContract(command: string, intent: st
|
|
|
70
70
|
/** Apply one declared read intent's defaults while preserving explicit caller options. */
|
|
71
71
|
export declare function applyContextIntentProjection(command: "context" | "get" | "list" | "next" | "search", options: Record<string, unknown>, positionalArguments?: readonly string[]): Record<string, unknown>;
|
|
72
72
|
interface ContextIntentCursorEnvelope {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
fingerprint: string;
|
|
74
|
+
after_index: number;
|
|
75
|
+
snapshot?: string;
|
|
76
76
|
}
|
|
77
77
|
/** Decode the cursor fields required to preserve a row-compacted continuation. */
|
|
78
78
|
export declare function decodeContextIntentCursor(cursor: string): ContextIntentCursorEnvelope | undefined;
|
|
@@ -80,7 +80,7 @@ export declare function decodeContextIntentCursor(cursor: string): ContextIntent
|
|
|
80
80
|
export declare function contextIntentRowId(row: unknown): string | undefined;
|
|
81
81
|
/** Attach budget and degradation evidence for a selected built-in read intent. */
|
|
82
82
|
export declare function attachContextIntentReceipt<Result extends Record<string, unknown>>(command: string, options: Record<string, unknown>, result: Result): Result & {
|
|
83
|
-
|
|
83
|
+
context_intent?: PmContextIntentReceipt;
|
|
84
84
|
};
|
|
85
85
|
/** Attach universal row, omission, and optional intent-budget contracts in rendering order. */
|
|
86
86
|
export declare function attachReadOutputContracts(command: string | undefined, options: Record<string, unknown>, result: unknown): unknown;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e834062a-97f7-51d7-b934-1e4b43e3d6b2")}catch{}})();import{AsyncLocalStorage}from"node:async_hooks";import{renderPmCommand}from"./command-line.js";import{attachOutputOmissionReceipt}from"./output-projection.js";import{encodeQueryCursor}from"./pagination.js";import{applyReadOutputDimensions,stabilizeReadOutputReceiptEstimates}from"./read-output-contracts.js";import{propagateContextUsageServingReceipt}from"./context-usage.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";const PM_CONTEXT_INTENT_CONTRACTS=Object.freeze([{command:"context",intent:"orient",description:"Bounded active hierarchy, ownership, blockers, and recent progress.",included_field_groups:["summary","focus","hierarchy","blockers","activity"],token_budget:3e3,source:"core"},{command:"context",intent:"handoff",description:"Active ownership, evidence, decisions, and immediate continuation context.",included_field_groups:["summary","focus","in_progress","decisions","activity"],token_budget:2200,source:"core"},{command:"get",intent:"inspect",description:"Standard-depth item metadata, relationships, evidence, and lifecycle state.",included_field_groups:["item","children","claim_state","linked"],token_budget:3200,source:"core"},{command:"list",intent:"triage",description:"A budget-derived page of compact governance, ownership, priority, and blocker rows for triage.",included_field_groups:["identity","governance","ownership","dependencies"],token_budget:3200,source:"core"},{command:"next",intent:"execute",description:"The highest-ranked actionable work with concise ranking evidence.",included_field_groups:["recommended"],token_budget:1200,source:"core"},{command:"search",intent:"discover",description:"A budget-derived page of ranked canonical lineage candidates with compact match evidence.",included_field_groups:["identity","status","lineage","match"],token_budget:1800,source:"core"}]),activeContextIntentContracts=new AsyncLocalStorage;function getActiveContextIntentContracts(){return activeContextIntentContracts.getStore()??PM_CONTEXT_INTENT_CONTRACTS}function runWithContextIntentContracts(layers,run){return activeContextIntentContracts.run(composeContextIntentContracts(layers.workspaceContracts,layers.packageContracts),run)}function normalizeContextIntentDeclaration(declaration,source){const command=declaration.command.trim().toLowerCase(),intent=declaration.intent.trim().toLowerCase(),key=`${command}:${intent}`;if(!/^[a-z0-9][a-z0-9-]*$/.test(command)||!/^[a-z0-9][a-z0-9-]*$/.test(intent))throw new TypeError(`Invalid context intent command or name: ${key}`);if(declaration.description.trim().length===0)throw new TypeError(`Context intent ${key} requires a non-empty description`);if(!Number.isSafeInteger(declaration.token_budget)||declaration.token_budget<=0)throw new TypeError(`Context intent ${key} requires a positive integer token_budget`);const includedFieldGroups=[...new Set(declaration.included_field_groups.map(field=>field.trim()).filter(Boolean))];if(includedFieldGroups.length===0)throw new TypeError(`Context intent ${key} requires included_field_groups`);return{command,intent,description:declaration.description.trim(),included_field_groups:includedFieldGroups,token_budget:declaration.token_budget,source}}function composeContextIntentContracts(workspaceContracts=[],packageContracts=[]){const layers=[{source:"core",contracts:PM_CONTEXT_INTENT_CONTRACTS,allowOverride:!1},{source:"package",contracts:packageContracts,allowOverride:!1},{source:"workspace",contracts:workspaceContracts,allowOverride:!0}],composed=new Map,keysSeenWithinLayer=new Set;for(const layer of layers){keysSeenWithinLayer.clear();for(const declaration of layer.contracts){const normalized=normalizeContextIntentDeclaration(declaration,layer.source),key=`${normalized.command}:${normalized.intent}`;if(keysSeenWithinLayer.has(key))throw new TypeError(`Duplicate context intent declaration: ${key}`);if(keysSeenWithinLayer.add(key),!layer.allowOverride&&composed.has(key))throw new TypeError(`Duplicate context intent declaration: ${key}`);composed.set(key,normalized)}}return[...composed.values()].sort((left,right)=>left.command.localeCompare(right.command)||left.intent.localeCompare(right.intent))}function resolveContextIntentContract(command,intent,contracts=getActiveContextIntentContracts(),positionalArguments=[]){const normalizedCommand=command.trim().toLowerCase(),normalizedIntent=intent.trim().toLowerCase(),exact=contracts.find(entry=>entry.command===normalizedCommand&&entry.intent===normalizedIntent);if(exact)return{...exact,source:exact.source??"core"};const candidates=contracts.filter(entry=>entry.command===normalizedCommand).map(entry=>entry.intent);if(candidates.length===0)return;const suggestion=candidates.map(candidate=>{const rows=Array.from({length:normalizedIntent.length+1},(_,index)=>index);for(let candidateIndex=1;candidateIndex<=candidate.length;candidateIndex+=1){let previous=rows[0];rows[0]=candidateIndex;for(let intentIndex=1;intentIndex<=normalizedIntent.length;intentIndex+=1){const prior=rows[intentIndex];rows[intentIndex]=Math.min(rows[intentIndex]+1,rows[intentIndex-1]+1,previous+(candidate[candidateIndex-1]===normalizedIntent[intentIndex-1]?0:1)),previous=prior}}return{candidate,distance:rows[normalizedIntent.length]}}).sort((left,right)=>left.distance-right.distance||left.candidate.localeCompare(right.candidate))[0].candidate,attemptedArguments=[normalizedCommand,...positionalArguments,"--for",normalizedIntent],suggestedRetryArguments=[normalizedCommand,...positionalArguments,"--for",suggestion],suggestedCommand=renderPmCommand(suggestedRetryArguments);throw new PmCliError(`Unknown context intent "${normalizedIntent}" for ${normalizedCommand}. Did you mean "${suggestion}"?`,EXIT_CODE.USAGE,{code:"unknown_context_intent",reason:"unknown_intent",field:"for",flag:"--for",value:normalizedIntent,required:`Use a declared ${normalizedCommand} intent.`,why:"Intent names are command-local contracts and cannot be inferred from output section names.",nextSteps:[suggestedCommand],recovery:{recovery_mode:"compact",attempted_command:renderPmCommand(attemptedArguments),allowed_values:[...candidates].sort(),suggested_retry:suggestedCommand,suggested_retry_args:suggestedRetryArguments}})}const CONTEXT_INTENT_DEFAULT_APPLIERS={context:(projected,contract,explicitTokenBudget)=>{projected.section===void 0&&projected.depth===void 0&&(projected.section=contract.intent==="handoff"?["activity","progress","blockers"]:["hierarchy","blockers","activity"]),projected.depth===void 0&&(projected.depth=contract.intent==="handoff"?"deep":"standard");const tokenBudget=resolveIntentTokenBudget(projected.tokenBudget,contract.token_budget),budgetDerivedLimit=resolveIntentRowBudget("context",contract.intent,tokenBudget,explicitTokenBudget),requestedLimit=parsePositiveIntentTokenBudget(projected.limit),derivedLimit=String(requestedLimit===void 0?budgetDerivedLimit:Math.min(requestedLimit,budgetDerivedLimit));(projected.limit===void 0||requestedLimit!==void 0)&&(projected.limit=derivedLimit),projected.activityLimit===void 0&&(projected.activityLimit=derivedLimit)},get:projected=>{projected.depth===void 0&&projected.fields===void 0&&(projected.depth="standard")},list:(projected,contract,explicitTokenBudget)=>{projected.brief===void 0&&projected.compact===void 0&&projected.full===void 0&&projected.fields===void 0&&(projected.fields="id,title,status,type,priority,parent,assignee,risk,blocked_by");const tokenBudget=resolveIntentTokenBudget(projected.tokenBudget,contract.token_budget),budgetDerivedLimit=resolveIntentRowBudget("list",contract.intent,tokenBudget,explicitTokenBudget),requestedLimit=parsePositiveIntentTokenBudget(projected.limit);(projected.limit===void 0||requestedLimit!==void 0)&&(projected.limit=String(requestedLimit===void 0?budgetDerivedLimit:Math.min(requestedLimit,budgetDerivedLimit)))},next:projected=>{projected.readyOnly===void 0&&(projected.readyOnly=!0)},search:(projected,contract,explicitTokenBudget)=>{projected.compact===void 0&&projected.full===void 0&&projected.fields===void 0&&(projected.compact=!0);const tokenBudget=resolveIntentTokenBudget(projected.tokenBudget,contract.token_budget),budgetDerivedLimit=resolveIntentRowBudget("search",contract.intent,tokenBudget,explicitTokenBudget),requestedLimit=parsePositiveIntentTokenBudget(projected.limit);(projected.limit===void 0||requestedLimit!==void 0)&&(projected.limit=String(requestedLimit===void 0?budgetDerivedLimit:Math.min(requestedLimit,budgetDerivedLimit)))}};function applyContextIntentProjection(command,options,positionalArguments=[]){const tokenBudget=options.tokenBudget??options.token_budget;if(typeof options.for!="string"){if(tokenBudget!==void 0&&(command==="get"||command==="list"||command==="search"))throw new PmCliError("--token-budget requires a declared context intent selected with --for",EXIT_CODE.USAGE,{code:"missing_required_option",field:"for",required:"Select a context intent with --for when setting --token-budget.",why:"A token-budget override has no projection contract to constrain without a selected intent.",nextSteps:["Retry with --for <intent> --token-budget <n>, or omit --token-budget."]});if(options.tokenBudget!==void 0||options.token_budget===void 0)return options;const projected2={...options,tokenBudget};return delete projected2.token_budget,projected2}const contract=resolveContextIntentContract(command,options.for,void 0,positionalArguments),explicitTokenBudget=parsePositiveIntentTokenBudget(tokenBudget)!==void 0,projected={...options};return projected.tokenBudget===void 0&&tokenBudget!==void 0&&(projected.tokenBudget=tokenBudget),delete projected.token_budget,projected.tokenBudget===void 0&&(projected.tokenBudget=String(contract.token_budget)),CONTEXT_INTENT_DEFAULT_APPLIERS[command](projected,contract,explicitTokenBudget),projected}const CONTEXT_INTENT_DEGRADATIONS={context:"bounded_sections",get:"standard_item",list:"bounded_fields_and_rows",next:"bounded_ranked_rows",search:"bounded_ranked_rows"},MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET=256;function compactContextIntentValue(value){return Array.isArray(value)?value.map(compactContextIntentValue):value!==null&&typeof value=="object"?Object.fromEntries(Object.entries(value).map(([key,entry])=>[key,compactContextIntentValue(entry)])):typeof value=="string"&&value.length>240?`${value.slice(0,240)}\u2026`:value}function parsePositiveIntentTokenBudget(value){const parsed=typeof value=="number"?value:typeof value=="string"&&/^\d+$/u.test(value.trim())?Number(value):Number.NaN;return Number.isSafeInteger(parsed)&&parsed>0?parsed:void 0}function resolveIntentTokenBudget(value,declaredBudget){const parsed=parsePositiveIntentTokenBudget(value);if(parsed===void 0)return declaredBudget;if(parsed<MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET)throw new PmCliError(`Context intent token budget must be at least ${MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET}`,EXIT_CODE.USAGE,{code:"invalid_argument_value",reason:"below_minimum",field:"tokenBudget",value:String(value),required:`Use an integer token budget of at least ${MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET}.`,why:"Smaller ceilings cannot contain the minimum machine-readable intent receipt.",nextSteps:[`Retry with --token-budget ${MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET} or omit the override.`]});return parsed}function resolveIntentRowBudget(command,intent,tokenBudget,explicitTokenBudget){if(command==="get"||command==="next")return;const contextOrient=command==="context"&&intent==="orient",overhead=command==="context"?contextOrient?1200:800:command==="list"?520:480,rowCost=command==="context"?contextOrient?600:500:16,calculatedLimit=Math.max(command==="context"?1:2,Math.floor((tokenBudget-overhead)/rowCost));return explicitTokenBudget?calculatedLimit:Math.min(command==="context"?20:100,calculatedLimit)}function updateContextIntentEstimate(projected,receipt){let measuredTokens=receipt.estimated_tokens;for(;;){receipt.estimated_tokens=measuredTokens;const nextMeasurement=Math.ceil(Buffer.byteLength(JSON.stringify(projected),"utf8")/4);if(nextMeasurement===measuredTokens)return;measuredTokens=nextMeasurement}}const CONTEXT_INTENT_ROW_KEYS={context:["high_level","low_level","blocked_fallback","recently_created","unparented","hierarchy","activity","blockers"],get:["children"],list:["items"],next:["ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items"]};function decodeContextIntentCursor(cursor){try{const parsed=JSON.parse(Buffer.from(cursor,"base64url").toString("utf8"));return typeof parsed.fingerprint!="string"||!Number.isSafeInteger(parsed.after_index)?void 0:{fingerprint:parsed.fingerprint,after_index:parsed.after_index,...typeof parsed.snapshot=="string"?{snapshot:parsed.snapshot}:{}}}catch{return}}function contextIntentRowId(row){if(row===null||typeof row!="object")return;if(typeof row.id=="string")return row.id;const nestedId=row.item?.id;return typeof nestedId=="string"?nestedId:void 0}function shrinkContextIntentRowsToBudget(projected,receipt,rows){let compacted=!1;for(;;){if(updateContextIntentEstimate(projected,receipt),receipt.estimated_tokens<=receipt.token_budget||rows.length<=1)return compacted;const rowBytes=Buffer.byteLength(JSON.stringify(rows),"utf8"),excessBytes=(receipt.estimated_tokens-receipt.token_budget)*4;rows.splice(-Math.min(rows.length-1,Math.max(1,Math.ceil(excessBytes/Math.max(1,Math.ceil(rowBytes/rows.length)))))),compacted=!0}}function compactPaginatedContextIntentRows(projected,receipt,options){const rows=projected.items,cursorContinuesExistingPage=typeof projected.next_cursor=="string",cursorSource=cursorContinuesExistingPage?projected.next_cursor:options.after;if(!Array.isArray(rows)||typeof cursorSource!="string")return!1;const cursorEnvelope=decodeContextIntentCursor(cursorSource);if(cursorEnvelope===void 0)return!1;const originalRowCount=rows.length,originalRows=[...rows];let compacted=!1;for(;;){if(compacted=shrinkContextIntentRowsToBudget(projected,receipt,rows)||compacted,!compacted)return!1;const lastId=contextIntentRowId(rows.at(-1));if(lastId===void 0)return rows.splice(0,rows.length,...originalRows),updateContextIntentEstimate(projected,receipt),!1;if(projected.next_cursor=encodeQueryCursor(cursorEnvelope.fingerprint,lastId,cursorContinuesExistingPage?cursorEnvelope.after_index-(originalRowCount-rows.length):cursorEnvelope.after_index+rows.length,cursorEnvelope.snapshot),updateContextIntentEstimate(projected,receipt),receipt.estimated_tokens<=receipt.token_budget||rows.length<=1)break}return typeof projected.count=="number"&&(projected.count=rows.length),typeof projected.applied_limit=="number"&&(projected.applied_limit=rows.length),!0}function compactContextIntentRows(command,projected,receipt,options){if(command==="list"||command==="search")return compactPaginatedContextIntentRows(projected,receipt,options);if(command!=="next"||typeof projected.next_cursor=="string")return!1;let compacted=!1;for(;;){if(updateContextIntentEstimate(projected,receipt),receipt.estimated_tokens<=receipt.token_budget)return compacted;const candidate=CONTEXT_INTENT_ROW_KEYS[command].map(key=>({key,rows:Array.isArray(projected[key])?projected[key]:[]})).filter(({rows})=>rows.length>0).sort((left,right)=>right.rows.length-left.rows.length||left.key.localeCompare(right.key))[0];if(candidate===void 0)return compacted;const retainedTotal=CONTEXT_INTENT_ROW_KEYS[command].reduce((total,key)=>total+(Array.isArray(projected[key])?projected[key].length:0),0);if(retainedTotal<=1)return compacted;const removableRows=Math.min(candidate.rows.length,retainedTotal-1),candidateBytes=Buffer.byteLength(JSON.stringify(candidate.rows),"utf8"),estimatedBytesPerRow=Math.max(1,Math.ceil(candidateBytes/candidate.rows.length)),excessBytes=(receipt.estimated_tokens-receipt.token_budget)*4,removalCount=Math.min(removableRows,Math.max(1,Math.ceil(excessBytes/estimatedBytesPerRow)));candidate.rows.splice(-removalCount,removalCount),compacted=!0}}function attachContextIntentReceipt(command,options,result){if(typeof options.for!="string")return result;const normalizedCommand=command.startsWith("list-")?"list":command;if(!(normalizedCommand in CONTEXT_INTENT_DEFAULT_APPLIERS))return result;const builtInCommand=normalizedCommand,contract=resolveContextIntentContract(builtInCommand,options.for),effectiveTokenBudget=resolveIntentTokenBudget(options.tokenBudget??options.token_budget,contract.token_budget),receipt={command:builtInCommand,intent:contract.intent,source:contract.source,included_field_groups:[...contract.included_field_groups],token_budget:effectiveTokenBudget,declared_token_budget:contract.token_budget,token_budget_override:effectiveTokenBudget-contract.token_budget,estimated_tokens:0,within_budget:!0,degradation:CONTEXT_INTENT_DEGRADATIONS[builtInCommand],declaration_feasible:!0,result_omitted:!1},resultWithDiagnostics={...result},budgetDerivedLimit=resolveIntentRowBudget(builtInCommand,contract.intent,receipt.token_budget,parsePositiveIntentTokenBudget(options.tokenBudget??options.token_budget)!==void 0);if(budgetDerivedLimit!==void 0){const effectiveLimit=parsePositiveIntentTokenBudget(options.limit),explicitLimitBinds=effectiveLimit!==void 0&&effectiveLimit<budgetDerivedLimit;receipt.budget_derived_limit=budgetDerivedLimit,receipt.binding_constraint=explicitLimitBinds?"explicit_limit":"token_budget",receipt.limit_reason=explicitLimitBinds?"The caller supplied a smaller row limit than the budget-derived ceiling.":"The selected intent token budget constrains the effective row ceiling.",resultWithDiagnostics.budget_derived_limit=budgetDerivedLimit}let projected={...resultWithDiagnostics,context_intent:receipt};return updateContextIntentEstimate(projected,receipt),receipt.estimated_tokens>receipt.token_budget&&(receipt.degradation="recursive_budget_compaction",projected={...compactContextIntentValue(resultWithDiagnostics),context_intent:receipt},updateContextIntentEstimate(projected,receipt)),receipt.estimated_tokens>receipt.token_budget&&compactContextIntentRows(builtInCommand,projected,receipt,options)&&(receipt.degradation="budget_row_compaction",updateContextIntentEstimate(projected,receipt)),receipt.declaration_feasible=receipt.estimated_tokens<=receipt.declared_token_budget,receipt.estimated_tokens>receipt.token_budget&&(receipt.degradation="budget_receipt_only",receipt.result_omitted=!0,receipt.within_budget=!1,projected={budget_exceeded:{omitted_result:!0,reason:receipt.token_budget_override===0?"declared_budget_infeasible":"effective_budget_infeasible",restore_with:buildContextIntentRecoveryCommand(command,builtInCommand,contract.intent,receipt,resultWithDiagnostics)},context_intent:receipt}),projected}function collapseContinuationMetadata(options,result){if(typeof options.after!="string"||options.after.length===0)return result;const fingerprint=decodeContextIntentCursor(options.after)?.fingerprint??"opaque_cursor",projected={...result};for(const key of["applied_limit","completeness","context_intent","count","filters","has_more","now","omission_receipt","projection","row_contract","sorting","total","truncated"])delete projected[key];return projected.continuation_contract={fingerprint,metadata:"reference",restore_with:"omit --after"},projected}function isOutputRecord(value){return value!==null&&typeof value=="object"&&!Array.isArray(value)}function buildContextIntentRecoveryCommand(command,builtInCommand,intent,receipt,result){const recoveryTarget=builtInCommand==="get"&&isOutputRecord(result.item)&&typeof result.item.id=="string"?result.item.id:builtInCommand==="search"&&typeof result.query=="string"?result.query:void 0,recoveryPositional=recoveryTarget===void 0?"":` '${recoveryTarget.replaceAll("'",`'"'"'`)}'`,boundedRowLimit=builtInCommand==="get"?"":` --limit ${receipt.budget_derived_limit??1}`;return`pm ${command}${recoveryPositional} --for ${intent} --token-budget ${Math.ceil(receipt.estimated_tokens/100)*100}${boundedRowLimit}`}function receiptEstimate(value,field){if(isOutputRecord(value))return typeof value[field]=="number"?value[field]:void 0}function stabilizeSuppressedRowContractReceipts(result,options){let finalized=result;for(let iteration=0;iteration<8;iteration+=1){const previousContextEstimate=receiptEstimate(finalized.context_intent,"estimated_tokens"),previousReadEstimate=receiptEstimate(finalized.read_output,"estimated_tokens"),previousSessionEstimate=receiptEstimate(finalized.read_session,"spent_this_call_tokens");if(isOutputRecord(finalized.context_intent)&&updateContextIntentEstimate(finalized,finalized.context_intent),finalized=stabilizeReadOutputReceiptEstimates(finalized,options),receiptEstimate(finalized.context_intent,"estimated_tokens")===previousContextEstimate&&receiptEstimate(finalized.read_output,"estimated_tokens")===previousReadEstimate&&receiptEstimate(finalized.read_session,"spent_this_call_tokens")===previousSessionEstimate)break}return finalized}function attachReadOutputContracts(command,options,result){const disclosedResult=attachOutputOmissionReceipt(command,result),projected=typeof disclosedResult=="object"&&disclosedResult!==null&&!Array.isArray(disclosedResult)?applyReadOutputDimensions(command??"",{...options,outputRowContract:options.outputRowContract===!0||options.output_row_contract===!0},collapseContinuationMetadata(options,attachContextIntentReceipt(command??"",options,disclosedResult))):disclosedResult;if(propagateContextUsageServingReceipt(result,projected),options.outputRowContract===!0||options.output_row_contract===!0||typeof projected!="object"||projected===null||Array.isArray(projected)||!Object.hasOwn(projected,"row_contract"))return projected;const withoutDiscoveryMetadata=Object.fromEntries(Object.entries(projected).filter(([key])=>key!=="row_contract"));Object.defineProperty(withoutDiscoveryMetadata,"row_contract",{value:projected.row_contract,enumerable:!1,configurable:!0});const suppressed=stabilizeSuppressedRowContractReceipts(withoutDiscoveryMetadata,options);return delete suppressed.row_contract,propagateContextUsageServingReceipt(projected,suppressed),suppressed}export{PM_CONTEXT_INTENT_CONTRACTS,applyContextIntentProjection,attachContextIntentReceipt,attachReadOutputContracts,composeContextIntentContracts,contextIntentRowId,decodeContextIntentCursor,getActiveContextIntentContracts,resolveContextIntentContract,runWithContextIntentContracts};
|
|
1
|
+
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5470b8b4-c584-50fb-bd09-0feb81bd8184")}catch{}})();import{AsyncLocalStorage}from"node:async_hooks";import{attachExtensionReadOutputRows}from"./read-output/extension.js";import{renderPmCommand}from"./command-line.js";import{attachOutputOmissionReceipt}from"./output-projection.js";import{encodeQueryCursor}from"./pagination.js";import{applyReadOutputDimensions,stabilizeReadOutputReceiptEstimates}from"./read-output-contracts.js";import{propagateContextUsageServingReceipt}from"./context-usage.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";const PM_CONTEXT_INTENT_CONTRACTS=Object.freeze([{command:"context",intent:"orient",description:"Bounded active hierarchy, ownership, blockers, and recent progress.",included_field_groups:["summary","focus","hierarchy","blockers","activity"],token_budget:3e3,source:"core"},{command:"context",intent:"handoff",description:"Active ownership, evidence, decisions, and immediate continuation context.",included_field_groups:["summary","focus","in_progress","decisions","activity"],token_budget:2200,source:"core"},{command:"get",intent:"inspect",description:"Standard-depth item metadata, relationships, evidence, and lifecycle state.",included_field_groups:["item","children","claim_state","linked"],token_budget:3200,source:"core"},{command:"list",intent:"triage",description:"A budget-derived page of compact governance, ownership, priority, and blocker rows for triage.",included_field_groups:["identity","governance","ownership","dependencies"],token_budget:3200,source:"core"},{command:"next",intent:"execute",description:"The highest-ranked actionable work with concise ranking evidence.",included_field_groups:["recommended"],token_budget:1200,source:"core"},{command:"search",intent:"discover",description:"A budget-derived page of ranked canonical lineage candidates with compact match evidence.",included_field_groups:["identity","status","lineage","match"],token_budget:1800,source:"core"}]),activeContextIntentContracts=new AsyncLocalStorage;function getActiveContextIntentContracts(){return activeContextIntentContracts.getStore()??PM_CONTEXT_INTENT_CONTRACTS}function runWithContextIntentContracts(layers,run){return activeContextIntentContracts.run(composeContextIntentContracts(layers.workspaceContracts,layers.packageContracts),run)}function normalizeContextIntentDeclaration(declaration,source){const command=declaration.command.trim().toLowerCase(),intent=declaration.intent.trim().toLowerCase(),key=`${command}:${intent}`;if(!/^[a-z0-9][a-z0-9-]*$/.test(command)||!/^[a-z0-9][a-z0-9-]*$/.test(intent))throw new TypeError(`Invalid context intent command or name: ${key}`);if(declaration.description.trim().length===0)throw new TypeError(`Context intent ${key} requires a non-empty description`);if(!Number.isSafeInteger(declaration.token_budget)||declaration.token_budget<=0)throw new TypeError(`Context intent ${key} requires a positive integer token_budget`);const includedFieldGroups=[...new Set(declaration.included_field_groups.map(field=>field.trim()).filter(Boolean))];if(includedFieldGroups.length===0)throw new TypeError(`Context intent ${key} requires included_field_groups`);return{command,intent,description:declaration.description.trim(),included_field_groups:includedFieldGroups,token_budget:declaration.token_budget,source}}function composeContextIntentContracts(workspaceContracts=[],packageContracts=[]){const layers=[{source:"core",contracts:PM_CONTEXT_INTENT_CONTRACTS,allowOverride:!1},{source:"package",contracts:packageContracts,allowOverride:!1},{source:"workspace",contracts:workspaceContracts,allowOverride:!0}],composed=new Map,keysSeenWithinLayer=new Set;for(const layer of layers){keysSeenWithinLayer.clear();for(const declaration of layer.contracts){const normalized=normalizeContextIntentDeclaration(declaration,layer.source),key=`${normalized.command}:${normalized.intent}`;if(keysSeenWithinLayer.has(key))throw new TypeError(`Duplicate context intent declaration: ${key}`);if(keysSeenWithinLayer.add(key),!layer.allowOverride&&composed.has(key))throw new TypeError(`Duplicate context intent declaration: ${key}`);composed.set(key,normalized)}}return[...composed.values()].sort((left,right)=>left.command.localeCompare(right.command)||left.intent.localeCompare(right.intent))}function resolveContextIntentContract(command,intent,contracts=getActiveContextIntentContracts(),positionalArguments=[]){const normalizedCommand=command.trim().toLowerCase(),normalizedIntent=intent.trim().toLowerCase(),exact=contracts.find(entry=>entry.command===normalizedCommand&&entry.intent===normalizedIntent);if(exact)return{...exact,source:exact.source??"core"};const candidates=contracts.filter(entry=>entry.command===normalizedCommand).map(entry=>entry.intent);if(candidates.length===0)return;const suggestion=candidates.map(candidate=>{const rows=Array.from({length:normalizedIntent.length+1},(_,index)=>index);for(let candidateIndex=1;candidateIndex<=candidate.length;candidateIndex+=1){let previous=rows[0];rows[0]=candidateIndex;for(let intentIndex=1;intentIndex<=normalizedIntent.length;intentIndex+=1){const prior=rows[intentIndex];rows[intentIndex]=Math.min(rows[intentIndex]+1,rows[intentIndex-1]+1,previous+(candidate[candidateIndex-1]===normalizedIntent[intentIndex-1]?0:1)),previous=prior}}return{candidate,distance:rows[normalizedIntent.length]}}).sort((left,right)=>left.distance-right.distance||left.candidate.localeCompare(right.candidate))[0].candidate,attemptedArguments=[normalizedCommand,...positionalArguments,"--for",normalizedIntent],suggestedRetryArguments=[normalizedCommand,...positionalArguments,"--for",suggestion],suggestedCommand=renderPmCommand(suggestedRetryArguments);throw new PmCliError(`Unknown context intent "${normalizedIntent}" for ${normalizedCommand}. Did you mean "${suggestion}"?`,EXIT_CODE.USAGE,{code:"unknown_context_intent",reason:"unknown_intent",field:"for",flag:"--for",value:normalizedIntent,required:`Use a declared ${normalizedCommand} intent.`,why:"Intent names are command-local contracts and cannot be inferred from output section names.",nextSteps:[suggestedCommand],recovery:{recovery_mode:"compact",attempted_command:renderPmCommand(attemptedArguments),allowed_values:[...candidates].sort(),suggested_retry:suggestedCommand,suggested_retry_args:suggestedRetryArguments}})}const CONTEXT_INTENT_DEFAULT_APPLIERS={context:(projected,contract,explicitTokenBudget)=>{projected.section===void 0&&projected.depth===void 0&&(projected.section=contract.intent==="handoff"?["activity","progress","blockers"]:["hierarchy","blockers","activity"]),projected.depth===void 0&&(projected.depth=contract.intent==="handoff"?"deep":"standard");const tokenBudget=resolveIntentTokenBudget(projected.tokenBudget,contract.token_budget),budgetDerivedLimit=resolveIntentRowBudget("context",contract.intent,tokenBudget,explicitTokenBudget),requestedLimit=parsePositiveIntentTokenBudget(projected.limit),derivedLimit=String(requestedLimit===void 0?budgetDerivedLimit:Math.min(requestedLimit,budgetDerivedLimit));(projected.limit===void 0||requestedLimit!==void 0)&&(projected.limit=derivedLimit),projected.activityLimit===void 0&&(projected.activityLimit=derivedLimit)},get:projected=>{projected.depth===void 0&&projected.fields===void 0&&(projected.depth="standard")},list:(projected,contract,explicitTokenBudget)=>{projected.brief===void 0&&projected.compact===void 0&&projected.full===void 0&&projected.fields===void 0&&(projected.fields="id,title,status,type,priority,parent,assignee,risk,blocked_by");const tokenBudget=resolveIntentTokenBudget(projected.tokenBudget,contract.token_budget),budgetDerivedLimit=resolveIntentRowBudget("list",contract.intent,tokenBudget,explicitTokenBudget),requestedLimit=parsePositiveIntentTokenBudget(projected.limit);(projected.limit===void 0||requestedLimit!==void 0)&&(projected.limit=String(requestedLimit===void 0?budgetDerivedLimit:Math.min(requestedLimit,budgetDerivedLimit)))},next:projected=>{projected.readyOnly===void 0&&(projected.readyOnly=!0)},search:(projected,contract,explicitTokenBudget)=>{projected.compact===void 0&&projected.full===void 0&&projected.fields===void 0&&(projected.compact=!0);const tokenBudget=resolveIntentTokenBudget(projected.tokenBudget,contract.token_budget),budgetDerivedLimit=resolveIntentRowBudget("search",contract.intent,tokenBudget,explicitTokenBudget),requestedLimit=parsePositiveIntentTokenBudget(projected.limit);(projected.limit===void 0||requestedLimit!==void 0)&&(projected.limit=String(requestedLimit===void 0?budgetDerivedLimit:Math.min(requestedLimit,budgetDerivedLimit)))}};function applyContextIntentProjection(command,options,positionalArguments=[]){const tokenBudget=options.tokenBudget??options.token_budget;if(typeof options.for!="string"){if(tokenBudget!==void 0&&(command==="get"||command==="list"||command==="search"))throw new PmCliError("--token-budget requires a declared context intent selected with --for",EXIT_CODE.USAGE,{code:"missing_required_option",field:"for",required:"Select a context intent with --for when setting --token-budget.",why:"A token-budget override has no projection contract to constrain without a selected intent.",nextSteps:["Retry with --for <intent> --token-budget <n>, or omit --token-budget."]});if(options.tokenBudget!==void 0||options.token_budget===void 0)return options;const projected2={...options,tokenBudget};return delete projected2.token_budget,projected2}const contract=resolveContextIntentContract(command,options.for,void 0,positionalArguments),explicitTokenBudget=parsePositiveIntentTokenBudget(tokenBudget)!==void 0,projected={...options};return projected.tokenBudget===void 0&&tokenBudget!==void 0&&(projected.tokenBudget=tokenBudget),delete projected.token_budget,projected.tokenBudget===void 0&&(projected.tokenBudget=String(contract.token_budget)),CONTEXT_INTENT_DEFAULT_APPLIERS[command](projected,contract,explicitTokenBudget),projected}const CONTEXT_INTENT_DEGRADATIONS={context:"bounded_sections",get:"standard_item",list:"bounded_fields_and_rows",next:"bounded_ranked_rows",search:"bounded_ranked_rows"},MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET=256;function compactContextIntentValue(value){return Array.isArray(value)?value.map(compactContextIntentValue):value!==null&&typeof value=="object"?Object.fromEntries(Object.entries(value).map(([key,entry])=>[key,compactContextIntentValue(entry)])):typeof value=="string"&&value.length>240?`${value.slice(0,240)}\u2026`:value}function parsePositiveIntentTokenBudget(value){const parsed=typeof value=="number"?value:typeof value=="string"&&/^\d+$/u.test(value.trim())?Number(value):Number.NaN;return Number.isSafeInteger(parsed)&&parsed>0?parsed:void 0}function resolveIntentTokenBudget(value,declaredBudget){const parsed=parsePositiveIntentTokenBudget(value);if(parsed===void 0)return declaredBudget;if(parsed<MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET)throw new PmCliError(`Context intent token budget must be at least ${MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET}`,EXIT_CODE.USAGE,{code:"invalid_argument_value",reason:"below_minimum",field:"tokenBudget",value:String(value),required:`Use an integer token budget of at least ${MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET}.`,why:"Smaller ceilings cannot contain the minimum machine-readable intent receipt.",nextSteps:[`Retry with --token-budget ${MINIMUM_CONTEXT_INTENT_TOKEN_BUDGET} or omit the override.`]});return parsed}function resolveIntentRowBudget(command,intent,tokenBudget,explicitTokenBudget){if(command==="get"||command==="next")return;const contextOrient=command==="context"&&intent==="orient",overhead=command==="context"?contextOrient?1200:800:command==="list"?520:480,rowCost=command==="context"?contextOrient?600:500:16,calculatedLimit=Math.max(command==="context"?1:2,Math.floor((tokenBudget-overhead)/rowCost));return explicitTokenBudget?calculatedLimit:Math.min(command==="context"?20:100,calculatedLimit)}function updateContextIntentEstimate(projected,receipt){let measuredTokens=receipt.estimated_tokens;for(;;){receipt.estimated_tokens=measuredTokens;const nextMeasurement=Math.ceil(Buffer.byteLength(JSON.stringify(projected),"utf8")/4);if(nextMeasurement===measuredTokens)return;measuredTokens=nextMeasurement}}const CONTEXT_INTENT_ROW_KEYS={context:["high_level","low_level","blocked_fallback","recently_created","unparented","hierarchy","activity","blockers"],get:["children"],list:["items"],next:["ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items"]};function decodeContextIntentCursor(cursor){try{const parsed=JSON.parse(Buffer.from(cursor,"base64url").toString("utf8"));return typeof parsed.fingerprint!="string"||!Number.isSafeInteger(parsed.after_index)?void 0:{fingerprint:parsed.fingerprint,after_index:parsed.after_index,...typeof parsed.snapshot=="string"?{snapshot:parsed.snapshot}:{}}}catch{return}}function contextIntentRowId(row){if(row===null||typeof row!="object")return;if(typeof row.id=="string")return row.id;const nestedId=row.item?.id;return typeof nestedId=="string"?nestedId:void 0}function shrinkContextIntentRowsToBudget(projected,receipt,rows){let compacted=!1;for(;;){if(updateContextIntentEstimate(projected,receipt),receipt.estimated_tokens<=receipt.token_budget||rows.length<=1)return compacted;const rowBytes=Buffer.byteLength(JSON.stringify(rows),"utf8"),excessBytes=(receipt.estimated_tokens-receipt.token_budget)*4;rows.splice(-Math.min(rows.length-1,Math.max(1,Math.ceil(excessBytes/Math.max(1,Math.ceil(rowBytes/rows.length)))))),compacted=!0}}function compactPaginatedContextIntentRows(projected,receipt,options){const rows=projected.items,cursorContinuesExistingPage=typeof projected.next_cursor=="string",cursorSource=cursorContinuesExistingPage?projected.next_cursor:options.after;if(!Array.isArray(rows)||typeof cursorSource!="string")return!1;const cursorEnvelope=decodeContextIntentCursor(cursorSource);if(cursorEnvelope===void 0)return!1;const originalRowCount=rows.length,originalRows=[...rows];let compacted=!1;for(;;){if(compacted=shrinkContextIntentRowsToBudget(projected,receipt,rows)||compacted,!compacted)return!1;const lastId=contextIntentRowId(rows.at(-1));if(lastId===void 0)return rows.splice(0,rows.length,...originalRows),updateContextIntentEstimate(projected,receipt),!1;if(projected.next_cursor=encodeQueryCursor(cursorEnvelope.fingerprint,lastId,cursorContinuesExistingPage?cursorEnvelope.after_index-(originalRowCount-rows.length):cursorEnvelope.after_index+rows.length,cursorEnvelope.snapshot),updateContextIntentEstimate(projected,receipt),receipt.estimated_tokens<=receipt.token_budget||rows.length<=1)break}return typeof projected.count=="number"&&(projected.count=rows.length),typeof projected.applied_limit=="number"&&(projected.applied_limit=rows.length),!0}function compactContextIntentRows(command,projected,receipt,options){if(command==="list"||command==="search")return compactPaginatedContextIntentRows(projected,receipt,options);if(command!=="next"||typeof projected.next_cursor=="string")return!1;let compacted=!1;for(;;){if(updateContextIntentEstimate(projected,receipt),receipt.estimated_tokens<=receipt.token_budget)return compacted;const candidate=CONTEXT_INTENT_ROW_KEYS[command].map(key=>({key,rows:Array.isArray(projected[key])?projected[key]:[]})).filter(({rows})=>rows.length>0).sort((left,right)=>right.rows.length-left.rows.length||left.key.localeCompare(right.key))[0];if(candidate===void 0)return compacted;const retainedTotal=CONTEXT_INTENT_ROW_KEYS[command].reduce((total,key)=>total+(Array.isArray(projected[key])?projected[key].length:0),0);if(retainedTotal<=1)return compacted;const removableRows=Math.min(candidate.rows.length,retainedTotal-1),candidateBytes=Buffer.byteLength(JSON.stringify(candidate.rows),"utf8"),estimatedBytesPerRow=Math.max(1,Math.ceil(candidateBytes/candidate.rows.length)),excessBytes=(receipt.estimated_tokens-receipt.token_budget)*4,removalCount=Math.min(removableRows,Math.max(1,Math.ceil(excessBytes/estimatedBytesPerRow)));candidate.rows.splice(-removalCount,removalCount),compacted=!0}}function attachContextIntentReceipt(command,options,result){if(typeof options.for!="string")return result;const normalizedCommand=command.startsWith("list-")?"list":command;if(!(normalizedCommand in CONTEXT_INTENT_DEFAULT_APPLIERS))return result;const builtInCommand=normalizedCommand,contract=resolveContextIntentContract(builtInCommand,options.for),effectiveTokenBudget=resolveIntentTokenBudget(options.tokenBudget??options.token_budget,contract.token_budget),receipt={command:builtInCommand,intent:contract.intent,source:contract.source,included_field_groups:[...contract.included_field_groups],token_budget:effectiveTokenBudget,declared_token_budget:contract.token_budget,token_budget_override:effectiveTokenBudget-contract.token_budget,estimated_tokens:0,within_budget:!0,degradation:CONTEXT_INTENT_DEGRADATIONS[builtInCommand],declaration_feasible:!0,result_omitted:!1},resultWithDiagnostics={...result},budgetDerivedLimit=resolveIntentRowBudget(builtInCommand,contract.intent,receipt.token_budget,parsePositiveIntentTokenBudget(options.tokenBudget??options.token_budget)!==void 0);if(budgetDerivedLimit!==void 0){const effectiveLimit=parsePositiveIntentTokenBudget(options.limit),explicitLimitBinds=effectiveLimit!==void 0&&effectiveLimit<budgetDerivedLimit;receipt.budget_derived_limit=budgetDerivedLimit,receipt.binding_constraint=explicitLimitBinds?"explicit_limit":"token_budget",receipt.limit_reason=explicitLimitBinds?"The caller supplied a smaller row limit than the budget-derived ceiling.":"The selected intent token budget constrains the effective row ceiling.",resultWithDiagnostics.budget_derived_limit=budgetDerivedLimit}let projected={...resultWithDiagnostics,context_intent:receipt};return updateContextIntentEstimate(projected,receipt),receipt.estimated_tokens>receipt.token_budget&&(receipt.degradation="recursive_budget_compaction",projected={...compactContextIntentValue(resultWithDiagnostics),context_intent:receipt},updateContextIntentEstimate(projected,receipt)),receipt.estimated_tokens>receipt.token_budget&&compactContextIntentRows(builtInCommand,projected,receipt,options)&&(receipt.degradation="budget_row_compaction",updateContextIntentEstimate(projected,receipt)),receipt.declaration_feasible=receipt.estimated_tokens<=receipt.declared_token_budget,receipt.estimated_tokens>receipt.token_budget&&(receipt.degradation="budget_receipt_only",receipt.result_omitted=!0,receipt.within_budget=!1,projected={budget_exceeded:{omitted_result:!0,reason:receipt.token_budget_override===0?"declared_budget_infeasible":"effective_budget_infeasible",restore_with:buildContextIntentRecoveryCommand(command,builtInCommand,contract.intent,receipt,resultWithDiagnostics)},context_intent:receipt}),projected}function collapseContinuationMetadata(options,result){if(typeof options.after!="string"||options.after.length===0)return result;const fingerprint=decodeContextIntentCursor(options.after)?.fingerprint??"opaque_cursor",projected={...result};for(const key of["applied_limit","completeness","context_intent","count","filters","has_more","now","omission_receipt","projection","row_contract","sorting","total","truncated"])delete projected[key];return projected.continuation_contract={fingerprint,metadata:"reference",restore_with:"omit --after"},projected}function isOutputRecord(value){return value!==null&&typeof value=="object"&&!Array.isArray(value)}function buildContextIntentRecoveryCommand(command,builtInCommand,intent,receipt,result){const recoveryTarget=builtInCommand==="get"&&isOutputRecord(result.item)&&typeof result.item.id=="string"?result.item.id:builtInCommand==="search"&&typeof result.query=="string"?result.query:void 0,recoveryPositional=recoveryTarget===void 0?"":` '${recoveryTarget.replaceAll("'",`'"'"'`)}'`,boundedRowLimit=builtInCommand==="get"?"":` --limit ${receipt.budget_derived_limit??1}`;return`pm ${command}${recoveryPositional} --for ${intent} --token-budget ${Math.ceil(receipt.estimated_tokens/100)*100}${boundedRowLimit}`}function receiptEstimate(value,field){if(isOutputRecord(value))return typeof value[field]=="number"?value[field]:void 0}function stabilizeSuppressedRowContractReceipts(result,options){let finalized=result;for(let iteration=0;iteration<8;iteration+=1){const previousContextEstimate=receiptEstimate(finalized.context_intent,"estimated_tokens"),previousReadEstimate=receiptEstimate(finalized.read_output,"estimated_tokens"),previousSessionEstimate=receiptEstimate(finalized.read_session,"spent_this_call_tokens");if(isOutputRecord(finalized.context_intent)&&updateContextIntentEstimate(finalized,finalized.context_intent),finalized=stabilizeReadOutputReceiptEstimates(finalized,options),receiptEstimate(finalized.context_intent,"estimated_tokens")===previousContextEstimate&&receiptEstimate(finalized.read_output,"estimated_tokens")===previousReadEstimate&&receiptEstimate(finalized.read_session,"spent_this_call_tokens")===previousSessionEstimate)break}return finalized}function attachReadOutputContracts(command,options,result){const disclosedResult=attachOutputOmissionReceipt(command,attachExtensionReadOutputRows(command??"",result)),projected=typeof disclosedResult=="object"&&disclosedResult!==null&&!Array.isArray(disclosedResult)?applyReadOutputDimensions(command??"",{...options,outputRowContract:options.outputRowContract===!0||options.output_row_contract===!0},collapseContinuationMetadata(options,attachContextIntentReceipt(command??"",options,disclosedResult))):disclosedResult;if(propagateContextUsageServingReceipt(result,projected),options.outputRowContract===!0||options.output_row_contract===!0||typeof projected!="object"||projected===null||Array.isArray(projected)||!Object.hasOwn(projected,"row_contract"))return projected;const withoutDiscoveryMetadata=Object.fromEntries(Object.entries(projected).filter(([key])=>key!=="row_contract"));Object.defineProperty(withoutDiscoveryMetadata,"row_contract",{value:projected.row_contract,enumerable:!1,configurable:!0});const suppressed=stabilizeSuppressedRowContractReceipts(withoutDiscoveryMetadata,options);return delete suppressed.row_contract,propagateContextUsageServingReceipt(projected,suppressed),suppressed}export{PM_CONTEXT_INTENT_CONTRACTS,applyContextIntentProjection,attachContextIntentReceipt,attachReadOutputContracts,composeContextIntentContracts,contextIntentRowId,decodeContextIntentCursor,getActiveContextIntentContracts,resolveContextIntentContract,runWithContextIntentContracts};
|
|
2
2
|
//# sourceMappingURL=context-intent-contracts.js.map
|