@unbrained/pm-cli 2026.11.6 → 2026.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +13 -0
- package/dist/cli/expected-revisions.js +1 -1
- package/dist/cli/main.js +1 -1
- package/dist/cli/runtime/close-fields-retry.js +2 -0
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-3DI6CEF3.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-6VRX2CM7.js → chunk-4PPWVIIT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7ZRCYESH.js → chunk-5KHLV7JU.js} +47 -47
- package/dist/cli-bundle/chunks/{chunk-X3URBPMV.js → chunk-BQ5O3CBF.js} +51 -51
- package/dist/cli-bundle/chunks/{chunk-WC4M2H6R.js → chunk-COKKWMSC.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-D53G3NOE.js +6 -0
- package/dist/cli-bundle/chunks/{chunk-LS3GI3H4.js → chunk-ETHAZC3F.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-F3B2ULHB.js +122 -0
- package/dist/cli-bundle/chunks/chunk-JZWFZH2K.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-335BZ75D.js → chunk-KPAVZILX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OH6WQ7VT.js → chunk-MQOZNGPS.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-O6TIOKCM.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-PE3ASURT.js → chunk-OIBSKKCO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HRFGFIYU.js → chunk-OJZG7Y6S.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SLC5UWCM.js → chunk-QG6FLDM4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-D7KYPRK4.js → chunk-RFI4O6NU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TSQCUBUX.js → chunk-TGQPCNAD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DAX3AOFI.js → chunk-VM6OGNQC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-S4LPZ4TN.js → chunk-WS2N4TQW.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-UEGXWXUZ.js → chunk-WXVMPLBY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QNWUIPBO.js → chunk-WYIDX67P.js} +30 -30
- package/dist/cli-bundle/chunks/{chunk-7DEKAXVA.js → chunk-XSEDESNW.js} +2 -2
- package/dist/cli-bundle/chunks/item-revision-SPEKTFBB.js +2 -0
- package/dist/cli-bundle/chunks/item-transaction-BT55TQXE.js +2 -0
- package/dist/cli-bundle/chunks/{mutation-admission-INMM3HHG.js → mutation-admission-LUXUKISJ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-5Y5JKWU5.js → register-list-query-DU4W7VJU.js} +3 -3
- package/dist/cli-bundle/chunks/{register-mutation-MDSUU3G7.js → register-mutation-IC2C53QK.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-WJHZJFK2.js → register-operations-AHDWE2G3.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-RRFOS7IT.js → register-setup-7BGG3CI3.js} +2 -2
- package/dist/cli-bundle/chunks/{stage-E3MMV4TV.js → stage-S5BYWLGY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CPMSL4HS.js → chunk-4EXRRSDS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4LDOL6U7.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-A46YSPRF.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RFTJZ5VB.js → chunk-AI2PYNFI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-AJ2I377F.js +44 -0
- package/dist/cli-bundle/focused-chunks/{chunk-WSOAASCY.js → chunk-BIDF4KO7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-VWWTIX5L.js → chunk-CWFNQQZE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-D3U7FOZR.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-F62XGAAY.js → chunk-G2VIY6XA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MG7C3JUY.js → chunk-GFF6BITP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-LW64TINU.js → chunk-IIBWXNW3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-AHWJPZSJ.js → chunk-IYJRFJHT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-D2TBEBNW.js → chunk-J5N42SKC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MC7IE7D7.js → chunk-JRJOFMI7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CZM75DE3.js → chunk-KL33JMPC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-E56OXRYH.js → chunk-LH4C7BLB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YMGB2O4E.js → chunk-LTQEYE2L.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-LTTMERPN.js +12 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7KK66ISG.js → chunk-LW4TN5ZM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-XHOBYCVE.js → chunk-MESFDQ3H.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-G4QP365K.js → chunk-MWTBAI3V.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-TWULNB3N.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-C6P6HPCX.js → chunk-XAC6NP7U.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-GS3JC5UU.js → chunk-XG3TBYQK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-XMZAFKVP.js +91 -0
- package/dist/cli-bundle/focused-chunks/item-revision-ELI6NGMY.js +2 -0
- package/dist/cli-bundle/focused-chunks/{item-transaction-H2XACBOP.js → item-transaction-GUGAUY77.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-admission-4WM7TNHZ.js → mutation-admission-54FI37AA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-WV7QXR4C.js → stage-OHDJ43T2.js} +2 -2
- package/dist/cli-bundle/main.js +31 -31
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +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 +57 -57
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +2 -2
- package/dist/core/store/item-mutation-precondition.d.ts +58 -0
- package/dist/core/store/item-mutation-precondition.js +1 -1
- package/dist/sdk/command-line.d.ts +5 -1
- package/dist/sdk/command-line.js +1 -1
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/item-revision.d.ts +15 -4
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/output/list-envelope.d.ts +18 -7
- package/dist/sdk/output/list-envelope.js +1 -1
- package/dist/sdk/output-projection.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/get.d.ts +16 -6
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/search/response.js +1 -1
- package/dist/sdk/runtime.js +1 -1
- package/docs/CLOSE_EVIDENCE_RECOVERY.md +36 -2
- package/docs/COMMANDS.md +10 -1
- package/docs/GET_READ_EVIDENCE.md +24 -3
- package/docs/RELEASING.md +17 -0
- package/docs/SDK.md +24 -7
- package/marketplace.json +1 -1
- package/package.json +1 -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/dist/cli/after-command-context-usage.d.ts +0 -21
- package/dist/cli/argv-utils.d.ts +0 -12
- package/dist/cli/bootstrap-args.d.ts +0 -6
- package/dist/cli/bundle-integrity.d.ts +0 -49
- package/dist/cli/command-namespaces.d.ts +0 -9
- package/dist/cli/commander-usage.d.ts +0 -73
- package/dist/cli/commands/annotations/comments.d.ts +0 -2
- package/dist/cli/commands/annotations/docs.d.ts +0 -6
- package/dist/cli/commands/annotations/files.d.ts +0 -6
- package/dist/cli/commands/annotations/learnings.d.ts +0 -2
- package/dist/cli/commands/annotations/notes.d.ts +0 -2
- package/dist/cli/commands/extension/describe.d.ts +0 -2
- package/dist/cli/commands/extension/extension.d.ts +0 -6
- package/dist/cli/commands/extension/scaffold.d.ts +0 -2
- package/dist/cli/commands/extension/shared.d.ts +0 -2
- package/dist/cli/commands/governance/gc.d.ts +0 -6
- package/dist/cli/commands/governance/health.d.ts +0 -6
- package/dist/cli/commands/governance/telemetry.d.ts +0 -6
- package/dist/cli/commands/governance/validate.d.ts +0 -9
- package/dist/cli/commands/history/activity.d.ts +0 -6
- package/dist/cli/commands/history/history-compact.d.ts +0 -7
- package/dist/cli/commands/history/history-redact.d.ts +0 -8
- package/dist/cli/commands/history/history-repair.d.ts +0 -7
- package/dist/cli/commands/history/history.d.ts +0 -2
- package/dist/cli/commands/history/restore.d.ts +0 -6
- package/dist/cli/commands/lifecycle/append.d.ts +0 -6
- package/dist/cli/commands/lifecycle/claim.d.ts +0 -2
- package/dist/cli/commands/lifecycle/close-many.d.ts +0 -2
- package/dist/cli/commands/lifecycle/close.d.ts +0 -6
- package/dist/cli/commands/lifecycle/copy.d.ts +0 -6
- package/dist/cli/commands/lifecycle/create.d.ts +0 -10
- package/dist/cli/commands/lifecycle/delete.d.ts +0 -6
- package/dist/cli/commands/lifecycle/focus.d.ts +0 -6
- package/dist/cli/commands/lifecycle/plan.d.ts +0 -9
- package/dist/cli/commands/lifecycle/update-many.d.ts +0 -6
- package/dist/cli/commands/lifecycle/update.d.ts +0 -10
- package/dist/cli/commands/query/aggregate.d.ts +0 -2
- package/dist/cli/commands/query/context.d.ts +0 -6
- package/dist/cli/commands/query/deps.d.ts +0 -6
- package/dist/cli/commands/query/duplicates.d.ts +0 -6
- package/dist/cli/commands/query/eval.d.ts +0 -6
- package/dist/cli/commands/query/get.d.ts +0 -6
- package/dist/cli/commands/query/graph.d.ts +0 -7
- package/dist/cli/commands/query/list.d.ts +0 -6
- package/dist/cli/commands/query/next.d.ts +0 -6
- package/dist/cli/commands/query/search.d.ts +0 -6
- package/dist/cli/commands/query/stats.d.ts +0 -6
- package/dist/cli/commands/test/test-all.d.ts +0 -6
- package/dist/cli/commands/test/test-runs.d.ts +0 -6
- package/dist/cli/commands/test/test.d.ts +0 -6
- package/dist/cli/commands/workspace/config.d.ts +0 -6
- package/dist/cli/commands/workspace/contracts.d.ts +0 -2
- package/dist/cli/commands/workspace/init.d.ts +0 -6
- package/dist/cli/commands/workspace/merge.d.ts +0 -8
- package/dist/cli/commands/workspace/profile.d.ts +0 -6
- package/dist/cli/commands/workspace/schema.d.ts +0 -7
- package/dist/cli/commands/workspace/upgrade.d.ts +0 -2
- package/dist/cli/context-intent-invocation.d.ts +0 -2
- package/dist/cli/description-stdin.d.ts +0 -2
- package/dist/cli/error-guidance.d.ts +0 -276
- package/dist/cli/expected-revisions.d.ts +0 -55
- package/dist/cli/extension-command-help.d.ts +0 -137
- package/dist/cli/extension-command-options.d.ts +0 -37
- package/dist/cli/extension-recovery.d.ts +0 -31
- package/dist/cli/help-content.d.ts +0 -57
- package/dist/cli/help-json-payload.d.ts +0 -83
- package/dist/cli/invocation-profile.d.ts +0 -26
- package/dist/cli/main.d.ts +0 -263
- package/dist/cli/migration-gates.d.ts +0 -55
- package/dist/cli/option-values.d.ts +0 -3
- package/dist/cli/preflight-warnings.d.ts +0 -11
- package/dist/cli/register-annotations.d.ts +0 -11
- package/dist/cli/register-assurance.d.ts +0 -8
- package/dist/cli/register-files-lookup.d.ts +0 -9
- package/dist/cli/register-history-activity.d.ts +0 -8
- package/dist/cli/register-history-author.d.ts +0 -8
- package/dist/cli/register-history-maintenance.d.ts +0 -9
- package/dist/cli/register-list-query.d.ts +0 -27
- package/dist/cli/register-mutation-options.d.ts +0 -10
- package/dist/cli/register-mutation.d.ts +0 -16
- package/dist/cli/register-operations.d.ts +0 -85
- package/dist/cli/register-setup.d.ts +0 -16
- package/dist/cli/register-structured-mutation.d.ts +0 -15
- package/dist/cli/registration-helpers.d.ts +0 -2
- package/dist/cli/runtime/activation.d.ts +0 -51
- package/dist/cli/runtime/field-route-retry.d.ts +0 -15
- package/dist/cli/runtime/invocation-options.d.ts +0 -43
- package/dist/cli/runtime/projection-retry.d.ts +0 -9
- package/dist/cli/runtime/selection.d.ts +0 -35
- package/dist/cli/runtime/telemetry-outcome.d.ts +0 -20
- package/dist/cli/runtime-compatibility-boundary.d.ts +0 -17
- package/dist/cli/schema/registration.d.ts +0 -4
- package/dist/cli/schema-registration-helpers.d.ts +0 -24
- package/dist/cli/search-refresh.d.ts +0 -2
- package/dist/cli/stats-analytics-json.d.ts +0 -9
- package/dist/cli/telemetry-flush.d.ts +0 -2
- package/dist/cli-bundle/chunks/chunk-5GWEY4P6.js +0 -122
- package/dist/cli-bundle/chunks/chunk-AUEKTX7V.js +0 -6
- package/dist/cli-bundle/chunks/chunk-FRNMQM45.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HNGLDMSZ.js +0 -9
- package/dist/cli-bundle/chunks/chunk-YKXATU2G.js +0 -3
- package/dist/cli-bundle/chunks/item-revision-OJJVPQY7.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-TBKEATN6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2KTJY7BV.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-G5PJCR7R.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-M6V7UMWL.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-MK4HV4JO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-O7EI33NP.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-SNOXXRSJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-UPJUTP2V.js +0 -12
- package/dist/cli-bundle/focused-chunks/item-revision-CTDO4H3I.js +0 -2
- package/dist/cli.d.ts +0 -13
- package/dist/core/checkpoint/checkpoint-gc.d.ts +0 -61
- package/dist/core/checkpoint/mutation-context.d.ts +0 -10
- package/dist/core/diagnostics/remediation.d.ts +0 -52
- package/dist/core/extensions/activation-transaction.d.ts +0 -22
- package/dist/core/extensions/command-visibility-tier.d.ts +0 -8
- package/dist/core/extensions/exporter-output-contract.d.ts +0 -12
- package/dist/core/extensions/extension-candidate.d.ts +0 -26
- package/dist/core/extensions/extension-runtime-helpers.d.ts +0 -16
- package/dist/core/extensions/module-graph-snapshot.d.ts +0 -19
- package/dist/core/extensions/preflight-ownership.d.ts +0 -5
- package/dist/core/extensions/read-output-contract.d.ts +0 -5
- package/dist/core/extensions/reserved-host-flags.d.ts +0 -18
- package/dist/core/extensions/service-ownership.d.ts +0 -8
- package/dist/core/extensions/version-diagnostics.d.ts +0 -2
- package/dist/core/fs/atomic-create.d.ts +0 -7
- package/dist/core/fs/index.d.ts +0 -6
- package/dist/core/fs/path-utils.d.ts +0 -2
- package/dist/core/history/drift-cache.d.ts +0 -4
- package/dist/core/history/drift-scan.d.ts +0 -51
- package/dist/core/history/index.d.ts +0 -6
- package/dist/core/history/tombstone.d.ts +0 -3
- package/dist/core/history/version-address.d.ts +0 -13
- package/dist/core/item/index.d.ts +0 -9
- package/dist/core/item/item-type-definition.d.ts +0 -51
- package/dist/core/item/toon-decode.d.ts +0 -25
- package/dist/core/lock/index.d.ts +0 -6
- package/dist/core/lock/lock-confinement.d.ts +0 -55
- package/dist/core/lock/lock-gc.d.ts +0 -93
- package/dist/core/output/mutation-projection.d.ts +0 -13
- package/dist/core/output/query-summary.d.ts +0 -30
- package/dist/core/search/staleness.d.ts +0 -23
- package/dist/core/sentry/sensitive-assignments.d.ts +0 -9
- package/dist/core/shared/conflict-markers.d.ts +0 -18
- package/dist/core/shared/index.d.ts +0 -9
- package/dist/core/shared/memo.d.ts +0 -7
- package/dist/core/store/index.d.ts +0 -9
- package/dist/core/store/settings-concurrency.d.ts +0 -7
- package/dist/core/telemetry/read-sampling.d.ts +0 -8
- package/dist/core/test/item-test-run-tracking.d.ts +0 -12
- package/dist/core/validate/estimate-defaults.d.ts +0 -21
- package/dist/core/validate/linked-artifact-reference.d.ts +0 -20
- package/dist/mcp/http-server.d.ts +0 -60
- package/dist/mcp/legacy-adapter.d.ts +0 -59
- package/dist/mcp/runtime-capabilities.d.ts +0 -57
- package/dist/mcp/server.d.ts +0 -101
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +0 -23
- package/dist/sdk/cli-contracts/registration-helpers.d.ts +0 -123
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +0 -796
- package/dist/sdk/cli-contracts/string-lists.d.ts +0 -9
- package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +0 -35
- package/dist/sdk/context/usage-egress.d.ts +0 -9
- package/dist/sdk/dependencies/context-budget-recovery.d.ts +0 -21
- package/dist/sdk/dependency-flag-validation.d.ts +0 -32
- package/dist/sdk/extension/author-manifest.d.ts +0 -22
- package/dist/sdk/extension/bundled-catalog.d.ts +0 -35
- package/dist/sdk/extension/concurrency.d.ts +0 -7
- package/dist/sdk/extension/copy-scope.d.ts +0 -2
- package/dist/sdk/extension/custom-field-collisions.d.ts +0 -6
- package/dist/sdk/extension/install-receipts.d.ts +0 -7
- package/dist/sdk/extension/install-snapshot.d.ts +0 -34
- package/dist/sdk/extension/managed-update-status.d.ts +0 -3
- package/dist/sdk/extension/runtime-summary.d.ts +0 -9
- package/dist/sdk/extension/scaffold.d.ts +0 -38
- package/dist/sdk/generated/error-code-catalog-rows.d.ts +0 -39
- package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +0 -8
- package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +0 -8
- package/dist/sdk/governance/assurance-limits.d.ts +0 -7
- package/dist/sdk/governance/defect-recurrence-signals.d.ts +0 -10
- package/dist/sdk/governance/health-merge-evidence.d.ts +0 -23
- package/dist/sdk/governance/tracked-runtime-cache.d.ts +0 -24
- package/dist/sdk/governance/validate-history-drift.d.ts +0 -7
- package/dist/sdk/history/attestation-scan.d.ts +0 -16
- package/dist/sdk/history-mcp.d.ts +0 -17
- package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +0 -15
- package/dist/sdk/lifecycle/core-field-recovery.d.ts +0 -33
- package/dist/sdk/lifecycle/core-item-fields.d.ts +0 -6
- package/dist/sdk/lifecycle/event-validation-messages.d.ts +0 -6
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +0 -15
- package/dist/sdk/lifecycle/legacy-none-tokens.d.ts +0 -71
- package/dist/sdk/lifecycle/mcp-actions.d.ts +0 -24
- package/dist/sdk/lifecycle/metadata-normalizers.d.ts +0 -8
- package/dist/sdk/lifecycle/mutation-facet-contracts.d.ts +0 -6
- package/dist/sdk/lifecycle/mutation-option-validation.d.ts +0 -2
- package/dist/sdk/lifecycle/recurrence-parsers.d.ts +0 -34
- package/dist/sdk/lifecycle/release-handoff.d.ts +0 -12
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.d.ts +0 -18
- package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +0 -45
- package/dist/sdk/merge/abandoned-receipts.d.ts +0 -15
- package/dist/sdk/merge/history-scalar-rebase.d.ts +0 -9
- package/dist/sdk/merge/ignored-artifacts.d.ts +0 -13
- package/dist/sdk/merge/indexed-receipt-blobs.d.ts +0 -4
- package/dist/sdk/merge/receipt-file-boundary.d.ts +0 -23
- package/dist/sdk/merge/settlement-hook.d.ts +0 -12
- package/dist/sdk/merge/stage.d.ts +0 -13
- package/dist/sdk/merge/worktree-config.d.ts +0 -11
- package/dist/sdk/query/light-metadata.d.ts +0 -3
- package/dist/sdk/query/window-pagination.d.ts +0 -20
- package/dist/sdk/read-output/extension.d.ts +0 -7
- package/dist/sdk/read-output/provenance.d.ts +0 -20
- package/dist/sdk/read-output/surfaces.d.ts +0 -27
- package/dist/sdk/runtime/actions.d.ts +0 -4
- package/dist/sdk/runtime/mutation-admission.d.ts +0 -2
- package/dist/sdk/runtime/mutation-value-validation.d.ts +0 -16
- package/dist/sdk/runtime/schema.d.ts +0 -4
- package/dist/sdk/runtime-action-aliases.d.ts +0 -7
- package/dist/sdk/runtime-extended-actions.d.ts +0 -27
- package/dist/sdk/runtime-stats-options.d.ts +0 -9
- package/dist/sdk/test/command-args.d.ts +0 -4
- package/dist/sdk/test/command-resolution.d.ts +0 -5
- package/dist/sdk/test/entry.d.ts +0 -18
- package/dist/sdk/test/execution-receipts.d.ts +0 -34
- package/dist/sdk/test/receipt-index-snapshot.d.ts +0 -2
- package/dist/sdk/test/workspace-snapshot.d.ts +0 -11
- package/dist/sdk/traceability/runtime-files-lookup.d.ts +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as He,e as Fe,f as ze,i as Jn,j as Kn,k as Yn,l as Xn,m as Zn}from"./chunk-VWWTIX5L.js";import{h as io}from"./chunk-4PW5XWVI.js";import{A as er,Aa as we,Bc as Qn,C as $n,Dc as it,Fa as Bn,Fe as rr,Ga as A,Ha as z,Hc as eo,Ia as ot,Ja as v,Qc as to,Rd as $e,Sd as q,Td as st,Ud as Ee,Vd as G,Zd as ro,_d as no,ae as oo,ee as $,fa as qn,i as Qe,j as Pn,k as jn,ka as Gn,l as Ln,m as Hn,q as et,r as tt,s as Fn,x as zn,y as rt,z as nt}from"./chunk-M6V7UMWL.js";import{A as w,C as Vn,D as W,E as ie,F as be,G as Un,H as tr,I as Le,J as Wn,m as J,u as Mn,x as h,y as je,z as E}from"./chunk-G6ERMFJ5.js";import{createHash as js}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ca5b60a5-80a7-5e7d-917f-4c7649bcbab6")}catch{}})();var Su=["sha256","sha512"],Ls="sha256",so="sha256";function se(e){if(e===void 0)return Ls;if(e==="sha256"||e==="sha512")return e;throw new TypeError(`unsupported_history_hash_algorithm:${String(e)}`)}function K(e,t){return js(se(t)).update(e,"utf8").digest("hex")}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6635e694-c788-5805-adb8-ed93cc931946")}catch{}})();var Hs=16;function at(e){let t=e.trim().replaceAll(/[^A-Za-z0-9]+/g," ").split(/\s+/).filter(o=>o.length>0).map(o=>o.toLowerCase());if(t.length===0)return e;let[r,...n]=t;return`${r}${n.map(o=>`${o.slice(0,1).toUpperCase()}${o.slice(1)}`).join("")}`}function Nu(e,t,r=new Set,n){if(uo(e,t,n))return;let o=_o(e,t,r,n),i=ct(e);return[at(e.cli_flag),...i].find(s=>!o.has(s)&&lo(s,i,o))}function lo(e,t,r){for(let n of t){if(n===e)break;if(r.has(n))return!1}return!0}function uo(e,t,r){return t.definitions.some(n=>n!==e&&n.metadata_key===e.metadata_key&&(r===void 0||n.commands.includes(r)))}function _o(e,t,r,n){return new Set([...r,...t.definitions.filter(o=>o!==e&&(n===void 0||o.commands.includes(n))).flatMap(o=>ct(o))])}function fo(e){return e.replace(/^-+/u,"").startsWith("no-")}function Fs(e){return e.startsWith("-")?e:`--${e}`}function Ru(e,t,r,n){if(uo(e,t,n))return;let o=_o(e,t,r.options,n),i=ct(e);return[e.cli_flag,...e.cli_aliases].find(s=>{let a=mo(s);return fo(s)||r.flags.has(Fs(s))||o.has(a)?!1:lo(a,i,o)})}function mo(e){return e.replace(/^-+/u,"").replace(/^no-/u,"").split("-").reduce((t,r)=>`${t}${r.charAt(0).toUpperCase()}${r.slice(1)}`)}function ct(e){return[...new Set([Zn(e),at(e.key),at(e.cli_flag),...e.cli_aliases.map(t=>at(t)),...[e.cli_flag,...e.cli_aliases].filter(t=>!fo(t)).map(t=>mo(t))])]}function po(e,t){for(let r of ct(t)){if(!Object.hasOwn(e,r))continue;let n=e[r];if(n!==void 0)return n}}function ho(e){return Array.isArray(e)?e.flatMap(t=>ho(t)).map(t=>t.trim()).filter(t=>t.length>0):typeof e=="string"?e.split(/[,\n|]/).map(t=>t.trim()).filter(t=>t.length>0):e==null?[]:[String(e).trim()].filter(t=>t.length>0)}function ao(e,t){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e=="string"){let r=e.trim().toLowerCase();if(r==="true"||r==="1"||r==="yes")return!0;if(r==="false"||r==="0"||r==="no")return!1}throw new w(`${t} must be one of true|false|1|0|yes|no`,E.USAGE)}function co(e,t){if(typeof e=="number"&&Number.isFinite(e))return e;let r=typeof e=="string"?e.trim():String(e),n=Number(r);if(!Number.isFinite(n))throw new w(`${t} must be a number`,E.USAGE);return n}function zs(e,t,r){let n=typeof e=="string"?(()=>{try{return JSON.parse(e)}catch{return}})():e;if(r==="array"&&Array.isArray(n)||r==="object"&&typeof n=="object"&&n!==null&&!Array.isArray(n))return n;throw new w(`${t} must be valid JSON ${r}`,E.USAGE)}function $s(e,t){return t===void 0?!0:t==="array"?Array.isArray(e):t==="object"?typeof e=="object"&&e!==null&&!Array.isArray(e):typeof e===t}function Ms(e,t,r){if(t.const!==void 0&&A(e)!==A(t.const))return`${r} must equal ${A(t.const)}`;if(t.enum!==void 0&&!t.enum.some(n=>A(n)===A(e)))return`${r} must be one of ${t.enum.map(n=>A(n)).join("|")}`;if(!$s(e,t.type))return`${r} must match configured type ${String(t.type)}`;if(typeof e=="string"){if(t.min_length!==void 0&&e.length<t.min_length)return`${r} must contain at least ${t.min_length} characters`;if(t.format==="date-time"&&!st(e))return`${r} must be an RFC 3339 date-time`}}function Vs(e,t,r,n){if(Array.isArray(e)){if(t.min_items!==void 0&&e.length<t.min_items)return`${r} must contain at least ${t.min_items} items`;if(t.items)for(let[o,i]of e.entries()){let s=dt(i,t.items,`${r}[${o}]`,n+1);if(s)return s}}}function Us(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))return;let o=e;for(let i of t.required??[])if(!Object.hasOwn(o,i))return`${r}.${i} is required`;for(let[i,s]of Object.entries(o)){let a=t.properties?.[i];if(!a){if(t.additional_properties===!1)return`${r}.${i} is not allowed`;continue}let d=dt(s,a,`${r}.${i}`,n+1);if(d)return d}}function dt(e,t,r,n=0){if(n>Hs)return`${r} value schema exceeds maximum depth`;let o=Ms(e,t,r);if(o)return o;let i=Vs(e,t,r,n);if(i)return i;let s=Us(e,t,r,n);if(s)return s;if(!t.one_of)return;let a=0;for(let d of t.one_of)if(dt(e,d,r,n+1)===void 0&&(a+=1,a>1))break;return a===1?void 0:`${r} must match exactly one configured schema variant`}function ae(e,t,r){if(!e.value_schema||t===void 0)return t;let n=dt(t,e.value_schema,r);if(n)throw new w(n,E.USAGE);return t}function Ws(e,t,r,n){let o=n==="option"&&Array.isArray(t)?t[t.length-1]:t;if(o!==void 0)return ae(e,zs(o,r,e.type),r)}function Me(e,t,r,n="option"){let o=r??`--${e.cli_flag}`;if(e.type==="array"||e.type==="object")return Ws(e,t,o,n);if(e.repeatable||e.type==="string_array"){let s=ho(t);return e.type==="number"?ae(e,s.map(a=>co(a,o)),o):e.type==="boolean"?ae(e,s.map(a=>ao(a,o)),o):ae(e,s,o)}let i=Array.isArray(t)?t[t.length-1]:t;if(i!==void 0)return e.type==="number"?ae(e,co(i,o),o):e.type==="boolean"?ae(e,ao(i,o),o):ae(e,typeof i=="string"?i:String(i),o)}function qs(e,t){return!e.required&&!e.required_on_create?!1:e.required_types.length===0?!0:t?e.required_types.map(r=>r.toLowerCase()).includes(t.trim().toLowerCase()):!1}function Du(e,t,r){let n={},o=[];for(let i of t.command_to_fields.get("create")??[]){let s=po(e,i);if(s===void 0){qs(i,r)&&o.push(`--${i.cli_flag}`);continue}n[i.metadata_key]=Me(i,s)}return{values:n,missing_required_flags:[...new Set(o)].sort((i,s)=>i.localeCompare(s))}}function Pu(e,t,r=["update"]){let n={},o=(r??["update"]).flatMap(s=>t.command_to_fields.get(s)??[]),i=new Set;for(let s of o){let a=po(e,s);a!==void 0&&(i.has(s.metadata_key)||(i.add(s.metadata_key),n[s.metadata_key]=Me(s,a)))}return n}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c35d4830-d7d1-5ee4-99bc-ab52cc3e4e09")}catch{}})();var nr=1,or=2;function Lu(e){return Math.max(ir(e),e.tests?.some(t=>t.updated_by!==void 0||t.updated_at!==void 0)?2:1)}function ir(e){let t=e.pm_format_version;return typeof t=="number"&&Number.isInteger(t)&&t>=1?t:1}function yo(e){if(!(typeof e!="number"||!Number.isInteger(e)||e<=1))return e}function Gs(e,t=2,r=t){return e<r?"outdated":e>t?"ahead":"current"}function Hu(e,t=2,r=t){let n=[],o=[];for(let i of e){let s=Gs(i.version,t,r);s==="outdated"?n.push(i.ref):s==="ahead"&&o.push(i.ref)}return{outdated:n.sort((i,s)=>i.localeCompare(s)),ahead:o.sort((i,s)=>i.localeCompare(s))}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="515840b7-cf86-5d71-8ac1-beac7fd7c8a8")}catch{}})();var Bs={"in-progress":"in_progress",cancelled:"canceled"};function lt(e,t){if(t){let o=Yn(e,t);if(o)return o}if(typeof e!="string")return;let r=e.trim().toLowerCase();if(!r)return;let n=Bs[r]??r;if(Qe.includes(n))return n}function Js(e,t){return lt(e,t)??e}function Mu(e,t){return t.terminal_statuses.has(Js(e,t))}import{encode as Zs}from"@toon-format/toon";import{isDeepStrictEqual as go}from"node:util";import{decode as Ks}from"@toon-format/toon";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aaa2be03-9478-5fbe-82e6-e4fc86e3735b")}catch{}})();function sr(e){return{value:Ks(e),usedScalarBracketEscape:!1}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="79626299-17a8-573a-9b66-ce37c65e2f5d")}catch{}})();var Ys=/^\s*(<<<<<<<|=======|>>>>>>>)(?:\s.*)?$/;function Xs(e){if(e.length===0)return[];let t=e.split(/\r?\n/),r=[];for(let n=0;n<t.length;n+=1){let o=t[n]??"",i=o.match(Ys);if(!i)continue;let s=i[1];r.push({line:n+1,marker:s,text:o})}return r}function ut(e){return Xs(e)[0]}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2789e87f-0706-52e8-8f4c-3855c65c618c")}catch{}})();var lr=new Set(["schema","tracker","auto","none"]),ko=new Set(["source","isolated","snapshot"]),Qs=new Set(["legacy","local_mutation","local_source_ref","acknowledged","invalid_provenance","foreign_source_ref"]),ea=new Set(["passed","failed","stopped","canceled"]),ta=new Set($n);function Ie(e){return e.replaceAll("\\","/")}function So(e){for(let t of e)if(t!==0)return t;return 0}function ft(e){for(let[t,r]of Object.entries(e))r===void 0&&delete e[t]}var Io=["id","title","description","created_at","updated_at"],ra=new Set(J);function Oo(e){if(e?.schema)return{statusRegistry:Kn(e.schema),fieldRegistry:Xn(e.schema),unknownFieldPolicy:e.schema.unknown_field_policy??"allow",extensionFieldNames:new Set(e.extensionFieldNames??[]),onWarning:e.onWarning}}function na(e,t){return e.required?e.required_types.length===0?!0:e.required_types.map(r=>r.toLowerCase()).includes(t.trim().toLowerCase()):!1}function Y(e){let t=e.match(/^([a-z_][\w.]*)\s/u)?.[1];throw new w(`Invalid item metadata: ${e}`,E.GENERIC_FAILURE,{code:"item_document_invalid",reason:e.includes("required")?"missing_required_field":"schema_validation_error",...t?{field:t}:{},required:"Provide an item document whose metadata satisfies the active runtime schema.",why:e})}function We(e,t){throw new w(t,E.GENERIC_FAILURE,{code:"item_document_invalid",reason:"syntax_error",format:e,required:`Provide a syntactically valid ${e==="toon"?"TOON":"JSON Markdown"} item document.`,why:"The document could not be decoded far enough to validate item metadata."})}function To(e,t){if(!t||typeof e!="object"||e===null)return;let r=ir(e);if(!(r<=or))throw new w(`Stored item uses format version ${r}; this runtime supports up to ${or}. Upgrade pm before reading or changing this item.`,E.CONFLICT,{code:"item_format_version_unsupported",format_version:r,required:"Upgrade to a pm runtime supporting the stored item format.",nextSteps:["Preserve the original item and history; do not lower pm_format_version to bypass compatibility checks."]})}function Ao(e){let t=new Set(ra);for(let r of e.fieldRegistry?.definitions??[])t.add(r.metadata_key);for(let r of e.extensionFieldNames)t.add(r);return t}function y(e,t){e||Y(t)}function qe(e,t){return(typeof e!="object"||e===null||Array.isArray(e))&&Y(t),e}function ar(e,t){let r=e[t];y(typeof r=="string",`${t} must be a string`),y(q(r),`${t} must be a valid ISO timestamp`)}function vo(e,t,r){let n=e[t];n!==void 0&&y(typeof n=="number"&&Number.isInteger(n)&&n>=1,`${r} must be an integer >= 1`)}function ur(e,t,r){let n=e[t];n!==void 0&&(y(typeof n=="string",`${r} must be a string`),y(q(n),`${r} must be a valid ISO timestamp`))}function oa(e){if(e!==void 0){y(Array.isArray(e),"event.recurrence.by_weekday must be an array");for(let t of e){y(typeof t=="string","event.recurrence.by_weekday entries must be strings");let r=t.trim().toLowerCase();y(nt.includes(r),`event.recurrence.by_weekday entries must be one of: ${nt.join(", ")}`)}}}function ia(e){if(e!==void 0){y(Array.isArray(e),"event.recurrence.by_month_day must be an array");for(let t of e)y(typeof t=="number"&&Number.isInteger(t)&&t>=1&&t<=31,"event.recurrence.by_month_day entries must be integers 1..31")}}function sa(e){if(e!==void 0){y(Array.isArray(e),"event.recurrence.exdates must be an array");for(let t of e)y(typeof t=="string","event.recurrence.exdates entries must be strings"),y(q(t),"event.recurrence.exdates entries must be valid ISO timestamps")}}function aa(e){let t=qe(e,"event.recurrence must be an object");y(typeof t.freq=="string","event.recurrence.freq must be a string");let r=t.freq.trim().toLowerCase();y(rt.includes(r),`event.recurrence.freq must be one of: ${rt.join(", ")}`),vo(t,"interval","event.recurrence.interval"),vo(t,"count","event.recurrence.count"),ur(t,"until","event.recurrence.until"),oa(t.by_weekday),ia(t.by_month_day),sa(t.exdates)}function ca(e){for(let n of Io)y(typeof e[n]=="string",`${n} is required and must be a string`);let t=e.type;y(typeof t=="string"&&t.trim().length>0,"type must be a non-empty string");let r=e.pm_format_version;return r!==void 0&&y(typeof r=="number"&&Number.isInteger(r)&&r>=nr,`pm_format_version must be an integer >= ${nr}`),t}function da(e,t){let r=e.status;y(typeof r=="string"&&r.trim().length>0,"status must be a non-empty string");let n=t?.statusRegistry,o=lt(r,n),i=n?n.definitions.map(s=>s.id):[...Qe];y(o!==void 0,`status must be one of: ${i.join(", ")}`)}function la(e){let t=e.priority;y(typeof t=="number"&&Number.isInteger(t)&&[0,1,2,3,4].includes(t),"priority must be an integer 0..4");let r=e.tags;y(Array.isArray(r),"tags must be an array");for(let n of r)y(typeof n=="string","tags entries must be strings")}function ua(e){let t=e.confidence;if(t!==void 0){if(typeof t=="number"){y(Number.isInteger(t)&&t>=0&&t<=100,"confidence number value must be an integer 0..100");return}if(typeof t=="string"){let r=t.trim().toLowerCase(),n=r==="med"||tt.includes(r);y(n,`confidence string value must be one of: ${[...tt,"med"].join(", ")}`);return}y(!1,"confidence must be a number or string")}}function _a(e){let t=e.severity;if(t===void 0)return;typeof t!="string"&&Y("severity must be a string");let r=t.trim().toLowerCase(),n=r==="med"||et.includes(r);y(n,`severity value must be one of: ${[...et,"med"].join(", ")}`)}function fa(e){e.regression!==void 0&&typeof e.regression!="boolean"&&Y("regression must be a boolean")}function ma(e){let t=e.reminders;if(t!==void 0){y(Array.isArray(t),"reminders must be an array");for(let r of t){let n=qe(r,"reminders entries must be objects");y(typeof n.at=="string","reminder.at must be a string"),y(q(n.at),"reminder.at must be a valid ISO timestamp"),y(typeof n.text=="string","reminder.text must be a string"),y(n.text.trim().length>0,"reminder.text must not be empty")}}}function pa(e){for(let t of["title","description","location","timezone"])e[t]!==void 0&&(y(typeof e[t]=="string",`event.${t} must be a string`),y(e[t].trim().length>0,`event.${t} must not be empty`))}function ha(e){e.recurrence!==void 0&&(aa(e.recurrence),e.recurrence.until!==void 0&&y(G(e.recurrence.until,e.start_at)>=0,"event.recurrence.until must be at or after event.start_at"))}function ya(e){let t=qe(e,"events entries must be objects");y(typeof t.start_at=="string","event.start_at must be a string"),y(q(t.start_at),"event.start_at must be a valid ISO timestamp"),t.end_at!==void 0&&(y(typeof t.end_at=="string","event.end_at must be a string"),y(q(t.end_at),"event.end_at must be a valid ISO timestamp"),y(G(t.end_at,t.start_at)>0,"event.end_at must be after event.start_at")),pa(t),t.all_day!==void 0&&y(typeof t.all_day=="boolean","event.all_day must be a boolean"),ha(t)}function ga(e){let t=e.events;if(t!==void 0){y(Array.isArray(t),"events must be an array");for(let r of t)ya(r)}}function va(e){for(let t of["source_type","source_owner","design","external_ref"]){let r=e[t];r!==void 0&&y(typeof r=="string",`${t} must be a string`)}}function ba(e){let t=e.type_options;if(t===void 0)return;let r=qe(t,"type_options must be an object");for(let[n,o]of Object.entries(r))y(n.trim().length>0,"type_options keys must be non-empty"),y(typeof o=="string","type_options values must be strings"),y(o.trim().length>0,"type_options values must be non-empty strings")}function wa(e,t,r){if(r?.fieldRegistry)for(let n of r.fieldRegistry.definitions){let o=e[n.metadata_key];if(o===void 0){na(n,t)&&Y(`missing required schema field: ${n.metadata_key}`);continue}try{e[n.metadata_key]=Me(n,o,`metadata field "${n.metadata_key}"`,"metadata")}catch(i){Y(String(i?.message).replace(/^Invalid\s+/u,""))}}}function Ea(e,t){if(!t||t.unknownFieldPolicy==="allow")return;let r=Ao(t),n=Object.keys(e).filter(o=>!r.has(o)).sort((o,i)=>o.localeCompare(i));n.length!==0&&(t.unknownFieldPolicy==="reject"?Y(`unknown schema fields are not allowed: ${n.join(", ")}`):t.onWarning?.(`item_unknown_schema_fields:${n.join(",")}`))}function _r(e,t){let r=qe(e,"item metadata must be an object"),n=ca(r);da(r,t),la(r),ua(r),_a(r),fa(r),ar(r,"created_at"),ar(r,"updated_at"),r.deadline!==void 0&&ar(r,"deadline"),ma(r),ga(r),ur(r,"closed_at","closed_at"),ur(r,"completed_at","completed_at"),va(r),ba(r),wa(r,n,t),Ea(r,t)}function ka(e){if(!(!e||e.length===0))return[...e].map((t,r)=>(y(t.created_at===void 0||typeof t.created_at=="string"&&st(t.created_at),`dependencies.${r}.created_at requires a valid timestamp; restore the dependency timestamp from its source record`),{id:t.id.trim(),kind:t.kind,created_at:t.created_at,author:t.author?.trim()||void 0,source_kind:t.source_kind?.trim()||void 0,author_source:t.author_source})).sort((t,r)=>{let n=G(t.created_at??"",r.created_at??"");if(n!==0)return n;let o=t.id.localeCompare(r.id);if(o!==0)return o;let i=t.kind.localeCompare(r.kind);return i!==0?i:(t.source_kind??"").localeCompare(r.source_kind??"")})}function cr(e){if(!(!e||e.length===0))return[...e].sort((t,r)=>{let n=G(t.created_at,r.created_at);if(n!==0)return n;let o=t.text.localeCompare(r.text);return o!==0?o:t.author.localeCompare(r.author)})}function Sa(e){if(!e||e.length===0)return;let t=[...e].map(r=>({at:r.at,text:r.text.trim()})).filter(r=>r.text.length>0).sort((r,n)=>{let o=G(r.at,n.at);return o!==0?o:r.text.localeCompare(n.text)});return t.length===0?void 0:t}function Ia(e){if(!e)return;let t=e.freq.trim().toLowerCase();if(!rt.includes(t))return;let r=Array.from(new Set((e.by_weekday??[]).map(s=>s.trim().toLowerCase()).filter(s=>nt.includes(s)))).sort((s,a)=>er(s)-er(a)),n=Array.from(new Set((e.by_month_day??[]).filter(s=>Number.isInteger(s)&&s>=1&&s<=31).map(s=>s))).sort((s,a)=>s-a),o=Array.from(new Set((e.exdates??[]).map(s=>s.trim()).filter(s=>q(s)))).sort((s,a)=>G(s,a)),i={freq:t,interval:e.interval!==void 0&&e.interval>1?e.interval:void 0,count:e.count,until:e.until?.trim()||void 0,by_weekday:r.length>0?r:void 0,by_month_day:n.length>0?n:void 0,exdates:o.length>0?o:void 0};for(let[s,a]of Object.entries(i))a===void 0&&delete i[s];return i}function Oa(e){return!Array.isArray(e)||e.length===0?void 0:[...e].map(Ta).sort(Aa)}function Ta(e){let t={start_at:e.start_at,end_at:e.end_at||void 0,title:e.title?.trim()||void 0,description:e.description?.trim()||void 0,location:e.location?.trim()||void 0,all_day:e.all_day,timezone:e.timezone?.trim()||void 0,recurrence:Ia(e.recurrence)};return ft(t),t}function Aa(e,t){return So([G(e.start_at,t.start_at),(e.end_at??"").localeCompare(t.end_at??""),(e.title??"").localeCompare(t.title??""),+!!e.all_day-+!!t.all_day,(e.timezone??"").localeCompare(t.timezone??""),(e.location??"").localeCompare(t.location??""),(e.description??"").localeCompare(t.description??""),JSON.stringify(e.recurrence??{}).localeCompare(JSON.stringify(t.recurrence??{}))])}function xa(e){if(!(!e||e.length===0))return e.map(t=>({path:Ie(t.path),scope:t.scope,note:t.note?.trim()||void 0}))}function Ca(e){if(!e||e.length===0)return;let t=e.map(Pa).filter(r=>r.run_id.length>0&&r.started_at.length>0&&r.finished_at.length>0&&r.recorded_at.length>0).sort((r,n)=>So([G(r.recorded_at,n.recorded_at),r.run_id.localeCompare(n.run_id),r.kind.localeCompare(n.kind)]));return t.length>0?t:void 0}function ke(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):void 0}function Na(e){return typeof e=="number"&&Number.isFinite(e)&&e>=1?Math.floor(e):void 0}function dr(e){return typeof e=="string"?e:""}function Ra(e){if(!Array.isArray(e))return;let t=e.filter(n=>n!==null&&typeof n=="object"&&typeof n.name=="string"&&n.name.trim().length>0&&typeof n.value=="number"&&Number.isFinite(n.value)&&typeof n.recorded_at=="string"&&n.recorded_at.trim().length>0).map(n=>({name:n.name.trim(),value:n.value,unit:typeof n.unit=="string"&&n.unit.trim()||void 0,threshold:typeof n.threshold=="number"&&Number.isFinite(n.threshold)?n.threshold:void 0,recorded_at:n.recorded_at.trim()})),r=[...new Map(t.map(n=>[n.name,n])).values()].sort((n,o)=>n.name.localeCompare(o.name)).slice(0,32);return r.length>0?r:void 0}function _t(e,t){return typeof e=="string"&&t.has(e)?e:void 0}function Da(e){if(!Array.isArray(e))return;let t=e.filter(r=>r&&typeof r.command=="string"&&r.command.trim().length>0).slice(0,32).map(r=>({command:r.command.trim(),requested_pm_context_mode:_t(r.requested_pm_context_mode,lr),pm_context_mode:_t(r.pm_context_mode,lr),workspace_context_mode:_t(r.workspace_context_mode,ko),trust_reason:_t(r.trust_reason,Qs)}));return t.length>0?t:void 0}function Pa(e){let t=typeof e.run_id=="string"?e.run_id.trim():"",r=e.kind==="test"||e.kind==="test-all"?e.kind:"test",n=ea.has(e.status)?e.status:"failed",o={run_id:t,kind:r,status:n,started_at:dr(e.started_at),finished_at:dr(e.finished_at),recorded_at:dr(e.recorded_at),attempt:Na(e.attempt),resumed_from:e.resumed_from?.trim()||void 0,passed:ke(e.passed)??0,failed:ke(e.failed)??0,skipped:ke(e.skipped)??0,items:ke(e.items),linked_tests:ke(e.linked_tests),fail_on_skipped_triggered:e.fail_on_skipped_triggered===!0?!0:void 0,measurements:Ra(e.measurements),executions:Da(e.executions)};return ft(o),o}function ja(e){if(!(!Array.isArray(e)||e.length===0))return e.map($a)}function Ve(e){if(!Array.isArray(e))return;let t=[...new Set(e.filter(r=>typeof r=="string").map(r=>r.trim()).filter(r=>r.length>0))].sort((r,n)=>r.localeCompare(n));return t.length>0?t:void 0}function hr(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function yr(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function bo(e){if(!hr(e))return;let t=Object.entries(e).map(([r,n])=>[r.trim(),String(n).trim()]).filter(([r,n])=>r.length>0&&!yr(r)&&n.length>0).sort(([r],[n])=>r.localeCompare(n));return t.length>0?Object.fromEntries(t):void 0}function La(e){if(!hr(e))return;let t=Object.entries(e).map(([r,n])=>[r.trim(),Number(n)]).filter(([r,n])=>r.length>0&&!yr(r)&&Number.isFinite(n)).sort(([r],[n])=>r.localeCompare(n));return t.length>0?Object.fromEntries(t):void 0}function Ha(e){let t=e?.trim().toLowerCase();if(!(!t||!lr.has(t)))return t}function Fa(e){let t=e?.trim().toLowerCase();if(!(!t||!ko.has(t)))return t}function za(e,t){if(t===!0)return{provenance_invalid:!0};if(e===void 0)return{};if(!hr(e))return{provenance_invalid:!0};let r=m(e.author),n=m(e.created_at),o=e.source_kind;return!r||!n||!q(n)||o!=="local_mutation"&&o!=="merge_union"?{provenance_invalid:!0}:{provenance:{author:r,created_at:n,source_kind:o,source_ref:m(e.source_ref)}}}function $a(e){let t={command:e.command?.trim()||void 0,path:e.path?Ie(e.path):void 0,scope:e.scope,timeout_seconds:typeof e.timeout_seconds=="number"&&Number.isFinite(e.timeout_seconds)&&e.timeout_seconds>0?e.timeout_seconds:void 0,pm_context_mode:Ha(e.pm_context_mode),workspace_context_mode:Fa(e.workspace_context_mode),...za(e.provenance,e.provenance_invalid),updated_by:m(e.updated_by),updated_at:m(e.updated_at),env_set:bo(e.env_set),env_clear:Ve(e.env_clear),shared_host_safe:e.shared_host_safe===!0?!0:void 0,assert_stdout_contains:Ve(e.assert_stdout_contains),assert_stdout_regex:Ve(e.assert_stdout_regex),assert_stderr_contains:Ve(e.assert_stderr_contains),assert_stderr_regex:Ve(e.assert_stderr_regex),assert_stdout_min_lines:ke(e.assert_stdout_min_lines),assert_json_field_equals:bo(e.assert_json_field_equals),assert_json_field_gte:La(e.assert_json_field_gte),note:e.note?.trim()||void 0};return ft(t),t}function Ma(e){if(!(!e||e.length===0))return[...e].map(t=>({path:Ie(t.path),scope:t.scope,note:t.note?.trim()||void 0})).sort((t,r)=>{let n=t.scope.localeCompare(r.scope);if(n!==0)return n;let o=t.path.localeCompare(r.path);return o!==0?o:(t.note??"").localeCompare(r.note??"")})}function m(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function Va(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.id),i=m(n.kind);if(!o||!i)continue;let s={id:o,kind:i},a=m(n.note);a&&(s.note=a),n.required_before_step===!0&&(s.required_before_step=!0),t.push(s)}return t.length>0?t:void 0}function Ua(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.path);if(!o)continue;let i={path:Ie(o)};(n.scope==="project"||n.scope==="global")&&(i.scope=n.scope);let s=m(n.note);s&&(i.note=s),t.push(i)}return t.length>0?t:void 0}function Wa(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.command),i=m(n.path);if(!o&&!i)continue;let s={};o&&(s.command=o),i&&(s.path=Ie(i));let a=m(n.note);a&&(s.note=a),t.push(s)}return t.length>0?t:void 0}function qa(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.path);if(!o)continue;let i={path:Ie(o)};(n.scope==="project"||n.scope==="global")&&(i.scope=n.scope);let s=m(n.note);s&&(i.note=s),t.push(i)}return t.length>0?t:void 0}function Ga(e){if(e===null||typeof e!="object")return;let t=e,r=m(t.id),n=m(t.title),o=m(t.status),i=o&&ta.has(o)?o:void 0,s=qn(t.order)??Number.NaN,a=typeof t.created_at=="string"?t.created_at:"",d=typeof t.updated_at=="string"?t.updated_at:"";if(!r||!n||!i||!Number.isFinite(s)||!a||!d)return;let l={id:r,order:s,title:n,status:i,created_at:a,updated_at:d};return Ba(l,t),l}function Ba(e,t){let r=[["body","body"],["owner","owner"],["evidence","evidence"],["blocked_reason","blocked_reason"],["superseded_by","superseded_by"]];for(let[i,s]of r){let a=m(t[s]);a&&(e[i]=a)}let n=typeof t.completed_at=="string"?t.completed_at:void 0;n&&n.length>0&&(e.completed_at=n);let o=[["linked_items","linked_items",Va],["files","files",Ua],["tests","tests",Wa],["docs","docs",qa]];for(let[i,s,a]of o){let d=a(t[s]);d&&(e[i]=d)}}function Ja(e){if(!Array.isArray(e))return;let t=e.flatMap(r=>{let n=Ga(r);return n?[n]:[]});return t.sort((r,n)=>r.order-n.order),t.length>0?t:void 0}function Ka(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=typeof n.ts=="string"?n.ts:"",i=typeof n.author=="string"?n.author:"",s=m(n.decision);if(!o||!i||!s)continue;let a={ts:o,author:i,decision:s},d=m(n.rationale);d&&(a.rationale=d);let l=m(n.evidence);l&&(a.evidence=l);let _=m(n.step_id);_&&(a.step_id=_),t.push(a)}return t.length>0?t:void 0}function Ya(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=typeof n.ts=="string"?n.ts:"",i=typeof n.author=="string"?n.author:"",s=m(n.text);if(!o||!i||!s)continue;let a={ts:o,author:i,text:s},d=m(n.step_id);d&&(a.step_id=d),t.push(a)}return t.length>0?t:void 0}function Xa(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.text);if(!o)continue;let i={text:o},s=m(n.command);s&&(i.command=s);let a=m(n.expected);a&&(i.expected=a),t.push(i)}return t.length>0?t:void 0}function Za(e){if(!e)return;let t=Object.entries(e).map(([r,n])=>[r.trim(),n.trim()]).filter(([r,n])=>r.length>0&&n.length>0).sort((r,n)=>r[0].localeCompare(n[0]));if(t.length!==0)return Object.fromEntries(t)}function Se(e){let t=0;for(;t<e.length&&e[t]===`
|
|
1
|
+
import{c as He,e as Fe,f as ze,i as Jn,j as Kn,k as Yn,l as Xn,m as Zn}from"./chunk-CWFNQQZE.js";import{h as io}from"./chunk-4PW5XWVI.js";import{A as er,Aa as we,C as $n,Fa as Bn,Ga as A,Gc as to,Ha as z,Hd as $e,Ia as ot,Id as q,Ja as v,Jd as st,Kd as Ee,Ld as G,Pd as ro,Qd as no,Sd as oo,Wd as $,fa as qn,i as Qe,j as Pn,k as jn,ka as Gn,l as Ln,m as Hn,q as et,r as tt,rc as Qn,s as Fn,tc as it,ve as rr,x as zn,xc as eo,y as rt,z as nt}from"./chunk-4LDOL6U7.js";import{A as w,C as Vn,D as W,E as ie,F as be,G as Un,H as tr,I as Le,J as Wn,m as J,u as Mn,x as h,y as je,z as E}from"./chunk-G6ERMFJ5.js";import{createHash as js}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ca5b60a5-80a7-5e7d-917f-4c7649bcbab6")}catch{}})();var Su=["sha256","sha512"],Ls="sha256",so="sha256";function se(e){if(e===void 0)return Ls;if(e==="sha256"||e==="sha512")return e;throw new TypeError(`unsupported_history_hash_algorithm:${String(e)}`)}function K(e,t){return js(se(t)).update(e,"utf8").digest("hex")}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6635e694-c788-5805-adb8-ed93cc931946")}catch{}})();var Hs=16;function at(e){let t=e.trim().replaceAll(/[^A-Za-z0-9]+/g," ").split(/\s+/).filter(o=>o.length>0).map(o=>o.toLowerCase());if(t.length===0)return e;let[r,...n]=t;return`${r}${n.map(o=>`${o.slice(0,1).toUpperCase()}${o.slice(1)}`).join("")}`}function Nu(e,t,r=new Set,n){if(uo(e,t,n))return;let o=_o(e,t,r,n),i=ct(e);return[at(e.cli_flag),...i].find(s=>!o.has(s)&&lo(s,i,o))}function lo(e,t,r){for(let n of t){if(n===e)break;if(r.has(n))return!1}return!0}function uo(e,t,r){return t.definitions.some(n=>n!==e&&n.metadata_key===e.metadata_key&&(r===void 0||n.commands.includes(r)))}function _o(e,t,r,n){return new Set([...r,...t.definitions.filter(o=>o!==e&&(n===void 0||o.commands.includes(n))).flatMap(o=>ct(o))])}function fo(e){return e.replace(/^-+/u,"").startsWith("no-")}function Fs(e){return e.startsWith("-")?e:`--${e}`}function Ru(e,t,r,n){if(uo(e,t,n))return;let o=_o(e,t,r.options,n),i=ct(e);return[e.cli_flag,...e.cli_aliases].find(s=>{let a=mo(s);return fo(s)||r.flags.has(Fs(s))||o.has(a)?!1:lo(a,i,o)})}function mo(e){return e.replace(/^-+/u,"").replace(/^no-/u,"").split("-").reduce((t,r)=>`${t}${r.charAt(0).toUpperCase()}${r.slice(1)}`)}function ct(e){return[...new Set([Zn(e),at(e.key),at(e.cli_flag),...e.cli_aliases.map(t=>at(t)),...[e.cli_flag,...e.cli_aliases].filter(t=>!fo(t)).map(t=>mo(t))])]}function po(e,t){for(let r of ct(t)){if(!Object.hasOwn(e,r))continue;let n=e[r];if(n!==void 0)return n}}function ho(e){return Array.isArray(e)?e.flatMap(t=>ho(t)).map(t=>t.trim()).filter(t=>t.length>0):typeof e=="string"?e.split(/[,\n|]/).map(t=>t.trim()).filter(t=>t.length>0):e==null?[]:[String(e).trim()].filter(t=>t.length>0)}function ao(e,t){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e=="string"){let r=e.trim().toLowerCase();if(r==="true"||r==="1"||r==="yes")return!0;if(r==="false"||r==="0"||r==="no")return!1}throw new w(`${t} must be one of true|false|1|0|yes|no`,E.USAGE)}function co(e,t){if(typeof e=="number"&&Number.isFinite(e))return e;let r=typeof e=="string"?e.trim():String(e),n=Number(r);if(!Number.isFinite(n))throw new w(`${t} must be a number`,E.USAGE);return n}function zs(e,t,r){let n=typeof e=="string"?(()=>{try{return JSON.parse(e)}catch{return}})():e;if(r==="array"&&Array.isArray(n)||r==="object"&&typeof n=="object"&&n!==null&&!Array.isArray(n))return n;throw new w(`${t} must be valid JSON ${r}`,E.USAGE)}function $s(e,t){return t===void 0?!0:t==="array"?Array.isArray(e):t==="object"?typeof e=="object"&&e!==null&&!Array.isArray(e):typeof e===t}function Ms(e,t,r){if(t.const!==void 0&&A(e)!==A(t.const))return`${r} must equal ${A(t.const)}`;if(t.enum!==void 0&&!t.enum.some(n=>A(n)===A(e)))return`${r} must be one of ${t.enum.map(n=>A(n)).join("|")}`;if(!$s(e,t.type))return`${r} must match configured type ${String(t.type)}`;if(typeof e=="string"){if(t.min_length!==void 0&&e.length<t.min_length)return`${r} must contain at least ${t.min_length} characters`;if(t.format==="date-time"&&!st(e))return`${r} must be an RFC 3339 date-time`}}function Vs(e,t,r,n){if(Array.isArray(e)){if(t.min_items!==void 0&&e.length<t.min_items)return`${r} must contain at least ${t.min_items} items`;if(t.items)for(let[o,i]of e.entries()){let s=dt(i,t.items,`${r}[${o}]`,n+1);if(s)return s}}}function Us(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))return;let o=e;for(let i of t.required??[])if(!Object.hasOwn(o,i))return`${r}.${i} is required`;for(let[i,s]of Object.entries(o)){let a=t.properties?.[i];if(!a){if(t.additional_properties===!1)return`${r}.${i} is not allowed`;continue}let d=dt(s,a,`${r}.${i}`,n+1);if(d)return d}}function dt(e,t,r,n=0){if(n>Hs)return`${r} value schema exceeds maximum depth`;let o=Ms(e,t,r);if(o)return o;let i=Vs(e,t,r,n);if(i)return i;let s=Us(e,t,r,n);if(s)return s;if(!t.one_of)return;let a=0;for(let d of t.one_of)if(dt(e,d,r,n+1)===void 0&&(a+=1,a>1))break;return a===1?void 0:`${r} must match exactly one configured schema variant`}function ae(e,t,r){if(!e.value_schema||t===void 0)return t;let n=dt(t,e.value_schema,r);if(n)throw new w(n,E.USAGE);return t}function Ws(e,t,r,n){let o=n==="option"&&Array.isArray(t)?t[t.length-1]:t;if(o!==void 0)return ae(e,zs(o,r,e.type),r)}function Me(e,t,r,n="option"){let o=r??`--${e.cli_flag}`;if(e.type==="array"||e.type==="object")return Ws(e,t,o,n);if(e.repeatable||e.type==="string_array"){let s=ho(t);return e.type==="number"?ae(e,s.map(a=>co(a,o)),o):e.type==="boolean"?ae(e,s.map(a=>ao(a,o)),o):ae(e,s,o)}let i=Array.isArray(t)?t[t.length-1]:t;if(i!==void 0)return e.type==="number"?ae(e,co(i,o),o):e.type==="boolean"?ae(e,ao(i,o),o):ae(e,typeof i=="string"?i:String(i),o)}function qs(e,t){return!e.required&&!e.required_on_create?!1:e.required_types.length===0?!0:t?e.required_types.map(r=>r.toLowerCase()).includes(t.trim().toLowerCase()):!1}function Du(e,t,r){let n={},o=[];for(let i of t.command_to_fields.get("create")??[]){let s=po(e,i);if(s===void 0){qs(i,r)&&o.push(`--${i.cli_flag}`);continue}n[i.metadata_key]=Me(i,s)}return{values:n,missing_required_flags:[...new Set(o)].sort((i,s)=>i.localeCompare(s))}}function Pu(e,t,r=["update"]){let n={},o=(r??["update"]).flatMap(s=>t.command_to_fields.get(s)??[]),i=new Set;for(let s of o){let a=po(e,s);a!==void 0&&(i.has(s.metadata_key)||(i.add(s.metadata_key),n[s.metadata_key]=Me(s,a)))}return n}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c35d4830-d7d1-5ee4-99bc-ab52cc3e4e09")}catch{}})();var nr=1,or=2;function Lu(e){return Math.max(ir(e),e.tests?.some(t=>t.updated_by!==void 0||t.updated_at!==void 0)?2:1)}function ir(e){let t=e.pm_format_version;return typeof t=="number"&&Number.isInteger(t)&&t>=1?t:1}function yo(e){if(!(typeof e!="number"||!Number.isInteger(e)||e<=1))return e}function Gs(e,t=2,r=t){return e<r?"outdated":e>t?"ahead":"current"}function Hu(e,t=2,r=t){let n=[],o=[];for(let i of e){let s=Gs(i.version,t,r);s==="outdated"?n.push(i.ref):s==="ahead"&&o.push(i.ref)}return{outdated:n.sort((i,s)=>i.localeCompare(s)),ahead:o.sort((i,s)=>i.localeCompare(s))}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="515840b7-cf86-5d71-8ac1-beac7fd7c8a8")}catch{}})();var Bs={"in-progress":"in_progress",cancelled:"canceled"};function lt(e,t){if(t){let o=Yn(e,t);if(o)return o}if(typeof e!="string")return;let r=e.trim().toLowerCase();if(!r)return;let n=Bs[r]??r;if(Qe.includes(n))return n}function Js(e,t){return lt(e,t)??e}function Mu(e,t){return t.terminal_statuses.has(Js(e,t))}import{encode as Zs}from"@toon-format/toon";import{isDeepStrictEqual as go}from"node:util";import{decode as Ks}from"@toon-format/toon";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aaa2be03-9478-5fbe-82e6-e4fc86e3735b")}catch{}})();function sr(e){return{value:Ks(e),usedScalarBracketEscape:!1}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="79626299-17a8-573a-9b66-ce37c65e2f5d")}catch{}})();var Ys=/^\s*(<<<<<<<|=======|>>>>>>>)(?:\s.*)?$/;function Xs(e){if(e.length===0)return[];let t=e.split(/\r?\n/),r=[];for(let n=0;n<t.length;n+=1){let o=t[n]??"",i=o.match(Ys);if(!i)continue;let s=i[1];r.push({line:n+1,marker:s,text:o})}return r}function ut(e){return Xs(e)[0]}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2789e87f-0706-52e8-8f4c-3855c65c618c")}catch{}})();var lr=new Set(["schema","tracker","auto","none"]),ko=new Set(["source","isolated","snapshot"]),Qs=new Set(["legacy","local_mutation","local_source_ref","acknowledged","invalid_provenance","foreign_source_ref"]),ea=new Set(["passed","failed","stopped","canceled"]),ta=new Set($n);function Ie(e){return e.replaceAll("\\","/")}function So(e){for(let t of e)if(t!==0)return t;return 0}function ft(e){for(let[t,r]of Object.entries(e))r===void 0&&delete e[t]}var Io=["id","title","description","created_at","updated_at"],ra=new Set(J);function Oo(e){if(e?.schema)return{statusRegistry:Kn(e.schema),fieldRegistry:Xn(e.schema),unknownFieldPolicy:e.schema.unknown_field_policy??"allow",extensionFieldNames:new Set(e.extensionFieldNames??[]),onWarning:e.onWarning}}function na(e,t){return e.required?e.required_types.length===0?!0:e.required_types.map(r=>r.toLowerCase()).includes(t.trim().toLowerCase()):!1}function Y(e){let t=e.match(/^([a-z_][\w.]*)\s/u)?.[1];throw new w(`Invalid item metadata: ${e}`,E.GENERIC_FAILURE,{code:"item_document_invalid",reason:e.includes("required")?"missing_required_field":"schema_validation_error",...t?{field:t}:{},required:"Provide an item document whose metadata satisfies the active runtime schema.",why:e})}function We(e,t){throw new w(t,E.GENERIC_FAILURE,{code:"item_document_invalid",reason:"syntax_error",format:e,required:`Provide a syntactically valid ${e==="toon"?"TOON":"JSON Markdown"} item document.`,why:"The document could not be decoded far enough to validate item metadata."})}function To(e,t){if(!t||typeof e!="object"||e===null)return;let r=ir(e);if(!(r<=or))throw new w(`Stored item uses format version ${r}; this runtime supports up to ${or}. Upgrade pm before reading or changing this item.`,E.CONFLICT,{code:"item_format_version_unsupported",format_version:r,required:"Upgrade to a pm runtime supporting the stored item format.",nextSteps:["Preserve the original item and history; do not lower pm_format_version to bypass compatibility checks."]})}function Ao(e){let t=new Set(ra);for(let r of e.fieldRegistry?.definitions??[])t.add(r.metadata_key);for(let r of e.extensionFieldNames)t.add(r);return t}function y(e,t){e||Y(t)}function qe(e,t){return(typeof e!="object"||e===null||Array.isArray(e))&&Y(t),e}function ar(e,t){let r=e[t];y(typeof r=="string",`${t} must be a string`),y(q(r),`${t} must be a valid ISO timestamp`)}function vo(e,t,r){let n=e[t];n!==void 0&&y(typeof n=="number"&&Number.isInteger(n)&&n>=1,`${r} must be an integer >= 1`)}function ur(e,t,r){let n=e[t];n!==void 0&&(y(typeof n=="string",`${r} must be a string`),y(q(n),`${r} must be a valid ISO timestamp`))}function oa(e){if(e!==void 0){y(Array.isArray(e),"event.recurrence.by_weekday must be an array");for(let t of e){y(typeof t=="string","event.recurrence.by_weekday entries must be strings");let r=t.trim().toLowerCase();y(nt.includes(r),`event.recurrence.by_weekday entries must be one of: ${nt.join(", ")}`)}}}function ia(e){if(e!==void 0){y(Array.isArray(e),"event.recurrence.by_month_day must be an array");for(let t of e)y(typeof t=="number"&&Number.isInteger(t)&&t>=1&&t<=31,"event.recurrence.by_month_day entries must be integers 1..31")}}function sa(e){if(e!==void 0){y(Array.isArray(e),"event.recurrence.exdates must be an array");for(let t of e)y(typeof t=="string","event.recurrence.exdates entries must be strings"),y(q(t),"event.recurrence.exdates entries must be valid ISO timestamps")}}function aa(e){let t=qe(e,"event.recurrence must be an object");y(typeof t.freq=="string","event.recurrence.freq must be a string");let r=t.freq.trim().toLowerCase();y(rt.includes(r),`event.recurrence.freq must be one of: ${rt.join(", ")}`),vo(t,"interval","event.recurrence.interval"),vo(t,"count","event.recurrence.count"),ur(t,"until","event.recurrence.until"),oa(t.by_weekday),ia(t.by_month_day),sa(t.exdates)}function ca(e){for(let n of Io)y(typeof e[n]=="string",`${n} is required and must be a string`);let t=e.type;y(typeof t=="string"&&t.trim().length>0,"type must be a non-empty string");let r=e.pm_format_version;return r!==void 0&&y(typeof r=="number"&&Number.isInteger(r)&&r>=nr,`pm_format_version must be an integer >= ${nr}`),t}function da(e,t){let r=e.status;y(typeof r=="string"&&r.trim().length>0,"status must be a non-empty string");let n=t?.statusRegistry,o=lt(r,n),i=n?n.definitions.map(s=>s.id):[...Qe];y(o!==void 0,`status must be one of: ${i.join(", ")}`)}function la(e){let t=e.priority;y(typeof t=="number"&&Number.isInteger(t)&&[0,1,2,3,4].includes(t),"priority must be an integer 0..4");let r=e.tags;y(Array.isArray(r),"tags must be an array");for(let n of r)y(typeof n=="string","tags entries must be strings")}function ua(e){let t=e.confidence;if(t!==void 0){if(typeof t=="number"){y(Number.isInteger(t)&&t>=0&&t<=100,"confidence number value must be an integer 0..100");return}if(typeof t=="string"){let r=t.trim().toLowerCase(),n=r==="med"||tt.includes(r);y(n,`confidence string value must be one of: ${[...tt,"med"].join(", ")}`);return}y(!1,"confidence must be a number or string")}}function _a(e){let t=e.severity;if(t===void 0)return;typeof t!="string"&&Y("severity must be a string");let r=t.trim().toLowerCase(),n=r==="med"||et.includes(r);y(n,`severity value must be one of: ${[...et,"med"].join(", ")}`)}function fa(e){e.regression!==void 0&&typeof e.regression!="boolean"&&Y("regression must be a boolean")}function ma(e){let t=e.reminders;if(t!==void 0){y(Array.isArray(t),"reminders must be an array");for(let r of t){let n=qe(r,"reminders entries must be objects");y(typeof n.at=="string","reminder.at must be a string"),y(q(n.at),"reminder.at must be a valid ISO timestamp"),y(typeof n.text=="string","reminder.text must be a string"),y(n.text.trim().length>0,"reminder.text must not be empty")}}}function pa(e){for(let t of["title","description","location","timezone"])e[t]!==void 0&&(y(typeof e[t]=="string",`event.${t} must be a string`),y(e[t].trim().length>0,`event.${t} must not be empty`))}function ha(e){e.recurrence!==void 0&&(aa(e.recurrence),e.recurrence.until!==void 0&&y(G(e.recurrence.until,e.start_at)>=0,"event.recurrence.until must be at or after event.start_at"))}function ya(e){let t=qe(e,"events entries must be objects");y(typeof t.start_at=="string","event.start_at must be a string"),y(q(t.start_at),"event.start_at must be a valid ISO timestamp"),t.end_at!==void 0&&(y(typeof t.end_at=="string","event.end_at must be a string"),y(q(t.end_at),"event.end_at must be a valid ISO timestamp"),y(G(t.end_at,t.start_at)>0,"event.end_at must be after event.start_at")),pa(t),t.all_day!==void 0&&y(typeof t.all_day=="boolean","event.all_day must be a boolean"),ha(t)}function ga(e){let t=e.events;if(t!==void 0){y(Array.isArray(t),"events must be an array");for(let r of t)ya(r)}}function va(e){for(let t of["source_type","source_owner","design","external_ref"]){let r=e[t];r!==void 0&&y(typeof r=="string",`${t} must be a string`)}}function ba(e){let t=e.type_options;if(t===void 0)return;let r=qe(t,"type_options must be an object");for(let[n,o]of Object.entries(r))y(n.trim().length>0,"type_options keys must be non-empty"),y(typeof o=="string","type_options values must be strings"),y(o.trim().length>0,"type_options values must be non-empty strings")}function wa(e,t,r){if(r?.fieldRegistry)for(let n of r.fieldRegistry.definitions){let o=e[n.metadata_key];if(o===void 0){na(n,t)&&Y(`missing required schema field: ${n.metadata_key}`);continue}try{e[n.metadata_key]=Me(n,o,`metadata field "${n.metadata_key}"`,"metadata")}catch(i){Y(String(i?.message).replace(/^Invalid\s+/u,""))}}}function Ea(e,t){if(!t||t.unknownFieldPolicy==="allow")return;let r=Ao(t),n=Object.keys(e).filter(o=>!r.has(o)).sort((o,i)=>o.localeCompare(i));n.length!==0&&(t.unknownFieldPolicy==="reject"?Y(`unknown schema fields are not allowed: ${n.join(", ")}`):t.onWarning?.(`item_unknown_schema_fields:${n.join(",")}`))}function _r(e,t){let r=qe(e,"item metadata must be an object"),n=ca(r);da(r,t),la(r),ua(r),_a(r),fa(r),ar(r,"created_at"),ar(r,"updated_at"),r.deadline!==void 0&&ar(r,"deadline"),ma(r),ga(r),ur(r,"closed_at","closed_at"),ur(r,"completed_at","completed_at"),va(r),ba(r),wa(r,n,t),Ea(r,t)}function ka(e){if(!(!e||e.length===0))return[...e].map((t,r)=>(y(t.created_at===void 0||typeof t.created_at=="string"&&st(t.created_at),`dependencies.${r}.created_at requires a valid timestamp; restore the dependency timestamp from its source record`),{id:t.id.trim(),kind:t.kind,created_at:t.created_at,author:t.author?.trim()||void 0,source_kind:t.source_kind?.trim()||void 0,author_source:t.author_source})).sort((t,r)=>{let n=G(t.created_at??"",r.created_at??"");if(n!==0)return n;let o=t.id.localeCompare(r.id);if(o!==0)return o;let i=t.kind.localeCompare(r.kind);return i!==0?i:(t.source_kind??"").localeCompare(r.source_kind??"")})}function cr(e){if(!(!e||e.length===0))return[...e].sort((t,r)=>{let n=G(t.created_at,r.created_at);if(n!==0)return n;let o=t.text.localeCompare(r.text);return o!==0?o:t.author.localeCompare(r.author)})}function Sa(e){if(!e||e.length===0)return;let t=[...e].map(r=>({at:r.at,text:r.text.trim()})).filter(r=>r.text.length>0).sort((r,n)=>{let o=G(r.at,n.at);return o!==0?o:r.text.localeCompare(n.text)});return t.length===0?void 0:t}function Ia(e){if(!e)return;let t=e.freq.trim().toLowerCase();if(!rt.includes(t))return;let r=Array.from(new Set((e.by_weekday??[]).map(s=>s.trim().toLowerCase()).filter(s=>nt.includes(s)))).sort((s,a)=>er(s)-er(a)),n=Array.from(new Set((e.by_month_day??[]).filter(s=>Number.isInteger(s)&&s>=1&&s<=31).map(s=>s))).sort((s,a)=>s-a),o=Array.from(new Set((e.exdates??[]).map(s=>s.trim()).filter(s=>q(s)))).sort((s,a)=>G(s,a)),i={freq:t,interval:e.interval!==void 0&&e.interval>1?e.interval:void 0,count:e.count,until:e.until?.trim()||void 0,by_weekday:r.length>0?r:void 0,by_month_day:n.length>0?n:void 0,exdates:o.length>0?o:void 0};for(let[s,a]of Object.entries(i))a===void 0&&delete i[s];return i}function Oa(e){return!Array.isArray(e)||e.length===0?void 0:[...e].map(Ta).sort(Aa)}function Ta(e){let t={start_at:e.start_at,end_at:e.end_at||void 0,title:e.title?.trim()||void 0,description:e.description?.trim()||void 0,location:e.location?.trim()||void 0,all_day:e.all_day,timezone:e.timezone?.trim()||void 0,recurrence:Ia(e.recurrence)};return ft(t),t}function Aa(e,t){return So([G(e.start_at,t.start_at),(e.end_at??"").localeCompare(t.end_at??""),(e.title??"").localeCompare(t.title??""),+!!e.all_day-+!!t.all_day,(e.timezone??"").localeCompare(t.timezone??""),(e.location??"").localeCompare(t.location??""),(e.description??"").localeCompare(t.description??""),JSON.stringify(e.recurrence??{}).localeCompare(JSON.stringify(t.recurrence??{}))])}function xa(e){if(!(!e||e.length===0))return e.map(t=>({path:Ie(t.path),scope:t.scope,note:t.note?.trim()||void 0}))}function Ca(e){if(!e||e.length===0)return;let t=e.map(Pa).filter(r=>r.run_id.length>0&&r.started_at.length>0&&r.finished_at.length>0&&r.recorded_at.length>0).sort((r,n)=>So([G(r.recorded_at,n.recorded_at),r.run_id.localeCompare(n.run_id),r.kind.localeCompare(n.kind)]));return t.length>0?t:void 0}function ke(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.floor(e):void 0}function Na(e){return typeof e=="number"&&Number.isFinite(e)&&e>=1?Math.floor(e):void 0}function dr(e){return typeof e=="string"?e:""}function Ra(e){if(!Array.isArray(e))return;let t=e.filter(n=>n!==null&&typeof n=="object"&&typeof n.name=="string"&&n.name.trim().length>0&&typeof n.value=="number"&&Number.isFinite(n.value)&&typeof n.recorded_at=="string"&&n.recorded_at.trim().length>0).map(n=>({name:n.name.trim(),value:n.value,unit:typeof n.unit=="string"&&n.unit.trim()||void 0,threshold:typeof n.threshold=="number"&&Number.isFinite(n.threshold)?n.threshold:void 0,recorded_at:n.recorded_at.trim()})),r=[...new Map(t.map(n=>[n.name,n])).values()].sort((n,o)=>n.name.localeCompare(o.name)).slice(0,32);return r.length>0?r:void 0}function _t(e,t){return typeof e=="string"&&t.has(e)?e:void 0}function Da(e){if(!Array.isArray(e))return;let t=e.filter(r=>r&&typeof r.command=="string"&&r.command.trim().length>0).slice(0,32).map(r=>({command:r.command.trim(),requested_pm_context_mode:_t(r.requested_pm_context_mode,lr),pm_context_mode:_t(r.pm_context_mode,lr),workspace_context_mode:_t(r.workspace_context_mode,ko),trust_reason:_t(r.trust_reason,Qs)}));return t.length>0?t:void 0}function Pa(e){let t=typeof e.run_id=="string"?e.run_id.trim():"",r=e.kind==="test"||e.kind==="test-all"?e.kind:"test",n=ea.has(e.status)?e.status:"failed",o={run_id:t,kind:r,status:n,started_at:dr(e.started_at),finished_at:dr(e.finished_at),recorded_at:dr(e.recorded_at),attempt:Na(e.attempt),resumed_from:e.resumed_from?.trim()||void 0,passed:ke(e.passed)??0,failed:ke(e.failed)??0,skipped:ke(e.skipped)??0,items:ke(e.items),linked_tests:ke(e.linked_tests),fail_on_skipped_triggered:e.fail_on_skipped_triggered===!0?!0:void 0,measurements:Ra(e.measurements),executions:Da(e.executions)};return ft(o),o}function ja(e){if(!(!Array.isArray(e)||e.length===0))return e.map($a)}function Ve(e){if(!Array.isArray(e))return;let t=[...new Set(e.filter(r=>typeof r=="string").map(r=>r.trim()).filter(r=>r.length>0))].sort((r,n)=>r.localeCompare(n));return t.length>0?t:void 0}function hr(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function yr(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function bo(e){if(!hr(e))return;let t=Object.entries(e).map(([r,n])=>[r.trim(),String(n).trim()]).filter(([r,n])=>r.length>0&&!yr(r)&&n.length>0).sort(([r],[n])=>r.localeCompare(n));return t.length>0?Object.fromEntries(t):void 0}function La(e){if(!hr(e))return;let t=Object.entries(e).map(([r,n])=>[r.trim(),Number(n)]).filter(([r,n])=>r.length>0&&!yr(r)&&Number.isFinite(n)).sort(([r],[n])=>r.localeCompare(n));return t.length>0?Object.fromEntries(t):void 0}function Ha(e){let t=e?.trim().toLowerCase();if(!(!t||!lr.has(t)))return t}function Fa(e){let t=e?.trim().toLowerCase();if(!(!t||!ko.has(t)))return t}function za(e,t){if(t===!0)return{provenance_invalid:!0};if(e===void 0)return{};if(!hr(e))return{provenance_invalid:!0};let r=m(e.author),n=m(e.created_at),o=e.source_kind;return!r||!n||!q(n)||o!=="local_mutation"&&o!=="merge_union"?{provenance_invalid:!0}:{provenance:{author:r,created_at:n,source_kind:o,source_ref:m(e.source_ref)}}}function $a(e){let t={command:e.command?.trim()||void 0,path:e.path?Ie(e.path):void 0,scope:e.scope,timeout_seconds:typeof e.timeout_seconds=="number"&&Number.isFinite(e.timeout_seconds)&&e.timeout_seconds>0?e.timeout_seconds:void 0,pm_context_mode:Ha(e.pm_context_mode),workspace_context_mode:Fa(e.workspace_context_mode),...za(e.provenance,e.provenance_invalid),updated_by:m(e.updated_by),updated_at:m(e.updated_at),env_set:bo(e.env_set),env_clear:Ve(e.env_clear),shared_host_safe:e.shared_host_safe===!0?!0:void 0,assert_stdout_contains:Ve(e.assert_stdout_contains),assert_stdout_regex:Ve(e.assert_stdout_regex),assert_stderr_contains:Ve(e.assert_stderr_contains),assert_stderr_regex:Ve(e.assert_stderr_regex),assert_stdout_min_lines:ke(e.assert_stdout_min_lines),assert_json_field_equals:bo(e.assert_json_field_equals),assert_json_field_gte:La(e.assert_json_field_gte),note:e.note?.trim()||void 0};return ft(t),t}function Ma(e){if(!(!e||e.length===0))return[...e].map(t=>({path:Ie(t.path),scope:t.scope,note:t.note?.trim()||void 0})).sort((t,r)=>{let n=t.scope.localeCompare(r.scope);if(n!==0)return n;let o=t.path.localeCompare(r.path);return o!==0?o:(t.note??"").localeCompare(r.note??"")})}function m(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function Va(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.id),i=m(n.kind);if(!o||!i)continue;let s={id:o,kind:i},a=m(n.note);a&&(s.note=a),n.required_before_step===!0&&(s.required_before_step=!0),t.push(s)}return t.length>0?t:void 0}function Ua(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.path);if(!o)continue;let i={path:Ie(o)};(n.scope==="project"||n.scope==="global")&&(i.scope=n.scope);let s=m(n.note);s&&(i.note=s),t.push(i)}return t.length>0?t:void 0}function Wa(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.command),i=m(n.path);if(!o&&!i)continue;let s={};o&&(s.command=o),i&&(s.path=Ie(i));let a=m(n.note);a&&(s.note=a),t.push(s)}return t.length>0?t:void 0}function qa(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.path);if(!o)continue;let i={path:Ie(o)};(n.scope==="project"||n.scope==="global")&&(i.scope=n.scope);let s=m(n.note);s&&(i.note=s),t.push(i)}return t.length>0?t:void 0}function Ga(e){if(e===null||typeof e!="object")return;let t=e,r=m(t.id),n=m(t.title),o=m(t.status),i=o&&ta.has(o)?o:void 0,s=qn(t.order)??Number.NaN,a=typeof t.created_at=="string"?t.created_at:"",d=typeof t.updated_at=="string"?t.updated_at:"";if(!r||!n||!i||!Number.isFinite(s)||!a||!d)return;let l={id:r,order:s,title:n,status:i,created_at:a,updated_at:d};return Ba(l,t),l}function Ba(e,t){let r=[["body","body"],["owner","owner"],["evidence","evidence"],["blocked_reason","blocked_reason"],["superseded_by","superseded_by"]];for(let[i,s]of r){let a=m(t[s]);a&&(e[i]=a)}let n=typeof t.completed_at=="string"?t.completed_at:void 0;n&&n.length>0&&(e.completed_at=n);let o=[["linked_items","linked_items",Va],["files","files",Ua],["tests","tests",Wa],["docs","docs",qa]];for(let[i,s,a]of o){let d=a(t[s]);d&&(e[i]=d)}}function Ja(e){if(!Array.isArray(e))return;let t=e.flatMap(r=>{let n=Ga(r);return n?[n]:[]});return t.sort((r,n)=>r.order-n.order),t.length>0?t:void 0}function Ka(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=typeof n.ts=="string"?n.ts:"",i=typeof n.author=="string"?n.author:"",s=m(n.decision);if(!o||!i||!s)continue;let a={ts:o,author:i,decision:s},d=m(n.rationale);d&&(a.rationale=d);let l=m(n.evidence);l&&(a.evidence=l);let _=m(n.step_id);_&&(a.step_id=_),t.push(a)}return t.length>0?t:void 0}function Ya(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=typeof n.ts=="string"?n.ts:"",i=typeof n.author=="string"?n.author:"",s=m(n.text);if(!o||!i||!s)continue;let a={ts:o,author:i,text:s},d=m(n.step_id);d&&(a.step_id=d),t.push(a)}return t.length>0?t:void 0}function Xa(e){if(!Array.isArray(e))return;let t=[];for(let r of e){if(r===null||typeof r!="object")continue;let n=r,o=m(n.text);if(!o)continue;let i={text:o},s=m(n.command);s&&(i.command=s);let a=m(n.expected);a&&(i.expected=a),t.push(i)}return t.length>0?t:void 0}function Za(e){if(!e)return;let t=Object.entries(e).map(([r,n])=>[r.trim(),n.trim()]).filter(([r,n])=>r.length>0&&n.length>0).sort((r,n)=>r[0].localeCompare(n[0]));if(t.length!==0)return Object.fromEntries(t)}function Se(e){let t=0;for(;t<e.length&&e[t]===`
|
|
2
2
|
`;)t+=1;return e.slice(t).trimEnd()}function Qa(e){if(e===void 0)return;if(typeof e=="number")return e;let t=e.trim().toLowerCase();if(t==="med")return"medium";if(tt.includes(t))return t}function ec(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t==="med")return"medium";if(et.includes(t))return t}function Ue(e){return e||void 0}function tc(e,t){let r=e,n=t;for(let[o,i]of Object.entries(n))yr(o)||Object.prototype.hasOwnProperty.call(r,o)||i===void 0||(r[o]=i)}function rc(e,t){if(!t?.fieldRegistry)return;let r=e;for(let n of t.fieldRegistry.definitions){let o=r[n.metadata_key];o!==void 0&&(r[n.metadata_key]=Me(n,o,`metadata field "${n.metadata_key}"`,"metadata"))}}function nc(e,t){if(!t||t.unknownFieldPolicy==="allow")return;let r=Ao(t),n=Object.keys(e).filter(o=>!r.has(o)).sort((o,i)=>o.localeCompare(i));n.length>0&&t.unknownFieldPolicy==="reject"&&Y(`unknown schema fields are not allowed: ${n.join(", ")}`),n.length>0&&t.onWarning?.(`item_unknown_schema_fields:${n.join(",")}`)}function mt(e,t={}){let r=Oo(t),n=lt(e.status,r?.statusRegistry)??e.status,o=Array.from(new Set((Array.isArray(e.tags)?e.tags:[]).filter(s=>typeof s=="string").map(s=>s.trim().toLowerCase()).filter(Boolean))).sort((s,a)=>s.localeCompare(a)),i={id:e.id,title:e.title,description:e.description,type:e.type,pm_format_version:yo(e.pm_format_version),source_type:m(e.source_type),type_options:Za(e.type_options),status:n,priority:e.priority,tags:o,created_at:e.created_at,updated_at:e.updated_at,dependencies:ka(e.dependencies),comments:cr(e.comments),notes:cr(e.notes),learnings:cr(e.learnings),files:xa(e.files),tests:ja(e.tests),test_runs:Ca(e.test_runs),docs:Ma(e.docs),deadline:Ue(e.deadline),reminders:Sa(e.reminders),events:Oa(e.events),closed_at:Ue(e.closed_at),completed_at:Ue(e.completed_at),assignee:m(e.assignee),claim_principal:m(e.claim_principal),source_owner:m(e.source_owner),author:Ue(e.author),estimated_minutes:e.estimated_minutes,acceptance_criteria:e.acceptance_criteria??void 0,design:e.design??void 0,external_ref:e.external_ref??void 0,definition_of_ready:m(e.definition_of_ready),order:e.order,goal:m(e.goal),objective:m(e.objective),value:m(e.value),impact:m(e.impact),outcome:m(e.outcome),why_now:m(e.why_now),parent:m(e.parent),reviewer:m(e.reviewer),risk:e.risk??void 0,confidence:Qa(e.confidence),sprint:m(e.sprint),release:m(e.release),blocked_by:m(e.blocked_by),blocked_reason:m(e.blocked_reason),unblock_note:m(e.unblock_note),reporter:m(e.reporter),severity:ec(e.severity),environment:m(e.environment),repro_steps:m(e.repro_steps),resolution:m(e.resolution),expected_result:m(e.expected_result),actual_result:m(e.actual_result),affected_version:m(e.affected_version),fixed_version:m(e.fixed_version),component:m(e.component),regression:e.regression,customer_impact:m(e.customer_impact),close_reason:Ue(e.close_reason),plan_mode:m(e.plan_mode),plan_scope:m(e.plan_scope),plan_harness:m(e.plan_harness),plan_resume_context:m(e.plan_resume_context),plan_steps:Ja(e.plan_steps),plan_decisions:Ka(e.plan_decisions),plan_discoveries:Ya(e.plan_discoveries),plan_validation:Xa(e.plan_validation)};return tc(i,e),rc(i,r),nc(i,r),ft(i),i}function xo(e){return v(e,J)}function oc(e){let t=0,r=!1,n=!1;for(let o=0;o<e.length;o+=1){let i=e[o];if(r){if(n){n=!1;continue}if(i==="\\"){n=!0;continue}i==='"'&&(r=!1);continue}if(i==='"'){r=!0;continue}if(i==="{"){t+=1;continue}if(i==="}"&&(t-=1,t===0))return o}return-1}function ic(e){if(!e.startsWith("{"))return{frontMatter:"",body:e};let t=oc(e);if(t<0)return{frontMatter:"",body:e};let r=e.slice(0,t+1),n=e.slice(t+1).replace(/^\r?\n+/,"");return{frontMatter:r,body:n}}function sc(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,r=t.match(/^[ \t]*---[ \t]*(?:\r?\n|$)/);if(!r)return{content:t,stripped:!1};let n=r[0].length;for(;n<t.length;){let o=t.indexOf(`
|
|
3
3
|
`,n),i=o===-1?t.length:o,s=t.slice(n,i).replace(/\r$/,""),a=o===-1?i:i+1;if(s.trim()==="---")return{content:t.slice(a).replace(/^\s+/,""),stripped:!0};n=a}return{content:t,stripped:!1}}function fr(e,t){return mt(e,{...t,onWarning:void 0})}function ac(e,t,r={}){let n=sc(e);n.stripped&&r.onWarning?.("json_markdown_leading_yaml_frontmatter_ignored");let{frontMatter:o,body:i}=ic(n.content);o||(e.trimStart().startsWith("{")&&We("json_markdown","JSON front matter is not valid JSON"),We("json_markdown","JSON Markdown item document is missing JSON front matter"));let s;try{s=JSON.parse(o)}catch{We("json_markdown","JSON front matter is not valid JSON")}return To(s,r.requireSupportedFormat),_r(s,t),{metadata:fr(s,r),body:Se(i)}}function cc(e,t,r={}){let n;try{n=sr(e).value}catch{We("toon","TOON item document is not valid TOON")}y(typeof n=="object"&&n!==null&&!Array.isArray(n),"TOON item document must be an object");let o=n;if(To(Object.prototype.hasOwnProperty.call(o,"front_matter")?o.front_matter:o,r.requireSupportedFormat),!Io.some(a=>Object.prototype.hasOwnProperty.call(o,a))&&!Object.prototype.hasOwnProperty.call(o,"front_matter")&&We("toon","TOON input does not have the shape of an item document"),Object.prototype.hasOwnProperty.call(o,"front_matter"))return _r(o.front_matter,t),y(o.body===void 0||typeof o.body=="string","TOON item document body must be a string"),{metadata:fr(o.front_matter,r),body:Se(typeof o.body=="string"?o.body:"")};let{body:i,...s}=o;return y(i===void 0||typeof i=="string","TOON item document body must be a string"),_r(s,t),{metadata:fr(s,r),body:Se(typeof i=="string"?i:"")}}function dc(e,t={}){let r=mt(e.metadata,t),n=xo(r),o=Se(e.body??"");pr(JSON.parse(JSON.stringify(n))),pr({body:o});let i=JSON.stringify(n,null,2);return o?`${i}
|
|
4
4
|
|
|
@@ -78,4 +78,4 @@ ${o}
|
|
|
78
78
|
`}function fu(e){try{return JSON.parse(e)}catch{throw new w("Existing settings.json is malformed; the settings write was refused.",E.USAGE,{code:"settings_write_invalid_existing_json",reason:"existing_settings_json_malformed",why:"Writing defaults over malformed settings could destroy intended project configuration.",nextSteps:["Repair the syntax in .agents/pm/settings.json, then retry the original command.","Run pm health to confirm the settings warning has cleared."]})}}async function Qm(e){return(await Ts(e)).settings}async function ep(e,t,r=Ol,n={}){let o=n.assignedPaths??[];du(o);let i=we(e),s=gs(t),a=s?void 0:En(t),d=Os(t,{persist_source:s}),l=JSON.parse(d),_=!1;try{if(await qi({pmRoot:e,filePath:i,mutate:f=>{let g=f===null?null:fu(f);return f!==null&&n.skipIfStored?.(g)===!0?(_=!0,{raw:f,result:void 0}):a!==void 0&&f!==null?{raw:_u(g,l,a,o,Fl(t)),result:void 0}:{raw:s?`${JSON.stringify(v(un(s.persisted_settings,l,g),Bt),null,2)}
|
|
79
79
|
`:su(d,n.omitSections,g),result:void 0}},op:r,author:Yo(void 0,t.author_default),lockTtlSeconds:t.locks.ttl_seconds,lockWaitMs:t.locks.wait_ms,recordCreation:!1}),_)return;s?wn(t,{...s,persisted_settings:structuredClone(l)}):a!==void 0&&zl(t,structuredClone(l)),await Qn({path:i,scope:"project",op:r})}finally{ge(e)}}import xs from"node:fs";import Xe from"node:path";import{createRequire as mu}from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b3d7667-1c63-565a-b314-3a74cc8d6b7d")}catch{}})();var Cs="@unbrained/pm-cli";var On=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,Tn="2026.8.31";function Jt(e){let t=e.match(On);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function Yt(e,t){let r=Jt(e),n=Jt(t);if(!r||!n)return null;for(let o=0;o<r.length;o+=1){let i=r[o]-n[o];if(i!==0)return Math.sign(i)}return 0}function In(e){return Yt(e,Tn)!==-1?3:2}function Kt(e){try{let t=JSON.parse(xs.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function pu(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(n=>({inclusive:n[1]==="<=",version:n[2]})),r=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return r?[...t,{inclusive:!0,version:r[1]}]:t}function hu(e){let t=e.split("||").map(r=>pu(r));return{bounded:t.some(r=>r.length>0),compatible:t.some(r=>r.every(n=>{let o=Yt(Tn,n.version);return o!==null&&(n.inclusive?o!==1:o===-1)}))}}function Ns(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let n=r[Cs];return typeof n=="string"?[n.trim()]:[]})}function yu(e){return Ns(e).flatMap(t=>{let r=/^[<!]/u.test(t)?void 0:t.match(On)?.[0];if(!r)return[];let n=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(t),o=hu(t);return[{version:r,constraint:n?"exact":o.bounded?"range":"minimum",...n?{}:{declaration:t},history_epoch_compatible:n?Yt(r,Tn)!==-1:o.compatible}]})}function gu(e){let t=Kt(Xe.join(e,"package-lock.json"))?.packages;if(typeof t!="object"||t===null)return;let r=t["node_modules/@unbrained/pm-cli"];if(typeof r!="object"||r===null)return;let n=r.version;return typeof n=="string"?n:void 0}function vu(e,t){try{let r=xs.readFileSync(Xe.join(e,t),"utf8").split(/\r?\n/u),n=r.findIndex(s=>s.includes(Cs));if(n<0)return;let o=r[n].match(/^\s*/u)[0].length,i=[r[n]];for(let s=n+1;s<r.length;s+=1){let a=r[s],d=a.trim(),l=a.match(/^\s*/u)[0].length;if(d.length>0&&l<=o)break;i.push(a)}return i.join(`
|
|
80
80
|
`).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(On)?.[0]}catch{return}}function bu(e){let t=[],r=Kt(Xe.join(e,"package.json"));r&&t.push(...yu(r).map(i=>({...i,source:"package.json"})));let n=Kt(Xe.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof n=="string"&&Jt(n)&&t.push({version:n,source:"installed-package",constraint:"exact",history_epoch_compatible:In(n)===3});let o=gu(e);o&&Jt(o)&&t.push({version:o,source:"package-lock.json",constraint:"exact",history_epoch_compatible:In(o)===3});for(let i of["pnpm-lock.yaml","yarn.lock"]){let s=vu(e,i);s&&t.push({version:s,source:i,constraint:"exact",history_epoch_compatible:In(s)===3})}return t}function ap(e,t){if(t<=1)return;let{minVersion:r,lt:n}=mu(import.meta.url)("semver"),o=Ns(Kt(Xe.join(e,"package.json"))??{}).find(s=>{try{let a=r(s);return a!==null&&n(a,"2026.10.10")}catch{return!1}}),i=o===void 0?bu(e).find(s=>Yt(s.version,"2026.10.10")===-1):{version:o,source:"package.json"};if(i)throw new w(`The project selects pm ${i.version}, which cannot safely refuse item format ${t}.`,E.CONFLICT,{code:"project_runtime_item_format_incompatible",reason:i.source,required:"Upgrade project pins, installed SDKs, CI hosts and Git merge drivers before writing guarded item formats.",nextSteps:["Use a pm runtime supporting the required item format throughout the project; preserve original item and history bytes, and never re-anchor history to satisfy an older host."]})}import xn from"node:fs/promises";import Xt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="658ab1c3-da92-5af6-a170-85ed7befaad6")}catch{}})();function ne(e,t){return typeof e=="object"&&e!==null&&"code"in e&&e.code===t}function Rs(e){let t=["--pm-path",e,"init","--defaults","--agent-guidance","skip"];return{suggested_retry:to(t),suggested_retry_args:t}}function Zt(e){return new w(`Tracker root is not a directory at ${e}.`,E.USAGE,{code:"tracker_root_not_directory",reason:"not_a_directory",resolved_path:e,nextSteps:["Pass a tracker directory, usually <workspace>/.agents/pm, rather than a file path."]})}function An(e){return new w(`Tracker root is not readable at ${e}.`,E.GENERIC_FAILURE,{code:"tracker_root_unreadable",reason:"unreadable",resolved_path:e,nextSteps:["Grant read and directory-search permission to the tracker root, then retry."]})}async function wu(e){let t=Xt.resolve(e),r=Xt.parse(t).root,n=Xt.dirname(t);for(;n!==r;){let o;try{o=await xn.stat(n)}catch(i){if(ne(i,"ENOTDIR"))throw Zt(e);if(!ne(i,"ENOENT"))throw i;n=Xt.dirname(n);continue}if(!o.isDirectory())throw Zt(e);return}}async function Eu(e){let t;try{t=await xn.stat(e)}catch(r){throw ne(r,"ENOENT")?(await wu(e),new w(`Tracker is not initialized at ${e}. Tracker root does not exist. Run pm init first.`,E.NOT_FOUND,{code:"tracker_root_missing",reason:"missing",resolved_path:e,nextSteps:["Confirm the tracker root path or initialize it with the emitted retry."],recovery:Rs(e)})):ne(r,"ENOTDIR")?Zt(e):ne(r,"EACCES")||ne(r,"EPERM")?An(e):r}if(!t.isDirectory())throw Zt(e);if(process.platform!=="win32"&&((t.mode&292)===0||(t.mode&73)===0))throw An(e);try{await(await xn.opendir(e)).close()}catch(r){throw ne(r,"EACCES")||ne(r,"EPERM")?An(e):r}}async function hp(e){if(await Eu(e),!await Vn(we(e)))throw new w(`Tracker is not initialized at ${e}. Run pm init first.`,E.NOT_FOUND,{code:"tracker_not_initialized",reason:"settings_missing",resolved_path:e,nextSteps:["Initialize the selected tracker root with the emitted retry."],recovery:Rs(e)})}export{Su as a,Ls as b,so as c,se as d,K as e,Xo as f,Nu as g,Fs as h,Ru as i,mo as j,po as k,Me as l,Du as m,Pu as n,nr as o,or as p,Lu as q,ir as r,yo as s,Gs as t,Hu as u,lt as v,Js as w,Mu as x,ut as y,$a as z,mt as A,s_ as B,a_ as C,Oe as D,ce as E,vr as F,l_ as G,u_ as H,Er as I,Po as J,Sr as K,b_ as L,w_ as M,E_ as N,k_ as O,S_ as P,I_ as Q,Dr as R,Pr as S,Vo as T,j_ as U,L_ as V,H_ as W,F_ as X,z_ as Y,$_ as Z,Fr as _,Bo as $,M_ as aa,V_ as ba,U_ as ca,Wc as da,W_ as ea,Yo as fa,bt as ga,Ge as ha,xe as ia,ai as ja,Od as ka,Nd as la,Rf as ma,Df as na,zd as oa,Pt as pa,_e as qa,Be as ra,nm as sa,nn as ta,wt as ua,ei as va,om as wa,ti as xa,im as ya,on as za,sn as Aa,Bc as Ba,Et as Ca,lf as Da,zr as Ea,kt as Fa,uf as Ga,_f as Ha,ni as Ia,St as Ja,It as Ka,Je as La,rd as Ma,ff as Na,mf as Oa,De as Pa,zt as Qa,bm as Ra,wm as Sa,Em as Ta,qi as Ua,km as Va,Mi as Wa,Ft as Xa,xm as Ya,ge as Za,Xm as _a,Il as $a,cs as ab,Zm as bb,Gt as cb,Os as db,Ts as eb,Qm as fb,ep as gb,bu as hb,ap as ib,Eu as jb,hp as kb};
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-LTQEYE2L.js.map
|