@unbrained/pm-cli 2026.10.14 → 2026.10.17
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/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +74 -2
- package/dist/cli/after-command-context-usage.d.ts +7 -7
- package/dist/cli/argv-utils.d.ts +4 -4
- package/dist/cli/bundle-integrity.d.ts +16 -16
- package/dist/cli/command-namespaces.d.ts +1 -1
- package/dist/cli/commander-usage.d.ts +34 -34
- package/dist/cli/commands/governance/validate.d.ts +1 -1
- package/dist/cli/commands/history/history-compact.d.ts +1 -1
- package/dist/cli/commands/history/history-redact.d.ts +1 -1
- package/dist/cli/commands/history/history-repair.d.ts +1 -1
- package/dist/cli/commands/history/restore.d.ts +1 -1
- package/dist/cli/commands/lifecycle/close.d.ts +1 -1
- package/dist/cli/commands/lifecycle/copy.d.ts +1 -1
- package/dist/cli/commands/lifecycle/delete.d.ts +1 -1
- package/dist/cli/commands/lifecycle/focus.d.ts +1 -1
- package/dist/cli/commands/query/get.d.ts +1 -1
- package/dist/cli/commands/workspace/merge.d.ts +1 -1
- package/dist/cli/commands/workspace/schema.d.ts +1 -1
- package/dist/cli/context-intent-invocation.d.ts +1 -1
- package/dist/cli/description-stdin.d.ts +1 -1
- package/dist/cli/error-guidance.d.ts +119 -119
- package/dist/cli/extension-command-help.d.ts +64 -64
- package/dist/cli/extension-command-help.js +2 -2
- package/dist/cli/extension-command-options.d.ts +18 -16
- package/dist/cli/extension-command-options.js +1 -1
- package/dist/cli/extension-recovery.d.ts +13 -13
- package/dist/cli/help-content.d.ts +22 -22
- package/dist/cli/help-content.js +3 -3
- package/dist/cli/help-json-payload.d.ts +45 -45
- package/dist/cli/invocation-profile.d.ts +5 -5
- package/dist/cli/main.d.ts +217 -217
- package/dist/cli/migration-gates.d.ts +24 -24
- package/dist/cli/option-values.d.ts +1 -1
- package/dist/cli/public.d.ts +1 -1
- package/dist/cli/register-annotations.d.ts +2 -2
- package/dist/cli/register-assurance.d.ts +1 -1
- package/dist/cli/register-files-lookup.d.ts +1 -1
- package/dist/cli/register-history-activity.d.ts +1 -1
- package/dist/cli/register-history-author.d.ts +1 -1
- package/dist/cli/register-history-maintenance.d.ts +1 -1
- package/dist/cli/register-list-query.d.ts +7 -7
- package/dist/cli/register-list-query.js +3 -3
- package/dist/cli/register-mutation-options.d.ts +1 -1
- package/dist/cli/register-mutation.d.ts +4 -4
- package/dist/cli/register-mutation.js +2 -2
- package/dist/cli/register-operations.d.ts +75 -75
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli/register-setup.d.ts +4 -4
- package/dist/cli/register-structured-mutation.d.ts +8 -13
- package/dist/cli/register-structured-mutation.js +1 -1
- package/dist/cli/runtime/activation.d.ts +23 -23
- package/dist/cli/runtime/invocation-options.d.ts +12 -12
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli/runtime/projection-retry.d.ts +1 -1
- package/dist/cli/runtime/selection.d.ts +16 -16
- package/dist/cli/runtime/telemetry-outcome.d.ts +11 -11
- package/dist/cli/runtime-compatibility-boundary.d.ts +7 -7
- package/dist/cli/schema/registration.d.ts +1 -1
- package/dist/cli/schema-registration-helpers.d.ts +2 -2
- package/dist/cli/stats-analytics-json.d.ts +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-LKESCZEN.js → chunk-3QKI3XNX.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-4PNPDT2N.js +236 -0
- package/dist/cli-bundle/chunks/{chunk-JTF6VMXH.js → chunk-6ZDKKOKM.js} +28 -28
- package/dist/cli-bundle/chunks/{chunk-MAT4AP7P.js → chunk-B5QVGCZX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5LU6PWA4.js → chunk-EA2CG7UM.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-HY7FQ7QX.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-3S5SEMEB.js → chunk-J4LPQCET.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-JS3B2M4D.js +6 -0
- package/dist/cli-bundle/chunks/chunk-O4YBC3OM.js +30 -0
- package/dist/cli-bundle/chunks/{chunk-LE4IEHDG.js → chunk-OZCSXX4D.js} +63 -64
- package/dist/cli-bundle/chunks/chunk-VMCSTFSO.js +2 -0
- package/dist/cli-bundle/chunks/chunk-W3KZ22DW.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-2UKKO45F.js → chunk-X2ONXFBP.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X53HM753.js +20 -0
- package/dist/cli-bundle/chunks/{register-list-query-GBLTOQQL.js → register-list-query-RU3QZSAQ.js} +7 -7
- package/dist/cli-bundle/chunks/register-mutation-EQYMT32A.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-J3WXP3MA.js → register-operations-VXBGE4XI.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-HLSKKU4V.js → register-setup-UUDEGFRO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ELQNEJDA.js → chunk-2IOHHNRT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5JEFDEL3.js +166 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4UA7KY4V.js → chunk-AH6NX6GM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ESOW6PH4.js → chunk-E33QA7PK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BUAGNTLG.js → chunk-FTUZ3JF2.js} +6 -6
- package/dist/cli-bundle/focused-chunks/{chunk-HNRI2KBT.js → chunk-JXR6UKFM.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-LDKX4KYJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-IGBSAHCA.js → chunk-MBQF6HT6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-NZO7GOXD.js +20 -0
- package/dist/cli-bundle/focused-chunks/{chunk-QIU4Y3AB.js → chunk-PYC7BF6Z.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YJNKISEI.js → chunk-QOSVJDOO.js} +61 -62
- package/dist/cli-bundle/focused-chunks/{chunk-RHQCQTZA.js → chunk-RBLSY6ML.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KSMQEB3V.js → chunk-RHTH5ILM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Y5A4XOSK.js → chunk-SIGIGZCG.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-TRFVAWF2.js +26 -0
- package/dist/cli-bundle/focused-chunks/{chunk-AULVKHYX.js → chunk-UNTQE37U.js} +2 -2
- 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 +23 -23
- 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 +54 -54
- 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 +7 -7
- package/dist/cli.d.ts +9 -9
- package/dist/core/checkpoint/checkpoint-gc.d.ts +17 -17
- package/dist/core/checkpoint/mutation-checkpoint.d.ts +26 -26
- package/dist/core/config/nested-settings.d.ts +20 -20
- package/dist/core/config/positional-value.d.ts +9 -9
- package/dist/core/diagnostics/remediation.d.ts +7 -7
- package/dist/core/extensions/activation-summary-markdown.d.ts +4 -4
- package/dist/core/extensions/activation-summary.d.ts +30 -30
- package/dist/core/extensions/activation-transaction.d.ts +9 -9
- package/dist/core/extensions/capability-usage.d.ts +25 -25
- package/dist/core/extensions/command-hook-context.d.ts +15 -15
- package/dist/core/extensions/command-metadata-contract.d.ts +1 -1
- package/dist/core/extensions/command-visibility-tier.d.ts +1 -1
- package/dist/core/extensions/contribution-inventory.d.ts +24 -24
- package/dist/core/extensions/exporter-output-contract.d.ts +4 -4
- package/dist/core/extensions/extension-candidate.d.ts +14 -14
- package/dist/core/extensions/extension-capability-aliases.d.ts +14 -14
- package/dist/core/extensions/extension-hook-runtime.d.ts +14 -14
- package/dist/core/extensions/extension-policy.d.ts +62 -62
- package/dist/core/extensions/extension-registries.d.ts +8 -8
- package/dist/core/extensions/extension-runtime-helpers.d.ts +5 -5
- package/dist/core/extensions/extension-types.d.ts +717 -702
- package/dist/core/extensions/extension-types.js +1 -1
- package/dist/core/extensions/flag-definition-validation.d.ts +11 -11
- package/dist/core/extensions/flag-value-types.d.ts +32 -4
- package/dist/core/extensions/flag-value-types.js +1 -1
- package/dist/core/extensions/index.d.ts +34 -34
- package/dist/core/extensions/item-field-types.d.ts +3 -3
- package/dist/core/extensions/item-fields.d.ts +6 -6
- package/dist/core/extensions/loader.d.ts +66 -66
- package/dist/core/extensions/manifest-parser.d.ts +1 -1
- package/dist/core/extensions/manifest-schema.d.ts +13 -13
- package/dist/core/extensions/module-graph-snapshot.d.ts +5 -5
- package/dist/core/extensions/preflight-ownership.d.ts +3 -3
- package/dist/core/extensions/read-output-contract.d.ts +2 -2
- package/dist/core/extensions/registration-contracts.d.ts +12 -12
- package/dist/core/extensions/registration-contracts.js +1 -1
- package/dist/core/extensions/registration-validation.d.ts +6 -6
- package/dist/core/extensions/registration-values.d.ts +19 -19
- package/dist/core/extensions/reserved-host-flags.d.ts +5 -5
- package/dist/core/extensions/runtime-registrations.d.ts +6 -6
- package/dist/core/extensions/service-ownership.d.ts +1 -1
- package/dist/core/extensions/version-compat.d.ts +9 -9
- package/dist/core/fs/atomic-create.d.ts +1 -1
- package/dist/core/fs/fs-utils.d.ts +12 -12
- package/dist/core/fs/host-environment-errors.d.ts +10 -10
- package/dist/core/fs/path-utils.d.ts +1 -1
- package/dist/core/governance/content-fields.d.ts +25 -25
- package/dist/core/governance/issue-codes.d.ts +16 -16
- package/dist/core/governance/metadata-coverage.d.ts +64 -64
- package/dist/core/history/digest.d.ts +5 -5
- package/dist/core/history/drift-cache.d.ts +2 -2
- package/dist/core/history/drift-scan.d.ts +18 -18
- package/dist/core/history/event-classification.d.ts +4 -4
- package/dist/core/history/event-index.d.ts +33 -33
- package/dist/core/history/history-compact-bulk.d.ts +12 -12
- package/dist/core/history/history-diff.d.ts +15 -15
- package/dist/core/history/history-rewrite.d.ts +43 -43
- package/dist/core/history/history-storage-stats.d.ts +20 -20
- package/dist/core/history/history-stream-policy.d.ts +12 -12
- package/dist/core/history/history.d.ts +45 -45
- package/dist/core/history/identity.d.ts +4 -4
- package/dist/core/history/operation-contract.d.ts +17 -17
- package/dist/core/history/projection.d.ts +16 -16
- package/dist/core/history/read.d.ts +4 -4
- package/dist/core/history/replay.d.ts +47 -47
- package/dist/core/history/tombstone.d.ts +1 -1
- package/dist/core/history/version-address.d.ts +2 -2
- package/dist/core/history/workspace-history.d.ts +72 -72
- package/dist/core/io/body-file.d.ts +2 -2
- package/dist/core/io/bulk-ids-input.d.ts +7 -7
- package/dist/core/item/actionability.d.ts +30 -30
- package/dist/core/item/dependency-reference.d.ts +2 -2
- package/dist/core/item/id.d.ts +9 -9
- package/dist/core/item/item-format-version.d.ts +17 -15
- package/dist/core/item/item-format-version.js +1 -1
- package/dist/core/item/item-format.d.ts +54 -54
- package/dist/core/item/item-format.js +3 -3
- package/dist/core/item/item-record.d.ts +1 -1
- package/dist/core/item/item-type-definition.d.ts +11 -11
- package/dist/core/item/parent-reference-policy.d.ts +6 -6
- package/dist/core/item/parse.d.ts +37 -37
- package/dist/core/item/plan-lifecycle.d.ts +4 -4
- package/dist/core/item/priority.d.ts +3 -3
- package/dist/core/item/sprint-release-format.d.ts +4 -4
- package/dist/core/item/status-filter.d.ts +5 -5
- package/dist/core/item/status.d.ts +3 -3
- package/dist/core/item/toon-decode.d.ts +10 -10
- package/dist/core/item/type-registry.d.ts +35 -35
- package/dist/core/item/type-synonyms.d.ts +2 -2
- package/dist/core/lock/lock-gc.d.ts +28 -28
- package/dist/core/lock/lock.d.ts +53 -53
- package/dist/core/output/mutation-projection.d.ts +4 -25
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/output/output-control.d.ts +4 -4
- package/dist/core/output/output.d.ts +30 -30
- package/dist/core/output/query-summary.d.ts +5 -5
- package/dist/core/output/tabular.d.ts +3 -3
- package/dist/core/packages/manifest.d.ts +30 -30
- package/dist/core/packages/root.d.ts +4 -4
- package/dist/core/policy/workflow-policy-schema.d.ts +291 -291
- package/dist/core/policy/workflow-policy-store.d.ts +15 -15
- package/dist/core/policy/workflow-policy.d.ts +56 -56
- package/dist/core/profile/profile-describe.d.ts +22 -22
- package/dist/core/profile/profile-lint.d.ts +13 -13
- package/dist/core/profile/profile-plan.d.ts +45 -45
- package/dist/core/profile/profile-presets.d.ts +36 -36
- package/dist/core/reproducibility/context.d.ts +9 -9
- package/dist/core/schema/fields-file.d.ts +35 -35
- package/dist/core/schema/item-types-file.d.ts +29 -29
- package/dist/core/schema/runtime-field-filters.d.ts +3 -3
- package/dist/core/schema/runtime-field-values.d.ts +7 -7
- package/dist/core/schema/runtime-schema.d.ts +59 -59
- package/dist/core/schema/status-defs-file.d.ts +29 -29
- package/dist/core/schema/status-token.d.ts +1 -1
- package/dist/core/schema/type-inference.d.ts +10 -10
- package/dist/core/schema/type-presets.d.ts +5 -5
- package/dist/core/schema/type-workflows.d.ts +15 -15
- package/dist/core/schema/type-workflows.js +1 -1
- package/dist/core/search/background-refresh.d.ts +12 -12
- package/dist/core/search/bm25.d.ts +16 -16
- package/dist/core/search/cache.d.ts +34 -34
- package/dist/core/search/corpus.d.ts +17 -17
- package/dist/core/search/embedding-batches.d.ts +25 -25
- package/dist/core/search/eval-thresholds.d.ts +4 -4
- package/dist/core/search/eval.d.ts +40 -40
- package/dist/core/search/http-client.d.ts +24 -24
- package/dist/core/search/providers.d.ts +30 -30
- package/dist/core/search/relevance.d.ts +17 -17
- package/dist/core/search/semantic-defaults.d.ts +5 -5
- package/dist/core/search/staleness.d.ts +3 -3
- package/dist/core/search/vector-stores.d.ts +51 -51
- package/dist/core/search/vectorization-metadata.d.ts +9 -9
- package/dist/core/sentry/helpers.d.ts +27 -27
- package/dist/core/sentry/instrument.d.ts +51 -51
- package/dist/core/sentry/instrument.js +1 -1
- package/dist/core/sentry/sensitive-assignments.d.ts +9 -0
- package/dist/core/sentry/sensitive-assignments.js +2 -0
- package/dist/core/session/session-state.d.ts +37 -37
- package/dist/core/shared/agent-session-context.d.ts +14 -14
- package/dist/core/shared/author.d.ts +89 -89
- package/dist/core/shared/command-line.d.ts +3 -3
- package/dist/core/shared/command-types.d.ts +20 -20
- package/dist/core/shared/conflict-markers.d.ts +5 -5
- package/dist/core/shared/constants.d.ts +30 -30
- package/dist/core/shared/errors.d.ts +100 -100
- package/dist/core/shared/html-entity-decode.d.ts +2 -2
- package/dist/core/shared/item-metadata-contract.d.ts +2 -2
- package/dist/core/shared/lazy-module.d.ts +1 -1
- package/dist/core/shared/levenshtein.d.ts +1 -1
- package/dist/core/shared/memo.d.ts +1 -1
- package/dist/core/shared/numeric-parsers.d.ts +1 -1
- package/dist/core/shared/option-alias-visibility.d.ts +3 -3
- package/dist/core/shared/primitives.d.ts +13 -13
- package/dist/core/shared/secret-rules.d.ts +92 -92
- package/dist/core/shared/serial-queue.d.ts +6 -6
- package/dist/core/shared/serialization.d.ts +4 -4
- package/dist/core/shared/split-comma-list.d.ts +4 -4
- package/dist/core/shared/text-normalization.d.ts +5 -3
- package/dist/core/shared/text-normalization.js +1 -1
- package/dist/core/shared/time.d.ts +27 -27
- package/dist/core/store/item-format-migration.d.ts +7 -7
- package/dist/core/store/item-metadata-cache.d.ts +30 -30
- package/dist/core/store/item-metadata-query-index.d.ts +66 -66
- package/dist/core/store/item-metadata-read-work.d.ts +6 -6
- package/dist/core/store/item-mutation-precondition.d.ts +11 -0
- package/dist/core/store/item-mutation-precondition.js +2 -0
- package/dist/core/store/item-store.d.ts +123 -123
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/store/paths.d.ts +27 -27
- package/dist/core/store/settings-concurrency.d.ts +1 -1
- package/dist/core/store/settings-read-cache.d.ts +11 -11
- package/dist/core/store/settings-validator.d.ts +117 -117
- package/dist/core/store/settings.d.ts +84 -84
- package/dist/core/store/sqlite-runtime.d.ts +2 -2
- package/dist/core/store/tracker-preflight.d.ts +3 -3
- package/dist/core/telemetry/consent.d.ts +1 -1
- package/dist/core/telemetry/observability.d.ts +16 -16
- package/dist/core/telemetry/policy.d.ts +7 -7
- package/dist/core/telemetry/read-sampling.d.ts +1 -1
- package/dist/core/telemetry/runtime.d.ts +275 -275
- package/dist/core/test/background-runs.d.ts +123 -123
- package/dist/core/test/item-test-run-tracking.d.ts +10 -10
- package/dist/core/test/run-selectors.d.ts +12 -12
- package/dist/core/validate/estimate-defaults.d.ts +3 -3
- package/dist/core/validate/fix-planning.d.ts +36 -36
- package/dist/core/validate/linked-artifact-reference.d.ts +1 -1
- package/dist/core/validate/missing-by-type.d.ts +3 -3
- package/dist/core/validate/missing-link-owners.d.ts +17 -17
- package/dist/core/validate/stale-file-classification.d.ts +6 -6
- package/dist/mcp/http-server.d.ts +26 -26
- package/dist/mcp/legacy-adapter.d.ts +18 -18
- package/dist/mcp/runtime-capabilities.d.ts +18 -18
- package/dist/mcp/server.d.ts +73 -73
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tool-definitions.d.ts +27 -27
- package/dist/mcp/tool-definitions.js +1 -1
- package/dist/sdk/actionability.d.ts +1 -1
- package/dist/sdk/agent/closed-domain-contracts.d.ts +11 -11
- package/dist/sdk/agent/command-recovery.d.ts +5 -5
- package/dist/sdk/agent/command-suggestions.d.ts +4 -4
- package/dist/sdk/agent/create-option-policy.d.ts +2 -2
- package/dist/sdk/agent/identity-config.d.ts +18 -18
- package/dist/sdk/agent/item-addressing.d.ts +6 -6
- package/dist/sdk/agent/refusal-closure-census.d.ts +26 -26
- package/dist/sdk/agent/refusal-closure.d.ts +22 -22
- package/dist/sdk/agent/refusal-corpus-contracts.d.ts +26 -26
- package/dist/sdk/agent/refusal-reachability.d.ts +65 -65
- package/dist/sdk/agent/subcommand-recovery.d.ts +20 -20
- package/dist/sdk/agent/task-transcript-contracts.d.ts +18 -18
- package/dist/sdk/agent/tracker-preflight-contracts.d.ts +21 -21
- package/dist/sdk/agent-capability-contracts.d.ts +41 -41
- package/dist/sdk/agent-session-context.d.ts +1 -1
- package/dist/sdk/annotations.d.ts +74 -74
- package/dist/sdk/author-attribution.d.ts +47 -47
- package/dist/sdk/authoring.d.ts +9 -9
- package/dist/sdk/cli-bootstrap.d.ts +65 -65
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +56 -56
- package/dist/sdk/cli-contracts/agent-output-contracts.js +1 -1
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +6 -6
- package/dist/sdk/cli-contracts/command-aliases.d.ts +19 -19
- package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +66 -66
- package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +7 -7
- package/dist/sdk/cli-contracts/commander-types.d.ts +18 -18
- package/dist/sdk/cli-contracts/completeness.d.ts +14 -14
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +28 -28
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +114 -112
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +27 -27
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
- package/dist/sdk/cli-contracts/grammar-contracts.d.ts +61 -61
- package/dist/sdk/cli-contracts/registration-helpers.d.ts +57 -57
- package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +250 -250
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +678 -678
- package/dist/sdk/cli-contracts/string-lists.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +564 -564
- package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +13 -13
- package/dist/sdk/cli-contracts/tool-schema.d.ts +54 -54
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +20 -20
- package/dist/sdk/cli-contracts.d.ts +15 -15
- package/dist/sdk/cli-program.d.ts +1 -1
- package/dist/sdk/cli-program.js +1 -1
- package/dist/sdk/command-line.d.ts +3 -3
- package/dist/sdk/comments.d.ts +24 -24
- package/dist/sdk/compile-cache.d.ts +4 -4
- package/dist/sdk/completion/bash.d.ts +1 -1
- package/dist/sdk/completion/fish.d.ts +1 -1
- package/dist/sdk/completion/shared.d.ts +74 -74
- package/dist/sdk/completion/zsh.d.ts +1 -1
- package/dist/sdk/completion.d.ts +3 -3
- package/dist/sdk/compose.d.ts +94 -94
- package/dist/sdk/config.d.ts +105 -105
- package/dist/sdk/context/recency.d.ts +1 -1
- package/dist/sdk/context/semantic-session-attribution.d.ts +23 -23
- package/dist/sdk/context/usage-egress.d.ts +1 -1
- package/dist/sdk/context/usage-ledger.d.ts +18 -18
- package/dist/sdk/context-intent-contracts.d.ts +37 -37
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/context-intent-runtime.d.ts +10 -10
- package/dist/sdk/context-packing.d.ts +44 -44
- package/dist/sdk/context-relevance.d.ts +110 -110
- package/dist/sdk/context-signal-store.d.ts +52 -52
- package/dist/sdk/context-usage.d.ts +78 -78
- package/dist/sdk/contracts.d.ts +2 -1
- package/dist/sdk/contracts.js +1 -1
- package/dist/sdk/core-governance.d.ts +5 -5
- package/dist/sdk/core.d.ts +9 -8
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/corpus-shape.d.ts +60 -60
- package/dist/sdk/define.d.ts +36 -36
- package/dist/sdk/dependencies.d.ts +70 -70
- package/dist/sdk/dependency-flag-validation.d.ts +17 -17
- package/dist/sdk/dependency-provenance.d.ts +22 -22
- package/dist/sdk/docs.d.ts +17 -17
- package/dist/sdk/duplicates.d.ts +14 -14
- package/dist/sdk/environment/agent-environment.d.ts +118 -118
- package/dist/sdk/environment/host-environment-errors.d.ts +1 -1
- package/dist/sdk/environment/project-runtime-compatibility.d.ts +42 -40
- package/dist/sdk/environment/project-runtime-compatibility.js +2 -2
- package/dist/sdk/environment/source-context.d.ts +4 -4
- package/dist/sdk/environment/tracker-preflight.d.ts +1 -1
- package/dist/sdk/error-code-catalog.d.ts +33 -33
- package/dist/sdk/error-runtime.d.ts +5 -5
- package/dist/sdk/errors.d.ts +17 -17
- package/dist/sdk/eval.d.ts +27 -27
- package/dist/sdk/extension/author-manifest.d.ts +9 -9
- package/dist/sdk/extension/bundled-catalog.d.ts +18 -18
- package/dist/sdk/extension/concurrency.d.ts +1 -1
- package/dist/sdk/extension/copy-scope.d.ts +1 -1
- package/dist/sdk/extension/custom-field-collisions.d.ts +1 -1
- package/dist/sdk/extension/describe.d.ts +21 -21
- package/dist/sdk/extension/doctor.d.ts +46 -46
- package/dist/sdk/extension/install-plan.d.ts +32 -32
- package/dist/sdk/extension/install-receipts.d.ts +4 -4
- package/dist/sdk/extension/install-runtime.d.ts +12 -12
- package/dist/sdk/extension/install-snapshot.d.ts +10 -10
- package/dist/sdk/extension/install-sources.d.ts +106 -106
- package/dist/sdk/extension/managed-state.d.ts +42 -42
- package/dist/sdk/extension/managed-update-status.d.ts +1 -1
- package/dist/sdk/extension/migrations.d.ts +48 -48
- package/dist/sdk/extension/output-ownership.d.ts +19 -19
- package/dist/sdk/extension/runtime-summary.d.ts +7 -7
- package/dist/sdk/extension/scaffold.d.ts +15 -15
- package/dist/sdk/extension/shared.d.ts +16 -16
- package/dist/sdk/extension/source-resolution.d.ts +16 -16
- package/dist/sdk/extension/static-inventory.d.ts +23 -23
- package/dist/sdk/extension/update-check.d.ts +9 -9
- package/dist/sdk/extension-command-context.d.ts +1 -1
- package/dist/sdk/extension-contracts.d.ts +10 -10
- package/dist/sdk/extension.d.ts +221 -221
- package/dist/sdk/files.d.ts +101 -101
- package/dist/sdk/flag-invocation-contracts.d.ts +25 -25
- package/dist/sdk/flag-invocation-contracts.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/generated-error-code-catalog.d.ts +1 -1
- package/dist/sdk/governance/artifact-ledgers.d.ts +19 -19
- package/dist/sdk/governance/assurance-action-contracts.d.ts +1 -1
- package/dist/sdk/governance/assurance-action.d.ts +46 -46
- package/dist/sdk/governance/assurance-mutation-error.d.ts +20 -20
- package/dist/sdk/governance/assurance-presets.d.ts +25 -25
- package/dist/sdk/governance/assurance-runtime.d.ts +10 -10
- package/dist/sdk/governance/assurance.d.ts +204 -204
- package/dist/sdk/governance/boundary-fixtures.d.ts +32 -32
- package/dist/sdk/governance/closure-timestamps.d.ts +10 -10
- package/dist/sdk/governance/coverage-assurance.d.ts +7 -7
- package/dist/sdk/governance/defect-recurrence-coverage.d.ts +40 -40
- package/dist/sdk/governance/defect-recurrence-graph.d.ts +11 -11
- package/dist/sdk/governance/defect-recurrence-signals.d.ts +1 -1
- package/dist/sdk/governance/defect-recurrence.d.ts +97 -97
- package/dist/sdk/governance/extension-host-version.d.ts +9 -9
- package/dist/sdk/governance/gc.d.ts +26 -26
- package/dist/sdk/governance/health-merge-evidence.d.ts +8 -8
- package/dist/sdk/governance/health.d.ts +172 -172
- package/dist/sdk/governance/health.js +1 -1
- package/dist/sdk/governance/hierarchy-validation.d.ts +16 -16
- package/dist/sdk/governance/linked-file-report.d.ts +15 -15
- package/dist/sdk/governance/merge-receipt-history.d.ts +24 -24
- package/dist/sdk/governance/provenance-health.d.ts +35 -35
- package/dist/sdk/governance/reindex.d.ts +102 -102
- package/dist/sdk/governance/reliability.d.ts +29 -29
- package/dist/sdk/governance/stale-work.d.ts +13 -13
- package/dist/sdk/governance/status-role-diagnostics.d.ts +8 -8
- package/dist/sdk/governance/storage-integrity.d.ts +28 -28
- package/dist/sdk/governance/tracked-runtime-cache.d.ts +7 -7
- package/dist/sdk/governance/upgrade.d.ts +77 -77
- package/dist/sdk/governance/validate-history-drift.d.ts +3 -3
- package/dist/sdk/governance/validate-item-reader.d.ts +9 -9
- package/dist/sdk/governance/validate-normalization.d.ts +4 -4
- package/dist/sdk/governance/validate.d.ts +176 -176
- package/dist/sdk/governance/validate.js +1 -1
- package/dist/sdk/governance/workflow-completeness.d.ts +15 -15
- package/dist/sdk/governance/workflow-policy.d.ts +18 -18
- package/dist/sdk/governance/workspace-position.d.ts +40 -40
- package/dist/sdk/governance.d.ts +2 -2
- package/dist/sdk/graph/adapter.d.ts +45 -45
- package/dist/sdk/graph/analytics.d.ts +36 -36
- package/dist/sdk/graph/assembly.d.ts +51 -51
- package/dist/sdk/graph/cache.d.ts +19 -19
- package/dist/sdk/graph/cardinality-integrity.d.ts +4 -4
- package/dist/sdk/graph/centrality.d.ts +20 -20
- package/dist/sdk/graph/conformance.d.ts +21 -21
- package/dist/sdk/graph/deadline-scheduling.d.ts +30 -30
- package/dist/sdk/graph/durable-cache.d.ts +22 -22
- package/dist/sdk/graph/governance-contracts.d.ts +1 -1
- package/dist/sdk/graph/governance.d.ts +92 -92
- package/dist/sdk/graph/hierarchy-integrity.d.ts +32 -32
- package/dist/sdk/graph/index.d.ts +15 -15
- package/dist/sdk/graph/lifecycle-coverage.d.ts +12 -12
- package/dist/sdk/graph/mutation-advisory.d.ts +15 -15
- package/dist/sdk/graph/query-contracts.d.ts +6 -6
- package/dist/sdk/graph/remediation.d.ts +15 -15
- package/dist/sdk/graph/run.d.ts +203 -203
- package/dist/sdk/graph/scheduling.d.ts +21 -21
- package/dist/sdk/graph/traversal.d.ts +18 -18
- package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +1 -1
- package/dist/sdk/guide-topics.d.ts +19 -19
- package/dist/sdk/guide-topics.js +1 -1
- package/dist/sdk/guide.d.ts +43 -43
- package/dist/sdk/history/attestation-command.d.ts +8 -8
- package/dist/sdk/history/attestation-contract.d.ts +43 -43
- package/dist/sdk/history/attestation-scan.d.ts +4 -4
- package/dist/sdk/history/attestation.d.ts +4 -4
- package/dist/sdk/history/maintenance.d.ts +25 -25
- package/dist/sdk/history/salvage.d.ts +19 -19
- package/dist/sdk/history/subject.d.ts +8 -8
- package/dist/sdk/history-analytics.d.ts +64 -64
- package/dist/sdk/history-compact.d.ts +67 -67
- package/dist/sdk/history-mcp.d.ts +7 -7
- package/dist/sdk/history-provenance.d.ts +40 -40
- package/dist/sdk/history-read.d.ts +24 -24
- package/dist/sdk/history-redact.d.ts +68 -68
- package/dist/sdk/history-repair.d.ts +92 -92
- package/dist/sdk/improvement-ledger-validation.d.ts +1 -1
- package/dist/sdk/improvement-ledger.d.ts +62 -62
- package/dist/sdk/index.d.ts +70 -69
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/init-agent-guidance.d.ts +68 -68
- package/dist/sdk/init.d.ts +117 -117
- package/dist/sdk/invocation-author.d.ts +1 -1
- package/dist/sdk/item-children.d.ts +15 -15
- package/dist/sdk/item-metadata-index.d.ts +2 -2
- package/dist/sdk/item-schedule.d.ts +9 -9
- package/dist/sdk/item-transaction.d.ts +139 -76
- package/dist/sdk/item-transaction.js +1 -1
- package/dist/sdk/learnings.d.ts +23 -23
- package/dist/sdk/lifecycle/append.d.ts +8 -8
- package/dist/sdk/lifecycle/claim.d.ts +53 -39
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/close-many.d.ts +71 -71
- package/dist/sdk/lifecycle/close.d.ts +18 -24
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/copy.d.ts +10 -10
- package/dist/sdk/lifecycle/core-field-recovery.d.ts +1 -1
- package/dist/sdk/lifecycle/core-item-fields.d.ts +6 -0
- package/dist/sdk/lifecycle/core-item-fields.js +2 -0
- package/dist/sdk/lifecycle/create.d.ts +88 -88
- package/dist/sdk/lifecycle/delete.d.ts +15 -15
- package/dist/sdk/lifecycle/event-validation-messages.d.ts +1 -1
- package/dist/sdk/lifecycle/focus.d.ts +6 -6
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +6 -6
- package/dist/sdk/lifecycle/legacy-none-tokens.d.ts +35 -35
- package/dist/sdk/lifecycle/lifecycle-transitions.d.ts +3 -3
- package/dist/sdk/lifecycle/mcp-actions.d.ts +10 -10
- package/dist/sdk/lifecycle/mcp-actions.js +1 -1
- package/dist/sdk/lifecycle/metadata-normalizers.d.ts +4 -4
- package/dist/sdk/lifecycle/mutation-command-options.d.ts +58 -58
- package/dist/sdk/lifecycle/mutation-facet-contracts.d.ts +1 -1
- package/dist/sdk/lifecycle/mutation-option-validation.d.ts +2 -0
- package/dist/sdk/lifecycle/mutation-option-validation.js +2 -0
- package/dist/sdk/lifecycle/plan-mutation-receipt.d.ts +24 -24
- package/dist/sdk/lifecycle/plan.d.ts +127 -127
- package/dist/sdk/lifecycle/recurrence-parsers.d.ts +5 -5
- package/dist/sdk/lifecycle/release-handoff.d.ts +12 -0
- package/dist/sdk/lifecycle/release-handoff.js +2 -0
- package/dist/sdk/lifecycle/reopen.d.ts +15 -15
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.d.ts +7 -7
- package/dist/sdk/lifecycle/restore.d.ts +34 -34
- package/dist/sdk/lifecycle/restore.js +1 -1
- package/dist/sdk/lifecycle/shared-unset-fields.d.ts +20 -20
- package/dist/sdk/lifecycle/structured-mutation-plan.d.ts +33 -0
- package/dist/sdk/lifecycle/structured-mutation-plan.js +2 -0
- package/dist/sdk/lifecycle/task-composition.d.ts +9 -9
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/lifecycle/update-many.d.ts +61 -61
- package/dist/sdk/lifecycle/update.d.ts +113 -121
- package/dist/sdk/lifecycle/update.js +1 -1
- package/dist/sdk/lifecycle/workflow-transition.d.ts +13 -0
- package/dist/sdk/lifecycle/workflow-transition.js +2 -0
- package/dist/sdk/lifecycle-completion.d.ts +14 -14
- package/dist/sdk/lifecycle-policy.d.ts +42 -32
- package/dist/sdk/lifecycle-policy.js +1 -1
- package/dist/sdk/linked-artifacts.d.ts +58 -58
- package/dist/sdk/mcp/apps.d.ts +28 -28
- package/dist/sdk/mcp/authorization.d.ts +66 -66
- package/dist/sdk/mcp/discovery.d.ts +67 -67
- package/dist/sdk/mcp/interactions.d.ts +49 -49
- package/dist/sdk/mcp/protocol.d.ts +63 -63
- package/dist/sdk/mcp/skills.d.ts +62 -62
- package/dist/sdk/mcp/subscriptions.d.ts +26 -26
- package/dist/sdk/mcp/tasks.d.ts +51 -51
- package/dist/sdk/mcp/transport.d.ts +17 -17
- package/dist/sdk/merge/abandoned-receipts.d.ts +8 -8
- package/dist/sdk/merge/driver.d.ts +38 -38
- package/dist/sdk/merge/index.d.ts +5 -5
- package/dist/sdk/merge/install.d.ts +48 -48
- package/dist/sdk/merge/receipt-file-boundary.d.ts +6 -6
- package/dist/sdk/merge/receipt-operation.d.ts +6 -6
- package/dist/sdk/merge/receipt-schema.d.ts +11 -11
- package/dist/sdk/merge/receipts.d.ts +111 -111
- package/dist/sdk/merge/reconcile.d.ts +20 -20
- package/dist/sdk/merge/three-way.d.ts +50 -50
- package/dist/sdk/merge/three-way.js +2 -2
- package/dist/sdk/merge/worktree-config.d.ts +3 -3
- package/dist/sdk/mutation-events.d.ts +62 -62
- package/dist/sdk/mutation-guard.d.ts +134 -134
- package/dist/sdk/notes.d.ts +28 -28
- package/dist/sdk/output/table-rows.d.ts +6 -6
- package/dist/sdk/output-contracts.d.ts +26 -26
- package/dist/sdk/output-projection.d.ts +108 -108
- package/dist/sdk/output-token-accounting.d.ts +18 -18
- package/dist/sdk/output.d.ts +18 -18
- package/dist/sdk/ownership-source.d.ts +1 -1
- package/dist/sdk/package-import-adapters.d.ts +51 -51
- package/dist/sdk/package-migrations.d.ts +3 -3
- package/dist/sdk/package-runtime-options.d.ts +3 -3
- package/dist/sdk/pagination.d.ts +28 -28
- package/dist/sdk/pagination.js +1 -1
- package/dist/sdk/profile.d.ts +72 -72
- package/dist/sdk/provenance.d.ts +37 -37
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.d.ts +84 -84
- package/dist/sdk/query/aggregate.d.ts +109 -109
- package/dist/sdk/query/calendar.d.ts +95 -95
- package/dist/sdk/query/complete-list.d.ts +35 -35
- package/dist/sdk/query/context.d.ts +300 -300
- package/dist/sdk/query/duplicate-candidates.d.ts +3 -3
- package/dist/sdk/query/get.d.ts +54 -54
- package/dist/sdk/query/history.d.ts +38 -38
- package/dist/sdk/query/item-filter-options.d.ts +41 -41
- package/dist/sdk/query/light-metadata.d.ts +1 -1
- package/dist/sdk/query/list-filter-shared.d.ts +4 -4
- package/dist/sdk/query/list.d.ts +167 -167
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/query/multi-value-filters.d.ts +6 -6
- package/dist/sdk/query/next-ready-budget.d.ts +8 -8
- package/dist/sdk/query/next.d.ts +94 -94
- package/dist/sdk/query/parsers.d.ts +3 -3
- package/dist/sdk/query/projection-contracts.d.ts +18 -18
- package/dist/sdk/query/search/corpus.d.ts +15 -15
- package/dist/sdk/query/search/filters.d.ts +15 -15
- package/dist/sdk/query/search/input.d.ts +8 -8
- package/dist/sdk/query/search/lexical.d.ts +10 -10
- package/dist/sdk/query/search/response.d.ts +22 -22
- package/dist/sdk/query/search/semantic.d.ts +133 -133
- package/dist/sdk/query/search/types.d.ts +65 -65
- package/dist/sdk/query/search-contracts.d.ts +53 -53
- package/dist/sdk/query/search-pagination.d.ts +21 -21
- package/dist/sdk/query/search-rendering.d.ts +30 -30
- package/dist/sdk/query/search.d.ts +60 -60
- package/dist/sdk/query/workspace-contracts.d.ts +2 -2
- package/dist/sdk/query.d.ts +6 -6
- package/dist/sdk/read-output/continuation.d.ts +11 -11
- package/dist/sdk/read-output/extension.d.ts +3 -3
- package/dist/sdk/read-output/options.d.ts +7 -7
- package/dist/sdk/read-output/provenance.d.ts +6 -6
- package/dist/sdk/read-output-budget.d.ts +11 -11
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.d.ts +112 -112
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.d.ts +15 -15
- package/dist/sdk/read-output-session.d.ts +29 -29
- package/dist/sdk/relationship-analytics.d.ts +46 -46
- package/dist/sdk/relationship-context.d.ts +48 -48
- package/dist/sdk/relationship-history.d.ts +59 -59
- package/dist/sdk/relationship-kinds/contract.d.ts +18 -18
- package/dist/sdk/relationship-migration.d.ts +14 -14
- package/dist/sdk/relationships.d.ts +46 -46
- package/dist/sdk/reproducibility/process.d.ts +9 -9
- package/dist/sdk/runtime/actions.d.ts +1 -1
- package/dist/sdk/runtime/context.d.ts +15 -15
- package/dist/sdk/runtime/schema-preview.d.ts +1 -1
- package/dist/sdk/runtime/schema.d.ts +1 -1
- package/dist/sdk/runtime-action-aliases.d.ts +3 -3
- package/dist/sdk/runtime-extended-actions.d.ts +9 -9
- package/dist/sdk/runtime-input.d.ts +29 -29
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.d.ts +53 -53
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime-public-contracts.d.ts +46 -46
- package/dist/sdk/runtime-stats-options.d.ts +1 -1
- package/dist/sdk/runtime.d.ts +374 -374
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/scheduling-shortcuts.d.ts +19 -19
- package/dist/sdk/schema-migration.d.ts +79 -79
- package/dist/sdk/schema.d.ts +224 -224
- package/dist/sdk/search-refresh-worker.d.ts +1 -1
- package/dist/sdk/similarity-scoring.d.ts +10 -10
- package/dist/sdk/similarity.d.ts +73 -73
- package/dist/sdk/start-task-status.d.ts +1 -1
- package/dist/sdk/stats.d.ts +72 -72
- package/dist/sdk/structured-mutations.d.ts +64 -13
- package/dist/sdk/structured-mutations.js +1 -1
- package/dist/sdk/telemetry-flush.d.ts +1 -1
- package/dist/sdk/telemetry.d.ts +32 -32
- package/dist/sdk/templates.d.ts +35 -35
- package/dist/sdk/test/batch.d.ts +50 -50
- package/dist/sdk/test/command-args.d.ts +2 -2
- package/dist/sdk/test/entry.d.ts +4 -4
- package/dist/sdk/test/execution-receipts.d.ts +5 -5
- package/dist/sdk/test/execution.d.ts +247 -247
- package/dist/sdk/test/json-path.d.ts +4 -4
- package/dist/sdk/test/linked-command-detection.d.ts +36 -36
- package/dist/sdk/test/measurements.d.ts +10 -10
- package/dist/sdk/test/parsers.d.ts +18 -18
- package/dist/sdk/test/prerequisites.d.ts +3 -3
- package/dist/sdk/test/runs.d.ts +43 -43
- package/dist/sdk/test/trust.d.ts +15 -15
- package/dist/sdk/test/update.d.ts +23 -23
- package/dist/sdk/test/workspace-snapshot.d.ts +1 -1
- package/dist/sdk/testing.d.ts +248 -248
- package/dist/sdk/traceability/runtime-files-lookup.d.ts +1 -1
- package/dist/sdk/traceability/source-traceability.d.ts +50 -50
- package/dist/sdk/workspace-contracts-cache.d.ts +2 -2
- package/dist/sdk/workspace-contracts.d.ts +20 -20
- package/dist/sdk/workspace-memory.d.ts +42 -42
- package/dist/sdk/workspace-recipe.d.ts +9 -9
- package/dist/sdk/workspace-snapshot.d.ts +60 -60
- package/dist/sdk/workspace-transaction-gc.d.ts +17 -17
- package/dist/sdk/workspace-transaction.d.ts +26 -26
- package/dist/sdk/workspace-transaction.js +2 -2
- package/dist/sdk/workspace.d.ts +9 -9
- package/dist/types.d.ts +540 -540
- package/docs/AGENT_GUIDE.md +33 -4
- package/docs/CLOSE_EVIDENCE_RECOVERY.md +16 -7
- package/docs/COMMANDS.md +96 -12
- package/docs/ECOSYSTEM_PLANNING_REVIEW.md +5 -1
- package/docs/EXTENSIONS.md +1 -1
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +18 -4
- package/docs/LINKED_TEST_EDITS.md +15 -0
- package/docs/RELEASING.md +2 -0
- package/docs/SDK.md +114 -2
- package/docs/TESTING.md +36 -1
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +1 -1
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +17 -3
- package/marketplace.json +1 -1
- package/package.json +4 -1
- 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 +9 -3
- package/dist/cli-bundle/chunks/chunk-66BZVFIK.js +0 -6
- package/dist/cli-bundle/chunks/chunk-IDEHMKYZ.js +0 -235
- package/dist/cli-bundle/chunks/chunk-LOSRTNNP.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PP3BVMFL.js +0 -30
- package/dist/cli-bundle/chunks/chunk-UNQZGMJL.js +0 -20
- package/dist/cli-bundle/chunks/chunk-YXRAYL7H.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-TNRHNK4N.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-23ACMPGB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-JDVZF75H.js +0 -165
- package/dist/cli-bundle/focused-chunks/chunk-LKWDWER4.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-WIXZF5SS.js +0 -26
- package/docs/ecosystem-review-2026-09-28.json +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/** Current content-addressed workspace snapshot manifest schema identifier. */
|
|
2
2
|
export declare const SNAPSHOT_SCHEMA = "https://schema.unbrained.dev/pm/workspace-snapshot/v1";
|
|
3
3
|
/** Workspace snapshot action tokens accepted by the SDK and CLI dispatcher. */
|
|
4
|
-
export declare const WORKSPACE_SNAPSHOT_ACTIONS:
|
|
4
|
+
export declare const WORKSPACE_SNAPSHOT_ACTIONS:readonly ["create","list","inspect","restore","delete"];
|
|
5
5
|
/** Filesystem operations required by atomic snapshot publish and restore swaps. */
|
|
6
6
|
export interface WorkspaceSnapshotAtomicOperations {
|
|
7
7
|
/** Rename one filesystem entry atomically. */
|
|
8
|
-
renameEntry:
|
|
8
|
+
renameEntry:(source:string,target:string) => Promise<void>;
|
|
9
9
|
/** Remove one filesystem entry recursively. */
|
|
10
|
-
removeEntry:
|
|
10
|
+
removeEntry:(target:string) => Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
/** Keeps one workspace writer lease current while a long restore is active. */
|
|
13
13
|
declare class WorkspaceLockHeartbeat {
|
|
@@ -18,111 +18,111 @@ private timer;
|
|
|
18
18
|
private refresh;
|
|
19
19
|
private failure;
|
|
20
20
|
/** Capture the exact lock identity and derive a sub-TTL renewal interval. */
|
|
21
|
-
constructor(lockPath:
|
|
21
|
+
constructor(lockPath:string,owner:string,ttlSeconds:number);
|
|
22
22
|
/** Begin renewing the lock without keeping the process alive on its own. */
|
|
23
|
-
start():
|
|
23
|
+
start():void;
|
|
24
24
|
/** Force and await one owned renewal so callers can establish a fresh lease boundary. */
|
|
25
|
-
refreshNow():
|
|
25
|
+
refreshNow():Promise<void>;
|
|
26
26
|
/** Fail the restore before activation when lease ownership was lost. */
|
|
27
|
-
assertHealthy():
|
|
27
|
+
assertHealthy():void;
|
|
28
28
|
/** Stop future renewals and await the last in-flight atomic write. */
|
|
29
|
-
stop():
|
|
29
|
+
stop():Promise<void>;
|
|
30
30
|
/** Serialize renewal attempts and retain the first ownership failure. */
|
|
31
31
|
private scheduleRenewal;
|
|
32
32
|
/** Atomically refresh only the lock still owned by this process and actor. */
|
|
33
33
|
private renew;
|
|
34
34
|
}
|
|
35
35
|
/** Internal heartbeat constructor exposed only for deterministic lock tests. */
|
|
36
|
-
export declare const _testOnlyWorkspaceSnapshot:
|
|
37
|
-
WorkspaceLockHeartbeat:
|
|
38
|
-
withSnapshotFilesystemGuard:
|
|
36
|
+
export declare const _testOnlyWorkspaceSnapshot:{
|
|
37
|
+
WorkspaceLockHeartbeat:typeof WorkspaceLockHeartbeat;
|
|
38
|
+
withSnapshotFilesystemGuard:typeof withSnapshotFilesystemGuard;
|
|
39
39
|
};
|
|
40
40
|
/** Immutable manifest stored with every content-addressed snapshot object. */
|
|
41
41
|
export interface WorkspaceSnapshotManifest {
|
|
42
42
|
/** Versioned snapshot schema identifier. */
|
|
43
|
-
schema:
|
|
43
|
+
schema:typeof SNAPSHOT_SCHEMA;
|
|
44
44
|
/** SHA-256 identity derived from sorted paths and file bytes. */
|
|
45
|
-
fingerprint:
|
|
45
|
+
fingerprint:string;
|
|
46
46
|
/** Sorted authoritative tracker-relative file paths. */
|
|
47
|
-
files:
|
|
47
|
+
files:readonly string[];
|
|
48
48
|
/** Total authoritative payload size in bytes. */
|
|
49
|
-
bytes:
|
|
49
|
+
bytes:number;
|
|
50
50
|
}
|
|
51
51
|
/** Named reference returned by snapshot list operations. */
|
|
52
52
|
export interface WorkspaceSnapshotReference {
|
|
53
53
|
/** Human-authored stable reference name. */
|
|
54
|
-
name:
|
|
54
|
+
name:string;
|
|
55
55
|
/** Referenced content fingerprint. */
|
|
56
|
-
fingerprint:
|
|
56
|
+
fingerprint:string;
|
|
57
57
|
}
|
|
58
58
|
/** Snapshot create outcome, including whether the object was deduplicated. */
|
|
59
59
|
export interface CreateWorkspaceSnapshotResult {
|
|
60
60
|
/** Immutable manifest for the captured state. */
|
|
61
|
-
manifest:
|
|
61
|
+
manifest:WorkspaceSnapshotManifest;
|
|
62
62
|
/** Optional named reference updated by the operation. */
|
|
63
|
-
name?:
|
|
63
|
+
name?:string;
|
|
64
64
|
/** True when an identical content object already existed. */
|
|
65
|
-
deduplicated:
|
|
65
|
+
deduplicated:boolean;
|
|
66
66
|
}
|
|
67
67
|
/** Exact destructive impact computed before a workspace snapshot restore. */
|
|
68
68
|
export interface WorkspaceSnapshotRestorePlan {
|
|
69
69
|
/** Target snapshot fingerprint. */
|
|
70
|
-
target_fingerprint:
|
|
70
|
+
target_fingerprint:string;
|
|
71
71
|
/** Fingerprint of the authoritative state that would be replaced. */
|
|
72
|
-
current_fingerprint:
|
|
72
|
+
current_fingerprint:string;
|
|
73
73
|
/** Authoritative files whose bytes differ between current and target state. */
|
|
74
|
-
changed_file_count:
|
|
74
|
+
changed_file_count:number;
|
|
75
75
|
/** Current authoritative files absent from the target snapshot. */
|
|
76
|
-
removed_file_count:
|
|
76
|
+
removed_file_count:number;
|
|
77
77
|
/** Target authoritative files absent from current state. */
|
|
78
|
-
added_file_count:
|
|
78
|
+
added_file_count:number;
|
|
79
79
|
/** Current item documents absent from the target snapshot. */
|
|
80
|
-
removed_item_count:
|
|
80
|
+
removed_item_count:number;
|
|
81
81
|
/** History streams absent from, or shorter in, the target snapshot. */
|
|
82
|
-
affected_history_stream_count:
|
|
82
|
+
affected_history_stream_count:number;
|
|
83
83
|
/** History entries that the target snapshot does not retain. */
|
|
84
|
-
removed_history_entry_count:
|
|
84
|
+
removed_history_entry_count:number;
|
|
85
85
|
/** Per-stream evidence for history reductions. */
|
|
86
|
-
affected_history_streams:
|
|
86
|
+
affected_history_streams:readonly WorkspaceSnapshotHistoryImpact[];
|
|
87
87
|
/** True when applying the plan changes authoritative state. */
|
|
88
|
-
changes_authoritative_state:
|
|
88
|
+
changes_authoritative_state:boolean;
|
|
89
89
|
}
|
|
90
90
|
/** One history stream whose retained entry count would decrease on restore. */
|
|
91
91
|
export interface WorkspaceSnapshotHistoryImpact {
|
|
92
92
|
/** Tracker-relative history stream path. */
|
|
93
|
-
path:
|
|
93
|
+
path:string;
|
|
94
94
|
/** Entry count in current authoritative state. */
|
|
95
|
-
current_entries:
|
|
95
|
+
current_entries:number;
|
|
96
96
|
/** Entry count in the target snapshot, or zero when the stream is absent. */
|
|
97
|
-
target_entries:
|
|
97
|
+
target_entries:number;
|
|
98
98
|
/** Entries no longer present after applying the target snapshot. */
|
|
99
|
-
removed_entries:
|
|
99
|
+
removed_entries:number;
|
|
100
100
|
}
|
|
101
101
|
/** Options for a guarded, audited workspace snapshot restore. */
|
|
102
102
|
export interface RestoreWorkspaceSnapshotOptions {
|
|
103
103
|
/** Explicit destructive-operation confirmation. */
|
|
104
|
-
force?:
|
|
104
|
+
force?:boolean;
|
|
105
105
|
/** Actor recorded on the durable workspace audit event. */
|
|
106
|
-
author?:
|
|
106
|
+
author?:string;
|
|
107
107
|
/** Optional human-readable restore rationale. */
|
|
108
|
-
message?:
|
|
108
|
+
message?:string;
|
|
109
109
|
/** Workspace-writer and audit lock time-to-live in seconds. */
|
|
110
|
-
lockTtlSeconds?:
|
|
110
|
+
lockTtlSeconds?:number;
|
|
111
111
|
/** Maximum workspace-writer and audit lock wait in milliseconds. */
|
|
112
|
-
lockWaitMs?:
|
|
112
|
+
lockWaitMs?:number;
|
|
113
113
|
}
|
|
114
114
|
/** Result of an audited and reversible workspace snapshot restore. */
|
|
115
115
|
export interface RestoreWorkspaceSnapshotResult {
|
|
116
116
|
/** Immutable target manifest that supplied the restored payload. */
|
|
117
|
-
manifest:
|
|
117
|
+
manifest:WorkspaceSnapshotManifest;
|
|
118
118
|
/** Exact impact accepted by the caller. */
|
|
119
|
-
plan:
|
|
119
|
+
plan:WorkspaceSnapshotRestorePlan;
|
|
120
120
|
/** Recovery object containing the complete pre-restore authoritative state. */
|
|
121
|
-
recovery_fingerprint:
|
|
121
|
+
recovery_fingerprint:string;
|
|
122
122
|
/** Workspace audit stream receiving the restore event. */
|
|
123
|
-
audit_history_path:
|
|
123
|
+
audit_history_path:string;
|
|
124
124
|
/** Stable audit operation appended after staging and before activation. */
|
|
125
|
-
audit_operation:
|
|
125
|
+
audit_operation:"workspace_snapshot_restore";
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
128
128
|
* Runs a bounded snapshot filesystem stage, converting host environment faults
|
|
@@ -131,27 +131,27 @@ audit_operation: "workspace_snapshot_restore";
|
|
|
131
131
|
* The operation label is a fixed identifier, never a path: snapshot failures
|
|
132
132
|
* are reported without disclosing workspace topology.
|
|
133
133
|
*/
|
|
134
|
-
declare function withSnapshotFilesystemGuard<T>(operation:
|
|
134
|
+
declare function withSnapshotFilesystemGuard<T>(operation:string,run:() => Promise<T>):Promise<T>;
|
|
135
135
|
/**
|
|
136
136
|
* Publish a prepared immutable object, treating a concurrent winning publish
|
|
137
137
|
* as successful deduplication.
|
|
138
138
|
*/
|
|
139
|
-
export declare function publishWorkspaceSnapshotObject(temporaryRoot:
|
|
139
|
+
export declare function publishWorkspaceSnapshotObject(temporaryRoot:string,objectRoot:string,operations?:WorkspaceSnapshotAtomicOperations):Promise<boolean>;
|
|
140
140
|
/** Activate a staged tracker root and restore the backup if activation fails. */
|
|
141
|
-
export declare function swapWorkspaceSnapshotRoot(staging:
|
|
141
|
+
export declare function swapWorkspaceSnapshotRoot(staging:string,pmRoot:string,backup:string,operations?:WorkspaceSnapshotAtomicOperations):Promise<void>;
|
|
142
142
|
/** Capture authoritative tracker state as a deduplicated immutable object. */
|
|
143
|
-
export declare function createWorkspaceSnapshot(pmRoot:
|
|
144
|
-
name?:
|
|
145
|
-
}):
|
|
143
|
+
export declare function createWorkspaceSnapshot(pmRoot:string,options?:{
|
|
144
|
+
name?:string;
|
|
145
|
+
}):Promise<CreateWorkspaceSnapshotResult>;
|
|
146
146
|
/** Read and verify a snapshot manifest by named reference or fingerprint. */
|
|
147
|
-
export declare function inspectWorkspaceSnapshot(pmRoot:
|
|
147
|
+
export declare function inspectWorkspaceSnapshot(pmRoot:string,target:string):Promise<WorkspaceSnapshotManifest>;
|
|
148
148
|
/** List immutable objects and human-readable named references. */
|
|
149
|
-
export declare function listWorkspaceSnapshots(pmRoot:
|
|
150
|
-
objects:
|
|
151
|
-
references:
|
|
149
|
+
export declare function listWorkspaceSnapshots(pmRoot:string):Promise<{
|
|
150
|
+
objects:WorkspaceSnapshotManifest[];
|
|
151
|
+
references:WorkspaceSnapshotReference[];
|
|
152
152
|
}>;
|
|
153
153
|
/** Compute the exact authoritative and history impact of restoring a snapshot. */
|
|
154
|
-
export declare function planWorkspaceSnapshotRestore(pmRoot:
|
|
154
|
+
export declare function planWorkspaceSnapshotRestore(pmRoot:string,target:string):Promise<WorkspaceSnapshotRestorePlan>;
|
|
155
155
|
/**
|
|
156
156
|
* Atomically replace tracker state with an audited, reversible snapshot.
|
|
157
157
|
*
|
|
@@ -159,7 +159,7 @@ export declare function planWorkspaceSnapshotRestore(pmRoot: string, target: str
|
|
|
159
159
|
* state is captured as an immutable recovery object before staging begins, and
|
|
160
160
|
* the staged `_workspace` stream receives the restore event before activation.
|
|
161
161
|
*/
|
|
162
|
-
export declare function restoreWorkspaceSnapshotWithRecovery(pmRoot:
|
|
162
|
+
export declare function restoreWorkspaceSnapshotWithRecovery(pmRoot:string,target:string,options?:RestoreWorkspaceSnapshotOptions):Promise<RestoreWorkspaceSnapshotResult>;
|
|
163
163
|
/**
|
|
164
164
|
* Restore a snapshot through the backward-compatible SDK signature.
|
|
165
165
|
*
|
|
@@ -168,10 +168,10 @@ export declare function restoreWorkspaceSnapshotWithRecovery(pmRoot: string, tar
|
|
|
168
168
|
* that need impact, recovery, and audit coordinates should use
|
|
169
169
|
* `restoreWorkspaceSnapshotWithRecovery`.
|
|
170
170
|
*/
|
|
171
|
-
export declare function restoreWorkspaceSnapshot(pmRoot:
|
|
171
|
+
export declare function restoreWorkspaceSnapshot(pmRoot:string,target:string):Promise<WorkspaceSnapshotManifest>;
|
|
172
172
|
/** Delete a named reference, or an unreferenced immutable object fingerprint. */
|
|
173
|
-
export declare function deleteWorkspaceSnapshot(pmRoot:
|
|
174
|
-
deleted:
|
|
175
|
-
target:
|
|
173
|
+
export declare function deleteWorkspaceSnapshot(pmRoot:string,target:string):Promise<{
|
|
174
|
+
deleted:"reference" | "object";
|
|
175
|
+
target:string;
|
|
176
176
|
}>;
|
|
177
177
|
export {};
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
/** Documents one journal-sweep decision row surfaced by the transaction GC. */
|
|
2
2
|
export interface WorkspaceTransactionGcEntry {
|
|
3
3
|
/** Relative path like "transactions/sdk/<transactionId>.json". */
|
|
4
|
-
file:
|
|
4
|
+
file:string;
|
|
5
5
|
/** Journal status read from the receipt, or null when unreadable. */
|
|
6
|
-
status:
|
|
6
|
+
status:string | null;
|
|
7
7
|
/** Age in seconds derived from the journal's updatedAt, or null when unparseable. */
|
|
8
|
-
age_seconds:
|
|
8
|
+
age_seconds:number | null;
|
|
9
9
|
/** Whether the journal was (or would be) pruned. */
|
|
10
|
-
stale:
|
|
10
|
+
stale:boolean;
|
|
11
11
|
/** Why the journal was retained, when it was. */
|
|
12
|
-
reason?:
|
|
12
|
+
reason?:"active" | "fresh" | "unparseable";
|
|
13
13
|
}
|
|
14
14
|
/** Extension hooks mirroring the checkpoint GC so reads/writes stay observable. */
|
|
15
15
|
export interface WorkspaceTransactionGcHooks {
|
|
16
16
|
/** Invoked before reading each journal file. */
|
|
17
|
-
onRead?:
|
|
17
|
+
onRead?:(absolutePath:string) => Promise<string[]>;
|
|
18
18
|
/** Invoked after removing each journal file. */
|
|
19
|
-
onWrite?:
|
|
19
|
+
onWrite?:(absolutePath:string) => Promise<string[]>;
|
|
20
20
|
}
|
|
21
21
|
/** Documents the transaction GC options payload exchanged by command, SDK, and package integrations. */
|
|
22
22
|
export interface WorkspaceTransactionGcOptions {
|
|
23
23
|
/** Preview prune decisions without deleting any journal. */
|
|
24
|
-
dryRun:
|
|
24
|
+
dryRun:boolean;
|
|
25
25
|
/** Prune terminal journals older than this many days. Negative values are clamped to zero; a non-finite value disables pruning entirely so bad input never deletes recovery receipts. */
|
|
26
|
-
retentionDays:
|
|
26
|
+
retentionDays:number;
|
|
27
27
|
/** Clock override for deterministic tests (milliseconds since epoch). */
|
|
28
|
-
now?:
|
|
28
|
+
now?:number;
|
|
29
29
|
/** Extension observability hooks. */
|
|
30
|
-
hooks?:
|
|
30
|
+
hooks?:WorkspaceTransactionGcHooks;
|
|
31
31
|
}
|
|
32
32
|
/** Documents the transaction GC result payload exchanged by command, SDK, and package integrations. */
|
|
33
33
|
export interface WorkspaceTransactionGcResult {
|
|
34
34
|
/** Number of journal files scanned. */
|
|
35
|
-
scanned:
|
|
35
|
+
scanned:number;
|
|
36
36
|
/** Relative paths of pruned journals. */
|
|
37
|
-
removed:
|
|
37
|
+
removed:string[];
|
|
38
38
|
/** Relative paths of retained journals. */
|
|
39
|
-
retained:
|
|
39
|
+
retained:string[];
|
|
40
40
|
/** Non-fatal sweep warnings. */
|
|
41
|
-
warnings:
|
|
41
|
+
warnings:string[];
|
|
42
42
|
/** One decision row per scanned journal. */
|
|
43
|
-
entries:
|
|
43
|
+
entries:WorkspaceTransactionGcEntry[];
|
|
44
44
|
}
|
|
45
45
|
/** Sweep `transactions/sdk/` and prune terminal workspace-transaction journals older than the retention window. One decision row is reported per journal so `pm gc` output stays auditable. */
|
|
46
|
-
export declare function runWorkspaceTransactionGc(pmRoot:
|
|
46
|
+
export declare function runWorkspaceTransactionGc(pmRoot:string,options:WorkspaceTransactionGcOptions):Promise<WorkspaceTransactionGcResult>;
|
|
@@ -2,68 +2,68 @@
|
|
|
2
2
|
export type WorkspaceTransactionStepState = "pending" | "applied" | "compensated";
|
|
3
3
|
/** JSON-compatible values retained in the durable transaction journal. */
|
|
4
4
|
export type WorkspaceTransactionJsonValue = null | boolean | number | string | WorkspaceTransactionJsonValue[] | {
|
|
5
|
-
[key:
|
|
5
|
+
[key:string]:WorkspaceTransactionJsonValue;
|
|
6
6
|
};
|
|
7
7
|
/** Result returned by a step inspection during replay or recovery. */
|
|
8
8
|
export interface WorkspaceTransactionStepInspection {
|
|
9
9
|
/** Current durable state of the step's domain mutation. */
|
|
10
|
-
state:
|
|
10
|
+
state:WorkspaceTransactionStepState;
|
|
11
11
|
/** Reconstructed result when the mutation is already applied. */
|
|
12
|
-
result?:
|
|
12
|
+
result?:WorkspaceTransactionJsonValue;
|
|
13
13
|
}
|
|
14
14
|
/** One idempotent forward mutation with an append-only compensation. */
|
|
15
15
|
export interface WorkspaceTransactionStep {
|
|
16
16
|
/** Stable identifier unique within the transaction plan. */
|
|
17
|
-
id:
|
|
17
|
+
id:string;
|
|
18
18
|
/** Inspect durable domain state without mutating it. */
|
|
19
|
-
inspect():
|
|
19
|
+
inspect():Promise<WorkspaceTransactionStepInspection>;
|
|
20
20
|
/** Capture journal-safe pre-mutation data required by compensation. */
|
|
21
|
-
prepareCompensation?():
|
|
21
|
+
prepareCompensation?():Promise<WorkspaceTransactionJsonValue | undefined>;
|
|
22
22
|
/** Apply the forward mutation and return a journal-safe result, or store nothing. */
|
|
23
|
-
apply():
|
|
23
|
+
apply():Promise<WorkspaceTransactionJsonValue | undefined>;
|
|
24
24
|
/** Idempotently reconcile only this step's exact forward mutation when present. */
|
|
25
|
-
compensate(data?:
|
|
25
|
+
compensate(data?:WorkspaceTransactionJsonValue):Promise<void>;
|
|
26
26
|
}
|
|
27
27
|
/** Observable transition points available to diagnostics and failure injection. */
|
|
28
28
|
export type WorkspaceTransactionTransition = "prepared" | "step_applied" | "step_recorded" | "committing" | "committed" | "compensating" | "step_compensating" | "step_compensated" | "compensated";
|
|
29
29
|
/** Context emitted at each transaction transition. */
|
|
30
30
|
export interface WorkspaceTransactionTransitionContext {
|
|
31
31
|
/** Stable transaction identifier. */
|
|
32
|
-
transactionId:
|
|
32
|
+
transactionId:string;
|
|
33
33
|
/** Current durable transaction attempt. */
|
|
34
|
-
attempt:
|
|
34
|
+
attempt:number;
|
|
35
35
|
/** Transition reached; `step_applied` follows mutation and precedes journal recording. */
|
|
36
|
-
transition:
|
|
36
|
+
transition:WorkspaceTransactionTransition;
|
|
37
37
|
/** Step associated with a step-level transition. */
|
|
38
|
-
stepId?:
|
|
38
|
+
stepId?:string;
|
|
39
39
|
}
|
|
40
40
|
/** Options accepted by the public workspace transaction coordinator. */
|
|
41
41
|
export interface CommitWorkspaceTransactionOptions {
|
|
42
42
|
/** Tracker root that owns the journal and workspace-wide writer lock. */
|
|
43
|
-
pmRoot:
|
|
43
|
+
pmRoot:string;
|
|
44
44
|
/** Stable idempotency key reused to recover an interrupted transaction. */
|
|
45
|
-
transactionId:
|
|
45
|
+
transactionId:string;
|
|
46
46
|
/** Attributable actor recorded in the durable journal. */
|
|
47
|
-
author:
|
|
47
|
+
author:string;
|
|
48
48
|
/** Ordered idempotent mutations; compensations run in reverse order. */
|
|
49
|
-
steps:
|
|
49
|
+
steps:readonly WorkspaceTransactionStep[];
|
|
50
50
|
/** Lock lifetime in seconds; size this above the longest expected attempt. */
|
|
51
|
-
lockTtlSeconds?:
|
|
51
|
+
lockTtlSeconds?:number;
|
|
52
52
|
/** Maximum time to wait for the workspace writer lock. */
|
|
53
|
-
lockWaitMs?:
|
|
53
|
+
lockWaitMs?:number;
|
|
54
54
|
/** Optional transition observer used by telemetry and deterministic crash tests. */
|
|
55
|
-
onTransition?(context:
|
|
55
|
+
onTransition?(context:WorkspaceTransactionTransitionContext):void | Promise<void>;
|
|
56
56
|
}
|
|
57
57
|
/** Successful durable transaction result. */
|
|
58
58
|
export interface WorkspaceTransactionCommitResult {
|
|
59
59
|
/** Stable transaction identifier. */
|
|
60
|
-
transactionId:
|
|
60
|
+
transactionId:string;
|
|
61
61
|
/** Final durable state. */
|
|
62
|
-
status:
|
|
62
|
+
status:"committed";
|
|
63
63
|
/** Whether an interrupted journal was resumed. */
|
|
64
|
-
recovered:
|
|
64
|
+
recovered:boolean;
|
|
65
65
|
/** One result per ordered transaction step. */
|
|
66
|
-
results:
|
|
66
|
+
results:Record<string,WorkspaceTransactionJsonValue>;
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* Deliberate process-boundary interruption used by deterministic crash tests.
|
|
@@ -72,14 +72,14 @@ results: Record<string, WorkspaceTransactionJsonValue>;
|
|
|
72
72
|
*/
|
|
73
73
|
export declare class WorkspaceTransactionInterruptedError extends Error {
|
|
74
74
|
/** Create one explicit crash-boundary interruption. */
|
|
75
|
-
constructor(message?:
|
|
75
|
+
constructor(message?:string);
|
|
76
76
|
}
|
|
77
77
|
/** Validate transaction identity before preview staging or acquiring any writer lock. */
|
|
78
|
-
export declare function validateWorkspaceTransactionIdentity(options:
|
|
78
|
+
export declare function validateWorkspaceTransactionIdentity(options:Pick<CommitWorkspaceTransactionOptions,"pmRoot" | "transactionId" | "author">):Pick<CommitWorkspaceTransactionOptions,"pmRoot" | "transactionId" | "author">;
|
|
79
79
|
/**
|
|
80
80
|
* Commit an ordered set of idempotent SDK mutations under one workspace writer
|
|
81
81
|
* lock. The durable journal resumes interrupted forward work, while ordinary
|
|
82
82
|
* failures append reverse-order compensations. This provides atomic logical
|
|
83
83
|
* replay without deleting or rewriting immutable domain histories.
|
|
84
84
|
*/
|
|
85
|
-
export declare function commitWorkspaceTransaction(options:
|
|
85
|
+
export declare function commitWorkspaceTransaction(options:CommitWorkspaceTransactionOptions):Promise<WorkspaceTransactionCommitResult>;
|
|
@@ -1,3 +1,3 @@
|
|
|
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]="
|
|
2
|
-
`)}function hasValidJournalMetadata(journal){return Number.isInteger(journal.attempt)&&typeof journal.author=="string"&&typeof journal.createdAt=="string"&&typeof journal.updatedAt=="string"}function createResultMap(source){return Object.assign(Object.create(null),source)}function cloneJournalValue(value,label){try{const serialized=JSON.stringify(value,(_key,nestedValue)=>{if(typeof nestedValue=="number"&&!Number.isFinite(nestedValue))throw new TypeError(`${label} contains a non-finite number`);if(nestedValue===void 0||typeof nestedValue=="function"||typeof nestedValue=="symbol")throw new TypeError(`${label} contains a non-JSON value`);return nestedValue});return JSON.parse(serialized)}catch(error){throw new TypeError(`${label} must be JSON serializable`,{cause:error})}}function cloneOptionalJournalValue(value,label){return value===void 0?void 0:cloneJournalValue(value,label)}function setJournalEntry(target,stepId,value,label){const cloned=cloneOptionalJournalValue(value,label);cloned===void 0?delete target[stepId]:target[stepId]=cloned}function isJournalMap(value){return value!==null&&typeof value=="object"&&!Array.isArray(value)}function hasUniqueKnownStepIds(value,stepIds){return Array.isArray(value)&&new Set(value).size===value.length&&value.every(stepId=>typeof stepId=="string"&&stepIds.includes(stepId))}function hasValidJournalLifecycle(journal,stepIds){if(!hasUniqueKnownStepIds(journal.startedStepIds,stepIds)||!hasUniqueKnownStepIds(journal.completedStepIds,stepIds)||!isJournalMap(journal.results)||!isJournalMap(journal.compensationData))return!1;const startedStepIds=journal.startedStepIds,started=new Set(startedStepIds),completedStepIds=journal.completedStepIds,completed=new Set(completedStepIds);return Object.keys(journal.compensationData).some(stepId=>!started.has(stepId))||Object.keys(journal.results).some(stepId=>!completed.has(stepId))?!1:journal.status==="committed"?stepIds.every(stepId=>completed.has(stepId)):journal.status!=="compensated"||completed.size===0&&started.size===0}function parseJournal(raw,transactionId,stepIds){let parsed;try{parsed=JSON.parse(raw)}catch{throw new TypeError(`Workspace transaction ${transactionId} journal is invalid JSON`)}if(!parsed||typeof parsed!="object"||Array.isArray(parsed))throw new TypeError(`Workspace transaction ${transactionId} journal is invalid`);const journal=parsed,identityMatches=journal.schemaVersion===1&&journal.transactionId===transactionId,stepsMatch=Array.isArray(journal.stepIds)&&journal.stepIds.length===stepIds.length&&journal.stepIds.every((stepId,index)=>stepId===stepIds[index]),lifecycleMatches=hasValidJournalLifecycle(journal,stepIds),metadataMatches=hasValidJournalMetadata(journal),statusMatches=["applying","compensating","compensated","committed"].includes(String(journal.status));if(!identityMatches||!stepsMatch||!lifecycleMatches||!metadataMatches||!statusMatches)throw new TypeError(`Workspace transaction ${transactionId} journal does not match the supplied plan`);return{...journal,results:createResultMap(journal.results),compensationData:createResultMap(journal.compensationData)}}async function prepareJournalForApply(options,transactionId,author,stepIds,existing){let journal=existing;const recovered=journal!==void 0;if(journal?.status==="compensating"&&await compensateAppliedSteps(options,journal),journal===void 0||journal.status==="compensated"){const timestamp=nowIso();journal={schemaVersion:1,transactionId,author,status:"applying",attempt:(journal?.attempt??0)+1,createdAt:journal?.createdAt??timestamp,updatedAt:timestamp,stepIds,startedStepIds:[],completedStepIds:[],results:createResultMap(),compensationData:createResultMap()},await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"prepared")}return{journal,recovered}}async function applyPreparedTransaction(options,journal,recovered){try{await discoverAppliedSteps(journal,options.steps),await writeJournal(options.pmRoot,journal);const completed=new Set(journal.completedStepIds),started=new Set(journal.startedStepIds);for(const step of options.steps){if(completed.has(step.id))continue;const inspection=await step.inspect();let result=cloneOptionalJournalValue(inspection.result,`Step ${step.id} result`);if(inspection.state!=="applied"){const compensationData=await step.prepareCompensation?.();setJournalEntry(journal.compensationData,step.id,compensationData,`Step ${step.id} compensation data`),started.add(step.id),journal.startedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>started.has(stepId)),await writeJournal(options.pmRoot,journal);const appliedResult=await step.apply();result=cloneOptionalJournalValue(appliedResult,`Step ${step.id} result`)}await emitTransition(options,journal,"step_applied",step.id),completed.add(step.id),journal.completedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>completed.has(stepId)),setJournalEntry(journal.results,step.id,result,`Step ${step.id} result`),await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"step_recorded",step.id)}return await emitTransition(options,journal,"committing"),journal.status="committed",await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"committed"),{transactionId:journal.transactionId,status:"committed",recovered,results:createResultMap(journal.results)}}catch(error){if(error instanceof WorkspaceTransactionInterruptedError||journal.status==="committed")throw error;try{await compensateAppliedSteps(options,journal)}catch(compensationError){throw new AggregateError([error,compensationError],`Workspace transaction failed and compensation failed: ${String(compensationError)}`,{cause:compensationError})}throw error}}async function loadJournal(pmRoot,transactionId,stepIds){try{return parseJournal(await readFile(journalPath(pmRoot,transactionId),"utf8"),transactionId,stepIds)}catch(error){if(error!==null&&typeof error=="object"&&"code"in error&&isFileMissingError(error))return;throw error}}async function emitTransition(options,journal,transition,stepId){await options.onTransition?.({transactionId:journal.transactionId,attempt:journal.attempt,transition,...stepId===void 0?{}:{stepId}})}async function discoverAppliedSteps(journal,steps){const completed=new Set,results=createResultMap();for(const step of steps){const inspection=await step.inspect();inspection.state==="applied"&&(completed.add(step.id),setJournalEntry(results,step.id,inspection.result,`Step ${step.id} result`))}journal.results=results,journal.completedStepIds=steps.map(step=>step.id).filter(stepId=>completed.has(stepId))}async function compensateAppliedSteps(options,journal){journal.status="compensating",await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"compensating");const completed=new Set(journal.completedStepIds),started=new Set(journal.startedStepIds);for(const step of[...options.steps].reverse()){if(!started.has(step.id)&&!completed.has(step.id))continue;let shouldCompensate;try{shouldCompensate=started.has(step.id)&&(await step.inspect()).state==="applied"}catch{shouldCompensate=started.has(step.id)}shouldCompensate&&(await emitTransition(options,journal,"step_compensating",step.id),await step.compensate(journal.compensationData[step.id])),completed.delete(step.id),started.delete(step.id),journal.completedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>completed.has(stepId)),journal.startedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>started.has(stepId)),delete journal.results[step.id],delete journal.compensationData[step.id],await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"step_compensated",step.id)}journal.status="compensated",await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"compensated")}async function commitWorkspaceTransaction(options){const{pmRoot,transactionId,author}=validateWorkspaceTransactionIdentity(options),lockTtlSeconds=positiveInteger(options.lockTtlSeconds,DEFAULT_LOCK_TTL_SECONDS,"Transaction lock TTL"),lockWaitMs=positiveInteger(options.lockWaitMs,DEFAULT_LOCK_WAIT_MS,"Transaction lock wait"),steps=[...options.steps];if(steps.length===0)throw new TypeError("Workspace transaction requires at least one step");const stepIds=steps.map(step=>{const stepId=requiredIdentifier(step.id,"Transaction step id");if(stepId!==step.id)throw new TypeError("Transaction step id must not contain surrounding whitespace");return stepId});if(new Set(stepIds).size!==stepIds.length)throw new TypeError("Workspace transaction step ids must be unique");const stableOptions={...options,pmRoot,transactionId,author,steps,lockTtlSeconds,lockWaitMs},release=await acquireLock(pmRoot,WORKSPACE_TRANSACTION_LOCK_ID,lockTtlSeconds,author,!1,!1,lockWaitMs);try{const existing=await loadJournal(pmRoot,transactionId,stepIds),recovered=existing!==void 0;if(existing?.status==="committed")return{transactionId,status:"committed",recovered:!0,results:createResultMap(existing.results)};const prepared=await prepareJournalForApply(stableOptions,transactionId,author,stepIds,existing);return await applyPreparedTransaction(stableOptions,prepared.journal,recovered||prepared.recovered)}finally{await release()}}export{WorkspaceTransactionInterruptedError,commitWorkspaceTransaction,validateWorkspaceTransactionIdentity};
|
|
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]="1fae5539-4eb8-5eba-bfd6-a191c89448ec")}catch{}})();import{mkdir,readFile}from"node:fs/promises";import path from"node:path";import{acquireLock}from"../core/lock/lock.js";import{isFileMissingError,writeFileAtomic}from"../core/fs/fs-utils.js";import{nowIso}from"../core/shared/time.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";class WorkspaceTransactionInterruptedError extends Error{constructor(message="Workspace transaction interrupted"){super(message),this.name="WorkspaceTransactionInterruptedError"}}const WORKSPACE_TRANSACTION_LOCK_ID="sdk-workspace-transaction",TRANSACTION_ID_PATTERN=/^[a-zA-Z0-9._-]+$/,DEFAULT_LOCK_TTL_SECONDS=30,DEFAULT_LOCK_WAIT_MS=3e3;function requiredIdentifier(value,label){if(typeof value!="string")throw new TypeError(`${label} must be a string`);const normalized=value.trim();if(!normalized||!TRANSACTION_ID_PATTERN.test(normalized))throw new TypeError(`${label} must match [a-zA-Z0-9._-]+`);return normalized}function requiredText(value,label){if(typeof value!="string")throw new TypeError(`${label} must be a string`);const normalized=value.trim();if(!normalized)throw new TypeError(`${label} must be non-empty`);return normalized}function validateWorkspaceTransactionIdentity(options){return{pmRoot:requiredText(options.pmRoot,"Transaction pmRoot"),transactionId:requiredIdentifier(options.transactionId,"Transaction id"),author:requiredText(options.author,"Transaction author")}}function positiveInteger(value,fallback,label){const resolved=value??fallback;if(!Number.isInteger(resolved)||resolved<=0)throw new TypeError(`${label} must be a positive integer`);return resolved}function journalPath(pmRoot,transactionId){return path.join(pmRoot,"transactions","sdk",`${transactionId}.json`)}async function writeJournal(pmRoot,journal){journal.updatedAt=nowIso();const target=journalPath(pmRoot,journal.transactionId);await mkdir(path.dirname(target),{recursive:!0}),await writeFileAtomic(target,`${JSON.stringify(journal,null,2)}
|
|
2
|
+
`)}function hasValidJournalMetadata(journal){return Number.isInteger(journal.attempt)&&typeof journal.author=="string"&&typeof journal.createdAt=="string"&&typeof journal.updatedAt=="string"}function createResultMap(source){return Object.assign(Object.create(null),source)}function cloneJournalValue(value,label){try{const serialized=JSON.stringify(value,(_key,nestedValue)=>{if(typeof nestedValue=="number"&&!Number.isFinite(nestedValue))throw new TypeError(`${label} contains a non-finite number`);if(nestedValue===void 0||typeof nestedValue=="function"||typeof nestedValue=="symbol")throw new TypeError(`${label} contains a non-JSON value`);return nestedValue});return JSON.parse(serialized)}catch(error){throw new TypeError(`${label} must be JSON serializable`,{cause:error})}}function cloneOptionalJournalValue(value,label){return value===void 0?void 0:cloneJournalValue(value,label)}function setJournalEntry(target,stepId,value,label){const cloned=cloneOptionalJournalValue(value,label);cloned===void 0?delete target[stepId]:target[stepId]=cloned}function isJournalMap(value){return value!==null&&typeof value=="object"&&!Array.isArray(value)}function hasUniqueKnownStepIds(value,stepIds){return Array.isArray(value)&&new Set(value).size===value.length&&value.every(stepId=>typeof stepId=="string"&&stepIds.includes(stepId))}function hasValidJournalLifecycle(journal,stepIds){if(!hasUniqueKnownStepIds(journal.startedStepIds,stepIds)||!hasUniqueKnownStepIds(journal.completedStepIds,stepIds)||!isJournalMap(journal.results)||!isJournalMap(journal.compensationData))return!1;const startedStepIds=journal.startedStepIds,started=new Set(startedStepIds),completedStepIds=journal.completedStepIds,completed=new Set(completedStepIds);return Object.keys(journal.compensationData).some(stepId=>!started.has(stepId))||Object.keys(journal.results).some(stepId=>!completed.has(stepId))?!1:journal.status==="committed"?stepIds.every(stepId=>completed.has(stepId)):journal.status!=="compensated"||completed.size===0&&started.size===0}function invalidJournal(transactionId,detail){return new PmCliError(`Workspace transaction ${transactionId} journal is invalid (${detail})`,EXIT_CODE.CONFLICT,{code:"transaction_journal_invalid",required:"A valid durable journal is required before transaction recovery can continue.",why:"Corrupt journal data cannot establish which steps applied or still require compensation.",nextSteps:["Preserve the journal and inspect its integrity or restore a verified backup before retrying.","Do not switch to a new transaction id to bypass an unreadable journal; previously applied work may remain."]})}function journalPlanMismatch(transactionId){return new PmCliError(`Workspace transaction ${transactionId} journal does not match the supplied plan`,EXIT_CODE.CONFLICT,{code:"transaction_plan_mismatch",required:"Replay the exact plan that started this transaction, or start a new transaction with a different id.",why:"A journal records the plan it is resuming; applying a different plan under the same id could skip or duplicate steps.",nextSteps:["Re-run with the original document to resume or replay it.","Pass --transaction-id <new-id> (or a new transactionId over MCP) to commit the changed plan as its own transaction.","Run pm ops gc --scope transactions --dry-run to inspect abandoned journals before pruning them."]})}function parseJournal(raw,transactionId,stepIds){let parsed;try{parsed=JSON.parse(raw)}catch{throw invalidJournal(transactionId,"invalid JSON")}if(!parsed||typeof parsed!="object"||Array.isArray(parsed))throw invalidJournal(transactionId,"expected an object");const journal=parsed;if(!(journal.schemaVersion===1&&journal.transactionId===transactionId))throw invalidJournal(transactionId,"schema version or transaction id does not match the journal file");const recordedStepIds=journal.stepIds;if(!Array.isArray(recordedStepIds)||!hasUniqueKnownStepIds(recordedStepIds,recordedStepIds)||!hasValidJournalLifecycle(journal,recordedStepIds)||!hasValidJournalMetadata(journal)||typeof journal.status!="string"||!["applying","compensating","compensated","committed"].includes(journal.status))throw invalidJournal(transactionId,"invalid lifecycle, metadata, status or step ids");if(!(journal.status==="compensated"||recordedStepIds.length===stepIds.length&&recordedStepIds.every((stepId,index)=>stepId===stepIds[index])))throw journalPlanMismatch(transactionId);return{...journal,results:createResultMap(journal.results),compensationData:createResultMap(journal.compensationData)}}async function prepareJournalForApply(options,transactionId,author,stepIds,existing){let journal=existing;const recovered=journal!==void 0;if(journal?.status==="compensating"&&await compensateAppliedSteps(options,journal),journal===void 0||journal.status==="compensated"){const timestamp=nowIso();journal={schemaVersion:1,transactionId,author,status:"applying",attempt:(journal?.attempt??0)+1,createdAt:journal?.createdAt??timestamp,updatedAt:timestamp,stepIds,startedStepIds:[],completedStepIds:[],results:createResultMap(),compensationData:createResultMap()},await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"prepared")}return{journal,recovered}}async function applyPreparedTransaction(options,journal,recovered){try{await discoverAppliedSteps(journal,options.steps),await writeJournal(options.pmRoot,journal);const completed=new Set(journal.completedStepIds),started=new Set(journal.startedStepIds);for(const step of options.steps){if(completed.has(step.id))continue;const inspection=await step.inspect();let result=cloneOptionalJournalValue(inspection.result,`Step ${step.id} result`);if(inspection.state!=="applied"){const compensationData=await step.prepareCompensation?.();setJournalEntry(journal.compensationData,step.id,compensationData,`Step ${step.id} compensation data`),started.add(step.id),journal.startedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>started.has(stepId)),await writeJournal(options.pmRoot,journal);const appliedResult=await step.apply();result=cloneOptionalJournalValue(appliedResult,`Step ${step.id} result`)}await emitTransition(options,journal,"step_applied",step.id),completed.add(step.id),journal.completedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>completed.has(stepId)),setJournalEntry(journal.results,step.id,result,`Step ${step.id} result`),await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"step_recorded",step.id)}return await emitTransition(options,journal,"committing"),journal.status="committed",await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"committed"),{transactionId:journal.transactionId,status:"committed",recovered,results:createResultMap(journal.results)}}catch(error){if(error instanceof WorkspaceTransactionInterruptedError||journal.status==="committed")throw error;try{await compensateAppliedSteps(options,journal)}catch(compensationError){throw new AggregateError([error,compensationError],`Workspace transaction failed and compensation failed: ${String(compensationError)}`,{cause:compensationError})}throw error}}async function loadJournal(pmRoot,transactionId,stepIds){try{return parseJournal(await readFile(journalPath(pmRoot,transactionId),"utf8"),transactionId,stepIds)}catch(error){if(error!==null&&typeof error=="object"&&"code"in error&&isFileMissingError(error))return;throw error}}async function emitTransition(options,journal,transition,stepId){await options.onTransition?.({transactionId:journal.transactionId,attempt:journal.attempt,transition,...stepId===void 0?{}:{stepId}})}async function discoverAppliedSteps(journal,steps){const completed=new Set,results=createResultMap();for(const step of steps){const inspection=await step.inspect();inspection.state==="applied"&&(completed.add(step.id),setJournalEntry(results,step.id,inspection.result,`Step ${step.id} result`))}journal.results=results,journal.completedStepIds=steps.map(step=>step.id).filter(stepId=>completed.has(stepId))}async function compensateAppliedSteps(options,journal){journal.status="compensating",await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"compensating");const completed=new Set(journal.completedStepIds),started=new Set(journal.startedStepIds);for(const step of[...options.steps].reverse()){if(!started.has(step.id)&&!completed.has(step.id))continue;let shouldCompensate;try{shouldCompensate=started.has(step.id)&&(await step.inspect()).state==="applied"}catch{shouldCompensate=started.has(step.id)}shouldCompensate&&(await emitTransition(options,journal,"step_compensating",step.id),await step.compensate(journal.compensationData[step.id])),completed.delete(step.id),started.delete(step.id),journal.completedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>completed.has(stepId)),journal.startedStepIds=options.steps.map(candidate=>candidate.id).filter(stepId=>started.has(stepId)),delete journal.results[step.id],delete journal.compensationData[step.id],await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"step_compensated",step.id)}journal.status="compensated",await writeJournal(options.pmRoot,journal),await emitTransition(options,journal,"compensated")}async function commitWorkspaceTransaction(options){const{pmRoot,transactionId,author}=validateWorkspaceTransactionIdentity(options),lockTtlSeconds=positiveInteger(options.lockTtlSeconds,DEFAULT_LOCK_TTL_SECONDS,"Transaction lock TTL"),lockWaitMs=positiveInteger(options.lockWaitMs,DEFAULT_LOCK_WAIT_MS,"Transaction lock wait"),steps=[...options.steps];if(steps.length===0)throw new TypeError("Workspace transaction requires at least one step");const stepIds=steps.map(step=>{const stepId=requiredIdentifier(step.id,"Transaction step id");if(stepId!==step.id)throw new TypeError("Transaction step id must not contain surrounding whitespace");return stepId});if(new Set(stepIds).size!==stepIds.length)throw new TypeError("Workspace transaction step ids must be unique");const stableOptions={...options,pmRoot,transactionId,author,steps,lockTtlSeconds,lockWaitMs},release=await acquireLock(pmRoot,WORKSPACE_TRANSACTION_LOCK_ID,lockTtlSeconds,author,!1,!1,lockWaitMs);try{const existing=await loadJournal(pmRoot,transactionId,stepIds),recovered=existing!==void 0;if(existing?.status==="committed")return{transactionId,status:"committed",recovered:!0,results:createResultMap(existing.results)};const prepared=await prepareJournalForApply(stableOptions,transactionId,author,stepIds,existing);return await applyPreparedTransaction(stableOptions,prepared.journal,recovered||prepared.recovered)}finally{await release()}}export{WorkspaceTransactionInterruptedError,commitWorkspaceTransaction,validateWorkspaceTransactionIdentity};
|
|
3
3
|
//# sourceMappingURL=workspace-transaction.js.map
|
package/dist/sdk/workspace.d.ts
CHANGED
|
@@ -13,20 +13,20 @@ export declare const PM_GITIGNORE_DEFAULT_TRACKER_ROOT = ".agents/pm";
|
|
|
13
13
|
* state with their own GC (`pm gc --scope transactions|checkpoints`), so
|
|
14
14
|
* keeping them untracked is the recorded merge-safety disposition.
|
|
15
15
|
*/
|
|
16
|
-
export declare const PM_GITIGNORE_RUNTIME_DIRECTORIES:
|
|
16
|
+
export declare const PM_GITIGNORE_RUNTIME_DIRECTORIES:readonly ["runtime/","search/","locks/","transactions/","checkpoints/"];
|
|
17
17
|
/** Tracker-relative curated search evidence that remains version controlled. */
|
|
18
|
-
export declare const PM_GITIGNORE_TRACKED_FILES:
|
|
18
|
+
export declare const PM_GITIGNORE_TRACKED_FILES:readonly ["search/eval-queries.json"];
|
|
19
19
|
/** Result of reconciling the init-owned repository ignore block. */
|
|
20
20
|
export interface EnsurePmGitignoreResult {
|
|
21
21
|
/** Absolute path to the reconciled file. */
|
|
22
|
-
path:
|
|
22
|
+
path:string;
|
|
23
23
|
/** Whether the file content changed. */
|
|
24
|
-
changed:
|
|
24
|
+
changed:boolean;
|
|
25
25
|
}
|
|
26
26
|
/** Return whether a relative path escapes its owning root, without rejecting valid names such as `..pm`. */
|
|
27
|
-
export declare function isPathOutsideRoot(relativePath:
|
|
27
|
+
export declare function isPathOutsideRoot(relativePath:string):boolean;
|
|
28
28
|
/** Return the canonical pm ignore block rendered for the given workspace-relative tracker root (defaults to `.agents/pm`), primarily for documentation and tests. */
|
|
29
|
-
export declare function getPmGitignoreBlock(trackerRelativeRoot?:
|
|
29
|
+
export declare function getPmGitignoreBlock(trackerRelativeRoot?:string):string;
|
|
30
30
|
/**
|
|
31
31
|
* Idempotently create or replace the fenced pm cache block in a workspace
|
|
32
32
|
* `.gitignore`. When `pmRoot` is provided the ignored runtime directories are
|
|
@@ -35,7 +35,7 @@ export declare function getPmGitignoreBlock(trackerRelativeRoot?: string): strin
|
|
|
35
35
|
* A tracker root outside the workspace needs no ignore rules here, so the
|
|
36
36
|
* file is left untouched.
|
|
37
37
|
*/
|
|
38
|
-
export declare function ensurePmGitignore(workspaceRoot:
|
|
38
|
+
export declare function ensurePmGitignore(workspaceRoot:string,options?:{
|
|
39
39
|
/** Absolute tracker root; rendered relative to the workspace root. */
|
|
40
|
-
pmRoot?:
|
|
41
|
-
}):
|
|
40
|
+
pmRoot?:string;
|
|
41
|
+
}):Promise<EnsurePmGitignoreResult>;
|