@unbrained/pm-cli 2026.11.22 → 2026.11.24
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-23K6DQQY.js +9 -0
- package/dist/cli-bundle/chunks/chunk-37UDIJ2K.js +3 -0
- package/dist/cli-bundle/chunks/chunk-5DUP4AZA.js +2 -0
- package/dist/cli-bundle/chunks/chunk-6H36ZHMI.js +2 -0
- package/dist/cli-bundle/chunks/chunk-7IROAPWI.js +3 -0
- package/dist/cli-bundle/chunks/chunk-7VRFEURZ.js +33 -0
- package/dist/cli-bundle/chunks/chunk-7X253M6Z.js +3 -0
- package/dist/cli-bundle/chunks/chunk-AA52P34H.js +3 -0
- package/dist/cli-bundle/chunks/chunk-AWB5KBJS.js +2 -0
- package/dist/cli-bundle/chunks/chunk-D6PDUKUG.js +9 -0
- package/dist/cli-bundle/chunks/chunk-DQDRA3SW.js +2 -0
- package/dist/cli-bundle/chunks/chunk-FXJYZBWV.js +113 -0
- package/dist/cli-bundle/chunks/chunk-HNKK2UG6.js +8 -0
- package/dist/cli-bundle/chunks/chunk-HZZLSBIJ.js +2 -0
- package/dist/cli-bundle/chunks/chunk-I2OJ5B4A.js +2 -0
- package/dist/cli-bundle/chunks/chunk-I3BFCKZR.js +2 -0
- package/dist/cli-bundle/chunks/chunk-MXUSC5RS.js +31 -0
- package/dist/cli-bundle/chunks/chunk-PLIUU37C.js +3 -0
- package/dist/cli-bundle/chunks/chunk-PQUBVRV5.js +2 -0
- package/dist/cli-bundle/chunks/chunk-PW7U7WCE.js +3 -0
- package/dist/cli-bundle/chunks/chunk-PZA7QECY.js +1 -0
- package/dist/cli-bundle/chunks/chunk-SLFRSZK6.js +1 -0
- package/dist/cli-bundle/chunks/chunk-SSALO4DB.js +2 -0
- package/dist/cli-bundle/chunks/chunk-STOOTHZZ.js +2 -0
- package/dist/cli-bundle/chunks/chunk-TKRY22SO.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-B76TFRO2.js → chunk-TVIJ2VCU.js} +93 -93
- package/dist/cli-bundle/chunks/chunk-VJSGUXGU.js +3 -0
- package/dist/cli-bundle/chunks/chunk-WWTPNIC2.js +6 -0
- package/dist/cli-bundle/chunks/chunk-XFADNMGD.js +2 -0
- package/dist/cli-bundle/chunks/chunk-YOPTAIBD.js +125 -0
- package/dist/cli-bundle/chunks/chunk-YW2HBHRO.js +70 -0
- package/dist/cli-bundle/chunks/chunk-YYT3MIRF.js +3 -0
- package/dist/cli-bundle/chunks/chunk-Z7MFVRDV.js +2 -0
- package/dist/cli-bundle/chunks/chunk-ZOX4SWRL.js +8 -0
- package/dist/cli-bundle/chunks/chunk-ZYCOM4MS.js +9 -0
- package/dist/cli-bundle/chunks/context-budget-recovery-M5RFUEFG.js +2 -0
- package/dist/cli-bundle/chunks/field-option-collisions-W66HSWMK.js +2 -0
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-BPYKN5Q7.js +4 -0
- package/dist/cli-bundle/{focused-chunks/item-revision-2O6MLPEX.js → chunks/item-revision-D3LSBNIR.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-M6NTBYH3.js +2 -0
- package/dist/cli-bundle/chunks/mutation-actor-OKL3CQVX.js +2 -0
- package/dist/cli-bundle/chunks/mutation-admission-EKPEOZMF.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-RR5KACJ3.js → register-list-query-3LBV6CS2.js} +11 -11
- package/dist/cli-bundle/chunks/register-mutation-72AGTMNE.js +21 -0
- package/dist/cli-bundle/chunks/register-operations-XERFG2SH.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-W22L34Z4.js +2 -0
- package/dist/cli-bundle/chunks/runtime-schema-JP2KBHBY.js +2 -0
- package/dist/cli-bundle/chunks/settlement-hook-6MR32OOC.js +7 -0
- package/dist/cli-bundle/chunks/stage-T2LKWN7C.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-24VRBNKE.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-3ELVASVA.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-3GT4A3ZN.js +44 -0
- package/dist/cli-bundle/focused-chunks/chunk-3OCDKITJ.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-3Z7MCUJM.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-46MP7IZN.js +5 -0
- package/dist/cli-bundle/focused-chunks/chunk-5LDBS6MS.js +91 -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-B6BNHKUW.js +78 -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-C7WHWI7K.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-EUQGZPGO.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-FDZPRJXJ.js +27 -0
- package/dist/cli-bundle/focused-chunks/chunk-GXP7Q4XM.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-HL47UQZJ.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-IIP6LZ5E.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-K53OIT5J.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-LMFIAQ2V.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-LMU7DDOA.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OZOCEB2Q.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-Q2HY44LV.js +13 -0
- package/dist/cli-bundle/focused-chunks/chunk-REFMQY47.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIE3SJSE.js +9 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIQUIHYU.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-RLO2HCZT.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-SMMOZ3H3.js +100 -0
- package/dist/cli-bundle/focused-chunks/chunk-UVTUX54T.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-X6CXWWNB.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-XDBHD4CY.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-YD66IRSL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Z7W2RQIB.js +2 -0
- package/dist/cli-bundle/focused-chunks/context-budget-recovery-CSJV3TY3.js +2 -0
- package/dist/cli-bundle/focused-chunks/field-option-collisions-UODPSV6W.js +2 -0
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-EGEJMG3G.js +4 -0
- package/dist/cli-bundle/focused-chunks/item-revision-QH7RNBX4.js +2 -0
- package/dist/cli-bundle/focused-chunks/item-transaction-ZO72OINF.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-actor-PHVLKG4I.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-admission-ZSG5OECH.js +2 -0
- package/dist/cli-bundle/focused-chunks/runtime-schema-6RQMIDTN.js +2 -0
- package/dist/cli-bundle/focused-chunks/settlement-hook-FMLGKG7J.js +7 -0
- package/dist/cli-bundle/focused-chunks/stage-AQMKRVX4.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 +13 -13
- 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.d.ts +2 -0
- 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.d.ts +26 -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/index.d.ts +1 -1
- 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.d.ts +11 -0
- 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-flag-spelling.d.ts +22 -0
- package/dist/sdk/schema/field-flag-spelling.js +2 -0
- 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 +2 -2
- package/docs/READ_OUTPUT_CONTRACTS.md +2 -0
- package/docs/SDK.md +94 -5
- package/docs/SDK_AUDITED_MUTATIONS.md +11 -0
- 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-revision-4QBMZXKX.js +0 -2
- 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
package/dist/cli-bundle/sdk.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as Ng}from"./chunks/chunk-X6MIWTTT.js";import{a as Ex,b as Sx,c as wx,d as Ax}from"./chunks/chunk-AR4NP5HI.js";import{a as Ox,b as vx}from"./chunks/chunk-EIGUKEV6.js";import{b as Vk,c as Kk,d as Wk,e as Yk,f as Xk,g as Jk,h as Qk,i as Zk,j as ex,k as tx,l as rx,m as ox,n as nx,o as ix,p as sx,q as ax,r as cx}from"./chunks/chunk-GYP24M7W.js";import{A as _x,B as hx,C as gx,D as yx,E as bx,F as Tx,G as Cx,a as qs,b as JR,c as QR,d as xc,e as Nc,f as Lc,h as Dc,i as $c,j as Fc,k as Gc,l as Uc,m as jc,n as Bc,o as qc,p as Vd,q as Kd,r as Wd,s as Yd,t as Xd,u as dx,v as lx,w as px,x as ux,y as mx,z as fx}from"./chunks/chunk-HC2OPETM.js";import{A as eN,B as tN,C as rN,D as oN,E as nN,F as iN,G as sN,H as aN,I as cN,J as dN,K as lN,L as pN,M as uN,N as mN,O as fN,P as _N,Q as hN,R as gN,S as yN,T as bN,U as TN,V as CN,W as EN,X as SN,Y as wN,Z as AN,_ as ON,a as Rx,b as Ix,c as Px,d as Mx,e as kx,f as xx,g as Nx,h as Lx,i as Dx,j as $x,k as Fx,l as Gx,m as Ux,n as jx,o as Bx,p as qx,q as zx,r as Hx,s as Vx,t as Kx,u as Wx,v as Yx,w as Xx,x as Jx,y as Qx,z as Zx}from"./chunks/chunk-GTPCAJMZ.js";import{$ as _f,$a as sh,$b as sg,A as f0,Aa as R_,Ab as xh,Ac as xg,B as Ke,Ba as I_,Bb as Nh,C as ef,Ca as P_,Cb as Lh,D as tf,Da as M_,Db as Dh,E as of,Ea as k_,Eb as $h,F as zt,Fa as x_,Fb as Fh,G as Ht,Ga as N_,Gb as Gh,H as Vt,Ha as L_,Hb as Uh,I as Kt,Ia as D_,Ib as jh,J as Wt,Ja as $_,Jb as Bh,K as Yt,Ka as F_,Kb as qh,L as Xt,La as G_,Lb as zh,M as Jt,Ma as U_,Mb as Hh,N as Qt,Na as j_,Nb as Vh,O as Zt,Oa as B_,Ob as Kh,P as er,Pa as q_,Pb as Wh,Q as nf,Qa as z_,Qb as Yh,R as sf,Ra as H_,Rb as Xh,S as af,Sa as V_,Sb as Jh,T as cf,Ta as K_,Tb as Qh,U as df,Ua as W_,Ub as Zh,V as We,Va as tr,Vb as eg,W as lf,Wa as _e,Wb as tg,X as pf,Xa as rh,Xb as rg,Y as uf,Ya as oh,Yb as og,Z as mf,Za as nh,Zb as ng,_ as ff,_a as ih,_b as ig,a as lR,aa as hf,ab as ah,ac as ag,b as pR,ba as gf,bb as ch,bc as cg,c as uR,ca as vk,cb as dh,cc as dg,d as mR,da as Rk,db as lh,dc as lg,e as fR,ea as Ik,eb as ph,ec as pg,f as _R,fa as Pf,fb as uh,fc as ug,g as yR,ga as Mf,gb as mh,gc as mg,h as bR,ha as kf,hb as fh,hc as fg,i as TR,ia as y_,ib as _h,ic as _g,j as CR,ja as b_,jb as hh,jc as hg,k as zs,ka as Fk,kb as gh,kc as gg,l as cd,la as Gk,lb as yh,lc as yg,m as dd,ma as Uk,mb as bh,mc as bg,n as ld,na as jk,nb as Th,nc as Tg,oa as Bk,ob as Ch,oc as Cg,p as DP,pa as qk,pb as Eh,pc as Eg,q as $P,qa as zk,qb as Sh,qc as Sg,r as FP,ra as Hk,rb as wh,rc as wg,s as GP,sa as T_,sb as Ah,sc as Ag,t as UP,ta as C_,tb as Oh,tc as Og,u as jP,ua as E_,ub as vh,uc as vg,v as Nu,va as S_,vb as Rh,vc as Rg,w as $u,wa as w_,wb as Ih,wc as Ig,x as Fu,xa as A_,xb as Ph,xc as Pg,y as nm,ya as O_,yb as Mh,yc as Mg,z as pm,za as v_,zb as kh,zc as kg}from"./chunks/chunk-B76TFRO2.js";import{e as zP,f as HP,g as ep,h as tp,i as jt}from"./chunks/chunk-U7EL3AYA.js";import{A as hk,B as gk,C as yk,D as bk,E as Tk,F as Ck,G as Ek,H as Sk,I as wk,J as Ak,K as Ok,L as Tf,M as Cf,N as Ef,O as Sf,P as wf,Q as Af,R as Of,S as vf,T as Rf,U as If,a as JM,b as QM,c as ZM,d as e0,e as t0,f as xu,g as r0,h as o0,i as n0,j as i0,k as s0,m as rf,n as yf,o as ik,p as sk,q as ak,r as ck,s as dk,t as lk,u as bf,v as pk,w as uk,x as mk,y as fk,z as _k}from"./chunks/chunk-VQFWW4EF.js";import{$ as WI,$a as Tp,$b as Ru,$d as X_,A as ze,Aa as bP,Ab as sM,Ac as zu,Ad as Kf,B as ee,Ba as TP,Bb as gu,Bc as Hu,Bd as Wf,C as ll,Ca as CP,Cb as aM,Cc as Vu,Cd as Yf,Db as wM,Dc as Ku,Dd as Xf,Eb as AM,Ec as Wu,Ed as Jf,F as He,Fa as BP,Fb as OM,Fc as Yu,Fd as Qf,G as pl,Ga as qP,Gb as vM,Gc as Xu,Gd as Zf,H as ul,Ha as Kl,Hb as RM,Hc as Ju,Hd as e_,Ia as Wl,Ib as IM,Ic as Qu,Id as t_,J as fe,Ja as Yl,Jb as PM,Jc as Zu,Jd as r_,K as ml,Ka as Xl,Kb as DM,Kc as em,Kd as o_,L as fl,La as Jl,Lb as $M,Lc as tm,Ld as n_,M as _l,Ma as Ql,Mb as yu,Mc as rm,Md as i_,N as hl,Na as Zl,Nb as bu,Nd as s_,O as $I,Oa as ap,Ob as FM,Oc as u0,Od as a_,P as FI,Pa as cp,Pb as GM,Pc as m0,Q as GI,Qa as dp,Qb as UM,Qc as om,Qd as c_,R as UI,Ra as lp,Rb as jM,Rc as um,Rd as d_,S as jI,Sa as pp,Sb as BM,Sc as mm,Sd as l_,T as xt,Ta as up,Tb as Tu,Tc as fm,Td as p_,U as BI,Ua as mp,Ub as Cu,Uc as _m,Ud as u_,V as qI,Va as fp,Vb as Eu,Vc as hm,Vd as m_,W as Nt,Wa as _p,Wb as Su,Wd as f_,X as zI,Xa as hp,Xb as wu,Xd as __,Y as HI,Ya as gp,Yb as Au,Yd as h_,Z as VI,Za as yp,Zb as Ou,Zd as g_,_ as KI,_a as bp,_b as vu,_c as gm,_d as Y_,a as ZR,aa as Ve,ab as Cp,ac as Iu,ad as Vm,ae as J_,b as It,ba as YI,bb as Ep,bc as Pu,bd as Km,be as Q_,c as eI,ca as Lt,cb as Sp,cc as Mu,cd as Wm,ce as Z_,d as Zc,da as XI,db as wp,dc as qM,de as eh,e as ed,ea as JI,eb as Ap,ec as zM,ed as Ym,ee as th,f as td,fa as QI,fb as Op,fc as HM,fd as Xm,g as rd,ga as ZI,gb as vp,gc as VM,gd as Jm,h as od,ha as eP,hb as Rp,hc as KM,hd as Qm,ia as tP,ib as WP,ic as WM,id as Zm,j as nd,ja as rP,jb as Ip,jc as YM,jd as xf,k as id,ka as oP,kb as Pp,kc as XM,kd as Nf,la as nP,lb as Mp,lc as ku,ld as Lf,ma as iP,mb as kp,mc as a0,md as Df,na as sP,nb as YP,nc as c0,nd as $f,o as sd,oa as aP,ob as xp,oc as d0,od as Ff,p as ad,pa as cP,pb as Np,pc as l0,pd as Gf,qa as dP,qb as Lp,qc as p0,qd as Uf,ra as lP,rb as Dp,rd as jf,sa as pP,sb as $p,sc as Lu,sd as Lk,ta as uP,tb as XP,tc as Du,td as Dk,ua as mP,ub as JP,uc as Gu,ud as $k,va as fP,vb as QP,vc as Uu,vd as Bf,w as Mt,wa as _P,wb as ZP,wd as qf,xa as hP,xb as eM,xc as ju,xd as zf,y as kt,ya as gP,yb as tM,yc as Bu,yd as Hf,za as yP,zb as rM,zc as qu,zd as Vf}from"./chunks/chunk-OJTMGDON.js";import"./chunks/chunk-YR2KEBHP.js";import{x as Jd}from"./chunks/chunk-XC5Q2ZV7.js";import{A as NP,Aa as $l,B as LP,Ba as Fl,C as Il,D as Pl,Da as Gl,E as Ml,Ea as Ul,F as kl,Fa as jl,G as Dt,Ga as Bl,Ha as ql,Ja as zl,Ka as Hl,La as Vl,b as OR,c as vR,d as RR,e as IR,f as PR,g as MR,h as Hs,i as Vs,j as Ks,k as Ws,l as Ys,ma as $t,n as EP,na as Ft,oa as Gt,pa as Ut,qa as xl,sa as Nl,ta as Ll,ua as Dl,w as MP,x as kP,z as xP}from"./chunks/chunk-XFHPKXAE.js";import{a as SP,b as wP,c as AP,d as OP,e as vP,f as RP,g as IP,h as Cl,i as El,j as Sl,k as wl,l as Al,m as PP,n as Ol,o as vl,p as Rl}from"./chunks/chunk-CAR2L5NW.js";import{a as gl,b as yl,e as bl,f as Tl}from"./chunks/chunk-YMUSRWV4.js";import{$a as yM,$b as $0,A as II,Aa as du,Ab as Sm,Ac as Dm,B as Qd,Ba as lu,Bb as wm,Bc as $m,C as Zd,Ca as pu,Cb as Am,Cc as Fm,D as el,Da as uu,Db as h0,Dc as Gm,E as tl,Ea as mu,Eb as g0,Ec as Um,F as rl,Fa as fu,Fb as y0,Fc as jm,G as ol,Ga as _u,Gb as b0,Gc as Bm,H as nl,Ha as hu,Hb as T0,Hc as qm,I as il,Ib as C0,Ic as qt,J as sl,Jb as E0,Jc as zm,K as al,Kc as tk,L as cl,La as oM,Lb as Om,Lc as rk,M as qe,Ma as nM,Mb as vm,Mc as ok,N as PI,Na as iM,Nb as S0,Nc as Hm,O as MI,Oa as cM,Ob as w0,Oc as nk,P as kI,Pa as dM,Pb as A0,Pc as Pk,Q as xI,Qa as lM,Qb as O0,Qc as Mk,R as NI,Ra as pM,Rb as v0,Rc as kk,S as LI,Sa as uM,Sb as R0,Sc as xk,T as DI,Ta as mM,Tb as I0,Tc as Nk,U as dl,Ua as fM,Ub as P0,V as rp,Va as _M,Vb as M0,W as op,Wa as hM,Wb as k0,X as np,Xa as gM,Xb as x0,Y as ip,Yb as N0,Z as VP,Zb as L0,_ as KP,_b as D0,a as ER,aa as sp,ac as F0,b as SR,ba as Fp,bb as bM,bc as G0,c as wR,ca as Gp,cb as TM,cc as U0,d as AR,da as Up,dc as j0,e as _I,ea as jp,ec as B0,f as hI,fa as Bp,fb as CM,fc as q0,g as gI,ga as qp,gb as EM,gc as z0,h as yI,ha as zp,hb as SM,hc as H0,i as bI,ia as Hp,ic as V0,j as TI,ja as Vp,jb as MM,jc as K0,k as CI,ka as Kp,kb as kM,kc as W0,la as Wp,lb as xM,lc as Y0,ma as Yp,mb as NM,mc as X0,na as Xp,nb as LM,nc as J0,oa as Jp,ob as im,oc as Q0,pa as Qp,pb as sm,pc as Z0,qa as Zp,qb as am,qc as ek,ra as eu,rb as cm,rc as Bt,sa as tu,sb as dm,sc as Rm,t as EI,ta as ru,tb as lm,tc as Im,u as SI,ua as ou,ub as ym,uc as Pm,v as wI,va as nu,vb as bm,vc as Mm,w as AI,wa as iu,wb as Tm,wc as km,x as OI,xa as su,xb as Cm,xc as xm,y as vI,ya as au,yb as _0,yc as Nm,z as RI,za as cu,zb as Em,zc as Lm}from"./chunks/chunk-6BBDEIKC.js";import{a as hR,b as gR}from"./chunks/chunk-HKUV74K3.js";import{$ as Ea,$a as Ec,A as Js,Aa as Ya,Ab as _d,B as Qs,Ba as Xa,Bb as hd,C as Zs,Ca as Ja,Cb as gd,Da as Qa,Db as yd,E as ea,Ea as Za,Eb as bd,F as ta,Fa as ec,Fb as Td,G as ra,Ga as tc,Gb as Cd,H as oa,Ha as rc,Hb as Ed,I as na,Ia as oc,Ib as Sd,J as ia,Ja as nc,Jb as wd,K as sa,Ka as ic,Kb as Ad,L as aa,La as sc,Lb as Od,M as ca,Ma as ac,Mb as vd,N as da,Na as cc,Nb as Rd,O as la,Oa as dc,Ob as Id,P as pa,Pa as lc,Pb as Pd,Q as ua,Qa as pc,Qb as Md,R as ma,Ra as uc,Rb as kd,Sa as mc,Sb as xd,T as fa,Ta as fc,Tb as Nd,U as _a,Ua as _c,Ub as tI,V as ha,Va as hc,Vb as rI,W as ga,Wa as gc,Wb as oI,X as ya,Xa as yc,Xb as nI,Y as ba,Ya as bc,Yb as iI,Z as Ta,Za as Tc,Zb as sI,_ as Ca,_a as Cc,a as kR,aa as Sa,ab as Sc,b as xR,ba as wa,bb as wc,bc as aI,c as NR,ca as Aa,cb as Ac,cc as cI,d as LR,da as Oa,db as Oc,dc as dI,e as DR,ea as va,eb as vc,ec as lI,fa as Ra,fb as Rc,fc as pI,g as $R,ga as Ia,gb as Ic,gc as uI,h as FR,ha as Pa,hb as Pc,hc as mI,i as Xs,ia as Ma,ib as Mc,ic as fI,j as GR,ja as ka,ka as xa,kb as Be,kc as Ld,la as Na,lb as Z,lc as Dd,m as UR,ma as La,mb as kc,mc as $d,n as jR,na as Da,nb as zc,nc as Fd,o as Ue,oa as $a,ob as Hc,oc as Gd,p as BR,pa as Fa,pb as Vc,pc as Ud,q as qR,qa as Ga,qb as Kc,qc as jd,r as zR,ra as Ua,rb as Wc,rc as Bd,s as Rt,sa as ja,sb as Yc,sc as qd,t as je,ta as Ba,tb as Xc,tc as zd,u as HR,ua as qa,ub as Jc,uc as Hd,v as VR,va as za,vb as Qc,vc as Pt,w as KR,wa as Ha,wb as pd,x as WR,xa as Va,xb as ud,y as YR,ya as Ka,yb as md,z as XR,za as Wa,zb as fd}from"./chunks/chunk-3W47ZZ5T.js";import{a as tR,b as rR,c as oR,d as nR,e as iR,f as sR,g as aR,h as cR,i as dR,j as Ns,k as Ls,l as Ds,m as $s,n as Fs,o as Gs,q as Us,s as js,y as Bs}from"./chunks/chunk-J52BEBSS.js";import{b as Qv}from"./chunks/chunk-TC6XLIYO.js";import"./chunks/chunk-IB7UB5TE.js";import{$b as dv,$c as Pv,A as uC,Aa as rO,Ab as HO,Ac as Tv,Ad as Yv,B as mC,Ba as oO,Bc as Cv,Bd as Xv,C as fC,Cc as Ev,Cd as Jv,Db as VO,Dc as Sv,Dd as Zv,Ec as wv,Ed as eR,Fb as KO,Fc as Av,Gc as Ov,Hc as fs,Ic as _s,Jb as WO,Jc as hs,K as wC,Kb as YO,Kc as gs,La as nO,Lb as XO,Lc as ys,M as xC,Ma as iO,Mb as os,Mc as bs,N as NC,Na as sO,Nb as JO,Nc as Ts,O as LC,Oa as aO,Oc as Cs,P as DC,Pa as cO,Pb as QO,Pc as Es,Q as BC,Qa as dO,Qb as ZO,Qc as Ss,R as qC,Ra as _O,Rb as ev,Rc as ws,S as wt,Sa as hO,Sb as tv,Sc as As,T as EA,Ta as gO,Tb as rv,Tc as Os,U as SA,Ua as At,Ub as ov,Uc as vs,V as wA,Vb as nv,Wa as yO,Wb as iv,Wc as Rs,X as AA,Xa as bO,Xb as sv,Xc as vv,Ya as TO,Yb as av,Yc as Rv,Z as OA,Za as CO,Zb as Ot,Zc as Is,_ as vA,_a as EO,_b as cv,_c as Iv,a as ZT,aa as RA,ad as Ps,ba as IA,bb as SO,bd as Ms,ca as PA,cd as Mv,da as MA,dd as kv,ea as kA,ed as xv,fa as xA,fb as Xi,fc as ns,fd as Nv,ga as NA,gc as is,gd as Lv,ha as zA,hb as xO,hc as ss,hd as Dv,i as sn,ib as NO,ic as as,id as $v,j as eC,ja as Vi,jb as LO,jd as ks,k as tC,ka as Ki,kb as DO,kc as cs,kd as xs,l as rC,la as Wi,lc as ds,ld as Fv,m as oC,mb as $O,mc as ls,md as Gv,na as HA,nb as FO,nc as ps,nd as Uv,o as nC,oa as VA,ob as GO,oc as us,od as jv,p as iC,pa as KA,pb as UO,pc as ms,pd as Bv,qa as WA,qb as es,qc as lv,qd as qv,r as sC,ra as YA,rb as ts,rc as pv,rd as zv,sa as XA,sc as uv,sd as Hv,t as aC,ta as JA,tb as rs,tc as mv,td as Vv,u as cC,ub as jO,uc as fv,ud as Kv,v as dC,va as QA,vc as _v,vd as Wv,wb as BO,wc as hv,x as lC,xa as ZA,xb as qO,xc as gv,y as pC,ya as eO,yb as zO,yc as yv,za as tO,zc as bv,zd as vt}from"./chunks/chunk-4TB5D6HL.js";import{A as vO,B as RO,C as IO,D as PO,E as MO,F as kO,G as Ji,H as Qi,I as Zi,a as LA,b as DA,c as $A,d as FA,e as GA,f as UA,g as jA,h as BA,i as qA,n as lO,q as pO,r as uO,u as mO,v as Yi,w as fO,x as wO,y as AO,z as OO}from"./chunks/chunk-YHVLVSEZ.js";import{$c as lE,$e as NE,$f as dS,$h as kw,$i as Zw,A as Fo,Ac as oE,Ad as Fe,Af as Ti,Ag as DS,Ah as Rw,Ai as Bw,Aj as zi,B as Go,Bd as Wn,Bf as Ci,Bg as $S,Bh as Iw,Bi as qw,C as Uo,Cb as AC,Ce as OE,Cf as Ei,Cg as FS,Ch as Pw,Ci as zw,D as jo,Db as OC,Dc as kn,Df as Si,Dg as GS,Di as Hw,Dj as hA,E as Bo,Ec as nE,Ee as pi,Ef as wi,Eg as US,Eh as Mw,Ei as Vw,Ej as Hi,F as qo,Fa as _C,Fc as xn,Fe as ui,Ff as Ai,Fg as jS,Fh as Di,G as zo,Ga as hC,Ge as mi,Gf as Oi,Gg as BS,Gh as $i,H as Ho,Ha as gC,Hc as iE,He as fi,Hf as vi,Hg as qS,Hj as gA,I as Ne,Id as mE,If as Ri,Ig as zS,Ii as Kw,Ij as yA,J as Le,Jb as vC,Jd as fE,Jf as Ii,Jg as HS,Jj as bA,K as Vo,Ka as gn,Kd as _E,Kf as Pi,Kg as VS,Ki as Ww,Kj as TA,L as Ko,La as yC,Ld as Yn,Lf as Mi,Lg as KS,Lj as CA,M as Wo,Ma as bC,Mb as RC,Md as Xn,Mf as ki,Mg as WS,N as Yo,Na as TC,Nc as sE,Nd as Jn,Ne as vE,Nf as xi,Ng as YS,O as Xo,Oa as CC,Od as Qn,Oe as RE,Of as Ni,Og as XS,P as Jo,Pb as IC,Pd as Zn,Pe as IE,Pf as Li,Pg as JS,Q as Qo,Qa as yn,Qc as aE,Qd as ei,Qf as eS,Qg as QS,R as Zo,Ra as bn,Rc as cE,Rd as ti,Rf as tS,Rg as ZS,S as en,Sa as $e,Sb as PC,Sc as Nn,Sd as ri,Sf as rS,Sg as ew,T as tn,Ta as EC,Tc as Ln,Td as oi,Te as _i,Tf as oS,Tg as tw,U as rn,Ua as SC,Ub as Tt,Ud as ni,Uf as nS,Ug as rw,V as on,Va as Tn,Vc as Dn,Vd as ii,Vf as iS,Vg as ow,W as nn,Wa as Cn,Wb as Ct,Wc as $n,Wd as si,Wf as sS,Wg as nw,Wi as Yw,Xc as Fn,Xd as ai,Xe as PE,Xf as aS,Xg as iw,Xi as Xw,Ya as En,Yb as Pn,Yc as Gn,Yd as ci,Ye as ME,Yf as cS,Yg as sw,Yi as Jw,Zb as Mn,Zc as Un,Zd as di,Ze as kE,Zg as aw,_b as Et,_c as dE,_e as xE,_i as Qw,a as R,aa as gt,ac as MC,ae as hE,af as LE,ag as lS,ah as cw,ai as Ge,b as jT,ba as yt,be as gE,bf as DE,bg as pS,bh as dw,bi as St,bj as eA,c as ht,ca as ln,cc as kC,ce as li,cf as $E,cg as uS,ch as lw,ci as xw,cj as Ui,da as pn,dc as $C,df as FE,dg as mS,dh as pw,di as Nw,e as BT,ea as un,ec as FC,ef as GE,eg as fS,eh as uw,ei as Lw,ej as ji,f as qT,fc as GC,ff as UE,fg as _S,fh as mw,fi as Dw,fj as Bi,g as zT,gc as UC,ge as yE,gf as jE,gg as hS,gh as fw,gi as q,h as HT,hc as jC,he as bE,hg as gS,hh as _w,hi as $w,i as VT,ic as zC,ig as yS,ii as Fw,ij as tA,j as KT,ja as mn,jb as Sn,jc as HC,jf as BE,jg as bS,ji as Gw,jj as rA,k as WT,kb as wn,kc as VC,kf as qE,kg as TS,ki as Uw,kj as oA,l as YT,la as fn,lb as An,lc as KC,ld as jn,lf as zE,lg as CS,lh as hw,lj as nA,m as XT,ma as _n,mb as On,mc as WC,md as Bn,mf as HE,mg as ES,mh as gw,mi as Fi,mj as iA,n as JT,na as hn,nb as vn,nc as YC,nd as pE,nf as VE,ng as SS,ni as Gi,nj as sA,o as QT,oc as XC,od as qn,of as KE,og as wS,oj as aA,p as Po,pc as JC,pd as zn,pf as WE,pg as AS,ph as yw,pj as qi,q as Mo,qc as QC,qd as uE,qe as TE,qf as YE,qg as OS,qh as bw,qj as cA,r as ko,rc as ZC,rd as Hn,re as CE,rf as XE,rg as vS,rh as Tw,rj as dA,s as xo,sc as eE,sd as Vn,se as EE,sf as JE,sg as RS,sh as Cw,t as ke,tc as tE,td as L,te as SE,tf as QE,tg as IS,th as Ew,u as No,uc as rE,ud as Kn,uf as ZE,ug as PS,uh as Sw,uj as lA,v as N,ve as wE,vg as MS,vh as ww,vj as pA,w as xe,wb as Rn,we as AE,wf as hi,wg as kS,wh as Aw,wj as uA,x as Lo,xf as gi,xg as xS,xj as mA,y as Do,yb as In,yf as yi,yg as NS,yh as Ow,yi as jw,yj as fA,z as $o,zf as bi,zg as LS,zh as vw,zj as _A}from"./chunks/chunk-HXHYDO2R.js";import"./chunks/chunk-LQBWLNZJ.js";import"./chunks/chunk-SPPHDVZE.js";import{A as ue,B as UT,C as b,E as an,F as bt,G as me,H as cn,K as De,M as dn,b as xT,c as NT,d as LT,m as DT,r as $T,u as FT,y as GT}from"./chunks/chunk-KQIZ34SF.js";import"./chunks/chunk-XAWE4EAK.js";(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]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},rr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Lg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function Dg(e){if(e!==void 0){if(typeof e!="string"||!rr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...rr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=Lg(t[w.clientInfo]),s=Dg(t[w.logLevel]);return{protocolVersion:z,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function vN(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function RN(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function IN(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function $g(e,t){return Xe({...e,resultType:"complete"},t)}function PN(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return $g({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function MN(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(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]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var Fg=new Set(["--help","-h","--version","-V"]);function Gg(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
|
|
2
|
-
`)}function
|
|
3
|
-
`}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?
|
|
4
|
-
`,stderr:""}}import{createHash as sr,createHmac as ar,timingSafeEqual as Ug}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]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var jg=["elicitation/create","roots/list","sampling/createMessage"],nr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},cr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Bg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ye(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let o={};for(let[n,s]of r){if(!cr.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!jg.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=Bg(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return ye(o,Qe,"inputRequests"),o}function dr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[o,n]of t){if(!cr.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return ye(r,Qe,"inputResponses"),r}function FN(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[w.serverInfo]:{...e.serverInfo}}}}function lr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function GN(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let o=r.toString("base64url"),n=ar("sha256",lr(t)).update(o).digest("base64url");return`${o}.${n}`}function qg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function UN(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=ar("sha256",lr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!Ug(i,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=qg(c),{expiresAt:l,method:p,parameterDigest:f,principal:_}=d;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function jN(e){return ye(e,Qe,"request parameters"),sr("sha256").update(JSON.stringify(e)).digest("hex")}var ir=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=sr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function zg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function BN(e,t){return{...e,...zg(t)}}function Hg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Vg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Hg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Kg(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,o=e.maxNodes??Je.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Wg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Yg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Vg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function qN(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Kg(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});ye(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Yg(e,a.value),Wg(a,s)}return structuredClone(e)}import{randomUUID as Xg}from"node:crypto";import{readFile as Jg}from"node:fs/promises";import pr 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]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var JN="io.modelcontextprotocol/tasks",Qg=["working","input_required","completed","failed","cancelled"],Zg=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,ey=3600*1e3,ty=1e3,Te=1024,ry=30,oy=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function be(e){let t=e.trim();if(!Zg.test(t))throw et("Unknown MCP task");return t}function ur(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function mr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Te),...h(e.data)?{data:structuredClone(e.data)}:{}}}function ny(e){if(!Qg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function iy(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function sy(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function ay(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function cy(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function dy(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function ly(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?be(e.taskId):"",r=ny(e.status),o=iy(e.principal),n=sy(e.workerPid),s=ay(e.ttlMs),i=cy(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:ur(e.createdAt,"createdAt"),lastUpdatedAt:ur(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:dy(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Te)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=mr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function H(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function re(e){return e==="completed"||e==="failed"||e==="cancelled"}function py(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#o;#i;constructor(t){this.#e=pr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Xg()}`),this.#i=t.workerPid??process.pid}#s(t){return pr.join(this.#e,"runtime","mcp-tasks","records",`${be(t)}.json`)}async#c(t){try{return ly(JSON.parse(await Jg(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await De(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
5
|
-
`)}async#n(t,r,o){let n=be(t),s=await Fe(this.#e,n,ry,this.#t,!1,!1,oy);try{let i=await this.#c(n);if(i.principal!==r)throw et("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=be(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?ey:t.ttlMs,s=t.pollIntervalMs??ty;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Te)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#n(t,r,o=>{if(re(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!py(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ze(t.inputRequests,t.requestContext);return H(await this.#n(t.taskId,t.principal,o=>{if(re(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Te),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=dr(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=p,delete c[l],s.push(l));return i=Object.keys(c).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return H(await this.#n(t,r,n=>re(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=mr(o);return H(await this.#n(t,r,s=>re(s.status)?s:{...s,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return H(await this.#n(t,r,o=>re(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function QN(e){return new tt(e)}(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]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var Ce="io.modelcontextprotocol/subscriptionId",fr=256,_r=2048,uy=5e3;function my(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),uy);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}function rt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function fy(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=rt(e.toolsListChanged,"toolsListChanged"),r=rt(e.promptsListChanged,"promptsListChanged"),o=rt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>fr)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:fr});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>_r)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:_r});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function _y(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var hr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=_y(fy(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Ce]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[Ce]:s}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Ce]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await my(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[Ce]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(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]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var gr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,hy=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,yr=/^[\t\x20-\x7E]*$/u,br=new Set(["prompts/get","resources/read","tools/call"]);function gy(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new u(e,m.headerMismatch,{header:t})}function Tr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&yr.test(t)&&!gr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Cr(e,t){let r=gr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!yr.test(e)?A("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function yy(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!hy.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Er(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(i)){if(!h(c))continue;let d=[...s,a],l=yy(c,d,r);l&&t.push(l);for(let[p,f]of Object.entries(c))if(p!=="properties"&&p!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:p});o(c,d)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&Ee(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Sr(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function wr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function by(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Er(t)){let s=Sr(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Tr(s)}}return o}function oL(e){let t=h(e.request.params)?e.request.params:void 0,r=Ye(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},s=wr(o,t);if(br.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Tr(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,by(t,e.toolSchema)),n}function Ty(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Ye(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),br.has(r)){let s=e.get("mcp-name"),i=wr(r,o);(s===void 0||i===void 0||Cr(s,"Mcp-Name")!==i)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function Cy(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function Ey(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Er(e.toolSchema)){let o=Sr(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),Cy(r,o,Cr(s,n))||A("MCP parameter header does not match request body",n)}}function nL(e){let t=gy(e.headers),r=typeof e.request.method=="string"?e.request.method:"";Ty(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Ey({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var iL=z;import{AsyncLocalStorage as Sy}from"node:async_hooks";import{createHash as Ar,timingSafeEqual as wy}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]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},Ay=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Oy=/^[a-z][a-z0-9_*/-]{0,255}$/u,vy=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Ry=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,vr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Rr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,Iy=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Py=/%(?![0-9A-Fa-f]{2})/u,My=512,ky=32,xy=180,Ny=8192,Ly=8192,Ir=new Sy;function S(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function Dy(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function lL(e){let t=S(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>S(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!vr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function pL(e){let t=S(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function uL(e,t){if(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=S(t,"expected issuer").href.replace(/\/$/u,"");if(S(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=c=>{let d=e[c];if(typeof d!="string")throw new y(`Authorization server metadata requires ${c}`,401);return S(d,c).href},n=c=>{let d=e[c];return typeof d=="string"?S(d,c).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(c=>typeof c=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...a?{registration_endpoint:a}:{}}}function mL(e){return e.hasPreRegisteredClient?"pre_registered":e.metadata.client_id_metadata_document_supported?"client_id_metadata_document":e.metadata.registration_endpoint?"dynamic":"user_supplied"}function fL(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function _L(e,t){let r=S(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);S(o,"client redirect URI",!0)}return structuredClone(e)}function hL(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>S(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Or=class{#e=new Map;set(t,r){let o=S(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=S(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=S(t,"credential issuer").href;return this.#e.delete(r)}};function $y(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Ay.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Gy(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function D(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function Fy(e){return Oy.test(e)||vy.test(e)}function Gy(e){if(Buffer.byteLength(e,"utf8")>My)return!1;let t=e.split(",");if(t.length>ky)return!1;let r=new Set;for(let o of t){let n=D(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!Fy(i)||!Ry.test(a)||r.has(i))return!1;r.add(i)}return!0}function Pr(e){return Iy.test(e)&&!Py.test(e)}function Uy(e){let t=D(e),r=t.indexOf("="),o=D(r>=0?t.slice(0,r):t),n=r>=0?D(t.slice(r+1)):void 0;return Rr.test(o)&&(n===void 0||Pr(n))}function jy(e){let t=D(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=D(s>0?o.slice(0,s):""),a=s>0?D(o.slice(s+1)):"";if(!(!Rr.test(i)||!Pr(a)||!n.every(Uy)))return{key:i,serialized:t}}function By(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Ny)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>xy)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=jy(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function gL(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=By(r.baggage,t.baggageAllowlist??[]);return{...$y(r),...o?{baggage:o}:{}}}function yL(e,t){return Ir.run(structuredClone(e),t)}function bL(){let e=Ir.getStore();return e?{...e}:void 0}async function TL(e){let t=S(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(d=>!vr.test(d)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let n=Dy(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>Ly)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let c=r.filter(d=>!i.scopes.includes(d));if(c.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${c.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function CL(e){let t=Ar("sha256").update(e.token).digest();return r=>{let o=Ar("sha256").update(r).digest();if(!wy(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(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]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var ot="io.modelcontextprotocol/ui",Se="2026-01-26",xr="text/html;profile=mcp-app",Mr=Object.freeze({specVersion:Se,mimeTypes:[xr]});function wL(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[ot];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[ot]:Mr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(xr)||n!==void 0&&n!==Se)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[ot]:Mr}}});return!0}var qy={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Nr=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:qy})));function AL(e){return Nr.find(t=>t.uri===e)}function OL(e){let t=new Map(Nr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function kr(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function vL(e){let t=kr(e.name),r=kr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Se}),n=JSON.stringify(Se);return`<!doctype html>
|
|
1
|
+
import{a as PN,b as MN}from"./chunks/chunk-SSALO4DB.js";import{b as Yk,c as Xk,d as Jk,e as Qk,f as Zk,g as eN,h as tN,i as rN,j as nN,k as oN,l as iN,m as sN,n as aN,o as cN,p as dN,q as pN,r as lN}from"./chunks/chunk-I3BFCKZR.js";import{a as Lg}from"./chunks/chunk-XFADNMGD.js";import{a as bN,b as wN,c as ON,d as RN}from"./chunks/chunk-37UDIJ2K.js";import{A as CN,B as yN,C as SN,D as TN,E as EN,F as AN,G as xN,a as qs,b as eP,c as tP,d as Nc,e as Lc,f as $c,h as Dc,i as Fc,j as Gc,k as Uc,l as jc,m as Bc,n as zc,o as qc,p as dd,q as pd,r as ld,s as ud,t as md,u as uN,v as mN,w as fN,x as _N,y as hN,z as gN}from"./chunks/chunk-TKRY22SO.js";import{A as n0,B as o0,C as i0,D as s0,E as a0,F as c0,G as d0,H as p0,I as l0,J as u0,K as m0,L as f0,M as _0,N as h0,O as g0,P as C0,Q as y0,R as S0,S as T0,T as E0,U as A0,V as x0,W as b0,X as w0,Y as O0,Z as R0,_ as P0,a as IN,b as vN,c as kN,d as NN,e as LN,f as $N,g as DN,h as FN,i as GN,j as UN,k as jN,l as BN,m as zN,n as qN,o as HN,p as VN,q as KN,r as WN,s as YN,t as XN,u as JN,v as QN,w as ZN,x as e0,y as t0,z as r0}from"./chunks/chunk-ZOX4SWRL.js";import{$ as hf,$a as ah,$b as ag,A as Ke,Aa as P_,Ab as Nh,Ac as Ng,B as ef,Ba as M_,Bb as Lh,C as tf,Ca as I_,Cb as $h,D as nf,Da as v_,Db as Dh,E as of,Ea as k_,Eb as Fh,F as Ht,Fa as N_,Fb as Gh,G as Vt,Ga as L_,Gb as Uh,H as Kt,Ha as $_,Hb as jh,I as Wt,Ia as D_,Ib as Bh,J as Yt,Ja as F_,Jb as zh,K as Xt,Ka as G_,Kb as qh,L as Jt,La as U_,Lb as Hh,M as Qt,Ma as j_,Mb as Vh,N as Zt,Na as B_,Nb as Kh,O as er,Oa as z_,Ob as Wh,P as tr,Pa as q_,Pb as Yh,Q as sf,Qa as H_,Qb as Xh,R as af,Ra as V_,Rb as Jh,S as cf,Sa as K_,Sb as Qh,T as df,Ta as W_,Tb as Zh,U as pf,Ua as Y_,Ub as eg,V as We,Va as rr,Vb as tg,W as lf,Wa as _e,Wb as rg,X as uf,Xa as nh,Xb as ng,Y as mf,Ya as oh,Yb as og,Z as ff,Za as ih,Zb as ig,_ as _f,_a as sh,_b as sg,a as mR,aa as gf,ab as ch,ac as cg,b as fR,ba as Cf,bb as dh,bc as dg,c as _R,ca as Mk,cb as ph,cc as pg,d as hR,da as Ik,db as lh,dc as lg,e as gR,ea as vk,eb as uh,ec as ug,f as CR,fa as If,fb as mh,fc as mg,g as TR,ga as vf,gb as fh,gc as fg,h as ER,ha as kf,hb as _h,hc as _g,i as AR,ia as y_,ib as hh,ic as hg,j as xR,ja as S_,jb as gh,jc as gg,k as Rc,ka as jk,kb as Ch,kc as Cg,la as Bk,lb as yh,lc as yg,m as GM,ma as zk,mb as Sh,mc as Sg,n as UM,na as qk,nb as Th,nc as Tg,o as jM,oa as Hk,ob as Eh,oc as Eg,p as BM,pa as Vk,pb as Ah,pc as Ag,q as zM,qa as Kk,qb as xh,qc as xg,r as qM,ra as Wk,rb as bh,rc as bg,s as Qp,sa as T_,sb as wh,sc as wg,t as ku,ta as E_,tb as Oh,tc as Og,u as Nu,ua as A_,ub as Rh,uc as Rg,v as Du,va as x_,vb as Ph,vc as Pg,w as Fu,wa as b_,wb as Mh,wc as Mg,x as om,xa as w_,xb as Ih,xc as Ig,y as lm,ya as O_,yb as vh,yc as vg,z as gv,za as R_,zb as kh,zc as kg}from"./chunks/chunk-TVIJ2VCU.js";import{$ as YP,$a as gl,$b as bu,$d as C_,Aa as SM,Ab as oI,Ac as Bu,Ad as Vf,Ba as TM,Bb as iI,Bc as zu,Bd as Kf,C as qe,Ca as EM,Cb as dI,Cc as qu,Cd as Wf,D as ee,Da as AM,Db as hu,Dc as Hu,Dd as Yf,E as cp,Ea as xM,Eb as pI,Ec as Vu,Ed as Xf,Fb as OI,Fc as Ku,Fd as Jf,Gb as RI,Gc as Wu,Gd as Qf,H as He,Ha as HM,Hb as PI,Hc as Yu,Hd as Zf,I as dp,Ia as VM,Ib as MI,Ic as Xu,Id as e_,J as pp,Ja as Hp,Jb as II,Jc as Ju,Jd as t_,Ka as Vp,Kb as vI,Kc as Qu,Kd as r_,L as fe,La as Kp,Lb as kI,Lc as Zu,Ld as n_,M as lp,Ma as Wp,Mb as GI,Mc as em,Md as o_,N as up,Na as Yp,Nb as UI,Nc as tm,Nd as i_,O as mp,Oa as Xp,Ob as gu,Oc as rm,Od as s_,P as fp,Pa as Jp,Pb as Cu,Pd as a_,Q as UP,Qa as sl,Qb as jI,Qc as _v,Qd as c_,R as jP,Ra as al,Rb as BI,Rc as hv,S as BP,Sa as cl,Sb as zI,Sc as nm,Sd as d_,T as zP,Ta as dl,Tb as qI,Tc as um,Td as p_,U as qP,Ua as pl,Ub as HI,Uc as mm,Ud as l_,V as Nt,Va as ll,Vb as yu,Vc as fm,Vd as u_,W as HP,Wa as ul,Wb as Su,Wc as _m,Wd as m_,X as VP,Xa as ml,Xb as Tu,Xc as hm,Xd as f_,Y as Lt,Ya as fl,Yb as Eu,Yd as __,Z as KP,Za as _l,Zb as Au,Zd as h_,_ as WP,_a as hl,_b as xu,_d as g_,a as rP,aa as XP,ab as Cl,ac as wu,ad as gm,ae as X_,b as Mt,ba as JP,bb as yl,bc as Ou,be as J_,c as nP,ca as Ve,cb as Sl,cc as Ru,cd as Vm,ce as Q_,d as ed,da as QP,db as Tl,dc as Pu,dd as Km,de as Z_,e as td,ea as $t,eb as El,ec as Mu,ed as Wm,ee as eh,f as rd,fa as ZP,fb as Al,fc as VI,fe as th,g as nd,ga as eM,gb as xl,gc as KI,gd as Ym,ge as rh,h as od,ha as tM,hb as bl,hc as WI,hd as Xm,ia as rM,ib as wl,ic as YI,id as Jm,j as id,ja as nM,jb as Ol,jc as XI,jd as Qm,k as sd,ka as oM,kb as JM,kc as JI,kd as Zm,la as iM,lb as Rl,lc as QI,ld as Nf,ma as sM,mb as Pl,mc as ZI,md as Lf,na as aM,nb as Ml,nc as Iu,nd as $f,o as ad,oa as cM,ob as Il,oc as pv,od as Df,p as cd,pa as dM,pb as QM,pc as lv,pd as Ff,qa as pM,qb as vl,qc as uv,qd as Gf,ra as lM,rb as kl,rc as mv,rd as Uf,sa as uM,sb as Nl,sc as fv,sd as jf,ta as mM,tb as Ll,td as Bf,ua as fM,ub as $l,uc as Lu,ud as Fk,va as _M,vb as ZM,vc as $u,vd as Gk,wa as hM,wb as eI,wc as Gu,wd as Uk,x as vt,xa as gM,xb as tI,xc as Uu,xd as zf,ya as CM,yb as rI,yd as qf,z as kt,za as yM,zb as nI,zc as ju,zd as Hf}from"./chunks/chunk-MXUSC5RS.js";import"./chunks/chunk-5DUP4AZA.js";import{x as Yd}from"./chunks/chunk-DQDRA3SW.js";import{e as KM,f as WM,g as Zp,h as el,i as Bt}from"./chunks/chunk-PLIUU37C.js";import{A as Pp,Aa as Fp,B as Mp,Ba as Gp,C as Dt,Ca as Up,Da as jp,Fa as Bp,Ga as zp,Ha as qp,b as PR,c as MR,d as IR,e as vR,f as kR,g as NR,h as Pc,i as Mc,ia as Ft,j as Ic,ja as Gt,k as vc,ka as Ut,l as kc,la as jt,ma as Ip,n as bM,oa as vp,pa as kp,qa as Np,s as NM,t as LM,v as $M,w as DM,wa as Lp,x as FM,xa as $p,y as Op,z as Rp,za as Dp}from"./chunks/chunk-YW2HBHRO.js";import{a as wM,b as OM,c as RM,d as PM,e as MM,f as IM,g as vM,h as yp,i as Sp,j as Tp,k as Ep,l as Ap,m as kM,n as xp,o as bp,p as wp}from"./chunks/chunk-HNKK2UG6.js";import{a as _p,b as hp,e as gp,f as Cp}from"./chunks/chunk-D6PDUKUG.js";import"./chunks/chunk-AA52P34H.js";import{A as yk,B as Sk,C as Tk,D as Ek,E as Ak,F as xk,G as bk,H as wk,I as Ok,J as Rk,K as Pk,L as Tf,M as Ef,N as Af,O as xf,P as bf,Q as wf,R as Of,S as Rf,T as Pf,U as Mf,a as ev,b as tv,c as rv,d as nv,e as ov,f as vu,g as iv,h as sv,i as av,j as cv,k as dv,m as rf,n as yf,o as ck,p as dk,q as pk,r as lk,s as uk,t as mk,u as Sf,v as fk,w as _k,x as hk,y as gk,z as Ck}from"./chunks/chunk-WWTPNIC2.js";import{$a as TI,$b as Uv,A as vP,Aa as cu,Ab as Am,Ac as $m,B as Xd,Ba as du,Bb as xm,Bc as Dm,C as Jd,Ca as pu,Cb as bm,Cc as Fm,D as Qd,Da as lu,Db as yv,Dc as Gm,E as Zd,Ea as uu,Eb as Sv,Ec as Um,F as ep,Fa as mu,Fb as Tv,Fc as jm,G as tp,Ga as fu,Gb as Ev,Gc as Bm,H as rp,Ha as _u,Hb as Av,Hc as zm,I as np,Ib as xv,Ic as qt,J as op,Jb as bv,Jc as qm,K as ip,Kc as ok,L as sp,La as sI,Lb as wm,Lc as ik,M as ze,Ma as aI,Mb as Om,Mc as sk,N as kP,Na as cI,Nb as wv,Nc as Hm,O as NP,Oa as lI,Ob as Ov,Oc as ak,P as LP,Pa as uI,Pb as Rv,Pc as kk,Q as $P,Qa as mI,Qb as Pv,Qc as Nk,R as DP,Ra as fI,Rb as Mv,Rc as Lk,S as FP,Sa as _I,Sb as Iv,Sc as $k,T as GP,Ta as hI,Tb as vv,Tc as Dk,U as ap,Ua as gI,Ub as kv,V as tl,Va as CI,Vb as Nv,W as rl,Wa as yI,Wb as Lv,X as nl,Xa as SI,Xb as $v,Y as ol,Yb as Dv,Z as YM,Zb as Fv,_ as XM,_b as Gv,a as bR,aa as il,ac as jv,b as wR,ba as Dl,bb as EI,bc as Bv,c as OR,ca as Fl,cb as AI,cc as zv,d as RR,da as Gl,dc as qv,e as CP,ea as Ul,ec as Hv,f as yP,fa as jl,fb as xI,fc as Vv,g as SP,ga as Bl,gb as bI,gc as Kv,h as TP,ha as zl,hb as wI,hc as Wv,i as EP,ia as ql,ic as Yv,j as AP,ja as Hl,jb as NI,jc as Xv,k as xP,ka as Vl,kb as LI,kc as Jv,la as Kl,lb as $I,lc as Qv,ma as Wl,mb as DI,mc as Zv,na as Yl,nb as FI,nc as ek,oa as Xl,ob as im,oc as tk,pa as Jl,pb as sm,pc as rk,qa as Ql,qb as am,qc as nk,ra as Zl,rb as cm,rc as zt,sa as eu,sb as dm,sc as Rm,t as bP,ta as tu,tb as pm,tc as Pm,u as wP,ua as ru,ub as Cm,uc as Mm,v as OP,va as nu,vb as ym,vc as Im,w as RP,wa as ou,wb as Sm,wc as vm,x as PP,xa as iu,xb as Tm,xc as km,y as MP,ya as su,yb as Cv,yc as Nm,z as IP,za as au,zb as Em,zc as Lm}from"./chunks/chunk-7VRFEURZ.js";import"./chunks/chunk-6H36ZHMI.js";import{a as yR,b as SR}from"./chunks/chunk-STOOTHZZ.js";import{$ as Ud,A as Id,B as vd,C as kd,D as Nd,E as Ld,F as $d,G as Dd,H as oP,I as iP,J as sP,K as aP,L as cP,M as dP,Q as pP,R as lP,S as uP,T as mP,U as fP,V as _P,W as hP,X as gP,Z as Fd,_ as Gd,a as Hc,aa as jd,b as Vc,ba as Bd,c as Kc,ca as zd,d as Wc,da as qd,e as Yc,ea as Hd,f as Xc,fa as Vd,g as Jc,ga as Kd,h as Qc,ha as Wd,i as Zc,ia as It,j as fd,k as _d,l as hd,m as gd,n as Cd,o as yd,p as Sd,q as Td,r as Ed,s as Ad,t as xd,u as bd,v as wd,w as Od,x as Rd,y as Pd,z as Md}from"./chunks/chunk-ZYCOM4MS.js";import{a as oR,b as iR,c as sR,d as aR,e as cR,f as dR,g as pR,h as lR,i as uR,j as Ls,k as $s,l as Ds,m as Fs,n as Gs,o as Us,q as js,s as Bs,y as zs}from"./chunks/chunk-Z7MFVRDV.js";import{b as tR}from"./chunks/chunk-PQUBVRV5.js";import"./chunks/chunk-PZA7QECY.js";import{$b as uO,$c as kO,A as mT,Aa as iw,Ab as Ww,Ac as AO,Ad as QO,B as fT,Ba as sw,Bc as xO,Bd as ZO,C as _T,Cc as bO,Cd as eR,Db as Yw,Dc as wO,Dd as rR,Ec as OO,Ed as nR,Fb as Xw,Fc as RO,Gc as PO,Hc as _s,Ic as hs,Jb as Jw,Jc as gs,K as bT,Kb as Qw,Kc as Cs,La as aw,Lb as Zw,Lc as ys,M as NT,Ma as cw,Mb as os,Mc as Ss,N as LT,Na as dw,Nb as eO,Nc as Ts,O as $T,Oa as pw,Oc as Es,P as DT,Pa as lw,Pb as tO,Pc as As,Q as zT,Qa as uw,Qb as rO,Qc as xs,R as qT,Ra as Cw,Rb as nO,Rc as bs,S as bt,Sa as yw,Sb as oO,Sc as ws,T as bb,Ta as Sw,Tb as iO,Tc as Os,U as wb,Ua as wt,Ub as sO,Uc as Rs,V as Ob,Vb as aO,Wa as Tw,Wb as cO,Wc as Ps,X as Rb,Xa as Ew,Xb as dO,Xc as MO,Ya as Aw,Yb as pO,Yc as IO,Z as Pb,Za as xw,Zb as Ot,Zc as Ms,_ as Mb,_a as bw,_b as lO,_c as vO,a as eT,aa as Ib,ad as Is,ba as vb,bb as ww,bd as vs,ca as kb,cd as NO,da as Nb,dd as LO,ea as Lb,ed as $O,fa as $b,fb as Ji,fc as is,fd as DO,ga as Db,gc as ss,gd as FO,ha as Kb,hb as $w,hc as as,hd as GO,i as io,ib as Dw,ic as cs,id as UO,j as tT,ja as Ki,jb as Fw,jd as ks,k as rT,ka as Wi,kb as Gw,kc as ds,kd as Ns,l as nT,la as Yi,lc as ps,ld as jO,m as oT,mb as Uw,mc as ls,md as BO,na as Wb,nb as jw,nc as us,nd as zO,o as iT,oa as Yb,ob as Bw,oc as ms,od as qO,p as sT,pa as Xb,pb as zw,pc as fs,pd as HO,qa as Jb,qb as ts,qc as mO,qd as VO,r as aT,ra as Qb,rb as rs,rc as fO,rd as KO,sa as Zb,sc as _O,sd as WO,t as cT,ta as ew,tb as ns,tc as hO,td as YO,u as dT,ub as qw,uc as gO,ud as XO,v as pT,va as tw,vc as CO,vd as JO,wb as Hw,wc as yO,x as lT,xa as rw,xb as Vw,xc as SO,y as uT,ya as nw,yb as Kw,yc as TO,za as ow,zc as EO,zd as Rt}from"./chunks/chunk-YOPTAIBD.js";import{A as Mw,B as Iw,C as vw,D as kw,E as Nw,F as Lw,G as Qi,H as Zi,I as es,a as Fb,b as Gb,c as Ub,d as jb,e as Bb,f as zb,g as qb,h as Hb,i as Vb,n as mw,q as fw,r as _w,u as hw,v as Xi,w as gw,x as Ow,y as Rw,z as Pw}from"./chunks/chunk-23K6DQQY.js";import{$ as Co,$a as tE,$b as ei,$c as ME,$d as $i,$e as QA,A as Qn,Ab as qo,Ad as WE,Ae as bA,Af as Sx,Ag as Gi,Ah as cb,B as Zn,Bb as Ho,Bd as YE,Be as wA,Bg as Ui,Bh as db,C as eo,Ca as RT,Cb as mE,Cc as TE,Cd as XE,Ce as OA,Ch as pb,D as to,Db as Vo,Dc as EE,Dd as JE,De as RA,Df as Tx,Dh as qi,E as ro,Eb as Ko,Ec as AE,Ed as QE,Ee as PA,Ef as Ex,Eh as lb,F as no,Fa as PT,Fb as L,Fc as xE,Fd as ZE,Fe as MA,Ff as Ax,Fh as ub,G as oo,Gb as Wo,Gd as eA,Ge as IA,Gf as xx,Hc as bE,He as vA,Hf as bx,Ia as MT,Ic as wE,Id as gi,Ie as kA,If as wx,Ih as mb,Jd as Ci,Je as NA,Jf as Ox,Jh as fb,Kd as yi,Ke as LA,Kf as Rx,Kh as _b,La as IT,Ld as Si,Le as $A,Lh as hb,M as Ct,Ma as FT,Mb as Fe,Md as Ti,Me as DA,Mf as Px,Mg as qx,Mh as gb,N as yt,Na as GT,Nb as Yo,Nd as Ei,Ne as FA,Nf as Mx,Nh as Cb,Oa as UT,Oc as OE,Od as Ai,Oe as GA,Of as Ix,Og as Hx,Oh as Hi,Pa as jT,Pd as xi,Pe as UA,Pf as vx,Pg as Vx,Q as hT,Qa as BT,Qc as ui,Qd as bi,Qe as jA,Qf as kx,Qg as Kx,R as gT,Ra as HT,Rc as mi,Rd as wi,Re as BA,Rg as Wx,Rh as yb,S as CT,Sa as VT,Sc as fi,Sd as Oi,Se as zA,Sf as Nx,Sg as Yx,Sh as Vi,Ta as KT,Tc as _i,Td as Ri,Te as qA,Tf as Di,Ua as WT,Ub as fE,Ud as Pi,Ue as HA,Uf as Fi,V as go,Va as YT,Vb as _E,Vd as Mi,Ve as VA,Vh as Sb,W as yT,Wa as XT,Wb as hE,Wd as Ii,We as KA,Wg as Xx,Wh as Tb,X as ST,Xa as JT,Xb as Xo,Xd as vi,Xe as WA,Xh as Eb,Y as TT,Ya as QT,Yb as Jo,Yd as ki,Ye as YA,Yg as Jx,Yh as Ab,Z as ET,Za as ZT,Zb as Qo,Zc as RE,Zd as Ni,Ze as XA,Zh as xb,_a as eE,_b as Zo,_c as PE,_d as Li,_e as JA,a as zS,aa as yo,ab as rE,ac as ti,ae as tA,af as ZA,b as qS,ba as De,bb as nE,bc as ri,be as rA,bf as ex,c as HS,ca as AT,cb as Lo,cc as ni,ce as nA,cf as tx,d as VS,da as xT,db as $o,dc as oi,dd as hi,de as oA,df as rx,e as KS,ea as So,ec as ii,ee as iA,ef as nx,f as WS,fa as To,fb as Do,fc as si,fe as sA,ff as ox,g as YS,gb as Fo,gc as ai,ge as aA,gf as ix,h as XS,ha as Eo,hb as Go,hc as ci,hd as IE,he as cA,hf as sx,i as JS,ib as Uo,ic as di,id as vE,ie as dA,if as ax,ih as Qx,j as QS,jb as jo,jc as pi,jd as kE,jf as cx,jh as Zx,k as ZS,kb as pE,kd as NE,kf as dx,kh as eb,l as Gn,lb as lE,ld as LE,le as pA,lf as px,m as Un,mc as gE,md as $E,me as lA,mh as tb,n as jn,nc as CE,nd as DE,ne as uA,ng as Lx,nh as rb,o as Bn,oc as li,od as FE,oe as mA,of as lx,og as Ge,p as zn,pd as GE,pe as fA,pf as ux,pg as xt,ph as nb,q as qn,qd as UE,qe as _A,qf as mx,qg as $x,qh as ji,r as Hn,rd as jE,re as hA,rf as fx,rg as Dx,s as Ne,sc as yE,sd as BE,se as gA,sf as _x,sg as Fx,sh as Bi,t as Le,tc as SE,te as CA,tf as hx,tg as Gx,th as zi,u as Vn,ue as yA,uf as gx,ug as z,v as Kn,va as Po,vd as zE,ve as SA,vf as Cx,vg as Ux,w as Wn,wd as qE,we as TA,wg as jx,wh as ob,x as Yn,xa as wT,xb as Bo,xd as HE,xe as EA,xg as Bx,xh as ib,y as Xn,ya as OT,yb as zo,yd as VE,ye as AA,yg as zx,yh as sb,z as Jn,zb as uE,zd as KE,ze as xA,zf as yx,zh as ab}from"./chunks/chunk-FXJYZBWV.js";import"./chunks/chunk-PW7U7WCE.js";import{$ as ha,$a as hc,A as ZR,Aa as za,B as Vs,Ba as qa,C as Ks,Ca as Ha,D as Ws,Da as Va,Ea as Ka,F as Ys,Fa as Wa,G as Xs,Ga as Ya,H as Js,Ha as Xa,I as Qs,Ia as Ja,J as Zs,Ja as Qa,K as ea,Ka as Za,L as ta,La as ec,M as ra,Ma as tc,N as na,Na as rc,O as oa,Oa as nc,P as ia,Pa as oc,Q as sa,Qa as ic,R as aa,Ra as sc,S as ca,Sa as ac,Ta as cc,U as da,Ua as dc,V as pa,Va as pc,W as la,Wa as lc,X as ua,Xa as uc,Y as ma,Ya as mc,Z as fa,Za as fc,_ as _a,_a as _c,aa as ga,ab as gc,b as LR,ba as Ca,bb as Cc,c as $R,ca as ya,cb as yc,d as DR,da as Sa,db as Sc,e as FR,ea as Ta,eb as Tc,f as GR,fa as Ea,fb as Ec,ga as Aa,gb as Ac,h as UR,ha as xa,hb as xc,i as jR,ia as ba,ib as bc,j as Hs,ja as wa,jb as wc,k as BR,ka as Oa,la as Ra,lb as Be,ma as Pa,mb as Z,n as zR,na as Ma,nb as Oc,o as qR,oa as Ia,p as Ue,pa as va,q as HR,qa as ka,r as VR,ra as Na,s as KR,sa as La,t as Pt,ta as $a,u as je,ua as Da,v as WR,va as Fa,w as YR,wa as Ga,x as XR,xa as Ua,y as JR,ya as ja,z as QR,za as Ba}from"./chunks/chunk-I2OJ5B4A.js";import{D as Ro,G as Tt,I as Et,K as Mo,L as Io,M as At,O as vT,Q as kT,S as No,Z as aE,a as R,aa as cE,b as BS,ba as dE,c as gt,e as Mn,f as In,g as vn,h as kn,i as ve,j as Nn,k as N,l as ke,m as Ln,n as $n,o as Dn,p as Fn,q as Ao,r as xo,s as bo,t as wo,u as Oo}from"./chunks/chunk-7IROAPWI.js";import{L as oE,O as vo,P as iE,Q as ko,S as sE,a as po,b as lo,c as uo,h as mo,j as fo,k as _o,l as ho}from"./chunks/chunk-7X253M6Z.js";import{A as ue,B as jS,C as S,E as so,F as St,G as me,H as ao,K as $e,M as co,b as NS,c as LS,d as $S,m as DS,r as FS,u as GS,y as US}from"./chunks/chunk-YYT3MIRF.js";import"./chunks/chunk-XAWE4EAK.js";var q="2026-07-28",or=["2025-11-25","2025-06-18"],te=[q],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},x={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},nr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function $g(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function Dg(e){if(e!==void 0){if(typeof e!="string"||!nr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:x.logLevel,allowed:[...nr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[x.protocolVersion,x.clientCapabilities]});let r=t[x.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let n=t[x.clientCapabilities];if(!h(n))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:x.clientCapabilities,expected:"object"});let o=$g(t[x.clientInfo]),i=Dg(t[x.logLevel]);return{protocolVersion:q,clientCapabilities:n,...o?{clientInfo:o}:{},...i?{logLevel:i}:{}}}function M0(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function I0(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function v0(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[x.serverInfo]:{...t}}}}function Fg(e,t){return Xe({...e,resultType:"complete"},t)}function k0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Fg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function N0(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}var Gg=new Set(["--help","-h","--version","-V"]);function Ug(e,t){let n=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&n.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),n.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),n.join(`
|
|
2
|
+
`)}function D0(e,t,r){if(e.length===0)return{kind:"serve"};let n=e.find(i=>!Gg.has(i));if(n!==void 0){let i=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(n)}. Run ${i} --help.
|
|
3
|
+
`}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Ug(t,r):`${r}
|
|
4
|
+
`,stderr:""}}import{createHash as ar,createHmac as cr,timingSafeEqual as jg}from"node:crypto";var Bg=["elicitation/create","roots/list","sampling/createMessage"],ir=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},dr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function zg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Ce(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let n={};for(let[o,i]of r){if(!dr.test(o)||!h(i))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!Bg.includes(s))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=zg(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(i.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return Ce(n,Qe,"inputRequests"),n}function pr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[n,o]of t){if(!dr.test(n)||!h(o))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return Ce(r,Qe,"inputResponses"),r}function j0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[x.serverInfo]:{...e.serverInfo}}}}function lr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function B0(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let n=r.toString("base64url"),o=cr("sha256",lr(t)).update(n).digest("base64url");return`${n}.${o}`}function qg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function z0(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=cr("sha256",lr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!jg(s,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=qg(c),{expiresAt:p,method:l,parameterDigest:f,principal:g}=d;if(p<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:p});if(l!==r.method||f!==r.parameterDigest||g!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function q0(e){return Ce(e,Qe,"request parameters"),ar("sha256").update(JSON.stringify(e)).digest("hex")}var sr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ar("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function Hg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function H0(e,t){return{...e,...Hg(t)}}function Vg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Kg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Vg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function Wg(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,n=e.maxNodes??Je.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function Yg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function Xg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Kg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function V0(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=Wg(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Ce(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:n,maximumNodes:o});Xg(e,a.value),Yg(a,i)}return structuredClone(e)}import{randomUUID as Jg}from"node:crypto";import{readFile as Qg}from"node:fs/promises";import ur from"node:path";var eL="io.modelcontextprotocol/tasks",Zg=["working","input_required","completed","failed","cancelled"],eC=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,tC=3600*1e3,rC=1e3,Se=1024,nC=30,oC=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ye(e){let t=e.trim();if(!eC.test(t))throw et("Unknown MCP task");return t}function mr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function fr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Se),...h(e.data)?{data:structuredClone(e.data)}:{}}}function iC(e){if(!Zg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function sC(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function aC(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function cC(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function dC(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function pC(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function lC(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ye(e.taskId):"",r=iC(e.status),n=sC(e.principal),o=aC(e.workerPid),i=cC(e.ttlMs),s=dC(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:pC(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=fr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function H(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function re(e){return e==="completed"||e==="failed"||e==="cancelled"}function uC(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#n;#i;constructor(t){this.#e=ur.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${Jg()}`),this.#i=t.workerPid??process.pid}#s(t){return ur.join(this.#e,"runtime","mcp-tasks","records",`${ye(t)}.json`)}async#c(t){try{return lC(JSON.parse(await Qg(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
|
|
5
|
+
`)}async#o(t,r,n){let o=ye(t),i=await Fe(this.#e,o,nC,this.#t,!1,!1,oC);try{let s=await this.#c(o);if(s.principal!==r)throw et("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ye(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?tC:t.ttlMs,i=t.pollIntervalMs??rC;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new u("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Se)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#o(t,r,n=>{if(re(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!uC(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ze(t.inputRequests,t.requestContext);return H(await this.#o(t.taskId,t.principal,n=>{if(re(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Se),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=pr(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[p,l]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,p)&&(d[p]=l,delete c[p],i.push(p));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return H(await this.#o(t,r,o=>re(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=fr(n);return H(await this.#o(t,r,i=>re(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return H(await this.#o(t,r,n=>re(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function tL(e){return new tt(e)}var Te="io.modelcontextprotocol/subscriptionId",_r=256,hr=2048,mC=5e3;function fC(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),mC);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function rt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function _C(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=rt(e.toolsListChanged,"toolsListChanged"),r=rt(e.promptsListChanged,"promptsListChanged"),n=rt(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>_r)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:_r});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>hr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:hr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function hC(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var gr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=hC(_C(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Te]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[Te]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Te]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await fC(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[Te]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};var Cr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,gC=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,yr=/^[\t\x20-\x7E]*$/u,Sr=new Set(["prompts/get","resources/read","tools/call"]);function CC(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function b(e,t){throw new u(e,m.headerMismatch,{header:t})}function Tr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&yr.test(t)&&!Cr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Er(e,t){let r=Cr.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?b("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!yr.test(e)?b("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function yC(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!gC.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function Ar(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!h(s))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!h(c))continue;let d=[...i,a],p=yC(c,d,r);p&&t.push(p);for(let[l,f]of Object.entries(c))if(l!=="properties"&&l!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:l});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&Ee(i))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function xr(e,t){let r=e;for(let n of t){if(!h(r))return;r=r[n]}return r}function br(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function SC(e,t){let r=h(e.arguments)?e.arguments:{},n={};for(let o of Ar(t)){let i=xr(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=Tr(i)}return n}function sL(e){let t=h(e.request.params)?e.request.params:void 0,r=Ye(t),n=e.request.method;if(typeof n!="string"||n.length===0)return b("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=br(n,t);if(Sr.has(n)){if(i===void 0)return b("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=Tr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,SC(t,e.toolSchema)),o}function TC(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&b("Missing MCP request method","Mcp-Method");let n=h(t.params)?t.params:void 0,o=Ye(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&b("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&b("MCP method header does not match request body","Mcp-Method"),Sr.has(r)){let i=e.get("mcp-name"),s=br(r,n);(i===void 0||s===void 0||Er(i,"Mcp-Name")!==s)&&b("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&b("MCP SSE resumability is not supported","Last-Event-ID")}function EC(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function AC(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Ar(e.toolSchema)){let n=xr(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&b("Unexpected MCP parameter header",o);continue}i===void 0&&b("Missing MCP parameter header",o),EC(r,n,Er(i,o))||b("MCP parameter header does not match request body",o)}}function aL(e){let t=CC(e.headers),r=typeof e.request.method=="string"?e.request.method:"";TC(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&AC({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var cL=q;import{AsyncLocalStorage as xC}from"node:async_hooks";import{createHash as wr,timingSafeEqual as bC}from"node:crypto";var C=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},wC=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,OC=/^[a-z][a-z0-9_*/-]{0,255}$/u,RC=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,PC=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Rr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Pr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,MC=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,IC=/%(?![0-9A-Fa-f]{2})/u,vC=512,kC=32,NC=180,LC=8192,$C=8192,Mr=new xC;function A(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new C(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new C(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new C(`Invalid ${t}`,401);return n}function DC(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function mL(e){let t=A(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new C("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>A(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Rr.test(o)))throw new C("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function fL(e){let t=A(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function _L(e,t){if(!h(e)||typeof e.issuer!="string")throw new C("Invalid authorization server metadata",401);let r=A(t,"expected issuer").href.replace(/\/$/u,"");if(A(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new C("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new C("Authorization server does not support required S256 PKCE",401);let o=d=>{let p=e[d];if(typeof p!="string")throw new C(`Authorization server metadata requires ${d}`,401);return A(p,d).href},i=d=>{let p=e[d];return typeof p=="string"?A(p,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function hL(e){return e.hasPreRegisteredClient?"pre_registered":e.metadata.client_id_metadata_document_supported?"client_id_metadata_document":e.metadata.registration_endpoint?"dynamic":"user_supplied"}function gL(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new C("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new C("Authorization response issuer mismatch",401)}function CL(e,t){let r=A(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new C("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new C("Invalid client redirect URI",401);A(n,"client redirect URI",!0)}return structuredClone(e)}function yL(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new C("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>A(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Or=class{#e=new Map;set(t,r){let n=A(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=A(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=A(t,"credential issuer").href;return this.#e.delete(r)}};function FC(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?wC.exec(t):null;if(!n)throw new C("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new C("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!UC(r)))throw new C("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function GC(e){return OC.test(e)||RC.test(e)}function UC(e){if(Buffer.byteLength(e,"utf8")>vC)return!1;let t=e.split(",");if(t.length>kC)return!1;let r=new Set;for(let n of t){let o=$(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!GC(s)||!PC.test(a)||r.has(s))return!1;r.add(s)}return!0}function Ir(e){return MC.test(e)&&!IC.test(e)}function jC(e){let t=$(e),r=t.indexOf("="),n=$(r>=0?t.slice(0,r):t),o=r>=0?$(t.slice(r+1)):void 0;return Pr.test(n)&&(o===void 0||Ir(o))}function BC(e){let t=$(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=$(i>0?n.slice(0,i):""),a=i>0?$(n.slice(i+1)):"";if(!(!Pr.test(s)||!Ir(a)||!o.every(jC)))return{key:s,serialized:t}}function zC(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>LC)throw new C("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>NC)throw new C("Invalid MCP baggage",403);let o=[];for(let i of n){let s=BC(i);if(!s)throw new C("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function SL(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},n=zC(r.baggage,t.baggageAllowlist??[]);return{...FC(r),...n?{baggage:n}:{}}}function TL(e,t){return Mr.run(structuredClone(e),t)}function EL(){let e=Mr.getStore();return e?{...e}:void 0}async function AL(e){let t=A(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(l=>!Rr.test(l)))throw new C("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new C("Access tokens must not appear in URI query parameters",401,n);let s=DC(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new C("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>$C)throw new C("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new C("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new C("Bearer token issuer or audience mismatch",401,n);let p=r.filter(l=>!c.scopes.includes(l));if(p.length>0)throw new C("Bearer token has insufficient scope",403,`${n}, scope="${p.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function xL(e){let t=wr("sha256").update(e.token).digest();return r=>{let n=wr("sha256").update(r).digest();if(!bC(t,n))throw new C("Invalid bearer token",401);return structuredClone(e.claims)}}var nt="io.modelcontextprotocol/ui",Ae="2026-01-26",Nr="text/html;profile=mcp-app",vr=Object.freeze({specVersion:Ae,mimeTypes:[Nr]});function OL(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[nt];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(Nr)||o!==void 0&&o!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});return!0}var qC={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Lr=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:qC})));function RL(e){return Lr.find(t=>t.uri===e)}function PL(e){let t=new Map(Lr.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function kr(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function ML(e){let t=kr(e.name),r=kr(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),o=JSON.stringify(Ae);return`<!doctype html>
|
|
6
6
|
<html lang="en">
|
|
7
7
|
<head>
|
|
8
8
|
<meta charset="utf-8">
|
|
@@ -22,14 +22,14 @@ import{a as Ng}from"./chunks/chunk-X6MIWTTT.js";import{a as Ex,b as Sx,c as wx,d
|
|
|
22
22
|
<button type="button" id="copy">Copy visible evidence</button>
|
|
23
23
|
</main>
|
|
24
24
|
<script>
|
|
25
|
-
(()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${
|
|
25
|
+
(()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${n},appCapabilities:{},protocolVersion:${o}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
|
|
26
26
|
</script>
|
|
27
27
|
</body>
|
|
28
|
-
</html>`}import{createHash as
|
|
29
|
-
`)).digest("hex");
|
|
30
|
-
`)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Gr(P.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=P.resolve(t.packageRoot,".agents","skills"),n=P.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let s=await Gr(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??I.defaultPageSize;$r.has(r)||C(`Skill list limit must be an integer from 1 to ${I.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(Ur),hasMore:a,...a?{nextCursor:this.#o(i,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Ur(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(d=>d.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},c=Fr(n,s);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:s.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,c=new Map;for(let T of n.resources){let E=T.uri.slice(`${a}/`.length);if(!E.startsWith(i))continue;let B=E.slice(i.length),[v,...vo]=B.split("/"),Ro=`${a}/${i}${v}`,Io=n.files.get(`${i}${v}`);c.set(v,{uri:Ro,name:v,mimeType:vo.length>0?"inode/directory":Fr(v,Io)})}s.length>0&&c.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??I.maxPageSize;$r.has(d)||C(`Skill directory limit must be an integer from 1 to ${I.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...c.values()].sort((T,E)=>T.uri.localeCompare(E.uri)),f=p.slice(l,l+d),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,t)}:{}}}};(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]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(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]="619dbd55-b854-5e69-b5a5-c0bcada81629")}catch{}})();var zr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function st(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,o)=>st(r,`${t}[${o}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,st(o,`${t}.${r}`)])))}function we(e){if(e.schema!==zr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,o)=>Object.freeze({action:r.action,input:st(r.input,`operations[${o}].input`)})))})}async function Hr(e,t){let r=we(e);return Ct(r,t)}async function Qy(e,t){return Hr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));return r})}(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]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var Vr="pm.agent-observation/v1",Kr="pm.agent-verdict/v1",Wr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function M(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function oe(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))oe(t)}return e}function Zy(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(M(r.command,"observation.reads.command"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function eb(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function tb(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(M(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let s of o.fields){if($(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function rb(e){if(e.schema!==Vr)throw new Error(`observation.schema must be ${Vr}.`);return M(e.id,"observation.id"),O(e.version,"observation.version"),Zy(e.reads),eb(e.calibration),e.corpus_dependence.kind==="bounded"&&(M(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),tb(e.tiers),oe(structuredClone(e))}function zL(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function ob(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(R(i),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function $(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Yr(e,t){let r=e;for(let o of $(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function nb(e){return`/${$(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function ib(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function sb(e){if(e.schema!==Kr)throw new Error(`verdict.schema must be ${Kr}.`);M(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){M(o.id,"verdict.predicates.id"),$(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);ib(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return oe(structuredClone(e))}function ab(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),c=Yr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:R(c)===R(a.expected);return{id:i,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${nb(a.path)}`,evidence_digest:ht(R(c))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function HL(e){if(e.schema!==Wr)throw new Error(`episode.schema must be ${Wr}.`);if(M(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)M(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)$(t,"episode.observable_fields");for(let t of e.withheld_fields)$(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return rb(e.observation),sb(e.verdict),we(e.recipe),oe(structuredClone(e))}function cb(e,t,r){let o=$(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function db(e,t){let r={};for(let o of t)cb(r,o,Yr(e,o));return r}async function VL(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await ob(e.observation,async _=>db(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),_=ab(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>L(a,d),step:async p=>{if(s)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await L(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=L(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:oe(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(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]="1202ba19-0bcb-5478-b245-4472e361d4de")}catch{}})();var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function V(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ne(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Jr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Jr(t);Object.freeze(e)}}function K(e){if(e.schema!==F)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(V(e.hierarchy_depth,"hierarchy_depth"),V(e.hierarchy_fanout,"hierarchy_fanout"),ne(e.age_span_days,"age_span_days"),V(e.history_entries_per_item,"history_entries_per_item"),ne(e.comments_per_100_items,"comments_per_100_items"),ne(e.notes_per_100_items,"notes_per_100_items"),ne(e.learnings_per_100_items,"learnings_per_100_items"),V(e.author_cardinality,"author_cardinality"),V(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Jr(t),t}var Ae=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],W=Object.freeze({scratch:K({schema:F,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:K({schema:F,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:Ae,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":K({schema:F,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:Ae,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":K({schema:F,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:Ae,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":K({schema:F,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:Ae,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function lb(){return Object.keys(W).sort().map(e=>W[e])}function pb(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Xr=new WeakMap;function Qr(e,t){if(e===0)return[];let r=Xr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Xr.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function ub(e,t,r,o=42){if(ne(t,"item index"),V(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,c=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=i%a,l=i-d,p=d===0?void 0:s+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Qr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var at=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Qr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[i,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),p=c*a+Math.min(a,d),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,c=this.expectedEdgeKinds[i]??0;a!==c&&o.push(`edge_kind:${i}:${a}!=${c}`)}let s=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:s.length===0,mismatches:s}}};function Zr(e){return new at(e)}function mb(e,t){let r=Zr(e);for(let o of t)r.add(o);return r.finish()}(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]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(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]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function fb(){let e=$e(process.cwd(),process.env.PM_PATH);await At(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!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]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function _b(){await vt()}(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]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var eo=["lines","branches","functions","statements"];function hb(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function gb(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function yb(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,o]of Object.entries(e)){hb(r,o);for(let n of eo){let s=gb(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}return t}import Y from"node:fs";import ct 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]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var to=300*1e3,bb=3;function pD(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function uD(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");Y.mkdirSync(e,{recursive:!0});let o=ct.join(e,r);Y.mkdirSync(o,{recursive:!0});let n=new Date;Y.utimesSync(o,n,n);let s=Y.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Y.statSync(ct.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&me(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),i=s.filter(d=>n.getTime()-d.mtimeMs<to),a=Math.max(0,bb-1-i.length),c=s.filter(d=>n.getTime()-d.mtimeMs>=to).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)Y.rmSync(ct.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as Tb}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]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var dt=1;function X(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),s=e.edges(),i=t.list();return Object.freeze({version:dt,fingerprint:Tb("sha256").update(R({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function Cb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!Cb(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==dt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ge([]);for(let n of e.kinds)t.register(n);let r=new q(e.nodes,e.edges,t),o=J(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function k(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");X(t.signal);let o=await e.read({...t,workspace:r});return X(t.signal),o===null?null:se(o)}async function Oe(e,t){let r=G(t.workspace,"workspace"),o=se(t.snapshot).snapshot,n=await k(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(X(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await k(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function Eb(e,t={}){let r=e.map(se),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let c=o.get(a.kind);if(c&&R(c)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Ge([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new q(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return J(s,n,t)}var ie=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){X(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){X(t.signal);let r=G(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(se(t.snapshot).snapshot))}async clear(t){X(t.signal);let r=G(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(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]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function ro(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Sb(e){let t=ro(e.nodeCount,"nodeCount"),r=ro(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function oo(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=St(),n=J(new q(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=J(new q(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),i=[];U(await k(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Oe(e,{workspace:r,snapshot:n});U(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await k(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),U((await Oe(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),U((await k(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.push({name:"replacement-visibility",passed:!0});let c=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{c=!0}return U(c,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),U(await k(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function wb(e){return oo(new ie,e?{workspace:e}:{})}(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]="58736688-35d0-545d-892e-e0ede7fedc1a")}catch{}})();(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]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(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]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var lt=2,Ab=["self_reported","independent_transport"];function ve(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function no(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let s=ae(o,`${t}[${String(n)}]`);return r?o:s})}function pt(e,t){return e===void 0?void 0:ae(e,t)}function Ob(e,t){if(e===void 0)return;if(!ve(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(s=>s.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function vb(e,t,r,o,n,s){if(o==="refusal"){if(Ve(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=gt(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=yt(t.slice(i+1));l!==void 0&&(a=xe(`history ${l}`))}let c=Lt(a);if(!Ve(r)||r!==0&&!c?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=Nt(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function Rb(e,t,r){if(!ve(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=ae(e.id,`${o}.id`),s=no(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!xt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!Ab.includes(d))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let p=no(e.required_fields,`${o}.required_fields`);if(p.some(E=>E.split(".").some(B=>B.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=Ob(e.expected_field_values,`${o}.expected_field_values`),_=pt(e.expected_error_code,`${o}.expected_error_code`),g=pt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=pt(e.recovery_for,`${o}.recovery_for`);return vb(o,s,i,c,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:c,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function Ib(e,t){if(!ve(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),o=ae(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>Rb(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function qD(e){if(!ve(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==lt)throw new TypeError(`agent-task transcript corpus version must be ${String(lt)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((o,n)=>Ib(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:lt,tasks:t}}import{createHash as io}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]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function so(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function KD(e,t){let r=so(t.migrationId,"migrationId"),o=so(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=qe(e,void 0,t.registry),a=i.graph.nodes(),c=i.graph.edges().map(f=>{let _=io("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),d=io("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),p=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(p),edge_count:c.length,skipped_existing_count:c.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as ao 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]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},YD=Object.freeze(Object.keys(ut));function co(e){if(Object.hasOwn(ut,e))return ut[e]}var Pb=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function Mb(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function kb(e){return e===void 0||e.kind==="punctuator"&&Pb.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function xb(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
|
|
31
|
-
`,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function
|
|
32
|
-
`&&t.push(r+1);return t}function
|
|
33
|
-
`)}(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]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function Xb(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function Jb(e){return[e.exit_code!==ue.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${ue.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...Xb(e)]}function d1(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let s=t.length;for(let i of Jb(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(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]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var uo="not-a-declared-action";function Qb(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function de(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function y1(e=je.filter(t=>Rt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>de(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=de(r.command),a=s.length>1&&t.has(i)?s.map(de).join("--"):i,c=Z(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=Ue.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${de(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>Qb(r.command,l)),...c],recovery_args:[...s,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function Zb(e){switch(N(e)){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ne;case"merge":return Le;case"plan":return Ke;case"profile":return We;case"schema":return Dt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function b1(e=je){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${de(t)}`,command:t,refusal_args:[...r,uo],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:uo,allowed_values:[...Zb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function eT(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function tT(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!eT(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function T1(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>tT(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).length,findings: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]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var ft=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function E1(){return ft.map(e=>({...e}))}function rT(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function S1(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ft){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=rT(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ft.length,closed_probe_count:o,findings:r}}(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]="e0a11b62-d1a7-5815-ab8a-31741fcd856e")}catch{}})();var Re,oT=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function nT(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=oT[N(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Ie(){if(Re!==void 0)return Re;let e=ee.filter(({command:n})=>Be(n)).flatMap(({command:n,family:s})=>It(n,Z(n)).map(i=>({command:n,family:s,concept:nT(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Re=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Re}function I1(){return Object.freeze(Ie().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var mo=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:104,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":28,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:41,docs:32,deps:32,plan:111,test:58,"test-all":41,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:40,release:25,"start-task":24,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),iT=1,fo=Object.freeze(Object.fromEntries(Object.entries({...mo,...Object.fromEntries(ke.flatMap(({alias:e,canonical:t})=>{let r=mo[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+iT])));function _o(){let e=new Map(Object.keys(fo).map(t=>[t,0]));for(let{command:t}of Ie())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(fo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function sT(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function aT(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function cT(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let c of n.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${c} no longer resolves to ${n.canonical_flag}.`})}}function P1(e=Ie(),t=_o(),r=[]){let o=[],n=new Map,s=new Map,i=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;n.has(d)?o.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):n.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=s.get(c.concept);l!==void 0&&l!==c.value_kind?o.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):s.set(c.concept,c.value_kind);let p=i.get(c.concept);p!==void 0&&p!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${p} and ${c.flag}.`}):i.set(c.concept,c.flag)}return sT(e,n,o),aT(a,t,o),cT(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:o}}function M1(){let e=Ie(),t=_o(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
|
|
34
|
-
`)}(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]="3f3a5dca-8370-52d7-b279-dc6f9f0aeadf")}catch{}})();function x1(e){return e}function N1(e){return e}function L1(e){return e}function D1(e){return e}function $1(e){return e}function F1(e){return e}function G1(e){return e}function U1(e){return e}function j1(e){return e}function B1(e){return e}function q1(e){return e}function z1(e){return e}function H1(e){return e}function V1(e){return{handled:!0,result:e}}function K1(){return{handled:!1}}function W1(e){return e}function Y1(e){return e}function X1(e){return e}function J1(e){return e}function Q1(e){return e}function Z1(e){return e}function e$(e){return e}function t$(e){return e}function r$(e){return e}(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]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function dT(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function lT(e={},t={}){return new _e(t).packageMigrate(e)}(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]="ce91f520-088c-5a77-9194-78a36c965ff6")}catch{}})();(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]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function x(e){if(typeof e!="string"||!Et(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function pT(e){let t=x(e.window_start),r=x(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function uT(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let c=x(i.started_at);if(i.repaired_at!==void 0&&(x(i.repaired_at)<c||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");c>=r&&c<o&&a.push(i)}return n}function C$(e,t){let{start:r,end:o}=pT(t),n=[...uT(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),c=i.filter(_=>_.outcome!=="pending").length,d=c===0?null:a.length/c,l=a.filter(_=>_.repaired_at!==void 0&&x(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return c<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),d!==null&&d>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:c,failed:a.length,pending:i.length-c,failure_rate:d,affected_days:[...new Set(a.map(_=>new Date(x(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(x(_.repaired_at)-x(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families: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]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function le(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function mT(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!le(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!le(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function fT(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!le(o.identity)||r.has(o.identity)||!le(o.reason)||!le(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function S$(e,t=[]){let r=mT(e),o=[...r.keys()].sort(),n=fT(t,o),s=[...new Set([...r.values()].flatMap(d=>[...d]))].sort(),i=[],a=new Set;for(let d of s){let l=o.filter(_=>!r.get(_).has(d));if(l.length===0)continue;let p=n.get(d),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(d),i.push({identity:d,present_in:o.filter(_=>r.get(_).has(d)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let c=[...n.keys()].filter(d=>!a.has(d)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(d=>d.disposition!==null)&&c.length===0,counts:Object.fromEntries(o.map(d=>[d,r.get(d).size])),findings:i,stale_exceptions:c}}(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]="14b66b71-90c1-5a6b-96cc-af2694079048")}catch{}})();import{createHash as go,createHmac as _T,randomBytes as hT,timingSafeEqual as gT}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]="98283845-5c48-5901-b54c-c8cc8138427b")}catch{}})();var aF="dev.unbrained.pm/progressive-tool-discovery",cF=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),yT=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),bT=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),yo={core:0,standard:1,full:2,internal:3},bo=Object.freeze(["core","standard","full"]),TT=new Set(["core","standard","full","custom"]),To=new Set(ee.map(({family:e})=>e)),CT=hT(32);function Me(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function Co(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function Eo(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function So(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function wo(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function ET(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function dF(e){if(wo(e),e.family!==void 0&&(typeof e.family!="string"||!To.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!bo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Me(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Co(e.limit)}:{},...e.cursor!==void 0?{cursor:Me(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:So(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:Eo(e.outputBudget)}:{}}}function ST(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function pe(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function wT(e,t){let r=pe(e);if(r.length===0)return 0;let o=new Set(pe(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function AT(e,t){let r=pe(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=pe(t),s=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function ho(e){return go("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Ao(e,t,r){return _T("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function OT(e,t,r){let o={version:1,offset:t,signature:Ao(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function vT(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),s=n.offset;if(n.version!==1||typeof s!="number"||!Number.isInteger(s)||s<0||s>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(Ao(t,s,o),"base64url"),a=Buffer.from(n.signature,"base64url");if(a.length!==i.length||!gT(a,i))throw new Error("cursor signature does not match the request");return s}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function _t(e,t,r){return{value:ST(e),weight:t,available:r!=="unavailable",source:r}}function Pe(e,t,r){return _t(e??t,r,e===void 0?"computed":"host")}function RT(e,t,r){let o=Object.hasOwn(fe,e.name)?fe[e.name]:"help",n=ze(o),s=`${e.name} ${e.description} ${o} ${n}`,i=wT(t,s),a=new Set(pe(t)),c={lexical:_t(i,j.lexical,"computed"),semantic:Pe(e.signals?.semantic,AT(t,s),j.semantic),graph:Pe(e.signals?.graph,a.has(n)||a.has(o)?1:0,j.graph),permission:_t(1,j.permission,"authorization"),freshness:Pe(e.signals?.freshness,1,j.freshness),usage:Pe(e.signals?.usage,yT.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:He(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function IT(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!bo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!To.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!TT.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function PT(e){let t=Me(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Me(e.cursor===void 0?"":e.cursor,"cursor");let r=Co(e.limit===void 0?10:e.limit),o=Eo(e.outputBudget===void 0?1200:e.outputBudget);return IT(e),{query:t,includeSchema:So(e.includeSchema),limit:r,budget:o,maximumTier:yo[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Oo(e,t,r){let o=r??e.tools.reduce((i,a,c)=>i+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===s)break;s=c}return s}function MT(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>RT(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&yo[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function kT(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Oo(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function lF(e,t={}){ET(e),wo(t);let r=PT(t),o=t.cursorIntegrityKey??CT,n=MT(e,t,r),s=ho({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=vT(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+r.limit<n.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:j},cache:{key:ho({fingerprint:s,cursorIntegrityKey:go("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:bT}},l=(g,T=g.length)=>{let E=i+T,B=E<n.length,v=[...c];return T<a.length&&v.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...g],returned:T,has_more:B,...B?{next_cursor:OT(s,E,o)}:{},omission_receipt:{has_omissions:v.length>0,omitted:v}}},p=g=>{let T=l(g),E=Oo(T,r.budget);return{...T,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=kT(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(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]="92de6b54-8d32-5394-964c-854d01cea810")}catch{}})();(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]="1d55714d-fdc3-511e-b441-39e257c8bde6")}catch{}})();export{rR as ACTIONABILITY_ORDERING_KINDS,Yc as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,yc as ACTIVITY_FLAG_CONTRACTS,Yn as AGENT_PROVENANCE_DIMENSIONS,ra as AGGREGATE_FLAG_CONTRACTS,Ba as APPEND_FLAG_CONTRACTS,VM as ASSURANCE_ACTIONS,KM as ASSURANCE_DECLARATION_KINDS,oP as ASSURANCE_DOCUMENT_VERSION,cc as ASSURANCE_FLAG_CONTRACTS,nP as ASSURANCE_GATE_TRIGGERS,iP as ASSURANCE_MEASUREMENT_SOURCE_KINDS,XP as ASSURANCE_PRESET_IDS,ZI as AssuranceEvaluationRefusalError,QI as AssuranceMutationRefusalError,eP as AssuranceSourceResolutionError,Nn as BASELINE_ITEM_FORMAT_VERSION,tI as BOUNDARY_FIXTURE_CAPTURE_SOURCES,NR as BRIEF_LIST_FIELDS,Jn as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,Xn as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,ln as BUILTIN_ITEM_TYPE_VALUES,Ht as BUILTIN_PROFILES,kw as BUILTIN_RELATIONSHIP_KINDS,Vc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,gc as CALENDAR_FLAG_CONTRACTS,qa as CLAIM_FLAG_CONTRACTS,Fd as CLOSE_ACTION_OPTION_KEYS,Ua as CLOSE_FLAG_CONTRACTS,ja as CLOSE_MANY_FLAG_CONTRACTS,Ya as CLOSE_TASK_FLAG_CONTRACTS,oa as COMMENTS_FLAG_CONTRACTS,_C as COMMON_MUTATION_COMMAND_OPTION_KEYS,Pc as COMPLETION_FLAG_CONTRACTS,hn as CONFIDENCE_TEXT_VALUES,ya as CONFIG_FLAG_CONTRACTS,Kc as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,M0 as CONTEXT_EVALUATION_METRIC_NAMES,Tc as CONTEXT_FLAG_CONTRACTS,XS as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,Bt as CONTEXT_OUTPUT_VALUES,D0 as CONTEXT_PACKING_PROFILES,S0 as CONTEXT_RECENCY_EPOCH,v0 as CONTEXT_RELEVANCE_SERVICE,A0 as CONTEXT_RELEVANCE_SIGNAL_NAMES,G0 as CONTEXT_SIGNAL_SET_VERSION,F0 as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,U0 as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,GS as CONTEXT_USAGE_LIMITS,Ic as CONTRACTS_FLAG_CONTRACTS,mc as COPY_FLAG_CONTRACTS,pd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,md as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,ud as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,$T as CREATE_DIRECT_CLOSE_REASON_DEFAULT,dc as CREATE_FLAG_CONTRACTS,eE as CURRENT_HISTORY_HASH_ALGORITHM,yw as CURRENT_HISTORY_ITEM_HASH_VERSION,Tw as CURRENT_HISTORY_RECORD_HASH_VERSION,Ln as CURRENT_ITEM_FORMAT_VERSION,z0 as ContextSignalStore,US as ContextUsageValidationError,h0 as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,ak as DEFAULT_CHILD_SAMPLE_LIMIT,xR as DEFAULT_COMPACT_LIST_FIELDS,DO as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Rf as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,VP as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,a0 as DEFAULT_TERMINAL_TRANSITION_POLICY,W0 as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,aI as DEFECT_ESCAPE_CLASSES,cI as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ha as DELETE_FLAG_CONTRACTS,mn as DEPENDENCY_KIND_VALUES,Sc as DEPS_FLAG_CONTRACTS,aa as DOCS_FLAG_CONTRACTS,ic as DUPLICATES_FLAG_CONTRACTS,wM as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,uI as DefectRecurrencePolicyParseError,Ac as EVAL_FLAG_CONTRACTS,Cf as EVAL_METRIC_NAMES,Af as EVAL_QUERY_SET_CONTRACT,Of as EVAL_QUERY_SET_EXAMPLE,wf as EVAL_QUERY_SET_SCHEMA_ID,bc as EVENTS_FLAG_CONTRACTS,Ja as EVENT_FLAG_CONTRACTS,Do as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,Ia as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ra as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Da as EXTENSION_ADOPT_FLAG_CONTRACTS,Fk as EXTENSION_CAPABILITIES,LT as EXTENSION_CAPABILITY_CONTRACT,xT as EXTENSION_CAPABILITY_CONTRACT_VERSION,NT as EXTENSION_CAPABILITY_LEGACY_ALIASES,Ui as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,La as EXTENSION_CATALOG_FLAG_CONTRACTS,Pa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,va as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Na as EXTENSION_DOCTOR_FLAG_CONTRACTS,Oa as EXTENSION_EXPLORE_FLAG_CONTRACTS,ba as EXTENSION_FLAG_CONTRACTS,Ca as EXTENSION_INIT_FLAG_CONTRACTS,wa as EXTENSION_INSTALL_FLAG_CONTRACTS,ka as EXTENSION_MANAGE_FLAG_CONTRACTS,Ma as EXTENSION_MIGRATE_FLAG_CONTRACTS,Gk as EXTENSION_POLICY_MODES,Uk as EXTENSION_POLICY_SURFACES,xa as EXTENSION_RELOAD_FLAG_CONTRACTS,Bk as EXTENSION_SANDBOX_PROFILES,Ta as EXTENSION_SCOPE_FLAG_CONTRACTS,jk as EXTENSION_TRUST_MODES,Aa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,wI as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,EI as EXTERNAL_DEPENDENCY_SOURCE_KIND,SI as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,uv as ExtensionCommandError,sa as FILES_FLAG_CONTRACTS,fc as FOCUS_FLAG_CONTRACTS,oc as GC_FLAG_CONTRACTS,FR as GET_DEPTH_INPUT_VALUES,$R as GET_DEPTH_VALUES,Cc as GET_FLAG_CONTRACTS,ea as GLOBAL_FLAG_CONTRACTS,nu as GRAPH_DURABLE_CACHE_MIN_ITEMS,ou as GRAPH_DURABLE_CACHE_VERSION,wc as GRAPH_FLAG_CONTRACTS,kR as GRAPH_QUERY_DEFAULTS,Ne as GRAPH_SUBCOMMAND_VALUES,Ec as GUIDE_FLAG_CONTRACTS,sc as HEALTH_FLAG_CONTRACTS,ua as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,BP as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,QM as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ma as HISTORY_COMPACT_FLAG_CONTRACTS,pi as HISTORY_EVENT_CLASSIFICATION_VERSION,ca as HISTORY_FLAG_CONTRACTS,QC as HISTORY_HASH_ALGORITHMS,wO as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,la as HISTORY_REDACT_FLAG_CONTRACTS,pa as HISTORY_REPAIR_FLAG_CONTRACTS,jl as INIT_AGENT_GUIDANCE_MODE_VALUES,ga as INIT_FLAG_CONTRACTS,$a as INSTALL_FLAG_CONTRACTS,sM as IN_PROGRESS_WORK_DETAIL_LIMIT,_n as ISSUE_SEVERITY_VALUES,pc as ITEM_COMPLETE_FLAG_CONTRACTS,_M as ITEM_LATEST_TIMESTAMP_FIELDS,DT as ITEM_METADATA_KEY_ORDER,lc as ITEM_MUTATE_FLAG_CONTRACTS,uc as ITEM_REOPEN_FLAG_CONTRACTS,Ds as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,Ls as ITEM_REVISION_CONFLICT_CODE,cM as ITEM_SCALAR_MISSING_VALUE,pn as ITEM_TYPE_VALUES,fM as ITEM_UNION_COLLECTION_FIELDS,q0 as JsonFileContextSignalStoreAdapter,ia as LEARNINGS_FLAG_CONTRACTS,ZC as LEGACY_HISTORY_HASH_ALGORITHM,ap as LINKED_ARTIFACT_NOTE_CONFLICT_MODES,qu as LINKED_TEST_ENV_NAME_PATTERN,zu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Bu as LINKED_TEST_PROTECTED_ENV_KEYS,Hu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,zc as LIST_COMMANDER_STRING_OPTION_CONTRACTS,LR as LIST_COMMAND_DEFAULT_PROJECTIONS,zk as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ta as LIST_FILTER_FLAG_CONTRACTS,kI as LIST_SORT_FIELDS,xI as LIST_SORT_ORDER_VALUES,ui as MAINTENANCE_HISTORY_OPERATIONS,sk as MAX_CHILD_PROJECTION_ITEMS,rI as MAX_WAIVER_NOTICE_DAYS,qT as MAX_WORKFLOW_POLICIES,zT as MAX_WORKFLOW_POLICY_TERMS,Xa as MEET_FLAG_CONTRACTS,vk as MERGE_DRIVER_ARTIFACT_VALUES,da as MERGE_FLAG_CONTRACTS,Le as MERGE_SUBCOMMAND_VALUES,Pk as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,Wc as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,vc as NEXT_FLAG_CONTRACTS,zm as NEXT_OUTPUT_VALUES,_0 as NEXT_RANKING_POLICIES,na as NOTES_FLAG_CONTRACTS,yR as OutputEnvelopeFitError,Ea as PACKAGE_FLAG_CONTRACTS,Sa as PACKAGE_INIT_FLAG_CONTRACTS,Wa as PAUSE_TASK_FLAG_CONTRACTS,$d as PLAN_CREATE_METADATA_PARAMETER_KEYS,ha as PLAN_FLAG_CONTRACTS,Xs as PLAN_SHOW_DEPTH_VALUES,Ke as PLAN_SUBCOMMANDS,ef as PLAN_TEMPLATE_NAMES,Ab as PM_AGENT_TASK_ACCOUNTING_MODES,lt as PM_AGENT_TASK_TRANSCRIPT_VERSION,ko as PM_BULK_LIFECYCLE_COMMAND_ALIASES,ns as PM_CLI_ERROR_DETAILS_LIMITS,ls as PM_CLI_EXPECTED_ERROR_NAME,HR as PM_CLI_GRAMMAR_CONTRACT,UR as PM_CLI_GRAMMAR_NOUNS,Yo as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,jR as PM_CLI_SHARED_VERBS,Lo as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Rt as PM_COMMAND_DESTINATION_CONTRACTS,KI as PM_COMMAND_EXIT_CONTRACTS,VI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,wi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,qI as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,je as PM_COMMAND_POSITIONAL_CONTRACTS,ll as PM_COMMAND_VISIBILITY_CONTRACTS,DP as PM_COMPLETE_LIST_FINDING_CODES,lR as PM_CONTEXT_INTENTS_FILE,JS as PM_CONTEXT_INTENT_CONTRACTS,Mo as PM_CONTEXT_OPS_COMMAND_ALIASES,Ho as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Jo as PM_DEPRECATED_TOOL_ACTIONS,bi as PM_DIAGNOSTIC_DEGRADATION_STEPS,Ti as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,yi as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qo as PM_DISCOVERABLE_TOOL_ACTIONS,Wr as PM_EPISODE_SCHEMA,jI as PM_ERROR_CODE_CATALOG,$I as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,eo as PM_EXACT_COVERAGE_METRICS,Go as PM_EXTENSION_CAPABILITY_CONTRACTS,Vo as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,jo as PM_EXTENSION_POLICY_MODE_CONTRACTS,zo as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,qo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Uo as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Bo as PM_EXTENSION_TRUST_MODE_CONTRACTS,Pi as PM_GENERIC_REFUSAL_GUIDANCE,vP as PM_GITATTRIBUTES_END,OP as PM_GITATTRIBUTES_START,IP as PM_GITATTRIBUTES_V2_END,RP as PM_GITATTRIBUTES_V2_START,yl as PM_GITIGNORE_END,gl as PM_GITIGNORE_START,r0 as PM_HISTORY_ATTESTATION_CONTRACT,Po as PM_HISTORY_COMMAND_ALIASES,VC as PM_HISTORY_OPERATION_ALIASES,WC as PM_HISTORY_OPERATION_CONTRACT,KC as PM_HISTORY_OPERATION_PATTERNS,Wo as PM_ITEM_ACTION_SUBCOMMANDS,zC as PM_ITEM_HISTORY_OPERATIONS,ot as PM_MCP_APPS_EXTENSION,Mr as PM_MCP_APPS_SERVER_CAPABILITY,Se as PM_MCP_APPS_SPEC_VERSION,Nr as PM_MCP_APP_CONTRACTS,xr as PM_MCP_APP_MIME_TYPE,yT as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,iL as PM_MCP_HTTP_PROTOCOL_VERSION,jg as PM_MCP_INPUT_REQUEST_METHODS,or as PM_MCP_LEGACY_PROTOCOL_VERSIONS,rr as PM_MCP_LOG_LEVELS,w as PM_MCP_META_KEYS,aF as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,cF as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,_l as PM_MCP_PROMPT_CONTRACTS,z as PM_MCP_PROTOCOL_VERSION,fl as PM_MCP_RESOURCE_CONTRACTS,it as PM_MCP_SKILLS_DRAFT_REVISION,Lr as PM_MCP_SKILLS_EXTENSION,Ky as PM_MCP_SKILLS_SERVER_CAPABILITY,I as PM_MCP_SKILL_LIMITS,Ce as PM_MCP_SUBSCRIPTION_ID_META_KEY,te as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,JN as PM_MCP_TASKS_EXTENSION,Qg as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,NE as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,fs as PM_MUTATION_ACTION_CONTRACTS,ke as PM_NAMESPACED_COMMAND_ALIASES,Vr as PM_OBSERVATION_SCHEMA,gi as PM_OUTPUT_BUDGET_CLASSES,hi as PM_OUTPUT_DEGRADATION_STEPS,xt as PM_OUTPUT_ENVELOPE_KINDS,Ft as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Ko as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,$t as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,Hd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,qd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,pS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,OS as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,dS as PM_READ_OUTPUT_DIMENSIONS,lS as PM_READ_OUTPUT_OPTION_FLAGS,nS as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,oS as PM_READ_OUTPUT_SESSION_MIN_TOKENS,PE as PM_READ_OUTPUT_SURFACES,uS as PM_READ_OUTPUT_SURFACE_CONTRACTS,eS as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,xE as PM_READ_ROW_CONTRACTS,kE as PM_READ_ROW_JQ_SELECTOR,Ni as PM_RECOVERY_ECHO_FIELDS,YD as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,Yb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,po as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,r1 as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,lo as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,xo as PM_RELOCATED_COMMAND_ALIASES,Kd as PM_REPRODUCIBLE_PROCESS_ENV,WI as PM_SUCCESS_EXIT_CODES,Xo as PM_TOOL_ACTIONS,Gd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,zd as PM_TOOL_PARAMETERS_SCHEMA,Bd as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,jd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Ld as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Kr as PM_VERDICT_SCHEMA,HC as PM_WORKSPACE_HISTORY_OPERATIONS,zr as PM_WORKSPACE_RECIPE_SCHEMA,_a as PROFILE_FLAG_CONTRACTS,Qt as PROFILE_LINT_CODES,Jt as PROFILE_LINT_DIMENSIONS,zt as PROFILE_NAMES,We as PROFILE_SUBCOMMANDS,b as PmCliError,_e as PmClient,$P as PmCompleteListValidationError,y as PmMcpAuthorizationError,nr as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,ir as PmMcpRequestStateReplayGuard,jr as PmMcpSkillRegistry,hr as PmMcpSubscriptionRegistry,tt as PmMcpTaskStore,FS as QUERY_CURSOR_CONTRACT,fS as READ_OUTPUT_MUTATION_CONFLICT_CODE,_S as READ_OUTPUT_SHAPING_CONTROL_FLAGS,Ga as REINDEX_FLAG_CONTRACTS,hO as REINDEX_LOCK_ID,dt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Va as RELEASE_FLAG_CONTRACTS,Qa as REMIND_FLAG_CONTRACTS,wt as RESERVED_ITEM_FIELD_NAMES,za as RESTORE_FLAG_CONTRACTS,fn as RISK_VALUES,TR as RelationshipEventLog,CR as RelationshipEventStore,q as RelationshipGraph,Ge as RelationshipKindRegistry,fa as SCHEMA_FLAG_CONTRACTS,Hc as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,Hk as SEARCH_EXTENSION_FLAG_DEFINITIONS,Rc as SEARCH_FLAG_CONTRACTS,gs as SECRET_GUARD_RULE_CATEGORIES,dm as SEMANTIC_ATTRIBUTION_LIMITS,GT as SETTINGS_DEFAULTS,xf as SNAPSHOT_SCHEMA,SP as SOURCE_CONTEXT_ACCESS_ENV,wP as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Vm as STALE_CLAIM_TAKEOVER_REFUSED_CODE,Rs as STALE_WORK_THRESHOLD_SETTING,fm as START_BLOCKED_REFUSAL_CODE,mm as START_BLOCKER_ENFORCEMENT_DEFAULT,Ka as START_TASK_FLAG_CONTRACTS,nc as STATS_FLAG_CONTRACTS,un as STATUS_VALUES,Zs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,mi as SUBSTANTIVE_HISTORY_OPERATIONS,bw as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Cw as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,vE as SUPPRESS_HOST_OUTPUT_MARKER,tc as TELEMETRY_FLAG_CONTRACTS,a_ as TELEMETRY_SUBCOMMANDS,ec as TEST_ALL_FLAG_CONTRACTS,Za as TEST_FLAG_CONTRACTS,rc as TEST_RUNS_FLAG_CONTRACTS,r_ as TEST_RUN_MEASUREMENT_LIMIT,Md as TOOL_ACTIVITY_OPTION_CONTRACTS,bd as TOOL_AGGREGATE_OPTION_CONTRACTS,vd as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Pd as TOOL_CALENDAR_OPTION_CONTRACTS,Id as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,kd as TOOL_CONTEXT_OPTION_CONTRACTS,wd as TOOL_CREATE_OPTION_CONTRACTS,Sd as TOOL_CREATE_OPTION_CONTRACT_SOURCE,xd as TOOL_DEPS_OPTION_CONTRACTS,Nd as TOOL_GRAPH_OPTION_CONTRACTS,yd as TOOL_LIST_FILTER_OPTION_CONTRACTS,Td as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Ed as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Cd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Rd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Od as TOOL_UPDATE_OPTION_CONTRACTS,Ad as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,FT as TYPE_TO_FOLDER,BC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,vv as UNPROVEN_ACTIVITY_REASONS,fd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,hd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,_d as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,_c as UPDATE_FLAG_CONTRACTS,hc as UPDATE_MANY_FLAG_CONTRACTS,Fa as UPGRADE_FLAG_CONTRACTS,On as URL_CREDENTIAL_PLACEHOLDER,ac as VALIDATE_FLAG_CONTRACTS,BT as WORKFLOW_POLICY_ACTIONS,kP as WORKFLOW_POLICY_DOCUMENT_SCHEMA,MP as WORKFLOW_POLICY_SCHEMA,Oc as WORKSPACE_FLAG_CONTRACTS,LA as WORKSPACE_HISTORY_ID,Nf as WORKSPACE_SNAPSHOT_ACTIONS,op as WorkspaceGraphCache,OR as WorkspaceTransactionInterruptedError,xu as _testOnly,ik as _testOnlyAggregateCommand,tp as _testOnlyConfigCommand,pk as _testOnlyGetCommand,bu as _testOnlyHealthCommand,Hl as _testOnlyInit,Bl as _testOnlyInitAgentGuidance,sx as _testOnlyItemTransaction,Nk as _testOnlyMutationEvents,rk as _testOnlyNextCommand,Ok as _testOnlySearchCommand,WP as _testOnlySimilarity,nf as _testOnlyTemplates,Pu as _testOnlyValidateCommand,$k as _testOnlyWorkspacePosition,cx as abandonItemTransaction,MR as abandonWorkspaceTransaction,eM as acceptAssuranceProposals,Ru as acknowledgeLinkedTests,Zl as acknowledgeUnknownAuthorHistoryEvents,Ql as acknowledgeUnknownAuthorHistoryEventsFromTransport,$O as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,Wn as acquireLockLease,jx as activateExtensionForTest,Qw as activateExtensions,hm as admitStartWithOpenBlockers,Kn as agentSessionEnvironment,ch as aggregate,Hf as analyzeAgentProvenanceDescriptorCoverage,lI as analyzeDefectChangeRisk,HM as analyzeDefectRecurrenceCoverage,Pp as analyzeDuplicateItems,SR as analyzeGraphImpact,el as analyzeHierarchyIntegrity,wR as analyzeKnowledgeGraph,XI as analyzePmCommandExitConformance,Zo as analyzePmToolActionParity,kM as analyzeReconciliationDiscard,ER as analyzeRelationshipExecution,Yp as analyzeRelationshipSchedule,xg as analyzeSdkActionCoverage,Pt as analyzeSdkCliParameterCompleteness,Th as append,$i as appendHistoryEntry,GA as appendWorkspaceAuditEvent,FA as appendWorkspaceHistoryChange,tC as applyAcceptanceCriteriaMutations,QP as applyAssurancePreset,$c as applyBootstrapPagerPolicy,UM as applyClosureTimestampFix,rw as applyContextIntentProjection,qm as applyContextTagProjection,NI as applyFilterValueEcho,TO as applyHistoryPatch,Vd as applyInvocationAuthorOverride,hp as applyPathMigrations,ES as applyReadOutputDimensions,yS as applyReadOutputIncludeModes,sS as applyReadOutputSessionReferences,wA as applyRegisteredItemFieldDefaultsAndValidation,Tp as applyStandaloneNote,Ks as applyStoredExtensionMigrationState,oC as applyTagRemovals,p0 as applyTerminalOrderingPolicy,Cp as artifactKey,PC as asRecordClone,IC as asRecordOrNull,qe as assembleWorkspaceRelationshipGraph,jP as assertCompleteListResult,CN as assertExtensionBlueprint,TN as assertExtensionCapabilityUsage,rN as assertExtensionDeactivated,wN as assertExtensionManifestCompatible,SN as assertExtensionManifestMatchesBlueprint,AN as assertExtensionPreflight,ol as assertHierarchyMutationAllowed,ZM as assertHistoryCompactTarget,NM as assertHistoryRepairTarget,Zi as assertInitializedTracker,gp as assertLinkedArtifactMutationIsUnambiguous,RN as assertMcpClientCapabilities,vN as assertMcpProtocolHeader,wb as assertMemoryRelationshipGraphAdapterConformance,sC as assertNoUnknownCsvKeys,Uu as assertNonHierarchyCardinalityMutationAllowed,oN as assertPackageManifest,WA as assertParentReferenceIsNotSelf,LL as assertPmMcpSkillsCapability,EN as assertProjectProfile,kO as assertProjectRuntimeCompatibility,RO as assertProjectRuntimeFormatGuard,LE as assertProjectionModeChoice,Qi as assertReadableTrackerRoot,nN as assertRegisteredCommandContract,fN as assertRegisteredCommandOverride,lN as assertRegisteredExporter,iN as assertRegisteredFlags,sN as assertRegisteredHook,dN as assertRegisteredImporter,pN as assertRegisteredItemField,uN as assertRegisteredItemType,bN as assertRegisteredMigration,_N as assertRegisteredParserOverride,hN as assertRegisteredPreflightOverride,mN as assertRegisteredProfile,gN as assertRegisteredRendererOverride,aN as assertRegisteredSearchProvider,yN as assertRegisteredServiceOverride,cN as assertRegisteredVectorStoreAdapter,Dw as assertRelationshipEdgeAllowed,oo as assertRelationshipGraphAdapterConformance,ZT as assertSchemaPreviewSupported,l_ as assertTestMeasurementRun,mw as assertWellFormedOutputText,sP as assuranceAssertionUpdateIsLoosening,iw as attachContextIntentReceipt,jS as attachContextUsageServingReceipt,wu as attachLinkedTestMutationProvenance,Su as attachLinkedTestProvenance,Xe as attachMcpServerInfo,jE as attachOutputOmissionReceipt,aw as attachOutputTokenAccounting,sw as attachReadOutputContracts,aS as attachReadOutputSessionReceipt,Al as auditMergeAttributeFence,PP as auditMergeDriverConfiguration,tu as auditWorkspaceRelationshipGraph,TL as authorizeMcpHttpRequest,Hn as boundAgentEpisodeIdentity,XE as boundReadOutputRows,Gm as buildChildrenByParent,Tk as buildCompactSearchFilterSummary,LI as buildContentFilterEcho,B0 as buildContextSignalSnapshot,ub as buildCorpusShapeItemPlan,dI as buildDefectRecurrenceIndex,Ll as buildExtensionDescribeResult,$l as buildExtensionInstallPlan,DI as buildGovernanceMissingFilterEcho,gu as buildInProgressSweepCommands,aM as buildInProgressWorkHealthSummary,nO as buildInvalidTypeError,ck as buildItemChildrenRollup,nx as buildItemCompletionMutations,O0 as buildItemContextRelevanceCandidates,qO as buildItemNotFoundError,lk as buildItemSchedule,jM as buildLinkedFileRepairReport,pL as buildMcpAuthorizationDiscoveryUrls,$g as buildMcpCompleteResult,PN as buildMcpDiscoverResult,hL as buildMcpDynamicRegistrationMetadata,oL as buildMcpHttpRequestHeaders,FN as buildMcpInputRequiredResult,lL as buildMcpProtectedResourceMetadata,Sl as buildMergeAttributePatterns,Ud as buildPmActionToolInputSchema,i1 as buildPmRefusalClosureCensus,KP as buildRelationshipContext,WO as buildSearchCorpus,XO as buildSemanticCorpusInput,$M as buildStatusRoleWarnings,Ji as buildTrackerInitializationRecovery,tv as buildVectorizationEmbeddingIdentity,rv as buildVectorizationEmbeddingMetadata,Ck as buildVerboseSearchFilters,xP as buildWorkflowCompletenessCheck,Y0 as buildWorkspaceMemorySnapshot,zn as canonicalDocument,hC as canonicalizeCommandOptionKey,Cx as canonicalizeCommandSuggestions,w0 as canonicalizeContextRecencyCoordinate,xw as canonicalizeRelationshipKind,XD as censusPmRecoveryReferenceProducers,UP as certifyCompleteListResult,$x as checkExtensionManifestCompatibility,og as claim,ng as claimNext,qP as classifyHistoryAuthorEvent,fi as classifyHistoryEvent,PM as classifyHistoryMergeReceiptReferences,zw as classifyHostEnvironmentFault,Sk as classifyImplicitSemanticFallbackReason,Fn as classifyItemFormatVersion,u_ as classifyLinkedTestCommandSafety,m_ as classifyLinkedTestFailure,_A as clearActiveExtensionHooks,du as clearDurableGraphCache,_E as clearFocusedItem,b_ as clearWorkspaceContractsCache,rg as close,Lu as closeItem,ug as closeTask,Uc as coalesceRepeatedListFlags,oR as collectBlockedByIds,iR as collectBlockedByIdsFromCorpus,qS as collectContextUsageDeliveredItemIds,al as collectDanglingDependencyReferences,aR as collectDependencyBlockedIds,il as collectDuplicateDependencyRows,eu as collectDuplicateRelationshipEdgeGroups,Ek as collectErrorCauseCodes,Zd as collectHierarchyRelations,Er as collectMcpHeaderAnnotations,cl as collectMissingDependencyTargetIds,Gu as collectNewOrderingCycleWarnings,Jp as collectOrderingCycles,sl as collectOrderingStorageContradictions,mR as collectPackageContextIntentContracts,Ut as collectPackageExtensionDirectories,EA as collectRegisteredItemFieldNames,aE as collectRuntimeCreateFieldValues,iO as collectRuntimeFilterValues,cE as collectRuntimeUpdateFieldValues,Nm as collectSubtreeIds,ji as collectUsedExtensionCapabilities,gC as commandOptionFlagLabel,ph as comments,z_ as commitImportedItem,ix as commitItemCompletion,ox as commitItemMutations,RR as commitWorkspaceTransaction,Qs as compactFlagAliasContracts,Lm as compareCriticalItems,AO as comparePmDateVersions,AR as compareRelationshipSnapshots,MC as compareTimestampStrings,C0 as compileHistoryProvenanceMatcher,ew as composeContextIntentContracts,Px as composeExtension,Dx as composeExtensionPackage,dR as computeActionabilityReport,kA as computeHistoryDiff,Kp as computeRelationshipCentrality,Vp as computeRelationshipDominators,rp as computeWorkspaceGraphFingerprint,Eh as config,fA as consumeAfterCommandAffectedItems,rh as context,nw as contextIntentRowId,sg as copy,ju as countFailureCategories,WE as countReadOutputRows,Zh as create,JP as createAssurancePreset,qM as createAssuranceWorkspaceContext,xC as createCheckpointId,FP as createCompleteListOptions,Zw as createCoreCommandHookContext,Zr as createCorpusShapeMeasurement,pP as createEmptyAssuranceDocument,jw as createEmptyExtensionRegistrationRegistry,mv as createExtensionCommandError,zs as createExtensionCommandSdk,Gi as createExtensionContributionInventory,ON as createExtensionTestHarness,Di as createHistoryEntry,Gv as createLazyModule,NP as createLifecycleCompletenessPolicies,CL as createMcpStaticBearerVerifier,QN as createMcpTaskStore,BO as createMutationGuardSdk,DE as createOutputOmissionReceipt,us as createPmCliExpectedError,qs as createPmCliProgram,Ei as createPmCommandOutputBudget,MS as createQueryFingerprint,Sb as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,St as createRelationshipKindRegistry,Yd as createReproducibleProcessRunner,yk as createSearchCursorFingerprint,eA as createSerialQueue,uC as createStdinTokenResolver,qC as createUnknownSubcommandError,QT as createWorkflowPolicyEvaluator,Lf as createWorkspaceSnapshot,Bx as deactivateExtensionForTest,bs as decideSecretGuardFinding,K1 as declineServiceOverride,ow as decodeContextIntentCursor,Fv as decodeHtmlEntitiesInOptions,Cr as decodeMcpHttpHeaderValue,dw as decodePmTableRows,LS as decodeQueryCursor,xS as decodeQueryCursorEnvelope,NS as decodeQueryCursorState,IS as decodeReadOutputContinuationCursor,Gx as decodeToon,OL as decoratePmMcpToolsWithApps,Sp as dedupeLinkedArtifacts,AA as defaultConfigScope,R0 as defaultScoreContextCandidates,Z1 as defineAfterCommandHook,J1 as defineBeforeCommandHook,Q1 as defineBeforeMutationHook,L1 as defineCommand,B1 as defineCommandOverride,K as defineCorpusShape,HL as defineEpisodeSpecification,X1 as defineExporter,Rx as defineExtension,Ix as defineExtensionBlueprint,x1 as defineExtensionManifest,D1 as defineFlag,Y1 as defineImporter,F1 as defineItemField,$1 as defineItemType,G1 as defineMigration,rb as defineObservationContract,r$ as defineOnIndexHook,t$ as defineOnReadHook,e$ as defineOnWriteHook,q1 as defineParserOverride,Si as definePmCommandOutputBudget,BI as definePmCommandOutputEnvelope,FI as definePmErrorCodeCatalog,z1 as definePreflightOverride,N1 as defineProjectProfile,W1 as defineRendererOverride,U1 as defineSearchProvider,H1 as defineServiceOverride,j1 as defineVectorStoreAdapter,sb as defineVerdictContract,we as defineWorkspaceRecipe,ag as deleteItem,jf as deleteWorkspaceSnapshot,$w as dependencyToRelationship,yh as deps,ZP as deriveAssuranceProposals,FM as deriveClosureTimestamp,kx as deriveExtensionCapabilities,Vk as deriveMutationTransactionId,JI as derivePmBulkMutationEffect,JD as derivePmRecoveryReferenceObligations,Xp as deriveRelationshipDeadlines,Il as deriveSchemaEvolutionMigrationId,bv as deriveTelemetryCommandResolution,dO as describeAllowedTransitions,EP as describeExtensionActivation,xx as describeExtensionBlueprint,UC as describeFlagScalarValueFailure,Cm as describeItemOwnershipConflict,Us as describeItemRevisionChanges,zL as describeObservationCost,Yt as describeProfileComposition,Xt as describeProjectProfile,px as describeReadCompletenessControls,fv as describeUnknownError,ni as detectAgentIdentity,ci as detectHarnessIdentity,zp as detectRelationshipCommunities,ii as diagnoseAgentIdentity,ru as diffRelationshipAuditSnapshots,i_ as diffTestRunMeasurements,jN as digestMcpRequestParameters,Xw as discoverExtensions,bn as discoverNearbyPmRoot,lF as discoverPmTools,vO as discoverProjectRuntimeVersionPins,gh as docs,lh as duplicates,iu as durableGraphCachePath,lu as durableGraphCacheStatus,Dn as effectiveItemFormatVersion,Jv as emitTelemetryErrorEvent,q_ as emptyImportedDocument,lM as encodeItemScalarDecisionValue,Tr as encodeMcpHttpHeaderValue,cw as encodePmTableRows,kS as encodeQueryCursor,RS as encodeReadOutputContinuationCursor,Ux as encodeToon,xA as enforceHistoryStreamPolicyForItem,NA as enforceHistoryStreamPolicyForItems,ZR as enrichCliFlagInvocationContract,It as enrichCliFlagInvocationContracts,EO as ensureMaterializedHistoryTarget,Tl as ensurePmGitignore,pp as ensureScope,pv as ensureSentryCommandTracing,lv as ensureSentryInit,B_ as ensureTrackerInitialized,Bp as enumerateRelationshipPaths,Oi as estimatePmOutputTokens,mP as evaluateAssuranceAssertion,fP as evaluateAssuranceGate,sI as evaluateBoundaryFixtures,ym as evaluateClaimActivity,k0 as evaluateContextRanking,pI as evaluateDefectGateEvidence,uP as evaluateMeasurement,Sf as evaluateMetricFloors,hs as evaluateMutationGuard,Jf as evaluateProvenanceCoverage,C$ as evaluateReliabilityWindow,Wf as evaluateSemanticAttributionCoverage,kp as evaluateSimilarityGovernance,cO as evaluateTransition,ab as evaluateVerdictContract,JT as evaluateWorkflowPolicies,os as executeEmbeddingBatchesWithRetry,ZO as executeVectorDelete,ev as executeVectorReset,QO as executeVectorUpsert,Qy as executeWorkspaceRecipe,bp as expandAddGlobEntries,Np as explainSourceTraceability,n0 as exportAttestation,mg as extension,_g as extensionActivate,hg as extensionDeactivate,fg as extensionList,dT as extensionMigrate,IM as extractHistoryMergeReceiptDispositions,RM as extractHistoryMergeReceiptReferences,gL as extractMcpTraceContext,yO as extractPatchFailureContext,Tu as extractReferencedPmItemIdsFromCommand,Eb as federateRelationshipGraphSnapshots,fh as files,_h as filesDiscover,hh as filesLookup,zS as finalizeContextUsageDelivery,yb as findCoverageDeficits,Mp as findDuplicateClusters,El as findGitWorkspaceRoot,bE as findHistoryIdentityDiscontinuities,xl as findInstalledNpmPackageCandidate,AL as findPmMcpAppByUri,No as findPmNamespacedCommand,Hp as findRedundantRelationshipEdges,Wp as findRelationshipCutStructure,Ip as findSimilarItems,Xv as finishTelemetryCommand,bR as fitOutputEnvelope,GC as flattenFlagListValue,_b as flushTelemetryQueue,dg as focus,qp as forEachMatchedRelationshipEdge,Zp as formatDuplicateEdgeGroup,tl as formatHierarchyRelation,Qp as formatOrderingStorageContradiction,zR as formatPmPositionalActionFlagTip,gf as formatProfileApplyHuman,hf as formatProfileLintHuman,ff as formatProfileListHuman,_f as formatProfileShowHuman,kl as formatSchemaEvolutionMigrationHuman,Ak as formatVectorIndexRecoveryWarnings,Dk as formatWorkspacePositionHuman,Kh as gc,Wi as generateItemId,sh as get,pA as getActiveCommandResult,QS as getActiveContextIntentContracts,qi as getActiveExtensionRegistrations,bL as getActiveMcpTraceContext,hP as getAssuranceDeclaration,Ig as getContracts,mE as getFocusedItem,En as getHistoryPath,gR as getItemAt,Cn as getItemPath,Es as getMutationActionContract,bl as getPmGitignoreBlock,Tn as getSettingsPath,T_ as getWorkspaceContracts,DA as getWorkspaceHistoryPath,bh as graph,su as graphAuditBaselinePath,Yf as groupHistoryByEpisode,V1 as handleServiceOverride,IN as hasMcpClientExtension,wL as hasPmMcpAppsCapability,Be as hasSubcommandFlagContractsForCommand,ov as hasVectorizationEmbeddingIdentityChanged,nv as hasVectorizationVectorDimensionChanged,Iw as hashDocument,Pw as hashDocumentForVersion,Mw as hashEmptyDocument,Sw as hashHistoryPatch,Ew as hashHistoryRecord,ww as hashHistoryStream,pM as hashItemScalarDecisionValue,Vh as health,Fp as hierarchyAncestors,Gp as hierarchyDescendants,Jh as historyCompact,Qh as historyCompactBulk,rE as historyDigest,T0 as historyEntryMatchesProvenance,OO as historyItemHashVersionForRuntime,Wh as historyRedact,Yh as historyRepair,Xh as historyRepairAll,nR as indexBlockedByIds,rl as indexHierarchyRelations,iv as inferConsistentVectorDimension,Ci as inferPmOutputBudgetClass,Ch as init,GP as inspectCompleteListResult,Bw as inspectExtensionManifestSchema,Kl as inspectHistoryAuthorStream,Ps as inspectInProgressWork,bM as inspectMergeReceiptEvidence,MO as inspectProjectRuntimeCompatibility,Ms as inspectStaleInProgressItems,Ng as inspectStaticExtensionInventory,DM as inspectStatusRoleAssignments,$A as inspectWorkspaceHistoryState,Df as inspectWorkspaceSnapshot,Rl as installMergeFence,MN as interpretMcpResultType,Km as isAlreadyClaimedError,gv as isCommanderError,fx as isCompatibleRecoveryFlag,od as isErrnoError,Zv as isExternalDependencyReference,eR as isExternalDependencySourceKind,me as isFileMissingError,Mi as isGenericRefusalRequired,ki as isGenericRefusalWhy,IE as isHostOutputSuppressed,ps as isItemAlreadyExistsError,js as isItemRevisionConflict,dM as isItemScalarMissingValue,kv as isJudgeableHistoryRecord,AM as isLegacyMergeReceiptSummary,h as isMcpRecord,Ts as isMutationAction,Lw as isOrderingRelationshipKind,VA as isPlaceholderReferenceToken,is as isPmCliErrorDetails,ms as isPmCliExpectedError,tn as isPmExtensionCapabilityContract,on as isPmExtensionPolicyModeContract,nn as isPmExtensionPolicySurfaceContract,rn as isPmExtensionServiceNameContract,YI as isPmKnownExitCode,zI as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,ds as isPmTokenBudgetRecovery,en as isPmToolAction,OM as isPreDurableCloneLocalReceiptSummary,vM as isPreDurableDispositionEligibleReference,PO as isProjectMutatingInvocation,Uv as isPureSnakeCaseAlias,wS as isReadOutputBudgetExceeded,rS as isReadOutputSessionReference,mx as isReadProjectionRecoveryFlag,SS as isReadResultOmittedForBudget,FE as isReadRowContract,Jd as isRuntimeRecord,uO as isSettingsReadFallback,_m as isStartTransition,qv as isTerminalPlanMode,lE as isTerminalStatus,Mn as isTimestampLiteral,oI as isWaiverNoticeDays,Mv as isWellFormedHistoryRecord,Jk as itemDocumentToMutationOptions,dk as itemHasSchedule,_i as jaccardSimilarity,Lv as latestHistoryTimestamp,mh as learnings,jC as levenshteinDistanceWithinLimit,ed as limitAnnotationEntries,Au as linkedTestTrustFingerprint,Nx as lintExtensionBlueprint,qw as lintExtensionManifestSchema,Zt as lintProjectProfile,oh as list,Zn as listAgentProvenanceAdapters,Gc as listAliasPluralKeys,nh as listAllComplete,UO as listAllDocumentCandidatesCached,rs as listAllItemMetadata,jO as listAllItemMetadataLight,_P as listAssuranceDeclarations,CP as listAssuranceVerdicts,lb as listBuiltinCorpusShapes,Ex as listCoreClosedDomainContracts,GR as listGetProjectionFields,nM as listInvalidProvenanceHistoryStreamIds,DR as listListProjectionFields,TM as listMergeReceipts,Cs as listMutationActions,Mk as listMutationEvents,_o as listPmCommandFlagBudgets,ul as listPmCommandsForFamily,pl as listPmCommandsForTier,Ie as listPmFlagLexicon,I1 as listPmFlagSpellingInventory,ml as listPmMcpToolsForProfile,y1 as listPmRequiredArgumentRefusalContracts,b1 as listPmSubcommandRefusalContracts,Wt as listProfiles,E1 as listTrackerPreflightRecoveryContracts,ex as listUpsertKeyCandidates,$f as listWorkspaceSnapshots,fR as loadContextIntentRuntimeLayers,sf as loadCreateTemplateOptions,Jw as loadExtensions,uu as loadGraphAuditBaseline,tx as loadGuardedRuntimeSchema,LC as loadMutationCheckpoint,k as loadRelationshipGraphAdapter,es as locateItem,iC as looksLikeGenericKeyValueEntry,YE as mapReadOutputRows,CM as markMergeReceiptReconciled,sO as matchesRuntimeFilters,Wv as maybeRunFirstUseTelemetryPrompt,mb as measureCorpusShapePlan,Xi as measureItemMetadataReadWork,rC as mergeAdditiveTags,Mx as mergeExtensionBlueprints,uM as mergeHistoryStreams,hM as mergeItemDocuments,gM as mergeJsonDocuments,jc as mergeLinkedTestTwoTokenEntries,mM as mergeRelationshipEventStreams,jm as mergeSortedWarnings,Bv as migrateItemFilesToFormat,HO as mutateItem,zO as mutateItemWithHistoryContext,UA as mutateWorkspaceJsonWithHistory,ah as next,ti as normalizeAgentProvenanceAdapterValue,Zc as normalizeAnnotationTransportOptions,rP as normalizeAssuranceEvaluation,tP as normalizeAssuranceMutation,Bc as normalizeBootstrapInvocation,IA as normalizeBulkIdsValue,nl as normalizeDependencyGraphTarget,RI as normalizeDependencySeedId,vI as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,$s as normalizeExpectedItemHash,Fi as normalizeExtensionContributionInventory,JC as normalizeHistoryOperationForWrite,oM as normalizeInvalidHistoryProvenance,QR as normalizeItemAddressInvocation,$n as normalizeItemFormatVersion,Ki as normalizeItemId,jn as normalizeItemMetadata,II as normalizeItemReference,Fc as normalizeLegacyExtensionActionSyntax,yp as normalizeLinkedPath,HA as normalizeParentReferenceValue,Vt as normalizeProfileName,Vi as normalizeRawItemId,bS as normalizeReadOutputIncludeModeOptions,SE as normalizeReplayPatchOps,Ss as normalizeSimilarityText,Rv as normalizeStaleWorkThresholdHours,dE as normalizeStatusForRegistry,Un as normalizeStatusInput,nE as normalizeStatusInputWithRegistry,hv as normalizeThrownExitCode,uh as notes,Pn as nowIso,au as openDurableGraphCache,UN as openMcpRequestState,VL as openPmEpisode,Up as orderingPredecessors,jp as orderingSuccessors,$0 as packContextCandidates,Dm as packRankedContextItems,Og as packageActivate,Ag as packageCatalog,vg as packageDeactivate,Sg as packageDescribe,Cg as packageDoctor,bg as packageInstall,gg as packageLifecycle,yg as packageList,Eg as packageManage,lT as packageMigrate,wg as packageReload,Tg as packageUninstall,$S as paginateQueryRows,up as parseAddEntries,mp as parseAddGlobEntries,rd as parseAnnotationTextInput,Kk as parseAtomicMutationControls,Dc as parseBootstrapCommandName,xc as parseBootstrapGlobalOptions,Lc as parseBootstrapHelpRequest,qc as parseBootstrapTypeValue,RA as parseBulkIdsText,km as parseContextDepth,Rm as parseContextFocusFields,pR as parseContextIntentDeclarations,xm as parseContextSections,j0 as parseContextSignalSnapshot,nC as parseCsvKv,fI as parseDefectChangeRiskRequest,zM as parseDefectRecurrenceCoverageRequest,mI as parseDefectRecurrencePolicy,Ef as parseEvalMetricFloors,vf as parseEvalQuerySet,Fs as parseExpectHashSpecs,AC as parseExtensionLongFlagToken,_u as parseGraphSubcommand,o0 as parseHistoryAttestation,y0 as parseHistoryProvenanceFilters,_I as parseIntegerLimit,pE as parseItemDocument,Wk as parseItemMutationBatch,oO as parseLimit,em as parseLinkedTestAssertionEqualsMap,tm as parseLinkedTestAssertionGteMap,Wu as parseLinkedTestBoolean,Yu as parseLinkedTestContextMode,Ku as parseLinkedTestEnvClear,Vu as parseLinkedTestEnvSet,rm as parseLinkedTestJsonEntries,Zu as parseLinkedTestMinLines,Qu as parseLinkedTestRegexList,Ju as parseLinkedTestStringList,Xu as parseLinkedTestWorkspaceContextMode,zg as parseMcpCachePolicy,Lg as parseMcpImplementation,Ze as parseMcpInputRequests,dr as parseMcpInputResponses,fy as parseMcpSubscriptionFilter,_p as parseMigrateEntries,yI as parseMultiValueFilter,HI as parseMutationReceipt,fC as parseOptionalNonNegativeInteger,mC as parseOptionalNumber,qD as parsePmAgentTaskTranscriptCorpus,dF as parsePmToolDiscoveryOptions,hI as parsePriority,CI as parsePriorityFilterSet,iS as parseReadOutputSession,SA as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,fp as parseRemoveEntries,xp as parseSourceLineRange,ZA as parseStatusFilterCsv,bI as parseStringFilterSet,sn as parseTags,o_ as parseTestRunMeasurements,gI as parseType,TI as parseTypeFilterSet,Jl as parseUnknownAuthorHistoryEventCoordinates,HT as parseWorkflowPolicy,VT as parseWorkflowPolicyDocument,ok as partitionDecisionEntries,MA as patchPathToChangedField,an as pathExists,pg as pauseTask,cu as persistDurableGraphResult,pO as persistSelectedItemFormat,HP as planAgentIdentityVocabularyMutation,K0 as planCompletedAtBackfill,Fl as planExtensionDirectoryCopy,vx as planItemMutationDocument,er as planProfileApplication,KD as planRelationshipEventBackfill,fu as planRelationshipRemediation,Pl as planSchemaEvolutionMigration,Yl as planUnknownAuthorHistoryAcknowledgment,Ff as planWorkspaceSnapshotRestore,KR as positionalShapeKey,WR as positionalSignatureKey,Fx as preflightExtension,As as prepareSimilarityText,cC as preserveMutationStdinTokenFields,aC as preserveMutationStdinTokenLiterals,Ox as previewItemMutationDocument,rx as previewItemMutations,gw as printError,hw as printResult,Uh as profile,qh as profileApply,zh as profileLint,jh as profileList,Bh as profileShow,mA as projectAfterCommandItemSnapshot,Im as projectContextFocusRows,t_ as projectFleetAttributionAnalytics,b0 as projectHistoryProvenance,Li as projectLeanRecoveryPayload,lp as projectLinkedCollectionMutation,lw as projectPmBriefListEnvelope,pw as projectPmBriefSearchEnvelope,cs as projectPmCliErrorContextDetails,ss as projectPmCliErrorDetails,Ri as projectPmDiagnosticOutput,Ii as projectPmDiagnosticText,Zf as projectProvenanceCoverageAnalytics,Iu as projectValidateCounts,tM as promoteAssuranceAssertion,BS as propagateContextUsageServingReceipt,uD as pruneCompileCacheGenerations,gP as putAssuranceDeclaration,yP as putAssuranceDeclarationBundle,xO as queryItemMetadataIndex,NO as queryLinkedFileMetadataIndex,LO as querySimilarItemMetadataIndex,n_ as queryTestRunMeasurementsBelow,wn as quoteCommandArg,Sn as quoteWindowsCommandArg,Tx as rankCommandPaths,td as readAnnotationEntries,si as readAuthorEnvironment,E_ as readBooleanOption,YS as readContextUsageAffinity,S_ as readCsvListOption,Vs as readExtensionMigrationState,cn as readFileIfExists,Xc as readFirstStringFromCommanderOptions,Jc as readFirstValueFromCommanderOptions,Xf as readHistoryAnalyticsWindow,yE as readHistoryEntries,li as readHistorySnapshot,qf as readImprovementLedger,FO as readItemMetadataDerivedIndexState,Gs as readItemRevision,ax as readItemTransaction,$v as readLatestHistoryActivity,ts as readLocatedItem,KE as readOutputBudgetCollections,vS as readOutputCollectionFingerprint,VE as readOutputContinuationRowCollections,zE as readOutputContinuationRowPaths,gS as readOutputIncludeModeOptions,tS as readOutputRetainsTail,HE as readOutputRowCollections,qE as readOutputRowPaths,cS as readOutputSessionRemainingTokens,Gt as readPmPackageManifest,vm as readRecentActivity,y_ as readRequiredString,sE as readRuntimeFieldOptionValue,Yi as readSettings,Vv as readSettingsSection,mO as readSettingsWithMetadata,Qc as readStringArrayFromCommanderOptions,C_ as readStringOption,_v as readThrownExitCode,sv as readVectorizationStatusLedger,SO as readWorkflowPolicies,KT as readWorkflowPolicyField,uR as readWorkspaceContextIntentContracts,H0 as readWorkspaceContextSignals,X0 as readWorkspaceMemory,Lk as readWorkspacePosition,IR as readWorkspaceTransaction,OE as reanchorHistoryEntries,S$ as reconcileArtifactLedgers,Bi as reconcileExtensionCapabilityUsage,BA as reconcileWorkspaceJsonHistory,uA as recordAfterCommandAffectedItem,TP as recordAssuranceVerdict,sm as recordClaimSemanticAttribution,VS as recordContextUsageDelivery,HS as recordContextUsageServing,KS as recordContextUsageTouch,WS as recordContextUsageTouches,cm as recordFocusSemanticAttribution,Bf as recordImprovementObservation,am as recordReleaseSemanticAttribution,Nv as recordedBaselineActivity,Dv as recordedPrefixActivity,Rn as redactUrlCredentialsInText,vn as redactUrlCredentialsInToken,GO as refreshItemMetadataDerivedIndex,Ol as refreshMergeAttributeFenceIfInstalled,QE as refreshReadOutputDeliveredCounts,cv as refreshSearchArtifactsForMutation,ei as registerAgentProvenanceAdapters,AI as registerExternalDependencyResolver,Qn as registerHarnessSignalDescriptors,ME as registerOutputMaterialFieldGroups,ig as release,JE as rememberReadOutputFocusRows,bP as removeAssuranceDeclaration,dn as removeFileIfExists,Op as renameArtifactsResultKey,Sm as renderCalendarMarkdown,wm as renderCalendarToon,Bm as renderContextMarkdown,Dl as renderExtensionDescribeMarkdown,Nl as renderExtensionSurfaceMarkdown,K_ as renderGuideMarkdown,gx as renderMissingOptionRetry,nk as renderNextMarkdown,Sx as renderPmClosedDomainHelp,An as renderPmCommand,Fo as renderPmCommandAliasMigrationHint,hl as renderPmCommandVisibilityMarkdown,M1 as renderPmFlagLexiconMarkdown,vL as renderPmMcpAppHtml,s1 as renderPmRefusalClosureCensusMarkdown,tO as renderRowsAsCsv,rO as renderRowsAsTable,tg as reopen,CO as replayHistoryToTarget,CE as replayToCanonicalItemDocument,TE as replayToItemDocument,XC as requireHistoryOperation,d0 as requireTerminalReason,l0 as requireTerminalReasonWithRecovery,vw as resealHistoryRewrite,cA as resetActiveExtensionRuntimeState,ip as resetWorkspaceGraphCache,Vn as resolveAgentSessionContextFromSignals,ad as resolveAnnotationIndex,nd as resolveAnnotationInput,gE as resolveAuthor,di as resolveAuthorIdentity,zA as resolveBodyFileContent,pb as resolveBuiltinCorpusShape,Em as resolveCalendarOutputFormat,GI as resolveCanonicalPmErrorCodeContract,Nw as resolveCanonicalRelationshipKind,hE as resolveClaimPrincipal,PA as resolveCliBulkIdsInput,TC as resolveCommandOptionPolicyState,pD as resolveCompileCacheGeneration,V0 as resolveCompletionTimestamp,Uw as resolveConfiguredPmPackageRoot,MI as resolveContentFieldFilters,tw as resolveContextIntentContract,Pm as resolveContextOutputFormat,Mm as resolveContextTokenBudget,u0 as resolveCreateExplicitEmptyFlag,Ns as resolveDeclaredBlockers,fk as resolveEffectiveSearchMode,VO as resolveEmbeddingProviders,Mt as resolveExtensionFlagOptionKey,FC as resolveExtensionFlagValueContract,Gl as resolveExtensionInstallSourceIdentity,OC as resolveExtensionLongFlagName,Hs as resolveExtensionMigrationStatePath,Yw as resolveExtensionRoots,OI as resolveExternalDependencyReference,$C as resolveFlagValueKind,SC as resolveGlobalPmRoot,H_ as resolveGuideOutputFormat,zf as resolveHistoryEpisodeGroupIdentity,tE as resolveHistoryHashAlgorithm,YC as resolveHistoryOperation,g0 as resolveHistoryProvenanceDimensions,Qv as resolveHistorySubject,bO as resolveHistoryTarget,hk as resolveHybridSemanticWeight,yn as resolveImplicitPmRoot,kC as resolveIsoOrRelative,sR as resolveItemBlockers,tR as resolveItemExecutionRole,Xk as resolveItemMutationDocument,Tm as resolveItemOwnershipActivity,bm as resolveItemOwnershipConflict,gn as resolveItemTypeRegistry,oE as resolveItemTypesFilePath,Is as resolveLastActivityAt,dx as resolveLifecycleVerbRecovery,wC as resolveLinkedResourcePositionalRecovery,f_ as resolveLinkedTestFailureExitCode,Cu as resolveLinkedTestSourceRef,Eu as resolveLinkedTestSourceWorkspaceRoot,Ou as resolveLinkedTestTrust,vu as resolveLinkedTestTrustBatch,_y as resolveMcpAcknowledgedSubscriptionFilter,Ye as resolveMcpRequestContext,Cl as resolveMergeInstallContext,yx as resolveMisnestedCommandPath,PI as resolveMissingMetadataFilters,hx as resolveMissingOptionPlaceholder,$E as resolveModePairedOutputOmissionReceipt,tk as resolveNextOutputFormat,UE as resolveOutputOmissionReceipt,Gw as resolvePmCliVersion,$o as resolvePmCommandAlias,ze as resolvePmCommandCapabilityFamily,Lt as resolvePmCommandExitContract,N as resolvePmCommandOperation,Ai as resolvePmCommandOutputBudget,Nt as resolvePmCommandOutputEnvelope,BR as resolvePmCommandPositionalContract,In as resolvePmCommandScopeArgs,He as resolvePmCommandVisibilityTier,vi as resolvePmDiagnosticOutputBudget,UI as resolvePmErrorCodeContract,nT as resolvePmFlagSemanticConcept,xe as resolvePmHistoryOperation,NN as resolvePmMcpExecutableInvocation,Fw as resolvePmPackageRootFromModule,qR as resolvePmPositionalActionContract,Mc as resolvePmPositionalActionFlagContracts,$e as resolvePmRoot,Dd as resolvePmToolCustomFieldCollision,YA as resolvePriority,Kt as resolveProfile,wl as resolveProjectMergeTypeFolders,DS as resolveQueryCursorStart,lx as resolveReadCompletenessControls,ux as resolveReadOptionRetryArgs,TS as resolveReadOutputDimensions,AS as resolveReadOutputEncoding,ZE as resolveReadOutputRecoveryBudget,mS as resolveReadOutputSurface,GE as resolveReadRowContract,_x as resolveRecoveryCommandName,OA as resolveRegisteredSearchProvider,vA as resolveRegisteredVectorStoreAdapter,Wd as resolveReproducibleProcessEnvironment,xn as resolveRuntimeFieldRegistry,kn as resolveRuntimeStatusRegistry,KO as resolveSearchCorpusFields,mk as resolveSearchMaxResults,bk as resolveSearchPage,_k as resolveSearchScoreThreshold,gk as resolveSearchTuning,YO as resolveSemanticCorpusCharacterLimit,im as resolveSemanticLineageIds,_O as resolveSettingsWithSemanticRuntimeDefaults,AP as resolveSourceContextWritePolicy,um as resolveStartTaskInProgressStatus,Z as resolveSubcommandFlagContractsForCommand,UT as resolveTelemetryErrorCategory,dv as resolveTelemetrySourceAttribution,c0 as resolveTerminalReason,Zk as resolveTransactionSchema,bC as resolveTypeDefinition,yC as resolveTypeName,eO as resolveTypeSynonym,aO as resolveTypeWorkflows,Xl as resolveUnknownAuthorAcknowledgmentSelector,wk as resolveVectorIndexRecovery,JO as resolveVectorStores,Qd as resolveWorkspaceRelationshipKindRegistry,EC as resolveWorkspaceRoot,cg as restore,DC as restoreCheckpointItems,qA as restoreWorkspaceJsonFromHistory,Uf as restoreWorkspaceSnapshot,Gf as restoreWorkspaceSnapshotWithRecovery,cp as reviseLinkedNote,kg as runAction,hA as runActiveBeforeMutationHooks,yA as runActiveCommandHandler,gA as runActiveOnIndexHooks,Hi as runActiveOnReadHooks,zi as runActiveOnWriteHooks,bA as runActiveParserOverride,TA as runActivePreflightOverride,CA as runActiveServiceOverride,Om as runActivity,Ww as runAfterCommandHooks,yf as runAggregate,sd as runAnnotationCommand,Nu as runAppend,WM as runAssuranceAction,YM as runAssuranceDispatch,Kw as runBeforeCommandHooks,Am as runCalendar,Wm as runClaim,Ym as runClaimNext,Du as runClose,$u as runCloseMany,Zm as runCloseTask,cd as runComments,W_ as runCompletion,ep as runConfig,qt as runContext,L0 as runContextEvaluationCorpus,x0 as runContextEvaluationScenario,Fu as runCopy,om as runCreate,nm as runDelete,sp as runDeps,vp as runDocs,YP as runDuplicates,If as runEval,Mf as runEvent,Ul as runExtension,Ys as runExtensionMigrateAction,Ws as runExtensionMigrations,Lp as runFiles,$p as runFilesDiscover,Dp as runFilesLookup,e_ as runFleetAttributionAnalytics,pm as runFocus,ku as runGc,bf as runGet,hu as runGraph,V_ as runGuide,yu as runHealth,uk as runHistory,s0 as runHistoryAttest,JM as runHistoryCompact,e0 as runHistoryCompactBulk,MM as runHistoryMaintenance,t0 as runHistoryRedact,xM as runHistoryRepair,LM as runHistoryRepairAll,Mg as runInActiveExtensionScope,Vl as runInit,ql as runInitAgentGuidance,dd as runLearnings,Ap as runLinkedArtifacts,__ as runLinkedTests,dl as runList,Pf as runMeet,Rk as runMergeDriver,vl as runMergeInstall,SM as runMergeReceiptEvidenceReport,EM as runMergeReceiptReport,Ik as runMergeReconcile,Hm as runNext,ld as runNotes,Qm as runPauseTask,tf as runPlan,mf as runProfileApply,uf as runProfileLint,lf as runProfileList,pf as runProfileShow,Qf as runProvenanceCoverageAnalytics,qx as runRegisteredCommandForTest,Wx as runRegisteredCommandOverrideForTest,tN as runRegisteredExporterForTest,Hx as runRegisteredHookForTest,eN as runRegisteredImporterForTest,Zx as runRegisteredMigrationForTest,zx as runRegisteredMutationGuardForTest,Vx as runRegisteredParserOverrideForTest,Kx as runRegisteredPreflightOverrideForTest,Yx as runRegisteredRendererOverrideForTest,Jx as runRegisteredSearchProviderForTest,Xx as runRegisteredServiceOverrideForTest,Qx as runRegisteredVectorStoreAdapterForTest,tr as runReindex,Xm as runRelease,kf as runRemind,f0 as runReopen,rf as runRestore,Ml as runSchemaEvolutionMigration,Tf as runSearch,fb as runSearchRefreshWorkerEntrypoint,Y_ as runStartBackgroundRun,Jm as runStartTask,s_ as runStats,c_ as runTelemetry,cf as runTemplatesList,af as runTemplatesSave,df as runTemplatesShow,h_ as runTest,g_ as runTestAll,X_ as runTestRunsList,Q_ as runTestRunsLogs,eh as runTestRunsResume,J_ as runTestRunsStatus,Z_ as runTestRunsStop,th as runTestRunsWorker,gm as runUpdate,of as runUpdateMany,jt as runUpgrade,Mu as runValidate,Pg as runWithActiveExtensions,L as runWithAgentSessionContext,lO as runWithConfigurationOnlySettings,ZS as runWithContextIntentContracts,_R as runWithDiscoveredContextIntentContracts,ri as runWithHarnessDetectionSignals,yL as runWithMcpTraceContext,Xd as runWithReproducibleProcessEnvironment,oi as runWithWorkspaceHarnessSignalDescriptors,Hr as runWithWorkspaceRecipe,LP as runWorkflowPolicyAction,XM as runWorkspaceTransactionGc,mu as saveGraphAuditBaseline,GM as scanClosureTimestamps,rM as scanExtensionHostVersions,Wl as scanHistoryAuthorAttribution,ks as scanInProgressWork,Gn as scanItemFormatVersions,_s as scanMutationSecrets,iM as scanProvenanceResolverHealth,xs as scanStaleInProgressItems,BM as scanStorageIntegrity,Sh as schema,Ph as schemaAddField,Rh as schemaAddStatus,Oh as schemaAddType,Nh as schemaApplyPreset,Lh as schemaInferTypes,wh as schemaList,kh as schemaListFields,Fh as schemaRemapStatus,Mh as schemaRemoveField,Ih as schemaRemoveStatus,vh as schemaRemoveType,$h as schemaRenameField,Dh as schemaRenameType,Ah as schemaShow,xh as schemaShowField,Gh as schemaShowStatus,bx as scoreCommandPathMatch,I0 as scoreContextCandidates,P0 as scoreContextCandidatesWithActiveExtensions,Os as scoreItemSimilarity,T1 as scorePmGrammarRefusalClosure,d1 as scorePmRefusalClosure,vs as scorePreparedItemSimilarity,S1 as scoreTrackerPreflightRecoveryClosure,Aw as sealHistoryRecord,GN as sealMcpRequestState,ih as search,Z0 as searchWorkspaceMemory,ek as searchWorkspaceMemoryReadResult,ys as secretGuardRuleCategory,cR as selectActionableEntries,PS as selectCursorSemanticOptions,j_ as selectImportAuthor,mL as selectMcpClientRegistrationMode,Q0 as selectWorkspaceMemory,J0 as selectWorkspaceMemoryRollups,lm as semanticAttributionAffinity,wv as sentryCaptureCliError,Ev as sentryDiscardCommandSpan,Sv as sentryFinishCommandSpan,Ov as sentryFlush,Av as sentryLogCliUsageError,Tv as sentrySetCommandContext,Cv as sentryStartCommandSpan,qn as serializeItemDocument,wx as serializeNdjsonRows,Ax as serializeNdjsonStream,ob as serveDeclaredObservation,dA as setActiveCommandContext,lA as setActiveCommandResult,rA as setActiveExtensionCommands,tA as setActiveExtensionHooks,oA as setActiveExtensionParsers,nA as setActiveExtensionPreflight,aA as setActiveExtensionRegistrations,sA as setActiveExtensionRenderers,iA as setActiveExtensionServices,fE as setFocusedItem,Hv as settingsSectionRevision,zv as shouldCompletePlanOnClose,pu as shouldPersistDurableGraphCache,pC as shouldResolveMutationStdinTokenField,lC as shouldResolveMutationStdinTokens,gO as shouldRunSearchRefreshInForeground,Rp as similarityAdvisoryWarnings,BE as sliceReadOutputRowCollection,as as snapshotPmCliErrorContext,Ep as sortLinkedArtifacts,iI as sortWaiverNotices,eC as splitAcceptanceCriteria,jv as splitCommaList,Bn as splitFrontMatter,CS as stabilizeReadOutputReceiptEstimates,R as stableStringify,Yk as stableUpsertValue,jT as stableValueEquals,Pv as staleEligibleAt,IO as stampRequiredItemFormat,lg as startTask,Yv as startTelemetryCommand,dh as stats,iE as statusIsTerminal,Nc as stripGlobalBootstrapTokens,kk as subscribeMutationEventBatches,xk as subscribeMutationEvents,zP as summarizeAgentIdentityVocabulary,Vf as summarizeAgentModelProvenance,Kf as summarizeAgentProvenance,N0 as summarizeContextEvaluationReports,p_ as summarizeContextPreflight,E0 as summarizeHistoryProvenance,zl as summarizeInitResult,yM as summarizeMergeReceipt,m0 as supportsCreateExplicitEmpty,JR as supportsItemIdAlias,RE as suppressHostOutput,Oe as syncRelationshipGraphAdapter,Lx as synthesizeExtensionManifest,kc as toCompletionFlagString,Um as toContextFocusItem,$m as toContextPackingSummary,Fm as toContextRankingSummary,RC as toErrorMessage,A_ as toEstimatedMinutesValue,qk as toExtensionFlagDefinitions,P_ as toImportBoolean,N_ as toImportConfidence,G_ as toImportDeferredFields,I_ as toImportInteger,F_ as toImportLinkedDocs,$_ as toImportLinkedFiles,U_ as toImportLinkedTests,D_ as toImportLogEntries,L_ as toImportNormalizedEnum,x_ as toImportNumberMap,O_ as toImportPriority,R_ as toImportStatus,M_ as toImportStringList,k_ as toImportStringMap,v_ as toImportTags,uE as toItemRecord,w_ as toNonEmptyImportString,vC as toNonEmptyStringOrUndefined,EE as toReplayDocument,uw as toWellFormedText,ws as tokenizeSimilarityText,dC as transferMutationStdinTokenPolicy,Hw as translateHostEnvironmentFault,xv as unprovenClaimActivity,eg as update,d_ as updateLinkedTest,Rg as upgrade,Hh as validate,cP as validateAssertionDefinition,lP as validateAssuranceDocument,dP as validateGateDefinition,Qk as validateItemMutationRows,wp as validateLinkedPaths,fL as validateMcpAuthorizationResponseIssuer,uL as validateMcpAuthorizationServerMetadata,_L as validateMcpClientMetadataDocument,nL as validateMcpHttpRequestHeaders,qN as validateMcpJsonSchema,aP as validateMeasurementDefinition,KA as validateMissingParentReference,hS as validateReadOutputOptions,QA as validateSprintOrReleaseValue,CC as validateTypeOptions,vR as validateWorkspaceTransactionIdentity,i0 as verifyAttestation,eI as verifyCliFlagInvocationParity,VR as verifyExplicitPositionalSlotCensus,AE as verifyHistoryChain,wE as verifyHistoryChainWithVersion,hR as verifyHistoryEntries,Ow as verifyHistoryRecordHash,Rw as verifyHistoryRewriteEvidence,XR as verifyPmCliGrammar,YR as verifyPmCommandPositionalContracts,P1 as verifyPmFlagLexicon,e1 as verifyPmRecoveryKindRuntimeCoverage,Wb as verifyPmRecoveryProducerRuntimeCoverage,ZD as verifyPmRecoveryReferences,n1 as verifyPmRefusalClosureIdentityRatchet,o1 as verifyPmRefusalClosureRatchet,QD as verifyPmRefusalReachability,gd as verifyToolOptionCliParity,nI as waiverNoticeFor,Iv as wholeHoursSince,XA as withCliMutationInput,Bs as withExpectedItemRevisions,Js as withFlagAliasMetadata,Vw as withHostEnvironmentBoundary,JA as withLiteralMutationInput,BN as withMcpCachePolicy,xi as withoutGenericRefusalExamples,YT as workflowApprovalFingerprint,XT as workflowPolicyApplies,WT as workflowPolicyFingerprint,np as workspaceGraphCache,PR as workspaceTransactionPlanDigest,id as wrapOwnershipConflict,yv as wrapThrownErrorForSentry,ai as writeAuthorEnvironment,De as writeFileAtomic,NC as writeMutationCheckpoint,fO as writeSettings,Kv as writeSettingsSection,_w as writeStderr,fw as writeStdout,av as writeVectorizationStatusLedger,jA as writeWorkspaceJsonWithHistory,dp as writtenLinkedEntries};
|
|
28
|
+
</html>`}import{createHash as ot}from"node:crypto";import{lstat as HC,readdir as zr,readFile as VC}from"node:fs/promises";import M from"node:path";import{parseDocument as KC}from"yaml";var $r="io.modelcontextprotocol/skills",it="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",WC=Object.freeze({revision:it,status:"draft",directoryRead:!0});function FL(e,t=!1){let r=e.clientCapabilities.extensions,n=h(r)?r[$r]:void 0;if(!h(n)||n.revision!==it||t&&n.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[$r]:WC}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Dr=100,YC=32*1024*1024,XC=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Fr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function T(e,t){throw new u(e,-32602,t)}function Gr(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function JC(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let n=KC(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});n.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:n.errors.map(i=>i.message)});let o;try{o=n.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof o!="object"||o===null||Array.isArray(o))&&T(`Skill ${t} frontmatter must be an object.`),o}async function QC(e,t,r,n){return r>P.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),n.files+=1,n.files>P.maxFilesPerSkill&&T(`Skill exceeds ${P.maxFilesPerSkill} files.`),n.skillBytes+=r,n.skillBytes>P.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),n.originBytes.value+=r,n.originBytes.value>YC&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),VC(e)}async function qr(e,t,r){let n=M.join(e,t),o=await zr(n,{withFileTypes:!0}),i=[];for(let s of o.sort((a,c)=>a.name.localeCompare(c.name))){let a=M.posix.join(t.split(M.sep).join("/"),s.name),c=M.join(e,...a.split("/")),d=await HC(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await qr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await QC(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Ur(e,t,r){let n=new Map,o;try{o=await zr(e,{withFileTypes:!0})}catch(a){if(St(a))return n;throw a}let i=o.filter(a=>a.isDirectory()&&XC.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Dr&&T(`Skill origin exceeds ${Dr} directories.`);let s={value:0};for(let a of i){let c=await qr(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((_,y)=>_+y.bytes.byteLength,0),p=c.find(_=>_.relative==="SKILL.md");if(!p)continue;let l=JC(p.bytes.toString("utf8"),a.name);l.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:l.name??null,expected:a.name}),(typeof l.description!="string"||l.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(_=>({uri:`skill://${a.name}/${_.relative}`,digest:`sha256:${ot("sha256").update(_.bytes).digest("hex")}`,size:_.bytes.byteLength})),g=ot("sha256").update(f.map(_=>`${_.uri}:${_.digest}`).join(`
|
|
29
|
+
`)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:l,resources:f,_meta:{contractVersion:1,extensionRevision:it,origin:t,packageVersion:r,protocolVersion:q,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(_=>[_.relative,_.bytes])),fingerprint:g})}return n}function jr(e){let{files:t,fingerprint:r,...n}=e;return n}var Br=class e{#e;#t;constructor(t){this.#e=t,this.#t=ot("sha256").update([...t.entries()].sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>`${r}:${n.fingerprint}`).join(`
|
|
30
|
+
`)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof n!="object"||n===null||!("fingerprint"in n)||n.fingerprint!==this.#t||!("scope"in n)||n.scope!==r||!("offset"in n)||!Number.isInteger(n.offset)||Number(n.offset)<0)&&T("Skill cursor is invalid or stale."),Number(n.offset)}catch(n){if(n instanceof u)throw n;return T("Skill cursor is invalid or stale.")}}#n(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Ur(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=M.resolve(t.packageRoot,".agents","skills"),o=M.resolve(t.workspaceRoot,".agents","skills");if(o!==n){let i=await Ur(o,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Fr.has(r)||T(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let n=this.#r(t.cursor,"skills/list"),o=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=o.slice(n,n+r),s=n+i.length,a=s<o.length;return{skills:i.map(jr),hasMore:a,...a?{nextCursor:this.#n(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),n=r?this.#e.get(r[1]):void 0;return n||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),jr(n)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),n=r?this.#e.get(r[1]):void 0,o=r?.[2]??"",i=n&&o?n.files.get(o):void 0,s=n?.resources.find(d=>d.uri===t);(!n||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:n._meta.origin,trust:"untrusted"},c=Gr(o,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let n=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),o=n?this.#e.get(n[1]):void 0;o||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(n?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${n[1]}`,c=new Map;for(let y of o.resources){let E=y.uri.slice(`${a}/`.length);if(!E.startsWith(s))continue;let B=E.slice(s.length),[O,...ht]=B.split("/"),Rn=`${a}/${s}${O}`,Pn=o.files.get(`${s}${O}`);c.set(O,{uri:Rn,name:O,mimeType:ht.length>0?"inode/directory":Gr(O,Pn)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;Fr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let p=this.#r(r.cursor,t),l=[...c.values()].sort((y,E)=>y.uri.localeCompare(E.uri)),f=l.slice(p,p+d),g=p+f.length,_=g<l.length;return{resources:f,hasMore:_,..._?{nextCursor:this.#n(g,t)}:{}}}};var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function st(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,n)=>st(r,`${t}[${n}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,n])=>[r,st(n,`${t}.${r}`)])))}function xe(e){if(e.schema!==Hr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,n)=>Object.freeze({action:r.action,input:st(r.input,`operations[${n}].input`)})))})}async function Vr(e,t){let r=xe(e);return Et(r,t)}async function ZC(e,t){return Vr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));return r})}var Kr="pm.agent-observation/v1",Wr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function w(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function I(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function ey(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(I(r.command,"observation.reads.command"),w(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function ty(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(w(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,n)=>r+n,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function ry(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let n of e){if(I(n.id,"observation.tiers.id"),w(n.max_tokens,"observation.tiers.max_tokens"),t.has(n.id))throw new Error(`Duplicate observation tier: ${n.id}.`);if(t.add(n.id),n.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=n.max_tokens;let o=new Set;for(let i of n.fields){if(D(i,"observation.tiers.fields"),o.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);o.add(i)}}}function ny(e){if(e.schema!==Kr)throw new Error(`observation.schema must be ${Kr}.`);return I(e.id,"observation.id"),w(e.version,"observation.version"),ey(e.reads),ty(e.calibration),e.corpus_dependence.kind==="bounded"&&(I(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),w(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),ry(e.tiers),ne(structuredClone(e))}function KL(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function oy(e,t,r){w(r.budget_tokens,"observation request budget_tokens");let n=[];for(let[o,i]of e.tiers.entries()){n.push(i.id);let s=await t(i),a=Buffer.byteLength(R(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:o>0,attempted_tiers:n,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:n,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function D(e,t){let r=e.split(".");if(r.some(n=>n.length===0||n==="__proto__"||n==="prototype"||n==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Xr(e,t){let r=e;for(let n of D(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,n))return;r=r[n]}return r}function iy(e){return`/${D(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function sy(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function ay(e){if(e.schema!==Wr)throw new Error(`verdict.schema must be ${Wr}.`);I(e.id,"verdict.id"),w(e.version,"verdict.version");let t=new Set;for(let n of e.predicates){I(n.id,"verdict.predicates.id"),D(n.path,"verdict.predicates.path");let o=n.kind;if(o!=="field_equals"&&o!=="field_present"&&o!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${n.id}.`);if(t.has(n.id))throw new Error(`Duplicate verdict predicate: ${n.id}.`);sy(n),t.add(n.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(n=>!t.has(n)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function cy(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),n=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=Xr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:R(c)===R(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${iy(a.path)}`,evidence_digest:gt(R(c))}}),o=n.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?o===n.length:o>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:o/n.length,policy:"verdict_only_no_reward",predicates:n}}function WL(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(I(e.id,"episode.id"),w(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)I(t,"episode.task_item_ids");w(e.limits.max_actions,"episode.limits.max_actions"),w(e.limits.max_observations,"episode.limits.max_observations"),w(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)D(t,"episode.observable_fields");for(let t of e.withheld_fields)D(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(n=>t===n||t.startsWith(`${n}.`)||n.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return ny(e.observation),ay(e.verdict),xe(e.recipe),ne(structuredClone(e))}function dy(e,t,r){let n=D(t,"observation projection field"),o=e;for(let[i,s]of n.entries()){if(i===n.length-1){r!==void 0&&(o[s]=structuredClone(r));return}let a=o[s];(a===null||typeof a!="object"||Array.isArray(a))&&(o[s]={}),o=o[s]}}function py(e,t){let r={};for(let n of t)dy(r,n,Xr(e,n));return r}async function YL(e,t){let r=[],n=0,o=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let l=await t.readRecordedState(),f=await oy(e.observation,async g=>py(l.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??l.snapshot_id}),f},p=async(l=!1)=>{if(i&&!l)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let f=await t.readRecordedState(),g=cy(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>L(a,d),step:async l=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");n+=1;let f=await L(a,()=>t.execute(l));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,p),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=L(a,()=>p(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ne(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function V(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function oe(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Qr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Qr(t);Object.freeze(e)}}function K(e){if(e.schema!==F)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(V(e.hierarchy_depth,"hierarchy_depth"),V(e.hierarchy_fanout,"hierarchy_fanout"),oe(e.age_span_days,"age_span_days"),V(e.history_entries_per_item,"history_entries_per_item"),oe(e.comments_per_100_items,"comments_per_100_items"),oe(e.notes_per_100_items,"notes_per_100_items"),oe(e.learnings_per_100_items,"learnings_per_100_items"),V(e.author_cardinality,"author_cardinality"),V(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Qr(t),t}var be=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],W=Object.freeze({scratch:K({schema:F,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:K({schema:F,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:be,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":K({schema:F,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:be,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":K({schema:F,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:be,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":K({schema:F,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:be,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function ly(){return Object.keys(W).sort().map(e=>W[e])}function uy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Jr=new WeakMap;function Zr(e,t){if(e===0)return[];let r=Jr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),Jr.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function my(e,t,r,n=42){if(oe(t,"item index"),V(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,p=s-d,l=d===0?void 0:i+(p+Math.floor((d-1)/e.hierarchy_fanout))*o,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,_=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),y=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...l===void 0?{}:{parent:`pm-s${l.toString(36).padStart(7,"0")}`},component:i,timestamp:_,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Zr(t,e),has_comment:y<e.comments_per_100_items,has_note:y<e.notes_per_100_items,has_learning:y<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var at=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let n of r)t[n]=(t[n]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Zr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,p=c*a+Math.max(0,a+d-100),l=c*a+Math.min(a,d),f=this.annotations[s];(f<p||f>l)&&n.push(`${s}:${f}!in[${p},${l}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function en(e){return new at(e)}function fy(e,t){let r=en(e);for(let n of t)r.add(n);return r.finish()}async function _y(){let e=De(process.cwd(),process.env.PM_PATH);await wt(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}async function hy(){await Rt()}var tn=["lines","branches","functions","statements"];function gy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Cy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function yy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,n]of Object.entries(e)){gy(r,n);for(let o of tn){let i=Cy(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}import Y from"node:fs";import ct from"node:path";var rn=300*1e3,Sy=3;function f$(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function _$(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");Y.mkdirSync(e,{recursive:!0});let n=ct.join(e,r);Y.mkdirSync(n,{recursive:!0});let o=new Date;Y.utimesSync(n,o,o);let i=Y.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Y.statSync(ct.join(e,d)).mtimeMs}]}catch(p){if(p instanceof Error&&"code"in p&&me(p))return[];throw p}}).sort((d,p)=>p.mtimeMs-d.mtimeMs||d.name.localeCompare(p.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<rn),a=Math.max(0,Sy-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=rn).slice(a).map(d=>d.name).sort((d,p)=>d.localeCompare(p));for(let d of c)Y.rmSync(ct.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as Ty}from"node:crypto";var dt=1;function X(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:dt,fingerprint:Ty("sha256").update(R({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function Ey(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!Ey(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==dt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ge([]);for(let o of e.kinds)t.register(o);let r=new z(e.nodes,e.edges,t),n=J(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function v(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");X(t.signal);let n=await e.read({...t,workspace:r});return X(t.signal),n===null?null:se(n)}async function we(e,t){let r=G(t.workspace,"workspace"),n=se(t.snapshot).snapshot,o=await v(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(X(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await v(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Ay(e,t={}){let r=e.map(se),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&R(c)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new Ge([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new z(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return J(i,o,t)}var ie=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){X(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(se(t.snapshot).snapshot))}async clear(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};function nn(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function xy(e){let t=nn(e.nodeCount,"nodeCount"),r=nn(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function on(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=xt(),o=J(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=J(new z(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];U(await v(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await we(e,{workspace:r,snapshot:o});U(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await v(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),U((await we(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),U((await v(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return U(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),U(await v(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function by(e){return on(new ie,e?{workspace:e}:{})}var pt=2,wy=["self_reported","independent_transport"];function Oe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function sn(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((n,o)=>{let i=ae(n,`${t}[${String(o)}]`);return r?n:i})}function lt(e,t){return e===void 0?void 0:ae(e,t)}function Oy(e,t){if(e===void 0)return;if(!Oe(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([n,o])=>{if(n.length===0||n.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError(`${t} values must be JSON primitives`);return[n,o]});return Object.fromEntries(r)}function Ry(e,t,r,n,o,i){if(n==="refusal"){if(Ve(r)||o===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(o!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=Ct(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let p=yt(t.slice(s+1));p!==void 0&&(a=ke(`history ${p}`))}let c=$t(a);if(!Ve(r)||r!==0&&!c?.exit_codes.some(p=>p===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=Lt(a).kind;if(n!==d)throw new TypeError(`${e} expected ${n}, but ${a} declares ${d}`)}function Py(e,t,r){if(!Oe(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let n=`tasks.${t}.steps[${String(r)}]`,o=ae(e.id,`${n}.id`),i=sn(e.args,`${n}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${n}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Nt.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!wy.includes(d))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let p=d;if(p==="independent_transport"&&c!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let l=sn(e.required_fields,`${n}.required_fields`);if(l.some(E=>E.split(".").some(B=>B.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let f=Oy(e.expected_field_values,`${n}.expected_field_values`),g=lt(e.expected_error_code,`${n}.expected_error_code`),_=lt(e.expected_refusal_surface,`${n}.expected_refusal_surface`),y=lt(e.recovery_for,`${n}.recovery_for`);return Ry(n,i,s,c,g,_),{id:o,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:p,required_fields:l,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},..._?{expected_refusal_surface:_}:{},...y?{recovery_for:y}:{}}}function My(e,t){if(!Oe(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),n=ae(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let o=e.steps.map((s,a)=>Py(s,r,a)),i=new Map;for(let s of o){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(o.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of o)if(s.expected_output_kind==="refusal"&&!o.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:n,steps:o}}function V$(e){if(!Oe(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==pt)throw new TypeError(`agent-task transcript corpus version must be ${String(pt)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((n,o)=>My(n,o)),r=new Set;for(let n of t){if(r.has(n.id))throw new TypeError(`duplicate agent-task transcript id ${n.id}`);r.add(n.id)}return{version:pt,tasks:t}}import{createHash as an}from"node:crypto";function cn(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function X$(e,t){let r=cn(t.migrationId,"migrationId"),n=cn(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=ze(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=an("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=an("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),p=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),l=c.filter(f=>!p.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(l),edge_count:c.length,skipped_existing_count:c.length-l.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as dn from"node:module";var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},Q$=Object.freeze(Object.keys(ut));function pn(e){if(Object.hasOwn(ut,e))return ut[e]}var Iy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function vy(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function ky(e){return e===void 0||e.kind==="punctuator"&&Iy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function Ny(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
|
|
31
|
+
`,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Ly(e,t,r){if(e[t]!=="/"||!ky(r))return;let n=t+1,o=!1;for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]==="[")o=!0,n+=1;else if(e[n]==="]")o=!1,n+=1;else if(e[n]==="/"&&!o){for(n+=1;/[A-Za-z]/u.test(e.charAt(n));)n+=1;return n}else n+=1;return n}function $y(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let o=vy(e,t);return r==="`"?{next:o.next}:{next:o.next,token:{kind:"string",value:o.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let o=t+1;for(;/[A-Za-z0-9_$]/u.test(e[o]??"");)o+=1;return{next:o,token:{kind:"identifier",value:e.slice(t,o),offset:t}}}let n=e.startsWith("=>",t)?"=>":r;return{next:t+n.length,token:{kind:"punctuator",value:n,offset:t}}}function Dy(e){let t=[],r=0;for(;r<e.length;){let n=Ny(e,r);if(n!==void 0){r=n;continue}let o=Ly(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=$y(e,r);i.token&&t.push(i.token),r=i.next}return t}var Fy=new Set(["object","block","pattern"]),Gy=new Set(["const","let","var"]),Uy=new Set(["}",")","]"]),jy=new Set(["=","(","[",",",":","?","return"]);function By(e,t,r){if([...r].reverse().find(i=>Fy.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Gy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&jy.has(o.value)?"object":"block"}function zy(e,t,r){let n=e[t];if(n.value==="{"){let a=By(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(n.value==="[")return{kind:"array"};if(n.value!=="(")return;let o=e[t-1],i=e[t-2];return{kind:"paren",...o?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function qy(e,t,r){if(!(e?.kind!=="object"||!e.member_start||t.kind!=="identifier"&&t.kind!=="string"||r?.value!==":"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(t.value)))return{field:t.value,offset:t.offset}}function Hy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Vy(e){let t=Dy(dn.stripTypeScriptTypes(e,{mode:"strip"})),r=[],n=[];for(let[o,i]of t.entries()){let s=n.at(-1),a=qy(s,i,t[o+1]);a&&s.candidates.push(a);let c=zy(t,o,n);if(c)n.push(c);else if(Uy.has(i.value)){let d=n.pop();d?.kind==="object"&&!Hy(t,o)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function Ky(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
|
|
32
|
+
`&&t.push(r+1);return t}function Wy(e,t){let r=0,n=e.length;for(;r<n;){let o=Math.floor((r+n)/2);e[o]<=t?r=o+1:n=o}return r}function Z$(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>Q(i.path,s.path))){let i=Ky(o.content),s;try{s=Vy(o.content)}catch(a){r.push({kind:"invalid_source",subject:o.path,detail:`${o.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=Wy(i,a.offset),p=pn(c);p?t.push({path:o.path,line:d,field:c,kind:p.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${o.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let n=Object.fromEntries(ce.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of ce)n[o]===0&&r.push({kind:"missing_kind_producer",subject:o,detail:`No source producer emits the ${o} recovery-reference kind.`});return t.sort((o,i)=>o.path!==i.path?Q(o.path,i.path):o.line!==i.line?o.line-i.line:Q(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?Q(o.subject,i.subject):Q(o.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:n,producers:t,findings:r}}function eD(e,t){let r=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,a)=>n(s,[...i,String(a)]));return}if(!(typeof o!="object"||o===null))for(let[s,a]of Object.entries(o).sort(([c],[d])=>Q(c,d))){let c=pn(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,p=[a].flat();d!==void 0&&p.forEach((l,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,_=g&&typeof l=="object"&&l!==null&&!Array.isArray(l)?l[g]:l;if(typeof _!="string"||_.trim().length===0)return;let y=[...i,s,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${d.kind}:${y}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:_})}),n(a,[...i,s])}};return n(t,[]),r}function tD(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),n=[],o=new Map;for(let s of t){if(o.has(s.probe_id)){n.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}o.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=o.get(a.probe_id);if(!c){n.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&n.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&n.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||n.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||n.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return n.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:n.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:n}}function rD(e,t){let r=[],n=new Set,o=new Set;for(let c of e){if(n.has(c.id)){o.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}n.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),n.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(o.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=ce.map(c=>{let d=e.filter(l=>l.kind===c),p=d.filter(l=>!o.has(l.id)).map(l=>i.get(l.id)).filter(l=>l!==void 0);return{kind:c,declared:d.length,observed:p.length,passed:d.filter(l=>{let f=i.get(l.id);return!o.has(l.id)&&f?.reachable===!0&&f.semantics===l.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:n.size===0?1:a/n.size,coverage_by_kind:s,findings:r}}function Yy(e,t){let r=new Map(ce.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=ce.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),o=n.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&o.length===0,source_producer_count:e.producer_count,runtime_value_count:n.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:n,missing_runtime_kinds:o}}var nD=Yy;var iD=16,Xy=Object.freeze(["bulk_ids_input_empty","bulk_ids_input_missing_path","bulk_ids_input_unreadable","invalid_argument_value","missing_lifecycle_target","missing_required_argument","projection_options_mutually_exclusive","tracker_not_initialized","tracker_root_missing","tracker_root_not_directory","tracker_root_unreadable","unknown_context_intent","unknown_field_projection","unknown_option","unknown_subcommand"]),ln=18,un=Object.freeze([...Xy,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function sD(e,t=ln){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function aD(e,t=un){let r=new Set(e.rows.filter(({disposition:o})=>o==="executable").map(({canonical_code:o})=>o)),n=t.filter(o=>!r.has(o));return{ok:n.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:n}}function mt(e,t){let r=e.get(t);if(r)return r;let n={kinds:new Set,probeIds:new Set};return e.set(t,n),n}function cD(e,t,r){let n=new Map(e.map(p=>[p.code,p.canonical_code??p.code])),o=new Map,i=0,s=0;for(let p of e){let l=mt(o,p.canonical_code??p.code);for(let f of p.owned_states??[])l.kinds.add("owned_state"),l.probeIds.add(f.probe_id)}for(let p of t){let l=n.get(p.error_code);if(l===void 0)continue;i+=1;let f=mt(o,l);f.kinds.add("closed_domain"),f.probeIds.add(p.probe_id)}for(let p of r){let l=n.get(p.error_code);if(l===void 0)continue;s+=1;let f=mt(o,l);f.kinds.add("grammar"),f.probeIds.add(p.probe_id)}let a=e.map(p=>{let l=p.canonical_code??p.code,f=o.get(l),g=[...f.probeIds].sort();return{code:p.code,canonical_code:l,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((p,l)=>p.code<l.code?-1:1),c=a.filter(({disposition:p})=>p==="uncovered").map(({code:p})=>p),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function dD(e){let t=e.rows.map(r=>`| \`${r.code}\` | \`${r.canonical_code}\` | ${r.disposition} | ${r.evidence_kinds.join(", ")||"none"} | ${r.probe_ids.length} |`);return["# Generated refusal closure census","","Tracker: `pm-f05lsg`.","","Every catalog code is listed. An `uncovered` row is an explicit closure obligation, never an omission or implied approval.","",`- Catalog error codes: ${e.catalog_error_code_count}`,`- Executable error codes: ${e.executable_error_code_count}`,`- Executable-code ratchet floor: ${ln}`,`- Required executable canonical codes: ${un.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
|
|
33
|
+
`)}function Jy(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function Qy(e){return[e.exit_code!==ue.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${ue.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...Jy(e)]}function uD(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of Qy(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/r.size,findings:t}}var mn="not-a-declared-action";function Zy(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function de(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function TD(e=je.filter(t=>Pt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>de(r)));return e.flatMap(r=>r.slots.flatMap((n,o)=>{if(!n.required)return[];let i=r.command.split(" "),s=de(r.command),a=i.length>1&&t.has(s)?i.map(de).join("--"):s,c=Z(r.command).flatMap(p=>p.required?[p.flag,...p.value_name?["example"]:[]]:[]),d=Ue.some(p=>p.command===r.command);return[{probe_id:`required-argument-${a}-${de(n.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,o).map(p=>Zy(r.command,p)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:n.name,missing_argument_index:o}]})).sort((r,n)=>r.probe_id.localeCompare(n.probe_id))}function eS(e){switch(N(e)){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ne;case"merge":return Le;case"plan":return Ke;case"profile":return We;case"schema":return Dt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function ED(e=je){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${de(t)}`,command:t,refusal_args:[...r,mn],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:mn,allowed_values:[...eS(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function tS(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function rS(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!tS(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function AD(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>rS(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:o}}var ft=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function bD(){return ft.map(e=>({...e}))}function nS(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function wD(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of ft){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=nS(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:ft.length,closed_probe_count:n,findings:r}}var Re,oS=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function iS(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=oS[N(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Pe(){if(Re!==void 0)return Re;let t=ee.filter(({command:i})=>Be(i)).flatMap(({command:i,family:s})=>Mt(i,Z(i)).map(a=>({command:i,family:s,concept:iS(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return Re=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Re}function vD(){return Object.freeze(Pe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var fn=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:104,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":28,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:41,docs:32,deps:32,plan:111,test:58,"test-all":41,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:40,release:25,"start-task":24,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),sS=1,_n=Object.freeze(Object.fromEntries(Object.entries({...fn,...Object.fromEntries(ve.flatMap(({alias:e,canonical:t})=>{let r=fn[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+sS])));function hn(){let e=new Map(Object.keys(_n).map(t=>[t,0]));for(let{command:t}of Pe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(_n).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function aS(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function cS(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function dS(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function kD(e=Pe(),t=hn(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let p=i.get(c.concept);p!==void 0&&p!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${p} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let l=s.get(c.concept);l!==void 0&&l!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${l} and ${c.flag}.`}):s.set(c.concept,c.flag)}return aS(e,o,n),cS(a,t,n),dS(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function ND(){let e=Pe(),t=hn(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
|
|
34
|
+
`)}function $D(e){return e}function DD(e){return e}function FD(e){return e}function GD(e){return e}function UD(e){return e}function jD(e){return e}function BD(e){return e}function zD(e){return e}function qD(e){return e}function HD(e){return e}function VD(e){return e}function KD(e){return e}function WD(e){return e}function YD(e){return{handled:!0,result:e}}function XD(){return{handled:!1}}function JD(e){return e}function QD(e){return e}function ZD(e){return e}function eF(e){return e}function tF(e){return e}function rF(e){return e}function nF(e){return e}function oF(e){return e}function iF(e){return e}function pS(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function lS(e={},t={}){return new _e(t).packageMigrate(e)}function k(e){if(typeof e!="string"||!At(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function uS(e){let t=k(e.window_start),r=k(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(n=>typeof n!="string"||n.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function mS(e,t,r,n){let o=new Map(t.map(s=>[s,[]])),i=new Set;for(let s of e){if(typeof s.id!="string"||s.id.trim().length===0||i.has(s.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");i.add(s.id);let a=o.get(s.family);if(!a||!["success","failure","pending"].includes(s.outcome)||s.cause!==void 0&&(!["product","infrastructure","unknown"].includes(s.cause)||s.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let c=k(s.started_at);if(s.repaired_at!==void 0&&(k(s.repaired_at)<c||s.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");c>=r&&c<n&&a.push(s)}return o}function xF(e,t){let{start:r,end:n}=uS(t),i=[...mS(e,t.families,r,n)].map(([s,a])=>{let c=a.filter(_=>_.outcome==="failure"),d=a.filter(_=>_.outcome!=="pending").length,p=d===0?null:c.length/d,l=c.filter(_=>_.repaired_at!==void 0&&k(_.repaired_at)<n),f={product:0,infrastructure:0,unknown:0};for(let _ of c)f[_.cause??"unknown"]+=1;let g=[];return d<t.min_completed_attempts&&g.push("insufficient_completed_attempts"),p!==null&&p>t.max_failure_rate&&g.push("failure_rate"),{family:s,attempts:a.length,completed:d,failed:c.length,pending:a.length-d,failure_rate:p,affected_days:[...new Set(c.map(_=>new Date(k(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(k(_.repaired_at)-k(_.started_at))/6e4).sort((_,y)=>_-y),unresolved:c.length-l.length,causes:f,violations:g,ok:g.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(n).toISOString(),ok:i.every(s=>s.ok),families:i}}function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function fS(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let n=new Set(r.identities);if(n.size!==r.identities.length||[...n].some(o=>!pe(o)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,n)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function _S(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let n of e){if(n===null||typeof n!="object"||!pe(n.identity)||r.has(n.identity)||!pe(n.reason)||!pe(n.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let o=n.missing_from;if(!Array.isArray(o)||o.length===0||o.length>=t.length||new Set(o).size!==o.length||[...o].some(i=>!t.includes(i)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(n.identity,n)}return r}function wF(e,t=[]){let r=fS(e),n=[...r.keys()].sort(),o=_S(t,n),i=[...new Set([...r.values()].flatMap(d=>[...d]))].sort(),s=[],a=new Set;for(let d of i){let p=n.filter(g=>!r.get(g).has(d));if(p.length===0)continue;let l=o.get(d),f=l!==void 0&&JSON.stringify([...l.missing_from].sort())===JSON.stringify(p);f&&a.add(d),s.push({identity:d,present_in:n.filter(g=>r.get(g).has(d)),missing_from:p,disposition:f?{reason:l.reason,evidence:l.evidence}:null})}let c=[...o.keys()].filter(d=>!a.has(d)).sort();return{schema:"pm-artifact-ledgers/1",ok:s.every(d=>d.disposition!==null)&&c.length===0,counts:Object.fromEntries(n.map(d=>[d,r.get(d).size])),findings:s,stale_exceptions:c}}import{createHash as Cn,createHmac as hS,randomBytes as gS,timingSafeEqual as CS}from"node:crypto";var p1="dev.unbrained.pm/progressive-tool-discovery",l1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),yS=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),SS=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),yn={core:0,standard:1,full:2,internal:3},Sn=Object.freeze(["core","standard","full"]),TS=new Set(["core","standard","full","custom"]),Tn=new Set(ee.map(({family:e})=>e)),ES=gS(32);function Ie(e,t){if(typeof e!="string")throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),n=0;for(let o=r.next();!o.done;o=r.next())if(n+=1,n>4096)throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function En(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new S("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function An(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new S("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function xn(e){if(e!==void 0&&typeof e!="boolean")throw new S("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function bn(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new S("pm tool discovery options must be an object.",64)}function AS(e){if(!Array.isArray(e))throw new S("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new S(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new S(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new S(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new S(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new S(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function u1(e){if(bn(e),e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ie(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:En(e.limit)}:{},...e.cursor!==void 0?{cursor:Ie(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:xn(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:An(e.outputBudget)}:{}}}function xS(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function le(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function bS(e,t){let r=le(e);if(r.length===0)return 0;let n=new Set(le(t)),o=r.filter(s=>n.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,o/r.length+i)}function wS(e,t){let r=le(e);if(r.length===0)return 0;let n=t.toLowerCase(),o=le(t),i=r.filter(a=>o.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=n.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function gn(e){return Cn("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function wn(e,t,r){return hS("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function OS(e,t,r){let n={version:1,offset:t,signature:wn(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function RS(e,t,r,n){if(e===void 0)return 0;try{let o=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),i=o.offset;if(o.version!==1||typeof i!="number"||!Number.isInteger(i)||i<0||i>r||typeof o.signature!="string")throw new Error("cursor fields do not match the request");let s=Buffer.from(wn(t,i,n),"base64url"),a=Buffer.from(o.signature,"base64url");if(a.length!==s.length||!CS(a,s))throw new Error("cursor signature does not match the request");return i}catch(o){throw new S("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(o)})}}function _t(e,t,r){return{value:xS(e),weight:t,available:r!=="unavailable",source:r}}function Me(e,t,r){return _t(e??t,r,e===void 0?"computed":"host")}function PS(e,t,r){let n=Object.hasOwn(fe,e.name)?fe[e.name]:"help",o=qe(n),i=`${e.name} ${e.description} ${n} ${o}`,s=bS(t,i),a=new Set(le(t)),c={lexical:_t(s,j.lexical,"computed"),semantic:Me(e.signals?.semantic,wS(t,i),j.semantic),graph:Me(e.signals?.graph,a.has(o)||a.has(n)?1:0,j.graph),permission:_t(1,j.permission,"authorization"),freshness:Me(e.signals?.freshness,1,j.freshness),usage:Me(e.signals?.usage,yS.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((p,l)=>p+l.value*l.weight,0);return{name:e.name,description:e.description,command:n,tier:He(n),family:o,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function MS(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new S("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!TS.has(e.profile)))throw new S("pm tool discovery profile must be core, standard, full, or custom.",64)}function IS(e){let r=Ie(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ie(e.cursor===void 0?"":e.cursor,"cursor");let n=En(e.limit===void 0?10:e.limit),o=An(e.outputBudget===void 0?1200:e.outputBudget);return MS(e),{query:r,includeSchema:xn(e.includeSchema),limit:n,budget:o,maximumTier:yn[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function On(e,t,r){let n=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),o={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...o,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+n)/4);if(c===i)break;i=c}return i}function vS(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>PS(n,r.query,r.includeSchema)).filter(n=>n.tier!=="internal"&&yn[n.tier]<=r.maximumTier&&(t.family===void 0||n.family===t.family)).sort((n,o)=>o.score-n.score||(n.name<o.name?-1:n.name>o.name?1:0))}function kS(e,t,r){if(t==="unbounded")return[...e];let n=[],o=0;for(let[i,s]of e.entries()){let a=o+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(On(r(i+1),t,a)>t)break;n.push(s),o=a}return n}function m1(e,t={}){AS(e),bn(t);let r=IS(t),n=t.cursorIntegrityKey??ES,o=vS(e,t,r),i=gn({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:o}),s=RS(t.cursor,i,o.length,n),a=o.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<o.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:o.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:j},cache:{key:gn({fingerprint:i,cursorIntegrityKey:Cn("sha256").update(n).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:SS}},p=(_,y=_.length)=>{let E=s+y,B=E<o.length,O=[...c];return y<a.length&&O.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[..._],returned:y,has_more:B,...B?{next_cursor:OS(i,E,n)}:{},omission_receipt:{has_omissions:O.length>0,omitted:O}}},l=_=>{let y=p(_),E=On(y,r.budget);return{...y,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=kS(a,r.budget,_=>p([],_)),g=l(f);if(a.length>0&&f.length===0){let _=l([a[0]]).token_cost.estimated_tokens;throw new S(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${_}.`,64,{required:String(_)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new S(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}export{iR as ACTIONABILITY_ORDERING_KINDS,Xc as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,mc as ACTIVITY_FLAG_CONTRACTS,Xo as AGENT_PROVENANCE_DIMENSIONS,Js as AGGREGATE_FLAG_CONTRACTS,Da as APPEND_FLAG_CONTRACTS,YI as ASSURANCE_ACTIONS,XI as ASSURANCE_DECLARATION_KINDS,sM as ASSURANCE_DOCUMENT_VERSION,nc as ASSURANCE_FLAG_CONTRACTS,aM as ASSURANCE_GATE_TRIGGERS,cM as ASSURANCE_MEASUREMENT_SOURCE_KINDS,ZM as ASSURANCE_PRESET_IDS,rM as AssuranceEvaluationRefusalError,tM as AssuranceMutationRefusalError,nM as AssuranceSourceResolutionError,Lo as BASELINE_ITEM_FORMAT_VERSION,oP as BOUNDARY_FIXTURE_CAPTURE_SOURCES,DR as BRIEF_LIST_FIELDS,Qo as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,Jo as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,po as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,Lx as BUILTIN_RELATIONSHIP_KINDS,Kc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,uc as CALENDAR_FLAG_CONTRACTS,Fa as CLAIM_FLAG_CONTRACTS,jd as CLOSE_ACTION_OPTION_KEYS,La as CLOSE_FLAG_CONTRACTS,$a as CLOSE_MANY_FLAG_CONTRACTS,qa as CLOSE_TASK_FLAG_CONTRACTS,Qs as COMMENTS_FLAG_CONTRACTS,hT as COMMON_MUTATION_COMMAND_OPTION_KEYS,bc as COMPLETION_FLAG_CONTRACTS,ho as CONFIDENCE_TEXT_VALUES,ma as CONFIG_FLAG_CONTRACTS,Wc as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,Nv as CONTEXT_EVALUATION_METRIC_NAMES,_c as CONTEXT_FLAG_CONTRACTS,ZA as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,zt as CONTEXT_OUTPUT_VALUES,Gv as CONTEXT_PACKING_PROFILES,wv as CONTEXT_RECENCY_EPOCH,Mv as CONTEXT_RELEVANCE_SERVICE,Rv as CONTEXT_RELEVANCE_SIGNAL_NAMES,Bv as CONTEXT_SIGNAL_SET_VERSION,jv as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,zv as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,BA as CONTEXT_USAGE_LIMITS,xc as CONTRACTS_FLAG_CONTRACTS,cc as COPY_FLAG_CONTRACTS,fd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,hd as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,_d as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,FS as CREATE_DIRECT_CLOSE_REASON_DEFAULT,oc as CREATE_FLAG_CONTRACTS,tE as CURRENT_HISTORY_HASH_ALGORITHM,Tx as CURRENT_HISTORY_ITEM_HASH_VERSION,Ax as CURRENT_HISTORY_RECORD_HASH_VERSION,$o as CURRENT_ITEM_FORMAT_VERSION,Kv as ContextSignalStore,zA as ContextUsageValidationError,yv as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,pk as DEFAULT_CHILD_SAMPLE_LIMIT,$R as DEFAULT_COMPACT_LIST_FIELDS,Gw as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Pf as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,YM as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,pv as DEFAULT_TERMINAL_TRANSITION_POLICY,Jv as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,pP as DEFECT_ESCAPE_CLASSES,lP as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ua as DELETE_FLAG_CONTRACTS,mo as DEPENDENCY_KIND_VALUES,Cc as DEPS_FLAG_CONTRACTS,ra as DOCS_FLAG_CONTRACTS,ec as DUPLICATES_FLAG_CONTRACTS,OI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,_P as DefectRecurrencePolicyParseError,Sc as EVAL_FLAG_CONTRACTS,Ef as EVAL_METRIC_NAMES,wf as EVAL_QUERY_SET_CONTRACT,Of as EVAL_QUERY_SET_EXAMPLE,bf as EVAL_QUERY_SET_SCHEMA_ID,fc as EVENTS_FLAG_CONTRACTS,Va as EVENT_FLAG_CONTRACTS,$n as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,xa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Aa as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Ia as EXTENSION_ADOPT_FLAG_CONTRACTS,jk as EXTENSION_CAPABILITIES,$S as EXTENSION_CAPABILITY_CONTRACT,NS as EXTENSION_CAPABILITY_CONTRACT_VERSION,LS as EXTENSION_CAPABILITY_LEGACY_ALIASES,ji as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Ma as EXTENSION_CATALOG_FLAG_CONTRACTS,ba as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ea as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Pa as EXTENSION_DOCTOR_FLAG_CONTRACTS,Ta as EXTENSION_EXPLORE_FLAG_CONTRACTS,fa as EXTENSION_FLAG_CONTRACTS,ha as EXTENSION_INIT_FLAG_CONTRACTS,ya as EXTENSION_INSTALL_FLAG_CONTRACTS,Oa as EXTENSION_MANAGE_FLAG_CONTRACTS,wa as EXTENSION_MIGRATE_FLAG_CONTRACTS,Bk as EXTENSION_POLICY_MODES,zk as EXTENSION_POLICY_SURFACES,Ra as EXTENSION_RELOAD_FLAG_CONTRACTS,Hk as EXTENSION_SANDBOX_PROFILES,_a as EXTENSION_SCOPE_FLAG_CONTRACTS,qk as EXTENSION_TRUST_MODES,Sa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,OP as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,bP as EXTERNAL_DEPENDENCY_SOURCE_KIND,wP as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,_O as ExtensionCommandError,ta as FILES_FLAG_CONTRACTS,dc as FOCUS_FLAG_CONTRACTS,Qa as GC_FLAG_CONTRACTS,jR as GET_DEPTH_INPUT_VALUES,UR as GET_DEPTH_VALUES,hc as GET_FLAG_CONTRACTS,Ys as GLOBAL_FLAG_CONTRACTS,nu as GRAPH_DURABLE_CACHE_MIN_ITEMS,ru as GRAPH_DURABLE_CACHE_VERSION,yc as GRAPH_FLAG_CONTRACTS,LR as GRAPH_QUERY_DEFAULTS,Ne as GRAPH_SUBCOMMAND_VALUES,gc as GUIDE_FLAG_CONTRACTS,tc as HEALTH_FLAG_CONTRACTS,aa as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HM as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,tv as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ca as HISTORY_COMPACT_FLAG_CONTRACTS,ui as HISTORY_EVENT_CLASSIFICATION_VERSION,na as HISTORY_FLAG_CONTRACTS,ZT as HISTORY_HASH_ALGORITHMS,Ow as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,ia as HISTORY_REDACT_FLAG_CONTRACTS,sa as HISTORY_REPAIR_FLAG_CONTRACTS,Gp as INIT_AGENT_GUIDANCE_MODE_VALUES,ua as INIT_FLAG_CONTRACTS,va as INSTALL_FLAG_CONTRACTS,dI as IN_PROGRESS_WORK_DETAIL_LIMIT,_o as ISSUE_SEVERITY_VALUES,sc as ITEM_COMPLETE_FLAG_CONTRACTS,CI as ITEM_LATEST_TIMESTAMP_FIELDS,DS as ITEM_METADATA_KEY_ORDER,ic as ITEM_MUTATE_FLAG_CONTRACTS,ac as ITEM_REOPEN_FLAG_CONTRACTS,Ds as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,$s as ITEM_REVISION_CONFLICT_CODE,lI as ITEM_SCALAR_MISSING_VALUE,lo as ITEM_TYPE_VALUES,gI as ITEM_UNION_COLLECTION_FIELDS,Vv as JsonFileContextSignalStoreAdapter,ea as LEARNINGS_FLAG_CONTRACTS,eE as LEGACY_HISTORY_HASH_ALGORITHM,sl as LINKED_ARTIFACT_NOTE_CONFLICT_MODES,zu as LINKED_TEST_ENV_NAME_PATTERN,qu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Bu as LINKED_TEST_PROTECTED_ENV_KEYS,Hu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Hc as LIST_COMMANDER_STRING_OPTION_CONTRACTS,FR as LIST_COMMAND_DEFAULT_PROJECTIONS,Kk as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Xs as LIST_FILTER_FLAG_CONTRACTS,LP as LIST_SORT_FIELDS,$P as LIST_SORT_ORDER_VALUES,mi as MAINTENANCE_HISTORY_OPERATIONS,dk as MAX_CHILD_PROJECTION_ITEMS,iP as MAX_WAIVER_NOTICE_DAYS,qS as MAX_WORKFLOW_POLICIES,HS as MAX_WORKFLOW_POLICY_TERMS,Ha as MEET_FLAG_CONTRACTS,Mk as MERGE_DRIVER_ARTIFACT_VALUES,oa as MERGE_FLAG_CONTRACTS,Le as MERGE_SUBCOMMAND_VALUES,kk as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,Yc as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Ec as NEXT_FLAG_CONTRACTS,qm as NEXT_OUTPUT_VALUES,Cv as NEXT_RANKING_POLICIES,Zs as NOTES_FLAG_CONTRACTS,TR as OutputEnvelopeFitError,ga as PACKAGE_FLAG_CONTRACTS,Ca as PACKAGE_INIT_FLAG_CONTRACTS,za as PAUSE_TASK_FLAG_CONTRACTS,Ud as PLAN_CREATE_METADATA_PARAMETER_KEYS,la as PLAN_FLAG_CONTRACTS,Hs as PLAN_SHOW_DEPTH_VALUES,Ke as PLAN_SUBCOMMANDS,ef as PLAN_TEMPLATE_NAMES,wy as PM_AGENT_TASK_ACCOUNTING_MODES,pt as PM_AGENT_TASK_TRANSCRIPT_VERSION,vn as PM_BULK_LIFECYCLE_COMMAND_ALIASES,is as PM_CLI_ERROR_DETAILS_LIMITS,ls as PM_CLI_EXPECTED_ERROR_NAME,WR as PM_CLI_GRAMMAR_CONTRACT,zR as PM_CLI_GRAMMAR_NOUNS,Yn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,qR as PM_CLI_SHARED_VERBS,Ln as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Pt as PM_COMMAND_DESTINATION_CONTRACTS,XP as PM_COMMAND_EXIT_CONTRACTS,YP as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,bi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,VP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,je as PM_COMMAND_POSITIONAL_CONTRACTS,cp as PM_COMMAND_VISIBILITY_CONTRACTS,GM as PM_COMPLETE_LIST_FINDING_CODES,mR as PM_CONTEXT_INTENTS_FILE,ex as PM_CONTEXT_INTENT_CONTRACTS,In as PM_CONTEXT_OPS_COMMAND_ALIASES,Hn as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Jn as PM_DEPRECATED_TOOL_ACTIONS,Si as PM_DIAGNOSTIC_DEGRADATION_STEPS,Ti as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,yi as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qn as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,qP as PM_ERROR_CODE_CATALOG,UP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,tn as PM_EXACT_COVERAGE_METRICS,Gn as PM_EXTENSION_CAPABILITY_CONTRACTS,Vn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,jn as PM_EXTENSION_POLICY_MODE_CONTRACTS,qn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,zn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Un as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Bn as PM_EXTENSION_TRUST_MODE_CONTRACTS,Ii as PM_GENERIC_REFUSAL_GUIDANCE,MM as PM_GITATTRIBUTES_END,PM as PM_GITATTRIBUTES_START,vM as PM_GITATTRIBUTES_V2_END,IM as PM_GITATTRIBUTES_V2_START,hp as PM_GITIGNORE_END,_p as PM_GITIGNORE_START,iv as PM_HISTORY_ATTESTATION_CONTRACT,Mn as PM_HISTORY_COMMAND_ALIASES,KT as PM_HISTORY_OPERATION_ALIASES,YT as PM_HISTORY_OPERATION_CONTRACT,WT as PM_HISTORY_OPERATION_PATTERNS,Wn as PM_ITEM_ACTION_SUBCOMMANDS,HT as PM_ITEM_HISTORY_OPERATIONS,nt as PM_MCP_APPS_EXTENSION,vr as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,Lr as PM_MCP_APP_CONTRACTS,Nr as PM_MCP_APP_MIME_TYPE,yS as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,cL as PM_MCP_HTTP_PROTOCOL_VERSION,Bg as PM_MCP_INPUT_REQUEST_METHODS,or as PM_MCP_LEGACY_PROTOCOL_VERSIONS,nr as PM_MCP_LOG_LEVELS,x as PM_MCP_META_KEYS,p1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,l1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,mp as PM_MCP_PROMPT_CONTRACTS,q as PM_MCP_PROTOCOL_VERSION,up as PM_MCP_RESOURCE_CONTRACTS,it as PM_MCP_SKILLS_DRAFT_REVISION,$r as PM_MCP_SKILLS_EXTENSION,WC as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Te as PM_MCP_SUBSCRIPTION_ID_META_KEY,te as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,eL as PM_MCP_TASKS_EXTENSION,Zg as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,LE as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,_s as PM_MUTATION_ACTION_CONTRACTS,ve as PM_NAMESPACED_COMMAND_ALIASES,Kr as PM_OBSERVATION_SCHEMA,Ci as PM_OUTPUT_BUDGET_CLASSES,gi as PM_OUTPUT_DEGRADATION_STEPS,Nt as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Kn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ft as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,Wd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Vd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,uA as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,PA as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,pA as PM_READ_OUTPUT_DIMENSIONS,lA as PM_READ_OUTPUT_OPTION_FLAGS,iA as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,oA as PM_READ_OUTPUT_SESSION_MIN_TOKENS,IE as PM_READ_OUTPUT_SURFACES,mA as PM_READ_OUTPUT_SURFACE_CONTRACTS,tA as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,NE as PM_READ_ROW_CONTRACTS,kE as PM_READ_ROW_JQ_SELECTOR,Li as PM_RECOVERY_ECHO_FIELDS,Q$ as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,Xy as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,un as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,iD as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,ln as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,kn as PM_RELOCATED_COMMAND_ALIASES,pd as PM_REPRODUCIBLE_PROCESS_ENV,JP as PM_SUCCESS_EXIT_CODES,Xn as PM_TOOL_ACTIONS,Bd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Kd as PM_TOOL_PARAMETERS_SCHEMA,Hd as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,qd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Fd as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Wr as PM_VERDICT_SCHEMA,VT as PM_WORKSPACE_HISTORY_OPERATIONS,Hr as PM_WORKSPACE_RECIPE_SCHEMA,pa as PROFILE_FLAG_CONTRACTS,Zt as PROFILE_LINT_CODES,Qt as PROFILE_LINT_DIMENSIONS,Ht as PROFILE_NAMES,We as PROFILE_SUBCOMMANDS,S as PmCliError,_e as PmClient,UM as PmCompleteListValidationError,C as PmMcpAuthorizationError,ir as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,sr as PmMcpRequestStateReplayGuard,Br as PmMcpSkillRegistry,gr as PmMcpSubscriptionRegistry,tt as PmMcpTaskStore,jA as QUERY_CURSOR_CONTRACT,hA as READ_OUTPUT_MUTATION_CONFLICT_CODE,gA as READ_OUTPUT_SHAPING_CONTROL_FLAGS,_A as READ_OUTPUT_SURFACE_UNSUPPORTED_CODE,Na as REINDEX_FLAG_CONTRACTS,yw as REINDEX_LOCK_ID,dt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,ja as RELEASE_FLAG_CONTRACTS,Ka as REMIND_FLAG_CONTRACTS,bt as RESERVED_ITEM_FIELD_NAMES,Ga as RESTORE_FLAG_CONTRACTS,fo as RISK_VALUES,AR as RelationshipEventLog,xR as RelationshipEventStore,z as RelationshipGraph,Ge as RelationshipKindRegistry,da as SCHEMA_FLAG_CONTRACTS,Vc as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,Wk as SEARCH_EXTENSION_FLAG_DEFINITIONS,Ac as SEARCH_FLAG_CONTRACTS,Cs as SECRET_GUARD_RULE_CATEGORIES,dm as SEMANTIC_ATTRIBUTION_LIMITS,US as SETTINGS_DEFAULTS,Nf as SNAPSHOT_SCHEMA,wM as SOURCE_CONTEXT_ACCESS_ENV,OM as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Vm as STALE_CLAIM_TAKEOVER_REFUSED_CODE,Ps as STALE_WORK_THRESHOLD_SETTING,fm as START_BLOCKED_REFUSAL_CODE,mm as START_BLOCKER_ENFORCEMENT_DEFAULT,Ba as START_TASK_FLAG_CONTRACTS,Za as STATS_FLAG_CONTRACTS,uo as STATUS_VALUES,Ws as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,fi as SUBSTANTIVE_HISTORY_OPERATIONS,Ex as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,xx as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,RE as SUPPRESS_HOST_OUTPUT_MARKER,Xa as TELEMETRY_FLAG_CONTRACTS,c_ as TELEMETRY_SUBCOMMANDS,Ya as TEST_ALL_FLAG_CONTRACTS,Wa as TEST_FLAG_CONTRACTS,Ja as TEST_RUNS_FLAG_CONTRACTS,n_ as TEST_RUN_MEASUREMENT_LIMIT,Nd as TOOL_ACTIVITY_OPTION_CONTRACTS,Ed as TOOL_AGGREGATE_OPTION_CONTRACTS,Md as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,kd as TOOL_CALENDAR_OPTION_CONTRACTS,vd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Ld as TOOL_CONTEXT_OPTION_CONTRACTS,Od as TOOL_CREATE_OPTION_CONTRACTS,wd as TOOL_CREATE_OPTION_CONTRACT_SOURCE,$d as TOOL_DEPS_OPTION_CONTRACTS,Dd as TOOL_GRAPH_OPTION_CONTRACTS,Td as TOOL_LIST_FILTER_OPTION_CONTRACTS,Ad as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,bd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,xd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Id as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Pd as TOOL_UPDATE_OPTION_CONTRACTS,Rd as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,GS as TYPE_TO_FOLDER,zT as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,MO as UNPROVEN_ACTIVITY_REASONS,gd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,yd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Cd as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,pc as UPDATE_FLAG_CONTRACTS,lc as UPDATE_MANY_FLAG_CONTRACTS,ka as UPGRADE_FLAG_CONTRACTS,wo as URL_CREDENTIAL_PLACEHOLDER,rc as VALIDATE_FLAG_CONTRACTS,zS as WORKFLOW_POLICY_ACTIONS,LM as WORKFLOW_POLICY_DOCUMENT_SCHEMA,NM as WORKFLOW_POLICY_SCHEMA,Tc as WORKSPACE_FLAG_CONTRACTS,Fb as WORKSPACE_HISTORY_ID,Lf as WORKSPACE_SNAPSHOT_ACTIONS,rl as WorkspaceGraphCache,PR as WorkspaceTransactionInterruptedError,vu as _testOnly,ck as _testOnlyAggregateCommand,el as _testOnlyConfigCommand,fk as _testOnlyGetCommand,Cu as _testOnlyHealthCommand,zp as _testOnlyInit,Up as _testOnlyInitAgentGuidance,dN as _testOnlyItemTransaction,Dk as _testOnlyMutationEvents,ik as _testOnlyNextCommand,Pk as _testOnlySearchCommand,JM as _testOnlySimilarity,sf as _testOnlyTemplates,Pu as _testOnlyValidateCommand,Uk as _testOnlyWorkspacePosition,lN as abandonItemTransaction,NR as abandonWorkspaceTransaction,nI as acceptAssuranceProposals,Ou as acknowledgeLinkedTests,Jp as acknowledgeUnknownAuthorHistoryEvents,Xp as acknowledgeUnknownAuthorHistoryEventsFromTransport,Uw as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,Yo as acquireLockLease,BN as activateExtensionForTest,tb as activateExtensions,hm as admitStartWithOpenBlockers,Wo as agentSessionEnvironment,dh as aggregate,Vf as analyzeAgentProvenanceDescriptorCoverage,mP as analyzeDefectChangeRisk,WI as analyzeDefectRecurrenceCoverage,Pl as analyzeDuplicateItems,wR as analyzeGraphImpact,Qd as analyzeHierarchyIntegrity,OR as analyzeKnowledgeGraph,ZP as analyzePmCommandExitConformance,Zn as analyzePmToolActionParity,LI as analyzeReconciliationDiscard,bR as analyzeRelationshipExecution,Wl as analyzeRelationshipSchedule,Ng as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,CA as annotationPositionalMutationOptions,Th as append,Fi as appendHistoryEntry,Bb as appendWorkspaceAuditEvent,jb as appendWorkspaceHistoryChange,rT as applyAcceptanceCriteriaMutations,tI as applyAssurancePreset,Fc as applyBootstrapPagerPolicy,zI as applyClosureTimestampFix,ix as applyContextIntentProjection,zm as applyContextTagProjection,DP as applyFilterValueEcho,Aw as applyHistoryPatch,dd as applyInvocationAuthorOverride,_l as applyPathMigrations,bA as applyReadOutputDimensions,TA as applyReadOutputIncludeModes,aA as applyReadOutputSessionReferences,Ob as applyRegisteredItemFieldDefaultsAndValidation,yl as applyStandaloneNote,Ic as applyStoredExtensionMigrationState,oT as applyTagRemovals,fv as applyTerminalOrderingPolicy,Sl as artifactKey,IT as asRecordClone,MT as asRecordOrNull,ze as assembleWorkspaceRelationshipGraph,qM as assertCompleteListResult,E0 as assertExtensionBlueprint,T0 as assertExtensionCapabilityUsage,n0 as assertExtensionDeactivated,b0 as assertExtensionManifestCompatible,x0 as assertExtensionManifestMatchesBlueprint,w0 as assertExtensionPreflight,tp as assertHierarchyMutationAllowed,rv as assertHistoryCompactTarget,DI as assertHistoryRepairTarget,es as assertInitializedTracker,hl as assertLinkedArtifactMutationIsUnambiguous,I0 as assertMcpClientCapabilities,M0 as assertMcpProtocolHeader,by as assertMemoryRelationshipGraphAdapterConformance,aT as assertNoUnknownCsvKeys,Uu as assertNonHierarchyCardinalityMutationAllowed,o0 as assertPackageManifest,Jb as assertParentReferenceIsNotSelf,FL as assertPmMcpSkillsCapability,A0 as assertProjectProfile,Lw as assertProjectRuntimeCompatibility,Iw as assertProjectRuntimeFormatGuard,$E as assertProjectionModeChoice,Zi as assertReadableTrackerRoot,i0 as assertRegisteredCommandContract,_0 as assertRegisteredCommandOverride,l0 as assertRegisteredExporter,s0 as assertRegisteredFlags,a0 as assertRegisteredHook,p0 as assertRegisteredImporter,u0 as assertRegisteredItemField,m0 as assertRegisteredItemType,S0 as assertRegisteredMigration,h0 as assertRegisteredParserOverride,g0 as assertRegisteredPreflightOverride,f0 as assertRegisteredProfile,C0 as assertRegisteredRendererOverride,c0 as assertRegisteredSearchProvider,y0 as assertRegisteredServiceOverride,d0 as assertRegisteredVectorStoreAdapter,Gx as assertRelationshipEdgeAllowed,on as assertRelationshipGraphAdapterConformance,eT as assertSchemaPreviewSupported,l_ as assertTestMeasurementRun,hx as assertWellFormedOutputText,dM as assuranceAssertionUpdateIsLoosening,cx as attachContextIntentReceipt,qA as attachContextUsageServingReceipt,Au as attachLinkedTestMutationProvenance,Eu as attachLinkedTestProvenance,Xe as attachMcpServerInfo,BE as attachOutputOmissionReceipt,px as attachOutputTokenAccounting,dx as attachReadOutputContracts,cA as attachReadOutputSessionReceipt,Ap as auditMergeAttributeFence,kM as auditMergeDriverConfiguration,eu as auditWorkspaceRelationshipGraph,AL as authorizeMcpHttpRequest,Vo as boundAgentEpisodeIdentity,JE as boundReadOutputRows,Gm as buildChildrenByParent,Ak as buildCompactSearchFilterSummary,FP as buildContentFilterEcho,Hv as buildContextSignalSnapshot,my as buildCorpusShapeItemPlan,uP as buildDefectRecurrenceIndex,kp as buildExtensionDescribeResult,Lp as buildExtensionInstallPlan,GP as buildGovernanceMissingFilterEcho,hu as buildInProgressSweepCommands,pI as buildInProgressWorkHealthSummary,aw as buildInvalidTypeError,lk as buildItemChildrenRollup,aN as buildItemCompletionMutations,Pv as buildItemContextRelevanceCandidates,Vw as buildItemNotFoundError,mk as buildItemSchedule,qI as buildLinkedFileRepairReport,fL as buildMcpAuthorizationDiscoveryUrls,Fg as buildMcpCompleteResult,k0 as buildMcpDiscoverResult,yL as buildMcpDynamicRegistrationMetadata,sL as buildMcpHttpRequestHeaders,j0 as buildMcpInputRequiredResult,mL as buildMcpProtectedResourceMetadata,Tp as buildMergeAttributePatterns,zd as buildPmActionToolInputSchema,cD as buildPmRefusalClosureCensus,XM as buildRelationshipContext,Jw as buildSearchCorpus,Zw as buildSemanticCorpusInput,UI as buildStatusRoleWarnings,Qi as buildTrackerInitializationRecovery,oO as buildVectorizationEmbeddingIdentity,iO as buildVectorizationEmbeddingMetadata,xk as buildVerboseSearchFilters,$M as buildWorkflowCompletenessCheck,Qv as buildWorkspaceMemorySnapshot,Ho as canonicalDocument,gT as canonicalizeCommandOptionKey,xN as canonicalizeCommandSuggestions,Ov as canonicalizeContextRecencyCoordinate,$x as canonicalizeRelationshipKind,Z$ as censusPmRecoveryReferenceProducers,zM as certifyCompleteListResult,UN as checkExtensionManifestCompatibility,og as claim,ig as claimNext,VM as classifyHistoryAuthorEvent,_i as classifyHistoryEvent,kI as classifyHistoryMergeReceiptReferences,Kx as classifyHostEnvironmentFault,wk as classifyImplicitSemanticFallbackReason,Go as classifyItemFormatVersion,m_ as classifyLinkedTestCommandSafety,f_ as classifyLinkedTestFailure,Cb as clearActiveExtensionHooks,cu as clearDurableGraphCache,hE as clearFocusedItem,S_ as clearWorkspaceContractsCache,ng as close,Lu as closeItem,mg as closeTask,jc as coalesceRepeatedListFlags,sR as collectBlockedByIds,cR as collectBlockedByIdsFromCorpus,VA as collectContextUsageDeliveredItemIds,ip as collectDanglingDependencyReferences,pR as collectDependencyBlockedIds,np as collectDuplicateDependencyRows,Zl as collectDuplicateRelationshipEdgeGroups,bk as collectErrorCauseCodes,Jd as collectHierarchyRelations,Ar as collectMcpHeaderAnnotations,sp as collectMissingDependencyTargetIds,Gu as collectNewOrderingCycleWarnings,Xl as collectOrderingCycles,op as collectOrderingStorageContradictions,hR as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,bb as collectRegisteredItemFieldNames,cE as collectRuntimeCreateFieldValues,cw as collectRuntimeFilterValues,dE as collectRuntimeUpdateFieldValues,Nm as collectSubtreeIds,Bi as collectUsedExtensionCapabilities,CT as commandOptionFlagLabel,uh as comments,H_ as commitImportedItem,cN as commitItemCompletion,sN as commitItemMutations,IR as commitWorkspaceTransaction,Ks as compactFlagAliasContracts,Lm as compareCriticalItems,Rw as comparePmDateVersions,RR as compareRelationshipSnapshots,vT as compareTimestampStrings,xv as compileHistoryProvenanceMatcher,nx as composeContextIntentContracts,kN as composeExtension,GN as composeExtensionPackage,uR as computeActionabilityReport,Lb as computeHistoryDiff,Vl as computeRelationshipCentrality,Hl as computeRelationshipDominators,tl as computeWorkspaceGraphFingerprint,Ah as config,gb as consumeAfterCommandAffectedItems,nh as context,ax as contextIntentRowId,ag as copy,ju as countFailureCategories,YE as countReadOutputRows,eg as create,eI as createAssurancePreset,VI as createAssuranceWorkspaceContext,NT as createCheckpointId,jM as createCompleteListOptions,rb as createCoreCommandHookContext,en as createCorpusShapeMeasurement,fM as createEmptyAssuranceDocument,qx as createEmptyExtensionRegistrationRegistry,hO as createExtensionCommandError,Rc as createExtensionCommandSdk,Ui as createExtensionContributionInventory,O0 as createExtensionTestHarness,Di as createHistoryEntry,BO as createLazyModule,DM as createLifecycleCompletenessPolicies,xL as createMcpStaticBearerVerifier,tL as createMcpTaskStore,Hw as createMutationGuardSdk,DE as createOutputOmissionReceipt,ms as createPmCliExpectedError,qs as createPmCliProgram,Ai as createPmCommandOutputBudget,NA as createQueryFingerprint,xy as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,xt as createRelationshipKindRegistry,ud as createReproducibleProcessRunner,Tk as createSearchCursorFingerprint,nb as createSerialQueue,mT as createStdinTokenResolver,qT as createUnknownSubcommandError,ZS as createWorkflowPolicyEvaluator,$f as createWorkspaceSnapshot,zN as deactivateExtensionForTest,Ss as decideSecretGuardFinding,XD as declineServiceOverride,sx as decodeContextIntentCursor,jO as decodeHtmlEntitiesInOptions,Er as decodeMcpHttpHeaderValue,ux as decodePmTableRows,FA as decodeQueryCursor,$A as decodeQueryCursorEnvelope,DA as decodeQueryCursorState,vA as decodeReadOutputContinuationCursor,R0 as decodeToon,PL as decoratePmMcpToolsWithApps,El as dedupeLinkedArtifacts,Rb as defaultConfigScope,Iv as defaultScoreContextCandidates,rF as defineAfterCommandHook,eF as defineBeforeCommandHook,tF as defineBeforeMutationHook,FD as defineCommand,HD as defineCommandOverride,K as defineCorpusShape,WL as defineEpisodeSpecification,ZD as defineExporter,IN as defineExtension,vN as defineExtensionBlueprint,$D as defineExtensionManifest,GD as defineFlag,QD as defineImporter,jD as defineItemField,UD as defineItemType,BD as defineMigration,ny as defineObservationContract,iF as defineOnIndexHook,oF as defineOnReadHook,nF as defineOnWriteHook,VD as defineParserOverride,xi as definePmCommandOutputBudget,HP as definePmCommandOutputEnvelope,jP as definePmErrorCodeCatalog,KD as definePreflightOverride,DD as defineProjectProfile,JD as defineRendererOverride,zD as defineSearchProvider,WD as defineServiceOverride,qD as defineVectorStoreAdapter,ay as defineVerdictContract,xe as defineWorkspaceRecipe,cg as deleteItem,Bf as deleteWorkspaceSnapshot,Ux as dependencyToRelationship,yh as deps,rI as deriveAssuranceProposals,jI as deriveClosureTimestamp,LN as deriveExtensionCapabilities,Yk as deriveMutationTransactionId,eM as derivePmBulkMutationEffect,eD as derivePmRecoveryReferenceObligations,Yl as deriveRelationshipDeadlines,Op as deriveSchemaEvolutionMigrationId,EO as deriveTelemetryCommandResolution,uw as describeAllowedTransitions,bM as describeExtensionActivation,$N as describeExtensionBlueprint,No as describeFieldFlagSpellingDefect,jT as describeFlagScalarValueFailure,Tm as describeItemOwnershipConflict,js as describeItemRevisionChanges,KL as describeObservationCost,Xt as describeProfileComposition,Jt as describeProjectProfile,fN as describeReadCompletenessControls,gO as describeUnknownError,ii as detectAgentIdentity,di as detectHarnessIdentity,zl as detectRelationshipCommunities,si as diagnoseAgentIdentity,tu as diffRelationshipAuditSnapshots,s_ as diffTestRunMeasurements,q0 as digestMcpRequestParameters,Zx as discoverExtensions,yo as discoverNearbyPmRoot,m1 as discoverPmTools,Mw as discoverProjectRuntimeVersionPins,Ch as docs,lh as duplicates,ou as durableGraphCachePath,du as durableGraphCacheStatus,Do as effectiveItemFormatVersion,eR as emitTelemetryErrorEvent,q_ as emptyImportedDocument,mI as encodeItemScalarDecisionValue,Tr as encodeMcpHttpHeaderValue,lx as encodePmTableRows,LA as encodeQueryCursor,IA as encodeReadOutputContinuationCursor,P0 as encodeToon,$b as enforceHistoryStreamPolicyForItem,Db as enforceHistoryStreamPolicyForItems,rP as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,bw as ensureMaterializedHistoryTarget,Cp as ensurePmGitignore,pl as ensureScope,fO as ensureSentryCommandTracing,mO as ensureSentryInit,z_ as ensureTrackerInitialized,jl as enumerateRelationshipPaths,Oi as estimatePmOutputTokens,hM as evaluateAssuranceAssertion,gM as evaluateAssuranceGate,dP as evaluateBoundaryFixtures,Cm as evaluateClaimActivity,Lv as evaluateContextRanking,fP as evaluateDefectGateEvidence,_M as evaluateMeasurement,xf as evaluateMetricFloors,gs as evaluateMutationGuard,Qf as evaluateProvenanceCoverage,xF as evaluateReliabilityWindow,Yf as evaluateSemanticAttributionCoverage,Il as evaluateSimilarityGovernance,lw as evaluateTransition,cy as evaluateVerdictContract,QS as evaluateWorkflowPolicies,os as executeEmbeddingBatchesWithRetry,rO as executeVectorDelete,nO as executeVectorReset,tO as executeVectorUpsert,ZC as executeWorkspaceRecipe,Cl as expandAddGlobEntries,kl as explainSourceTraceability,av as exportAttestation,fg as extension,hg as extensionActivate,gg as extensionDeactivate,_g as extensionList,pS as extensionMigrate,vI as extractHistoryMergeReceiptDispositions,II as extractHistoryMergeReceiptReferences,SL as extractMcpTraceContext,Tw as extractPatchFailureContext,yu as extractReferencedPmItemIdsFromCommand,Ay as federateRelationshipGraphSnapshots,_h as files,hh as filesDiscover,gh as filesLookup,KA as finalizeContextUsageDelivery,yy as findCoverageDeficits,Ml as findDuplicateClusters,Sp as findGitWorkspaceRoot,SE as findHistoryIdentityDiscontinuities,Ip as findInstalledNpmPackageCandidate,RL as findPmMcpAppByUri,Nn as findPmNamespacedCommand,ql as findRedundantRelationshipEdges,Kl as findRelationshipCutStructure,Rl as findSimilarItems,ZO as finishTelemetryCommand,ER as fitOutputEnvelope,UT as flattenFlagListValue,hy as flushTelemetryQueue,pg as focus,Bl as forEachMatchedRelationshipEdge,Ql as formatDuplicateEdgeGroup,Zd as formatHierarchyRelation,Jl as formatOrderingStorageContradiction,KR as formatPmPositionalActionFlagTip,Cf as formatProfileApplyHuman,gf as formatProfileLintHuman,_f as formatProfileListHuman,hf as formatProfileShowHuman,Mp as formatSchemaEvolutionMigrationHuman,Rk as formatVectorIndexRecoveryWarnings,Gk as formatWorkspacePositionHuman,Wh as gc,Yi as generateItemId,ah as get,fb as getActiveCommandResult,tx as getActiveContextIntentContracts,qi as getActiveExtensionRegistrations,EL as getActiveMcpTraceContext,yM as getAssuranceDeclaration,Mg as getContracts,fE as getFocusedItem,Eo as getHistoryPath,SR as getItemAt,To as getItemPath,As as getMutationActionContract,gp as getPmGitignoreBlock,So as getSettingsPath,T_ as getWorkspaceContracts,Gb as getWorkspaceHistoryPath,Sh as graph,iu as graphAuditBaselinePath,Xf as groupHistoryByEpisode,YD as handleServiceOverride,v0 as hasMcpClientExtension,OL as hasPmMcpAppsCapability,Be as hasSubcommandFlagContractsForCommand,sO as hasVectorizationEmbeddingIdentityChanged,aO as hasVectorizationVectorDimensionChanged,vx as hashDocument,kx as hashDocumentForVersion,Nx as hashEmptyDocument,wx as hashHistoryPatch,bx as hashHistoryRecord,Ox as hashHistoryStream,fI as hashItemScalarDecisionValue,Kh as health,Dl as hierarchyAncestors,Fl as hierarchyDescendants,Qh as historyCompact,Zh as historyCompactBulk,nE as historyDigest,Av as historyEntryMatchesProvenance,Pw as historyItemHashVersionForRuntime,Yh as historyRedact,Xh as historyRepair,Jh as historyRepairAll,aR as indexBlockedByIds,ep as indexHierarchyRelations,cO as inferConsistentVectorDimension,Ei as inferPmOutputBudgetClass,Eh as init,BM as inspectCompleteListResult,Hx as inspectExtensionManifestSchema,Hp as inspectHistoryAuthorStream,Is as inspectInProgressWork,EI as inspectMergeReceiptEvidence,Nw as inspectProjectRuntimeCompatibility,vs as inspectStaleInProgressItems,Lg as inspectStaticExtensionInventory,GI as inspectStatusRoleAssignments,Ub as inspectWorkspaceHistoryState,Df as inspectWorkspaceSnapshot,wp as installMergeFence,N0 as interpretMcpResultType,Km as isAlreadyClaimedError,SO as isCommanderError,gN as isCompatibleRecoveryFlag,od as isErrnoError,rR as isExternalDependencyReference,nR as isExternalDependencySourceKind,me as isFileMissingError,vi as isGenericRefusalRequired,ki as isGenericRefusalWhy,ME as isHostOutputSuppressed,us as isItemAlreadyExistsError,Bs as isItemRevisionConflict,uI as isItemScalarMissingValue,LO as isJudgeableHistoryRecord,RI as isLegacyMergeReceiptSummary,h as isMcpRecord,Ts as isMutationAction,Fx as isOrderingRelationshipKind,Yb as isPlaceholderReferenceToken,ss as isPmCliErrorDetails,fs as isPmCliExpectedError,to as isPmExtensionCapabilityContract,no as isPmExtensionPolicyModeContract,oo as isPmExtensionPolicySurfaceContract,ro as isPmExtensionServiceNameContract,QP as isPmKnownExitCode,KP as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,ps as isPmTokenBudgetRecovery,eo as isPmToolAction,PI as isPreDurableCloneLocalReceiptSummary,MI as isPreDurableDispositionEligibleReference,kw as isProjectMutatingInvocation,zO as isPureSnakeCaseAlias,OA as isReadOutputBudgetExceeded,nA as isReadOutputSessionReference,hN as isReadProjectionRecoveryFlag,wA as isReadResultOmittedForBudget,GE as isReadRowContract,Yd as isRuntimeRecord,_w as isSettingsReadFallback,_m as isStartTransition,VO as isTerminalPlanMode,lE as isTerminalStatus,Io as isTimestampLiteral,sP as isWaiverNoticeDays,NO as isWellFormedHistoryRecord,eN as itemDocumentToMutationOptions,uk as itemHasSchedule,hi as jaccardSimilarity,FO as latestHistoryTimestamp,fh as learnings,BT as levenshteinDistanceWithinLimit,td as limitAnnotationEntries,xu as linkedTestTrustFingerprint,DN as lintExtensionBlueprint,Vx as lintExtensionManifestSchema,er as lintProjectProfile,oh as list,ei as listAgentProvenanceAdapters,Uc as listAliasPluralKeys,ih as listAllComplete,zw as listAllDocumentCandidatesCached,ns as listAllItemMetadata,qw as listAllItemMetadataLight,CM as listAssuranceDeclarations,xM as listAssuranceVerdicts,ly as listBuiltinCorpusShapes,bN as listCoreClosedDomainContracts,BR as listGetProjectionFields,aI as listInvalidProvenanceHistoryStreamIds,GR as listListProjectionFields,AI as listMergeReceipts,Es as listMutationActions,Nk as listMutationEvents,hn as listPmCommandFlagBudgets,pp as listPmCommandsForFamily,dp as listPmCommandsForTier,Pe as listPmFlagLexicon,vD as listPmFlagSpellingInventory,lp as listPmMcpToolsForProfile,TD as listPmRequiredArgumentRefusalContracts,ED as listPmSubcommandRefusalContracts,Yt as listProfiles,bD as listTrackerPreflightRecoveryContracts,nN as listUpsertKeyCandidates,Ff as listWorkspaceSnapshots,gR as loadContextIntentRuntimeLayers,af as loadCreateTemplateOptions,eb as loadExtensions,lu as loadGraphAuditBaseline,oN as loadGuardedRuntimeSchema,$T as loadMutationCheckpoint,v as loadRelationshipGraphAdapter,ts as locateItem,sT as looksLikeGenericKeyValueEntry,XE as mapReadOutputRows,xI as markMergeReceiptReconciled,dw as matchesRuntimeFilters,JO as maybeRunFirstUseTelemetryPrompt,fy as measureCorpusShapePlan,Ji as measureItemMetadataReadWork,nT as mergeAdditiveTags,NN as mergeExtensionBlueprints,_I as mergeHistoryStreams,yI as mergeItemDocuments,SI as mergeJsonDocuments,Bc as mergeLinkedTestTwoTokenEntries,hI as mergeRelationshipEventStreams,jm as mergeSortedWarnings,HO as migrateItemFilesToFormat,Ww as mutateItem,Kw as mutateItemWithHistoryContext,zb as mutateWorkspaceJsonWithHistory,ch as next,ri as normalizeAgentProvenanceAdapterValue,ed as normalizeAnnotationTransportOptions,iM as normalizeAssuranceEvaluation,oM as normalizeAssuranceMutation,zc as normalizeBootstrapInvocation,vb as normalizeBulkIdsValue,rp as normalizeDependencyGraphTarget,IP as normalizeDependencySeedId,MP as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,Fs as normalizeExpectedItemHash,Gi as normalizeExtensionContributionInventory,QT as normalizeHistoryOperationForWrite,sI as normalizeInvalidHistoryProvenance,tP as normalizeItemAddressInvocation,Fo as normalizeItemFormatVersion,Wi as normalizeItemId,Bo as normalizeItemMetadata,vP as normalizeItemReference,Gc as normalizeLegacyExtensionActionSyntax,gl as normalizeLinkedPath,Wb as normalizeParentReferenceValue,Kt as normalizeProfileName,Ki as normalizeRawItemId,EA as normalizeReadOutputIncludeModeOptions,xE as normalizeReplayPatchOps,xs as normalizeSimilarityText,IO as normalizeStaleWorkThresholdHours,pE as normalizeStatusForRegistry,jo as normalizeStatusInput,iE as normalizeStatusInputWithRegistry,yO as normalizeThrownExitCode,mh as notes,Mo as nowIso,su as openDurableGraphCache,z0 as openMcpRequestState,YL as openPmEpisode,Gl as orderingPredecessors,Ul as orderingSuccessors,Uv as packContextCandidates,$m as packRankedContextItems,Og as packageActivate,wg as packageCatalog,Rg as packageDeactivate,xg as packageDescribe,Eg as packageDoctor,Sg as packageInstall,Cg as packageLifecycle,yg as packageList,Ag as packageManage,lS as packageMigrate,bg as packageReload,Tg as packageUninstall,UA as paginateQueryRows,ll as parseAddEntries,ul as parseAddGlobEntries,nd as parseAnnotationTextInput,Xk as parseAtomicMutationControls,Dc as parseBootstrapCommandName,Nc as parseBootstrapGlobalOptions,$c as parseBootstrapHelpRequest,qc as parseBootstrapTypeValue,Ib as parseBulkIdsText,vm as parseContextDepth,Rm as parseContextFocusFields,fR as parseContextIntentDeclarations,km as parseContextSections,qv as parseContextSignalSnapshot,iT as parseCsvKv,gP as parseDefectChangeRiskRequest,KI as parseDefectRecurrenceCoverageRequest,hP as parseDefectRecurrencePolicy,Af as parseEvalMetricFloors,Rf as parseEvalQuerySet,Gs as parseExpectHashSpecs,wT as parseExtensionLongFlagToken,fu as parseGraphSubcommand,sv as parseHistoryAttestation,Tv as parseHistoryProvenanceFilters,CP as parseIntegerLimit,uE as parseItemDocument,Jk as parseItemMutationBatch,sw as parseLimit,em as parseLinkedTestAssertionEqualsMap,tm as parseLinkedTestAssertionGteMap,Wu as parseLinkedTestBoolean,Yu as parseLinkedTestContextMode,Ku as parseLinkedTestEnvClear,Vu as parseLinkedTestEnvSet,rm as parseLinkedTestJsonEntries,Zu as parseLinkedTestMinLines,Qu as parseLinkedTestRegexList,Ju as parseLinkedTestStringList,Xu as parseLinkedTestWorkspaceContextMode,Hg as parseMcpCachePolicy,$g as parseMcpImplementation,Ze as parseMcpInputRequests,pr as parseMcpInputResponses,_C as parseMcpSubscriptionFilter,fl as parseMigrateEntries,TP as parseMultiValueFilter,WP as parseMutationReceipt,_T as parseOptionalNonNegativeInteger,fT as parseOptionalNumber,V$ as parsePmAgentTaskTranscriptCorpus,u1 as parsePmToolDiscoveryOptions,yP as parsePriority,xP as parsePriorityFilterSet,sA as parseReadOutputSession,wb as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,ml as parseRemoveEntries,vl as parseSourceLineRange,rw as parseStatusFilterCsv,EP as parseStringFilterSet,io as parseTags,o_ as parseTestRunMeasurements,SP as parseType,AP as parseTypeFilterSet,Yp as parseUnknownAuthorHistoryEventCoordinates,VS as parseWorkflowPolicy,KS as parseWorkflowPolicyDocument,sk as partitionDecisionEntries,Nb as patchPathToChangedField,so as pathExists,ug as pauseTask,au as persistDurableGraphResult,fw as persistSelectedItemFormat,WM as planAgentIdentityVocabularyMutation,Xv as planCompletedAtBackfill,$p as planExtensionDirectoryCopy,MN as planItemMutationDocument,tr as planProfileApplication,X$ as planRelationshipEventBackfill,mu as planRelationshipRemediation,Rp as planSchemaEvolutionMigration,Kp as planUnknownAuthorHistoryAcknowledgment,Gf as planWorkspaceSnapshotRestore,XR as positionalShapeKey,JR as positionalSignatureKey,jN as preflightExtension,ws as prepareSimilarityText,dT as preserveMutationStdinTokenFields,cT as preserveMutationStdinTokenLiterals,PN as previewItemMutationDocument,iN as previewItemMutations,Sx as printError,yx as printResult,jh as profile,qh as profileApply,Hh as profileLint,Bh as profileList,zh as profileShow,hb as projectAfterCommandItemSnapshot,Pm as projectContextFocusRows,r_ as projectFleetAttributionAnalytics,Ev as projectHistoryProvenance,$i as projectLeanRecoveryPayload,dl as projectLinkedCollectionMutation,mx as projectPmBriefListEnvelope,fx as projectPmBriefSearchEnvelope,ds as projectPmCliErrorContextDetails,as as projectPmCliErrorDetails,Pi as projectPmDiagnosticOutput,Mi as projectPmDiagnosticText,e_ as projectProvenanceCoverageAnalytics,Ru as projectValidateCounts,oI as promoteAssuranceAssertion,HA as propagateContextUsageServingReceipt,_$ as pruneCompileCacheGenerations,SM as putAssuranceDeclaration,TM as putAssuranceDeclarationBundle,$w as queryItemMetadataIndex,Dw as queryLinkedFileMetadataIndex,Fw as querySimilarItemMetadataIndex,i_ as queryTestRunMeasurementsBelow,xo as quoteCommandArg,Ao as quoteWindowsCommandArg,AN as rankCommandPaths,rd as readAnnotationEntries,ai as readAuthorEnvironment,A_ as readBooleanOption,QA as readContextUsageAffinity,x_ as readCsvListOption,Mc as readExtensionMigrationState,ao as readFileIfExists,Jc as readFirstStringFromCommanderOptions,Qc as readFirstValueFromCommanderOptions,Jf as readHistoryAnalyticsWindow,yE as readHistoryEntries,li as readHistorySnapshot,qf as readImprovementLedger,jw as readItemMetadataDerivedIndexState,Us as readItemRevision,pN as readItemTransaction,UO as readLatestHistoryActivity,rs as readLocatedItem,WE as readOutputBudgetCollections,MA as readOutputCollectionFingerprint,KE as readOutputContinuationRowCollections,HE as readOutputContinuationRowPaths,SA as readOutputIncludeModeOptions,rA as readOutputRetainsTail,VE as readOutputRowCollections,qE as readOutputRowPaths,dA as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,Om as readRecentActivity,y_ as readRequiredString,aE as readRuntimeFieldOptionValue,Xi as readSettings,YO as readSettingsSection,hw as readSettingsWithMetadata,Zc as readStringArrayFromCommanderOptions,E_ as readStringOption,CO as readThrownExitCode,dO as readVectorizationStatusLedger,ww as readWorkflowPolicies,WS as readWorkflowPolicyField,_R as readWorkspaceContextIntentContracts,Wv as readWorkspaceContextSignals,Zv as readWorkspaceMemory,Fk as readWorkspacePosition,vR as readWorkspaceTransaction,OE as reanchorHistoryEntries,wF as reconcileArtifactLedgers,zi as reconcileExtensionCapabilityUsage,Hb as reconcileWorkspaceJsonHistory,_b as recordAfterCommandAffectedItem,AM as recordAssuranceVerdict,sm as recordClaimSemanticAttribution,YA as recordContextUsageDelivery,WA as recordContextUsageServing,XA as recordContextUsageTouch,JA as recordContextUsageTouches,cm as recordFocusSemanticAttribution,zf as recordImprovementObservation,am as recordReleaseSemanticAttribution,DO as recordedBaselineActivity,GO as recordedPrefixActivity,Ro as redactUrlCredentialsInText,Oo as redactUrlCredentialsInToken,Bw as refreshItemMetadataDerivedIndex,xp as refreshMergeAttributeFenceIfInstalled,ZE as refreshReadOutputDeliveredCounts,lO as refreshSearchArtifactsForMutation,ti as registerAgentProvenanceAdapters,RP as registerExternalDependencyResolver,Zo as registerHarnessSignalDescriptors,vE as registerOutputMaterialFieldGroups,sg as release,QE as rememberReadOutputFocusRows,EM as removeAssuranceDeclaration,co as removeFileIfExists,bl as renameArtifactsResultKey,Am as renderCalendarMarkdown,xm as renderCalendarToon,Bm as renderContextMarkdown,Np as renderExtensionDescribeMarkdown,vp as renderExtensionSurfaceMarkdown,W_ as renderGuideMarkdown,SN as renderMissingOptionRetry,ak as renderNextMarkdown,wN as renderPmClosedDomainHelp,bo as renderPmCommand,Fn as renderPmCommandAliasMigrationHint,fp as renderPmCommandVisibilityMarkdown,ND as renderPmFlagLexiconMarkdown,ML as renderPmMcpAppHtml,dD as renderPmRefusalClosureCensusMarkdown,ow as renderRowsAsCsv,iw as renderRowsAsTable,rg as reopen,xw as replayHistoryToTarget,EE as replayToCanonicalItemDocument,TE as replayToItemDocument,JT as requireHistoryOperation,uv as requireTerminalReason,mv as requireTerminalReasonWithRecovery,Mx as resealHistoryRewrite,lb as resetActiveExtensionRuntimeState,ol as resetWorkspaceGraphCache,Ko as resolveAgentSessionContextFromSignals,cd as resolveAnnotationIndex,id as resolveAnnotationInput,CE as resolveAuthor,pi as resolveAuthorIdentity,Kb as resolveBodyFileContent,uy as resolveBuiltinCorpusShape,Em as resolveCalendarOutputFormat,BP as resolveCanonicalPmErrorCodeContract,Dx as resolveCanonicalRelationshipKind,gE as resolveClaimPrincipal,kb as resolveCliBulkIdsInput,TT as resolveCommandOptionPolicyState,f$ as resolveCompileCacheGeneration,Yv as resolveCompletionTimestamp,zx as resolveConfiguredPmPackageRoot,NP as resolveContentFieldFilters,ox as resolveContextIntentContract,Mm as resolveContextOutputFormat,Im as resolveContextTokenBudget,_v as resolveCreateExplicitEmptyFlag,Ls as resolveDeclaredBlockers,gk as resolveEffectiveSearchMode,Yw as resolveEmbeddingProviders,vt as resolveExtensionFlagOptionKey,GT as resolveExtensionFlagValueContract,Dp as resolveExtensionInstallSourceIdentity,OT as resolveExtensionLongFlagName,Pc as resolveExtensionMigrationStatePath,Qx as resolveExtensionRoots,PP as resolveExternalDependencyReference,FT as resolveFlagValueKind,xT as resolveGlobalPmRoot,V_ as resolveGuideOutputFormat,Hf as resolveHistoryEpisodeGroupIdentity,rE as resolveHistoryHashAlgorithm,XT as resolveHistoryOperation,Sv as resolveHistoryProvenanceDimensions,tR as resolveHistorySubject,Ew as resolveHistoryTarget,yk as resolveHybridSemanticWeight,Co as resolveImplicitPmRoot,kT as resolveIsoOrRelative,dR as resolveItemBlockers,oR as resolveItemExecutionRole,Zk as resolveItemMutationDocument,Sm as resolveItemOwnershipActivity,ym as resolveItemOwnershipConflict,go as resolveItemTypeRegistry,oE as resolveItemTypesFilePath,Ms as resolveLastActivityAt,uN as resolveLifecycleVerbRecovery,bT as resolveLinkedResourcePositionalRecovery,__ as resolveLinkedTestFailureExitCode,Su as resolveLinkedTestSourceRef,Tu as resolveLinkedTestSourceWorkspaceRoot,bu as resolveLinkedTestTrust,wu as resolveLinkedTestTrustBatch,hC as resolveMcpAcknowledgedSubscriptionFilter,Ye as resolveMcpRequestContext,yp as resolveMergeInstallContext,TN as resolveMisnestedCommandPath,kP as resolveMissingMetadataFilters,yN as resolveMissingOptionPlaceholder,FE as resolveModePairedOutputOmissionReceipt,ok as resolveNextOutputFormat,jE as resolveOutputOmissionReceipt,Bx as resolvePmCliVersion,Dn as resolvePmCommandAlias,qe as resolvePmCommandCapabilityFamily,$t as resolvePmCommandExitContract,N as resolvePmCommandOperation,wi as resolvePmCommandOutputBudget,Lt as resolvePmCommandOutputEnvelope,HR as resolvePmCommandPositionalContract,Po as resolvePmCommandScopeArgs,He as resolvePmCommandVisibilityTier,Ri as resolvePmDiagnosticOutputBudget,zP as resolvePmErrorCodeContract,iS as resolvePmFlagSemanticConcept,ke as resolvePmHistoryOperation,D0 as resolvePmMcpExecutableInvocation,jx as resolvePmPackageRootFromModule,VR as resolvePmPositionalActionContract,wc as resolvePmPositionalActionFlagContracts,De as resolvePmRoot,Gd as resolvePmToolCustomFieldCollision,Qb as resolvePriority,Wt as resolveProfile,Ep as resolveProjectMergeTypeFolders,GA as resolveQueryCursorStart,mN as resolveReadCompletenessControls,_N as resolveReadOptionRetryArgs,AA as resolveReadOutputDimensions,RA as resolveReadOutputEncoding,eA as resolveReadOutputRecoveryBudget,fA as resolveReadOutputSurface,UE as resolveReadRowContract,CN as resolveRecoveryCommandName,Pb as resolveRegisteredSearchProvider,Mb as resolveRegisteredVectorStoreAdapter,ld as resolveReproducibleProcessEnvironment,ko as resolveRuntimeFieldRegistry,vo as resolveRuntimeStatusRegistry,Xw as resolveSearchCorpusFields,hk as resolveSearchMaxResults,Ek as resolveSearchPage,Ck as resolveSearchScoreThreshold,Sk as resolveSearchTuning,Qw as resolveSemanticCorpusCharacterLimit,im as resolveSemanticLineageIds,Cw as resolveSettingsWithSemanticRuntimeDefaults,RM as resolveSourceContextWritePolicy,um as resolveStartTaskInProgressStatus,Z as resolveSubcommandFlagContractsForCommand,jS as resolveTelemetryErrorCategory,uO as resolveTelemetrySourceAttribution,lv as resolveTerminalReason,rN as resolveTransactionSchema,ST as resolveTypeDefinition,yT as resolveTypeName,nw as resolveTypeSynonym,pw as resolveTypeWorkflows,Wp as resolveUnknownAuthorAcknowledgmentSelector,Ok as resolveVectorIndexRecovery,eO as resolveVectorStores,Xd as resolveWorkspaceRelationshipKindRegistry,AT as resolveWorkspaceRoot,dg as restore,DT as restoreCheckpointItems,Vb as restoreWorkspaceJsonFromHistory,jf as restoreWorkspaceSnapshot,Uf as restoreWorkspaceSnapshotWithRecovery,al as reviseLinkedNote,kg as runAction,yb as runActiveBeforeMutationHooks,Tb as runActiveCommandHandler,Sb as runActiveOnIndexHooks,Vi as runActiveOnReadHooks,Hi as runActiveOnWriteHooks,Eb as runActiveParserOverride,Ab as runActivePreflightOverride,xb as runActiveServiceOverride,wm as runActivity,Jx as runAfterCommandHooks,yf as runAggregate,ad as runAnnotationCommand,Nu as runAppend,JI as runAssuranceAction,QI as runAssuranceDispatch,Xx as runBeforeCommandHooks,bm as runCalendar,Wm as runClaim,Ym as runClaimNext,$u as runClose,Du as runCloseMany,Zm as runCloseTask,Qp as runComments,Y_ as runCompletion,Zp as runConfig,qt as runContext,Fv as runContextEvaluationCorpus,$v as runContextEvaluationScenario,Fu as runCopy,nm as runCreate,om as runDelete,il as runDeps,wl as runDocs,QM as runDuplicates,Mf as runEval,vf as runEvent,Fp as runExtension,kc as runExtensionMigrateAction,vc as runExtensionMigrations,Nl as runFiles,$l as runFilesDiscover,Ll as runFilesLookup,t_ as runFleetAttributionAnalytics,lm as runFocus,Iu as runGc,Sf as runGet,_u as runGraph,K_ as runGuide,gu as runHealth,_k as runHistory,dv as runHistoryAttest,ev as runHistoryCompact,nv as runHistoryCompactBulk,NI as runHistoryMaintenance,ov as runHistoryRedact,$I as runHistoryRepair,FI as runHistoryRepairAll,vg as runInActiveExtensionScope,qp as runInit,jp as runInitAgentGuidance,ku as runLearnings,xl as runLinkedArtifacts,h_ as runLinkedTests,ap as runList,If as runMeet,Ik as runMergeDriver,bp as runMergeInstall,wI as runMergeReceiptEvidenceReport,bI as runMergeReceiptReport,vk as runMergeReconcile,Hm as runNext,of as runNotes,Qm as runPauseTask,tf as runPlan,ff as runProfileApply,mf as runProfileLint,lf as runProfileList,uf as runProfileShow,Zf as runProvenanceCoverageAnalytics,qN as runRegisteredCommandForTest,YN as runRegisteredCommandOverrideForTest,r0 as runRegisteredExporterForTest,VN as runRegisteredHookForTest,t0 as runRegisteredImporterForTest,e0 as runRegisteredMigrationForTest,HN as runRegisteredMutationGuardForTest,KN as runRegisteredParserOverrideForTest,WN as runRegisteredPreflightOverrideForTest,XN as runRegisteredRendererOverrideForTest,QN as runRegisteredSearchProviderForTest,JN as runRegisteredServiceOverrideForTest,ZN as runRegisteredVectorStoreAdapterForTest,rr as runReindex,Xm as runRelease,kf as runRemind,gv as runReopen,rf as runRestore,Pp as runSchemaEvolutionMigration,Tf as runSearch,_y as runSearchRefreshWorkerEntrypoint,X_ as runStartBackgroundRun,Jm as runStartTask,a_ as runStats,d_ as runTelemetry,df as runTemplatesList,cf as runTemplatesSave,pf as runTemplatesShow,g_ as runTest,C_ as runTestAll,J_ as runTestRunsList,Z_ as runTestRunsLogs,th as runTestRunsResume,Q_ as runTestRunsStatus,eh as runTestRunsStop,rh as runTestRunsWorker,gm as runUpdate,nf as runUpdateMany,Bt as runUpgrade,Mu as runValidate,Ig as runWithActiveExtensions,L as runWithAgentSessionContext,mw as runWithConfigurationOnlySettings,rx as runWithContextIntentContracts,CR as runWithDiscoveredContextIntentContracts,ni as runWithHarnessDetectionSignals,TL as runWithMcpTraceContext,md as runWithReproducibleProcessEnvironment,oi as runWithWorkspaceHarnessSignalDescriptors,Vr as runWithWorkspaceRecipe,FM as runWorkflowPolicyAction,ZI as runWorkspaceTransactionGc,uu as saveGraphAuditBaseline,BI as scanClosureTimestamps,iI as scanExtensionHostVersions,Vp as scanHistoryAuthorAttribution,ks as scanInProgressWork,Uo as scanItemFormatVersions,hs as scanMutationSecrets,cI as scanProvenanceResolverHealth,Ns as scanStaleInProgressItems,HI as scanStorageIntegrity,xh as schema,Ih as schemaAddField,Ph as schemaAddStatus,Oh as schemaAddType,Lh as schemaApplyPreset,$h as schemaInferTypes,bh as schemaList,kh as schemaListFields,Gh as schemaRemapStatus,vh as schemaRemoveField,Mh as schemaRemoveStatus,Rh as schemaRemoveType,Fh as schemaRenameField,Dh as schemaRenameType,wh as schemaShow,Nh as schemaShowField,Uh as schemaShowStatus,EN as scoreCommandPathMatch,vv as scoreContextCandidates,kv as scoreContextCandidatesWithActiveExtensions,Os as scoreItemSimilarity,AD as scorePmGrammarRefusalClosure,uD as scorePmRefusalClosure,Rs as scorePreparedItemSimilarity,wD as scoreTrackerPreflightRecoveryClosure,Rx as sealHistoryRecord,B0 as sealMcpRequestState,sh as search,rk as searchWorkspaceMemory,nk as searchWorkspaceMemoryReadResult,ys as secretGuardRuleCategory,lR as selectActionableEntries,kA as selectCursorSemanticOptions,B_ as selectImportAuthor,hL as selectMcpClientRegistrationMode,tk as selectWorkspaceMemory,ek as selectWorkspaceMemoryRollups,pm as semanticAttributionAffinity,OO as sentryCaptureCliError,bO as sentryDiscardCommandSpan,wO as sentryFinishCommandSpan,PO as sentryFlush,RO as sentryLogCliUsageError,AO as sentrySetCommandContext,xO as sentryStartCommandSpan,qo as serializeItemDocument,ON as serializeNdjsonRows,RN as serializeNdjsonStream,oy as serveDeclaredObservation,ub as setActiveCommandContext,mb as setActiveCommandResult,ib as setActiveExtensionCommands,ob as setActiveExtensionHooks,sb as setActiveExtensionParsers,ab as setActiveExtensionPreflight,pb as setActiveExtensionRegistrations,db as setActiveExtensionRenderers,cb as setActiveExtensionServices,_E as setFocusedItem,WO as settingsSectionRevision,KO as shouldCompletePlanOnClose,pu as shouldPersistDurableGraphCache,uT as shouldResolveMutationStdinTokenField,lT as shouldResolveMutationStdinTokens,Sw as shouldRunSearchRefreshInForeground,Ol as similarityAdvisoryWarnings,zE as sliceReadOutputRowCollection,cs as snapshotPmCliErrorContext,Tl as sortLinkedArtifacts,cP as sortWaiverNotices,tT as splitAcceptanceCriteria,qO as splitCommaList,zo as splitFrontMatter,xA as stabilizeReadOutputReceiptEstimates,R as stableStringify,Qk as stableUpsertValue,BS as stableValueEquals,kO as staleEligibleAt,vw as stampRequiredItemFormat,lg as startTask,QO as startTelemetryCommand,ph as stats,sE as statusIsTerminal,Lc as stripGlobalBootstrapTokens,Lk as subscribeMutationEventBatches,$k as subscribeMutationEvents,KM as summarizeAgentIdentityVocabulary,Kf as summarizeAgentModelProvenance,Wf as summarizeAgentProvenance,Dv as summarizeContextEvaluationReports,u_ as summarizeContextPreflight,bv as summarizeHistoryProvenance,Bp as summarizeInitResult,TI as summarizeMergeReceipt,hv as supportsCreateExplicitEmpty,eP as supportsItemIdAlias,PE as suppressHostOutput,we as syncRelationshipGraphAdapter,FN as synthesizeExtensionManifest,Oc as toCompletionFlagString,Um as toContextFocusItem,Dm as toContextPackingSummary,Fm as toContextRankingSummary,PT as toErrorMessage,w_ as toEstimatedMinutesValue,Vk as toExtensionFlagDefinitions,I_ as toImportBoolean,L_ as toImportConfidence,U_ as toImportDeferredFields,M_ as toImportInteger,G_ as toImportLinkedDocs,F_ as toImportLinkedFiles,j_ as toImportLinkedTests,D_ as toImportLogEntries,$_ as toImportNormalizedEnum,N_ as toImportNumberMap,O_ as toImportPriority,P_ as toImportStatus,v_ as toImportStringList,k_ as toImportStringMap,R_ as toImportTags,mE as toItemRecord,b_ as toNonEmptyImportString,RT as toNonEmptyStringOrUndefined,AE as toReplayDocument,_x as toWellFormedText,bs as tokenizeSimilarityText,pT as transferMutationStdinTokenPolicy,Wx as translateHostEnvironmentFault,$O as unprovenClaimActivity,tg as update,p_ as updateLinkedTest,Pg as upgrade,Vh as validate,lM as validateAssertionDefinition,mM as validateAssuranceDocument,uM as validateGateDefinition,tN as validateItemMutationRows,Al as validateLinkedPaths,gL as validateMcpAuthorizationResponseIssuer,_L as validateMcpAuthorizationServerMetadata,CL as validateMcpClientMetadataDocument,aL as validateMcpHttpRequestHeaders,V0 as validateMcpJsonSchema,pM as validateMeasurementDefinition,Xb as validateMissingParentReference,yA as validateReadOutputOptions,tw as validateSprintOrReleaseValue,ET as validateTypeOptions,MR as validateWorkspaceTransactionIdentity,cv as verifyAttestation,nP as verifyCliFlagInvocationParity,YR as verifyExplicitPositionalSlotCensus,wE as verifyHistoryChain,bE as verifyHistoryChainWithVersion,yR as verifyHistoryEntries,Px as verifyHistoryRecordHash,Ix as verifyHistoryRewriteEvidence,ZR as verifyPmCliGrammar,QR as verifyPmCommandPositionalContracts,kD as verifyPmFlagLexicon,nD as verifyPmRecoveryKindRuntimeCoverage,Yy as verifyPmRecoveryProducerRuntimeCoverage,rD as verifyPmRecoveryReferences,aD as verifyPmRefusalClosureIdentityRatchet,sD as verifyPmRefusalClosureRatchet,tD as verifyPmRefusalReachability,Sd as verifyToolOptionCliParity,aP as waiverNoticeFor,vO as wholeHoursSince,Zb as withCliMutationInput,zs as withExpectedItemRevisions,Vs as withFlagAliasMetadata,Yx as withHostEnvironmentBoundary,ew as withLiteralMutationInput,H0 as withMcpCachePolicy,Ni as withoutGenericRefusalExamples,XS as workflowApprovalFingerprint,JS as workflowPolicyApplies,YS as workflowPolicyFingerprint,nl as workspaceGraphCache,kR as workspaceTransactionPlanDigest,sd as wrapOwnershipConflict,TO as wrapThrownErrorForSentry,ci as writeAuthorEnvironment,$e as writeFileAtomic,LT as writeMutationCheckpoint,gw as writeSettings,XO as writeSettingsSection,Cx as writeStderr,gx as writeStdout,pO as writeVectorizationStatusLedger,qb as writeWorkspaceJsonWithHistory,cl as writtenLinkedEntries};
|
|
35
35
|
//# sourceMappingURL=sdk.js.map
|