@unbrained/pm-cli 2026.11.22 → 2026.11.23
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/dist/cli/after-command-context-usage.js +1 -1
- package/dist/cli/argv-utils.js +1 -1
- package/dist/cli/bootstrap-args.js +1 -1
- package/dist/cli/bundle-integrity.js +2 -2
- package/dist/cli/command-namespaces.js +1 -1
- package/dist/cli/commander-usage.js +11 -11
- package/dist/cli/commands/annotations/comments.js +1 -1
- package/dist/cli/commands/annotations/docs.js +1 -1
- package/dist/cli/commands/annotations/files.js +1 -1
- package/dist/cli/commands/annotations/learnings.js +1 -1
- package/dist/cli/commands/annotations/notes.js +1 -1
- package/dist/cli/commands/extension/describe.js +1 -1
- package/dist/cli/commands/extension/extension.js +1 -1
- package/dist/cli/commands/extension/scaffold.js +1 -1
- package/dist/cli/commands/extension/shared.js +1 -1
- package/dist/cli/commands/governance/gc.js +1 -1
- package/dist/cli/commands/governance/health.js +1 -1
- package/dist/cli/commands/governance/telemetry.js +1 -1
- package/dist/cli/commands/governance/validate.js +1 -1
- package/dist/cli/commands/history/activity.js +1 -1
- package/dist/cli/commands/history/history-compact.js +1 -1
- package/dist/cli/commands/history/history-redact.js +1 -1
- package/dist/cli/commands/history/history-repair.js +1 -1
- package/dist/cli/commands/history/history.js +1 -1
- package/dist/cli/commands/history/restore.js +1 -1
- package/dist/cli/commands/lifecycle/append.js +1 -1
- package/dist/cli/commands/lifecycle/claim.js +1 -1
- package/dist/cli/commands/lifecycle/close-many.js +1 -1
- package/dist/cli/commands/lifecycle/close.js +1 -1
- package/dist/cli/commands/lifecycle/copy.js +1 -1
- package/dist/cli/commands/lifecycle/create.js +1 -1
- package/dist/cli/commands/lifecycle/delete.js +1 -1
- package/dist/cli/commands/lifecycle/focus.js +1 -1
- package/dist/cli/commands/lifecycle/plan.js +1 -1
- package/dist/cli/commands/lifecycle/update-many.js +1 -1
- package/dist/cli/commands/lifecycle/update.js +1 -1
- package/dist/cli/commands/query/aggregate.js +1 -1
- package/dist/cli/commands/query/context.js +1 -1
- package/dist/cli/commands/query/deps.js +1 -1
- package/dist/cli/commands/query/duplicates.js +1 -1
- package/dist/cli/commands/query/eval.js +1 -1
- package/dist/cli/commands/query/get.js +1 -1
- package/dist/cli/commands/query/graph.js +1 -1
- package/dist/cli/commands/query/list.js +1 -1
- package/dist/cli/commands/query/next.js +1 -1
- package/dist/cli/commands/query/search.js +1 -1
- package/dist/cli/commands/query/stats.js +1 -1
- package/dist/cli/commands/test/test-all.js +1 -1
- package/dist/cli/commands/test/test-runs.js +1 -1
- package/dist/cli/commands/test/test.js +1 -1
- package/dist/cli/commands/workspace/config.js +1 -1
- package/dist/cli/commands/workspace/contracts.js +1 -1
- package/dist/cli/commands/workspace/init.js +1 -1
- package/dist/cli/commands/workspace/merge.js +1 -1
- package/dist/cli/commands/workspace/profile.js +1 -1
- package/dist/cli/commands/workspace/schema.js +1 -1
- package/dist/cli/commands/workspace/upgrade.js +1 -1
- package/dist/cli/context-intent-invocation.js +1 -1
- package/dist/cli/description-stdin.js +1 -1
- package/dist/cli/error-guidance.js +5 -5
- package/dist/cli/expected-revisions.js +1 -1
- package/dist/cli/extension-command-help.js +6 -6
- package/dist/cli/extension-recovery.js +1 -1
- package/dist/cli/help-content.js +5 -5
- package/dist/cli/help-json-payload.js +7 -7
- package/dist/cli/invocation-profile.js +2 -2
- package/dist/cli/main.js +5 -5
- package/dist/cli/migration-gates.js +1 -1
- package/dist/cli/option-values.js +1 -1
- package/dist/cli/preflight-warnings.js +3 -3
- package/dist/cli/public.js +1 -1
- package/dist/cli/register-annotations.js +1 -1
- package/dist/cli/register-assurance.js +1 -1
- package/dist/cli/register-files-lookup.js +1 -1
- package/dist/cli/register-history-activity.js +1 -1
- package/dist/cli/register-history-author.js +1 -1
- package/dist/cli/register-history-maintenance.js +2 -2
- package/dist/cli/register-list-query.js +10 -10
- package/dist/cli/register-mutation-options.js +0 -1
- package/dist/cli/register-mutation.js +6 -6
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli/register-structured-mutation.js +1 -1
- package/dist/cli/registration-helpers.js +1 -1
- package/dist/cli/runtime/activation.js +1 -1
- package/dist/cli/runtime/annotation-option-retry.js +1 -1
- package/dist/cli/runtime/close-fields-retry.js +1 -1
- package/dist/cli/runtime/field-route-retry.js +1 -1
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli/runtime/invocation-rewrites.js +1 -1
- package/dist/cli/runtime/projection-retry.js +1 -1
- package/dist/cli/runtime/read-output-mutation-retry.js +1 -1
- package/dist/cli/runtime/refusal-credential-redaction.js +1 -1
- package/dist/cli/runtime/selection.js +1 -1
- package/dist/cli/runtime/telemetry-outcome.js +1 -1
- package/dist/cli/runtime-compatibility-boundary.js +4 -4
- package/dist/cli/schema/registration.js +15 -15
- package/dist/cli/schema-registration-helpers.js +1 -1
- package/dist/cli/search-refresh.js +1 -1
- package/dist/cli/stats-analytics-json.js +1 -1
- package/dist/cli/telemetry-flush.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-2UQU7HRR.js +9 -0
- package/dist/cli-bundle/chunks/chunk-5DUP4AZA.js +2 -0
- package/dist/cli-bundle/chunks/chunk-5WZZ5XEN.js +3 -0
- package/dist/cli-bundle/chunks/chunk-6H36ZHMI.js +2 -0
- package/dist/cli-bundle/chunks/chunk-6MYJLOSG.js +2 -0
- package/dist/cli-bundle/chunks/chunk-AA52P34H.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-B76TFRO2.js → chunk-AEOHUSUI.js} +101 -101
- package/dist/cli-bundle/chunks/chunk-BSRIVYTM.js +8 -0
- package/dist/cli-bundle/chunks/chunk-CFWLQFJM.js +71 -0
- package/dist/cli-bundle/chunks/chunk-D6PDUKUG.js +9 -0
- package/dist/cli-bundle/chunks/chunk-ENKXRSFZ.js +31 -0
- package/dist/cli-bundle/chunks/chunk-F2Z6XLZB.js +3 -0
- package/dist/cli-bundle/chunks/chunk-FJOEL75F.js +2 -0
- package/dist/cli-bundle/chunks/chunk-GDXCAC52.js +2 -0
- package/dist/cli-bundle/chunks/chunk-H7JEXRIN.js +6 -0
- package/dist/cli-bundle/chunks/chunk-J2PDAVBC.js +2 -0
- package/dist/cli-bundle/chunks/chunk-KE7HMBEW.js +2 -0
- package/dist/cli-bundle/chunks/chunk-KZHIBEJL.js +33 -0
- package/dist/cli-bundle/chunks/chunk-NGJ5ERBF.js +115 -0
- package/dist/cli-bundle/chunks/chunk-NQ54T7T2.js +2 -0
- package/dist/cli-bundle/chunks/chunk-O7JHS64G.js +3 -0
- package/dist/cli-bundle/chunks/chunk-OKEZF7HU.js +2 -0
- package/dist/cli-bundle/chunks/chunk-OKIKF4FD.js +2 -0
- package/dist/cli-bundle/chunks/chunk-OPJF254V.js +9 -0
- package/dist/cli-bundle/chunks/chunk-PZA7QECY.js +1 -0
- package/dist/cli-bundle/chunks/chunk-RWA5YZ5X.js +2 -0
- package/dist/cli-bundle/chunks/chunk-S32NGRQM.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SLFRSZK6.js +1 -0
- package/dist/cli-bundle/chunks/chunk-TZY5MVJF.js +125 -0
- package/dist/cli-bundle/chunks/chunk-YYT3MIRF.js +3 -0
- package/dist/cli-bundle/chunks/chunk-ZPS4B6SI.js +8 -0
- package/dist/cli-bundle/chunks/context-budget-recovery-M5RFUEFG.js +2 -0
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-BPYKN5Q7.js +4 -0
- package/dist/cli-bundle/chunks/{item-revision-4QBMZXKX.js → item-revision-FMD4KWBB.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-SEHTH7N2.js +2 -0
- package/dist/cli-bundle/chunks/mutation-actor-SFGYIRPW.js +2 -0
- package/dist/cli-bundle/chunks/mutation-admission-57LBSKQI.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-RR5KACJ3.js → register-list-query-L4IBU64P.js} +11 -11
- package/dist/cli-bundle/chunks/register-mutation-6NUOPHZ3.js +21 -0
- package/dist/cli-bundle/chunks/register-operations-JGYVORNN.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-C44SIXEH.js +2 -0
- package/dist/cli-bundle/chunks/settlement-hook-6MR32OOC.js +7 -0
- package/dist/cli-bundle/chunks/stage-PQ7AB63N.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-6LKTEKHS.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-6LPXMFLM.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-A6VEMCRR.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-AIDL2ZNT.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-BKPUUW5O.js +1 -0
- package/dist/cli-bundle/focused-chunks/chunk-BWOVFE5B.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-HMDQDRV2.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-I66IKYKP.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IIP6LZ5E.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IR2J3NOT.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IROZDIDX.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-ITKDHSBR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-K53OIT5J.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-LQYYPXUK.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-NQTEE66P.js +13 -0
- package/dist/cli-bundle/focused-chunks/chunk-O7Z73ALG.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OTMMOKPM.js +91 -0
- package/dist/cli-bundle/focused-chunks/chunk-OXOCZJC6.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QLAHEDT6.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QQIIMMFU.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIE3SJSE.js +9 -0
- package/dist/cli-bundle/focused-chunks/chunk-TD544C74.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-UFTUNBMY.js +27 -0
- package/dist/cli-bundle/focused-chunks/chunk-X6CXWWNB.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-XRS3VNC6.js +44 -0
- package/dist/cli-bundle/focused-chunks/chunk-XYPEZGTR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Y2ESLKCF.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-YSJKQLFR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Z2X7HH3C.js +102 -0
- package/dist/cli-bundle/focused-chunks/chunk-ZHWPCVQL.js +78 -0
- package/dist/cli-bundle/focused-chunks/context-budget-recovery-CSJV3TY3.js +2 -0
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-EGEJMG3G.js +4 -0
- package/dist/cli-bundle/focused-chunks/{item-revision-2O6MLPEX.js → item-revision-YDACCDVY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/item-transaction-UKEQCTKB.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-actor-AS465LRX.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-admission-E5UHJZFE.js +2 -0
- package/dist/cli-bundle/focused-chunks/settlement-hook-FMLGKG7J.js +7 -0
- package/dist/cli-bundle/focused-chunks/stage-36J7YLGI.js +2 -0
- package/dist/cli-bundle/main.js +27 -27
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +5 -5
- package/dist/cli-bundle/sdk-core.js +1 -1
- 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 +66 -66
- 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 +12 -12
- package/dist/cli.js +1 -1
- package/dist/core/checkpoint/checkpoint-gc.js +1 -1
- package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
- package/dist/core/checkpoint/mutation-context.js +1 -1
- package/dist/core/config/nested-settings.js +1 -1
- package/dist/core/config/positional-value.js +1 -1
- package/dist/core/diagnostics/remediation.js +1 -1
- package/dist/core/extensions/activation-summary-markdown.js +2 -2
- package/dist/core/extensions/activation-summary.js +1 -1
- package/dist/core/extensions/activation-transaction.js +1 -1
- package/dist/core/extensions/capability-usage.js +1 -1
- package/dist/core/extensions/command-hook-context.js +1 -1
- package/dist/core/extensions/command-metadata-contract.js +1 -1
- package/dist/core/extensions/command-visibility-tier.js +1 -1
- package/dist/core/extensions/contribution-inventory.js +1 -1
- package/dist/core/extensions/exporter-output-contract.js +1 -1
- package/dist/core/extensions/extension-candidate.js +1 -1
- package/dist/core/extensions/extension-capability-aliases.js +1 -1
- package/dist/core/extensions/extension-hook-runtime.js +1 -1
- package/dist/core/extensions/extension-policy.js +1 -1
- package/dist/core/extensions/extension-registries.js +1 -1
- package/dist/core/extensions/extension-runtime-helpers.js +1 -1
- package/dist/core/extensions/extension-types.js +1 -1
- package/dist/core/extensions/flag-definition-validation.js +1 -1
- package/dist/core/extensions/flag-value-types.js +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/item-field-types.js +1 -1
- package/dist/core/extensions/item-fields.js +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/manifest-parser.js +1 -1
- package/dist/core/extensions/manifest-schema.js +1 -1
- package/dist/core/extensions/module-graph-snapshot.js +1 -1
- package/dist/core/extensions/mutation-actor-snapshot.js +1 -1
- package/dist/core/extensions/mutation-actor.js +1 -1
- package/dist/core/extensions/preflight-ownership.js +1 -1
- package/dist/core/extensions/read-output-contract.js +1 -1
- package/dist/core/extensions/registration-contracts.js +1 -1
- package/dist/core/extensions/registration-validation.js +1 -1
- package/dist/core/extensions/registration-values.js +1 -1
- package/dist/core/extensions/reserved-host-flags.js +1 -1
- package/dist/core/extensions/runtime-registrations.js +1 -1
- package/dist/core/extensions/service-ownership.js +1 -1
- package/dist/core/extensions/version-compat.js +1 -1
- package/dist/core/extensions/version-diagnostics.js +1 -1
- package/dist/core/fs/atomic-create.js +1 -1
- package/dist/core/fs/file-glob.js +1 -1
- package/dist/core/fs/fs-utils.js +2 -2
- package/dist/core/fs/host-environment-errors.js +1 -1
- package/dist/core/fs/index.js +1 -1
- package/dist/core/fs/path-utils.js +1 -1
- package/dist/core/governance/content-fields.js +1 -1
- package/dist/core/governance/issue-codes.js +1 -1
- package/dist/core/governance/metadata-coverage.js +1 -1
- package/dist/core/history/bridge.js +1 -1
- package/dist/core/history/digest.js +1 -1
- package/dist/core/history/drift-cache.js +3 -3
- package/dist/core/history/drift-scan.js +1 -1
- package/dist/core/history/event-classification.js +1 -1
- package/dist/core/history/event-index.js +11 -11
- package/dist/core/history/history-compact-bulk.js +1 -1
- package/dist/core/history/history-diff.js +1 -1
- package/dist/core/history/history-rewrite.js +1 -1
- package/dist/core/history/history-storage-stats.js +1 -1
- package/dist/core/history/history-stream-policy.js +1 -1
- package/dist/core/history/history.js +2 -2
- package/dist/core/history/identity.js +1 -1
- package/dist/core/history/index.js +1 -1
- package/dist/core/history/operation-contract.js +1 -1
- package/dist/core/history/projection.js +1 -1
- package/dist/core/history/read.js +1 -1
- package/dist/core/history/replay.js +2 -2
- package/dist/core/history/stream-summary.js +2 -2
- package/dist/core/history/tombstone.js +1 -1
- package/dist/core/history/version-address.js +1 -1
- package/dist/core/history/workspace-history.js +2 -2
- package/dist/core/io/body-file.js +1 -1
- package/dist/core/io/bulk-ids-input.js +2 -2
- package/dist/core/item/actionability.js +1 -1
- package/dist/core/item/deferred-fields.js +1 -1
- package/dist/core/item/dependency-reference.js +1 -1
- package/dist/core/item/id.js +1 -1
- package/dist/core/item/index.js +1 -1
- package/dist/core/item/item-format-version.js +1 -1
- package/dist/core/item/item-format.js +7 -7
- package/dist/core/item/item-record.js +1 -1
- package/dist/core/item/item-type-definition.js +1 -1
- package/dist/core/item/literal-mutation-input.js +1 -1
- package/dist/core/item/parent-reference-policy.js +1 -1
- package/dist/core/item/parse.js +8 -8
- package/dist/core/item/plan-lifecycle.js +1 -1
- package/dist/core/item/priority.js +1 -1
- package/dist/core/item/sprint-release-format.js +1 -1
- package/dist/core/item/status-filter.js +1 -1
- package/dist/core/item/status.js +1 -1
- package/dist/core/item/toon-decode.js +1 -1
- package/dist/core/item/type-registry.js +1 -1
- package/dist/core/item/type-synonyms.js +1 -1
- package/dist/core/lock/index.js +1 -1
- package/dist/core/lock/lock-confinement.js +1 -1
- package/dist/core/lock/lock-gc.js +1 -1
- package/dist/core/lock/lock-owner.js +1 -1
- package/dist/core/lock/lock.js +4 -4
- package/dist/core/output/linked-test-projection.js +5 -5
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/output/output-control.js +1 -1
- package/dist/core/output/output.js +19 -19
- package/dist/core/output/query-summary.js +1 -1
- package/dist/core/output/tabular.js +3 -3
- package/dist/core/packages/manifest.js +1 -1
- package/dist/core/packages/root.js +1 -1
- package/dist/core/policy/workflow-policy-schema.js +1 -1
- package/dist/core/policy/workflow-policy-store.js +1 -1
- package/dist/core/policy/workflow-policy.js +1 -1
- package/dist/core/profile/profile-describe.js +1 -1
- package/dist/core/profile/profile-lint.d.ts +1 -1
- package/dist/core/profile/profile-lint.js +1 -1
- package/dist/core/profile/profile-plan.js +1 -1
- package/dist/core/profile/profile-presets.js +4 -4
- package/dist/core/reproducibility/context.js +1 -1
- package/dist/core/schema/fields-file.js +2 -2
- package/dist/core/schema/item-types-file.js +2 -2
- package/dist/core/schema/runtime-field-filters.js +1 -1
- package/dist/core/schema/runtime-field-values.js +1 -1
- package/dist/core/schema/runtime-schema.js +2 -2
- package/dist/core/schema/status-defs-file.js +2 -2
- package/dist/core/schema/status-token.js +1 -1
- package/dist/core/schema/type-inference.js +1 -1
- package/dist/core/schema/type-presets.js +1 -1
- package/dist/core/schema/type-workflows.js +1 -1
- package/dist/core/search/background-refresh.js +2 -2
- package/dist/core/search/bm25.js +1 -1
- package/dist/core/search/cache.js +2 -2
- package/dist/core/search/corpus.js +1 -1
- package/dist/core/search/embedding-batches.js +1 -1
- package/dist/core/search/eval-thresholds.js +1 -1
- package/dist/core/search/eval.js +1 -1
- package/dist/core/search/http-client.js +1 -1
- package/dist/core/search/providers.js +1 -1
- package/dist/core/search/relevance.js +1 -1
- package/dist/core/search/semantic-defaults.js +1 -1
- package/dist/core/search/staleness.js +1 -1
- package/dist/core/search/vector-stores.js +2 -2
- package/dist/core/search/vectorization-metadata.js +1 -1
- package/dist/core/sentry/helpers.js +1 -1
- package/dist/core/sentry/instrument.js +1 -1
- package/dist/core/sentry/sensitive-assignments.js +1 -1
- package/dist/core/session/session-state.js +1 -1
- package/dist/core/shared/agent-session-context.js +1 -1
- package/dist/core/shared/author.js +5 -5
- package/dist/core/shared/command-line.js +1 -1
- package/dist/core/shared/command-types.js +0 -1
- package/dist/core/shared/conflict-markers.js +1 -1
- package/dist/core/shared/constants.js +1 -1
- package/dist/core/shared/error-details.js +1 -1
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/shared/html-entity-decode.js +1 -1
- package/dist/core/shared/index.js +1 -1
- package/dist/core/shared/item-metadata-contract.js +1 -1
- package/dist/core/shared/lazy-module.js +1 -1
- package/dist/core/shared/levenshtein.js +1 -1
- package/dist/core/shared/memo.js +1 -1
- package/dist/core/shared/numeric-parsers.js +1 -1
- package/dist/core/shared/option-alias-visibility.js +1 -1
- package/dist/core/shared/output-unicode.js +1 -1
- package/dist/core/shared/primitives.js +1 -1
- package/dist/core/shared/process-tree.js +2 -2
- package/dist/core/shared/secret-rules.js +5 -5
- package/dist/core/shared/serial-queue.js +1 -1
- package/dist/core/shared/serialization.js +1 -1
- package/dist/core/shared/split-comma-list.js +1 -1
- package/dist/core/shared/text-normalization.js +1 -1
- package/dist/core/shared/time.js +2 -2
- package/dist/core/shared/url-credentials.js +1 -1
- package/dist/core/store/index.js +1 -1
- package/dist/core/store/item-format-migration.js +1 -1
- package/dist/core/store/item-metadata-cache.js +1 -1
- package/dist/core/store/item-metadata-query-index.js +11 -11
- package/dist/core/store/item-metadata-read-work.js +1 -1
- package/dist/core/store/item-mutation-precondition.js +1 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/store/paths.js +1 -1
- package/dist/core/store/settings-concurrency.js +1 -1
- package/dist/core/store/settings-read-cache.js +1 -1
- package/dist/core/store/settings-sections.js +2 -2
- package/dist/core/store/settings-validator.js +1 -1
- package/dist/core/store/settings.d.ts +3 -1
- package/dist/core/store/settings.js +6 -6
- package/dist/core/store/sqlite-runtime.js +1 -1
- package/dist/core/store/tracker-preflight.js +1 -1
- package/dist/core/store/transaction-coordinator-scope.js +1 -1
- package/dist/core/telemetry/consent.js +3 -3
- package/dist/core/telemetry/observability.js +1 -1
- package/dist/core/telemetry/policy.js +1 -1
- package/dist/core/telemetry/read-sampling.js +2 -2
- package/dist/core/telemetry/runtime.js +9 -9
- package/dist/core/test/background-runs.js +4 -4
- package/dist/core/test/item-test-run-tracking.js +1 -1
- package/dist/core/test/run-selectors.js +1 -1
- package/dist/core/validate/estimate-defaults.js +1 -1
- package/dist/core/validate/fix-planning.js +1 -1
- package/dist/core/validate/linked-artifact-reference.js +1 -1
- package/dist/core/validate/missing-by-type.js +1 -1
- package/dist/core/validate/missing-link-owners.js +1 -1
- package/dist/core/validate/stale-file-classification.js +1 -1
- package/dist/mcp/http-server.js +5 -5
- package/dist/mcp/legacy-adapter.js +1 -1
- package/dist/mcp/runtime-capabilities.js +1 -1
- package/dist/mcp/server.js +4 -4
- package/dist/mcp/tool-definitions.js +1 -1
- package/dist/sdk/actionability.js +1 -1
- package/dist/sdk/agent/closed-domain-contracts.js +1 -1
- package/dist/sdk/agent/command-recovery.js +1 -1
- package/dist/sdk/agent/command-suggestions.js +1 -1
- package/dist/sdk/agent/create-option-policy.js +1 -1
- package/dist/sdk/agent/identity-config.js +1 -1
- package/dist/sdk/agent/item-addressing.js +1 -1
- package/dist/sdk/agent/linked-resource-recovery.js +1 -1
- package/dist/sdk/agent/refusal-closure-census.js +2 -2
- package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
- package/dist/sdk/agent/subcommand-recovery.js +1 -1
- package/dist/sdk/agent-capability-contracts.js +3 -3
- package/dist/sdk/agent-session-context.js +1 -1
- package/dist/sdk/annotations.js +1 -1
- package/dist/sdk/author-attribution.js +1 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/agent-output-contracts.js +5 -5
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +1 -1
- package/dist/sdk/cli-contracts/completeness.js +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +2 -2
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/registration-helpers.js +7 -7
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -1
- package/dist/sdk/cli-contracts/string-lists.js +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.js +0 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/cli-program.js +1 -1
- package/dist/sdk/command-line.js +1 -1
- package/dist/sdk/comments.js +1 -1
- package/dist/sdk/compile-cache.js +1 -1
- package/dist/sdk/completion/bash.js +2 -2
- package/dist/sdk/completion/fish.js +72 -72
- package/dist/sdk/completion/shared.js +1 -1
- package/dist/sdk/completion/zsh.js +75 -75
- package/dist/sdk/completion.js +1 -1
- package/dist/sdk/config.js +1 -1
- package/dist/sdk/context/recency.js +1 -1
- package/dist/sdk/context/semantic-session-attribution.js +1 -1
- package/dist/sdk/context/usage-egress.js +1 -1
- package/dist/sdk/context/usage-ledger.js +6 -6
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/context-intent-runtime.js +1 -1
- package/dist/sdk/context-packing.js +1 -1
- package/dist/sdk/context-relevance.js +1 -1
- package/dist/sdk/context-signal-store.js +2 -2
- package/dist/sdk/context-usage.js +1 -1
- package/dist/sdk/dependencies/context-budget-recovery.js +1 -1
- package/dist/sdk/dependencies.js +1 -1
- package/dist/sdk/dependency-flag-validation.js +1 -1
- package/dist/sdk/dependency-provenance.js +1 -1
- package/dist/sdk/docs.js +1 -1
- package/dist/sdk/duplicates.js +1 -1
- package/dist/sdk/environment/host-environment-errors.js +1 -1
- package/dist/sdk/environment/project-runtime-compatibility.js +2 -2
- package/dist/sdk/environment/source-context.js +1 -1
- package/dist/sdk/environment/tracker-preflight.js +1 -1
- package/dist/sdk/error-code-catalog.js +1 -1
- package/dist/sdk/error-runtime.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/eval.js +1 -1
- package/dist/sdk/extension/author-manifest.js +1 -1
- package/dist/sdk/extension/bundled-catalog.js +1 -1
- package/dist/sdk/extension/command-options.js +1 -1
- package/dist/sdk/extension/concurrency.js +1 -1
- package/dist/sdk/extension/copy-scope.js +1 -1
- package/dist/sdk/extension/custom-field-collisions.js +1 -1
- package/dist/sdk/extension/describe.js +3 -3
- package/dist/sdk/extension/doctor.js +1 -1
- package/dist/sdk/extension/install-plan.js +1 -1
- package/dist/sdk/extension/install-receipts.js +1 -1
- package/dist/sdk/extension/install-runtime.js +3 -3
- package/dist/sdk/extension/install-snapshot.js +1 -1
- package/dist/sdk/extension/install-sources.js +5 -5
- package/dist/sdk/extension/managed-state.js +2 -2
- package/dist/sdk/extension/managed-update-status.js +1 -1
- package/dist/sdk/extension/migrations.js +2 -2
- package/dist/sdk/extension/native-command-options.js +1 -1
- package/dist/sdk/extension/output-ownership.js +1 -1
- package/dist/sdk/extension/runtime-summary.js +1 -1
- package/dist/sdk/extension/scaffold.js +11 -11
- package/dist/sdk/extension/shared.js +1 -1
- package/dist/sdk/extension/source-resolution.js +1 -1
- package/dist/sdk/extension/static-inventory.js +1 -1
- package/dist/sdk/extension/update-check.js +1 -1
- package/dist/sdk/extension-command-context.js +2 -2
- package/dist/sdk/extension-contracts.js +1 -1
- package/dist/sdk/extension.js +1 -1
- package/dist/sdk/files.js +1 -1
- package/dist/sdk/flag-invocation-contracts.js +1 -1
- package/dist/sdk/generated/error-code-catalog-rows.js +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.js +1 -1
- package/dist/sdk/generated-error-code-catalog.js +1 -1
- package/dist/sdk/governance/assurance-action-contracts.js +0 -1
- package/dist/sdk/governance/assurance-action.js +1 -1
- package/dist/sdk/governance/assurance-limits.js +1 -1
- package/dist/sdk/governance/assurance-mutation-error.js +1 -1
- package/dist/sdk/governance/assurance-presets.js +1 -1
- package/dist/sdk/governance/assurance-runtime.js +1 -1
- package/dist/sdk/governance/assurance.js +4 -4
- package/dist/sdk/governance/boundary-fixtures.js +1 -1
- package/dist/sdk/governance/closure-timestamps.js +1 -1
- package/dist/sdk/governance/defect-recurrence-coverage.js +1 -1
- package/dist/sdk/governance/defect-recurrence-graph.js +1 -1
- package/dist/sdk/governance/defect-recurrence-signals.js +1 -1
- package/dist/sdk/governance/defect-recurrence.js +2 -2
- package/dist/sdk/governance/extension-host-version.js +1 -1
- package/dist/sdk/governance/gc.js +1 -1
- package/dist/sdk/governance/health/history-drift-remedies.js +1 -1
- package/dist/sdk/governance/health/projection.js +1 -1
- package/dist/sdk/governance/health-merge-evidence.js +1 -1
- package/dist/sdk/governance/health.js +2 -2
- package/dist/sdk/governance/hierarchy-validation.js +1 -1
- package/dist/sdk/governance/in-progress-work-health.js +1 -1
- package/dist/sdk/governance/lifecycle-dependency-cycles.js +1 -1
- package/dist/sdk/governance/linked-file-report.js +1 -1
- package/dist/sdk/governance/merge-receipt-history.js +1 -1
- package/dist/sdk/governance/provenance-health.js +4 -4
- package/dist/sdk/governance/reindex.js +5 -5
- package/dist/sdk/governance/stale-work.js +1 -1
- package/dist/sdk/governance/status-role-diagnostics.js +1 -1
- package/dist/sdk/governance/storage-integrity.js +1 -1
- package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
- package/dist/sdk/governance/upgrade.js +2 -2
- package/dist/sdk/governance/validate-deferred-fields.js +1 -1
- package/dist/sdk/governance/validate-history-drift.js +1 -1
- package/dist/sdk/governance/validate-item-reader.js +1 -1
- package/dist/sdk/governance/validate-normalization.js +1 -1
- package/dist/sdk/governance/validate.js +1 -1
- package/dist/sdk/governance/workflow-completeness.js +1 -1
- package/dist/sdk/governance/workflow-policy.js +3 -3
- package/dist/sdk/governance/workspace-position.js +2 -2
- package/dist/sdk/graph/analytics.js +1 -1
- package/dist/sdk/graph/assembly.js +1 -1
- package/dist/sdk/graph/cache.js +1 -1
- package/dist/sdk/graph/cardinality-integrity.js +1 -1
- package/dist/sdk/graph/centrality.js +1 -1
- package/dist/sdk/graph/deadline-scheduling.js +1 -1
- package/dist/sdk/graph/durable-cache.js +1 -1
- package/dist/sdk/graph/governance-contracts.js +1 -1
- package/dist/sdk/graph/governance.js +1 -1
- package/dist/sdk/graph/hierarchy-integrity.js +1 -1
- package/dist/sdk/graph/lifecycle-coverage.js +1 -1
- package/dist/sdk/graph/mutation-advisory.js +1 -1
- package/dist/sdk/graph/query-contracts.js +1 -1
- package/dist/sdk/graph/remediation.js +1 -1
- package/dist/sdk/graph/run.js +1 -1
- package/dist/sdk/graph/scheduling.js +1 -1
- package/dist/sdk/graph/traversal.js +1 -1
- package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -1
- package/dist/sdk/guide-topics.js +1 -1
- package/dist/sdk/guide.js +7 -7
- package/dist/sdk/history/append-only-repair.js +4 -4
- package/dist/sdk/history/attestation-command.js +2 -2
- package/dist/sdk/history/attestation-contract.js +1 -1
- package/dist/sdk/history/attestation-scan.js +1 -1
- package/dist/sdk/history/attestation.js +1 -1
- package/dist/sdk/history/maintenance.js +1 -1
- package/dist/sdk/history/reanchor-refusal.js +1 -1
- package/dist/sdk/history/reseed.js +1 -1
- package/dist/sdk/history/salvage.js +5 -5
- package/dist/sdk/history/subject.js +1 -1
- package/dist/sdk/history-analytics.js +1 -1
- package/dist/sdk/history-compact.js +1 -1
- package/dist/sdk/history-mcp.js +1 -1
- package/dist/sdk/history-provenance.js +1 -1
- package/dist/sdk/history-read.js +1 -1
- package/dist/sdk/history-redact.js +1 -1
- package/dist/sdk/history-repair.js +1 -1
- package/dist/sdk/improvement-ledger-validation.js +1 -1
- package/dist/sdk/improvement-ledger.js +2 -2
- package/dist/sdk/init-agent-guidance.js +10 -10
- package/dist/sdk/init.js +14 -14
- package/dist/sdk/invocation-author.js +1 -1
- package/dist/sdk/item-children.js +1 -1
- package/dist/sdk/item-metadata-index.js +1 -1
- package/dist/sdk/item-schedule.js +1 -1
- package/dist/sdk/item-transaction.js +1 -1
- package/dist/sdk/learnings.js +1 -1
- package/dist/sdk/lifecycle/append.js +3 -3
- package/dist/sdk/lifecycle/checkpoint-rollback.js +1 -1
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/cli-input.js +1 -1
- package/dist/sdk/lifecycle/close-many.js +1 -1
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/copy.js +1 -1
- package/dist/sdk/lifecycle/core-field-recovery.js +1 -1
- package/dist/sdk/lifecycle/core-item-fields.js +1 -1
- package/dist/sdk/lifecycle/create-deferrals.js +1 -1
- package/dist/sdk/lifecycle/create.js +1 -1
- package/dist/sdk/lifecycle/delete.js +1 -1
- package/dist/sdk/lifecycle/dependency-removal.js +1 -1
- package/dist/sdk/lifecycle/event-validation-messages.js +1 -1
- package/dist/sdk/lifecycle/focus.js +1 -1
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
- package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
- package/dist/sdk/lifecycle/mcp-actions.js +1 -1
- package/dist/sdk/lifecycle/metadata-normalizers.js +1 -1
- package/dist/sdk/lifecycle/mutation-command-options.js +0 -1
- package/dist/sdk/lifecycle/mutation-facet-contracts.js +1 -1
- package/dist/sdk/lifecycle/mutation-option-validation.js +1 -1
- package/dist/sdk/lifecycle/plan-mutation-receipt.js +1 -1
- package/dist/sdk/lifecycle/plan.js +1 -1
- package/dist/sdk/lifecycle/recurrence-parsers.js +1 -1
- package/dist/sdk/lifecycle/release-handoff.js +1 -1
- package/dist/sdk/lifecycle/reopen.js +1 -1
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +2 -2
- package/dist/sdk/lifecycle/repeated-terminal-state.js +1 -1
- package/dist/sdk/lifecycle/restore.js +1 -1
- package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
- package/dist/sdk/lifecycle/start-blockers.js +1 -1
- package/dist/sdk/lifecycle/structured-mutation-plan.js +1 -1
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/lifecycle/update-many.js +1 -1
- package/dist/sdk/lifecycle/update.js +2 -2
- package/dist/sdk/lifecycle/workflow-transition.js +1 -1
- package/dist/sdk/lifecycle-completion.js +1 -1
- package/dist/sdk/lifecycle-policy.js +1 -1
- package/dist/sdk/linked-artifacts.js +2 -2
- package/dist/sdk/mcp/apps.js +5 -5
- package/dist/sdk/mcp/authorization.js +1 -1
- package/dist/sdk/mcp/discovery.js +1 -1
- package/dist/sdk/mcp/executable.js +4 -4
- package/dist/sdk/mcp/interactions.js +1 -1
- package/dist/sdk/mcp/protocol.js +1 -1
- package/dist/sdk/mcp/skills.js +3 -3
- package/dist/sdk/mcp/subscriptions.js +1 -1
- package/dist/sdk/mcp/tasks.js +2 -2
- package/dist/sdk/mcp/transport.js +1 -1
- package/dist/sdk/merge/abandoned-receipts.js +1 -1
- package/dist/sdk/merge/driver.js +7 -7
- package/dist/sdk/merge/history-scalar-rebase.js +1 -1
- package/dist/sdk/merge/ignored-artifacts.js +1 -1
- package/dist/sdk/merge/index.js +1 -1
- package/dist/sdk/merge/indexed-receipt-blobs.js +2 -2
- package/dist/sdk/merge/install.js +6 -6
- package/dist/sdk/merge/receipt-file-boundary.js +1 -1
- package/dist/sdk/merge/receipt-operation.js +1 -1
- package/dist/sdk/merge/receipt-schema.js +1 -1
- package/dist/sdk/merge/receipts.js +4 -4
- package/dist/sdk/merge/reconcile.js +1 -1
- package/dist/sdk/merge/settlement-hook.js +4 -4
- package/dist/sdk/merge/stage.js +1 -1
- package/dist/sdk/merge/three-way.js +9 -9
- package/dist/sdk/merge/worktree-config.js +2 -2
- package/dist/sdk/merge.js +1 -1
- package/dist/sdk/mutation-events.js +1 -1
- package/dist/sdk/mutation-guard.js +1 -1
- package/dist/sdk/notes.js +1 -1
- package/dist/sdk/output/fit-envelope.js +1 -1
- package/dist/sdk/output/list-envelope.js +1 -1
- package/dist/sdk/output/table-rows.js +1 -1
- package/dist/sdk/output-contracts.js +1 -1
- package/dist/sdk/output-projection.js +1 -1
- package/dist/sdk/output-token-accounting.js +1 -1
- package/dist/sdk/output.js +2 -2
- package/dist/sdk/ownership-source.js +1 -1
- package/dist/sdk/package-import-adapters.js +1 -1
- package/dist/sdk/package-migrations.js +1 -1
- package/dist/sdk/package-runtime-options.js +1 -1
- package/dist/sdk/pagination.js +1 -1
- package/dist/sdk/profile.js +5 -5
- package/dist/sdk/provenance.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.js +1 -1
- package/dist/sdk/query/aggregate.js +1 -1
- package/dist/sdk/query/calendar.js +4 -4
- package/dist/sdk/query/complete-list.js +1 -1
- package/dist/sdk/query/context.js +2 -2
- package/dist/sdk/query/declared-blockers.js +1 -1
- package/dist/sdk/query/duplicate-candidates.js +1 -1
- package/dist/sdk/query/get-facet-roots.js +1 -1
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/history.js +1 -1
- package/dist/sdk/query/item-filter-options.js +0 -1
- package/dist/sdk/query/light-metadata.js +1 -1
- package/dist/sdk/query/list-filter-shared.js +1 -1
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/query/multi-value-filters.js +1 -1
- package/dist/sdk/query/next-ranking-policy.js +1 -1
- package/dist/sdk/query/next-ready-budget.js +1 -1
- package/dist/sdk/query/next.js +2 -2
- package/dist/sdk/query/parsers.js +1 -1
- package/dist/sdk/query/projection-contracts.js +1 -1
- package/dist/sdk/query/search/corpus.js +2 -2
- package/dist/sdk/query/search/filters.js +1 -1
- package/dist/sdk/query/search/input.js +1 -1
- package/dist/sdk/query/search/lexical.js +1 -1
- package/dist/sdk/query/search/response.js +1 -1
- package/dist/sdk/query/search/semantic.js +3 -3
- package/dist/sdk/query/search/types.js +0 -1
- package/dist/sdk/query/search-contracts.js +1 -1
- package/dist/sdk/query/search-pagination.js +1 -1
- package/dist/sdk/query/search-rendering.js +1 -1
- package/dist/sdk/query/search.js +1 -1
- package/dist/sdk/query/window-pagination.js +1 -1
- package/dist/sdk/query/workspace-contracts.js +1 -1
- package/dist/sdk/read-output/continuation.js +1 -1
- package/dist/sdk/read-output/extension.js +1 -1
- package/dist/sdk/read-output/options.js +1 -1
- package/dist/sdk/read-output/positional-rows.js +1 -1
- package/dist/sdk/read-output/provenance.js +1 -1
- package/dist/sdk/read-output/session-result.js +0 -1
- package/dist/sdk/read-output/surfaces.js +1 -1
- package/dist/sdk/read-output/tail-retention.js +1 -1
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.js +1 -1
- package/dist/sdk/read-output-session.js +1 -1
- package/dist/sdk/relationship-analytics.js +1 -1
- package/dist/sdk/relationship-context.js +1 -1
- package/dist/sdk/relationship-history.js +6 -6
- package/dist/sdk/relationship-kinds/contract.js +1 -1
- package/dist/sdk/relationships.js +1 -1
- package/dist/sdk/reproducibility/process.js +1 -1
- package/dist/sdk/runtime/actions.js +1 -1
- package/dist/sdk/runtime/context.js +1 -1
- package/dist/sdk/runtime/mutation-admission.js +1 -1
- package/dist/sdk/runtime/mutation-value-validation.js +1 -1
- package/dist/sdk/runtime/schema-preview.js +1 -1
- package/dist/sdk/runtime/schema.js +1 -1
- package/dist/sdk/runtime-action-aliases.js +1 -1
- package/dist/sdk/runtime-extended-actions.js +1 -1
- package/dist/sdk/runtime-input.d.ts +2 -0
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime-public-contracts.js +0 -1
- package/dist/sdk/runtime-stats-options.js +1 -1
- package/dist/sdk/runtime.d.ts +5 -3
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/scheduling-shortcuts.js +1 -1
- package/dist/sdk/schema/field-option-collisions.js +2 -0
- package/dist/sdk/schema-migration.js +4 -4
- package/dist/sdk/schema.js +7 -7
- package/dist/sdk/search-refresh-worker.js +1 -1
- package/dist/sdk/similarity-scoring.js +1 -1
- package/dist/sdk/similarity.js +1 -1
- package/dist/sdk/start-task-status.js +1 -1
- package/dist/sdk/stats.js +1 -1
- package/dist/sdk/structured-mutations.js +1 -1
- package/dist/sdk/telemetry-flush.js +1 -1
- package/dist/sdk/telemetry.js +4 -4
- package/dist/sdk/templates.js +3 -3
- package/dist/sdk/test/batch.js +2 -2
- package/dist/sdk/test/command-args.js +1 -1
- package/dist/sdk/test/command-resolution.js +2 -2
- package/dist/sdk/test/entry.js +2 -2
- package/dist/sdk/test/execution-receipts.js +2 -2
- package/dist/sdk/test/execution.js +5 -5
- package/dist/sdk/test/json-path.js +1 -1
- package/dist/sdk/test/linked-command-detection.js +1 -1
- package/dist/sdk/test/measurements.js +1 -1
- package/dist/sdk/test/parsers.js +1 -1
- package/dist/sdk/test/prerequisites.js +1 -1
- package/dist/sdk/test/receipt-index-snapshot.js +1 -1
- package/dist/sdk/test/run-phases.js +1 -1
- package/dist/sdk/test/runs.js +1 -1
- package/dist/sdk/test/trust.js +2 -2
- package/dist/sdk/test/update.js +1 -1
- package/dist/sdk/test/workspace-snapshot.js +1 -1
- package/dist/sdk/traceability/runtime-files-lookup.js +1 -1
- package/dist/sdk/traceability/source-traceability.js +2 -2
- package/dist/sdk/tracker-root-discovery.js +1 -1
- package/dist/sdk/transactions/item-finalization.js +1 -1
- package/dist/sdk/workspace-contracts-cache.js +1 -1
- package/dist/sdk/workspace-contracts.js +1 -1
- package/dist/sdk/workspace-memory.js +2 -2
- package/dist/sdk/workspace-snapshot.js +5 -5
- package/dist/sdk/workspace-transaction-gc.js +1 -1
- package/dist/sdk/workspace-transaction.js +2 -2
- package/dist/sdk/workspace.js +6 -6
- package/dist/types/index.js +1 -1
- package/dist/types.js +1 -1
- package/docs/COMMANDS.md +1 -1
- package/docs/EXTENSIONS.md +1 -1
- package/docs/SDK.md +74 -4
- package/marketplace.json +1 -1
- package/package.json +2 -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 +63 -24
- package/scripts/prepare-build-cache.mjs +28 -1
- package/dist/cli-bundle/chunks/chunk-3W47ZZ5T.js +0 -9
- package/dist/cli-bundle/chunks/chunk-4TB5D6HL.js +0 -125
- package/dist/cli-bundle/chunks/chunk-5ZMVLWE3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-6BBDEIKC.js +0 -33
- package/dist/cli-bundle/chunks/chunk-AR4NP5HI.js +0 -3
- package/dist/cli-bundle/chunks/chunk-B4PPFOPY.js +0 -3
- package/dist/cli-bundle/chunks/chunk-CAR2L5NW.js +0 -8
- package/dist/cli-bundle/chunks/chunk-DEZPZOQ7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-EIGUKEV6.js +0 -2
- package/dist/cli-bundle/chunks/chunk-GTPCAJMZ.js +0 -8
- package/dist/cli-bundle/chunks/chunk-GYP24M7W.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HC2OPETM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HKUV74K3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HXHYDO2R.js +0 -115
- package/dist/cli-bundle/chunks/chunk-IB7UB5TE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J2LABXBL.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J52BEBSS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KQIZ34SF.js +0 -3
- package/dist/cli-bundle/chunks/chunk-LQBWLNZJ.js +0 -3
- package/dist/cli-bundle/chunks/chunk-OJTMGDON.js +0 -31
- package/dist/cli-bundle/chunks/chunk-SPPHDVZE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TC6XLIYO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-U7EL3AYA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-VQFWW4EF.js +0 -6
- package/dist/cli-bundle/chunks/chunk-X6MIWTTT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XC5Q2ZV7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XFHPKXAE.js +0 -71
- package/dist/cli-bundle/chunks/chunk-YHVLVSEZ.js +0 -9
- package/dist/cli-bundle/chunks/chunk-YMUSRWV4.js +0 -9
- package/dist/cli-bundle/chunks/chunk-YR2KEBHP.js +0 -2
- package/dist/cli-bundle/chunks/context-budget-recovery-L2WP5S26.js +0 -2
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-ITTXIN4K.js +0 -4
- package/dist/cli-bundle/chunks/item-transaction-QY3PUHEI.js +0 -2
- package/dist/cli-bundle/chunks/mutation-actor-FWLYWJ37.js +0 -2
- package/dist/cli-bundle/chunks/mutation-admission-7ZDCK3G2.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-57AJQWFV.js +0 -21
- package/dist/cli-bundle/chunks/register-operations-RKWST7CU.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-CMI23PC5.js +0 -2
- package/dist/cli-bundle/chunks/settlement-hook-BXN5LEQD.js +0 -7
- package/dist/cli-bundle/chunks/stage-4KDVXC5Z.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2ZD7275J.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-324AHXJO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3IRCYJI5.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-3V53UBHN.js +0 -9
- package/dist/cli-bundle/focused-chunks/chunk-3XSWH6QC.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-4JZITIJB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4KTFKSS3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5C5TK3ET.js +0 -78
- package/dist/cli-bundle/focused-chunks/chunk-AKJYOZZP.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-BRZV7BFV.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-C3O6JJPO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CR7CGEB2.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-EGN2HFRU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-GHQVM6K6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HDEKFSOK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-I5LGPUWH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IWOXAUDU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ML3JHCC6.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-OPGOOP25.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-RE7ZWT7D.js +0 -27
- package/dist/cli-bundle/focused-chunks/chunk-RKQNVYGF.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-RQ252B6V.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-SVOOGGAK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-URGHTTT3.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-USPYKWQG.js +0 -13
- package/dist/cli-bundle/focused-chunks/chunk-UWS3FC4D.js +0 -102
- package/dist/cli-bundle/focused-chunks/chunk-UXQGFGAT.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-WZWXGDYY.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-YKSLZPLT.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZWJTY4ID.js +0 -2
- package/dist/cli-bundle/focused-chunks/context-budget-recovery-5MKOCGY5.js +0 -2
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-AF4U3F3D.js +0 -4
- package/dist/cli-bundle/focused-chunks/item-transaction-GLACUTPL.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-actor-TCYDPUGG.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-LY73EJWM.js +0 -2
- package/dist/cli-bundle/focused-chunks/settlement-hook-ARYCZQY4.js +0 -7
- package/dist/cli-bundle/focused-chunks/stage-DQ7RQQ52.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ja as s,ka as u,qb as g}from"./chunk-TZY5MVJF.js";import{I as x,v as h}from"./chunk-2UQU7HRR.js";import{Ka as I,Sa as y,Ya as i,pj as w}from"./chunk-NGJ5ERBF.js";import{A as d,C as p,E as l}from"./chunk-YYT3MIRF.js";async function D(r){let t=y(process.cwd(),r);await x(t);let o=await h(t),a=I(o,w());return{pmRoot:t,settings:o,typeRegistry:a}}async function S(r,t,o,a){i(r,s(t));let e=await g(r,t,o.id_prefix,o.item_format,a);if(e)return{id:e.id,historyPath:i(r,e.id),located:e};let m=u(t,o.id_prefix),n=s(t),v=m===n?[m]:[m,n];for(let c of v){let f=i(r,c);if(await l(f))return{id:c,historyPath:f,located:null}}throw new p(`Item ${t} not found`,d.NOT_FOUND)}export{D as a,S as b};
|
|
2
|
+
//# sourceMappingURL=chunk-NQ54T7T2.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{d as _,f as p,j as m,l as f}from"./chunk-OPJF254V.js";import{Pg as c}from"./chunk-NGJ5ERBF.js";var g="not-a-declared-intent",i="not-a-declared-field";function y(){let t={get:["pm-domain"],search:["Domain query"]},r=[...new Set(c.map(({command:e})=>e))].map(e=>{let n=c.filter(d=>d.command===e),s=n[0],u=t[s.command]??[];return{probe_id:`${s.command}-invalid-intent`,command:s.command,flag:"--for",rejected_value:g,refusal_args:[s.command,...u,"--for",g],allowed_values:n.map(({intent:d})=>d).sort(),suggested_retry_args:[s.command,...u,"--for",s.intent],error_code:"unknown_context_intent"}}),l=p(),o=Object.keys(_).map(e=>({probe_id:`${e}-invalid-field`,command:e,flag:"--fields",rejected_value:i,refusal_args:[e,"--fields",i],allowed_values:l,suggested_retry_args:[e,"--fields","id,title,status"],error_code:"unknown_field_projection"}));return[...r,...o,{probe_id:"get-invalid-field",command:"get",flag:"--fields",rejected_value:i,refusal_args:["get","pm-domain","--fields",i],allowed_values:m(),suggested_retry_args:["get","pm-domain","--fields","id,title,status"],error_code:"unknown_field_projection"},{probe_id:"list-mutually-exclusive-projection",command:"list",flag:"--projection",rejected_value:"--brief+--full",refusal_args:["list","--brief","--full"],allowed_values:[],suggested_retry_args:["list","--brief"],error_code:"projection_options_mutually_exclusive",allowed_values_required:!1},{probe_id:"get-mutually-exclusive-projection",command:"get",flag:"--projection",rejected_value:"--full+--fields",refusal_args:["get","pm-domain","--full","--fields","id"],allowed_values:[],suggested_retry_args:["get","pm-domain","--full"],error_code:"projection_options_mutually_exclusive",allowed_values_required:!1},{probe_id:"search-mutually-exclusive-projection",command:"search",flag:"--projection",rejected_value:"--full+--fields",refusal_args:["search","Domain query","--full","--fields","id"],allowed_values:[],suggested_retry_args:["search","Domain query","--full"],error_code:"projection_options_mutually_exclusive",allowed_values_required:!1},{probe_id:"package-upgrade-mutually-exclusive-modes",command:"package upgrade",flag:"--cli-only/--packages-only",rejected_value:"--cli-only+--packages-only",refusal_args:["package","upgrade","--cli-only","--packages-only","--dry-run"],allowed_values:[],suggested_retry_args:["package","upgrade","--packages-only","--dry-run"],error_code:"package_upgrade_modes_mutually_exclusive",allowed_values_required:!1},{probe_id:"search-invalid-field",command:"search",flag:"--fields",rejected_value:i,refusal_args:["search","Domain query","--fields",i],allowed_values:f(),suggested_retry_args:["search","Domain query","--fields","id,title,status,score"],error_code:"unknown_field_projection"}].sort((e,n)=>e.probe_id.localeCompare(n.probe_id))}function T(t,r){let l=y().find(e=>e.command===t&&e.flag===r);if(!l)return"No stable core values are declared.";let o=l.allowed_values.filter(e=>!e.startsWith("item.")),a=r==="--fields"?" item.<field> aliases and configured runtime metadata fields are also accepted.":" Configured package and workspace intents may extend this domain.";return`Allowed core values: ${o.join("|")}.${a}`}function v(t){return t.map((r,l)=>{if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`NDJSON row ${l} must be a non-null object.`);let o=JSON.stringify(r);if(o===void 0)throw new TypeError(`NDJSON row ${l} must serialize to a non-null object.`);let a=JSON.parse(o);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError(`NDJSON row ${l} must serialize to a non-null object.`);return o}).join(`
|
|
2
|
+
`)}function P(t,r){if(r.count!==t.length)throw new TypeError(`NDJSON trailer count ${r.count} does not match ${t.length} ${t.length===1?"row":"rows"}.`);for(let[l,o]of t.entries())if(typeof o=="object"&&o!==null&&!Array.isArray(o)&&Reflect.get(o,"record_type")==="pm.stream.trailer")throw new TypeError(`NDJSON row ${l} uses reserved record_type pm.stream.trailer`);return v([...t,{...r,record_type:"pm.stream.trailer"}])}export{y as a,T as b,v as c,P as d};
|
|
3
|
+
//# sourceMappingURL=chunk-O7JHS64G.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$a as ae,Ub as ut,Vb as ft,Xb as ce,_b as pt,a as tt,ac as lt,bc as mt,xc as ht,yc as yt}from"./chunk-AEOHUSUI.js";import{u as dt}from"./chunk-H7JEXRIN.js";import{wc as ct}from"./chunk-ENKXRSFZ.js";import{m as at}from"./chunk-FJOEL75F.js";import{a as nt,c as P,d as oe,e as rt,f as se,g as it}from"./chunk-CFWLQFJM.js";import{ra as ot,wb as z,xa as st,zb as G}from"./chunk-OPJF254V.js";import{Ab as Qe,T as Ve,Va as ie,d as Re,ia as Ye,ka as x,t as Ie,u as Me,ub as Xe,uc as et,v as X}from"./chunk-TZY5MVJF.js";import{k as He,o as Ze,v as D}from"./chunk-2UQU7HRR.js";import{Bh as Le,Bj as We,Cc as xe,Cd as qe,Cj as Be,Gc as v,Hh as M,Ka as ee,Nc as ne,Ta as Ne,a as b,ad as De,ce as Ke,fd as Pe,ge as U,hc as je,nd as ze,od as Ge,oj as Je,pd as re,pj as C,vh as F,wc as Ue,yc as te,zc as Fe}from"./chunk-NGJ5ERBF.js";import{A as f,C as u,G as Q,I as Ce,J as I,l as $e,q as R,t as Te,y as ke}from"./chunk-YYT3MIRF.js";import ge from"node:crypto";import{constants as me,readFileSync as Jn}from"node:fs";import{cp as Wn,lstat as qt,mkdir as Bn,mkdtemp as Kt,open as Vn,readdir as Yn,realpath as Lt,rm as Jt,stat as _e,writeFile as Wt}from"node:fs/promises";import{tmpdir as Bt}from"node:os";import m from"node:path";import Tt from"node:crypto";var A=new Set(["id","title","description","type","status","priority","tags","body","deadline","estimated_minutes","acceptance_criteria","definition_of_ready","order","rank","assignee",...$e,"affected_version","fixed_version","component","regression","customer_impact","close_reason","completed_at","dependencies","comments","notes","learnings","files","tests","docs","reminders","events","type_options"]);function wt(e){if(e===void 0)return;let t=e.replace(/[A-Z]/gu,n=>`_${n.toLowerCase()}`);return A.has(t)?t:e}function q(e,t,n){let r=e?.estimatedMinutes;if(!(r===void 0||typeof r=="string"))throw new u(`Mutation ${n+1} ${t} option "estimatedMinutes" must be a string.`,f.USAGE,{code:"mutation_option_value_invalid",required:'Pass estimatedMinutes as a string, for example "45", in raw mutation options.',why:"Raw options use the create/update command option types; item documents accept numeric estimated_minutes instead.",nextSteps:["Quote the estimatedMinutes value or use an item document with numeric estimated_minutes, then retry the transaction."]})}var de=["op","id","reason","options","unique","match"],sn=[...de,"ref"],gt=[...sn,"item"],an="mutate-",_t="row-",St=["schema_version","mutations"],kt="[a-z][a-z0-9._-]{0,63}",Et=new RegExp(`^${kt}$`,"u"),Rt=new RegExp(`(^|,)id=@(${kt})(?=,|$)`,"gu"),Ot=e=>e.slice(2).replaceAll(/-([a-z])/gu,(t,n)=>n.toUpperCase()),K=["item","item_hash","linked","schedule","claim_state","children","omission_receipt","row_contract","context_intent"],It=new Set(["created_at","updated_at","closed_at","version","format_version","path","author","collection_counts","notes_count","tests_count","pm_format_version","claim_principal","test_runs","deferred_fields"]),cn=new Set([...It,"completed_at","id"]),Mt={create:z.map(e=>e.target),update:G.map(e=>e.target),close:ot.map(e=>Ot(e.flag)).filter(e=>e!=="reason"),release:st.map(e=>Ot(e.flag))};function Pr(e){let t=Tt.createHash("sha256").update(e).digest("hex");return`${an}${t.slice(0,24)}`}function zr(e){let t={},n=e.createCompensation;if(n!==void 0){if(n!=="close"&&n!=="delete")throw new u("createCompensation must be close or delete.",f.USAGE);t.createCompensation=n}for(let r of["lockTtlSeconds","lockWaitMs"]){let i=e[r];if(i===void 0)continue;let s=typeof i=="number"||typeof i=="string"&&i.trim().length>0?Number(i):Number.NaN;if(!Number.isSafeInteger(s)||s<=0)throw new u(`${r} must be a positive safe integer.`,f.USAGE);t[r]=s}return t}function w(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function L(e,t){let n=Math.max(1,Math.min(3,Math.floor(e.length/4)+1)),r;for(let i of t){let s=je(e,i,n);s!==null&&(r===void 0||s<r.distance)&&(r={key:i,distance:s})}return r?.key}function $(e,t,n){let r=L(t,n);return new u(r===void 0?`${e} does not recognize key "${t}". Allowed keys: ${n.join(", ")}.`:`${e} does not recognize key "${t}". Did you mean "${r}"?`,f.USAGE,{code:"stdin_json_unknown_key",required:`Use documented ${e} keys only.`,why:"Strict structured input prevents silent typos from creating incomplete or unintended mutations.",nextSteps:[r===void 0?`Remove or correct "${t}".`:`Replace "${t}" with "${r}".`]})}function pe(e,t){try{return JSON.parse(e)}catch(n){let r=n instanceof Error?n.message:String(n);throw new u(`${t} must be valid JSON: ${r}`,f.USAGE,{code:"stdin_json_invalid",required:`Pipe one valid JSON ${t.toLowerCase()} into stdin.`,why:"Structured mutation input must parse deterministically before any tracker write begins."})}}function dn(e,t){if(!w(e))throw new u(`Mutation ${t+1} must be an object.`,f.USAGE);for(let n of Object.keys(e))if(!de.includes(n))throw $(`mutation ${t+1}`,n,de);return e}function un(e,t,n,r){if(e===void 0)return;if(!w(e))throw new u(`Mutation ${n+1} options must be an object.`,f.USAGE);let i=[...Mt[t],...jt(t,r)];for(let s of Object.keys(e))if(!i.includes(s))throw $(`mutation ${n+1} ${t} options`,s,i);return q(e,t,n),e}function bt(e,t,n,r){if(e===void 0)return;let i=r==="unique"?"create":"update";if(t!==i)throw new u(`Mutation ${n+1} ${r} is only valid for ${i} operations.`,f.USAGE);let s=w(e)&&typeof e.key=="string"?e.key.trim():"";if(!w(e)||s.length===0||e.value===void 0||e.value===null)throw new u(`Mutation ${n+1} ${r} must be an object with a non-empty key and a value.`,f.USAGE);return{key:s,value:e.value}}function fn(e,t,n){let r=dn(e,t),{op:i,id:s,reason:o}=r;if(i!=="create"&&i!=="update"&&i!=="close"&&i!=="release")throw new u(`Mutation ${t+1} op must be create, update, close, or release.`,f.USAGE);let a=un(r.options,i,t,n),d=bt(r.unique,i,t,"unique"),c=bt(r.match,i,t,"match");if(typeof s!="string"||s.trim().length===0)throw new u(`Mutation ${t+1} requires a non-empty id.`,f.USAGE);let p=s.trim();if(i==="close"){if(typeof o!="string"||o.trim().length===0)throw new u(`Mutation ${t+1} close requires a non-empty reason.`,f.USAGE);return{op:i,id:p,reason:o.trim(),...a===void 0?{}:{options:a}}}if(i==="release")return{op:i,id:p,...a===void 0?{}:{options:a}};if(!w(a))throw new u(`Mutation ${t+1} ${i} requires an options object.`,f.USAGE);return{op:i,id:p,options:a,...d===void 0?{}:{unique:d},...c===void 0?{}:{match:c}}}function Ct(e,t={}){let n=pe(e,"Mutation batch"),r=Array.isArray(n)?n:w(n)&&Array.isArray(n.mutations)?n.mutations:void 0;if(r===void 0||r.length===0)throw new u("Mutation batch must be a non-empty JSON array or an object with a non-empty mutations array.",f.USAGE);let i=t.runtimeFields??[];return r.map((s,o)=>{let a=fn(s,o,i);return a.options!==void 0&&Ie(a.options),a})}function pn(e,t,n){let r=Tt.createHash("sha256").update(e).update("\0").update(t).digest("hex"),i=BigInt(`0x${r.slice(0,16)}`).toString(36).padStart(13,"0").slice(-12);return`${Ye(n)}${i}`}function vt(e,t){if(typeof e!="string"||!e.startsWith("@"))return e;let n=e.slice(1),r=t[n];if(r===void 0)throw new u(`Unknown mutation reference "${e}".`,f.USAGE);return r}function At(e,t){if(typeof e!="string")return e;let n=e.replace(Rt,(r,i,s)=>{let o=t[s];if(o===void 0)throw new u(`Unknown mutation reference "@${s}".`,f.USAGE);return`${i}id=${o}`});if(/(^|,)id=@/u.test(n))throw new u(`Malformed mutation reference in dependency "${e}".`,f.USAGE);return n}function ln(e){return typeof e!="string"?[]:e.startsWith("@")?[e.slice(1)]:[...e.matchAll(Rt)].map(t=>t[1]).filter(t=>t!==void 0)}function mn(e,t){let n=new Map;for(let[o,a]of e.entries()){let d=t[o];if(d===void 0)continue;let c=w(a.options)?a.options:{},p=Array.isArray(c.dep)?c.dep:c.dep===void 0?[]:[c.dep];n.set(d,[c.parent,c.blockedBy,...p].flatMap(ln))}let r=new Set,i=new Set,s=o=>{if(r.has(o))throw new u(`Mutation reference cycle includes "@${o}".`,f.USAGE);if(!i.has(o)){r.add(o);for(let a of n.get(o))n.has(a)&&s(a);r.delete(o),i.add(o)}};for(let o of n.keys())s(o)}function hn(e){let n=e.split(/\r?\n/u).map((o,a)=>({line:o.trim(),number:a+1})).filter(o=>o.line.length>0);if(n.length<2)return null;let r=n.map(o=>{try{return{...o,ok:!0,value:JSON.parse(o.line)}}catch(a){return{...o,ok:!1,error:a}}}),i=r[0];if(!i.ok&&(i.line.startsWith("[")||i.line==="{"||r.at(-1).line==="}")||!r.some(o=>o.ok&&w(o.value)))return null;let s=[];for(let o of r){if(!o.ok)throw new u(`Mutation document line ${o.number} must be one valid JSON object: ${et(o.error)}`,f.USAGE,{code:"stdin_json_invalid",required:"Provide one JSON object per line (JSON Lines), a JSON array, or a {schema_version, mutations} document.",why:"Structured mutation input must parse deterministically before any tracker write begins."});if(!w(o.value))throw new u(`Mutation document line ${o.number} must be a JSON object.`,f.USAGE);s.push(o.value)}return s}function yn(e){return Object.hasOwn(e,"mutations")||Object.hasOwn(e,"schema_version")}function wn(e){let t;try{t=pe(e,"Mutation document")}catch(n){let r=hn(e);if(r===null)throw n;return{schema_version:1,mutations:r}}return Array.isArray(t)?{schema_version:1,mutations:t}:w(t)&&!yn(t)?{schema_version:1,mutations:[t]}:t}function gn(e,t){let n=Object.hasOwn(e,"op")?_n(e,t):Sn(e,t);if(n.op==="create"&&n.id===void 0&&w(n.item)&&n.item.id!==void 0){if(typeof n.item.id!="string")throw new u(`Mutation ${t+1} item id must be a string.`,f.USAGE);n.id=n.item.id}return n}function _n(e,t){for(let n of Object.keys(e))if(!gt.includes(n))throw $(`mutation ${t+1}`,n,gt);if(e.item!==void 0&&e.op!=="create")throw new u(`Mutation ${t+1} item documents are only valid for create operations.`,f.USAGE);if(e.item!==void 0&&e.options!==void 0)throw new u(`Mutation ${t+1} must declare either item or options, not both.`,f.USAGE);return{...e}}function Sn(e,t){let{ref:n,id:r,item:i,...s}=e,o=i!==void 0?i:s;if(i!==void 0&&Object.keys(s).length>0)throw new u(`Mutation ${t+1} must not mix item document keys with top-level fields.`,f.USAGE);if(!w(o))throw new u(`Mutation ${t+1} item document must be an object.`,f.USAGE);return{op:"create",...n===void 0?{}:{ref:n},...r===void 0?{}:{id:r},item:o}}function En(e){let t=wn(e);if(!w(t))throw new u("Mutation document must be a JSON array or object.",f.USAGE);for(let n of Object.keys(t))if(!St.includes(n))throw $("mutation document",n,St);if(t.schema_version!==void 0&&t.schema_version!==1)throw new u("Mutation document schema_version must be 1.",f.USAGE);if(!Array.isArray(t.mutations)||t.mutations.length===0)throw new u("Mutation document requires a non-empty mutations array.",f.USAGE);return t.mutations.map((n,r)=>{if(!w(n))throw new u(`Mutation ${r+1} must be an object.`,f.USAGE);return gn(n,r)})}function On(e,t,n){let r=new Set(Object.values(Ft(t,n,Object.create(null))));for(let i of t)i.op==="create"&&typeof i.id=="string"&&i.id.trim().length>0&&r.add(x(i.id,n.idPrefix));return{...e,existing:e.existing.filter(i=>!r.has(i.id))}}function bn(e){let t=new Set(e.map(n=>n.ref).filter(n=>typeof n=="string"));for(let[n,r]of e.entries()){if(r.op!=="create"||r.ref!==void 0||typeof r.id=="string"&&r.id.trim().length>0)continue;let i=`${_t}${n+1}`;if(t.has(i))throw new u(`Mutation ${n+1} receives the synthesized ref "${i}", but another row declares that ref. Rename it or give mutation ${n+1} its own ref; ${_t}<n> aliases are reserved for rows without one.`,f.USAGE);r.ref=i}}function Nt(e,t,n){let r=Gn(JSON.stringify(e),t,{},n);return delete r.stdinJson,delete r.documentAnnotationSnapshot,r}function jt(e,t){return e!=="create"&&e!=="update"?[]:t.filter(n=>n.commands.includes(e)).map(n=>v(n))}function vn(e,t){for(let n of e)w(n.item)&&(n.options=Nt(n.item,"create",t),delete n.item)}function Ut(e,t){return t.some(n=>n.metadata_key===e)?e:wt(e)}function ue(e,t,n){let r=t.replaceAll(/_([a-z])/gu,(d,c)=>c.toUpperCase());if(w(e.item)){if(e.item[t]!==void 0)return e.item[t];if(Ut(r,n)===t&&e.item[r]!==void 0)return e.item[r]}let i=w(e.options)?e.options:{},s=n.find(d=>d.metadata_key===t);return s!==void 0&&i[v(s)]!==void 0?i[v(s)]:i[t]!==void 0?i[t]:i[r]!==void 0?i[r]:(Array.isArray(i.field)?i.field:[]).map(String).find(d=>d.startsWith(`${t}=`))?.slice(t.length+1)}function An(e,t){return e<t?-1:+(e!==t)}function fe(e){return Array.isArray(e)?e.map(fe):w(e)?Object.fromEntries(Object.entries(e).sort(([t],[n])=>An(t,n)).map(([t,n])=>[t,fe(n)])):e}function S(e){return typeof e=="string"?e.trim():JSON.stringify(fe(e))}function $n(e,t,n,r,i){let s=t.key.trim();if(s.length===0)throw new u("Upsert key must be a non-empty field name.",f.USAGE);let o=Tn(t.existing),a=new Map,d=new Set;for(let[c,p]of e.entries()){if(p.op!=="create")continue;let l=kn(p,s,c,a,r),y=Rn(o.get(l)??[],s,l);if(y===void 0){p.unique={key:s,value:ue(p,s,r)};continue}let h=x(y,n);typeof p.ref=="string"&&(i[p.ref]=h),In(p,h,r,{key:s,value:ue(p,s,r)}),d.add(c)}return d}function Tn(e){let t=new Map;for(let n of e){if(n.value===void 0||n.value===null)continue;let r=S(n.value);t.set(r,[...t.get(r)??[],n.id])}return t}function kn(e,t,n,r,i){let s=ue(e,t,i);if(s==null||s==="")throw new u(`Mutation ${n+1} is missing the upsert key "${t}".`,f.USAGE,{code:"upsert_key_missing",required:`Every create record must carry a non-empty "${t}" value when --upsert-key ${t} is set.`,why:"Keyed upsert identifies existing items by that field; a record without it cannot be matched or safely created."});let o=S(s),a=r.get(o);if(a!==void 0)throw new u(`Mutations ${a+1} and ${n+1} share the upsert key value ${JSON.stringify(o)} for "${t}".`,f.USAGE,{code:"upsert_key_duplicate",required:"Each record must carry a distinct upsert key value within one batch.",why:"Two records with the same key would race for the same existing item."});return r.set(o,n),o}function Rn(e,t,n){if(e.length>1)throw new u(`Upsert key "${t}" value ${JSON.stringify(n)} matches ${e.length} existing items: ${e.join(", ")}.`,f.CONFLICT,{code:"upsert_key_ambiguous",required:"Resolve the duplicate existing items or choose a key that is unique per item.",why:"An ambiguous key cannot select one item to update without guessing."});return e[0]}function In(e,t,n,r){let i=new Set([...Mt.update,...jt("update",n)]),s=w(e.item)?Nt(e.item,"update",n):Object.fromEntries(Object.entries(e.options).filter(([o])=>i.has(o)));delete e.item,delete e.ref,e.op="update",e.id=t,e.options=s,e.match=r}function Ft(e,t,n){for(let[r,i]of e.entries())if(i.ref!==void 0){if(i.op!=="create")throw new u(`Mutation ${r+1} ref is only valid for create operations.`,f.USAGE);if(typeof i.ref!="string"||!Et.test(i.ref))throw new u(`Mutation ${r+1} ref must match ${Et.source}.`,f.USAGE);if(n[i.ref]!==void 0)throw new u(`Duplicate mutation ref "${i.ref}".`,f.USAGE);n[i.ref]=typeof i.id=="string"&&i.id.trim().length>0?x(i.id,t.idPrefix):pn(t.transactionId,i.ref,t.idPrefix)}return n}function Gr(e,t){let n=En(e);bn(n);let r=n.map(p=>typeof p.ref=="string"?p.ref:void 0),i=Object.create(null),s=t.upsert===void 0?new Set:$n(n,On(t.upsert,n,t),t.idPrefix,t.runtimeFields??[],i);vn(n,t.runtimeFields??[]),Ft(n,t,i),mn(n,r);let o=n.map(p=>{let l={...p},y=typeof l.ref=="string"?l.ref:void 0;if(delete l.ref,y!==void 0?l.id=i[y]:l.id=vt(l.id,i),w(l.options)){let h={...l.options};for(let g of["parent","blockedBy"])h[g]!==void 0&&(h[g]=vt(h[g],i));Array.isArray(h.dep)?h.dep=h.dep.map(g=>At(g,i)):h.dep!==void 0&&(h.dep=At(h.dep,i)),l.options=h}return l}),a=Ct(JSON.stringify(o),{runtimeFields:t.runtimeFields??[]}),d=a.filter(p=>p.op==="create").map(p=>p.id);if(new Set(d).size!==d.length)throw new u("Duplicate resolved create id in mutation document.",f.USAGE);let c=a.map((p,l)=>{let y=r[l];return{index:l,...typeof y=="string"?{ref:y}:{},id:p.id,op:p.op,...s.has(l)?{upserted:!0}:{}}});return{schema_version:1,mutations:a,references:i,rows:c}}function Mn(e,t){return t.filter(n=>e[n]!==void 0&&e[n]!==null).map(n=>{let r=String(e[n]);return`${n}=${/[",\n\r\\]/u.test(r)?JSON.stringify(r):r}`}).join(",")}function Cn(e,t,n){if(e!==void 0){if(!Array.isArray(e)||!e.every(w))throw new u(`${n} must be an array of objects.`,f.USAGE);return e.map(r=>Mn(r,t))}}function Nn(e,t){return e==="tags"&&Array.isArray(t)&&t.every(n=>typeof n=="string")?JSON.stringify(t):typeof t=="number"||typeof t=="boolean"?String(t):t}function $t(e,t,n=!1){for(let[r,i,s]of ct){let o=t[r],a=Cn(n&&["comments","notes","learnings"].includes(r)&&Array.isArray(o)?o.filter(d=>!w(d)||d.created_at===void 0):o,s,r);a!==void 0&&a.length>0&&(e[i]=a)}}function jn(e,t){for(let n of Object.keys(e)){if(t){if(!K.includes(n))throw $("item envelope",n,K);continue}if(!A.has(n)&&L(n,[...A])===void 0&&L(n,K)==="item")throw $("item envelope",n,K)}}function Un(e){let t=Object.hasOwn(e,"item");jn(e,t);let n=t?e.item:e;if(!w(n))throw new u("Item document item must be an object.",f.USAGE);return{item:n,...t&&w(e.linked)?{linked:e.linked}:{}}}function Fn(e,t,n,r,i,s){if((r==="update"?cn:It).has(t))return;let a=i.find(d=>d.metadata_key===t&&d.commands.includes(r));if(a!==void 0){let d=ne(s,a);e[v(a)]=d!==void 0?d:a.type==="array"||a.type==="object"?JSON.stringify(n):n;return}if(!A.has(t)){if(L(t,[...A])!==void 0)throw $("item document",t,[...A]);let c=Array.isArray(e.field)?e.field:[];c.push(`${t}=${typeof n=="string"?n:JSON.stringify(n)}`),e.field=c;return}["dependencies","comments","notes","learnings","files","tests","docs","reminders","events","type_options"].includes(t)||(e[t.replaceAll(/_([a-z])/gu,(d,c)=>c.toUpperCase())]=Nn(t,n))}function xn(e){return{command_to_fields:new Map([["create",e.filter(t=>t.commands.includes("create"))]])}}function Dn(e,t,n,r){let i=r.filter(c=>c.commands.includes("create")),s=new Set([...De.filter(c=>t.has(c.option)).map(c=>c.field),...i.filter(c=>t.has(v(c))).map(c=>c.metadata_key),...at(Array.isArray(n)?n.map(String):[],xn(i)).metadataKeys]),o=(Array.isArray(e)?e:[]).filter(w).filter(c=>typeof c.field=="string"&&!s.has(c.field));if(o.length===0)return{};let a=o.map(c=>typeof c.reason=="string"?c.reason.trim():""),d=o.map(c=>c.field);return t.has("deferReason")?{defer:d}:a.every(c=>c.length>0)?{defer:d,deferReason:[...new Set(a)].join("; ")}:{defer:d}}function Pn(e,t,n){let r=new Set(Object.entries(e).filter(([,s])=>s!==void 0).map(([s])=>s)),i=t==="create"?z:G;for(let{target:s,keys:o}of i)o.some(a=>r.has(a))&&r.add(s);for(let s of n.filter(o=>o.commands.includes(t)))ne(e,s)!==void 0&&r.add(v(s));return r}function zn(e,t,n){let r=t==="create"?z:G;for(let{target:i}of r)i!=="field"&&n.has(i)&&delete e[i]}function Gn(e,t,n={},r=[]){let i=pe(e,"Item document");if(!w(i))throw new u("Item document must be a JSON object.",f.USAGE);let{item:s,linked:o}=Un(i),a={};for(let[l,y]of Object.entries(s)){let h=Ut(l,r);h!==l&&Object.hasOwn(s,h)||Fn(a,h,y,t,r,n)}$t(a,s,t==="update"),o!==void 0&&$t(a,o);let d=Pn(n,t,r);if(zn(a,t,d),t==="create"&&!d.has("defer")&&Object.assign(a,Dn(s.deferred_fields,d,n.unset,r)),t==="update"){let l=Object.fromEntries(["comments","notes","learnings"].filter(y=>Object.hasOwn(s,y)&&!d.has(y.slice(0,-1))).map(y=>[y,s[y].filter(h=>w(h)&&h.created_at!==void 0)]));Object.keys(l).length>0&&(a.documentAnnotationSnapshot=l)}let c={...a,...Object.fromEntries(Object.entries(n).filter(([,l])=>l!==void 0)),...Array.isArray(a.field)&&Array.isArray(n.field)?{field:[...a.field,...n.field]}:{},stdinJson:void 0},p=Object.keys(a).filter(l=>!d.has(l));return Me(Re(c,p),p)}function qr(e){return Ct(JSON.stringify(e))}var qn=["id","updated_at","pm_format_version","type"],Kn="import";function xt(e,t){if(typeof e!="string"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(e)||e in Object.prototype)throw new TypeError(`${t} names an invalid field ${JSON.stringify(e)}; use a front-matter field name of letters, digits and underscores`);if(qn.includes(e))throw new TypeError(`${t} cannot change "${e}"; the item writer derives it, or an update row owns it`)}function J(e){return Array.isArray(e)?`array of ${e.length}`:typeof e}var Ln=["__proto__","constructor","prototype"];function Dt(e){return e!==null&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype}function N(e){return e===null||typeof e=="string"||typeof e=="boolean"?!0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?Array.from(e).every(N):Dt(e)?Object.entries(e).every(([t,n])=>!Ln.includes(t)&&N(n)):!1}function le(e,t){let{set:n,unset:r}=e;if(n!==void 0&&!Dt(n))throw new TypeError(`${t} set must be a plain object of front-matter fields`);if(r!==void 0&&!Array.isArray(r))throw new TypeError(`${t} unset must be an array of front-matter field names`);let i=Object.keys(n??{}),s=r??[];if(i.length+s.length===0)throw new TypeError(`${t} requires at least one field in set or unset`);for(let o of i)if(xt(o,t),n[o]===null||!N(n[o]))throw new TypeError(`${t} set "${o}" must be a non-null JSON value (no undefined, non-finite number, sparse array, class instance, or __proto__/constructor/prototype key); remove a field with unset`);for(let o of s){if(xt(o,t),o==="body"||o==="front_matter")throw new TypeError(`${t} cannot unset "${o}"; the item format reserves that name`);if(i.includes(o))throw new TypeError(`${t} both sets and unsets "${o}"`)}if(new Set(s).size!==s.length)throw new TypeError(`${t} unset repeats a field`)}async function Pt(e){le(e,`Finalization of ${e.id}`);let t=await D(e.pmRoot),n={schema:t.schema,extensionFieldNames:Ve(C())},r=await Qe({pmRoot:e.pmRoot,settings:t,id:e.id,op:Kn,author:e.author,message:e.message,force:e.force===!0,extensionFieldNames:n.extensionFieldNames,mutate:i=>{let s=structuredClone(i.metadata),o=i.metadata;for(let[c,p]of Object.entries(e.set??{}))o[c]=structuredClone(p);for(let c of e.unset??[])delete o[c];let a;try{Pe(i.metadata);let c=re(i,n),p=re(ze(Ge(c,n),n),n);if(b(p)!==b(c))throw new TypeError("the stored item reads back as a different document; a set field collides with a name the item format reserves");a=c.metadata;let l=Object.entries(e.set??{}).find(([y,h])=>J(a[y])!==J(h));if(l!==void 0)throw new TypeError(`set "${l[0]}" is not stored as declared (${J(l[1])} normalizes to ${a[l[0]]===void 0?"an absent field":J(a[l[0]])})`)}catch(c){throw new u(`Finalization of ${e.id} would not store a readable item with the declared fields: ${c.message}`,f.USAGE,{code:"finalization_invalid_document",item_id:e.id,required:"Declare set and unset fields that leave a valid item under the workspace schema, with each set value in the shape its field stores.",why:"A finalization writes front-matter fields exactly, so the patched document is read back through the item reader, and each declared value is checked against what would be stored, before anything is written.",nextSteps:[`Run pm get ${e.id} --json to compare the current fields with the finalization, then correct the patch and retry the transaction.`]})}return{changedFields:[...new Set([...Object.keys(s),...Object.keys(a)])].filter(c=>Object.hasOwn(s,c)!==Object.hasOwn(a,c)||b(s[c])!==b(a[c])).sort((c,p)=>c.localeCompare(p))}}});return{item:r.item,changedFields:r.changedFields}}async function Hn(e,t){if(!Ze(e))return{schema:te(t.schema),typeDefinitionsFromFile:[]};let n=await fr(e,t.schema);return{schema:n.schema,typeDefinitionsFromFile:n.type_definitions_from_file??[]}}async function Zn(e,t,n,r){let i=ee({...t,item_types:{...t.item_types,definitions:[...t.item_types?.definitions??[],...n.typeDefinitionsFromFile]}},C());return(await Xe(e,t.item_format,i.type_to_folder,void 0,n.schema)).flatMap(o=>{let a=o[r];return a==null?[]:[{id:o.id,value:a}]})}function Se(e){let t=new Map,n=async r=>{let i=await D(e),s=await Hn(e,i),o=new Map;for(let a of await Zn(e,i,s,r)){let d=S(a.value);o.set(d,[...o.get(d)??[],a.id])}return o};return{lookup(r){let i=t.get(r)??n(r);return t.set(r,i),i},async recordCreate(r){for(let[i,s]of t){let o=r[i];if(o==null)continue;let a=await s,d=S(o);a.set(d,[...a.get(d)??[],String(r.id)])}},invalidate(){t.clear()}}}async function Xn(e,t){let n=S(t.value),r=(await e.lookup(t.key)).get(n)??[];if(r.length!==0)throw new u(`Upsert key "${t.key}" value ${JSON.stringify(n)} now matches existing item ${r.join(", ")}; the plan was resolved before it existed.`,f.CONFLICT,{code:"upsert_key_conflict",required:"Re-plan the document so the row updates the existing item instead of creating a duplicate.",why:"Keyed upsert is resolved before the writer lock, so every remaining create is re-checked under the lock; concurrent imports therefore cannot create two items for one key value.",nextSteps:["Re-run pm item mutate with the same document and --upsert-key; the re-plan turns the row into an update of the existing item.","Inspect the existing item first when its content should win over the document row."]})}function Vt(e,t,n){let r=e.metadata[n.key],i=S(n.value);if(S(r)!==i)throw new u(`Item ${t} no longer carries upsert key "${n.key}" value ${JSON.stringify(i)}; the plan selected it before the key changed.`,f.CONFLICT,{code:"upsert_match_changed",required:"Re-plan the document so the row is resolved against the current key values.",why:"Keyed upsert selects its target before the writer lock, so the update re-reads the key under the lock instead of updating a mismatched item blindly.",nextSteps:["Re-run pm item mutate with the same document and --upsert-key; the re-plan creates or re-targets the row from the current key values."]})}function zt(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=e;return typeof t.key=="string"&&t.key.trim().length>0&&t.value!==void 0&&t.value!==null}function Y(e,t){let n={...e,...t};return e===void 0?n:X(e,n)}async function E(e,t){try{let r=(await ae(t,{},{pmRoot:e})).item;return{id:r.id,closedAt:r.closed_at,updatedAt:r.updated_at,assignee:r.assignee,claimPrincipal:r.claim_principal}}catch(n){if(n instanceof u&&n.exitCode===f.NOT_FOUND)return;throw n}}function Ee(e,t){let n=e.id.replaceAll(/[^a-zA-Z0-9._-]/gu,"_"),r=ge.createHash("sha256").update(b(e)).digest("hex").slice(0,12);return`${t+1}-${e.op}-${n}-${r}`}function Qn(e,t){let n=e.id.replaceAll(/[^a-zA-Z0-9._-]/gu,"_");return`${t+1}-${e.op}-${n}`}function _(e,t,n){return`bulk-item-transaction ${e} ${t} ${n}`}function Oe(e,t){return e===t||(e?.startsWith(`${t} | `)??!1)}async function k(e,t,n,r){let i=await U(m.join(e,"history",`${t}.jsonl`),t),s=_(n,r,"apply"),o=_(n,r,"compensate");for(let a=i.length-1;a>=0;a-=1){let d=i[a].message;if(Oe(d,s))return!0;if(d===o)return!1}return!1}async function H(e,t){let n=await E(e,t.id);if(n?.updatedAt===void 0)throw new u(`Bulk ${t.op} target ${t.id} does not exist or has no restorable version`,f.NOT_FOUND);let r=await U(m.join(e,"history",`${n.id}.jsonl`),n.id);if(r.length===0)throw new u(`Bulk ${t.op} target ${t.id} has no restorable history`,f.NOT_FOUND);return{target_updated_at:n.updatedAt,target_version:String(ie(r)+r.length),target_history_hash:F(r),target_history_length:r.length}}function T(e,t,n){return new u(`Transaction ${e.transactionId} cannot safely compensate incomplete step ${n}; review item ${t} history before recovery.`,f.CONFLICT,{code:"transaction_partial_mutation",item_id:t,required:"Reconcile the item's partial or intervening changes before resuming this transaction.",why:"The retained history does not prove exclusive ownership of the changes to undo. The journal remains compensating instead of claiming a rollback or overwriting another writer.",nextSteps:[`Run pm history ${t} and inspect this transaction's retained compensation data before explicitly restoring or reconciling the item.`]})}function Yt(e,t){let n=`bulk-item-transaction ${t} `;return[e.message,e.context?.item_transaction_step].some(r=>typeof r=="string"&&r.startsWith(n))}function er(e,t,n){let{expectedHistory:r,length:i,version:s}=t;if(F(e)===r)return!1;if(typeof i!="number"||!Number.isSafeInteger(i)||i<1||F(e.slice(0,i))!==r||s!==String(ie(e)+i))throw T(n,n.itemId,n.stepId);let o=_(n.transactionId,n.stepId,"apply"),a=e.slice(i),d=y=>Oe(y.message,o)||y.context?.item_transaction_step===o,c=_(n.transactionId,n.stepId,"compensate");if(a.filter(y=>d(y)||y.message===c).at(-1)?.message===c)return!1;let p=a.filter(d);if(p.length===0)return!1;let l=e.at(-1).after_hash===p.at(-1).after_hash&&a.every(y=>Yt(y,n.transactionId));if(p.length!==a.length&&!l)throw T(n,n.itemId,n.stepId);return!0}async function Ht(e,t){let n=m.join(e,"history",`${t}.jsonl`),r=await Ke(n,t);return{history:r.entries,assertOwnedUnderLock:(i,s)=>{let o;try{o=Jn(n).equals(r.raw_bytes)&&Le(i)===r.entries.at(-1).after_hash}catch(a){throw Object.assign(s(),{cause:a})}if(!o)throw s()}}}async function j(e,t,n,r){let i=r!==null&&typeof r=="object"&&!Array.isArray(r)?r:void 0;if(i===void 0||typeof i.target_updated_at!="string")return;let s=i.target_updated_at,o=await E(e.pmRoot,t);if(o===void 0)return;let{history:a,assertOwnedUnderLock:d}=await Ht(e.pmRoot,o.id),c=i.target_history_hash,p=typeof c=="string";if(typeof c=="string"){if(!er(a,{expectedHistory:c,length:i.target_history_length,version:i.target_version},{...e,itemId:o.id,stepId:n}))return}else{if(o.updatedAt===s)return;if(!await k(e.pmRoot,o.id,e.transactionId,n))throw T(e,o.id,n)}let l=()=>mt(t,typeof i.target_version=="string"?i.target_version:s,{force:!0,author:e.author,message:_(e.transactionId,n,"compensate")},{pmRoot:e.pmRoot});await M({pmRoot:e.pmRoot,id:o.id,validate:y=>{d(y,()=>T(e,o.id,n))},compensation:Xt(e,t,n,"restore",p)},l)}var Zt=new WeakMap;function Xt(e,t,n,r,i){let s=i?nt(e.pmRoot,e.transactionId):void 0,o=s===void 0?void 0:Zt.get(s);if(!(o?.stepId!==n||o.itemId!==t||o.operation!==r))return{transaction_id:e.transactionId,step_id:n,operations:[r],overrides:[]}}function Qt(e,t,n){return{id:n,async inspect(){let r=await E(e.pmRoot,t.id);if(r===void 0)return{state:"pending"};if(r.closedAt!==void 0){let i=await U(m.join(e.pmRoot,"history",`${r.id}.jsonl`),r.id),s=`Compensated: interrupted bulk transaction ${e.transactionId}`;if(i.filter(d=>d.op==="close").at(-1)?.patch.some(d=>d.op==="add"||d.op==="replace"?d.path==="/metadata/close_reason"&&d.value===s:!1)??!1)throw new u(`Created item ${r.id} remains closed by transaction compensation; explicitly reopen or reconcile it before retrying.`,f.CONFLICT,{code:"transaction_create_compensated",item_id:r.id,required:"Review the compensated item and explicitly reopen it before retrying the same document.",why:"This item's latest closure belongs to transaction compensation. Automatically reopening it could overwrite later lifecycle decisions.",nextSteps:[`Run pm item reopen ${r.id} "Retry compensated creation" after reviewing its history, then retry the transaction.`]})}return{state:"applied",result:{id:r.id,op:"create"}}},async apply(){t.unique!==void 0&&await Xn(e.uniqueIndex,t.unique);let r=await ut(Y(t.options,{author:e.author,id:t.id,message:_(e.transactionId,n,"apply")}),{pmRoot:e.pmRoot}),i=r.item;return e.onCreateWarnings?.(String(i.id),r.warnings),await e.uniqueIndex.recordCreate(i),{id:String(i.id),op:"create"}},async compensate(){await tr(e,t.id,n)}}}async function tr(e,t,n){let r=await E(e.pmRoot,t);if(r===void 0||e.createCompensation==="close"&&r.closedAt!==void 0)return;let{history:i,assertOwnedUnderLock:s}=await Ht(e.pmRoot,r.id),o=_(e.transactionId,n,"apply"),a=_(e.transactionId,n,"compensate"),d=i.filter(c=>Oe(c.message,o)||c.message===a).at(-1);if(d?.message!==a){if(d===void 0||!i.every(c=>Yt(c,e.transactionId)))throw T(e,r.id,n);await M({pmRoot:e.pmRoot,id:r.id,validate:c=>{s(c,()=>T(e,r.id,n))},compensation:Xt(e,t,n,e.createCompensation==="delete"?"delete":"close",!0)},async()=>{let c={force:!0,author:e.author,message:a};e.createCompensation==="delete"?await lt(t,c,{pmRoot:e.pmRoot}):await ce(t,`Compensated: interrupted bulk transaction ${e.transactionId}`,{...c,validateClose:"off"},{pmRoot:e.pmRoot})})}}function nr(e,t,n){return{id:n,compensatePending:!0,async inspect(){let r=await E(e.pmRoot,t.id);return r===void 0?{state:"pending"}:await k(e.pmRoot,r.id,e.transactionId,n)?{state:"applied",result:{id:r.id,op:"update"}}:{state:"pending"}},async prepareCompensation(){return H(e.pmRoot,t)},async apply(){let r=()=>ft(t.id,Y(t.options,{author:e.author,message:_(e.transactionId,n,"apply")}),{pmRoot:e.pmRoot}),i=t.match,s=i,a=(await M({pmRoot:e.pmRoot,id:await en(e.pmRoot,t.id),validate:d=>{s!==void 0&&Vt(d,t.id,s)},committed:d=>{i!==void 0&&(s={key:i.key,value:structuredClone(d.metadata[i.key])})},historyContext:{item_transaction_step:_(e.transactionId,n,"apply")}},r)).item;return e.uniqueIndex.invalidate(),{id:String(a.id),op:"update"}},async compensate(r){await j(e,t.id,n,r)}}}async function en(e,t){return String((await ae(t,{},{pmRoot:e})).item.id)}function rr(e,t,n){let r=_(e.transactionId,n,"apply");return{id:n,compensatePending:!0,async inspect(){let i=await E(e.pmRoot,t.id);return i===void 0||!await k(e.pmRoot,i.id,e.transactionId,n)?{state:"pending"}:{state:"applied",result:{id:i.id,op:t.op}}},async prepareCompensation(){return H(e.pmRoot,t)},async apply(){let i=await en(e.pmRoot,t.id),{match:s}=t;return await yt(e.pmRoot,()=>M({pmRoot:e.pmRoot,id:i,validate:o=>{s!==void 0&&Vt(o,t.id,s)},historyContext:{item_transaction_step:r}},()=>Pt({pmRoot:e.pmRoot,id:i,author:e.author,message:r,force:t.force,...t.set===void 0?{}:{set:t.set},...t.unset===void 0?{}:{unset:t.unset}}))),e.uniqueIndex.invalidate(),{id:i,op:t.op}},async compensate(i){await j(e,t.id,n,i)}}}function ir(e,t,n){return{id:n,async inspect(){let r=await E(e.pmRoot,t.id);return r===void 0?{state:"pending"}:await k(e.pmRoot,r.id,e.transactionId,n)?{state:"applied",result:{id:r.id,op:"close"}}:r.closedAt===void 0?{state:"pending"}:{state:"applied",result:{id:r.id,op:"close"}}},async prepareCompensation(){return H(e.pmRoot,t)},async apply(){let i=(await ce(t.id,t.reason,Y(t.options,{author:e.author,message:_(e.transactionId,n,"apply")}),{pmRoot:e.pmRoot})).item;return e.uniqueIndex.invalidate(),{id:String(i.id),op:"close"}},async compensate(r){await j(e,t.id,n,r)}}}function or(e,t,n){return{id:n,async inspect(){let r=await E(e.pmRoot,t.id);return r===void 0?{state:"pending"}:await k(e.pmRoot,r.id,e.transactionId,n)?{state:"applied",result:{id:r.id,op:"release"}}:r.assignee!==void 0||r.claimPrincipal!==void 0?{state:"pending"}:{state:"applied",result:{id:r.id,op:"release"}}},async prepareCompensation(){return H(e.pmRoot,t)},async apply(){let i=(await pt(t.id,Y(t.options,{author:e.author,message:_(e.transactionId,n,"apply")}),{pmRoot:e.pmRoot})).item;return e.uniqueIndex.invalidate(),{id:String(i.id),op:"release"}},async compensate(r){await j(e,t.id,n,r)}}}function be(e,t,n){let r=Ee(t,n),i=sr(e,t,r);return Zt.set(i,{transactionId:e.transactionId,stepId:r,itemId:t.id,operation:t.op!=="create"?"restore":e.createCompensation==="delete"?"delete":"close"}),i}function sr(e,t,n){switch(t.op){case"create":return Qt(e,t,n);case"update":return nr(e,t,n);case"close":return ir(e,t,n);case"release":return or(e,t,n);case"finalize":return rr(e,t,n)}}function ar(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`Bulk mutation ${t+1} must be an object`);if(!["create","update","close","release","finalize"].includes(e.op))throw new TypeError(`Bulk mutation ${t+1} op must be create, update, close, release, or finalize`);if(typeof e.id!="string"||e.id.trim().length===0)throw new TypeError(`Bulk mutation ${t+1} requires a non-empty id`);if(e.op==="close"&&(typeof e.reason!="string"||e.reason.trim().length===0))throw new TypeError(`Bulk close mutation ${t+1} requires a non-empty reason`);if(cr(e,t),e.op==="finalize"){dr(e,t);return}q(e.options,e.op,t)}function cr(e,t){if(e.op==="create"&&e.unique!==void 0&&!zt(e.unique))throw new TypeError(`Bulk create mutation ${t+1} unique must be an object with a non-empty key and a value`);if((e.op==="update"||e.op==="finalize")&&e.match!==void 0&&!zt(e.match))throw new TypeError(`Bulk ${e.op} mutation ${t+1} match must be an object with a non-empty key and a value`)}var Gt=["op","id","set","unset","match","force"];function dr(e,t){let n=`Bulk finalize mutation ${t+1}`,r=Object.keys(e).filter(i=>!Gt.includes(i));if(r.length>0)throw new TypeError(`${n} has unsupported keys: ${r.join(", ")}; a finalization carries only ${Gt.join(", ")}`);if(e.force!==void 0&&typeof e.force!="boolean")throw new TypeError(`${n} force must be a boolean`);if(e.match!==void 0&&!N(e.match))throw new TypeError(`${n} match must be a plain object with a JSON value`);le(e,n)}function we(e){if(e.length===0)throw new TypeError("Bulk item transaction requires at least one mutation");let t=new Map;for(let[n,r]of e.entries()){if(ar(r,n),r.op!=="create"||r.unique===void 0)continue;let{key:i,value:s}=r.unique,o=t.get(i)??new Map,a=S(s),d=o.get(a);if(d!==void 0)throw new u(`Bulk create mutations ${d+1} and ${n+1} share the upsert key value ${JSON.stringify(a)} for "${i}".`,f.USAGE,{code:"upsert_key_duplicate",required:"Each create must carry a distinct unique key value within one batch.",why:"Direct SDK batches must preserve the same uniqueness invariant as planned document rows."});o.set(a,n),t.set(i,o)}}function tn(e){let t=[...e];we(t);let n=t.map(r=>{let i=structuredClone(r);return r.op!=="finalize"&&i.op!=="finalize"&&r.options!==void 0&&i.options!==void 0&&X(r.options,i.options),i});return we(n),n}function nn(e,t=""){return e===null||typeof e!="object"?[]:Object.entries(e).flatMap(([n,r])=>{let i=`${t}/${n.replaceAll("~","~0").replaceAll("/","~1")}`;return/^(created_at|updated_at|closed_at|completed_at|timestamp)$/u.test(n)?[i]:nn(r,i)})}async function he(e,t,n){try{return await n()}catch(r){throw r instanceof u?new u(r.message,r.exitCode,{...r.context,transaction_operation:{index:t,op:e.op,id:e.id}}):r}}function rn(e,t,n,r){let i=m.relative(e,t),s=i.split(m.sep);return s[0]==="extensions"&&s[2]==="node_modules"&&!r.some(o=>i===o||i.startsWith(`${o}${m.sep}`)||o.startsWith(`${i}${m.sep}`))?!1:["locks","runtime","search"].includes(i.split(m.sep)[0])?r.some(o=>i===o||i.startsWith(`${o}${m.sep}`)||o.startsWith(`${i}${m.sep}`)):i===""||n===void 0||n.some(o=>i===o||i.startsWith(`${o}${m.sep}`)||o.startsWith(`${i}${m.sep}`))}async function B(e,t){let n=await qt(t);if(n.isSymbolicLink())await _e(t);else if(n.isDirectory()||n.isFile())return n;throw I(m.relative(e,t))}async function ur(e,t){let n=await Vn(t,me.O_RDONLY|me.O_NOFOLLOW|me.O_NONBLOCK);try{let r=await n.stat();if(!r.isFile())throw I(m.relative(e,t));let i=ge.createHash("sha256");if(r.size>0)for await(let s of n.createReadStream({highWaterMark:64*1024,end:r.size-1,autoClose:!1}))i.update(s);return i.digest()}finally{await n.close()}}async function ye(e,t,n){let r=ge.createHash("sha256");async function i(s){for(let o of(await Yn(s)).sort()){let a=m.join(s,o);rn(e,a,t,n)&&((await B(e,a)).isDirectory()?await i(a):(r.update(JSON.stringify(m.relative(e,a))),r.update(await ur(e,a))))}}return await i(e),r.digest("hex")}function W(){return new u("Tracker changed while preparing the transaction preview; retry against stable state.",f.CONFLICT,{code:"transaction_preview_snapshot_changed"})}async function ve(e){if(!Q(e))return!1;let t=e.path;if(typeof t!="string")return!1;let n=m.resolve(t),r=n;for(;;)try{let i=await qt(r);return r!==n&&i.isDirectory()}catch(i){if(!Q(i))return!1;let s=m.dirname(r);if(s===r)return!1;r=s}}async function V(e,t){let n=m.join(e,t);try{let r=e;for(let i of t.split(m.sep).slice(0,-1))r=m.join(r,i),await B(e,r);if(!(await B(e,n)).isFile())throw I(t);return await Ce(n,I(t))}catch(r){if(await ve(r))return;throw r}}async function on(e,t,n,r){let i=te(n);for(let[s,o]of Object.entries(i.files)){let a=m.relative(e,Fe(e,o,Ue[s]));if(a===""||!m.resolve(e,a).startsWith(m.join(e,m.sep)))throw new u("Transaction preview requires schema files inside the selected tracker root; relocate the configured schema file before retrying.",f.USAGE,{code:"transaction_preview_external_schema",field:`schema.files.${s}`});i.files[s]=a;let d=await V(e,a);if(r?.set(a,d),d!==void 0){let c=m.join(t,a);await Bn(m.dirname(c),{recursive:!0}),await Wt(c,d)}}return xe(t,i)}async function fr(e,t){await _e(e);let n=await Kt(m.join(Bt(),"pm-schema-plan-"));try{let r=await Lt(e);return await on(r,m.join(n,"configuration"),t)}catch(r){throw await ve(r)?W():r}finally{await Jt(n,{recursive:!0,force:!0})}}async function pr(e,t,n){let r=new Map,i=await V(e,R);r.set(R,i);let s;try{s=JSON.parse(i??"null")}catch{s=null}let o=He(s),a=o.success?o.data:void 0,d=await on(e,t,a?.schema,r),c=d.schema,p=m.relative(e,qe(e));r.set(p,await V(e,p));let l=ee({...ke,item_types:{definitions:[...a?.item_types?.definitions??[],...d.type_definitions_from_file??[]]}},n),y=Ne(e)===e?[...Te.filter(Boolean),R,tt,"transactions",...l.folders,...r.keys()].map(g=>m.normalize(g)):void 0,h=a===void 0?void 0:JSON.stringify({...s,schema:{...a.schema,files:c.files}});return{configuration:r,ownedPaths:y,stagedSettings:h,registryFolders:l.folders}}async function lr(e,t,n){await _e(e);try{let r=await Lt(e),i=await pr(r,m.join(m.dirname(t),"configuration"),n),s=[...i.configuration.keys(),...i.registryFolders].map(c=>m.normalize(c)),o=await ye(r,i.ownedPaths,s);await Wn(r,t,{recursive:!0,dereference:!1,filter:async c=>rn(r,c,i.ownedPaths,s)?(await B(r,c),!0):!1});let[a,d]=await Promise.all([ye(r,i.ownedPaths,s),ye(t,i.ownedPaths,s)]);if(o!==a||o!==d)throw W();for(let[c,p]of i.configuration)if(await V(t,c)!==p)throw W();i.stagedSettings!==void 0&&await Wt(m.join(t,R),i.stagedSettings)}catch(r){throw await ve(r)?W():r}}async function Mi(e){let t=P(e),n=tn(e.mutations),r=C(),i=Be(),s=await Kt(m.join(Bt(),"pm-transaction-preview-")),o=m.join(s,"tracker");try{await lr(t.pmRoot,o,r);let a=!1,d=[],c=[],p=new Set;return await We(i,()=>ht({path:o,noExtensions:!0},async()=>{Je(r);let l={...t,pmRoot:o,createCompensation:"close",uniqueIndex:Se(o)},y=n.map((h,g)=>{let O=be({...l,onCreateWarnings:(Z,Ae)=>{Ae.length>0&&d.push({index:g,id:Z,op:"create",warnings:Ae})}},h,g);return{...O,inspect:()=>he(h,g,()=>O.inspect()),prepareCompensation:()=>he(h,g,async()=>O.prepareCompensation?.()),apply:()=>he(h,g,async()=>{let Z=await O.apply();return p.add(g),Z})}});if(await oe({...t,pmRoot:o,steps:y,onTransition:({transition:h})=>{h==="committed"&&(a=!0)}}),a)for(let[h,g]of n.entries()){let O=(await dt(g.id,{path:o},{full:!0})).item;c.push({index:h,id:String(O.id),op:g.op,execution:p.has(h)?"applied":"adopted",item:O,commit_time_fields:nn(O)})}})),{records:c,validated:a,state:a?"staged_snapshot":"replayed_committed_plan",warnings:d,unresolved_commit_constraints:["concurrent_tracker_changes","extension_write_hooks","derived_extension_dependencies_excluded","generated_timestamps_and_provenance"]}}finally{await Jt(s,{recursive:!0,force:!0})}}async function mr(e){let t=P(e),n=tn(e.mutations),r=e.createCompensation??"close";if(!["close","delete"].includes(r))throw new TypeError("Bulk item transaction createCompensation must be close or delete");let i={...t,createCompensation:r,uniqueIndex:Se(t.pmRoot)},s=await oe({...t,steps:n.map((a,d)=>be(i,a,d)),recoveryData:JSON.parse(JSON.stringify({kind:"item-mutations-v1",mutations:n,createCompensation:r})),...e.lockTtlSeconds===void 0?{}:{lockTtlSeconds:e.lockTtlSeconds},...e.lockWaitMs===void 0?{}:{lockWaitMs:e.lockWaitMs},...e.onTransition===void 0?{}:{onTransition:e.onTransition}}),o={};for(let[a,d]of n.entries()){let c=Ee(d,a),p=s.results[c];o[Qn(d,a)]=p}return{transactionId:s.transactionId,status:"committed",recovered:s.recovered,results:o}}function hr(e){let t=[];return e.evidence!==void 0&&Object.keys(e.evidence).length>0&&t.push({op:"update",id:e.id,options:e.evidence}),t.push({op:"close",id:e.id,reason:e.reason,...e.closeOptions===void 0?{}:{options:e.closeOptions}},{op:"release",id:e.id,...e.releaseOptions===void 0?{}:{options:e.releaseOptions}}),t}function Ci(e){return mr({pmRoot:e.pmRoot,transactionId:e.transactionId,author:e.author,mutations:hr(e),...e.lockTtlSeconds===void 0?{}:{lockTtlSeconds:e.lockTtlSeconds},...e.lockWaitMs===void 0?{}:{lockWaitMs:e.lockWaitMs},...e.onTransition===void 0?{}:{onTransition:e.onTransition}})}var Ni={buildCreateStep:Qt,bulkHistoryMarker:_,compensateByRestore:j,deriveStepId:Ee,isUpdateMarkerApplied:k,readItemSnapshot:E};async function ji(e,t){let n=await rt(e,t);return n===void 0?void 0:{journal:n,planDigest:se(n)}}function yr(e,t){let n=t.recoveryData;if(n===null||typeof n!="object"||Array.isArray(n)||n.kind!=="item-mutations-v1"||!Array.isArray(n.mutations)||!["close","delete"].includes(String(n.createCompensation)))throw new u("Transaction has no supported item recovery plan",f.CONFLICT,{code:"transaction_recovery_plan_missing",required:"Resume with the original plan and its original adapter.",why:"Legacy or foreign journals cannot safely reconstruct item compensation."});let r=n.mutations;we(r);let i={...e,createCompensation:n.createCompensation,uniqueIndex:Se(e.pmRoot)};return r.map((s,o)=>be(i,s,o))}async function Ui(e){let t=P(e),n=await it({...e,...t,resolveSteps:r=>yr({...e,...t},r)});return{journal:n,planDigest:se(n)}}export{wt as a,Pr as b,zr as c,Ct as d,S as e,Gr as f,Gn as g,qr as h,Hn as i,Zn as j,fr as k,Mi as l,mr as m,hr as n,Ci as o,Ni as p,ji as q,Ui as r};
|
|
2
|
+
//# sourceMappingURL=chunk-OKIKF4FD.js.map
|