@unbrained/pm-cli 2026.10.4 → 2026.10.5
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 +2 -2
- package/CHANGELOG.md +11 -0
- 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.d.ts +1 -1
- package/dist/cli/commander-usage.js +7 -4
- 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 +3 -1
- package/dist/cli/extension-command-help.js +5 -3
- package/dist/cli/extension-command-options.js +1 -1
- package/dist/cli/extension-recovery.js +1 -1
- package/dist/cli/help-content.js +5 -2
- package/dist/cli/help-json-payload.js +6 -3
- 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/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 +1 -1
- package/dist/cli/register-mutation.js +2 -2
- 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/invocation-options.js +1 -1
- package/dist/cli/runtime/projection-retry.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 +2 -2
- 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 +163 -163
- package/dist/cli-bundle/chunks/chunk-3CYOBJUK.js +3 -0
- package/dist/cli-bundle/chunks/chunk-5MNOWZPN.js +3 -0
- package/dist/cli-bundle/chunks/chunk-AJ7H6XUF.js +20 -0
- package/dist/cli-bundle/chunks/chunk-D332RXZ7.js +80 -0
- package/dist/cli-bundle/chunks/chunk-HRJ6G6ZG.js +31 -0
- package/dist/cli-bundle/chunks/chunk-KRVI56QE.js +6 -0
- package/dist/cli-bundle/chunks/chunk-N4YGSG6F.js +238 -0
- package/dist/cli-bundle/chunks/{chunk-7CE2DJMA.js → chunk-OOLYASYJ.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-R7CG2DB7.js +2 -0
- package/dist/cli-bundle/chunks/chunk-TGMONGWX.js +2 -0
- package/dist/cli-bundle/chunks/chunk-UZ7BIUCI.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-GZMWISWW.js → chunk-VZ63DEVJ.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-WFZ4UEOB.js +2 -0
- package/dist/cli-bundle/chunks/chunk-YVBRASXO.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-SMKHR6BM.js → chunk-Z66DWDAU.js} +87 -87
- package/dist/cli-bundle/chunks/{register-list-query-QBGXO5JJ.js → register-list-query-75QXHIFH.js} +11 -11
- package/dist/cli-bundle/chunks/register-mutation-YS54SCHG.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-6KHZQSYJ.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-RTATEN2M.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-Q6DJ5DFQ.js → chunk-2CVX3KR3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5C3IDDW7.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-467EW5RL.js → chunk-ABV67XCC.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-B5RSLVE6.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-C224METM.js +20 -0
- package/dist/cli-bundle/focused-chunks/chunk-CLDPTMQY.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-DDRN42PB.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7O4NUJVO.js → chunk-DOVTUKJQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ECBOPEJE.js +75 -0
- package/dist/cli-bundle/focused-chunks/chunk-GITOYRUW.js +165 -0
- package/dist/cli-bundle/focused-chunks/chunk-GUIF3WVC.js +30 -0
- package/dist/cli-bundle/focused-chunks/chunk-LE4JUCRR.js +3 -0
- package/dist/cli-bundle/focused-chunks/{chunk-HFAW3FJQ.js → chunk-PSXFFQFT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-RHIH6XIW.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-UDYRVBOZ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-XV5RV4ZT.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-JCVMOSWQ.js → chunk-YMU42COG.js} +2 -2
- package/dist/cli-bundle/main.js +27 -27
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +32 -32
- 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 +55 -55
- 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 +10 -10
- 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/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 -1
- 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/preflight-ownership.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/fs/atomic-create.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/digest.js +1 -1
- package/dist/core/history/drift-cache.js +3 -3
- package/dist/core/history/drift-scan.d.ts +4 -0
- 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 +8 -7
- 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 -1
- 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 -1
- package/dist/core/item/actionability.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 +6 -4
- package/dist/core/item/item-record.js +1 -1
- package/dist/core/item/item-type-definition.js +1 -1
- package/dist/core/item/parent-reference-policy.js +1 -1
- package/dist/core/item/parse.js +8 -2
- 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-gc.js +1 -1
- package/dist/core/lock/lock.js +3 -3
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/output/output-control.js +1 -1
- package/dist/core/output/output.js +22 -10
- package/dist/core/output/query-summary.js +1 -1
- package/dist/core/output/tabular.js +3 -1
- 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.js +1 -1
- package/dist/core/profile/profile-plan.js +1 -1
- package/dist/core/profile/profile-presets.js +25 -1
- package/dist/core/reproducibility/context.js +1 -1
- package/dist/core/schema/fields-file.js +2 -2
- package/dist/core/schema/item-types-file.js +2 -2
- package/dist/core/schema/runtime-field-filters.js +1 -1
- package/dist/core/schema/runtime-field-values.js +1 -1
- package/dist/core/schema/runtime-schema.js +2 -2
- package/dist/core/schema/status-defs-file.js +2 -2
- package/dist/core/schema/status-token.js +1 -1
- package/dist/core/schema/type-inference.js +1 -1
- package/dist/core/schema/type-presets.js +1 -1
- package/dist/core/schema/type-workflows.js +1 -1
- package/dist/core/search/background-refresh.js +2 -2
- package/dist/core/search/bm25.js +1 -1
- package/dist/core/search/cache.js +2 -2
- package/dist/core/search/corpus.js +1 -1
- package/dist/core/search/embedding-batches.js +1 -1
- package/dist/core/search/eval-thresholds.js +1 -1
- package/dist/core/search/eval.js +1 -1
- package/dist/core/search/http-client.js +1 -1
- package/dist/core/search/providers.js +1 -1
- package/dist/core/search/relevance.js +1 -1
- package/dist/core/search/semantic-defaults.js +1 -1
- package/dist/core/search/staleness.js +1 -1
- package/dist/core/search/vector-stores.js +2 -2
- package/dist/core/search/vectorization-metadata.js +1 -1
- package/dist/core/sentry/helpers.js +1 -1
- package/dist/core/sentry/instrument.js +1 -1
- package/dist/core/session/session-state.js +1 -1
- package/dist/core/shared/agent-session-context.js +1 -1
- package/dist/core/shared/author.js +5 -1
- package/dist/core/shared/command-line.js +1 -1
- package/dist/core/shared/command-types.js +1 -1
- package/dist/core/shared/conflict-markers.js +1 -1
- package/dist/core/shared/constants.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/primitives.js +1 -1
- package/dist/core/shared/secret-rules.js +1 -1
- 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 -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 +7 -7
- package/dist/core/store/item-metadata-read-work.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-validator.js +1 -1
- package/dist/core/store/settings.js +3 -3
- package/dist/core/store/tracker-preflight.js +1 -1
- package/dist/core/telemetry/consent.js +2 -2
- 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 -5
- package/dist/core/test/background-runs.js +3 -3
- 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 +6 -4
- 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/refusal-closure-census.js +2 -1
- package/dist/sdk/agent/refusal-closure.js +1 -1
- package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
- package/dist/sdk/agent/refusal-reachability.js +3 -1
- package/dist/sdk/agent/subcommand-recovery.js +1 -1
- package/dist/sdk/agent/task-transcript-contracts.js +1 -1
- package/dist/sdk/agent/tracker-preflight-contracts.js +1 -1
- package/dist/sdk/agent-capability-contracts.js +3 -1
- 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/authoring.js +1 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/agent-output-contracts.js +5 -3
- 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 -1
- 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 +1 -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 -1
- package/dist/sdk/completion/fish.js +13 -7
- package/dist/sdk/completion/shared.js +1 -1
- package/dist/sdk/completion/zsh.js +14 -8
- package/dist/sdk/completion.js +1 -1
- package/dist/sdk/compose.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 -3
- 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/contracts.js +1 -1
- package/dist/sdk/core-governance.js +1 -1
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/corpus-shape.js +1 -1
- package/dist/sdk/define.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/agent-environment.js +1 -1
- package/dist/sdk/environment/host-environment-errors.js +1 -1
- package/dist/sdk/environment/project-runtime-compatibility.js +2 -1
- 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/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 +4 -2
- 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/migrations.js +2 -2
- 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 -4
- 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 +1 -1
- 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/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 +1 -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/coverage-assurance.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 +1 -1
- package/dist/sdk/governance/extension-host-version.js +1 -1
- package/dist/sdk/governance/gc.js +1 -1
- package/dist/sdk/governance/health-merge-evidence.js +1 -1
- package/dist/sdk/governance/health.js +2 -1
- package/dist/sdk/governance/hierarchy-validation.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 -1
- package/dist/sdk/governance/reindex.js +5 -4
- 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-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 -1
- package/dist/sdk/governance.js +1 -1
- package/dist/sdk/graph/adapter.js +1 -1
- 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/centrality.js +1 -1
- package/dist/sdk/graph/conformance.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/index.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/graph.js +1 -1
- package/dist/sdk/guide-topics.js +1 -1
- package/dist/sdk/guide.js +8 -1
- package/dist/sdk/history/attestation-command.js +1 -1
- 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/salvage.js +3 -2
- 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.js +1 -1
- package/dist/sdk/init-agent-guidance.js +16 -2
- package/dist/sdk/init.js +16 -2
- 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 +4 -2
- package/dist/sdk/lifecycle/claim.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/create.js +1 -1
- package/dist/sdk/lifecycle/delete.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/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 +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/reopen.js +1 -1
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +2 -1
- package/dist/sdk/lifecycle/restore.js +1 -1
- package/dist/sdk/lifecycle/shared-unset-fields.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 -1
- package/dist/sdk/lifecycle-completion.js +1 -1
- package/dist/sdk/lifecycle-policy.js +1 -1
- package/dist/sdk/linked-artifacts.js +2 -1
- package/dist/sdk/mcp/apps.js +1 -1
- package/dist/sdk/mcp/authorization.js +1 -1
- package/dist/sdk/mcp/discovery.js +1 -1
- package/dist/sdk/mcp/interactions.js +1 -1
- package/dist/sdk/mcp/protocol.js +1 -1
- package/dist/sdk/mcp/skills.js +3 -1
- 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 +1 -1
- package/dist/sdk/merge/index.js +1 -1
- package/dist/sdk/merge/install.js +4 -2
- 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/three-way.js +3 -2
- package/dist/sdk/merge/worktree-config.js +1 -1
- 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-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 -1
- 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 -1
- 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 -1
- package/dist/sdk/query/complete-list.js +1 -1
- package/dist/sdk/query/context.js +2 -1
- package/dist/sdk/query/duplicate-candidates.js +1 -1
- package/dist/sdk/query/get.d.ts +14 -2
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/history.js +1 -1
- package/dist/sdk/query/item-filter-options.js +1 -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-ready-budget.js +1 -1
- package/dist/sdk/query/next.js +2 -1
- 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 -1
- 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 -2
- package/dist/sdk/query/search/types.js +1 -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/workspace-contracts.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/read-output/continuation.js +1 -1
- package/dist/sdk/read-output/options.js +1 -1
- package/dist/sdk/read-output/provenance.js +1 -1
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.js +1 -1
- package/dist/sdk/read-output-session.js +1 -1
- package/dist/sdk/relationship-analytics.js +1 -1
- package/dist/sdk/relationship-context.js +1 -1
- package/dist/sdk/relationship-history.js +7 -4
- package/dist/sdk/relationship-kinds/contract.js +1 -1
- package/dist/sdk/relationship-migration.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/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.js +1 -1
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime-public-contracts.js +1 -1
- package/dist/sdk/runtime-stats-options.js +1 -1
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/scheduling-shortcuts.js +1 -1
- package/dist/sdk/schema-migration.js +4 -3
- package/dist/sdk/schema.js +7 -1
- 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 -3
- package/dist/sdk/templates.js +26 -2
- package/dist/sdk/test/batch.js +2 -2
- package/dist/sdk/test/entry.js +1 -1
- package/dist/sdk/test/execution.js +6 -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/runs.js +1 -1
- package/dist/sdk/test/trust.js +2 -2
- package/dist/sdk/test/workspace-snapshot.js +1 -1
- package/dist/sdk/testing.js +7 -4
- package/dist/sdk/traceability/runtime-files-lookup.js +1 -1
- package/dist/sdk/traceability/source-traceability.js +2 -1
- package/dist/sdk/tracker-root-discovery.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-recipe.js +1 -1
- package/dist/sdk/workspace-snapshot.js +5 -4
- package/dist/sdk/workspace-transaction-gc.js +1 -1
- package/dist/sdk/workspace-transaction.js +2 -2
- package/dist/sdk/workspace.js +3 -2
- package/dist/types/index.js +1 -1
- package/dist/types.js +1 -1
- package/docs/AGENT_EVIDENCE_CONSISTENCY.md +88 -0
- package/docs/GET_READ_EVIDENCE.md +68 -0
- package/docs/README.md +2 -0
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/extensions/vcs/index.ts +4 -2
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +2 -2
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +2 -2
- package/plugins/pm-codex/plugin.json +1 -1
- package/scripts/finalize-build.mjs +3 -2
- package/dist/cli-bundle/chunks/chunk-7UVXKI7K.js +0 -2
- package/dist/cli-bundle/chunks/chunk-D7Z2ZMJL.js +0 -3
- package/dist/cli-bundle/chunks/chunk-DEZPZOQ7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J52QIRRZ.js +0 -80
- package/dist/cli-bundle/chunks/chunk-JDKD3WGG.js +0 -6
- package/dist/cli-bundle/chunks/chunk-JQ7DW663.js +0 -2
- package/dist/cli-bundle/chunks/chunk-QXIDOOWT.js +0 -20
- package/dist/cli-bundle/chunks/chunk-SGFQQXFD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-V3U77H3V.js +0 -31
- package/dist/cli-bundle/chunks/chunk-XZDWAYJC.js +0 -3
- package/dist/cli-bundle/chunks/chunk-Y6VRBTP3.js +0 -238
- package/dist/cli-bundle/chunks/chunk-YAAFYFS4.js +0 -8
- package/dist/cli-bundle/chunks/register-mutation-53ZLT4RX.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-OBK2FXUU.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-HM3OCBH2.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2JFYR56O.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-32EVUSS4.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-5GUSO2P4.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-6XBRADQQ.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-CURTIIQT.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IJUWEEEB.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-JMJK2L4Z.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-KG3H4UZZ.js +0 -30
- package/dist/cli-bundle/focused-chunks/chunk-MHQ2XICU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-RJV6QVJE.js +0 -75
- package/dist/cli-bundle/focused-chunks/chunk-ZE2JZ7R6.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-ZLEN4HZD.js +0 -165
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{P as le,Wa as pe,l as ae}from"./chunk-SMKHR6BM.js";import{Qa as fe,o as R}from"./chunk-J52QIRRZ.js";import{$b as X,Al as de,Bl as me,Cl as ce,Jb as H,Ji as se,Nb as L,Ob as K,R as b,Rb as q,S as B,Sb as U,Wb as V,Xb as z,Yb as W,Zb as G,_b as Y,aa as C,ac as J,bc as Q,cc as Z,dc as ee,ec as re,fc as te,lc as ne,mc as oe,sb as v,sc as ie,wb as x,xb as D}from"./chunk-Y6VRBTP3.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="c06f3fb3-4b1f-5fdb-a9ce-bce8f88704aa")}catch{}})();function Ir(r){return r}function Mr(r){return r}function Ce(r,e){for(let t of e.commands??[])r.registerCommand(t);for(let[t,n]of Object.entries(e.commandOverrides??{}))r.registerCommand(t,n);for(let[t,n]of Object.entries(e.flags??{}))r.registerFlags(t,n);for(let[t,n]of Object.entries(e.parsers??{}))r.registerParser(t,n);for(let[t,n]of Object.entries(e.renderers??{}))if(typeof n=="function")r.registerRenderer(t,n);else{let{run:s,...o}=n;r.registerRenderer(t,s,o)}for(let[t,n]of Object.entries(e.services??{}))r.registerService(t,n)}function Re(r,e){for(let o of e.preflights??[])r.registerPreflight(o);let t=e.itemTypes??[];t.length>0&&r.registerItemTypes(t);let n=e.itemFields??[];n.length>0&&r.registerItemFields(n);let s=e.relationshipKinds??[];s.length>0&&r.registerRelationshipKinds(s);for(let o of e.migrations??[])r.registerMigration(o);for(let o of e.profiles??[])r.registerProfile(o)}function Ne(r,e){for(let t of e.searchProviders??[])r.registerSearchProvider(t);for(let t of e.vectorStoreAdapters??[])r.registerVectorStoreAdapter(t);for(let t of e.assuranceProviders??[])r.registerAssuranceMeasurementProvider(t);for(let t of e.importers??[])r.registerImporter(t.name,t.importer,t.options);for(let t of e.exporters??[])r.registerExporter(t.name,t.exporter,t.options)}function Se(r,e){for(let t of e.beforeCommand??[])r.hooks.beforeCommand(t);for(let t of e.beforeMutation??[])r.hooks.beforeMutation(t);for(let t of e.afterCommand??[])r.hooks.afterCommand(t);for(let t of e.onWrite??[])r.hooks.onWrite(t);for(let t of e.onRead??[])r.hooks.onRead(t);for(let t of e.onIndex??[])r.hooks.onIndex(t)}function Oe(r){let t={activate:async n=>{Ce(n,r),Re(n,r),Ne(n,r),Se(n,r.hooks??{}),await r.activate?.(n)}};return r.manifest&&(t.manifest=r.manifest),r.deactivate&&(t.deactivate=r.deactivate),t}function h(r){let e=r.flatMap(t=>t??[]);return e.length>0?e:void 0}function _(r){let e=Object.assign({},...r.map(t=>t??{}));return Object.keys(e).length>0?e:void 0}function Ae(r){let e={};for(let t of r)for(let[n,s]of Object.entries(t??{}))e[n]=[...e[n]??[],...s];return Object.keys(e).length>0?e:void 0}var Fe=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function Pe(r,e,t){let n=e.map(o=>o?.[t]),s=h(n);if(s!==void 0){let o=r;o[t]=s}}function Te(r){let e={};for(let t of Fe)Pe(e,r,t);return Object.keys(e).length>0?e:void 0}function jr(...r){let e={},t=(i,a)=>{a!==void 0&&(e[i]=a)};t("commands",h(r.map(i=>i.commands))),t("commandOverrides",_(r.map(i=>i.commandOverrides))),t("flags",Ae(r.map(i=>i.flags))),t("parsers",_(r.map(i=>i.parsers))),t("renderers",_(r.map(i=>i.renderers))),t("services",_(r.map(i=>i.services))),t("preflights",h(r.map(i=>i.preflights))),t("itemTypes",h(r.map(i=>i.itemTypes))),t("itemFields",h(r.map(i=>i.itemFields))),t("relationshipKinds",h(r.map(i=>i.relationshipKinds))),t("migrations",h(r.map(i=>i.migrations))),t("profiles",h(r.map(i=>i.profiles))),t("searchProviders",h(r.map(i=>i.searchProviders))),t("vectorStoreAdapters",h(r.map(i=>i.vectorStoreAdapters))),t("assuranceProviders",h(r.map(i=>i.assuranceProviders))),t("importers",h(r.map(i=>i.importers))),t("exporters",h(r.map(i=>i.exporters))),t("hooks",Te(r.map(i=>i.hooks)));let n;for(let i of r)i.manifest&&(n=i.manifest);t("manifest",n);let s=r.some(i=>i.activate);t("activate",s?async i=>{for(let a of r)a.activate&&await a.activate(i)}:void 0);let o=r.some(i=>i.deactivate);return t("deactivate",o?async()=>{let i=[];for(let a of[...r].reverse())if(a.deactivate)try{await a.deactivate()}catch(d){i.push(d)}if(i.length>0)throw i.length>1?new AggregateError(i,"Multiple extension blueprint deactivate hooks failed."):i[0]}:void 0),e}var Ie=[["commands","commands"],["commandOverrides","commands"],["flags","schema"],["itemTypes","schema"],["itemFields","schema"],["relationshipKinds","schema"],["migrations","schema"],["profiles","schema"],["parsers","parser"],["renderers","renderers"],["services","services"],["preflights","preflight"],["searchProviders","search"],["vectorStoreAdapters","search"],["assuranceProviders","services"],["importers","importers"],["exporters","importers"]];function $(r){return r?Array.isArray(r)?r.length>0:Object.keys(r).length>0:!1}function N(r){let e=new Set;for(let[s,o]of Ie)$(r[s])&&e.add(o);(r.commands??[]).filter(w).some(s=>s.flags!==void 0)&&e.add("schema");let t=[...r.importers??[],...r.exporters??[]].filter(w);t.some(s=>s?.options?.flags!==void 0)&&e.add("schema"),t.some(s=>typeof s=="object")&&e.add("commands");let n=r.hooks??{};return[n.beforeCommand,n.beforeMutation,n.afterCommand,n.onWrite,n.onRead,n.onIndex].some($)&&e.add("hooks"),[...e].sort((s,o)=>s.localeCompare(o))}var Me=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function l(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function w(r){return r!=null}function S(r){return v(`${r.name} import`)}function O(r){return v(`${r.name} export`)}function je(r,e,t){return[...r.map(n=>v(n.name)),...e.filter(n=>n.options!==void 0).map(S),...t.filter(n=>n.options!==void 0).map(O)]}function Be(r,e,t,n){return[...Object.keys(r.flags??{}).map(s=>v(s)),...e.filter(s=>s.flags!==void 0).map(s=>v(s.name)),...t.filter(s=>s.options?.flags!==void 0).map(S),...n.filter(s=>s.options?.flags!==void 0).map(O)]}function De(r){return Me.filter(([e])=>(r[e]?.length??0)>0).map(([,e])=>e)}function He(r){let e=Object.entries(r??{}).filter(([,t])=>typeof t!="function"&&((t.commands?.length??0)>0||t.resultDiscriminator!==void 0)).map(([t,n])=>{let s=n;return{format:t,commands:l((s.commands??[]).map(o=>v(o))),result_discriminator:s.resultDiscriminator!==void 0}}).sort((t,n)=>t.format.localeCompare(n.format));return e.length>0?{renderer_ownership:e}:{}}function Le(r){return!r||r.length===0?{}:{assurance_providers:l(r.map(e=>e.id))}}function Ke(r,e,t){return{item_types:l((r.itemTypes??[]).map(n=>n.name)),item_fields:l((r.itemFields??[]).map(n=>n.name)),...(r.relationshipKinds?.length??0)>0?{relationship_kinds:l(r.relationshipKinds.map(n=>n.kind))}:{},migrations:l((r.migrations??[]).flatMap(n=>typeof n.id=="string"?[n.id]:[])),profiles:l((r.profiles??[]).map(n=>n.name)),importers:l(e.map(n=>v(n.name))),exporters:l(t.map(n=>v(n.name))),search_providers:l((r.searchProviders??[]).map(n=>n.name)),vector_store_adapters:l((r.vectorStoreAdapters??[]).map(n=>n.name)),...Le(r.assuranceProviders),parser_overrides:l(Object.keys(r.parsers??{}).map(n=>v(n))),service_overrides:l(Object.keys(r.services??{}).map(n=>String(n).trim().toLowerCase())),renderer_overrides:l(Object.keys(r.renderers??{}).map(n=>String(n).trim().toLowerCase())),...He(r.renderers),preflight_overrides:(r.preflights??[]).length,preflight_ownership:(r.preflights??[]).map(n=>({commands:[...n.commands??[]]}))}}function qe(r){let e=(r.commands??[]).filter(w),t=(r.importers??[]).filter(w),n=(r.exporters??[]).filter(w),s=t.map(S),o=n.map(O),i=je(e,t,n),a=Be(r,e,t,n),d=r.hooks??{},c=Ke(r,t,n);return{capabilities:N(r),commands:l(i),command_overrides:l(Object.keys(r.commandOverrides??{}).map(E=>v(E))),command_handlers:l([...i,...s,...o]),hooks:De(d),flag_commands:l(a),...c}}var Ue=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function Ve(r){return(r.itemFields??[]).filter(e=>typeof e?.name=="string"&&se.has(e.name.trim())).map(e=>({code:"reserved_item_field",severity:"error",message:`Item field "${e.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:e.name}))}function ze(r){return[...Object.values(r.flags??{}).flat(),...(r.commands??[]).flatMap(t=>t.flags??[]),...(r.importers??[]).flatMap(t=>t.options?.flags??[]),...(r.exporters??[]).flatMap(t=>t.options?.flags??[])].flatMap(t=>{if(typeof t?.long!="string"&&typeof t?.short!="string")return[];let n=L(t.long,t.short);if(n===null)return[];let{token:s,failure:o}=n;return[{code:o,severity:"error",message:`Flag "${s}" ${K(s,o)}.`,field:s}]})}function ge(r){let e=new Set;for(let t of r){let n=D(t)??x(t);n!==null&&e.add(n)}return[...e].sort((t,n)=>t.localeCompare(n))}function We(r,e){let t=[];if(e===null)return r.length>0&&t.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${r.length===1?"capability":"capabilities"} [${r.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),t;let n=new Set(e),s=new Set(r);for(let o of r)n.has(o)||t.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${o}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${o}" to the manifest capabilities.`,capability:o});for(let o of e)s.has(o)||t.push({code:"capability_unused",severity:"warning",message:`Capability "${o}" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,capability:o});return t}function Ge(r){let e=[],t=new Map;for(let s of r.commands??[]){let o=v(s.name);t.set(o,(t.get(o)??0)+1)}for(let[s,o]of t)o>1&&e.push({code:"duplicate_command",severity:"warning",message:`Command "${s}" is declared ${o} times in commands; the later registration shadows the earlier one at dispatch.`,command:s});let n=new Set(Object.keys(r.commandOverrides??{}).map(s=>v(s)));for(let s of t.keys())n.has(s)&&e.push({code:"command_override_conflict",severity:"warning",message:`Command "${s}" is declared both as a new command definition and as a command override; register one or the other.`,command:s});return e}function Ye(r){let e=[];for(let t of Ue)t in r&&!$(r[t])&&e.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${t}" is present but empty; remove it or populate it.`,field:t});if("hooks"in r){let t=r.hooks??{};[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some($)||e.push({code:"empty_surface",severity:"warning",message:'Blueprint field "hooks" is present but registers no lifecycle hooks; remove it or populate it.',field:"hooks"})}return e}function k(r,e={}){let t=N(r),n=e.declaredCapabilities??r.manifest?.capabilities,s=Array.isArray(n)?ge(n):null,o=[...We(t,s),...Ge(r),...ze(r),...Ve(r),...Ye(r)];return{ok:o.every(i=>i.severity!=="error"),findings:o,used:t,declared:s}}function ve(r,e){let{additionalCapabilities:t,...n}=e,s=Array.isArray(t)?ge(t):[],o=[...new Set([...N(r),...s])].sort((i,a)=>i.localeCompare(a));return{...n,capabilities:o}}function Br(r,e){let t=ve(r,e);return{module:Oe({...r,manifest:t}),manifest:t}}function ue(r,e){if(r.status==="absent"||r.status==="ok")return null;let t=`${r.kind}_${r.status}`,n="";switch(t){case"pm_min_version_invalid":n=`pm_min_version "${r.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":n=`pm_min_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_min_version_unmet":n=`Requires pm >= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_invalid":n=`pm_max_version "${r.required}" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;break;case"pm_max_version_unchecked":n=`pm_max_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_max_version_exceeded":n=`Allows pm <= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":n=`Target pm ${e} is newer than pm_max_version ${r.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:t,severity:r.allowed?"warning":"error",constraint:r.kind,required:r.required,current:e,message:n}}function A(r,e){let t=q(r.pm_min_version,e.pmVersion),n=U(r.pm_max_version,e.pmVersion,e.pmMaxVersionExceededMode??"block"),o=H(r).findings.map(c=>({code:c.code,severity:"warning",constraint:"manifest",required:c.code==="manifest_unknown_key"?c.path:"pm_min_version",current:e.pmVersion,path:c.path,...c.suggested_key?{suggested_key:c.suggested_key}:{},message:c.message})),i=[],a=ue(t,e.pmVersion);a!==null&&i.push(a);let d=ue(n,e.pmVersion);return d!==null&&i.push(d),{compatible:t.allowed&&n.allowed,findings:[...o,...i],pmVersion:e.pmVersion}}var Xe=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function he(r,e={}){let t=k(r,{declaredCapabilities:e.declaredCapabilities}),n=e.identity?ve(r,e.identity):null,s=e.target?A(n??r.manifest??{},e.target):null,a=[...(n!==null&&e.declaredCapabilities===void 0?t.findings.filter(d=>!Xe.has(d.code)):t.findings).map(d=>({source:"blueprint",severity:d.severity,code:d.code,message:d.message})),...(s?.findings??[]).map(d=>({source:"compatibility",severity:d.severity,code:d.code,message:d.message}))];return{ok:a.every(d=>d.severity!=="error"),capabilities:t.used,blueprint:t,manifest:n,compatibility:s,findings:a}}(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="52ee6b9f-9465-52ec-9164-c5b21360d078")}catch{}})();function g(r,e){return r.name??e??""}var Je={before_command:"beforeCommand",before_mutation:"beforeMutation",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"},F={before_command:"beforeCommand",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"};function p(r){return r.trim().toLowerCase()}function ye(r){return p(r).replaceAll("-","_")}function u(r){return r?` from extension "${r}"`:""}function f(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function y(r){if(typeof r!="string")throw new Error('A command name string is required. Pass it via the options object, e.g. runRegisteredCommandForTest(activation, { command: "my command" }) \u2014 positional command arguments are not supported.');return r.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0).join(" ")}function m(r){return r.length>0?r.join(", "):"(none)"}function be(r,e,t){let n=new Set(r??[]),s=f(e.filter(o=>!n.has(o)));if(s.length>0)throw new Error(`Expected package manifest ${t} to include ${s.join(", ")}; available: ${m(f(r??[]))}`)}function we(r){let e=new Set;for(let t of r)typeof t.long=="string"&&t.long.trim().length>0&&e.add(t.long.trim()),typeof t.short=="string"&&t.short.trim().length>0&&e.add(t.short.trim());return e}function P(r){let e=b(r);if(!e)return{};let t=b(e.manifest);if(t)return t;let n=b(e.default),s=b(n?.manifest);return s||(n&&typeof e.default!="function"&&("name"in n||"capabilities"in n)?n:typeof r!="function"&&("name"in e||"capabilities"in e)?e:{})}function T(r,e){return e??(typeof r.name=="string"&&r.name.trim().length>0?r.name.trim():"test-extension")}function Ee(r,e){return Array.isArray(e.capabilities)?[...e.capabilities]:Array.isArray(r.capabilities)?r.capabilities.filter(t=>typeof t=="string"):[]}function xe(r,e,t){return{disabled_by_flag:!1,roots:{global:"",project:""},configured_enabled:[],configured_disabled:[],discovered:[],effective:[],warnings:[],policy:t.policy,failed:[],loaded:[{layer:t.layer,directory:"",manifest_path:"",name:t.name,version:typeof e.version=="string"?e.version:"0.0.0",entry:typeof e.entry=="string"?e.entry:"./index.js",priority:typeof e.priority=="number"?e.priority:0,entry_path:"",capabilities:t.capabilities,manifest_version:typeof e.manifest_version=="number"?e.manifest_version:void 0,pm_min_version:typeof e.pm_min_version=="string"?e.pm_min_version:void 0,pm_max_version:typeof e.pm_max_version=="string"?e.pm_max_version:void 0,engines:e.engines,trusted:e.trusted,provenance:e.provenance,sandbox_profile:e.sandbox_profile,permissions:e.permissions,activation:e.activation,module:r}]}}async function Qe(r,e={}){let t=P(r);return oe(xe(r,t,{name:T(t,e.name),layer:e.layer??"project",capabilities:Ee(t,e),policy:e.policy??C()}))}async function Ze(r,e={}){let t=P(r);return ne(xe(r,t,{name:T(t,e.name),layer:e.layer??"project",capabilities:Ee(t,{}),policy:C()}),e.activation,e.deactivateTimeoutMs===void 0?{}:{deactivate_timeout_ms:e.deactivateTimeoutMs})}async function I(r,e){let t=y(e.command);if(t.length===0)throw new Error("Expected command name must be a non-empty string");if(!r.handlers.some(a=>a.command===t)){let a=f(r.handlers.map(d=>d.command));throw new Error(`Expected a registered command handler for "${t}" to invoke. Available command handlers: ${m(a)}`)}if(e.sdk!==void 0&&e.sdkFactory!==void 0)throw new TypeError("runRegisteredCommandForTest accepts sdk or sdkFactory, not both");let s=e.pmRoot??"",o={json:!0,quiet:!0,noPager:!0,...e.global},i=e.sdk??e.sdkFactory?.({pmRoot:s,global:o})??(s.length>0?ae(s,new pe({pmRoot:s}),void 0,t):void 0);return J(r,{command:t,args:e.args?[...e.args]:[],options:e.options?{...e.options}:{},global:o,pm_root:s,...i===void 0?{}:{sdk:i}})}async function er(r,e){if((r.beforeMutation?.length??0)===0)throw new Error("Expected a registered before_mutation hook to invoke");await z(r,e.context)}async function rr(r,e){let t=e.kind;if(t==="before_mutation")throw new Error("Invoke before_mutation hooks with runRegisteredMutationGuardForTest so denials and failures retain fail-closed semantics.");if((r[F[t]]?.length??0)===0){let n=f(Object.keys(F).filter(s=>(r[F[s]]?.length??0)>0));throw new Error(`Expected a registered "${t}" hook to invoke. Hook kinds with registrations: ${m(n)}`)}switch(e.kind){case"before_command":return V(r,e.context);case"after_command":return W(r,e.context);case"on_read":return Y(r,e.context);case"on_write":return G(r,e.context);case"on_index":return X(r,e.context)}}async function tr(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered parser override for command "${t}" to invoke. Available parser override commands: ${m(f(r.overrides.map(n=>n.command)))}`);return Q(r,e)}async function nr(r,e){if(r.overrides.length===0)throw new Error("Expected a registered preflight override to invoke, but none are registered.");return Z(r,e)}async function or(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered command override for command "${t}" to invoke. Available command override commands: ${m(f(r.overrides.map(n=>n.command)))}`);return re(r,e)}async function ir(r,e){if(!r.overrides.some(t=>t.format===e.format))throw new Error(`Expected a registered renderer override for format "${e.format}" to invoke. Available renderer override formats: ${m(f(r.overrides.map(t=>t.format)))}`);return te(r,e)}async function sr(r,e){if(!r.overrides.some(t=>t.service===e.service))throw new Error(`Expected a registered service override for service "${e.service}" to invoke. Available service override services: ${m(f(r.overrides.map(t=>t.service)))}`);return ee(r,e)}var ar={query:["query"],embed:["embed"],embedBatch:["embedBatch","embed_batch"],queryExpansion:["queryExpansion","query_expansion"],rerank:["rerank"]};async function dr(r,e){let t=de(r,e.provider);if(!t){let o=f(r.search_providers.map(i=>i.definition.name));throw new Error(`Expected a registered search provider "${e.provider}" to invoke. Available search providers: ${m(o)}`)}let n=t.runtime_definition,s=ar[e.operation].map(o=>n[o]).find(o=>typeof o=="function");if(typeof s!="function")throw new Error(`Registered search provider "${e.provider}" does not implement the "${e.operation}" operation.`);return await s(e.context)}async function mr(r,e){let t=me(r,e.adapter);if(!t){let s=f(r.vector_store_adapters.map(o=>o.definition.name));throw new Error(`Expected a registered vector store adapter "${e.adapter}" to invoke. Available vector store adapters: ${m(s)}`)}let n=t.runtime_definition[e.operation];if(typeof n!="function")throw new Error(`Registered vector store adapter "${e.adapter}" does not implement the "${e.operation}" operation.`);return await n(e.context)}async function cr(r,e){let t=ke(r,{migration:e.migration,extensionName:e.extensionName}),n=ce(t).run;if(typeof n!="function")throw new Error(`Registered migration "${e.migration}" does not implement a run function to invoke.`);let s=t.definition.status,o={id:t.definition.id,command:"migration",layer:t.layer,extension:t.name,pm_root:e.pmRoot??"",status:(typeof s=="string"?s.trim().toLowerCase():"")||"pending"};return await n(o)}async function fr(r,e){let t=_e(r.registrations,{importer:e.importer,extensionName:e.extensionName});return I(r.commands,{command:`${t.importer} import`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}async function lr(r,e){let t=$e(r.registrations,{exporter:e.exporter,extensionName:e.extensionName});return I(r.commands,{command:`${t.exporter} export`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}function Qr(r,e={}){let t=e.deactivated??1;if(r.deactivated!==t)throw new Error(`Expected ${t} extension${t===1?"":"s"} to deactivate cleanly, but ${r.deactivated} did.`);let n=e.failed??0;if(r.failed.length!==n){let s=r.failed.map(o=>`${o.layer}:${o.name} (${o.error})`).join(", ");throw new Error(`Expected ${n} teardown failure${n===1?"":"s"}, but observed ${r.failed.length}${s.length>0?`: ${s}`:""}.`)}return r}function Zr(r,e){if(e.packageName!==void 0&&r.package_name!==e.packageName)throw new Error(`Expected package manifest package_name to be "${e.packageName}"; received "${r.package_name??"(none)"}"`);if(e.aliases!==void 0&&be(r.aliases,e.aliases,"aliases"),e.resources!==void 0)for(let[t,n]of Object.entries(e.resources))be(r.resources[t],n,`pm.${t}`);return r}function pr(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.commands.filter(i=>i.command===t),s=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!s){let i=r.commands.map(d=>d.command).sort((d,c)=>d.localeCompare(c)),a=e.extensionName?` from extension "${e.extensionName}"`:"";throw new Error(`Expected extension command "${t}"${a} to be registered. Available commands: ${m(i)}`)}if(e.action!==void 0&&s.action!==e.action)throw new Error(`Expected extension command "${t}" action "${e.action}", received "${s.action}"`);if(e.arguments!==void 0){let i=(s.arguments??[]).map(d=>d.name),a=e.arguments.filter(d=>!i.includes(d));if(a.length>0)throw new Error(`Expected extension command "${t}" arguments ${m(e.arguments)}; missing ${m(a)}; available ${m(i)}`)}let o=r.flags.filter(i=>i.target_command===t&&(e.extensionName===void 0||i.name===e.extensionName)).flatMap(i=>i.flags);if(e.flags!==void 0){let i=we(o),a=e.flags.filter(d=>!i.has(d));if(a.length>0)throw new Error(`Expected extension command "${t}" flags ${m(e.flags)}; missing ${m(a)}; available ${m([...i].sort((d,c)=>d.localeCompare(c)))}`)}return{command:s,flags:o}}function ur(r,e){let t=y(g(e,e.targetCommand));if(t.length===0)throw new Error("Expected target command name must be a non-empty string");let n=r.flags.filter(o=>o.target_command===t),s;if(e.extensionName)s=n.find(o=>o.name===e.extensionName);else if(n.length===1)s=n[0];else if(n.length>1){let o=f(n.map(i=>i.name));throw new Error(`Expected flags for target command "${t}" matched multiple extensions: ${m(o)}. Specify extensionName to choose one registration.`)}if(!s){let o=f(r.flags.map(a=>a.target_command)),i=f(n.map(a=>a.name));throw new Error(`Expected flags for target command "${t}"${u(e.extensionName)} to be registered. Available flag target commands: ${m(o)}; matching extensions: ${m(i)}`)}if(e.flags!==void 0){let o=we(s.flags),i=e.flags.filter(a=>!o.has(a));if(i.length>0)throw new Error(`Expected flags for target command "${t}" to include ${m(e.flags)}; missing ${m(i)}; available ${m([...o].sort((a,d)=>a.localeCompare(d)))}`)}return s}function gr(r,e){let t=Je[e.kind],n=r[t]??[],s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(n.map(i=>i.name));throw new Error(`Expected a "${e.kind}" hook${u(e.extensionName)} to be registered. Available "${e.kind}" hooks: ${m(o)}`)}return s}function vr(r,e){let t=p(g(e,e.provider));if(t.length===0)throw new Error("Expected search provider name must be a non-empty string");let n=r.search_providers.filter(o=>p(o.definition.name)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.search_providers.map(i=>i.definition.name));throw new Error(`Expected search provider "${t}"${u(e.extensionName)} to be registered. Available search providers: ${m(o)}`)}return s}function hr(r,e){let t=p(g(e,e.adapter));if(t.length===0)throw new Error("Expected vector store adapter name must be a non-empty string");let n=r.vector_store_adapters.filter(o=>p(o.definition.name)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.vector_store_adapters.map(i=>i.definition.name));throw new Error(`Expected vector store adapter "${t}"${u(e.extensionName)} to be registered. Available vector store adapters: ${m(o)}`)}return s}function _e(r,e){let t=p(g(e,e.importer));if(t.length===0)throw new Error("Expected importer name must be a non-empty string");let n=r.importers.filter(o=>p(o.importer)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.importers.map(i=>i.importer));throw new Error(`Expected importer "${t}"${u(e.extensionName)} to be registered. Available importers: ${m(o)}`)}return s}function $e(r,e){let t=p(g(e,e.exporter));if(t.length===0)throw new Error("Expected exporter name must be a non-empty string");let n=r.exporters.filter(o=>p(o.exporter)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.exporters.map(i=>i.exporter));throw new Error(`Expected exporter "${t}"${u(e.extensionName)} to be registered. Available exporters: ${m(o)}`)}return s}function yr(r,e){let t=p(g(e,e.field));if(t.length===0)throw new Error("Expected item field name must be a non-empty string");let s=r.item_fields.filter(o=>e.extensionName===void 0||o.name===e.extensionName).map(o=>({registration:o,field:o.fields.find(i=>p(i.name)===t)})).filter(o=>o.field!==void 0).find(o=>e.type===void 0||o.field.type===e.type);if(!s){let o=f(r.item_fields.flatMap(i=>i.fields.map(a=>`${a.name}:${a.type}`)));throw new Error(`Expected item field "${t}"${u(e.extensionName)} to be registered. Available item fields: ${m(o)}`)}return s}function br(r,e){let t=p(g(e,e.itemType));if(t.length===0)throw new Error("Expected item type name must be a non-empty string");let s=r.item_types.filter(o=>e.extensionName===void 0||o.name===e.extensionName).map(o=>({registration:o,itemType:o.types.find(i=>p(i.name)===t)})).filter(o=>o.itemType!==void 0).find(o=>e.folder===void 0||o.itemType.folder===e.folder);if(!s){let o=f(r.item_types.flatMap(i=>i.types.map(a=>`${a.name}:${a.folder}`)));throw new Error(`Expected item type "${t}"${u(e.extensionName)} to be registered. Available item types: ${m(o)}`)}return s}function wr(r,e){let t=ye(g(e,e.profile));if(t.length===0)throw new Error("Expected profile name must be a non-empty string");let n=r.profiles.filter(s=>e.extensionName===void 0||s.name===e.extensionName).find(s=>ye(s.profile.name)===t);if(!n){let s=f(r.profiles.map(o=>o.profile.name));throw new Error(`Expected profile "${t}"${u(e.extensionName)} to be registered. Available profiles: ${m(s)}`)}return{registration:n,profile:n.profile}}function Er(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(o=>o.command===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.command));throw new Error(`Expected command override "${t}"${u(e.extensionName)} to be registered. Available command overrides: ${m(o)}`)}return s}function xr(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(o=>o.command===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.command));throw new Error(`Expected parser override "${t}"${u(e.extensionName)} to be registered. Available parser overrides: ${m(o)}`)}return s}function _r(r,e={}){let t=e.extensionName?r.overrides.find(n=>n.name===e.extensionName):r.overrides[0];if(!t){let n=f(r.overrides.map(s=>s.name));throw new Error(`Expected a preflight override${u(e.extensionName)} to be registered. Available preflight overrides: ${m(n)}`)}return t}function $r(r,e){let t=p(g(e,e.format));if(t.length===0)throw new Error("Expected renderer format must be a non-empty string");let n=r.overrides.filter(o=>o.format===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.format));throw new Error(`Expected renderer override "${t}"${u(e.extensionName)} to be registered. Available renderer overrides: ${m(o)}`)}return s}function kr(r,e){let t=p(g(e,e.service));if(t.length===0)throw new Error("Expected service name must be a non-empty string");let n=r.overrides.filter(o=>p(o.service)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.service));throw new Error(`Expected service override "${t}"${u(e.extensionName)} to be registered. Available service overrides: ${m(o)}`)}return s}function ke(r,e){let t=p(g(e,e.migration));if(t.length===0)throw new Error("Expected migration id must be a non-empty string");let n=r.migrations.filter(a=>(e.extensionName===void 0||a.name===e.extensionName)&&typeof a.definition.id=="string"&&p(a.definition.id)===t),s=n.find(a=>e.mandatory===void 0||(a.definition.mandatory??!1)===e.mandatory);if(s)return s;let o=n[0];if(o!==void 0)throw new Error(`Expected migration "${t}"${u(e.extensionName)} to have mandatory=${e.mandatory}, but it is mandatory=${o.definition.mandatory??!1}.`);let i=f(r.migrations.map(a=>`${typeof a.definition.id=="string"&&a.definition.id.trim().length>0?a.definition.id.trim():"(unnamed)"}:${a.definition.mandatory===!0}`));throw new Error(`Expected migration "${t}"${u(e.extensionName)} to be registered. Available migrations: ${m(i)}`)}function Cr(r,e){let t=(d,c)=>{let E=new Set;for(let M of d){let j=x(M);if(j===null)throw new Error(`Expected ${c} capability "${M}" to be a known extension capability. Use canonical capability names (see manifest.capabilities).`);E.add(j)}return E},n=[...t(e.declared,"declared")].sort((d,c)=>d.localeCompare(c)),s=t(e.allowUnused??[],"allowUnused"),o=ie(r,{extensionName:e.extensionName}),i=new Set(o),a=n.filter(d=>!i.has(d)&&!s.has(d));if(a.length>0){let d=u(e.extensionName);throw new Error(`Expected every declared capability${d} to be exercised, but [${a.join(", ")}] ${a.length===1?"is":"are"} declared yet never registered against. Remove ${a.length===1?"it":"them"} from manifest.capabilities for least privilege, or pass allowUnused for capabilities registered only behind a runtime flag.`)}return{declared:n,used:o,unused:a}}function et(r,e={}){let t=k(r,e);if(!t.ok){let n=t.findings.filter(s=>s.severity==="error");throw new Error(`Extension blueprint failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
|
|
2
|
-
`+n.map(s=>` - [${s.code}] ${s.message}`).join(`
|
|
3
|
-
`))}return t}function rt(r,e={}){let t=le(r),n=t.findings.filter(s=>s.severity==="error"||e.strict===!0&&s.severity==="warning");if(n.length>0)throw new Error(`Project profile "${t.profile}" failed lint with ${n.length} ${n.length===1?"issue":"issues"}:
|
|
4
|
-
`+n.map(s=>` - ${s.severity} [${s.code}] ${s.message}`).join(`
|
|
5
|
-
`));return t}function tt(r,e){let t=Array.isArray(r.capabilities)?r.capabilities:[],n=k(e,{declaredCapabilities:t}),s=n.declared,o=new Set(s),i=new Set(n.used),a=n.used.filter(c=>!o.has(c)),d=s.filter(c=>!i.has(c));if(a.length>0||d.length>0){let c=[];throw a.length>0&&c.push(`missing [${a.join(", ")}] (the blueprint registers ${a.length===1?"a surface":"surfaces"} requiring ${a.length===1?"it":"them"}; activation throws extension_capability_missing)`),d.length>0&&c.push(`unused [${d.join(", ")}] (declared but no surface exercises ${d.length===1?"it":"them"}; drop for least privilege)`),new Error(`Manifest capabilities do not match the blueprint: ${c.join("; ")}. Set capabilities to synthesizeExtensionManifest(blueprint, identity).capabilities to stay in sync.`)}return{used:n.used,declared:s,missing:a,unused:d,findings:n.findings}}function nt(r,e){let t=A(r,e),n=t.findings.filter(s=>s.severity==="error");if(n.length>0)throw new Error(`Extension manifest is not compatible with pm ${t.pmVersion}: ${n.map(s=>s.message).join("; ")}`);return t}function ot(r,e={}){let t=he(r,e);if(!t.ok){let n=t.findings.filter(s=>s.severity==="error");throw new Error(`Extension failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
|
|
6
|
-
`+n.map(s=>` - [${s.source}:${s.code}] ${s.message}`).join(`
|
|
7
|
-
`))}return t}function Rr(r){if(!B(r))throw new Error("createExtensionTestHarness received a module with no activate export. Pass the extension module (with an activate(api) function on the module or its default export) as the first argument, and options second.")}async function it(r,e={}){Rr(r);let t=P(r),n=T(t,e.name),s=e.layer??"project",o=await Qe(r,e);if(o.failed.length>0){let i=o.failed.map(a=>{let d=a.trace?.missing_capability,c=d?`${a.error}; missing capability "${d}"`:a.error;return`${a.layer}:${a.name} (${c})`}).join(", ");throw new Error(`createExtensionTestHarness could not activate the extension cleanly: ${i}. Declare the required capability in the manifest (or pass it via options.capabilities), or use activateExtensionForTest directly to inspect a failed activation.`)}return{module:r,name:n,layer:s,activation:o,activationSummary(i){return R(o,i)},renderMarkdown(i={}){let{extensionName:a,...d}=i??{};return fe(R(o,{extensionName:a}),d)},assertCommandContract(i){return pr(o.registrations,i)},assertFlags(i){return ur(o.registrations,i)},assertItemField(i){return yr(o.registrations,i)},assertItemType(i){return br(o.registrations,i)},assertProfile(i){return wr(o.registrations,i)},assertHook(i){return gr(o.hooks,i)},assertCommandOverride(i){return Er(o.commands,i)},assertParserOverride(i){return xr(o.parsers,i)},assertPreflightOverride(i){return _r(o.preflight,i)},assertRendererOverride(i){return $r(o.renderers,i)},assertServiceOverride(i){return kr(o.services,i)},assertSearchProvider(i){return vr(o.registrations,i)},assertVectorStoreAdapter(i){return hr(o.registrations,i)},assertImporter(i){return _e(o.registrations,i)},assertExporter(i){return $e(o.registrations,i)},assertMigration(i){return ke(o.registrations,i)},assertCapabilityUsage(i){return Cr(o,i)},runCommand(i){return I(o.commands,i)},runHook(i){return rr(o.hooks,i)},runMutationGuard(i){return er(o.hooks,i)},runCommandOverride(i){return or(o.commands,i)},runParserOverride(i){return tr(o.parsers,i)},runPreflightOverride(i){return nr(o.preflight,i)},runRendererOverride(i){return ir(o.renderers,i)},runServiceOverride(i){return sr(o.services,i)},runSearchProvider(i){return dr(o.registrations,i)},runVectorStoreAdapter(i){return mr(o.registrations,i)},runMigration(i){return cr(o.registrations,i)},runImporter(i){return fr(o,i)},runExporter(i){return lr(o,i)},deactivate(i={}){return Ze(r,{name:n,layer:s,activation:o,deactivateTimeoutMs:i.deactivateTimeoutMs})}}}export{Ir as a,Mr as b,Oe as c,jr as d,N as e,qe as f,k as g,ve as h,Br as i,A as j,he as k,Qe as l,Ze as m,I as n,er as o,rr as p,tr as q,nr as r,or as s,ir as t,sr as u,dr as v,mr as w,cr as x,fr as y,lr as z,Qr as A,Zr as B,pr as C,ur as D,gr as E,vr as F,hr as G,_e as H,$e as I,yr as J,br as K,wr as L,Er as M,xr as N,_r as O,$r as P,kr as Q,ke as R,Cr as S,et as T,rt as U,tt as V,nt as W,ot as X,it as Y};
|
|
8
|
-
//# sourceMappingURL=chunk-YAAFYFS4.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{a as re,c as At,d as se,f as le,g as kt,h as _t,i as xt}from"./chunk-7CE2DJMA.js";import{$ as jt,A as vt,D as ht,E as bt,F as wt,W as Lt,X as Bt,Y as Ut,Z as Gt,_ as qt,aa as Vt,ba as zt,ca as Jt,da as ie,ea as ne,fa as ae,s as it,t as ct,u as ut,v as pt,w as ee,x as te,y as oe,z as yt}from"./chunk-SMKHR6BM.js";import"./chunk-XZDWAYJC.js";import{a as St}from"./chunk-D7Z2ZMJL.js";import"./chunk-JDKD3WGG.js";import"./chunk-SGFQQXFD.js";import{Pc as ft,Uc as mt,Wa as ot,bd as gt,mb as at,ub as rt,vc as Q,wb as st,xb as lt,yb as dt}from"./chunk-V3U77H3V.js";import{Aa as Xe,Ba as Ye,Ca as Ze,Da as Qe,Ea as et,K as W,Z as P,aa as xe,ba as Ce,ca as De,da as Ie,ea as Re,ga as Te,ha as Ee,ia as Oe,ja as Fe,ka as Me,la as Pe,ma as Ne,na as $e,oa as He,pa as Le,qa as Be,ra as Ue,sa as Ge,ta as qe,ua as je,va as Ve,wa as ze,xa as Je,ya as Ke,za as We}from"./chunk-J52QIRRZ.js";import{ua as nt,zb as Z}from"./chunk-QXIDOOWT.js";import"./chunk-DEZPZOQ7.js";import{$o as X,Gn as J,Go as K,Jf as h,Jo as _e,La as be,Ld as we,Mf as f,Nf as v,Nl as j,No as I,Ol as Ae,Ro as y,Ul as x,Uo as d,Vo as s,Wo as w,Xo as R,Zl as V,_o as N,a as ve,ab as D,am as z,ap as Y,bp as tt,cd as B,ce as U,ih as G,mp as b,na as p,pa as m,qa as he,qi as q,sl as Se,xo as ke,yl as C}from"./chunk-Y6VRBTP3.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]="48b9050b-3290-55d6-82cc-b9d14cc33186")}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]="f111051f-3880-5ff0-9138-5166cd8a93a9")}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]="e599b2e9-fc63-5982-b7cf-ae208c127f62")}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]="fd8685dd-856f-51b2-9bfa-f1df88acb070")}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]="e972ba26-a7b8-5e91-9e63-21416be686eb")}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]="a310e747-0cd7-5dff-b8a0-29d3c4ded9f3")}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]="f27f4c13-4b15-5536-bc5a-b1f263fab5db")}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]="529dd34d-5a81-504f-9641-28093d41d247")}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]="6e6bec6b-9415-5f41-87e8-2d1248fba748")}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]="fd91be06-efd5-5b43-895a-e47a1c144333")}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]="5760feb1-435b-5b0e-b4ed-c22f6a955bed")}catch{}})();var T={};ve(T,{PROFILE_SUBCOMMANDS:()=>Lt,formatProfileApplyHuman:()=>Jt,formatProfileLintHuman:()=>zt,formatProfileListHuman:()=>jt,formatProfileShowHuman:()=>Vt,runProfileApply:()=>qt,runProfileLint:()=>Gt,runProfileList:()=>Bt,runProfileShow:()=>Ut});(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]="2d367793-8aa5-5a00-8c8c-60512a27f62a")}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]="e8448334-e87d-5984-9e89-04e506e0a2a7")}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]="898eb13c-9378-5c0f-b431-a4f7b1ab7339")}catch{}})();async function de(e){typeof e.description=="string"&&e.description.trim()==="-"&&(e.description=await x().resolveValue(e.description,"--description")??"")}(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]="19b15a00-6395-566f-9b09-4aeb4084c10c")}catch{}})();async function Kt(e,t,o,i){let n=y(i),r=await yt(e,t,{status:typeof o.status=="string"?o.status:void 0,author:typeof o.author=="string"?o.author:n.author,message:typeof o.message=="string"?o.message:void 0,force:o.force===!0},n);await b(n,r),f(r,n)}async function Wt(e,t){let o=y(t),i=await x().resolveValue("-","--stdin-json");if(i===void 0||i.trim().length===0)throw new m("pm item mutate requires a non-empty JSON batch on stdin.",p.USAGE);let n=typeof e.transactionId=="string"?e.transactionId.trim():"";if(n.length===0)throw new m("pm item mutate requires --transaction-id <value>.",p.USAGE);let r=D(process.cwd(),o.path),a=await q(r),l=At(i,{transactionId:n,idPrefix:a.id_prefix}),{mutations:c,references:u}=l,g=re(e),S=G(typeof e.author=="string"?e.author:o.author,a.author_default);if(e.dryRun===!0){let M=await le({pmRoot:r,transactionId:n,author:S,mutations:c});f({transaction_id:n,dry_run:!0,validation:M,mutation_count:c.length,mutations:c,references:u},o);return}let A=await kt({pmRoot:r,transactionId:n,author:S,mutations:c,...g});f({...A,mutation_count:c.length,references:u},o)}function Xt(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():typeof t=="string"?t.trim():""}async function Yt(e,t,o,i){let n=y(i),r=typeof o.transactionId=="string"?o.transactionId.trim():"";if(r.length===0)throw new m("pm item complete requires --transaction-id <value>.",p.USAGE);let a=Xt(t,o.reason);if(a.length===0)throw new m("pm item complete requires a close reason.",p.USAGE);let c=Object.fromEntries(["file","doc","test","comment","note","learning"].filter(k=>o[k]!==void 0).map(k=>[k,o[k]])),u=o.force===!0,{lockTtlSeconds:g,lockWaitMs:S}=re(o),A={...typeof o.resolution=="string"?{resolution:o.resolution}:{},...typeof o.expectedResult=="string"?{expectedResult:o.expectedResult}:{},...typeof o.actualResult=="string"?{actualResult:o.actualResult}:{},...typeof o.completedAt=="string"?{completedAt:o.completedAt}:{},...typeof o.validateClose=="string"?{validateClose:o.validateClose}:{},...u?{force:!0}:{}},M={id:e,reason:a,...Object.keys(c).length===0?{}:{evidence:c},...Object.keys(A).length===0?{}:{closeOptions:A},...u?{releaseOptions:{force:!0}}:{}},L=D(process.cwd(),n.path),ye=G(typeof o.author=="string"?o.author:n.author,(await q(L)).author_default);if(o.dryRun===!0){let k=_t(M),Ht=await le({pmRoot:L,transactionId:r,author:ye,mutations:k});f({transaction_id:r,dry_run:!0,validation:Ht,mutation_count:k.length,mutations:k},n);return}let ge=await xt({pmRoot:L,transactionId:r,author:ye,...M,lockTtlSeconds:g,lockWaitMs:S});f({...ge,mutation_count:Object.keys(ge.results).length},n)}function Ct(e){let t=e.commands.find(o=>o.name()==="item")??e.command("item").description("Run item lifecycle operations.");t.command("reopen <id> <reason>").option("--status <value>","Active target status: open or in_progress").option("--message <value>","Human-readable recurrence history message").option("--force","Override ownership or stale-lock conflicts").option("--author <value>","Mutation author").description("Reopen terminal work with recurrence evidence.").action(Kt),t.command("mutate").requiredOption("--transaction-id <value>","Stable idempotency key used to resume an interrupted batch").option("--stdin-json","Read the JSON mutation array from stdin",!0).option("--dry-run","Validate and preview the batch without writing").option("--create-compensation <mode>","Created-item compensation policy: close or delete","close").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--author <value>","Mutation author").description("Apply SDK-backed mutations atomically.").action(Wt),t.command("complete <id> [reason]").requiredOption("--transaction-id <value>","Stable idempotency key for the composed completion").option("--reason <value>","Close reason when omitted positionally").option("--file <value>","Linked file evidence",d).option("--doc <value>","Linked documentation evidence",d).option("--test <value>","Linked test evidence",d).option("--comment <value>","Evidence comment",d).option("--note <value>","Completion note",d).option("--learning <value>","Durable completion learning",d).option("--resolution <value>","Structured resolution evidence").option("--expected-result <value>","Expected result evidence").option("--actual-result <value>","Actual result evidence").option("--completed-at <value>","Actual completion time").option("--validate-close <mode>","Close validation: off, warn, or strict").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--dry-run","Validate and preview completion without writing").option("--force","Override lifecycle and ownership conflicts").option("--author <value>","Completion author").description("Close with evidence and release the claim.").action(Yt)}(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]="771083a4-6b0a-530d-b607-bf1c1010ff0e")}catch{}})();async function Zt(e,t){let o=y(t),i=Array.isArray(e.event)?e.event:[],n=await ot(D(process.cwd(),o.path),{historyEvent:i,allActionable:e.allActionable===!0,dryRun:e.dryRun===!0,planFingerprint:s(e,"planFingerprint"),limit:e.limit,attributedAuthor:s(e,"attributedAuthor"),reviewer:s(e,"reviewer"),reason:s(e,"reason")});f(n,o)}function Dt(e){e.command("history-author-acknowledge").option("--event <item-id:line>","Unknown-author event coordinate (repeatable)",d).option("--all-actionable","Select all actionable events").option("--dry-run","Preview a deterministic source-bound plan").option("--plan-fingerprint <sha256>","Apply the exact fingerprint returned by --dry-run").option("--limit <n>","Maximum coordinate rows returned in the plan").option("--attributed-author <value>","Reviewed principal attribution").option("--reviewer <value>","Disposition reviewer").option("--reason <value>","Review evidence").description("Append audited dispositions for immutable unknown-author events.").action(Zt)}(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]="53ca90df-8382-5cc2-8906-8491afe5101a")}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]="e2514244-d31d-5ee4-b037-b9101f9a24e1")}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]="10a4ed4d-39d3-5b7b-87b1-4a6f95f0f2ab")}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]="796e71dc-4693-50da-bbb8-57b19ff0af95")}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]="dc9822ba-df3c-5179-827e-ef2551786b14")}catch{}})();function ce(e,t,o,i){if(t.trim().toLowerCase()!=="add"||!o?.trim())return;let n=s(i,"add")??s(i,"text")??s(i,"note")??s(i,"body")??s(i,"comment"),r=s(i,"file"),a=[e,o.trim()];n!==void 0?a.push("--add",n):i.stdin===!0?a.push("--stdin"):r!==void 0?a.push("--file",r):a.push("--add","-");let l=B(a),c=B([e,o.trim(),"--add","-"]);throw new m(`The positional token "add" was parsed as the item id, while "${o.trim()}" was parsed as annotation text. ${e} does not use an add subcommand.`,p.USAGE,{code:"annotation_transposed_subcommand",reason:"noun_verb_object_transposition",required:`Place the item id immediately after ${e}, then use --add for annotation text.`,examples:[...new Set([l,c])],recovery:{attempted_command:`pm ${e} add ${o.trim()}`,normalized_args:[e,"add",o.trim()],parsed_positionals:[{role:"transposed_subcommand",value:"add"},{role:"item_id",value:o.trim()}],suggested_retry:l}})}function It(e,t,o){let i=o.flatMap(r=>{let a=s(t,r);return a===void 0?[]:[{alias:r,value:a}]});if([...new Set(i.map(({value:r})=>r))].length>1)throw new m(`Specify ${e} text with one alias or the same value across aliases: ${i.map(({alias:r})=>`--${r}`).join(", ")}`,p.USAGE,{code:"annotation_alias_conflict"});return i[0]?.value}function Qt(e,t){let o=typeof t.edit=="number"?t.edit:void 0,i=typeof t.delete=="number"?t.delete:void 0,n=It("comment",t,["add","text","body","comment"]),r=typeof e=="string"?e:void 0,a=t.stdin===!0,l=s(t,"file");if(+(n!==void 0)+ +(r!==void 0)+Number(a)+ +(l!==void 0)>1)throw n!==void 0&&r!==void 0&&!a&&l===void 0?new m("Specify comment text either as positional [text] or with --add, not both",p.USAGE):new m("Specify comment text with exactly one source: positional [text], --add, --stdin, or --file",p.USAGE);let u=n??r;return{add:u,readFromStdin:a,readFromFile:l,editIndex:o,deleteIndex:i,isMutation:typeof u=="string"||a||l!==void 0||o!==void 0||i!==void 0}}function Rt(e,t,o){let i=It(e,o,e==="note"?["add","text","note"]:["add","text"]),n=typeof t=="string"?t:void 0;if(i!==void 0&&n!==void 0)throw new m(`Specify ${e} text either as positional [text] or with --add, not both`,p.USAGE);let r=i??n,a=e==="note"?s(o,"addJson"):void 0,l=o.stdin===!0,c=s(o,"file"),u=typeof o.edit=="number"?o.edit:void 0,g=typeof o.delete=="number"?o.delete:void 0;return{add:r,addJson:a,readFromStdin:l,readFromFile:c,editIndex:u,deleteIndex:g,isMutation:typeof r=="string"||a!==void 0||l||c!==void 0||u!==void 0||g!==void 0}}async function eo(e,t,o,i){let n=y(i),r=Date.now();ce("comments",e,t,o);let a=Qt(t,o),l=await it(e,{add:a.add,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:s(o,"author"),message:s(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},n);a.isMutation&&l.changed!==!1&&await b(n,l),ue("comments",l,n,r)}async function to(e,t,o,i){let n=y(i),r=Date.now();ce("notes",e,t,o);let a=Rt("note",t,o),l=await wt(e,{add:a.add,addJson:a.addJson,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),since:s(o,"since"),eventType:s(o,"eventType"),includeMeta:o.includeMeta===!0,fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:s(o,"author"),message:s(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},n);a.isMutation&&l.changed!==!1&&await b(n,l),ue("notes",l,n,r)}async function oo(e,t,o,i){let n=y(i),r=Date.now();ce("learnings",e,t,o);let a=Rt("learning",t,o),l=await ct(e,{add:a.add,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:s(o,"author"),message:s(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},n);a.isMutation&&l.changed!==!1&&await b(n,l),ue("learnings",l,n,r)}function ue(e,t,o,i){f(t,o),o.profile&&v(`profile:command=${e} took_ms=${Date.now()-i}`)}function Tt(e,t){let o=e.command("comments").argument("<id>","Item id").argument("[text]","Optional comment text shorthand (equivalent to --add)").option("--add <text>","Append comment text; use text=<value> for structured input or - for stdin").option("--stdin","Read comment text from stdin (supports multiline markdown)").option("--file <path>","Read comment text from a file or stdin (-)").option("--edit <index>","Replace one comment using positional text, --add, --stdin, or --file",t("--edit")).option("--delete <index>","Delete the comment at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n comments").option("--full-history","Return complete comment history instead of a bounded mutation receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Comment author; defaults to PM_AUTHOR or settings").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete comments for an item.").action(eo);w(o,"--body <text>","Alias for --add",!1),w(o,"--text <text>","Alias for --add",!1),w(o,"--comment <text>","Alias for --add",!1);let i=e.command("notes").argument("<id>","Item id").argument("[text]","Optional note text shorthand for --add").option("--add <text>","Add a text note (- reads stdin)").option("--note <text>","Alias for --add").option("--add-json <json>","Append a JSON event").option("--stdin","Read note text from stdin").option("--file <path>","Read note from file or stdin (-)").option("--edit <index>","Replace a 1-based note using the selected text input",t("--edit")).option("--delete <index>","Delete the note at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n notes").option("--since <timestamp>","Filter JSON events from this ISO time").option("--event-type <value>","Filter JSON events by top-level type").option("--include-meta","Include count and truncation metadata").option("--full-history","Return complete note history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Author; defaults to PM_AUTHOR/settings").option("--message <value>","History message").option("--force","Force ownership override").description("Manage merge-safe text notes and JSON context events.").action(to);w(i,"--text <text>","Alias for --add",!1);let n=e.command("learnings").argument("<id>","Item id").argument("[text]","Optional learning text shorthand for --add").option("--add <text>","Append learning text; use text=<value> or - for stdin").option("--stdin","Read learning text from stdin").option("--file <path>","Read learning text from a file or stdin (-)").option("--edit <index>","Replace one learning using positional text, --add, --stdin, or --file",t("--edit")).option("--delete <index>","Delete the learning at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n learnings").option("--full-history","Return complete learning history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Learning author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete learnings for an item.").action(oo);w(n,"--text <text>","Alias for --add",!1)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2cac3cd9-887c-56e0-a197-cc36d2203c9e")}catch{}})();function pe(e,t){return o=>{let i=Number(o);if(!Number.isInteger(i)||i<t)throw new m(`${e} must be an integer greater than or equal to ${t}.`,p.USAGE);return i}}async function io(e,t,o){let i=y(o);if(t.scope!==void 0&&t.scope!=="project"&&t.scope!=="global")throw new m("--scope must be either project or global.",p.USAGE);let n=await lt({paths:e,scope:t.scope,limit:typeof t.limit=="number"?t.limit:void 0,offset:typeof t.offset=="number"?t.offset:void 0,noTruncate:t.noTruncate===!0,strictRead:t.strictRead===!0,explain:t.explain===!0,lineRange:typeof t.lines=="string"?rt(t.lines):void 0,decisionDepth:typeof t.decisionDepth=="number"?t.decisionDepth:void 0},i);f(n,i)}function Et(e){e.command("lookup").argument("<paths...>","Project-relative or absolute source paths").option("--scope <scope>","Restrict links to project or global scope").option("--limit <n>","Maximum referencing items to return",pe("--limit",1)).option("--offset <n>","Number of referencing items to skip",pe("--offset",0)).option("--no-truncate","Return every referencing item").option("--strict-read","Fail when any authoritative item cannot be read").option("--explain","Include ranked source-to-work rationale").option("--lines <start:end>","Attribute an inclusive source line range").option("--decision-depth <n>","Maximum governing-decision relationship depth",pe("--decision-depth",1)).description("Find and explain pm items that govern requested source paths.").action(io)}(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]="89de1556-ed75-5c37-bc98-164490364567")}catch{}})();var no=["add-","apply-","list-","remove-","show-"],ao=new Set(["field","fields","help","status","statuses","type","types"]);function fe(e){let t=e.trim(),o=t.toLowerCase();return o.length===0?!1:t[0]===o[0]||ao.has(o)||no.some(i=>o.startsWith(i))}function $(e){if(e!=null){if(typeof e=="number"){if(!Number.isInteger(e))throw new m("--order must be a finite integer.",p.USAGE);return e}if(typeof e=="string"){if(e.trim().length===0)return;let t=Number(e);if(!Number.isInteger(t))throw new m("--order must be a finite integer.",p.USAGE);return t}throw new m("--order must be a finite integer.",p.USAGE)}}(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]="9e5f7e21-caa0-5a5c-9d38-36d834aba1e0")}catch{}})();function E(e){if(Array.isArray(e))return e;if(typeof e=="string")return[e]}var O={};ve(O,{SCHEMA_SUBCOMMANDS:()=>De,_testOnlySchemaCommand:()=>et,formatSchemaAddFieldHuman:()=>Ke,formatSchemaAddStatusHuman:()=>qe,formatSchemaAddTypeHuman:()=>Ue,formatSchemaApplyPresetHuman:()=>Ze,formatSchemaEvolutionMigrationHuman:()=>Ce,formatSchemaInferTypesHuman:()=>Qe,formatSchemaListFieldsHuman:()=>Xe,formatSchemaListHuman:()=>Ve,formatSchemaRemoveFieldHuman:()=>We,formatSchemaRemoveStatusHuman:()=>je,formatSchemaRemoveTypeHuman:()=>Ge,formatSchemaShowFieldHuman:()=>Ye,formatSchemaShowHuman:()=>ze,formatSchemaShowStatusHuman:()=>Je,runSchemaAddField:()=>Pe,runSchemaAddStatus:()=>Te,runSchemaAddType:()=>Ie,runSchemaApplyPreset:()=>Le,runSchemaEvolutionMigration:()=>xe,runSchemaInferTypes:()=>Be,runSchemaList:()=>Oe,runSchemaListFields:()=>$e,runSchemaRemoveField:()=>Ne,runSchemaRemoveStatus:()=>Ee,runSchemaRemoveType:()=>Re,runSchemaShow:()=>Fe,runSchemaShowField:()=>He,runSchemaShowStatus:()=>Me,runWorkflowPolicyAction:()=>P});(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]="a4b4d693-ba4c-529a-a5d4-8f6c874830ad")}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]="19c403ea-a458-5118-992c-1c68e83c702d")}catch{}})();function ro(e,t){let o=t.normalizedSubcommand;return o!=="rename-type"&&o!=="rename-field"&&o!=="remap-status"?null:e.runSchemaEvolutionMigration({kind:o,from:t.typeName,to:s(t.options,"to"),...o==="rename-field"&&typeof t.options.type=="string"?{type:t.options.type}:{}},{migrationId:s(t.options,"migrationId")??s(t.options,"migration_id"),dryRun:t.options.dryRun===!0,author:t.author,force:t.force},t.globalOptions)}function so(e,t){let{normalizedSubcommand:o,typeName:i,globalOptions:n,author:r,force:a}=t;switch(o){case"list":return e.runSchemaList(n);case"show":return e.runSchemaShow(i,n);case"show-status":return e.runSchemaShowStatus(i,n);case"list-fields":return e.runSchemaListFields(n);case"show-field":return e.runSchemaShowField(i,n);case"remove-type":return e.runSchemaRemoveType(i,{author:r,force:a},n);case"remove-field":return e.runSchemaRemoveField(i,{author:r,force:a},n);case"remove-status":return e.runSchemaRemoveStatus(i,{author:r,force:a},n);case"apply-preset":return e.runSchemaApplyPreset(i,{author:r,force:a},n);default:return null}}async function lo(e,t){let{normalizedSubcommand:o,typeName:i,options:n,globalOptions:r}=t,{author:a,force:l,description:c}=t,u=ro(e,t);if(u)return u;let g=so(e,t);if(g)return g;switch(o){case"add-field":return e.runSchemaAddField(i,{type:typeof n.type=="string"?n.type:void 0,commands:t.commands,description:c,cliFlag:typeof n.cliFlag=="string"?n.cliFlag:void 0,alias:t.aliases,required:!!n.required,requiredOnCreate:!!n.requiredOnCreate,allowUnset:n.allowUnset!==!1,requiredTypes:t.requiredTypes,author:a,force:l},r);case"add-status":return e.runSchemaAddStatus(i,{role:t.roles,alias:t.aliases,description:c,order:t.order,author:a,force:l},r);default:return n.infer===!0?e.runSchemaInferTypes({minCount:t.minCount,apply:!!n.apply,author:a,force:l},r):e.runSchemaAddType(i,{description:c,defaultStatus:t.defaultStatus,folder:typeof n.folder=="string"?n.folder:void 0,alias:t.aliases,author:a,force:l},r)}}function co(e,t){if("migration_id"in t){h(`${e.formatSchemaEvolutionMigrationHuman(t)}
|
|
2
|
-
`);return}switch(t.action){case"list":h(`${e.formatSchemaListHuman(t)}
|
|
3
|
-
`);return;case"show":h(`${e.formatSchemaShowHuman(t)}
|
|
4
|
-
`);return;case"show-status":h(`${e.formatSchemaShowStatusHuman(t)}
|
|
5
|
-
`);return;case"list-fields":h(`${e.formatSchemaListFieldsHuman(t)}
|
|
6
|
-
`);return;case"show-field":h(`${e.formatSchemaShowFieldHuman(t)}
|
|
7
|
-
`);return;case"remove-type":h(`${e.formatSchemaRemoveTypeHuman(t)}
|
|
8
|
-
`);break;case"remove-field":h(`${e.formatSchemaRemoveFieldHuman(t)}
|
|
9
|
-
`);break;case"apply-preset":h(`${e.formatSchemaApplyPresetHuman(t)}
|
|
10
|
-
`);break;case"infer-types":h(`${e.formatSchemaInferTypesHuman(t)}
|
|
11
|
-
`);break;case"add-field":h(`${e.formatSchemaAddFieldHuman(t)}
|
|
12
|
-
`);break;case"add-status":h(`${e.formatSchemaAddStatusHuman(t)}
|
|
13
|
-
`);break;case"remove-status":h(`${e.formatSchemaRemoveStatusHuman(t)}
|
|
14
|
-
`);break;default:h(`${e.formatSchemaAddTypeHuman(t)}
|
|
15
|
-
`);break}t.warnings.length>0&&v(`schema ${t.action} warnings: ${N(t.warnings)}`)}function Ot(e){if(Array.isArray(e))return e.flatMap(t=>t.split(",")).map(t=>t.trim()).filter(t=>t.length>0)}async function uo(e,t,o,i){let n=y(i),r=Date.now(),{SCHEMA_SUBCOMMANDS:a}=O,l=(e??"").trim().toLowerCase(),c=t;if(po(l,a),!a.includes(l)&&c===void 0&&!fe(e)&&(c=e,l="add-type"),!a.includes(l))throw C({command_path:"schema",token:l,allowed:a});let u=we.find(g=>g===l);if(Se(l,o.dryRun===!0),u)f(await P(u,t,{definition:o.definition,policy:s(o,"policy"),message:s(o,"message"),author:s(o,"author"),dryRun:o.dryRun===!0},n),n);else{let g=await lo(O,{normalizedSubcommand:l,typeName:c,options:o,aliases:E(o.alias),roles:E(o.role),commands:Ot(o.commands),requiredTypes:Ot(o.requiredTypes),defaultStatus:s(o,"defaultStatus")??s(o,"default_status"),order:$(o.order),minCount:$(o.minCount),author:s(o,"author"),force:!!o.force,description:s(o,"description"),globalOptions:n});n.json===!0||n.defaultOutputFormat==="json"?f(g,n):n.quiet||co(O,g)}n.profile&&v(`profile:command=schema took_ms=${Date.now()-r}`)}function po(e,t){if(!e)throw new m(`pm schema requires a subcommand. Allowed: ${t.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:["pm schema list","pm schema show Task","pm schema show-status open",'pm schema add-type Spike --description "Time-boxed investigation" --default-status open',"pm schema remove-type Spike","pm schema add-status review --role active --alias in_review","pm schema remove-status review","pm schema add-field severity_level --type string --commands create,update","pm schema list-fields","pm schema apply-preset agile","pm schema add-type --infer --min-count 10","pm schema rename-type Spike --to Experiment --migration-id spike-v2 --dry-run","pm schema rename-field severity --to impact --migration-id severity-v2","pm schema remap-status review --to verifying --migration-id review-v2"]})}function Ft(e){let t=e.command("schema").option("--definition <json>","Policy or proposed fields JSON").option("--policy <id>","Policy id for policy-approve").option("--message <text>","Audit rationale for a policy mutation").argument("[subcommand]","Required; schema verb (list/show, add/remove, rename/remap, policy-*), or custom type shorthand").argument("[name]","Definition/source name or item id; policy-mode: advise|refuse").option("--description <text>","Type, status, or field description").option("--default-status <status>","Default status for this type").option("--folder <dir>","Storage folder for items of this custom type").option("--alias <name>","Alias for the custom type, status, or field flag (repeatable, csv-friendly)",d).option("--role <value>","Lifecycle role for a custom status (repeatable): draft, active, blocked, terminal, terminal_done, terminal_canceled, default_open, default_close, default_cancel",d).option("--order <n>","Display/sort order for a custom status").optionsGroup("Field options (add-field):").option("--type <type>","Value type for a custom field (add-field): string, number, boolean, string_array, array, object").option("--commands <list>","Field commands (repeatable/csv): create, update, update_many, list, search, calendar, context",d).option("--cli-flag <flag>","Override the auto-derived CLI flag for a custom field (add-field)").option("--required","Mark a custom field as always required (add-field)").option("--required-on-create","Mark a custom field as required at create time (add-field)").option("--no-allow-unset","Disallow clearing a custom field via --unset (add-field)").option("--required-types <list>","Restrict a custom field's requirement to specific item types (add-field; repeatable, comma-friendly)",d).optionsGroup("Type inference and migration options:").option("--infer","Infer custom item types from title-prefix conventions (add-type; preview unless --apply)").option("--min-count <n>","Minimum items sharing a prefix for add-type --infer (default 10)").option("--apply","Register inferred types (add-type --infer); without it the command previews only").option("--to <name>","Target definition name for rename/remap migrations").option("--migration-id <id>","Stable idempotency key for a resumable schema migration").option("--dry-run","Preview rename/remap migrations and workflow-policy actions without writes").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("Manage types, statuses, fields, presets, and workflow policies.");w(t,"--default_status <status>","Alias for --default-status",!1),w(t,"--migration_id <id>","Alias for --migration-id",!1),t.action(uo)}(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]="3418cfe8-745d-5f3c-9d14-8293e7296875")}catch{}})();var fo=new Set(he.map(e=>e.toLowerCase())),mo=new Set(ke.map(e=>e==="estimate"?"estimatedMinutes":e));async function yo(e,t,o,i,n){switch(t){case"list":return e.runProfileList();case"show":return e.runProfileShow(o);case"lint":return e.runProfileLint(o);default:return e.runProfileApply(o,{dryRun:i.dryRun===!0,author:typeof i.author=="string"?i.author:void 0,force:i.force===!0},n)}}function go(e,t){switch(t.action){case"list":h(`${e.formatProfileListHuman(t)}
|
|
16
|
-
`);return;case"show":h(`${e.formatProfileShowHuman(t)}
|
|
17
|
-
`);return;case"lint":h(`${e.formatProfileLintHuman(t)}
|
|
18
|
-
`);return;default:h(`${e.formatProfileApplyHuman(t)}
|
|
19
|
-
`),t.warnings.length>0&&v(`profile apply warnings: ${N(t.warnings)}`);break}}function vo(e){return t=>{let o=Number(t);if(!Number.isInteger(o)||o<1)throw new m(`${e} must be a positive integer (1-based index).`,p.USAGE);return o}}function Mt(e,t){e.option("--filter-has-notes",`Select only items that have notes before ${t}`).option("--filter-no-notes",`Select only items that have no notes before ${t}`).option("--filter-has-learnings",`Select only items that have learnings before ${t}`).option("--filter-no-learnings",`Select only items that have no learnings before ${t}`).option("--filter-has-files",`Select only items that have linked files before ${t}`).option("--filter-no-files",`Select only items that have no linked files before ${t}`).option("--filter-has-docs",`Select only items that have linked docs before ${t}`).option("--filter-no-docs",`Select only items that have no linked docs before ${t}`).option("--filter-has-tests",`Select only items that have linked tests before ${t}`).option("--filter-no-tests",`Select only items that have no linked tests before ${t}`).option("--filter-has-comments",`Select only items that have comments before ${t}`).option("--filter-no-comments",`Select only items that have no comments before ${t}`).option("--filter-has-deps",`Select only items that have dependencies before ${t}`).option("--filter-no-deps",`Select only items that have no dependencies before ${t}`).option("--filter-has-body",`Select only items that have a non-empty body before ${t}`).option("--filter-empty-body",`Select only items with an empty body before ${t}`).option("--filter-has-linked-command",`Select only items whose linked tests carry a runnable command before ${t}`).option("--filter-no-linked-command",`Select only items whose linked tests carry no runnable command before ${t}`).option("--filter-reviewer-missing",`Select only items missing reviewer before ${t}`).option("--filter-risk-missing",`Select only items missing risk before ${t}`).option("--filter-confidence-missing",`Select only items missing confidence before ${t}`).option("--filter-sprint-missing",`Select only items missing sprint before ${t}`).option("--filter-release-missing",`Select only items missing release before ${t}`)}var ho=[["filterHasNotes","filterNoNotes","--filter-has-notes","--filter-no-notes"],["filterHasLearnings","filterNoLearnings","--filter-has-learnings","--filter-no-learnings"],["filterHasFiles","filterNoFiles","--filter-has-files","--filter-no-files"],["filterHasDocs","filterNoDocs","--filter-has-docs","--filter-no-docs"],["filterHasTests","filterNoTests","--filter-has-tests","--filter-no-tests"],["filterHasComments","filterNoComments","--filter-has-comments","--filter-no-comments"],["filterHasDeps","filterNoDeps","--filter-has-deps","--filter-no-deps"],["filterHasBody","filterEmptyBody","--filter-has-body","--filter-empty-body"],["filterHasLinkedCommand","filterNoLinkedCommand","--filter-has-linked-command","--filter-no-linked-command"]];function Pt(e){let t=o=>e[o]===!0?!0:void 0;for(let[o,i,n,r]of ho)if(e[o]===!0&&e[i]===!0)throw new m(`Cannot combine ${n} with ${r} for the same field.`,p.USAGE);return{filterReviewerMissing:t("filterReviewerMissing"),filterRiskMissing:t("filterRiskMissing"),filterConfidenceMissing:t("filterConfidenceMissing"),filterSprintMissing:t("filterSprintMissing"),filterReleaseMissing:t("filterReleaseMissing"),hasNotes:t("filterHasNotes"),hasLearnings:t("filterHasLearnings"),hasFiles:t("filterHasFiles"),hasDocs:t("filterHasDocs"),hasTests:t("filterHasTests"),hasComments:t("filterHasComments"),hasDeps:t("filterHasDeps"),hasBody:t("filterHasBody"),hasLinkedCommand:t("filterHasLinkedCommand"),noNotes:t("filterNoNotes"),noLearnings:t("filterNoLearnings"),noFiles:t("filterNoFiles"),noDocs:t("filterNoDocs"),noTests:t("filterNoTests"),noComments:t("filterNoComments"),noDeps:t("filterNoDeps"),emptyBody:t("filterEmptyBody"),noLinkedCommand:t("filterNoLinkedCommand")}}function me(e,t){for(let o of t){let i=[],n=e.args,r=a=>(e.args!==n&&(i.length=0,n=e.args),i.push(a),i);o.required?e.requiredOption(o.option,o.description):o.repeatable?e.option(o.option,o.description,r):e.option(o.option,o.description);for(let a of o.aliasOptions??[])J(o.option,a.option)?w(e,a.option,a.description,o.repeatable===!0,o.repeatable?r:void 0):o.repeatable?e.option(a.option,a.description,r):e.option(a.option,a.description)}}function bo(e){let t=o=>typeof e[o]=="string"?e[o]:void 0;return{type:t("filterType"),tag:t("filterTag"),priority:t("filterPriority"),deadlineBefore:t("filterDeadlineBefore"),deadlineAfter:t("filterDeadlineAfter"),updatedAfter:t("filterUpdatedAfter"),updatedBefore:t("filterUpdatedBefore"),createdAfter:t("filterCreatedAfter"),createdBefore:t("filterCreatedBefore"),ids:t("ids"),assignee:t("filterAssignee"),assigneeFilter:t("filterAssigneeFilter")??t("filterAssignee_filter"),parent:t("filterParent"),sprint:t("filterSprint"),release:t("filterRelease"),filterAcMissing:e.filterAcMissing===!0?!0:void 0,filterEstimatesMissing:e.filterEstimatesMissing===!0||e.filterEstimateMissing===!0?!0:void 0,filterResolutionMissing:e.filterResolutionMissing===!0?!0:void 0,filterMetadataMissing:e.filterMetadataMissing===!0?!0:void 0,...Pt(e),limit:t("limit"),offset:t("offset"),includeBody:!0}}function F(...e){for(let t of e)if(typeof t=="string")return t}function wo(e,t,o){return typeof t=="string"&&t.length>0?{positionalType:e,positionalTitle:t}:typeof e!="string"||e.length===0?{positionalType:void 0,positionalTitle:void 0}:typeof o.title=="string"&&o.title.trim().length>0&&o.type===void 0?{positionalType:e,positionalTitle:void 0}:{positionalType:void 0,positionalTitle:e}}function So(e,t,o){if(e!==void 0||typeof t!="string"||t.length===0||o.title!==void 0||o.type!==void 0||!fo.has(t.trim().toLowerCase()))return;let i=t.trim();throw new m(`pm create needs a title \u2014 "${i}" looks like an item type, not a title. Use either: pm create ${i} "<title>" or pm create "<title>" --type ${i}.`,p.USAGE,{code:"create_positional_type_without_title",why:'Without this guard the single positional is used as the title and the type defaults to Task \u2014 so the command would silently create a Task literally titled "'+i+'".',examples:[`pm create ${i} "Wire up SSO for the agent harness"`,`pm create "Wire up SSO for the agent harness" --type ${i}`],nextSteps:[`Re-run with both type and title: pm create ${i} "<title>"`]})}var Ao=["body","bodyFile","description","dep","depRemove","comment","note","learning","file","test","doc","reminder","event","typeOption","field","ids"];function H(e){let t=Ao.flatMap(o=>{let i=e[o],n=typeof i=="string"&&i.trim()==="-"?1:Array.isArray(i)?i.filter(a=>typeof a=="string"&&a.trim()==="-").length:0,r=`--${o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`)}`;return Array.from({length:n},()=>r)});if(e.stdinJson===!0&&t.unshift("--stdin-json"),t.length>1)throw new m(`Only one option may consume stdin per command invocation. Found: ${t.join(", ")}.`,p.USAGE)}function Nt(e,t,o){let i=[];t&&i.push("body"),o&&i.push("description"),Ae(e,i)}function $t(e,t){return!t&&typeof e.description=="string"&&e.description.trim()==="-"}async function ko(e,t,o,i){let n=y(i),r=Date.now();H(o);let a=o.stdinJson===!0;if(a){let A=await x().resolveValue("-","--stdin-json");o=se(A??"","create",o)}let l=wo(e,t,o);So(l.positionalType,l.positionalTitle,o),typeof l.positionalType=="string"&&l.positionalType.length>0&&o.type===void 0&&(o.type=l.positionalType),typeof l.positionalTitle=="string"&&l.positionalTitle.length>0&&o.title===void 0&&(o.title=l.positionalTitle);let c=$t(o,a);a||await de(o);let u=typeof o.bodyFile=="string";u&&(o.body=await z(String(o.bodyFile),o.body!==void 0?String(o.body):void 0),delete o.bodyFile);let g=X(o,{requireType:!1});Nt(g,u,c),a&&j(g);let S=await ft(g,n);await b(n,S),f(S,n),n.profile&&v(`profile:command=create took_ms=${Date.now()-r}`)}function _o(e){return{type:s(e,"filterType"),tag:s(e,"filterTag"),priority:s(e,"filterPriority"),deadlineBefore:s(e,"filterDeadlineBefore"),deadlineAfter:s(e,"filterDeadlineAfter"),updatedAfter:s(e,"filterUpdatedAfter"),updatedBefore:s(e,"filterUpdatedBefore"),createdAfter:s(e,"filterCreatedAfter"),createdBefore:s(e,"filterCreatedBefore"),ids:s(e,"ids"),assignee:s(e,"filterAssignee"),assigneeFilter:F(e.filterAssigneeFilter,e.filterAssignee_filter),parent:s(e,"filterParent"),sprint:s(e,"filterSprint"),release:s(e,"filterRelease"),...Pt(e),limit:s(e,"limit"),offset:s(e,"offset")}}async function xo(e,t){let o=y(t),i=Date.now();H(e),e.ids=await V(s(e,"ids"));let n=await pt({status:s(e,"filterStatus"),list:_o(e),reason:s(e,"reason"),completedAt:s(e,"completedAt"),resolution:s(e,"resolution"),expectedResult:F(e.expectedResult,e.expected_result,e.expected),actualResult:F(e.actualResult,e.actual_result,e.actual),validateClose:e.validateClose===!0?"warn":s(e,"validateClose"),author:s(e,"author"),message:s(e,"message"),force:!!e.force,dryRun:e.dryRun===!0?!0:void 0,rollback:s(e,"rollback"),checkpoint:e.checkpoint===!1?!1:void 0},o);await b(o,n),f(n,o),o.profile&&v(`profile:command=close-many took_ms=${Date.now()-i}`)}async function Co(e,t){let o=y(t),i=Date.now();H(e),e.ids=await V(s(e,"ids"));let n=await bt({status:s(e,"filterStatus"),list:bo(e),update:Y(tt(e)),dryRun:e.dryRun===!0?!0:void 0,rollback:s(e,"rollback"),checkpoint:e.checkpoint===!1?!1:void 0},o);await b(o,n),f(await I("update-many",[],e,o,n),o),o.profile&&v(`profile:command=update-many took_ms=${Date.now()-i}`)}async function Do(e,t,o,i){let n=y(i),r=Date.now(),a=typeof o.reason=="string"&&o.reason.trim().length>0&&o.reason||typeof o.closeReason=="string"&&o.closeReason.trim().length>0&&o.closeReason||void 0,l=typeof t=="string"&&t.length>0?t:a,u=await(o.releaseAssignment===!0?gt:Q)(e,l,{author:s(o,"author"),message:s(o,"message"),validateClose:o.validateClose===!0?"warn":s(o,"validateClose"),force:!!o.force,duplicateOf:s(o,"duplicateOf"),completedAt:s(o,"completedAt"),resolution:s(o,"resolution"),expectedResult:F(o.expectedResult,o.expected_result,o.expected),actualResult:F(o.actualResult,o.actual_result,o.actual)},n);await b(n,u),f(u,n),n.profile&&v(`profile:command=close took_ms=${Date.now()-r}`)}function Io(e){let t={...e},o=[["blocked_by","blockedBy"],["resume_context","resumeContext"],["from_search","fromSearch"],["step_title","stepTitle"],["step_body","stepBody"],["step_owner","stepOwner"],["step_status","stepStatus"],["step_evidence","stepEvidence"],["step_blocked_reason","stepBlockedReason"],["step_replacement","stepReplacement"],["depends_on","dependsOn"],["link_kind","linkKind"],["link_note","linkNote"],["promote_to_item_dep","promoteToItemDep"],["allow_multiple_active","allowMultipleActive"],["decision_text","decisionText"],["decision_rationale","decisionRationale"],["decision_evidence","decisionEvidence"],["discovery_text","discoveryText"],["validation_text","validationText"],["validation_command","validationCommand"],["validation_expected","validationExpected"],["materialize_type","materializeType"],["materialize_parent","materializeParent"],["materialize_tags","materializeTags"]];for(let[n,r]of o)t[n]!==void 0&&t[r]===void 0&&(t[r]=t[n]);let i=X(t,{requireType:!1});return i.blockedBy=t.blockedBy,i}function Ro(e,t){if(!e)throw new m(`pm plan requires a subcommand. Allowed: ${t.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:['pm plan create --title "Refactor lock retry"',"pm plan show pm-a1b2 --depth standard",'pm plan add-step pm-a1b2 --step-title "Read lock.ts"']});if(t.includes(e))return;throw C({command_path:"plan",token:e,allowed:t,examples:e==="list"||e==="ls"?["pm list --type Plan","pm list-all --type Plan"]:void 0,retry_command:e==="list"||e==="ls"?"pm list --type Plan":void 0})}function To(e,t){if(e!=="reorder-step"||typeof t!="string")return;let o=Number.parseInt(t,10);if(!Number.isFinite(o))throw new m(`reorder-step requires an integer new order, got "${t}"`,p.USAGE);return o}async function Eo(e,t,o,i,n,r){let a=y(r),l=Date.now(),c=(e??"").trim().toLowerCase();Ro(c,vt);let u=Io(n),g=To(c,i),S=c==="create"&&typeof t=="string"&&t.length>0&&u.title===void 0?void 0:t;S===void 0&&typeof t=="string"&&t.length>0&&(u.title=t);let A=await ht({subcommand:c,id:S,stepRef:o,reorderTo:g,options:u,global:a});await b(a,A),f(A,a),a.profile&&v(`profile:command=plan took_ms=${Date.now()-l}`)}async function Oo(e,t,o){if(e!==void 0)throw new m("merge reconcile takes no positional arguments.",p.USAGE);let i=await ae({dryRun:t.dryRun===!0,force:t.force===!0,message:typeof t.message=="string"?t.message:void 0,author:o.author},o);f(i,o),i.ok||(process.exitCode=p.GENERIC_FAILURE)}async function Fo(e,t,o,i,n,r){if(e===void 0||t===void 0||o===void 0||i===void 0)throw new m("merge driver requires <artifact> <base> <ours> <theirs> (git supplies %O %A %B). Example: pm merge driver history %O %A %B",p.USAGE);let a=await ne({artifact:e,basePath:t,oursPath:o,theirsPath:i,outputPath:typeof n.output=="string"?n.output:void 0,itemPath:typeof n.itemPath=="string"?n.itemPath:void 0,prefer:typeof n.prefer=="string"?n.prefer:void 0},r);f(a,r),a.ok||(process.exitCode=p.GENERIC_FAILURE)}async function Mo(e,t,o,i,n,r,a){let l=y(a),c=Date.now();switch(e.trim().toLowerCase()){case"install":{if(t!==void 0)throw new m("merge install takes no positional arguments.",p.USAGE);let g=await W({dryRun:r.dryRun===!0},l);f(g,l);break}case"reconcile":await Oo(t,r,l);break;case"report":{if(t!==void 0)throw new m("merge report takes no positional arguments.",p.USAGE);let g=await Z({includeReconciled:r.includeReconciled===!0});f(g,l),g.ok||(process.exitCode=p.GENERIC_FAILURE);break}case"driver":await Fo(t,o,i,n,r,l);break;default:throw C({command_path:"merge",token:e,allowed:U,display_name:"merge"})}l.profile&&v(`profile:command=merge took_ms=${Date.now()-c}`)}async function Po(e,t,o){let i=y(o),n=Date.now(),r=await ee(e,{title:s(t,"title"),author:s(t,"author"),message:s(t,"message"),allowDuplicate:t.allowDuplicate===!0},i);await b(i,r),f(r,i),i.profile&&v(`profile:command=copy took_ms=${Date.now()-n}`)}async function No(e,t,o){let i=y(o),n=Date.now(),r=await oe(e,{clear:t.clear===!0},i);f(r,i),i.profile&&v(`profile:command=focus took_ms=${Date.now()-n}`)}async function $o(e,t,o){let i=y(o),n=Date.now();H(t);let r=t.stdinJson===!0;if(r){let g=await x().resolveValue("-","--stdin-json");t=se(g??"","update",t)}let a=$t(t,r);r||await de(t);let l=typeof t.bodyFile=="string";l&&(t.body=await z(String(t.bodyFile),t.body!==void 0?String(t.body):void 0),delete t.bodyFile);let c=Y(t);Nt(c,l,a),r&&j(c);let u=await mt(e,c,i);await b(i,u),f(await I("update",[e],t,i,u),i),i.profile&&v(`profile:command=update took_ms=${Date.now()-n}`)}async function Ho(e,t,o){let i=y(o),n=Date.now(),r=await te(e,{author:s(t,"author"),message:s(t,"message"),force:!!t.force,dryRun:t.dryRun===!0},i);r.dry_run!==!0&&await b(i,r),f(r,i),i.profile&&v(`profile:command=delete took_ms=${Date.now()-n}`)}function Lo(e,t){let o=s(t,"body"),i=s(t,"text"),n=typeof e=="string"?e:void 0;if([o,i,n].filter(l=>l!==void 0).length>1)throw new m("Specify append text with exactly one source: positional [text], --body, or --text",p.USAGE);let a=o??i??n;if(a===void 0)throw new m("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).",p.USAGE);return a}async function Bo(e,t,o,i){let n=y(i),r=Date.now(),a=await ut(e,{body:Lo(t,o),author:s(o,"author"),message:s(o,"message"),force:!!o.force},n);await b(n,a),f(a,n),n.profile&&v(`profile:command=append took_ms=${Date.now()-r}`)}async function Uo(e,t,o,i){let n=y(i),r=Date.now(),{PROFILE_SUBCOMMANDS:a}=T,l=(e??"").trim().toLowerCase();if(!l)throw new m(`pm profile requires a subcommand. Allowed: ${a.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:["pm profile list","pm profile show agile","pm profile apply agile --dry-run","pm profile lint agile"]});if(!a.includes(l))throw C({command_path:"profile",token:l,allowed:a});let c=await yo(T,l,t,o,n);n.json===!0||n.defaultOutputFormat==="json"?f(c,n):n.quiet||go(T,c),c.action==="lint"&&!c.ok&&(process.exitCode=p.GENERIC_FAILURE),n.profile&&v(`profile:command=profile took_ms=${Date.now()-r}`)}function _(e,t){return E(e[t])??[]}async function Go(e,t,o){let i=y(o),n=Date.now(),r=_(t,"add"),a=_(t,"addGlob"),l=_(t,"remove"),c=_(t,"migrate"),u=await st(e,{add:r,addGlob:a,remove:l,migrate:c,note:s(t,"note"),list:!!t.list,appendStable:!!t.appendStable,validatePaths:!!t.validatePaths,author:s(t,"author"),message:s(t,"message"),force:!!t.force},i);(r.length>0||a.length>0||l.length>0||c.length>0)&&await b(i,u),f(await I("files",[e],t,i,u),i),i.profile&&v(`profile:command=files took_ms=${Date.now()-n}`)}async function qo(e,t,o){let i=y(o),n=Date.now(),r={...o.optsWithGlobals(),...t},a=await dt(e,{apply:!!r.apply,note:s(r,"note"),appendStable:!!r.appendStable,author:s(r,"author"),message:s(r,"message"),force:!!r.force},i);a.changed&&await b(i,a),f(a,i),i.profile&&v(`profile:command=files.discover took_ms=${Date.now()-n}`)}async function jo(e,t,o){let i=y(o),n=Date.now(),r=_(t,"add"),a=_(t,"addGlob"),l=_(t,"remove"),c=_(t,"migrate"),u=await at(e,{add:r,addGlob:a,remove:l,migrate:c,note:s(t,"note"),list:!!t.list,validatePaths:!!t.validatePaths,author:s(t,"author"),message:s(t,"message"),force:!!t.force},i);(r.length>0||a.length>0||l.length>0||c.length>0)&&await b(i,u),f(await I("docs",[e],t,i,u),i),i.profile&&v(`profile:command=docs took_ms=${Date.now()-n}`)}async function Vo(e,t,o){let i=y(o),n=Date.now(),r=await nt(e,{format:t.format,maxDepth:s(t,"maxDepth"),collapse:t.collapse,summary:t.summary===!0,full:t.full===!0,nodeLimit:s(t,"nodeLimit"),edgeLimit:s(t,"edgeLimit"),tokenBudget:s(t,"tokenBudget"),cursor:s(t,"cursor"),direction:s(t,"direction"),...Array.isArray(t.kind)?{kind:t.kind}:{}},i);f(r,i),i.profile&&v(`profile:command=deps took_ms=${Date.now()-n}`)}function Hn(e,t={}){let o=e.command("create").argument("[type-or-title]",'Item title, or item type when a title follows (e.g. `pm create task "Fix bug"`)').argument("[title]","Item title when the first argument is an item type").description("Create a new project management item.");if(me(o,K),o.option("--stdin-json","Read a full item JSON document from stdin; explicit flags override document values").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--allow-duplicate","Explicitly create even when strict similarity governance finds likely duplicates").action(ko),t.targetCommandName==="create")return;e.command("copy").argument("<id>","Source item id").option("--title <value>","Optional title override for the copied item").option("--author <value>","Mutation author").option("--message <value>","History message").option("--allow-duplicate","Explicitly copy even when strict similarity governance finds likely duplicates").description("Copy an item into a new item id while resetting lifecycle fields.").action(Po),e.command("focus").argument("[id]","Item id to focus (omit to show current focus)").option("--clear","Clear the focused item").description("Set/clear/show the session focused item that new items default --parent to.").action(No);let i=e.command("update").argument("<id>","Item id").description("Update item fields and metadata.");me(i,_e),i.option("--stdin-json","Read a full item JSON document from stdin; explicit flags override document values").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--replace-deps","Atomically replace dependency entries with the provided --dep values").option("--replace-tests","Atomically replace linked test entries with the provided --test values").option("--replace-files","Atomically replace linked file entries with the provided --file values").option("--replace-docs","Atomically replace linked doc entries with the provided --doc values").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--force","Force ownership override"),i.action($o),Ct(e);let n=e.command("update-many").description("Bulk-update matched items with dry-run plans and rollback checkpoints.").option("--filter-status <value>","Filter by status before applying updates").option("--filter-type <value>","Filter by item type before applying updates").option("--filter-tag <value>","Filter by tag before applying updates").option("--filter-priority <value>","Filter by priority before applying updates").option("--filter-deadline-before <value>","Filter by deadline upper bound before applying updates").option("--filter-deadline-after <value>","Filter by deadline lower bound before applying updates").option("--filter-updated-after <value>","Filter by updated_at lower bound before applying updates (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before applying updates (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before applying updates (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before applying updates (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before applying updates").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before applying updates").option("--filter-parent <value>","Filter by parent item ID before applying updates").option("--filter-sprint <value>","Filter by sprint before applying updates").option("--filter-release <value>","Filter by release before applying updates").option("--filter-ac-missing","Select only items missing acceptance_criteria (bulk backfill)").option("--filter-estimates-missing","Select only items missing estimated_minutes (bulk backfill)").option("--filter-resolution-missing","Select only terminal items missing resolution (bulk backfill)").option("--filter-metadata-missing","Select only items missing any tracked metadata (AC, estimate, or resolution)");Mt(n,"applying updates"),n.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--dry-run","Preview per-item diffs and checkpoint intent without mutating").option("--rollback <value>","Rollback a prior update-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode").option("--title, -t <value>","Set title").option("--description, -d <value>","Set description").option("--body, -b <value>","Set body (allow empty string)").option("--status, -s <value>","Set status (use close command for closed)").option("--priority, -p <value>","Set priority").option("--type <value>","Set type").option("--tags <value>","Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively.").option("--add-tags <value>","Add tags additively without replacing existing (repeatable; CSV accepted)",d).option("--remove-tags <value>","Remove tags from the existing list (repeatable; CSV accepted)",d).option("--deadline <value>","Set deadline (ISO/date string or relative)").option("--estimate, --estimated-minutes <value>","Set estimated minutes").option("--acceptance-criteria <value>","Set acceptance criteria").option("--ac <value>","Alias for --acceptance-criteria").option("--add-ac <value>","Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",d).option("--remove-ac <value>","Remove one semicolon-free acceptance criterion by exact text match (repeatable)",d).option("--definition-of-ready <value>","Set definition of ready").option("--order <value>","Set planning order/rank integer").option("--rank <value>","Alias for --order").option("--goal <value>","Set goal identifier").option("--objective <value>","Set objective identifier").option("--value <value>","Set business value summary").option("--impact <value>","Set business impact summary").option("--outcome <value>","Set expected outcome summary").option("--why-now <value>","Set why-now rationale").option("--assignee <value>","Set assignee").option("--parent <value>","Set parent item ID").option("--reviewer <value>","Set reviewer").option("--risk <value>","Set risk level").option("--confidence <value>","Set confidence level").option("--sprint <value>","Set sprint identifier").option("--release <value>","Set release identifier").option("--blocked-by <value>","Set blocked-by item ID or reason").option("--blocked-reason <value>","Set blocked reason").option("--unblock-note <value>","Set unblock rationale note").option("--reporter <value>","Set issue reporter").option("--severity <value>","Set issue severity").option("--environment <value>","Set issue environment context").option("--repro-steps <value>","Set issue reproduction steps").option("--resolution <value>","Set issue resolution summary").option("--expected-result <value>","Set issue expected behavior").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Set issue observed behavior").option("--actual <value>","Short alias for --actual-result").option("--affected-version <value>","Set affected version identifier").option("--fixed-version <value>","Set fixed version identifier").option("--component <value>","Set issue component ownership").option("--regression [value]","Set regression marker; bare flag means true, or pass true|false|1|0").option("--customer-impact <value>","Set customer impact summary").option("--dep <value>","Add dependency entry id=<id>,kind=<kind>,author=<author>,created_at=<timestamp>",d).option("--dep-remove <value>","Remove dependency entries by id/kind/author/timestamp signature",d).option("--replace-deps","Atomically replace dependency entries with provided --dep values").option("--replace-tests","Atomically replace linked tests with provided --test values").option("--replace-files","Atomically replace linked files with provided --file values").option("--replace-docs","Atomically replace linked docs with provided --doc values").option("--comment <value>","Add comment seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--note <value>","Add note seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--learning <value>","Add learning seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--file <value>","Add linked file path=<value>,scope=<project|global>,note=<text>",d).option("--test <value>","Add linked test command=<value>,path=<value>,scope=<project|global>",d).option("--doc <value>","Add linked doc path=<value>,scope=<project|global>,note=<text>",d).option("--reminder <value>","Add reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>",d).option("--event <value>","Add event entry start=<iso|relative>,end=<iso|relative>,recur_*",d).option("--type-option <value>","Set type options key=value (repeatable)",d).option("--unset <field>","Clear scalar metadata field by name (repeatable)",d).option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override"),R(n,[["--filter-assignee_filter <value>","Alias for --filter-assignee-filter"],["--estimated_minutes <value>","Alias for --estimated-minutes"],["--acceptance_criteria <value>","Alias for --acceptance-criteria"],["--definition_of_ready <value>","Alias for --definition-of-ready"],["--why_now <value>","Alias for --why-now"],["--blocked_by <value>","Alias for --blocked-by"],["--blocked_reason <value>","Alias for --blocked-reason"],["--unblock_note <value>","Alias for --unblock-note"],["--repro_steps <value>","Alias for --repro-steps"],["--expected_result <value>","Alias for --expected-result"],["--actual_result <value>","Alias for --actual-result"],["--affected_version <value>","Alias for --affected-version"],["--fixed_version <value>","Alias for --fixed-version"],["--customer_impact <value>","Alias for --customer-impact"],["--filter-estimate-missing","Alias for --filter-estimates-missing"]],!1),R(n,[["--dep_remove <value>","Alias for --dep-remove"],["--type_option <value>","Alias for --type-option"],["--add_tags <value>","Alias for --add-tags"],["--remove_tags <value>","Alias for --remove-tags"],["--add_ac <value>","Alias for --add-ac"],["--remove_ac <value>","Alias for --remove-ac"]],!0),n.action(Co);let r=e.command("close").option("--release-assignment","Release ownership after closure").argument("<id>","Item id").argument("[text]","Close reason text (alias: --reason)").option("-r, --reason <value>","Close reason text (alias for positional <text>)").option("--close-reason <value>","Close reason text (alias for positional <text>)").option("--completed-at <value>","Actual completion timestamp (ISO or relative), distinct from tracker close time").option("-d, --duplicate-of <id>","Close as a duplicate of the canonical item id and auto-fill duplicate closure metadata").option("--author <value>","Mutation author").option("-m, --message <value>","History message").option("--validate-close [mode]",'Validate closure metadata before close: "off", "warn", or "strict" (default: settings governance preset)').option("--resolution <value>","Closure resolution summary (checked by --validate-close strict)").option("--expected-result <value>","Expected outcome for closure validation").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Observed outcome for closure validation").option("--actual <value>","Short alias for --actual-result").option("--force","Force ownership override").description("Close an item. Close reason requirement follows governance.require_close_reason.");w(r,"--expected_result <value>","Alias for --expected-result",!1),w(r,"--actual_result <value>","Alias for --actual-result",!1),r.action(Do);let a=e.command("close-many").description("Bulk-close matched items with a shared reason and full runClose semantics (dry-run + rollback checkpoint).").option("--filter-status <value>","Filter by status before closing").option("--filter-type <value>","Filter by item type before closing").option("--filter-tag <value>","Filter by tag before closing").option("--filter-priority <value>","Filter by priority before closing").option("--filter-deadline-before <value>","Filter by deadline upper bound before closing").option("--filter-deadline-after <value>","Filter by deadline lower bound before closing").option("--filter-updated-after <value>","Filter by updated_at lower bound before closing (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before closing (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before closing (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before closing (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before closing").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before closing").option("--filter-parent <value>","Filter by parent item ID before closing").option("--filter-sprint <value>","Filter by sprint before closing").option("--filter-release <value>","Filter by release before closing");Mt(a,"closing"),a.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--reason <value>","Shared close reason applied to matched items (required when governance.require_close_reason is enabled)").option("--completed-at <value>","Actual completion timestamp (ISO or relative) applied to every matched item").option("--resolution <value>","Shared closure resolution applied to every matched item (closure-validation field)").option("--expected-result <value>","Shared expected-result note (closure-validation field)").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Shared actual-result note (closure-validation field)").option("--actual <value>","Short alias for --actual-result").option("--validate-close [mode]",'Validate closure metadata per item: "off", "warn", or "strict" (default: settings governance preset)').option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Re-close already-terminal matches and override ownership").option("--dry-run","Preview matched items + per-item skip/active-child plan without mutating").option("--rollback <value>","Rollback a prior close-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode"),w(a,"--filter-assignee_filter <value>","Alias for --filter-assignee-filter",!1),w(a,"--expected_result <value>","Alias for --expected-result",!1),w(a,"--actual_result <value>","Alias for --actual-result",!1),a.action(xo),e.command("delete").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").option("--dry-run","Preview the item file that would be deleted without mutating").description("Delete an item and record the change in history.").action(Ho),e.command("append").argument("<id>","Item id").argument("[text]","Body text; same as --body (- reads stdin)").option("--body <value>","Text to append to body (or - for stdin)").option("--text <value>","Alias for --body").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override").description("Append text to an item's body. For concurrent writes, use pm notes.").action(Bo);let l=e.command("plan").description("Agent-optimized Plan item workflow: create, manage steps, link dependencies, approve, and materialize.").argument("[subcommand]","Required; Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize").argument("[id]","Plan id (required for non-create subcommands); for create this may be the positional title").argument("[step]","Step reference: stable id (plan-step-001) or order integer").argument("[new-order]","New order integer for reorder-step").option("--title <value>","Plan title").option("--description <value>","Plan description").option("--scope <value>","Short scope statement of the target change or investigation").option("--parent <value>","Parent pm item id").option("--related <value>","Related pm item ids (repeatable, csv-friendly)",d).option("--blocks <value>","Pm item ids this plan blocks (repeatable, csv-friendly)",d).option("--blocked-by <value>","Pm item ids that block this plan (repeatable, csv-friendly)",d).option("--harness <value>","Plan harness provenance: codex|claude-code|cursor|generic").option("--mode <value>","Plan mode: draft|research|review|approved|executing|paused|completed|superseded").option("--resume-context <value>","Compact context summary for a future stateless agent").option("--tags <value>","Comma-separated tags").option("--priority <value>","Priority 0-4").option("--body <value>","Plan item body").option("--claim","Claim the plan on create for the author").option("--from-search <value>","Record the search query that led to plan creation").option("--template <value>","Seed plan steps from a built-in template: bug-investigation|feature-implementation|refactoring-sprint").option("--step-title <value>","Step title for add-step / update-step").option("--step <value>","Step title (repeatable on create: each --step appends an ordered step; elsewhere a single value aliases --step-title)",d).option("--step-body <value>","Step body text").option("--step-owner <value>","Step owner").option("--step-status <value>","Step status: pending|in_progress|completed|blocked|skipped|superseded").option("--step-evidence <value>","Step evidence text (used by update-step/complete-step)").option("--step-blocked-reason <value>","Step blocked reason (required when blocking)").option("--step-replacement <value>","Replacement reference for a superseded step").option("--depends-on <value>","Pm item ids the step depends on (repeatable, csv-friendly)",d).option("--link <value>","Pm item id to link (repeatable, csv-friendly)",d).option("--link-kind <value>",`Link kind: ${be.join("|")}`).option("--link-note <value>","Optional note for the link").option("--promote-to-item-dep","Also add the linked id as a top-level item dependency when linking").option("--allow-multiple-active","Allow multiple steps to be in_progress at once").option("--file <value>","Step linked file path=<value>[,scope=project|global,note=<text>] (repeatable)",d).option("--test <value>","Step linked test command=<value>[,path=<value>,note=<text>] (repeatable)",d).option("--doc <value>","Step linked doc path=<value>[,scope=project|global,note=<text>] (repeatable)",d).option("--decision-text <value>","Decision log entry text").option("--decision <value>","Alias for --decision-text").option("--decision-rationale <value>","Decision log entry rationale").option("--decision-evidence <value>","Decision log entry evidence").option("--discovery-text <value>","Discovery log entry text").option("--discovery <value>","Alias for --discovery-text").option("--validation-text <value>","Validation log entry text").option("--validation <value>","Alias for --validation-text").option("--validation-command <value>","Validation log entry command").option("--validation-expected <value>","Validation log entry expected outcome").option("--depth <value>","Show depth: brief|standard|deep (default: brief)").option("--fields <value>","Comma-separated field projection for show output").option("--steps <value>","Comma-separated step ids/orders for materialize").option("--materialize-type <value>","Item type for materialized steps (default: Task)").option("--materialize-parent <value>","Parent item id for materialized children (default: the plan)").option("--materialize-tags <value>","Comma-separated tags for materialized children").option("--field <name=value>","Custom field value forwarded to every materialized child (repeatable)",d).option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override");me(l,K.filter(g=>mo.has(g.target))),R(l,[["--resume_context <value>","Alias for --resume-context"],["--from_search <value>","Alias for --from-search"],["--step_title <value>","Alias for --step-title"],["--step_body <value>","Alias for --step-body"],["--step_owner <value>","Alias for --step-owner"],["--step_status <value>","Alias for --step-status"],["--step_evidence <value>","Alias for --step-evidence"],["--step_blocked_reason <value>","Alias for --step-blocked-reason"],["--step_replacement <value>","Alias for --step-replacement"],["--link_kind <value>","Alias for --link-kind"],["--link_note <value>","Alias for --link-note"],["--promote_to_item_dep","Alias for --promote-to-item-dep"],["--allow_multiple_active","Alias for --allow-multiple-active"],["--decision_text <value>","Alias for --decision-text"],["--decision_rationale <value>","Alias for --decision-rationale"],["--decision_evidence <value>","Alias for --decision-evidence"],["--discovery_text <value>","Alias for --discovery-text"],["--validation_text <value>","Alias for --validation-text"],["--validation_command <value>","Alias for --validation-command"],["--validation_expected <value>","Alias for --validation-expected"],["--materialize_type <value>","Alias for --materialize-type"],["--materialize_parent <value>","Alias for --materialize-parent"],["--materialize_tags <value>","Alias for --materialize-tags"]],!1),R(l,[["--blocked_by <value>","Alias for --blocked-by"],["--depends_on <value>","Alias for --depends-on"]],!0),l.action(Eo),St(e,!1),Dt(e),e.command("merge").argument("<subcommand>",`Merge subcommand: ${U.join(", ")}`).argument("[artifact]",`driver only: artifact class to merge (${ie.join(", ")})`).argument("[base]","driver only: common-ancestor file path (git %O)").argument("[ours]","driver only: current-branch file path (git %A)").argument("[theirs]","driver only: other-branch file path (git %B)").option("--dry-run","install/reconcile: preview changes without writing").option("--message <text>","reconcile only: audit message recorded on repaired history streams").option("--force","reconcile only: permit the underlying audited history ownership override").option("--include-reconciled","report only: include clone-local receipts already recorded in history").option("--output <path>","driver only: write the merged content to this path instead of the ours path").option("--item-path <path>","driver only: original repository-relative path supplied by git as %P").option("--prefer <side>","driver only: side that wins unresolvable conflicts (ours|theirs; default ours)").description("Install merge drivers, reconcile or report post-merge history, or run a field-aware driver.").action(Mo),Ft(e),e.command("profile").argument("[subcommand]","Required; Profile subcommand: list, show, apply, or lint").argument("[name]","Profile name for show/apply/lint: agile, ops, or research").option("--dry-run","Preview the apply diff without writing any files (apply)").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("List, show, apply, and lint project profiles \u2014 archetype bundles of item types, statuses, fields, workflows, config, templates, and recommended packages.").action(Uo),Tt(e,vo);let u=e.command("files").description("Manage files linked to an item.");u.argument("<id>","Item id").option("--add <value>","Add linked file entry (CSV/markdown pairs or - for stdin)",d).option("--add-glob <value>","Add linked file entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",d).option("--remove <value>","Remove linked file by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",d).option("--migrate <value>","Migrate linked file paths in-place (from=<prefix>,to=<prefix>; repeatable)",d).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list","List linked files without mutating").option("--append-stable","Preserve existing linked-file order and append new links without full-array resorting").option("--validate-paths","Validate linked file paths for existence and file shape").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").action(Go),u.command("discover").argument("<id>","Item id").option("--apply","Add discovered missing files to the item").option("--note <value>","Note to attach to discovered file links").option("--append-stable","Preserve existing linked-file order and append discovered links without full-array resorting").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Discover existing file paths referenced in item text and optionally link missing files.").action(qo),Et(u),e.command("docs").argument("<id>","Item id").option("--add <value>","Add linked doc entry (CSV/markdown pairs or - for stdin)",d).option("--add-glob <value>","Add linked doc entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",d).option("--remove <value>","Remove linked doc by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",d).option("--migrate <value>","Migrate linked doc paths in-place (from=<prefix>,to=<prefix>; repeatable)",d).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list","List linked docs without mutating").option("--validate-paths","Validate linked doc paths for existence and file shape").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage docs linked to an item.").action(jo),e.command("deps").argument("<id>","Item id").option("--format <value>","Output format (tree, graph, or context)","tree").option("--max-depth <value>","Maximum dependency traversal depth (0 keeps only the root)").option("--collapse <value>","Collapse mode (none or repeated)","none").option("--summary","Return counts only without full tree/graph payload").option("--full","Return the complete dependency row projection").option("--node-limit <value>","Maximum nodes in context output").option("--edge-limit <value>","Maximum edges and missing-reference rows in context output").option("--token-budget <value>","Maximum estimated tokens in context output").option("--cursor <value>","Continue an equivalent context query").option("--direction <value>","Context traversal direction (outgoing, incoming, or both)").option("--kind <value>","Restrict context traversal to registered relationship kinds (repeatable or comma-separated)",d).description("Show dependency relationships for an item.").action(Vo)}export{fe as looksLikeSchemaSubcommandTypo,vo as parsePositiveIntOption,$ as parseSchemaOrderOption,me as registerCommanderOptionContracts,Hn as registerMutationCommands};
|
|
20
|
-
//# sourceMappingURL=register-mutation-53ZLT4RX.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./chunk-SGFQQXFD.js";import{$c as H,Gd as ee,Jd as te,Pb as M,Qd as ne,Rd as oe,Sd as C,Uc as U,Yc as q,Yd as ae,Zc as $,_c as G,ad as W,bd as J,dd as I,ed as j,fc as F,fd as z,ga as E,gd as Y,hd as K,id as X,kd as Q,lc as V,ld as Z,oc as N,tb as L}from"./chunk-V3U77H3V.js";import"./chunk-J52QIRRZ.js";import"./chunk-QXIDOOWT.js";import"./chunk-DEZPZOQ7.js";import{Gc as x,Mf as l,Nf as u,No as R,Ro as c,Uo as f,Vo as i,Wo as g,Yo as O,Zo as P,ab as v,ih as T,l as S,m as B,mp as y,na as d,pa as m,qi as A,yl as _}from"./chunk-Y6VRBTP3.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]="3ae42f02-fdd3-5ca6-8c0b-e01e5f6bd95d")}catch{}})();var re=new Map([["measurements","boolean"],["metric","string"],["measurementLimit","number"],["observe","string_array"],["direction","direction"],["measurementSource","string"],["measurementItem","string"],["measurementRevision","string"],["author","string"],["message","string"],["provenanceCoverage","boolean"],["fleetAttribution","boolean"],["since","string"],["eventLimit","number"],["minimumSample","number"]]),be=new Set(["higher","lower","target"]),we=[...re.keys()].sort((e,t)=>e.localeCompare(t)).join(", ");function ve(e,t){return e==="boolean"?typeof t=="boolean":e==="string"?typeof t=="string":e==="number"?typeof t=="number":e==="string_array"?Array.isArray(t)&&t.every(n=>typeof n=="string"):e==="direction"&&be.has(t)}function ie(e){if(e===void 0)return{};let t;try{t=JSON.parse(e)}catch(n){throw new m(`--analytics must be valid JSON: ${String(n)}`,d.USAGE)}if(t===null||typeof t!="object"||Array.isArray(t))throw new m("--analytics must be a JSON object.",d.USAGE);for(let[n,o]of Object.entries(t)){let a=re.get(n);if(!ve(a,o))throw new m(a===void 0?`Unknown --analytics field "${n}". Accepted fields: ${we}.`:`--analytics field "${n}" must be ${a.replace("_"," ")}.`,d.USAGE)}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]="dcd8c925-34ee-5faa-9132-1be43961c749")}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]="29db968f-30ad-5f3c-bf95-e33be18614c6")}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]="524ade8e-33d6-5353-b01d-c7baddc956e8")}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]="02e10fe1-c111-5c09-8dbe-a67f2b97f0d0")}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]="3d4a8db3-8a53-50b4-a96c-1affff2207a3")}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]="d008ca8f-41bf-54fb-9b56-bc1d4af9f226")}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]="de197522-9007-5e21-8f9c-06cbf63707d1")}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]="a5e0162a-bbf1-50fe-8912-a820de155e90")}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]="9ee008b9-3751-5794-8d01-1f6d3123d6cd")}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]="b6fa277d-ccf2-5413-95d5-0790283203d5")}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]="2d59e10e-c85b-542a-8859-b20a08e809fa")}catch{}})();var se=(e,t)=>F(e,t,{runUpdate:(n,o,a)=>U(n,o,a)});(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]="70a8a9b3-0fe4-5903-8e9c-85db1f0ca522")}catch{}})();async function xe(e,t,n,o,a){let r=c(a),s=e==="run",p=e==="verdicts",b=e==="presets"||e==="apply",w=e==="promote",h=await V({action:e,...s||p||b||w?{}:{kind:t},id:s||p||w?n??t:n,preset:b?n??t:void 0,definition:i(o,"definition"),trigger:i(o,"trigger"),tree:i(o,"tree"),gate:i(o,"gate"),limit:i(o,"limit"),dry_run:o.dryRun===!0,fullChangedFields:r.fullChangedFields,idOnly:r.idOnly,author:i(o,"author"),message:i(o,"message"),owner:i(o,"owner"),apply:o.apply===!0,enforcement:i(o,"enforcement")},r);l(h,r),typeof h=="object"&&h!==null&&"exit_code"in h&&h.exit_code===1&&(process.exitCode=1)}function le(e){e.command("assurance").argument("<action>","Action; inspect `pm contracts --command assurance`").argument("[kind]","Declaration kind or run gate id").argument("[id]","Declaration/gate id").description("Manage SDK-owned assurance contracts.").option("--definition <json>","Put declaration JSON").option("--trigger <value>","Gate trigger").option("--tree <value>","Revision identity").option("--gate <id>","Verdict gate filter").option("--limit <number>","Verdict limit").option("--dry-run","Evaluate without recording").option("--author <value>","Mutation author").option("--message <value>","Mutation rationale").option("--owner <item-id>","Preset/derivation owner").option("--apply","Persist derived proposals").option("--enforcement <level>","Promote to warn or block").action(xe)}(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]="2d28905b-e311-589e-88b7-051c2626aeae")}catch{}})();function Ae(e,t){let n=e?.trim().toLowerCase(),o=t?.trim().toLowerCase();if(n===void 0||n.length===0)return o;if(n==="local-analytics")return o&&o.length>0?o:"status";if(o!==void 0&&o.length>0)throw _({command_path:"telemetry",token:`${e} ${t}`,allowed:["status","flush","stats","clear","local-analytics"],token_kind:"path",examples:["pm telemetry stats --limit 10","pm telemetry local-analytics status --json"]});return n}function _e(e){return{addValues:Array.isArray(e.add)?e.add:[],addJsonValues:Array.isArray(e.addJson)?e.addJson:[],removeValues:Array.isArray(e.remove)?e.remove:[],removeIndexValues:Array.isArray(e.removeIndex)?e.removeIndex:[]}}function ue(e,t){if(e.background===!0){if(e.run!==!0)throw new m("--background requires --run",d.USAGE);if(e.acknowledgeLinkedTests===!0)throw new m("--background cannot be combined with --acknowledge-linked-tests; acknowledgement is a non-executing foreground operation",d.USAGE);if(t.addValues.length>0||t.addJsonValues.length>0||t.removeValues.length>0||t.removeIndexValues.length>0)throw new m("--background does not support --add/--add-json/--remove/--remove-index; update linked tests first, then run in background",d.USAGE)}}async function Ie(e,t,n,o){let a=await C({kind:"test",commandArgs:O(e,{...t,add:o.addValues,addJson:o.addJsonValues,remove:o.removeValues,removeIndex:o.removeIndexValues}),targetId:e,author:typeof t.author=="string"?t.author:void 0,noExtensions:n.noExtensions===!0},n);l(a,n)}function me(e,t){return{add:t.addValues,addJson:t.addJsonValues,remove:t.removeValues,removeIndex:t.removeIndexValues,list:!!e.list,run:!!e.run,match:typeof e.match=="string"?e.match:void 0,onlyIndex:typeof e.onlyIndex=="string"||typeof e.onlyIndex=="number"?e.onlyIndex:void 0,onlyLast:!!e.onlyLast,timeout:typeof e.timeout=="string"?e.timeout:void 0,progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:typeof e.pmContext=="string"?e.pmContext:void 0,overrideLinkedPmContext:!!e.overrideLinkedPmContext,workspaceContext:typeof e.workspaceContext=="string"?e.workspaceContext:void 0,overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,acknowledgeLinkedTests:!!e.acknowledgeLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext,author:typeof e.author=="string"?e.author:void 0,message:typeof e.message=="string"?e.message:void 0,force:!!e.force,measure:Array.isArray(e.measure)?e.measure:[],metricBelow:typeof e.metricBelow=="string"?e.metricBelow:void 0,metricDiff:typeof e.metricDiff=="string"?e.metricDiff:void 0}}var Lt={buildRunTestOptions:me,buildRunTestAllOptions:fe,runWorkspacePositionAction:pe,validateBackgroundTestOptions:ue};async function Ce(e,t,n,o){let a=await ne(e,me(t,o),n);(o.addValues.length>0||o.addJsonValues.length>0||o.removeValues.length>0||t.run===!0||o.removeIndexValues.length>0)&&await y(n,a),l(a,n),(a.run_results.some(r=>r.status==="failed")||a.fail_on_skipped_triggered===!0)&&(process.exitCode=d.DEPENDENCY_FAILED)}async function De(e,t,n){let o=c(n),a=Date.now(),r=_e(t);ue(t,r),t.background===!0?await Ie(e,t,o,r):await Ce(e,t,o,r),o.profile&&u(`profile:command=test took_ms=${Date.now()-a}`)}function k(e){let t=i(e,"author"),n=i(e,"assignee");if(t!==void 0&&n!==void 0&&t!==n)throw new m("Lifecycle ownership received conflicting --author and --assignee values; use one actor value for both aliases.",d.USAGE,{code:"conflicting_lifecycle_owner",examples:["pm claim pm-123","pm claim pm-123 --start","pm release pm-123"]});return{author:t??n,message:i(e,"message")}}async function Se(e,t){let n=c(t),o=Date.now();if(e.background===!0){let s=await C({kind:"test-all",commandArgs:P(e),statusFilter:i(e,"status"),noExtensions:n.noExtensions===!0},n);l(s,n),n.profile&&u(`profile:command=test-all took_ms=${Date.now()-o}`);return}let r=await oe(fe(e),n);await y(n,{ids:r.results.map(s=>s.id)}),l(r,n),(r.failed>0||r.fail_on_skipped_triggered===!0)&&(process.exitCode=d.DEPENDENCY_FAILED),n.profile&&u(`profile:command=test-all took_ms=${Date.now()-o}`)}function fe(e){return{status:i(e,"status"),limit:i(e,"limit"),offset:i(e,"offset"),timeout:i(e,"timeout"),progress:!!e.progress,envSet:Array.isArray(e.envSet)?e.envSet:[],envClear:Array.isArray(e.envClear)?e.envClear:[],sharedHostSafe:!!e.sharedHostSafe,pmContext:i(e,"pmContext"),overrideLinkedPmContext:!!e.overrideLinkedPmContext,workspaceContext:i(e,"workspaceContext"),overrideLinkedWorkspaceContext:!!e.overrideLinkedWorkspaceContext,allowUntrustedLinkedTests:!!e.allowUntrustedLinkedTests,failOnContextMismatch:!!e.failOnContextMismatch,failOnSkipped:!!e.failOnSkipped,failOnEmptyTestRun:!!e.failOnEmptyTestRun,requireAssertionsForPm:!!e.requireAssertionsForPm,checkContext:!!e.checkContext,autoPmContext:!!e.autoPmContext}}async function Be(e,t,n,o){let a=c(o),r=Date.now(),s=await te({subcommand:Ae(e,t),limit:i(n,"limit")},a);l(s,a),a.profile&&u(`profile:command=telemetry took_ms=${Date.now()-r}`)}async function Te(e,t){let n=c(t),o=Date.now(),a=ie(i(e,"analytics")),r=await ee(n,{includeEmpty:e.includeEmpty===!0,storage:e.storage===!0,metadataCoverage:e.metadataCoverage===!0,byAssignee:e.byAssignee===!0,byTag:e.byTag===!0,byPriority:e.byPriority===!0,tagPrefix:i(e,"tagPrefix"),fieldUtilization:e.fieldUtilization===!0,...a});r.recorded_observations?.some(s=>s.changed)===!0&&await y(n,{ids:r.recorded_observations?.flatMap(s=>s.observation.item_id?[s.observation.item_id]:[])}),l(r,n),n.profile&&u(`profile:command=stats took_ms=${Date.now()-o}`)}async function Ee(e,t){let n=c(t),o=Date.now(),a=i(e,"threshold"),r=i(e,"limit"),s=await L(n,{...e.exhaustive===!0?{exhaustive:!0}:{},status:Array.isArray(e.status)&&e.status.length>0?e.status:void 0,since:i(e,"since"),...a===void 0?{}:{threshold:Number(a)},...r===void 0?{}:{limit:Number(r)}});l(s,n),n.profile&&u(`profile:command=duplicates took_ms=${Date.now()-o}`)}async function Re(e,t){let n=c(t),o=Date.now(),a=!!e.strictExit||!!e.failOnWarn,r=await M(n,{strictExit:a,strictDirectories:!!e.strictDirectories,requireMergeDrivers:!!e.requireMergeDrivers,checkOnly:!!e.checkOnly,checkTelemetry:!!e.checkTelemetry,noRefresh:!!e.noRefresh,refreshVectors:!!e.refreshVectors,verboseStaleItems:!!e.verboseStaleItems,verboseAuthorEvents:!!e.verboseAuthorEvents,brief:!!e.brief,summary:!!e.summary||a,skipVectors:!!e.skipVectors,skipIntegrity:!!e.skipIntegrity,skipDrift:!!e.skipDrift,full:!!e.full});l(r,n),a&&!r.ok&&(x({...r,exit_code:d.GENERIC_FAILURE,error_code:"health_findings",error_category:"validation",command_resolution:"health_findings",resolution_stage:"execute"}),process.exitCode=d.GENERIC_FAILURE),n.profile&&u(`profile:command=health took_ms=${Date.now()-o}`)}async function Oe(e,t){let n=c(t),o=Date.now(),a=await se({checkMetadata:!!e.checkMetadata,metadataProfile:i(e,"metadataProfile"),checkResolution:!!e.checkResolution,checkCompleteness:!!e.checkCompleteness,checkLifecycle:!!e.checkLifecycle,checkStaleBlockers:!!e.checkStaleBlockers,dependencyCycleSeverity:i(e,"dependencyCycleSeverity"),parentCycleSeverity:i(e,"parentCycleSeverity"),checkFiles:!!e.checkFiles,checkCommandReferences:!!e.checkCommandReferences,scanMode:i(e,"scanMode"),includePmInternals:!!e.includePmInternals,verboseFileLists:!!e.verboseFileLists,verboseDiagnostics:!!e.verboseDiagnostics,allAffectedIds:!!e.allAffectedIds,checkHistoryDrift:!!e.checkHistoryDrift,checkStorageIntegrity:!!e.checkStorageIntegrity,fixHints:!!e.fixHints,autoFix:!!e.autoFix,dryRun:!!e.dryRun,fixScope:Array.isArray(e.fixScope)?e.fixScope:void 0,pruneMissing:!!e.pruneMissing,counts:!!e.counts,full:!!e.full},n);l(a,n),(e.strictExit||e.failOnWarn)&&(a.has_warnings||!a.ok)&&(x({...a,exit_code:d.GENERIC_FAILURE,error_code:"validation_findings",error_category:"validation",command_resolution:"validation_findings",resolution_stage:"execute"}),process.exitCode=d.GENERIC_FAILURE),n.profile&&u(`profile:command=validate took_ms=${Date.now()-o}`)}async function Pe(e,t){let n=c(t),o=Date.now(),a=await N(n,{dryRun:e.dryRun===!0,scope:Array.isArray(e.scope)?e.scope:[]});l(a,n),n.profile&&u(`profile:command=gc took_ms=${Date.now()-o}`)}async function Le(e,t,n,o){let a=c(o),r=v(process.cwd(),a.path),s=e.trim().toLowerCase();if(!I.some(p=>p===s))throw _({command_path:"workspace snapshot",token:e,allowed:I,display_name:"workspace snapshot",token_kind:"action",examples:["pm workspace snapshot create before-migration","pm workspace snapshot restore before-migration"]});if(s==="list"){l(await Y(r),a);return}if(s==="create"){l(await j(r,t===void 0?{}:{name:t}),a);return}if(t===void 0)throw new m(`pm workspace snapshot ${s} requires a snapshot name or fingerprint`,d.USAGE);if(s==="inspect"){l(await z(r,t),a);return}if(s==="restore"){if(n.dryRun===!0){l(await K(r,t),a);return}let p=await A(r);l(await X(r,t,{force:n.force===!0,author:T(i(n,"author"),p.author_default),message:i(n,"message"),lockTtlSeconds:p.locks.ttl_seconds,lockWaitMs:p.locks.wait_ms}),a);return}l(await Q(r,t),a)}async function pe(e,t){let n=c(t);l(await Z(n),n)}async function Me(e,t){let n=c(t),o=Date.now(),a=await E({action:i(e,"action"),command:i(e,"command"),summary:!!e.summary,schemaOnly:!!e.schemaOnly,flagsOnly:!!e.flagsOnly,availabilityOnly:!!e.availabilityOnly,runtimeOnly:!!e.runtimeOnly||!!e.activeOnly,full:!!e.full},n);l(a,n),n.profile&&u(`profile:command=contracts took_ms=${Date.now()-o}`)}async function Fe(e,t,n){if(t.start===!0){ce(e,!1),await ye(e,t,n);return}let o=c(n),a=Date.now(),r={...k(t),ifAvailable:t.ifAvailable===!0,maxAttempts:t.maxAttempts};ce(e,t.next===!0);let s=t.next===!0?await $(!!t.force,o,r,{type:typeof t.type=="string"?t.type:void 0,tag:typeof t.tag=="string"?t.tag:void 0,priority:t.priority,assigneeFilter:typeof t.assigneeFilter=="string"?t.assigneeFilter:void 0,parent:typeof t.parent=="string"?t.parent:void 0,sprint:typeof t.sprint=="string"?t.sprint:void 0,release:typeof t.release=="string"?t.release:void 0,includeDecisions:t.includeDecisions===!0,includeGates:t.includeGates===!0,includeContainers:t.includeContainers===!0,tokenBudget:t.tokenBudget??t.token_budget,explainRanking:t.explainRanking===!0||t.explain_ranking===!0}):await q(e,!!t.force,o,r);await y(o,s),l(s,o),o.profile&&u(`profile:command=claim took_ms=${Date.now()-a}`)}function ce(e,t){if(!t&&!e)throw new m("Specify an item id or pass --next",d.USAGE);if(t&&e)throw new m("Specify either an item id or --next, not both",d.USAGE)}async function Ve(e,t,n){if(t.pause===!0){await ge(e,t,n);return}let o=c(n),a=Date.now(),r=await G(e,!!t.force,o,{...k(t),ownershipReleaseBypass:t.ownershipReleaseBypass===!0});await y(o,r),l(await R("release",[e],t,o,r),o),o.profile&&u(`profile:command=release took_ms=${Date.now()-a}`)}async function D(e){let t=c(e),n=S(e.name());if(!n||t.json||t.quiet)return;(await A(v(process.cwd(),t.path))).ux?.deprecation_hints&&u(B(n))}async function ye(e,t,n){await D(n);let o=c(n),a=Date.now(),r=await H(e,{...k(t),force:!!t.force,next:t.next===!0,ifAvailable:t.ifAvailable===!0},o);await y(o,r.update),l(r,o),o.profile&&u(`profile:command=start-task took_ms=${Date.now()-a}`)}async function ge(e,t,n){await D(n);let o=c(n),a=Date.now(),r=await W(e,{...k(t),force:!!t.force},o);await y(o,r.release),l(r,o),o.profile&&u(`profile:command=pause-task took_ms=${Date.now()-a}`)}async function Ne(e,t,n,o){await D(o);let a=c(o),r=Date.now(),s=await J(e,t,{...k(n),validateClose:i(n,"validateClose"),force:!!n.force},a);await y(a,s.release),l(s,a),a.profile&&u(`profile:command=close-task took_ms=${Date.now()-r}`)}function de(e){return e.option("--background","Run linked tests in managed background mode").option("--timeout <seconds>","Default run timeout in seconds").option("--progress","Emit linked-test progress to stderr (always shown in TTY, opt-in for non-TTY)").option("--env-set <value>","Set environment variable(s) for linked-test runs (KEY=VALUE, repeatable)",f).option("--env-clear <value>","Clear environment variable(s) for linked-test runs (NAME, repeatable)",f).option("--shared-host-safe","Apply additive shared-host-safe runtime defaults for linked-test runs").option("--pm-context <mode>","PM test context: schema|tracker|auto|none (default: schema)").option("--override-linked-pm-context","Force run-level --pm-context to override per-linked-test pm_context_mode metadata").option("--workspace-context <mode>","Source-workspace mode: source|isolated|snapshot (default: source)").option("--override-linked-workspace-context","Force run-level --workspace-context over per-linked-test metadata").option("--allow-untrusted-linked-tests","Execute untrusted linked commands when project policy also permits it").option("--fail-on-context-mismatch","Fail linked PM commands when context item counts differ").option("--fail-on-skipped","Treat skipped linked tests as dependency failures").option("--fail-on-empty-test-run","Treat successful linked-test commands that report zero executed tests as failures").option("--require-assertions-for-pm","Require assertion metadata for linked PM command tests").option("--check-context","Preflight linked PM command context diagnostics before executing commands").option("--auto-pm-context","Auto-remediate PM tracker-read context mismatches by routing those linked commands through tracker context")}function Mt(e){le(e);let t=e.command("test").argument("<id>","Item id").option("--add <value>","Add verified isolated test (CSV/markdown or stdin)",f).option("--add-json <value>","Add verified isolated test (JSON object/array or stdin)",f).option("--remove <value>","Remove linked test entry by exact command/path (command=<value> and path=<value> preserve commas and equals signs; or - for stdin)",f).option("--remove-index <n>","Remove the 1-based linked-test index from --list order (repeatable)",f).option("--list","List linked tests without mutating").option("--run","Run linked test commands").option("--match <value>","Run only linked tests whose command/path contains this substring").option("--only-index <n>","Run only the 1-based linked-test index from --list order").option("--only-last","Run only the most recently added linked test");t.option("--acknowledge-linked-tests","Trust the item's current linked commands in this clone without executing them"),de(t).option("--measure <value>","Record name=value[,unit=...][,threshold=...] evidence; repeatable",f).option("--metric-below <value>","Return evidence below name=value").option("--metric-diff <name>","Diff the latest two values").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage tests linked to an item and optionally run them.").action(De);let n=e.command("test-all").description("Run linked tests across matching items.").option("--status <value>","Filter items by status before running tests").option("--limit <n>","Limit matching items before running linked tests").option("--offset <n>","Skip matching items before running linked tests");de(n).action(Se),e.command("test-runs-worker",{hidden:!0}).argument("<runId>","Background run id").description("Internal background worker command.").action(async(w,h,he)=>{let ke=c(he);await ae(w,ke)}),e.command("telemetry").argument("[namespace-or-subcommand]","Telemetry subcommand: status, flush, stats, clear (default: status)").argument("[subcommand]","Compatibility alias target for local-analytics: status, flush, stats, clear").option("--limit <n>","Maximum command groups returned by telemetry stats").description("Inspect and manage local telemetry queue/runtime state.").action(Be),e.command("duplicates").description("Find duplicate clusters across all statuses.").option("--status <value>","Statuses (repeatable or comma-separated)",f,[]).option("--since <value>","Created at or after this time").option("--threshold <value>","Minimum similarity (0-1)").option("--limit <n>","Maximum clusters").option("--exhaustive","Score all pairs within the safety bound").action(Ee),e.command("stats").description("Show project tracker statistics.").option("--include-empty","Restore zero-count registered item-type and lifecycle-status buckets").option("--storage","Include aggregate history-stream storage metrics (total streams/lines/bytes, largest + deepest streams, oldest/newest entries)").option("--metadata-coverage","Include metadata coverage % (acceptance_criteria, estimated_minutes, resolution, tags, parent) overall and by type").option("--by-assignee","Include a lifecycle-bucketed item breakdown grouped by assignee").option("--by-tag","Include a lifecycle-bucketed item breakdown grouped by tag").option("--by-priority","Include a lifecycle-bucketed item breakdown grouped by priority").option("--tag-prefix <value>","With --by-tag: only count tags starting with this prefix (e.g. domain:)").option("--field-utilization","Report content-field utilization rates (notes/learnings/files/docs/tests/comments/deps/body) for governance analysis").option("--analytics <json>","Improvement ledger/history analytics JSON").action(Te),e.command("health").description("Show project tracker health checks.").option("--strict-directories","Treat optional item-type directories as required failures").option("--require-merge-drivers","Treat absent clone-local merge drivers as a required health failure").option("--check-only","Run read-only health diagnostics without refreshing vectors").option("--check-telemetry","Probe telemetry endpoint health and include network diagnostics").option("--no-refresh","Disable automatic vector refresh attempts during health checks").option("--refresh-vectors","Explicitly enable vector refresh attempts during health checks").option("--verbose-stale-items","Include full stale vectorization ID lists in health output").option("--verbose-author-events","Include every actionable unknown-author event coordinate for review or disposition").option("--brief","Emit compact health details for low-token agent checks").option("--summary","Emit one-line-style health status with check names and warning count").option("--skip-vectors","Skip vectorization check for a faster run").option("--skip-integrity","Skip item/history file integrity check for a faster run").option("--skip-drift","Skip history drift hash check for a faster run").option("--full","Run all checks including slow integrity, drift, and vectorization checks").option("--strict-exit","Return non-zero exit when health is not ok and default to actionable summary output; use --full for complete details").option("--fail-on-warn","Alias for --strict-exit").action(Re),e.command("validate").description("Validate metadata, lifecycle policies, files, command references, and history.").option("--check-metadata","Run metadata completeness checks").option("--metadata-profile <value>","Metadata profile (core|strict|custom)").option("--check-resolution","Run closed-item resolution metadata checks").option("--check-completeness","Check declarative lifecycle field requirements").option("--check-lifecycle","Run active-item lifecycle governance drift checks").option("--check-stale-blockers","Include stale blocker-pattern diagnostics in lifecycle checks").option("--dependency-cycle-severity <value>","Set dependency-cycle warning policy for lifecycle checks (off|warn|error)").option("--parent-cycle-severity <value>","Set parent-hierarchy cycle warning policy for lifecycle checks (off|warn|error)").option("--check-files","Run linked-file and orphaned-file checks").option("--check-command-references","Run linked-command PM-ID reference checks").option("--scan-mode <value>","Select file candidate scan mode for --check-files (default|tracked-all|tracked-all-strict)").option("--include-pm-internals","Include PM storage internals in tracked-all candidate scans").option("--verbose-file-lists","Include full file-path lists for validate --check-files details").option("--verbose-diagnostics","Include full diagnostic ID lists").option("--all-affected-ids","Emit complete missing_* affected-ID lists with no truncation (implied by --json)").option("--strict-exit","Return non-zero exit when validation warnings are present").option("--fail-on-warn","Alias for --strict-exit").option("--fix-hints","Add a machine-executable fix_hints[] of pm commands to each failing check's details").option("--auto-fix","Apply safe, deterministic field backfills").option("--dry-run","Preview planned --auto-fix/--prune-missing fixes without applying them").option("--fix-scope <scope>","Grant --auto-fix scopes (metadata, resolution, estimates, timestamps, lifecycle; comma-separated or repeatable). Default: metadata, resolution; other scopes require explicit opt-in",f).option("--prune-missing","Remove deleted-path file/doc links; preserves real files").option("--check-history-drift","Run item/history hash drift checks").option("--check-storage-integrity","Run the post-merge storage-integrity check (unreadable items, history conflict markers, resurrected deletes, unparseable config/schema)").option("--counts","Keep validation counts and totals while omitting per-item diagnostic arrays").option("--full","Return the complete validation diagnostic projection").action(Oe),e.command("gc").option("--dry-run","Preview cleanup targets without deleting files; without this flag, pm gc deletes matched artifacts").option("--scope <value>","Limit cleanup to one or more scopes (comma-separated or repeatable): index, embeddings, runtime, locks, checkpoints, transactions",f).description("Delete optional cache artifacts by default (including expired lock debris) and show a summary.").action(Pe);let o=e.command("workspace").description("Inspect workspace state and snapshots.");o.command("position").description("Show merge and history readiness.").action(pe),o.command("snapshot").argument("<action>","Action: create, list, inspect, restore, delete").argument("[target]","Optional name for create; name or fingerprint otherwise").description("Manage content-addressed tracker snapshots.").option("--dry-run","Preview restore file, item, stream, and history-entry impact without mutating state").option("--force","Explicitly confirm a whole-workspace snapshot restore").option("--author <value>","Actor recorded on the restore audit event").option("--message <value>","Human-readable restore rationale").action(Le),e.command("contracts").description("Show machine-readable command and schema contracts for agents.").option("--action <value>","Filter tool schema branches to a specific action").option("--command <value>","Scope contracts output to one CLI command (narrow-by-default)").option("--summary","Return one command+intent row per top-level command for cheap agent bootstrap").option("--schema-only","Return schema-focused output only").option("--flags-only","Return command flag contracts only").option("--availability-only","Return action availability surface only").option("--runtime-only","Include only actions invocable in the current runtime").option("--active-only","Alias for --runtime-only").option("--full","Include full schema and command-flag surfaces (large; default brief output omits heavy sections for unfiltered queries)").action(Me);let a=e.command("claim").option("--start","Claim and start an explicit item").argument("[id]","Item id (omit with --next)").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force claim override").option("--if-available","Skip another author's claim (skipped=true)").option("--next","Atomically claim the next caller-available actionable item").option("--type <value>","Filter --next candidates by type").option("--tag <value>","Filter --next candidates by tag").option("--priority <value>","Filter --next candidates by priority").option("--assignee-filter <value>","Filter --next candidates: assigned|unassigned").option("--parent <id>","Scope --next candidates to a subtree").option("--sprint <value>","Filter --next candidates by sprint").option("--release <value>","Filter --next candidates by release").option("--max-attempts <n>","Bound the --next candidate walk (default 10; maximum 100)").option("--include-decisions","Allow --next to claim human-gated Decision items").option("--include-gates","Allow --next to claim outcome gates").option("--include-containers","Allow --next to claim containers with unfinished descendants").option("--token-budget <n>","Bound the estimated tokens used to rank --next candidates").option("--explain-ranking","Include ranking provenance for --next selection").description("Claim an item for active work.").action(Fe);g(a,"--assignee <value>","Alias for --author on lifecycle ownership commands"),g(a,"--token_budget <n>","Alias for --token-budget"),g(a,"--explain_ranking","Alias for --explain-ranking");let r=e.command("release").option("--pause","Use open status").argument("<id>","Item id").option("--author <value>","Author").option("--message <value>","Message").option("--force","Override ownership").description("Release ownership.").action(Ve);g(r,"--assignee <value>","Alias for --author on lifecycle ownership commands");let s=e.command("start-task",{hidden:!0}).argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: claim an item and move it to in_progress.").action(ye);g(s,"--assignee <value>","Alias for --author on lifecycle ownership commands");let p=e.command("pause-task",{hidden:!0}).argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override when required").description("Lifecycle alias: move an item to open and release its claim.").action(ge);g(p,"--assignee <value>","Alias for --author on lifecycle ownership commands");let b=e.command("close-task",{hidden:!0}).argument("<id>","Item id").argument("[reason]","Close reason text").option("--author <value>","Mutation author").option("--message <value>","History message").option("--validate-close <value>","Close-time validation mode: off|warn|strict").option("--force","Force ownership or terminal override when required").description("Lifecycle alias: close an item and release assignment metadata.").action(Ne);g(b,"--assignee <value>","Alias for --author on lifecycle ownership commands")}export{Lt as _testOnlyRegisterOperations,Mt as registerOperationCommands,ce as requireClaimTarget};
|
|
2
|
-
//# sourceMappingURL=register-operations-OBK2FXUU.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as W}from"./chunk-7UVXKI7K.js";import{g as T,i as P}from"./chunk-XZDWAYJC.js";import{$a as C,Pa as U,Sa as O,eb as L,gb as j}from"./chunk-J52QIRRZ.js";import"./chunk-DEZPZOQ7.js";import{Jf as D,Mf as b,Nf as h,Ro as y,Uo as x,ab as I,l as $,m as S,na as d,pa as m,qi as R}from"./chunk-Y6VRBTP3.js";import A from"node:fs/promises";import F from"node:path";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="26ea7f42-d5f7-5ada-afd9-389dadc4d138")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0b0e08e0-f6e7-59c4-ac96-9f47b172727a")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="d975120a-964e-5b19-ae10-8ba011ba9bf8")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="108609fa-51fc-5bd0-ac54-de2ad14a66c6")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="b36466e6-5574-5509-909a-e8599f11664c")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="e5e1e242-6864-5a72-adb9-0eda4c65a0c3")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1261f2a8-b56d-5108-a130-abb46bbab3ac")}catch{}})();var M={extension:"extension",package:void 0};async function E(t,e){if(!t)return;let o=$(t),a=y(e);await R(I(process.cwd(),a.path)).then(r=>r.ux.deprecation_hints)&&h(S(o))}var X={init:"init",install:"install",uninstall:"uninstall",explore:"explore",manage:"manage",describe:"describe",reload:"reload",doctor:"doctor",catalog:"catalog",adopt:"adopt","adopt-all":"adoptAll",activate:"activate",deactivate:"deactivate",migrate:"migrate"};function Y(t){let e=t.capability,o=typeof e=="string"?[e]:Array.isArray(e)?e.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new m(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function G(t,e,o="extension"){let a={...t};e!==void 0&&(a[X[e]]=!0);let i=(...c)=>c.some(s=>a[s]===!0),r=(...c)=>{for(let s of c)if(typeof a[s]=="string")return a[s]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:r("gh"),github:r("github"),ref:r("ref"),capability:Y(t),declarative:i("declarative"),fields:r("fields"),detail:r("detail"),output:r("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function J(t){let e=(await A.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...t].sort((a,i)=>a.localeCompare(i));return e.length===o.length&&e.every((a,i)=>a===o[i])}async function Q(t){let e=(t??[]).map(o=>o.trim()).filter(o=>o.length>0);return e.length<=1?e.length===0?void 0:e:await J(e)?["*"]:e}function z(t,e,o){let a=t.markdown===!0;if(o!==void 0&&o==="")throw new m("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new m("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(e.json)throw new m("Cannot combine --json with --markdown.",d.USAGE);if(t.describe!==!0)throw new m("--markdown is only supported by the describe action.",d.USAGE)}}async function Z(t){let e=O(t.result.details,t.vocabulary);if(t.outputPath!==void 0){let o=F.resolve(t.outputPath);await A.mkdir(F.dirname(o),{recursive:!0}),await A.writeFile(o,e,"utf8")}if(!t.globalOptions.quiet){for(let o of t.result.warnings)h(`warning: ${o}`);t.outputPath===void 0&&D(e)}}function tt(t,e){let o=!!e.strictExit||!!e.failOnWarn;if(t.action!=="doctor"||!o)return;let a=t.details!==null&&typeof t.details=="object"?t.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,r=i&&typeof i.status=="string"?i.status:void 0;(t.warnings.length>0||r!==void 0&&r!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function f(t,e,o,a,i="extension"){let r=y(o),c=Date.now(),s=i==="extension"?"package":i;await E(M[i],o);let n=G(e,a,s),p=(typeof n.output=="string"?n.output:void 0)?.trim();z(n,r,p);let g=await C(t,n,r);n.markdown===!0?await Z({result:g,vocabulary:s,outputPath:p,globalOptions:r}):b(g,r),tt(g,n),g.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),r.profile&&h(`profile:command=extension took_ms=${Date.now()-c}`)}function et(t){return t.details!==null&&typeof t.details=="object"?t.details:{}}function ot(t){return t instanceof m?{message:t.message,exit_code:t.exitCode,...t.context}:{message:t instanceof Error?t.message:String(t),exit_code:d.GENERIC_FAILURE}}async function at(t,e,o){let a=[],i=[],r=d.GENERIC_FAILURE;for(let c of t)try{let s=await C(c,e,o),n=et(s),l=Array.isArray(s.warnings)?s.warnings:[];i.push(...l);let p=s.ok===!0;a.push({target:c,ok:p,extension:n.extension,source:n.source,install_plan:n.install_plan,dry_run:n.dry_run,destination_path:n.destination_path,activated:n.activated,settings_changed:n.settings_changed,command_paths:n.command_paths,action_paths:n.action_paths,runtime_activation_status:n.runtime_activation_status,activation_diagnostics:n.activation_diagnostics,command_discovery:n.command_discovery,verification:n.verification,warnings:l,...p?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(s){let n=ot(s),l=n.exit_code;typeof l=="number"&&r===d.GENERIC_FAILURE&&l!==d.GENERIC_FAILURE&&(r=l),a.push({target:c,ok:!1,error:n})}return{rows:a,warnings:i,failureExitCode:r}}async function N(t,e,o,a){let i=a==="extension"?"package":a;await E(M[a],o);let r=await Q(t);if(r===void 0||r.length<=1){await f(r?.[0],e,o,"install",i);return}let c=y(o),s=Date.now(),n=G(e,"install",i);if(z(n,c,void 0),[n.gh,n.github].some(v=>typeof v=="string"&&v.trim().length>0))throw new m("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let{rows:p,warnings:g,failureExitCode:w}=await at(r,n,c),k=p.filter(v=>v.ok!==!0).length,B={ok:k===0,action:"install",scope:n.global===!0?"global":"project",installed_count:n.dryRun===!0?0:p.length-k,...n.dryRun===!0?{dry_run:!0,planned_count:p.length-k}:{},failed_count:k,targets:p,warnings:[...new Set(g)].sort((v,V)=>v.localeCompare(V))};b(B,c),k>0&&(process.exitCode=w),c.profile&&h(`profile:command=extension took_ms=${Date.now()-s}`)}function it(t){return t.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function _(t){return t.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function u(t,e){return e==="package"?_(t):it(t)}function q(t){return t.option("--dry-run","Plan CLI/package upgrades without running npm or reinstalling packages").option("--cli-only","Upgrade only the pm CLI/SDK npm package").option("--packages-only","Upgrade only managed pm packages").option("--repair","Force npm global reinstall when upgrading the pm CLI/SDK").option("--tag <value>","npm dist-tag/version for CLI and registry package upgrades").option("--package-name <value>","Override the CLI package name for self-upgrade testing")}async function K(t,e,o){let a=y(e),i=Date.now();o&&await E("upgrade",e);let r=await P(t,e.optsWithGlobals(),a);b(r,a),r.ok||(process.exitCode=d.GENERIC_FAILURE),a.profile&&h(`profile:command=package-upgrade took_ms=${Date.now()-i}`)}function H(t,e){let o=e==="package"?"package":"extension",a=e==="package"?"packages":"extensions",i=e,r=t.command(i,{hidden:e==="extension"}).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source, name, or scaffold path`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>","Starter capability for --init (default: commands)",x).option("--install",`Install a ${o} source`).option("--dry-run","Preview install without writes or activation").option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} and updates`).option("--describe",`Show surfaces registered by a loaded ${o}`).option("--markdown","Render describe as Markdown").option("--output <path>","Write Markdown to a file").option("--reload",`Reload ${a} without import cache`).option("--watch","Use watch mode with --reload").option("--doctor",`Run ${o} diagnostics`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt unmanaged ${o}`).option("--adopt-all",`Adopt all unmanaged ${a}`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(e==="package"?"Manage package lifecycle in project or global scope.":"Manage extension lifecycle in project or global scope.").action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,void 0,e)});e==="package"&&(r.alias("packages"),r.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=r.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${U.join("|")}; default commands)`,x).description(e==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");e==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"init",e)}),u(r.command("install").option("--dry-run","Resolve sources and estimate copying without destination writes or activation").argument("[targets...]",`${o[0].toUpperCase()}${o.slice(1)} source (local path, bundled alias, npm: source, wildcard, or GitHub source)`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description(`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source.`),e).action(async(s,n,l)=>{await N(s,l.optsWithGlobals(),l,e)}),u(r.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"uninstall",e)}),u(r.command("explore").description(`List discovered ${a} in selected scope.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"explore",e)}),u(r.command("inventory").argument("[name]",`${o[0].toUpperCase()}${o.slice(1)} name or directory to inspect`).description(`Read configured ${o} install and enablement state without activating extension code.`),e).action(async(s,n,l)=>{let p=y(l),g=l.optsWithGlobals();if(g.global===!0&&(g.project===!0||g.local===!0))throw new m("--global and --project/--local are mutually exclusive.",d.USAGE);let w=await W({pmRoot:I(process.cwd(),p.path),scope:g.global===!0?"global":"project",name:s});b(w,p),w.complete||(process.exitCode=d.GENERIC_FAILURE)}),u(r.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"manage",e)}),u(r.command("describe").argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} name to describe (omit for every loaded ${o})`).option("--markdown","Render the surface map as a Markdown reference document instead of toon/json").option("--output <path>","Write Markdown output to a file (requires --markdown)").description(`Map every surface a loaded ${o} registers (commands, hooks, item types, providers, overrides, ...).`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"describe",e)}),u(r.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"reload",e)}),u(r.command("doctor").option("--detail <mode>",`Detail mode for ${o} diagnostics (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"doctor",e)}),u(r.command("catalog").alias("list").option("--fields <value>","Render compact comma-separated catalog fields, for example: alias,installed,install_command").description(`List bundled first-party ${o} catalog metadata.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"catalog",e)}),u(r.command("adopt").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).option("--gh <owner/repo[/path]>",`GitHub provenance shorthand for adopted ${o}`).option("--github <owner/repo[/path]>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub shorthand source").description(`Adopt an existing unmanaged ${o} into managed metadata.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"adopt",e)}),u(r.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"adopt-all",e)}),u(r.command("migrate").option("--dry-run","Plan active migrations without invoking extension code").description(`Plan or apply active ${o} migrations with durable receipts.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"migrate",e)}),u(r.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"activate",e)}),u(r.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"deactivate",e)}),e==="package"&&q(_(r.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(s,n,l)=>{await K(s,l,!1)})}async function nt(t,e,o){let a=y(o),i=Date.now(),r=await j(t,a,{idPrefix:typeof e.idPrefix=="string"?e.idPrefix:void 0,preset:typeof e.preset=="string"?e.preset:void 0,defaults:e.defaults===!0||e.yes===!0,author:typeof e.author=="string"?e.author:void 0,agentGuidance:typeof e.agentGuidance=="string"?e.agentGuidance:void 0,typePreset:typeof e.typePreset=="string"?e.typePreset:void 0,withPackages:e.withPackages===!0,mergeFence:e.mergeFence!==!1,force:e.force===!0,workspace:typeof e.workspace=="string"?e.workspace:void 0}),s=e.verbose===!0||a.json===!0;b(s?r:L(r,!0),a),a.profile&&h(`profile:command=init took_ms=${Date.now()-i}`)}function rt(t,e,o,a){let r=t!==void 0&&new Set(["get","set","list","export"]).has(t);return{resolvedScope:r?"project":t??"project",resolvedAction:r?t:e??"list",resolvedKey:r?e:o,resolvedValue:r?o:a}}function st(t){return{criterion:Array.isArray(t.criterion)?t.criterion:[],format:typeof t.format=="string"?t.format:void 0,policy:typeof t.policy=="string"?t.policy:void 0,value:typeof t.value=="string"?t.value:void 0,clearCriteria:t.clearCriteria===!0,defaultDepth:typeof t.defaultDepth=="string"?t.defaultDepth:void 0,activityLimit:typeof t.activityLimit=="string"?t.activityLimit:void 0,staleThresholdDays:typeof t.staleThresholdDays=="string"?t.staleThresholdDays:void 0,sectionHierarchy:typeof t.sectionHierarchy=="string"?t.sectionHierarchy:void 0,sectionActivity:typeof t.sectionActivity=="string"?t.sectionActivity:void 0,sectionProgress:typeof t.sectionProgress=="string"?t.sectionProgress:void 0,sectionBlockers:typeof t.sectionBlockers=="string"?t.sectionBlockers:void 0,sectionFiles:typeof t.sectionFiles=="string"?t.sectionFiles:void 0,sectionWorkload:typeof t.sectionWorkload=="string"?t.sectionWorkload:void 0,sectionStaleness:typeof t.sectionStaleness=="string"?t.sectionStaleness:void 0,sectionTests:typeof t.sectionTests=="string"?t.sectionTests:void 0}}async function lt(t,e,o,a,i,r){let c=y(r),s=Date.now(),{resolvedScope:n,resolvedAction:l,resolvedKey:p,resolvedValue:g}=rt(t,e,o,a),w=await T(n,l,p,st(i),c,typeof g=="string"?g:void 0);b(w,c),c.profile&&h(`profile:command=config took_ms=${Date.now()-s}`)}var Ut={normalizeExtensionOptions:G};function Ot(t){t.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(e,o,a)=>{await nt(e,o,a)}),t.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",x).option("--clear-criteria","Clear criteria-list keys for config set operations").option("--format <value>","Item format for item-format key: toon").option("--policy <value>","Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; untrusted-linked-test-execution=enabled|disabled; telemetry-tracking=enabled|disabled").option("--value <value>","Typed nested setting value. Mutation guards: require-attributed-author=true|false, secret-guard=off|advise|block, stale-in-progress-hours=integer>=1. Kebab-case is preferred; underscore aliases remain accepted.").option("--default-depth <value>","Context default depth: brief|standard|deep").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(e,o,a,i,r,c)=>{await lt(e,o,a,i,r,c)}),H(t,"extension"),H(t,"package"),_(t.command("install",{hidden:!0}).option("--dry-run","Resolve sources and estimate copying without destination writes or activation").argument("[targets...]","Package source (local path, bundled alias, npm: source, wildcard, or GitHub source)").option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description("Install a pm package into the project package scope by default.")).action(async(e,o,a)=>{await E("install",a),await N(e,a.optsWithGlobals(),a,"package")}),q(_(t.command("upgrade",{hidden:!0}).argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(e,o,a)=>{await K(e,a,!0)})}export{Ut as _testOnlyRegisterSetup,Ot as registerSetupCommands};
|
|
2
|
-
//# sourceMappingURL=register-setup-HM3OCBH2.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{P as i}from"./chunk-KG3H4UZZ.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]="261c726f-338d-5618-8f6b-051b41a38c99")}catch{}})();var u=["id","title","status","type","priority","parent","updated_at"],E=["id","status","type","title"],p={list:"brief","list-all":"full","list-draft":"full","list-open":"brief","list-in-progress":"brief","list-blocked":"brief","list-closed":"brief","list-canceled":"full"},o=["tree_depth","tree_parent","tree_children","tree_title"];function f(e=[]){return[...new Set([...i,"body",...o,...e])].flatMap(t=>[t,`item.${t}`]).sort()}var m=["brief","standard","deep"],r=["body","linked","claim_state","children","schedule"],l=["linked.files","linked.tests","linked.docs"],c=["claim_state.claimed","claim_state.assignee","claim_state.last_claim","claim_state.last_release"],a=["schedule.deadline","schedule.start_at","schedule.end_at","schedule.location","schedule.reminders","schedule.events"];function T(e=[]){return[...[...new Set([...i,...e,"notes_count","tests_count","collection_counts"])].flatMap(s=>[s,`item.${s}`]),...r,...l,...c,...a].sort()}var I=["id","title","status","type","priority","updated_at","score","matched_fields"],d=["score","matched_fields","highlights"],n=["id","title","description","type","status","priority","tags","created_at","updated_at","deadline","assignee","author","estimated_minutes","acceptance_criteria","dependencies","comments","notes","learnings","reminders","events","files","tests","docs","close_reason","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result","affected_version","fixed_version","component","regression","customer_impact","definition_of_ready","order","rank","goal","objective","value","impact","outcome","why_now","plan"];function S(e=[]){let t=[...new Set(e)];return[...d,...n,...n.map(s=>`item.${s}`),...t,...t.map(s=>`item.${s}`)].sort()}export{u as a,E as b,p as c,f as d,m as e,T as f,I as g,S as h};
|
|
2
|
-
//# sourceMappingURL=chunk-2JFYR56O.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{r as D,s as q}from"./chunk-MHQ2XICU.js";import{Yb as N,cc as z,ec as _}from"./chunk-ZLEN4HZD.js";import{dd as C,de as x,gd as L,jd as j,ka as k,pa as m,rb as O,ua as b,xa as S}from"./chunk-KG3H4UZZ.js";import{constants as p}from"node:fs";import{lstat as M,mkdir as $,open as F}from"node:fs/promises";import h from"node:path";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="e57a9bca-1190-5ffd-bb7d-d76a22fc9e57")}catch{}})();function E(n,e){if(typeof n!="string"||n.trim().length===0)throw new TypeError(`Relationship event ${e} must be non-empty`);return n.trim()}function I(n,e){let t=e.require(n.kind),i=t.direction==="undirected"?[n.source,n.target].sort().join("\0"):`${n.source}\0${n.target}`;return`${t.kind}\0${i}`}function H(n){return Object.freeze({...n,...n.payload===void 0?{}:{payload:Object.freeze(structuredClone(n.payload))}})}function J(n,e,t,i){let r=t.require(n.kind),o=i.outgoingOne.get(`${r.kind}\0${n.source}`);if(o!==void 0&&o!==e)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let s=i.incomingOne.get(`${r.kind}\0${n.target}`);if(s!==void 0&&s!==e)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let c=I(n,t),d=i.identities.get(c);if(d!==void 0&&d!==e)throw new TypeError(`Relationship edge already active: ${c}`)}function K(n){let e=new Map;for(let t of n)t.action==="remove"?e.delete(t.relationshipId):e.set(t.relationshipId,t.edge);return e}function G(n,e,t){if(n.expectedVersion!==void 0&&n.expectedVersion!==e)throw new TypeError(`Relationship event version conflict: expected ${n.expectedVersion}, current ${e}`);let i=E(n.eventId,"eventId");if(t.has(i))throw new TypeError(`Relationship event already exists: ${i}`);if(n.action!=="add"&&n.action!=="remove"&&n.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${n.action}`);if(!Number.isFinite(Date.parse(n.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:i,relationshipId:E(n.relationshipId,"relationshipId"),author:E(n.author,"author"),timestamp:new Date(n.timestamp).toISOString()}}function Q(n,e,t,i,r,o){let s=t.has(e);if(n.action==="add"&&s)throw new TypeError(`Relationship is already active: ${e}`);if(n.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${e}`);if(n.action==="remove")return;if(!n.edge)throw new TypeError(`Relationship ${n.action} event requires an edge`);let c=typeof n.edge.source=="string"?n.edge.source.trim():"",d=typeof n.edge.target=="string"?n.edge.target.trim():"";if(!i.has(c)||!i.has(d))throw new TypeError(`Relationship endpoint not found: ${c} -> ${d}`);let a=new m([c,d],[n.edge],r).edges()[0];return J(a,e,r,o),H(a)}var T=class{#t;#i;#n=[];#o=new Set;#e=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(e,t={}){this.#t=new Set([...e].filter(i=>typeof i=="string").map(i=>i.trim()).filter(Boolean)),this.#i=t.registry??k()}get version(){return this.#n.length}events(){return Object.freeze([...this.#n])}*stream(e={}){let t=e.fromVersion??1,i=e.toVersion??this.version,r=e.batchSize??100;if(!Number.isInteger(t)||t<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${i}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(t>i+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let o=t-1;o<i;o+=r)yield Object.freeze(this.#n.slice(o,Math.min(o+r,i)))}project(e,t,i={}){if(typeof t!="function")throw new TypeError("Relationship event projection requires a reducer");let r=e,o=0,s;for(let c of this.stream({...i,batchSize:256}))for(let d of c)r=t(r,d),o+=1,s=d;return Object.freeze({state:r,version:s?.sequence??Math.max(0,(i.fromVersion??1)-1),processed:o,...s===void 0?{}:{asOf:s.timestamp}})}#s(e,t){let i=this.#i.require(t.kind);this.#r.identities.set(I(t,this.#i),e),i.outgoing==="one"&&this.#r.outgoingOne.set(`${i.kind}\0${t.source}`,e),i.incoming==="one"&&this.#r.incomingOne.set(`${i.kind}\0${t.target}`,e)}#a(e){let t=this.#i.require(e.kind);this.#r.identities.delete(I(e,this.#i)),t.outgoing==="one"&&this.#r.outgoingOne.delete(`${t.kind}\0${e.source}`),t.incoming==="one"&&this.#r.incomingOne.delete(`${t.kind}\0${e.target}`)}append(e){let t=G(e,this.version,this.#o),i=this.#e.get(t.relationshipId),r=Q(e,t.relationshipId,this.#e,this.#t,this.#i,this.#r),o=Object.freeze({eventId:t.eventId,relationshipId:t.relationshipId,action:e.action,...r===void 0?{}:{edge:r},author:t.author,timestamp:t.timestamp,...e.reason?.trim()?{reason:e.reason.trim()}:{},sequence:this.version+1});return this.#n.push(o),this.#o.add(t.eventId),i&&this.#a(i),e.action==="remove"?this.#e.delete(t.relationshipId):(this.#e.set(t.relationshipId,r),this.#s(t.relationshipId,r)),o}snapshot(e={}){if(e.atVersion!==void 0&&e.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let t;if(e.atTimestamp!==void 0){let o=Date.parse(e.atTimestamp);if(!Number.isFinite(o))throw new TypeError("Relationship snapshot timestamp must be valid");t=this.#n.filter(s=>Date.parse(s.timestamp)<=o)}else{let o=e.atVersion??this.version;if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship snapshot version out of range: ${o}`);t=this.#n.slice(0,o)}let i=K(t),r=new m(this.#t,i.values(),this.#i);return Object.freeze({version:t.at(-1)?.sequence??0,...t.at(-1)?{asOf:t.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(e){if(!Number.isInteger(e.limit)||e.limit<1)throw new TypeError("Relationship event page limit must be positive");let t=C("relationship-events",{order:"append-sequence"}),i=e.cursor===void 0?this.version:Number(L(e.cursor,t).snapshot);if(!Number.isSafeInteger(i)||i<0||i>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=j(this.#n.slice(0,i),{cursor:e.cursor,fingerprint:t,limit:e.limit,readId:o=>o.eventId,snapshot:String(i)});return{version:i,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},Y="relationship-event-store",A=p.O_NOFOLLOW;function g(n){return x(n,Y,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function f(n,e="relationships/events.jsonl"){let t=h.resolve(n),i=h.resolve(t,e),r=h.relative(t,i);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${h.sep}`)||h.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await $(t,{recursive:!0}),(await M(t)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let s=t;for(let c of r.split(h.sep)){s=h.join(s,c);try{if((await M(s)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(d){if(b(d))break;throw d}}return i}async function w(n,e,t){let i=new T(e,{registry:t}),r,o;try{o=await F(n,p.O_RDONLY|A),r=await o.readFile("utf8")}catch(c){if(b(c))return{log:i,raw:""};throw c}finally{await o?.close()}let s=r.split(`
|
|
2
|
-
`);for(let c=0;c<s.length;c+=1){let d=s[c].trim();if(!d)continue;let a;try{a=JSON.parse(d)}catch{throw new TypeError(`Invalid relationship event JSONL at line ${c+1}`)}if(a.sequence!==i.version+1)throw new TypeError(`Invalid relationship event sequence at line ${c+1}`);i.append({eventId:a.eventId,relationshipId:a.relationshipId,action:a.action,...a.edge===void 0?{}:{edge:a.edge},author:a.author,timestamp:a.timestamp,...a.reason===void 0?{}:{reason:a.reason},expectedVersion:i.version})}return{log:i,raw:r}}function U(n,e,t,i){let r=Date.parse(e.timestamp),o;return e.action!=="remove"&&e.edge!==void 0&&(o=new m(t,[e.edge],i).edges()[0]),n.eventId===e.eventId.trim()&&n.relationshipId===e.relationshipId.trim()&&n.action===e.action&&n.author===e.author.trim()&&Number.isFinite(r)&&n.timestamp===new Date(r).toISOString()&&n.reason===(e.reason?.trim()||void 0)&&O(n.edge)===O(o)}var V=class n{#t;#i;#n;#o;#e;constructor(e,t,i,r){this.#t=e.pmRoot,this.#i=t,this.#n=e.registry,this.#o=i,this.#e=r}static async open(e){let t=Object.freeze([...e.nodes]),i=await f(e.pmRoot,e.relativePath),r=await g(e.pmRoot);try{await f(e.pmRoot,i);let{log:o}=await w(i,t,e.registry);return new n(e,t,i,o)}finally{await r()}}get path(){return this.#o}async currentVersion(){return this.#e=await this.#r(),this.#e.version}async append(e){let t=await g(this.#t);try{let i=await f(this.#t,this.#o),{log:r}=await w(i,this.#i,this.#n),o=r.append(e);await $(h.dirname(i),{recursive:!0}),await f(this.#t,i);let s=await F(i,p.O_APPEND|p.O_CREAT|p.O_WRONLY|A);try{await s.appendFile(`${JSON.stringify(o)}
|
|
3
|
-
`,"utf8")}finally{await s.close()}return this.#e=r,o}finally{await t()}}async appendBatch(e,t={}){let i=await g(this.#t);try{let r=await f(this.#t,this.#o),{log:o,raw:s}=await w(r,this.#i,this.#n),c=o.version,d=new Map(o.events().map(l=>[l.eventId,l])),a=[],R=[];for(let l of e){let u=l.eventId.trim(),v=d.get(u);if(v!==void 0){if(t.existingEventPolicy==="skip_identical"&&U(v,l,this.#i,this.#n)){R.push(v.eventId);continue}if(t.existingEventPolicy==="skip_identical")throw new TypeError(`Relationship event id collision with different content: ${u}`)}let y=o.append(l);d.set(y.eventId,y),a.push(y)}if(a.length>0){let l=s.length===0||s.endsWith(`
|
|
4
|
-
`)?s:`${s}
|
|
5
|
-
`;await $(h.dirname(r),{recursive:!0}),await f(this.#t,r),await S(r,`${l}${a.map(u=>JSON.stringify(u)).join(`
|
|
6
|
-
`)}
|
|
7
|
-
`)}return this.#e=o,Object.freeze({version_before:c,version_after:o.version,appended:Object.freeze(a),skipped_event_ids:Object.freeze(R)})}finally{await i()}}async snapshot(e={}){return this.#e=await this.#r(),this.#e.snapshot(e)}async page(e){return this.#e=await this.#r(),this.#e.page(e)}async*stream(e={}){this.#e=await this.#r(),yield*this.#e.stream(e)}async project(e,t,i={}){return this.#e=await this.#r(),this.#e.project(e,t,i)}async#r(){let e=await g(this.#t);try{let t=await f(this.#t,this.#o);return(await w(t,this.#i,this.#n)).log}finally{await e()}}};(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="874a21db-ed3b-5b4f-a913-bf87103172e7")}catch{}})();function P(n){return[...n].sort().join("\0")}function X(n,e,t){let i=n.successors.get(e);i?i.push(t):n.successors.set(e,[t]);let r=n.predecessors.get(t);r?r.push(e):n.predecessors.set(t,[e])}function W(n,e,t,i,r){let o=e.resolve(r);if(o?.ordering!==!0)return;let s=z(i),c=s===void 0?void 0:n.canonicalIds.get(s.toLowerCase());if(c===void 0)return;let d=(o.precedence??"source_before_target")==="source_before_target";X(n,d?t:c,d?c:t)}function Z(n,e){let t={successors:new Map,predecessors:new Map,canonicalIds:new Map},i=n.filter(r=>typeof r?.id=="string"&&r.id.trim().length>0);for(let r of i){let o=r.id.trim();t.canonicalIds.set(o.toLowerCase(),o)}for(let r of i){let o=r.id.trim();W(t,e,o,r.blocked_by,"blocked_by");for(let s of r.dependencies??[])typeof s!="object"||s===null||W(t,e,o,s.id,typeof s.kind=="string"?s.kind:"related")}for(let r of[t.successors,t.predecessors])for(let o of r.values())o.sort();return t}function ee(n,e){let t=new Set([e]),i=[e];for(;i.length>0;){let r=i.pop();for(let o of[n.successors,n.predecessors])for(let s of o.get(r)??[])t.has(s)||(t.add(s),i.push(s))}return t}function te(n,e){let t=new Map;for(let i of e){let r=(n.successors.get(i)??[]).filter(o=>e.has(o));r.length>0&&t.set(i,r)}return t}function B(n,e,t){let i=Z(n,e),r=i.canonicalIds.get(t.trim().toLowerCase());if(r===void 0)return{cycles:[],successors:new Map,canonical:t};let o=te(i,ee(i,r));return{cycles:D(o).filter(s=>s.includes(r)),successors:o,canonical:r}}function ie(n,e,t){let i=new Set(e),r=i.has(t)?t:e[0];if(n.get(r)?.includes(r))return[r,r];for(let o of n.get(r)??[]){if(!i.has(o))continue;let s=ne(n,i,r,o);if(s)return s}return[...e,e[0]]}function ne(n,e,t,i){let r=[[i]],o=new Set([t,i]);for(;r.length>0;){let s=r.shift(),c=s.at(-1);for(let d of n.get(c)??[]){if(d===t)return[t,...s,t];!e.has(d)||o.has(d)||(o.add(d),r.push([...s,d]))}}}function me(n,e,t){let i=N(),r=B(n,i,t),o=B(e,i,t),s=new Set(r.cycles.map(P)),c=new Set(_(n,void 0,i).map(a=>`${a.holder_id.toLowerCase()}\0${a.target_id.toLowerCase()}\0${a.dependency_kind}`));return[..._(e,void 0,i).filter(a=>a.holder_id.toLowerCase()===t.trim().toLowerCase()&&!c.has(`${a.holder_id.toLowerCase()}\0${a.target_id.toLowerCase()}\0${a.dependency_kind}`)).map(a=>`ordering_storage_contradiction_created:${q(a)}:remove_contradicting_dependency_row:run_pm_graph_audit`),...o.cycles.filter(a=>!s.has(P(a))).map(a=>`ordering_cycle_created:${ie(o.successors,a,o.canonical).join(" -> ")}:items_will_not_be_ready:run_pm_graph_audit`)]}export{T as a,V as b,me as c};
|
|
8
|
-
//# sourceMappingURL=chunk-32EVUSS4.js.map
|