@unbrained/pm-cli 2026.11.22 → 2026.11.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/cli/after-command-context-usage.js +1 -1
- package/dist/cli/argv-utils.js +1 -1
- package/dist/cli/bootstrap-args.js +1 -1
- package/dist/cli/bundle-integrity.js +2 -2
- package/dist/cli/command-namespaces.js +1 -1
- package/dist/cli/commander-usage.js +11 -11
- package/dist/cli/commands/annotations/comments.js +1 -1
- package/dist/cli/commands/annotations/docs.js +1 -1
- package/dist/cli/commands/annotations/files.js +1 -1
- package/dist/cli/commands/annotations/learnings.js +1 -1
- package/dist/cli/commands/annotations/notes.js +1 -1
- package/dist/cli/commands/extension/describe.js +1 -1
- package/dist/cli/commands/extension/extension.js +1 -1
- package/dist/cli/commands/extension/scaffold.js +1 -1
- package/dist/cli/commands/extension/shared.js +1 -1
- package/dist/cli/commands/governance/gc.js +1 -1
- package/dist/cli/commands/governance/health.js +1 -1
- package/dist/cli/commands/governance/telemetry.js +1 -1
- package/dist/cli/commands/governance/validate.js +1 -1
- package/dist/cli/commands/history/activity.js +1 -1
- package/dist/cli/commands/history/history-compact.js +1 -1
- package/dist/cli/commands/history/history-redact.js +1 -1
- package/dist/cli/commands/history/history-repair.js +1 -1
- package/dist/cli/commands/history/history.js +1 -1
- package/dist/cli/commands/history/restore.js +1 -1
- package/dist/cli/commands/lifecycle/append.js +1 -1
- package/dist/cli/commands/lifecycle/claim.js +1 -1
- package/dist/cli/commands/lifecycle/close-many.js +1 -1
- package/dist/cli/commands/lifecycle/close.js +1 -1
- package/dist/cli/commands/lifecycle/copy.js +1 -1
- package/dist/cli/commands/lifecycle/create.js +1 -1
- package/dist/cli/commands/lifecycle/delete.js +1 -1
- package/dist/cli/commands/lifecycle/focus.js +1 -1
- package/dist/cli/commands/lifecycle/plan.js +1 -1
- package/dist/cli/commands/lifecycle/update-many.js +1 -1
- package/dist/cli/commands/lifecycle/update.js +1 -1
- package/dist/cli/commands/query/aggregate.js +1 -1
- package/dist/cli/commands/query/context.js +1 -1
- package/dist/cli/commands/query/deps.js +1 -1
- package/dist/cli/commands/query/duplicates.js +1 -1
- package/dist/cli/commands/query/eval.js +1 -1
- package/dist/cli/commands/query/get.js +1 -1
- package/dist/cli/commands/query/graph.js +1 -1
- package/dist/cli/commands/query/list.js +1 -1
- package/dist/cli/commands/query/next.js +1 -1
- package/dist/cli/commands/query/search.js +1 -1
- package/dist/cli/commands/query/stats.js +1 -1
- package/dist/cli/commands/test/test-all.js +1 -1
- package/dist/cli/commands/test/test-runs.js +1 -1
- package/dist/cli/commands/test/test.js +1 -1
- package/dist/cli/commands/workspace/config.js +1 -1
- package/dist/cli/commands/workspace/contracts.js +1 -1
- package/dist/cli/commands/workspace/init.js +1 -1
- package/dist/cli/commands/workspace/merge.js +1 -1
- package/dist/cli/commands/workspace/profile.js +1 -1
- package/dist/cli/commands/workspace/schema.js +1 -1
- package/dist/cli/commands/workspace/upgrade.js +1 -1
- package/dist/cli/context-intent-invocation.js +1 -1
- package/dist/cli/description-stdin.js +1 -1
- package/dist/cli/error-guidance.js +5 -5
- package/dist/cli/expected-revisions.js +1 -1
- package/dist/cli/extension-command-help.js +6 -6
- package/dist/cli/extension-recovery.js +1 -1
- package/dist/cli/help-content.js +5 -5
- package/dist/cli/help-json-payload.js +7 -7
- package/dist/cli/invocation-profile.js +2 -2
- package/dist/cli/main.js +5 -5
- package/dist/cli/migration-gates.js +1 -1
- package/dist/cli/option-values.js +1 -1
- package/dist/cli/preflight-warnings.js +3 -3
- package/dist/cli/public.js +1 -1
- package/dist/cli/register-annotations.js +1 -1
- package/dist/cli/register-assurance.js +1 -1
- package/dist/cli/register-files-lookup.js +1 -1
- package/dist/cli/register-history-activity.js +1 -1
- package/dist/cli/register-history-author.js +1 -1
- package/dist/cli/register-history-maintenance.js +2 -2
- package/dist/cli/register-list-query.js +10 -10
- package/dist/cli/register-mutation-options.js +0 -1
- package/dist/cli/register-mutation.js +6 -6
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli/register-structured-mutation.js +1 -1
- package/dist/cli/registration-helpers.js +1 -1
- package/dist/cli/runtime/activation.js +1 -1
- package/dist/cli/runtime/annotation-option-retry.js +1 -1
- package/dist/cli/runtime/close-fields-retry.js +1 -1
- package/dist/cli/runtime/field-route-retry.js +1 -1
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli/runtime/invocation-rewrites.js +1 -1
- package/dist/cli/runtime/projection-retry.js +1 -1
- package/dist/cli/runtime/read-output-mutation-retry.js +1 -1
- package/dist/cli/runtime/refusal-credential-redaction.js +1 -1
- package/dist/cli/runtime/selection.js +1 -1
- package/dist/cli/runtime/telemetry-outcome.js +1 -1
- package/dist/cli/runtime-compatibility-boundary.js +4 -4
- package/dist/cli/schema/registration.js +15 -15
- package/dist/cli/schema-registration-helpers.js +1 -1
- package/dist/cli/search-refresh.js +1 -1
- package/dist/cli/stats-analytics-json.js +1 -1
- package/dist/cli/telemetry-flush.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-2UQU7HRR.js +9 -0
- package/dist/cli-bundle/chunks/chunk-5DUP4AZA.js +2 -0
- package/dist/cli-bundle/chunks/chunk-5WZZ5XEN.js +3 -0
- package/dist/cli-bundle/chunks/chunk-6H36ZHMI.js +2 -0
- package/dist/cli-bundle/chunks/chunk-6MYJLOSG.js +2 -0
- package/dist/cli-bundle/chunks/chunk-AA52P34H.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-B76TFRO2.js → chunk-AEOHUSUI.js} +101 -101
- package/dist/cli-bundle/chunks/chunk-BSRIVYTM.js +8 -0
- package/dist/cli-bundle/chunks/chunk-CFWLQFJM.js +71 -0
- package/dist/cli-bundle/chunks/chunk-D6PDUKUG.js +9 -0
- package/dist/cli-bundle/chunks/chunk-ENKXRSFZ.js +31 -0
- package/dist/cli-bundle/chunks/chunk-F2Z6XLZB.js +3 -0
- package/dist/cli-bundle/chunks/chunk-FJOEL75F.js +2 -0
- package/dist/cli-bundle/chunks/chunk-GDXCAC52.js +2 -0
- package/dist/cli-bundle/chunks/chunk-H7JEXRIN.js +6 -0
- package/dist/cli-bundle/chunks/chunk-J2PDAVBC.js +2 -0
- package/dist/cli-bundle/chunks/chunk-KE7HMBEW.js +2 -0
- package/dist/cli-bundle/chunks/chunk-KZHIBEJL.js +33 -0
- package/dist/cli-bundle/chunks/chunk-NGJ5ERBF.js +115 -0
- package/dist/cli-bundle/chunks/chunk-NQ54T7T2.js +2 -0
- package/dist/cli-bundle/chunks/chunk-O7JHS64G.js +3 -0
- package/dist/cli-bundle/chunks/chunk-OKEZF7HU.js +2 -0
- package/dist/cli-bundle/chunks/chunk-OKIKF4FD.js +2 -0
- package/dist/cli-bundle/chunks/chunk-OPJF254V.js +9 -0
- package/dist/cli-bundle/chunks/chunk-PZA7QECY.js +1 -0
- package/dist/cli-bundle/chunks/chunk-RWA5YZ5X.js +2 -0
- package/dist/cli-bundle/chunks/chunk-S32NGRQM.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SLFRSZK6.js +1 -0
- package/dist/cli-bundle/chunks/chunk-TZY5MVJF.js +125 -0
- package/dist/cli-bundle/chunks/chunk-YYT3MIRF.js +3 -0
- package/dist/cli-bundle/chunks/chunk-ZPS4B6SI.js +8 -0
- package/dist/cli-bundle/chunks/context-budget-recovery-M5RFUEFG.js +2 -0
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-BPYKN5Q7.js +4 -0
- package/dist/cli-bundle/chunks/{item-revision-4QBMZXKX.js → item-revision-FMD4KWBB.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-SEHTH7N2.js +2 -0
- package/dist/cli-bundle/chunks/mutation-actor-SFGYIRPW.js +2 -0
- package/dist/cli-bundle/chunks/mutation-admission-57LBSKQI.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-RR5KACJ3.js → register-list-query-L4IBU64P.js} +11 -11
- package/dist/cli-bundle/chunks/register-mutation-6NUOPHZ3.js +21 -0
- package/dist/cli-bundle/chunks/register-operations-JGYVORNN.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-C44SIXEH.js +2 -0
- package/dist/cli-bundle/chunks/settlement-hook-6MR32OOC.js +7 -0
- package/dist/cli-bundle/chunks/stage-PQ7AB63N.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-6LKTEKHS.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-6LPXMFLM.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-A6VEMCRR.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-AIDL2ZNT.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-BKPUUW5O.js +1 -0
- package/dist/cli-bundle/focused-chunks/chunk-BWOVFE5B.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-HMDQDRV2.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-I66IKYKP.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IIP6LZ5E.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IR2J3NOT.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IROZDIDX.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-ITKDHSBR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-K53OIT5J.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-LQYYPXUK.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-NQTEE66P.js +13 -0
- package/dist/cli-bundle/focused-chunks/chunk-O7Z73ALG.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OTMMOKPM.js +91 -0
- package/dist/cli-bundle/focused-chunks/chunk-OXOCZJC6.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QLAHEDT6.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QQIIMMFU.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIE3SJSE.js +9 -0
- package/dist/cli-bundle/focused-chunks/chunk-TD544C74.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-UFTUNBMY.js +27 -0
- package/dist/cli-bundle/focused-chunks/chunk-X6CXWWNB.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-XRS3VNC6.js +44 -0
- package/dist/cli-bundle/focused-chunks/chunk-XYPEZGTR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Y2ESLKCF.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-YSJKQLFR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Z2X7HH3C.js +102 -0
- package/dist/cli-bundle/focused-chunks/chunk-ZHWPCVQL.js +78 -0
- package/dist/cli-bundle/focused-chunks/context-budget-recovery-CSJV3TY3.js +2 -0
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-EGEJMG3G.js +4 -0
- package/dist/cli-bundle/focused-chunks/{item-revision-2O6MLPEX.js → item-revision-YDACCDVY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/item-transaction-UKEQCTKB.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-actor-AS465LRX.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-admission-E5UHJZFE.js +2 -0
- package/dist/cli-bundle/focused-chunks/settlement-hook-FMLGKG7J.js +7 -0
- package/dist/cli-bundle/focused-chunks/stage-36J7YLGI.js +2 -0
- package/dist/cli-bundle/main.js +27 -27
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +5 -5
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +66 -66
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +12 -12
- package/dist/cli.js +1 -1
- package/dist/core/checkpoint/checkpoint-gc.js +1 -1
- package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
- package/dist/core/checkpoint/mutation-context.js +1 -1
- package/dist/core/config/nested-settings.js +1 -1
- package/dist/core/config/positional-value.js +1 -1
- package/dist/core/diagnostics/remediation.js +1 -1
- package/dist/core/extensions/activation-summary-markdown.js +2 -2
- package/dist/core/extensions/activation-summary.js +1 -1
- package/dist/core/extensions/activation-transaction.js +1 -1
- package/dist/core/extensions/capability-usage.js +1 -1
- package/dist/core/extensions/command-hook-context.js +1 -1
- package/dist/core/extensions/command-metadata-contract.js +1 -1
- package/dist/core/extensions/command-visibility-tier.js +1 -1
- package/dist/core/extensions/contribution-inventory.js +1 -1
- package/dist/core/extensions/exporter-output-contract.js +1 -1
- package/dist/core/extensions/extension-candidate.js +1 -1
- package/dist/core/extensions/extension-capability-aliases.js +1 -1
- package/dist/core/extensions/extension-hook-runtime.js +1 -1
- package/dist/core/extensions/extension-policy.js +1 -1
- package/dist/core/extensions/extension-registries.js +1 -1
- package/dist/core/extensions/extension-runtime-helpers.js +1 -1
- package/dist/core/extensions/extension-types.js +1 -1
- package/dist/core/extensions/flag-definition-validation.js +1 -1
- package/dist/core/extensions/flag-value-types.js +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/item-field-types.js +1 -1
- package/dist/core/extensions/item-fields.js +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/manifest-parser.js +1 -1
- package/dist/core/extensions/manifest-schema.js +1 -1
- package/dist/core/extensions/module-graph-snapshot.js +1 -1
- package/dist/core/extensions/mutation-actor-snapshot.js +1 -1
- package/dist/core/extensions/mutation-actor.js +1 -1
- package/dist/core/extensions/preflight-ownership.js +1 -1
- package/dist/core/extensions/read-output-contract.js +1 -1
- package/dist/core/extensions/registration-contracts.js +1 -1
- package/dist/core/extensions/registration-validation.js +1 -1
- package/dist/core/extensions/registration-values.js +1 -1
- package/dist/core/extensions/reserved-host-flags.js +1 -1
- package/dist/core/extensions/runtime-registrations.js +1 -1
- package/dist/core/extensions/service-ownership.js +1 -1
- package/dist/core/extensions/version-compat.js +1 -1
- package/dist/core/extensions/version-diagnostics.js +1 -1
- package/dist/core/fs/atomic-create.js +1 -1
- package/dist/core/fs/file-glob.js +1 -1
- package/dist/core/fs/fs-utils.js +2 -2
- package/dist/core/fs/host-environment-errors.js +1 -1
- package/dist/core/fs/index.js +1 -1
- package/dist/core/fs/path-utils.js +1 -1
- package/dist/core/governance/content-fields.js +1 -1
- package/dist/core/governance/issue-codes.js +1 -1
- package/dist/core/governance/metadata-coverage.js +1 -1
- package/dist/core/history/bridge.js +1 -1
- package/dist/core/history/digest.js +1 -1
- package/dist/core/history/drift-cache.js +3 -3
- package/dist/core/history/drift-scan.js +1 -1
- package/dist/core/history/event-classification.js +1 -1
- package/dist/core/history/event-index.js +11 -11
- package/dist/core/history/history-compact-bulk.js +1 -1
- package/dist/core/history/history-diff.js +1 -1
- package/dist/core/history/history-rewrite.js +1 -1
- package/dist/core/history/history-storage-stats.js +1 -1
- package/dist/core/history/history-stream-policy.js +1 -1
- package/dist/core/history/history.js +2 -2
- package/dist/core/history/identity.js +1 -1
- package/dist/core/history/index.js +1 -1
- package/dist/core/history/operation-contract.js +1 -1
- package/dist/core/history/projection.js +1 -1
- package/dist/core/history/read.js +1 -1
- package/dist/core/history/replay.js +2 -2
- package/dist/core/history/stream-summary.js +2 -2
- package/dist/core/history/tombstone.js +1 -1
- package/dist/core/history/version-address.js +1 -1
- package/dist/core/history/workspace-history.js +2 -2
- package/dist/core/io/body-file.js +1 -1
- package/dist/core/io/bulk-ids-input.js +2 -2
- package/dist/core/item/actionability.js +1 -1
- package/dist/core/item/deferred-fields.js +1 -1
- package/dist/core/item/dependency-reference.js +1 -1
- package/dist/core/item/id.js +1 -1
- package/dist/core/item/index.js +1 -1
- package/dist/core/item/item-format-version.js +1 -1
- package/dist/core/item/item-format.js +7 -7
- package/dist/core/item/item-record.js +1 -1
- package/dist/core/item/item-type-definition.js +1 -1
- package/dist/core/item/literal-mutation-input.js +1 -1
- package/dist/core/item/parent-reference-policy.js +1 -1
- package/dist/core/item/parse.js +8 -8
- package/dist/core/item/plan-lifecycle.js +1 -1
- package/dist/core/item/priority.js +1 -1
- package/dist/core/item/sprint-release-format.js +1 -1
- package/dist/core/item/status-filter.js +1 -1
- package/dist/core/item/status.js +1 -1
- package/dist/core/item/toon-decode.js +1 -1
- package/dist/core/item/type-registry.js +1 -1
- package/dist/core/item/type-synonyms.js +1 -1
- package/dist/core/lock/index.js +1 -1
- package/dist/core/lock/lock-confinement.js +1 -1
- package/dist/core/lock/lock-gc.js +1 -1
- package/dist/core/lock/lock-owner.js +1 -1
- package/dist/core/lock/lock.js +4 -4
- package/dist/core/output/linked-test-projection.js +5 -5
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/output/output-control.js +1 -1
- package/dist/core/output/output.js +19 -19
- package/dist/core/output/query-summary.js +1 -1
- package/dist/core/output/tabular.js +3 -3
- package/dist/core/packages/manifest.js +1 -1
- package/dist/core/packages/root.js +1 -1
- package/dist/core/policy/workflow-policy-schema.js +1 -1
- package/dist/core/policy/workflow-policy-store.js +1 -1
- package/dist/core/policy/workflow-policy.js +1 -1
- package/dist/core/profile/profile-describe.js +1 -1
- package/dist/core/profile/profile-lint.d.ts +1 -1
- package/dist/core/profile/profile-lint.js +1 -1
- package/dist/core/profile/profile-plan.js +1 -1
- package/dist/core/profile/profile-presets.js +4 -4
- package/dist/core/reproducibility/context.js +1 -1
- package/dist/core/schema/fields-file.js +2 -2
- package/dist/core/schema/item-types-file.js +2 -2
- package/dist/core/schema/runtime-field-filters.js +1 -1
- package/dist/core/schema/runtime-field-values.js +1 -1
- package/dist/core/schema/runtime-schema.js +2 -2
- package/dist/core/schema/status-defs-file.js +2 -2
- package/dist/core/schema/status-token.js +1 -1
- package/dist/core/schema/type-inference.js +1 -1
- package/dist/core/schema/type-presets.js +1 -1
- package/dist/core/schema/type-workflows.js +1 -1
- package/dist/core/search/background-refresh.js +2 -2
- package/dist/core/search/bm25.js +1 -1
- package/dist/core/search/cache.js +2 -2
- package/dist/core/search/corpus.js +1 -1
- package/dist/core/search/embedding-batches.js +1 -1
- package/dist/core/search/eval-thresholds.js +1 -1
- package/dist/core/search/eval.js +1 -1
- package/dist/core/search/http-client.js +1 -1
- package/dist/core/search/providers.js +1 -1
- package/dist/core/search/relevance.js +1 -1
- package/dist/core/search/semantic-defaults.js +1 -1
- package/dist/core/search/staleness.js +1 -1
- package/dist/core/search/vector-stores.js +2 -2
- package/dist/core/search/vectorization-metadata.js +1 -1
- package/dist/core/sentry/helpers.js +1 -1
- package/dist/core/sentry/instrument.js +1 -1
- package/dist/core/sentry/sensitive-assignments.js +1 -1
- package/dist/core/session/session-state.js +1 -1
- package/dist/core/shared/agent-session-context.js +1 -1
- package/dist/core/shared/author.js +5 -5
- package/dist/core/shared/command-line.js +1 -1
- package/dist/core/shared/command-types.js +0 -1
- package/dist/core/shared/conflict-markers.js +1 -1
- package/dist/core/shared/constants.js +1 -1
- package/dist/core/shared/error-details.js +1 -1
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/shared/html-entity-decode.js +1 -1
- package/dist/core/shared/index.js +1 -1
- package/dist/core/shared/item-metadata-contract.js +1 -1
- package/dist/core/shared/lazy-module.js +1 -1
- package/dist/core/shared/levenshtein.js +1 -1
- package/dist/core/shared/memo.js +1 -1
- package/dist/core/shared/numeric-parsers.js +1 -1
- package/dist/core/shared/option-alias-visibility.js +1 -1
- package/dist/core/shared/output-unicode.js +1 -1
- package/dist/core/shared/primitives.js +1 -1
- package/dist/core/shared/process-tree.js +2 -2
- package/dist/core/shared/secret-rules.js +5 -5
- package/dist/core/shared/serial-queue.js +1 -1
- package/dist/core/shared/serialization.js +1 -1
- package/dist/core/shared/split-comma-list.js +1 -1
- package/dist/core/shared/text-normalization.js +1 -1
- package/dist/core/shared/time.js +2 -2
- package/dist/core/shared/url-credentials.js +1 -1
- package/dist/core/store/index.js +1 -1
- package/dist/core/store/item-format-migration.js +1 -1
- package/dist/core/store/item-metadata-cache.js +1 -1
- package/dist/core/store/item-metadata-query-index.js +11 -11
- package/dist/core/store/item-metadata-read-work.js +1 -1
- package/dist/core/store/item-mutation-precondition.js +1 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/store/paths.js +1 -1
- package/dist/core/store/settings-concurrency.js +1 -1
- package/dist/core/store/settings-read-cache.js +1 -1
- package/dist/core/store/settings-sections.js +2 -2
- package/dist/core/store/settings-validator.js +1 -1
- package/dist/core/store/settings.d.ts +3 -1
- package/dist/core/store/settings.js +6 -6
- package/dist/core/store/sqlite-runtime.js +1 -1
- package/dist/core/store/tracker-preflight.js +1 -1
- package/dist/core/store/transaction-coordinator-scope.js +1 -1
- package/dist/core/telemetry/consent.js +3 -3
- package/dist/core/telemetry/observability.js +1 -1
- package/dist/core/telemetry/policy.js +1 -1
- package/dist/core/telemetry/read-sampling.js +2 -2
- package/dist/core/telemetry/runtime.js +9 -9
- package/dist/core/test/background-runs.js +4 -4
- package/dist/core/test/item-test-run-tracking.js +1 -1
- package/dist/core/test/run-selectors.js +1 -1
- package/dist/core/validate/estimate-defaults.js +1 -1
- package/dist/core/validate/fix-planning.js +1 -1
- package/dist/core/validate/linked-artifact-reference.js +1 -1
- package/dist/core/validate/missing-by-type.js +1 -1
- package/dist/core/validate/missing-link-owners.js +1 -1
- package/dist/core/validate/stale-file-classification.js +1 -1
- package/dist/mcp/http-server.js +5 -5
- package/dist/mcp/legacy-adapter.js +1 -1
- package/dist/mcp/runtime-capabilities.js +1 -1
- package/dist/mcp/server.js +4 -4
- package/dist/mcp/tool-definitions.js +1 -1
- package/dist/sdk/actionability.js +1 -1
- package/dist/sdk/agent/closed-domain-contracts.js +1 -1
- package/dist/sdk/agent/command-recovery.js +1 -1
- package/dist/sdk/agent/command-suggestions.js +1 -1
- package/dist/sdk/agent/create-option-policy.js +1 -1
- package/dist/sdk/agent/identity-config.js +1 -1
- package/dist/sdk/agent/item-addressing.js +1 -1
- package/dist/sdk/agent/linked-resource-recovery.js +1 -1
- package/dist/sdk/agent/refusal-closure-census.js +2 -2
- package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
- package/dist/sdk/agent/subcommand-recovery.js +1 -1
- package/dist/sdk/agent-capability-contracts.js +3 -3
- package/dist/sdk/agent-session-context.js +1 -1
- package/dist/sdk/annotations.js +1 -1
- package/dist/sdk/author-attribution.js +1 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/agent-output-contracts.js +5 -5
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +1 -1
- package/dist/sdk/cli-contracts/completeness.js +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +2 -2
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/registration-helpers.js +7 -7
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -1
- package/dist/sdk/cli-contracts/string-lists.js +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.js +0 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/cli-program.js +1 -1
- package/dist/sdk/command-line.js +1 -1
- package/dist/sdk/comments.js +1 -1
- package/dist/sdk/compile-cache.js +1 -1
- package/dist/sdk/completion/bash.js +2 -2
- package/dist/sdk/completion/fish.js +72 -72
- package/dist/sdk/completion/shared.js +1 -1
- package/dist/sdk/completion/zsh.js +75 -75
- package/dist/sdk/completion.js +1 -1
- package/dist/sdk/config.js +1 -1
- package/dist/sdk/context/recency.js +1 -1
- package/dist/sdk/context/semantic-session-attribution.js +1 -1
- package/dist/sdk/context/usage-egress.js +1 -1
- package/dist/sdk/context/usage-ledger.js +6 -6
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/context-intent-runtime.js +1 -1
- package/dist/sdk/context-packing.js +1 -1
- package/dist/sdk/context-relevance.js +1 -1
- package/dist/sdk/context-signal-store.js +2 -2
- package/dist/sdk/context-usage.js +1 -1
- package/dist/sdk/dependencies/context-budget-recovery.js +1 -1
- package/dist/sdk/dependencies.js +1 -1
- package/dist/sdk/dependency-flag-validation.js +1 -1
- package/dist/sdk/dependency-provenance.js +1 -1
- package/dist/sdk/docs.js +1 -1
- package/dist/sdk/duplicates.js +1 -1
- package/dist/sdk/environment/host-environment-errors.js +1 -1
- package/dist/sdk/environment/project-runtime-compatibility.js +2 -2
- package/dist/sdk/environment/source-context.js +1 -1
- package/dist/sdk/environment/tracker-preflight.js +1 -1
- package/dist/sdk/error-code-catalog.js +1 -1
- package/dist/sdk/error-runtime.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/eval.js +1 -1
- package/dist/sdk/extension/author-manifest.js +1 -1
- package/dist/sdk/extension/bundled-catalog.js +1 -1
- package/dist/sdk/extension/command-options.js +1 -1
- package/dist/sdk/extension/concurrency.js +1 -1
- package/dist/sdk/extension/copy-scope.js +1 -1
- package/dist/sdk/extension/custom-field-collisions.js +1 -1
- package/dist/sdk/extension/describe.js +3 -3
- package/dist/sdk/extension/doctor.js +1 -1
- package/dist/sdk/extension/install-plan.js +1 -1
- package/dist/sdk/extension/install-receipts.js +1 -1
- package/dist/sdk/extension/install-runtime.js +3 -3
- package/dist/sdk/extension/install-snapshot.js +1 -1
- package/dist/sdk/extension/install-sources.js +5 -5
- package/dist/sdk/extension/managed-state.js +2 -2
- package/dist/sdk/extension/managed-update-status.js +1 -1
- package/dist/sdk/extension/migrations.js +2 -2
- package/dist/sdk/extension/native-command-options.js +1 -1
- package/dist/sdk/extension/output-ownership.js +1 -1
- package/dist/sdk/extension/runtime-summary.js +1 -1
- package/dist/sdk/extension/scaffold.js +11 -11
- package/dist/sdk/extension/shared.js +1 -1
- package/dist/sdk/extension/source-resolution.js +1 -1
- package/dist/sdk/extension/static-inventory.js +1 -1
- package/dist/sdk/extension/update-check.js +1 -1
- package/dist/sdk/extension-command-context.js +2 -2
- package/dist/sdk/extension-contracts.js +1 -1
- package/dist/sdk/extension.js +1 -1
- package/dist/sdk/files.js +1 -1
- package/dist/sdk/flag-invocation-contracts.js +1 -1
- package/dist/sdk/generated/error-code-catalog-rows.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/generated-error-code-catalog.js +1 -1
- package/dist/sdk/governance/assurance-action-contracts.js +0 -1
- package/dist/sdk/governance/assurance-action.js +1 -1
- package/dist/sdk/governance/assurance-limits.js +1 -1
- package/dist/sdk/governance/assurance-mutation-error.js +1 -1
- package/dist/sdk/governance/assurance-presets.js +1 -1
- package/dist/sdk/governance/assurance-runtime.js +1 -1
- package/dist/sdk/governance/assurance.js +4 -4
- package/dist/sdk/governance/boundary-fixtures.js +1 -1
- package/dist/sdk/governance/closure-timestamps.js +1 -1
- package/dist/sdk/governance/defect-recurrence-coverage.js +1 -1
- package/dist/sdk/governance/defect-recurrence-graph.js +1 -1
- package/dist/sdk/governance/defect-recurrence-signals.js +1 -1
- package/dist/sdk/governance/defect-recurrence.js +2 -2
- package/dist/sdk/governance/extension-host-version.js +1 -1
- package/dist/sdk/governance/gc.js +1 -1
- package/dist/sdk/governance/health/history-drift-remedies.js +1 -1
- package/dist/sdk/governance/health/projection.js +1 -1
- package/dist/sdk/governance/health-merge-evidence.js +1 -1
- package/dist/sdk/governance/health.js +2 -2
- package/dist/sdk/governance/hierarchy-validation.js +1 -1
- package/dist/sdk/governance/in-progress-work-health.js +1 -1
- package/dist/sdk/governance/lifecycle-dependency-cycles.js +1 -1
- package/dist/sdk/governance/linked-file-report.js +1 -1
- package/dist/sdk/governance/merge-receipt-history.js +1 -1
- package/dist/sdk/governance/provenance-health.js +4 -4
- package/dist/sdk/governance/reindex.js +5 -5
- package/dist/sdk/governance/stale-work.js +1 -1
- package/dist/sdk/governance/status-role-diagnostics.js +1 -1
- package/dist/sdk/governance/storage-integrity.js +1 -1
- package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
- package/dist/sdk/governance/upgrade.js +2 -2
- package/dist/sdk/governance/validate-deferred-fields.js +1 -1
- package/dist/sdk/governance/validate-history-drift.js +1 -1
- package/dist/sdk/governance/validate-item-reader.js +1 -1
- package/dist/sdk/governance/validate-normalization.js +1 -1
- package/dist/sdk/governance/validate.js +1 -1
- package/dist/sdk/governance/workflow-completeness.js +1 -1
- package/dist/sdk/governance/workflow-policy.js +3 -3
- package/dist/sdk/governance/workspace-position.js +2 -2
- package/dist/sdk/graph/analytics.js +1 -1
- package/dist/sdk/graph/assembly.js +1 -1
- package/dist/sdk/graph/cache.js +1 -1
- package/dist/sdk/graph/cardinality-integrity.js +1 -1
- package/dist/sdk/graph/centrality.js +1 -1
- package/dist/sdk/graph/deadline-scheduling.js +1 -1
- package/dist/sdk/graph/durable-cache.js +1 -1
- package/dist/sdk/graph/governance-contracts.js +1 -1
- package/dist/sdk/graph/governance.js +1 -1
- package/dist/sdk/graph/hierarchy-integrity.js +1 -1
- package/dist/sdk/graph/lifecycle-coverage.js +1 -1
- package/dist/sdk/graph/mutation-advisory.js +1 -1
- package/dist/sdk/graph/query-contracts.js +1 -1
- package/dist/sdk/graph/remediation.js +1 -1
- package/dist/sdk/graph/run.js +1 -1
- package/dist/sdk/graph/scheduling.js +1 -1
- package/dist/sdk/graph/traversal.js +1 -1
- package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -1
- package/dist/sdk/guide-topics.js +1 -1
- package/dist/sdk/guide.js +7 -7
- package/dist/sdk/history/append-only-repair.js +4 -4
- package/dist/sdk/history/attestation-command.js +2 -2
- package/dist/sdk/history/attestation-contract.js +1 -1
- package/dist/sdk/history/attestation-scan.js +1 -1
- package/dist/sdk/history/attestation.js +1 -1
- package/dist/sdk/history/maintenance.js +1 -1
- package/dist/sdk/history/reanchor-refusal.js +1 -1
- package/dist/sdk/history/reseed.js +1 -1
- package/dist/sdk/history/salvage.js +5 -5
- package/dist/sdk/history/subject.js +1 -1
- package/dist/sdk/history-analytics.js +1 -1
- package/dist/sdk/history-compact.js +1 -1
- package/dist/sdk/history-mcp.js +1 -1
- package/dist/sdk/history-provenance.js +1 -1
- package/dist/sdk/history-read.js +1 -1
- package/dist/sdk/history-redact.js +1 -1
- package/dist/sdk/history-repair.js +1 -1
- package/dist/sdk/improvement-ledger-validation.js +1 -1
- package/dist/sdk/improvement-ledger.js +2 -2
- package/dist/sdk/init-agent-guidance.js +10 -10
- package/dist/sdk/init.js +14 -14
- package/dist/sdk/invocation-author.js +1 -1
- package/dist/sdk/item-children.js +1 -1
- package/dist/sdk/item-metadata-index.js +1 -1
- package/dist/sdk/item-schedule.js +1 -1
- package/dist/sdk/item-transaction.js +1 -1
- package/dist/sdk/learnings.js +1 -1
- package/dist/sdk/lifecycle/append.js +3 -3
- package/dist/sdk/lifecycle/checkpoint-rollback.js +1 -1
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/cli-input.js +1 -1
- package/dist/sdk/lifecycle/close-many.js +1 -1
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/copy.js +1 -1
- package/dist/sdk/lifecycle/core-field-recovery.js +1 -1
- package/dist/sdk/lifecycle/core-item-fields.js +1 -1
- package/dist/sdk/lifecycle/create-deferrals.js +1 -1
- package/dist/sdk/lifecycle/create.js +1 -1
- package/dist/sdk/lifecycle/delete.js +1 -1
- package/dist/sdk/lifecycle/dependency-removal.js +1 -1
- package/dist/sdk/lifecycle/event-validation-messages.js +1 -1
- package/dist/sdk/lifecycle/focus.js +1 -1
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
- package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
- package/dist/sdk/lifecycle/mcp-actions.js +1 -1
- package/dist/sdk/lifecycle/metadata-normalizers.js +1 -1
- package/dist/sdk/lifecycle/mutation-command-options.js +0 -1
- package/dist/sdk/lifecycle/mutation-facet-contracts.js +1 -1
- package/dist/sdk/lifecycle/mutation-option-validation.js +1 -1
- package/dist/sdk/lifecycle/plan-mutation-receipt.js +1 -1
- package/dist/sdk/lifecycle/plan.js +1 -1
- package/dist/sdk/lifecycle/recurrence-parsers.js +1 -1
- package/dist/sdk/lifecycle/release-handoff.js +1 -1
- package/dist/sdk/lifecycle/reopen.js +1 -1
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +2 -2
- package/dist/sdk/lifecycle/repeated-terminal-state.js +1 -1
- package/dist/sdk/lifecycle/restore.js +1 -1
- package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
- package/dist/sdk/lifecycle/start-blockers.js +1 -1
- package/dist/sdk/lifecycle/structured-mutation-plan.js +1 -1
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/lifecycle/update-many.js +1 -1
- package/dist/sdk/lifecycle/update.js +2 -2
- package/dist/sdk/lifecycle/workflow-transition.js +1 -1
- package/dist/sdk/lifecycle-completion.js +1 -1
- package/dist/sdk/lifecycle-policy.js +1 -1
- package/dist/sdk/linked-artifacts.js +2 -2
- package/dist/sdk/mcp/apps.js +5 -5
- package/dist/sdk/mcp/authorization.js +1 -1
- package/dist/sdk/mcp/discovery.js +1 -1
- package/dist/sdk/mcp/executable.js +4 -4
- package/dist/sdk/mcp/interactions.js +1 -1
- package/dist/sdk/mcp/protocol.js +1 -1
- package/dist/sdk/mcp/skills.js +3 -3
- package/dist/sdk/mcp/subscriptions.js +1 -1
- package/dist/sdk/mcp/tasks.js +2 -2
- package/dist/sdk/mcp/transport.js +1 -1
- package/dist/sdk/merge/abandoned-receipts.js +1 -1
- package/dist/sdk/merge/driver.js +7 -7
- package/dist/sdk/merge/history-scalar-rebase.js +1 -1
- package/dist/sdk/merge/ignored-artifacts.js +1 -1
- package/dist/sdk/merge/index.js +1 -1
- package/dist/sdk/merge/indexed-receipt-blobs.js +2 -2
- package/dist/sdk/merge/install.js +6 -6
- package/dist/sdk/merge/receipt-file-boundary.js +1 -1
- package/dist/sdk/merge/receipt-operation.js +1 -1
- package/dist/sdk/merge/receipt-schema.js +1 -1
- package/dist/sdk/merge/receipts.js +4 -4
- package/dist/sdk/merge/reconcile.js +1 -1
- package/dist/sdk/merge/settlement-hook.js +4 -4
- package/dist/sdk/merge/stage.js +1 -1
- package/dist/sdk/merge/three-way.js +9 -9
- package/dist/sdk/merge/worktree-config.js +2 -2
- package/dist/sdk/merge.js +1 -1
- package/dist/sdk/mutation-events.js +1 -1
- package/dist/sdk/mutation-guard.js +1 -1
- package/dist/sdk/notes.js +1 -1
- package/dist/sdk/output/fit-envelope.js +1 -1
- package/dist/sdk/output/list-envelope.js +1 -1
- package/dist/sdk/output/table-rows.js +1 -1
- package/dist/sdk/output-contracts.js +1 -1
- package/dist/sdk/output-projection.js +1 -1
- package/dist/sdk/output-token-accounting.js +1 -1
- package/dist/sdk/output.js +2 -2
- package/dist/sdk/ownership-source.js +1 -1
- package/dist/sdk/package-import-adapters.js +1 -1
- package/dist/sdk/package-migrations.js +1 -1
- package/dist/sdk/package-runtime-options.js +1 -1
- package/dist/sdk/pagination.js +1 -1
- package/dist/sdk/profile.js +5 -5
- package/dist/sdk/provenance.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.js +1 -1
- package/dist/sdk/query/aggregate.js +1 -1
- package/dist/sdk/query/calendar.js +4 -4
- package/dist/sdk/query/complete-list.js +1 -1
- package/dist/sdk/query/context.js +2 -2
- package/dist/sdk/query/declared-blockers.js +1 -1
- package/dist/sdk/query/duplicate-candidates.js +1 -1
- package/dist/sdk/query/get-facet-roots.js +1 -1
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/history.js +1 -1
- package/dist/sdk/query/item-filter-options.js +0 -1
- package/dist/sdk/query/light-metadata.js +1 -1
- package/dist/sdk/query/list-filter-shared.js +1 -1
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/query/multi-value-filters.js +1 -1
- package/dist/sdk/query/next-ranking-policy.js +1 -1
- package/dist/sdk/query/next-ready-budget.js +1 -1
- package/dist/sdk/query/next.js +2 -2
- package/dist/sdk/query/parsers.js +1 -1
- package/dist/sdk/query/projection-contracts.js +1 -1
- package/dist/sdk/query/search/corpus.js +2 -2
- package/dist/sdk/query/search/filters.js +1 -1
- package/dist/sdk/query/search/input.js +1 -1
- package/dist/sdk/query/search/lexical.js +1 -1
- package/dist/sdk/query/search/response.js +1 -1
- package/dist/sdk/query/search/semantic.js +3 -3
- package/dist/sdk/query/search/types.js +0 -1
- package/dist/sdk/query/search-contracts.js +1 -1
- package/dist/sdk/query/search-pagination.js +1 -1
- package/dist/sdk/query/search-rendering.js +1 -1
- package/dist/sdk/query/search.js +1 -1
- package/dist/sdk/query/window-pagination.js +1 -1
- package/dist/sdk/query/workspace-contracts.js +1 -1
- package/dist/sdk/read-output/continuation.js +1 -1
- package/dist/sdk/read-output/extension.js +1 -1
- package/dist/sdk/read-output/options.js +1 -1
- package/dist/sdk/read-output/positional-rows.js +1 -1
- package/dist/sdk/read-output/provenance.js +1 -1
- package/dist/sdk/read-output/session-result.js +0 -1
- package/dist/sdk/read-output/surfaces.js +1 -1
- package/dist/sdk/read-output/tail-retention.js +1 -1
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.js +1 -1
- package/dist/sdk/read-output-session.js +1 -1
- package/dist/sdk/relationship-analytics.js +1 -1
- package/dist/sdk/relationship-context.js +1 -1
- package/dist/sdk/relationship-history.js +6 -6
- package/dist/sdk/relationship-kinds/contract.js +1 -1
- package/dist/sdk/relationships.js +1 -1
- package/dist/sdk/reproducibility/process.js +1 -1
- package/dist/sdk/runtime/actions.js +1 -1
- package/dist/sdk/runtime/context.js +1 -1
- package/dist/sdk/runtime/mutation-admission.js +1 -1
- package/dist/sdk/runtime/mutation-value-validation.js +1 -1
- package/dist/sdk/runtime/schema-preview.js +1 -1
- package/dist/sdk/runtime/schema.js +1 -1
- package/dist/sdk/runtime-action-aliases.js +1 -1
- package/dist/sdk/runtime-extended-actions.js +1 -1
- package/dist/sdk/runtime-input.d.ts +2 -0
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime-public-contracts.js +0 -1
- package/dist/sdk/runtime-stats-options.js +1 -1
- package/dist/sdk/runtime.d.ts +5 -3
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/scheduling-shortcuts.js +1 -1
- package/dist/sdk/schema/field-option-collisions.js +2 -0
- package/dist/sdk/schema-migration.js +4 -4
- package/dist/sdk/schema.js +7 -7
- package/dist/sdk/search-refresh-worker.js +1 -1
- package/dist/sdk/similarity-scoring.js +1 -1
- package/dist/sdk/similarity.js +1 -1
- package/dist/sdk/start-task-status.js +1 -1
- package/dist/sdk/stats.js +1 -1
- package/dist/sdk/structured-mutations.js +1 -1
- package/dist/sdk/telemetry-flush.js +1 -1
- package/dist/sdk/telemetry.js +4 -4
- package/dist/sdk/templates.js +3 -3
- package/dist/sdk/test/batch.js +2 -2
- package/dist/sdk/test/command-args.js +1 -1
- package/dist/sdk/test/command-resolution.js +2 -2
- package/dist/sdk/test/entry.js +2 -2
- package/dist/sdk/test/execution-receipts.js +2 -2
- package/dist/sdk/test/execution.js +5 -5
- package/dist/sdk/test/json-path.js +1 -1
- package/dist/sdk/test/linked-command-detection.js +1 -1
- package/dist/sdk/test/measurements.js +1 -1
- package/dist/sdk/test/parsers.js +1 -1
- package/dist/sdk/test/prerequisites.js +1 -1
- package/dist/sdk/test/receipt-index-snapshot.js +1 -1
- package/dist/sdk/test/run-phases.js +1 -1
- package/dist/sdk/test/runs.js +1 -1
- package/dist/sdk/test/trust.js +2 -2
- package/dist/sdk/test/update.js +1 -1
- package/dist/sdk/test/workspace-snapshot.js +1 -1
- package/dist/sdk/traceability/runtime-files-lookup.js +1 -1
- package/dist/sdk/traceability/source-traceability.js +2 -2
- package/dist/sdk/tracker-root-discovery.js +1 -1
- package/dist/sdk/transactions/item-finalization.js +1 -1
- package/dist/sdk/workspace-contracts-cache.js +1 -1
- package/dist/sdk/workspace-contracts.js +1 -1
- package/dist/sdk/workspace-memory.js +2 -2
- package/dist/sdk/workspace-snapshot.js +5 -5
- package/dist/sdk/workspace-transaction-gc.js +1 -1
- package/dist/sdk/workspace-transaction.js +2 -2
- package/dist/sdk/workspace.js +6 -6
- package/dist/types/index.js +1 -1
- package/dist/types.js +1 -1
- package/docs/COMMANDS.md +1 -1
- package/docs/EXTENSIONS.md +1 -1
- package/docs/SDK.md +74 -4
- package/marketplace.json +1 -1
- package/package.json +2 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/scripts/finalize-build.mjs +63 -24
- package/scripts/prepare-build-cache.mjs +28 -1
- package/dist/cli-bundle/chunks/chunk-3W47ZZ5T.js +0 -9
- package/dist/cli-bundle/chunks/chunk-4TB5D6HL.js +0 -125
- package/dist/cli-bundle/chunks/chunk-5ZMVLWE3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-6BBDEIKC.js +0 -33
- package/dist/cli-bundle/chunks/chunk-AR4NP5HI.js +0 -3
- package/dist/cli-bundle/chunks/chunk-B4PPFOPY.js +0 -3
- package/dist/cli-bundle/chunks/chunk-CAR2L5NW.js +0 -8
- package/dist/cli-bundle/chunks/chunk-DEZPZOQ7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-EIGUKEV6.js +0 -2
- package/dist/cli-bundle/chunks/chunk-GTPCAJMZ.js +0 -8
- package/dist/cli-bundle/chunks/chunk-GYP24M7W.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HC2OPETM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HKUV74K3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HXHYDO2R.js +0 -115
- package/dist/cli-bundle/chunks/chunk-IB7UB5TE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J2LABXBL.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J52BEBSS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KQIZ34SF.js +0 -3
- package/dist/cli-bundle/chunks/chunk-LQBWLNZJ.js +0 -3
- package/dist/cli-bundle/chunks/chunk-OJTMGDON.js +0 -31
- package/dist/cli-bundle/chunks/chunk-SPPHDVZE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TC6XLIYO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-U7EL3AYA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-VQFWW4EF.js +0 -6
- package/dist/cli-bundle/chunks/chunk-X6MIWTTT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XC5Q2ZV7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XFHPKXAE.js +0 -71
- package/dist/cli-bundle/chunks/chunk-YHVLVSEZ.js +0 -9
- package/dist/cli-bundle/chunks/chunk-YMUSRWV4.js +0 -9
- package/dist/cli-bundle/chunks/chunk-YR2KEBHP.js +0 -2
- package/dist/cli-bundle/chunks/context-budget-recovery-L2WP5S26.js +0 -2
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-ITTXIN4K.js +0 -4
- package/dist/cli-bundle/chunks/item-transaction-QY3PUHEI.js +0 -2
- package/dist/cli-bundle/chunks/mutation-actor-FWLYWJ37.js +0 -2
- package/dist/cli-bundle/chunks/mutation-admission-7ZDCK3G2.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-57AJQWFV.js +0 -21
- package/dist/cli-bundle/chunks/register-operations-RKWST7CU.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-CMI23PC5.js +0 -2
- package/dist/cli-bundle/chunks/settlement-hook-BXN5LEQD.js +0 -7
- package/dist/cli-bundle/chunks/stage-4KDVXC5Z.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2ZD7275J.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-324AHXJO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3IRCYJI5.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-3V53UBHN.js +0 -9
- package/dist/cli-bundle/focused-chunks/chunk-3XSWH6QC.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-4JZITIJB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4KTFKSS3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5C5TK3ET.js +0 -78
- package/dist/cli-bundle/focused-chunks/chunk-AKJYOZZP.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-BRZV7BFV.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-C3O6JJPO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CR7CGEB2.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-EGN2HFRU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-GHQVM6K6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HDEKFSOK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-I5LGPUWH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IWOXAUDU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ML3JHCC6.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-OPGOOP25.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-RE7ZWT7D.js +0 -27
- package/dist/cli-bundle/focused-chunks/chunk-RKQNVYGF.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-RQ252B6V.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-SVOOGGAK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-URGHTTT3.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-USPYKWQG.js +0 -13
- package/dist/cli-bundle/focused-chunks/chunk-UWS3FC4D.js +0 -102
- package/dist/cli-bundle/focused-chunks/chunk-UXQGFGAT.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-WZWXGDYY.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-YKSLZPLT.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZWJTY4ID.js +0 -2
- package/dist/cli-bundle/focused-chunks/context-budget-recovery-5MKOCGY5.js +0 -2
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-AF4U3F3D.js +0 -4
- package/dist/cli-bundle/focused-chunks/item-transaction-GLACUTPL.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-actor-TCYDPUGG.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-LY73EJWM.js +0 -2
- package/dist/cli-bundle/focused-chunks/settlement-hook-ARYCZQY4.js +0 -7
- package/dist/cli-bundle/focused-chunks/stage-DQ7RQQ52.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{withHostEnvironmentBoundary as w}from"../../core/fs/host-environment-errors.js";import a from"node:fs/promises";import l from"node:path";import{getSettingsPath as _}from"../../core/store/paths.js";import{isErrnoCode as E}from"./install-runtime.js";import{pathExists as x}from"../../core/fs/fs-utils.js";import{PmCliError as y}from"../../core/shared/errors.js";import{EXIT_CODE as b}from"../../core/shared/constants.js";import{renderPmCommand as P}from"../command-line.js";import{areDirectoriesEquivalent as S}from"./install-sources.js";import{writeWorkspaceJsonWithHistory as R}from"../../core/history/workspace-history.js";import{readSettings as C}from"../../core/store/settings.js";import{clearSettingsReadCache as D}from"../../core/store/settings-read-cache.js";import{resolveAuthor as I}from"../../core/shared/author.js";import{resolveManagedExtensionStatePath as j}from"./managed-state.js";const v=async t=>a.readFile(t).catch(e=>{if(E(e,"ENOENT"))return null;throw e}),F=async(t,e,r,n,i)=>w("extension_install_backup",async()=>{const d=j(t),c=_(e),[u,m]=await Promise.all([v(d),v(c)]);return n&&await a.cp(r,i,{recursive:!0,force:!0}),{backupDirectory:i,destinationDirectory:r,destinationExists:n,managedStatePath:d,managedStateContents:u,settingsPath:c,settingsContents:m}}),h=async t=>w("extension_install_rollback",async()=>{await a.rm(t.destinationDirectory,{recursive:!0,force:!0}),t.destinationExists&&await a.cp(t.backupDirectory,t.destinationDirectory,{recursive:!0,force:!0});for(const[e,r]of[[t.managedStatePath,t.managedStateContents],[t.settingsPath,t.settingsContents]])if(r===null)await a.rm(e,{force:!0});else if(e===t.settingsPath){const n=l.dirname(t.settingsPath),i=await C(n);try{await R({pmRoot:n,filePath:e,raw:r.toString("utf8"),op:"extension:install:rollback",author:I(void 0,i.author_default),lockTtlSeconds:i.locks.ttl_seconds,lockWaitMs:i.locks.wait_ms})}finally{D(n)}}else await a.mkdir(l.dirname(e),{recursive:!0}),await a.writeFile(e,r)});async function X(t,e){const r=await x(t.destinationDirectory),n=await S(t.sourceDirectory,t.destinationDirectory);await a.mkdir(t.selectedRoot,{recursive:!0});const i=l.join(l.dirname(t.selectedRoot),"runtime","extension-installs");await a.mkdir(i,{recursive:!0});const d=await a.mkdtemp(l.join(i,".pm-extension-install-backup-")),c=l.join(d,"destination"),u=["package","install",c,`--${t.scope}`],m=P(u);let f=!1;try{const p=await F(t.selectedRoot,t.settingsRoot,t.destinationDirectory,r,c);let o;try{o=await e()}catch(s){try{await h(p)}catch(k){f=!0;const g=new y(`Extension install failed: ${String(s)}; rollback failed: ${String(k)}`,b.GENERIC_FAILURE,{code:"extension_install_rollback_failed",original_code:s instanceof y?s.code:void 0,required:"Restore the previous package before retrying the replacement. Previous state was not preserved.",nextSteps:[r?m:"Repair the reported metadata write failure, then retry the original install."],...r?{recovery:{suggested_retry:m,suggested_retry_args:u}}:{}});throw Object.defineProperty(g,"cause",{value:s,configurable:!0,writable:!0}),g}throw s}if(o.ok)return o;if(!r||n)return{...o,details:{...o.details,previous_state_preserved:!1}};try{await h(p)}catch(s){return f=!0,{...o,details:{...o.details,previous_state_preserved:!1,rollback:{status:"failed",error:String(s),backup_directory:c,recovery_command:m,recovery_args:u}}}}return{...o,details:{...o.details,overwritten:!1,settings_changed:!1,previous_state_preserved:!0,rollback:{status:"restored"}}}}finally{f||await a.rm(d,{recursive:!0,force:!0}).catch(()=>{})}}export{F as captureExtensionInstallSnapshot,v as readOptionalMetadataFile,h as restoreExtensionInstallSnapshot,X as withVerifiedExtensionInstall};
|
|
2
2
|
//# sourceMappingURL=install-snapshot.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
${
|
|
3
|
-
${message}`,EXIT_CODE.GENERIC_FAILURE)}}function npmPackageNameFromSpec(spec){const trimmed=spec.trim(),withoutAlias=trimmed.includes("@file:")?trimmed.slice(0,trimmed.lastIndexOf("@file:")):trimmed;return withoutAlias.startsWith("@")?withoutAlias.match(/^(@[^/@\s]+\/[^/@\s]+)/)?.[1]??withoutAlias:withoutAlias.match(/^([^/@\s]+)/)?.[1]??withoutAlias}function isNpmLocalFileAliasSpec(spec){const marker="@file:",markerIndex=spec.lastIndexOf(marker);return markerIndex>0&&spec.slice(0,markerIndex).trim().length>0&&spec.slice(markerIndex+marker.length).trim().length>0}function isNpmNotFoundError(error){const normalized=(error instanceof Error?error.message:String(error)).toLowerCase();return normalized.includes("npm err! code e404")||normalized.includes("404 not found")||normalized.includes("is not in this registry")}function isNpmPackNotFoundError(error){const normalized=(error instanceof Error?error.message:String(error)).toLowerCase();return isNpmNotFoundError(error)||normalized.includes("not found")}function isFirstPartyPmPackageName(packageName){const normalized=packageName.trim().toLowerCase();return normalized.startsWith("@unbrained/pm-")||normalized.startsWith("pm-")}function buildNpmNotFoundRecovery(spec){const packageName=npmPackageNameFromSpec(spec),isFirstPartyPackage=isFirstPartyPmPackageName(packageName),repoName=packageName.replace(/^.*\//,""),githubSource=isFirstPartyPackage?`github.com/unbraind/${repoName}`:void 0,nextBestCommand=githubSource?`pm package install --project ${githubSource}`:void 0;return{message:isFirstPartyPackage?`npm package "${spec}" was not found in the registry. If this is an unpublished first-party pm package, install its GitHub repository instead.`:`npm package "${spec}" was not found in the registry.`,context:{code:"npm_package_not_found",required:"Use an install source that exists, or publish the npm package before installing it with npm:<name>.",why:"Classifying npm 404s avoids repeated registry retries and gives agents a deterministic fallback path.",examples:nextBestCommand?[nextBestCommand,"pm package catalog --project --json"]:[`npm view ${packageName}`,"pm package catalog --project --json"],nextSteps:nextBestCommand?[`Try ${nextBestCommand} if the repository exists.`,"Use pm package catalog --project --json to inspect bundled package aliases before installing."]:[`Verify ${packageName} exists in the npm registry and that you have access to it.`,"Use pm package catalog --project --json to inspect bundled package aliases before installing."],recovery:{attempted_command:`pm install --project npm:${spec}`,normalized_args:["install","--project",`npm:${spec}`],...githubSource&&nextBestCommand?{fallback_candidates:[{source:githubSource,command:nextBestCommand,reason:"canonical first-party GitHub repository fallback for unpublished pm packages"}],next_best_command:nextBestCommand}:{}}}}}function wrapNpmPackResolutionError(spec,error){if(!isNpmPackNotFoundError(error))return null;const recovery=buildNpmNotFoundRecovery(spec);return new PmCliError(recovery.message,EXIT_CODE.NOT_FOUND,recovery.context)}async function resolveLocalNpmPackagePath(spec){if(path.isAbsolute(spec)||spec.startsWith(".")||spec.startsWith("..")){const absolutePath=path.resolve(process.cwd(),spec);return await pathExists(absolutePath)?absolutePath:null}try{const parsed=new URL(spec);if(parsed.protocol==="file:"){const absolutePath=fileURLToPath(parsed);return await pathExists(absolutePath)?absolutePath:null}}catch{}if(!/^[a-z][a-z0-9+.-]*:/i.test(spec)){const absolutePath=path.resolve(process.cwd(),spec);if(await pathExists(absolutePath))return absolutePath}return null}async function resolveNpmPackSpec(spec){const localPath=await resolveLocalNpmPackagePath(spec);if(localPath)return localPath;const localFileAlias=normalizeNpmLocalFileAliasSpec(spec);return localFileAlias!==spec?localFileAlias:(/^[a-z][a-z0-9+.-]*:/i.test(spec),spec)}function normalizeNpmLocalFileAliasSpec(spec,cwd=process.cwd()){const marker="@file:",markerIndex=spec.lastIndexOf(marker);if(!isNpmLocalFileAliasSpec(spec))return spec;const packageName=spec.slice(0,markerIndex),target=spec.slice(markerIndex+marker.length);if(target.startsWith("//")&&!target.startsWith("///"))return spec;if(!target.startsWith("/"))return`${packageName}@${path.resolve(cwd,target)}`;let decodedPath;try{decodedPath=decodeURIComponent(new URL(`file:${target}`).pathname)}catch{return spec}const nativePath=/^\/[A-Za-z]:/.test(decodedPath)?decodedPath.slice(1):decodedPath;return`${packageName}@${nativePath}`}function resolvePackedTarball(packDirectory,filename){const tarball=path.resolve(packDirectory,filename),relativeTarball=path.relative(packDirectory,tarball);if(relativeTarball.length===0||relativeTarball===".."||relativeTarball.startsWith(`..${path.sep}`)||path.isAbsolute(relativeTarball))throw new PmCliError("npm pack reported a package archive outside its isolated destination.",EXIT_CODE.GENERIC_FAILURE,{code:"npm_package_archive_unsafe",required:"Retry with a trusted npm client that writes its archive inside the requested pack destination.",why:"pm will not read a package-manager artifact outside the isolated directory created for this install."});return tarball}function decodePackedNpmCandidate(value,key){if(typeof value!="object"||value===null||Array.isArray(value))return;const record=value;if(!(typeof record.filename!="string"||record.filename.trim().length===0))return{...key===void 0?{}:{key},filename:record.filename,...typeof record.name=="string"?{name:record.name}:{},...typeof record.version=="string"?{version:record.version}:{}}}function collectPackedNpmCandidates(parsed){return(Array.isArray(parsed)?parsed.map(value=>({value})):typeof parsed=="object"&&parsed!==null?Object.entries(parsed).map(([key,value])=>({key,value})):[]).flatMap(({key,value})=>{const candidate=decodePackedNpmCandidate(value,key);return candidate?[candidate]:[]})}function selectPackedNpmCandidate(candidates,expectedPackage){const normalizedExpected=expectedPackage?.trim().toLowerCase(),matchingCandidates=normalizedExpected?candidates.filter(candidate=>{const normalizedName=candidate.name?.trim().toLowerCase();return normalizedName!==void 0?normalizedName===normalizedExpected:candidate.key?.trim().toLowerCase()===normalizedExpected}):[];if(matchingCandidates.length===1)return matchingCandidates[0];if(candidates.length!==1)return;const soleCandidate=candidates[0],soleIdentity=soleCandidate.name??soleCandidate.key;return normalizedExpected&&soleIdentity!==void 0&&soleIdentity.trim().toLowerCase()!==normalizedExpected?void 0:soleCandidate}function parsePackedNpmPackage(stdout,packDirectory,expectedPackage){let parsed;try{parsed=JSON.parse(stdout)}catch{const filename=stdout.split(/\r?\n/).map(line=>line.trim()).filter(line=>line.length>0).at(-1);if(!filename)throw new PmCliError("npm pack did not report a tarball filename.",EXIT_CODE.GENERIC_FAILURE);return{tarball:resolvePackedTarball(packDirectory,filename)}}const candidates=collectPackedNpmCandidates(parsed),selected=selectPackedNpmCandidate(candidates,expectedPackage);if(!selected)throw new PmCliError("npm pack --json returned an unsupported or ambiguous package receipt.",EXIT_CODE.GENERIC_FAILURE,{code:"npm_pack_json_shape_unsupported",required:"Use an npm client that returns an array of package receipts or an object keyed by package name, with exactly one requested package entry containing filename.",why:`Well-formed JSON contained ${candidates.length} usable package receipt(s), but pm could not select ${expectedPackage??"one package"} deterministically.`});return{tarball:resolvePackedTarball(packDirectory,selected.filename),package:selected.name??selected.key,version:selected.version}}async function resolveNpmSourceDirectory(source){return resolveNpmSourceDirectoryWithRunner(source,runNpmCommand)}async function resolveNpmSourceDirectoryWithRunner(source,npmRunner){const localPackageRoot=await resolveLocalNpmPackagePath(source.spec);if(localPackageRoot){if((await fs.stat(localPackageRoot)).isFile()&&isLocalPackageArchive(localPackageRoot))return extractLocalPackageArchive(localPackageRoot);const packageJsonPath=path.join(localPackageRoot,"package.json"),packageJson=await pathExists(packageJsonPath)?JSON.parse(await fs.readFile(packageJsonPath,"utf8")):{};return{directory:await resolvePackageExtensionDirectory(localPackageRoot,source.input),package:typeof packageJson.name=="string"?packageJson.name:void 0,version:typeof packageJson.version=="string"?packageJson.version:void 0,cleanup:async()=>{}}}const tempRoot=await fs.mkdtemp(path.join(os.tmpdir(),"pm-npm-package-source-")),packDirectory=path.join(tempRoot,"pack");await fs.mkdir(packDirectory,{recursive:!0});try{const packSpec=await resolveNpmPackSpec(source.spec),packStdout=await npmRunner(["pack",packSpec,"--json","--pack-destination",packDirectory]),packed=parsePackedNpmPackage(packStdout,packDirectory,isNpmLocalFileAliasSpec(source.spec)?void 0:npmPackageNameFromSpec(source.spec));if(!await pathExists(packed.tarball))throw new PmCliError("npm pack did not create its reported package archive.",EXIT_CODE.GENERIC_FAILURE,{code:"npm_package_archive_missing",required:"Retry the npm package install with a healthy registry and writable temporary directory.",why:"The package manager reported a tarball filename that was absent before validation, so pm cannot safely extract or install it."});const extracted=await extractLocalPackageArchive(packed.tarball);return{directory:extracted.directory,package:packed.package??extracted.package,version:packed.version??extracted.version,cleanup:async()=>{try{await extracted.cleanup()}finally{await fs.rm(tempRoot,{recursive:!0,force:!0})}}}}catch(error){throw await fs.rm(tempRoot,{recursive:!0,force:!0}),wrapNpmPackResolutionError(source.spec,error)||error}}function isLocalPackageArchive(candidate){const normalized=candidate.toLowerCase();return normalized.endsWith(".tgz")||normalized.endsWith(".tar.gz")}function failLocalPackageArchive(message){throw new PmCliError(message,EXIT_CODE.USAGE,{code:"local_package_archive_unsafe",required:"Use a bounded npm .tgz or .tar.gz archive with one package/ root and no links or escaping paths.",why:"Package archives are untrusted input and must be validated before any entry reaches the filesystem."})}function validateLocalPackageArchiveEntry(entry,limits,state){if(entry.meta)return;state.entries+=1,state.entries>limits.maxEntries&&failLocalPackageArchive(`Local package archive exceeds the ${limits.maxEntries} entry limit.`);const archivePath=entry.path,segments=archivePath.split("/");(archivePath.includes("\\")||archivePath.startsWith("/")||/^[A-Za-z]:/u.test(archivePath)||segments.some(segment=>segment===".."))&&failLocalPackageArchive(`Local package archive contains an escaping path: "${archivePath}".`),segments[0]!=="package"&&failLocalPackageArchive(`Local package archive entry "${archivePath}" is outside the required package/ root.`),(entry.type==="SymbolicLink"||entry.type==="Link")&&failLocalPackageArchive(`Local package archive link "${archivePath}" is not supported.`),entry.type!=="File"&&entry.type!=="OldFile"&&entry.type!=="Directory"&&failLocalPackageArchive(`Local package archive entry "${archivePath}" uses unsupported type "${entry.type}".`),entry.size>limits.maxEntryBytes&&failLocalPackageArchive(`Local package archive entry "${archivePath}" exceeds the ${limits.maxEntryBytes} byte entry limit.`),state.expandedBytes+=entry.size,state.expandedBytes>limits.maxExpandedBytes&&failLocalPackageArchive(`Local package archive exceeds the ${limits.maxExpandedBytes} expanded byte limit.`),archivePath==="package/package.json"&&(state.packageJsonEntries+=1)}async function extractLocalPackageArchive(archivePath,limits=LOCAL_PACKAGE_ARCHIVE_LIMITS){(await fs.stat(archivePath)).size>limits.maxArchiveBytes&&failLocalPackageArchive(`Local package archive exceeds the ${limits.maxArchiveBytes} archive byte limit.`);const tempRoot=await fs.mkdtemp(path.join(os.tmpdir(),"pm-local-package-archive-")),extractDirectory=path.join(tempRoot,"extract");await fs.mkdir(extractDirectory,{recursive:!0});const state={entries:0,expandedBytes:0,packageJsonEntries:0};let validationError;try{if(await listTar({file:archivePath,strict:!0,maxDecompressionRatio:100,onReadEntry:entry=>{if(validationError===void 0)try{validateLocalPackageArchiveEntry(entry,limits,state)}catch(error){validationError=error}}}),validationError!==void 0)throw validationError;state.packageJsonEntries!==1&&failLocalPackageArchive(`Local package archive must contain exactly one package/package.json entry; found ${state.packageJsonEntries}.`),await extractTar({file:archivePath,cwd:extractDirectory,strict:!0,preservePaths:!1,preserveOwner:!1,noMtime:!0,unlink:!0,maxDepth:64,maxDecompressionRatio:100});const packageRoot=path.join(extractDirectory,"package"),packageJsonPath=path.join(packageRoot,"package.json"),packageJson=JSON.parse(await fs.readFile(packageJsonPath,"utf8"));return await installNpmPackageRuntimeDependencies(packageRoot),{directory:await resolvePackageExtensionDirectory(packageRoot,archivePath),package:typeof packageJson.name=="string"?packageJson.name:void 0,version:typeof packageJson.version=="string"?packageJson.version:void 0,cleanup:async()=>{await fs.rm(tempRoot,{recursive:!0,force:!0})}}}catch(error){throw await fs.rm(tempRoot,{recursive:!0,force:!0}),error}}async function installNpmPackageRuntimeDependencies(packageRoot,npmRunner=runNpmCommand){const packageJsonPath=path.join(packageRoot,"package.json");if(!await pathExists(packageJsonPath))return;let parsed;try{parsed=JSON.parse(await fs.readFile(packageJsonPath,"utf8"))}catch{return}if(typeof parsed!="object"||parsed===null)return;const manifest=parsed,dependencySpecs=runtimeDependencyInstallSpecs(manifest),shouldLinkHostedPmCli=hasHostedPmCliDependency(manifest);if(dependencySpecs.length===0&&!shouldLinkHostedPmCli)return;const runtimeOnlyManifest={...parsed};delete runtimeOnlyManifest.devDependencies;const installManifest={...runtimeOnlyManifest};removeHostedPmCliDependency(installManifest),await fs.writeFile(packageJsonPath,`${JSON.stringify(installManifest,null,2)}
|
|
4
|
-
`,"utf8");try{await Promise.all([
|
|
5
|
-
`,"utf8")}}function
|
|
1
|
+
import{execFile as J}from"node:child_process";import l from"node:fs/promises";import k from"node:os";import c from"node:path";import{fileURLToPath as M}from"node:url";import{promisify as q}from"node:util";import T from"npm-package-arg";import{extract as H,list as K}from"tar";import{collectPackageExtensionDirectories as V}from"../../core/packages/manifest.js";import{resolvePmPackageRootFromModule as Z}from"../../core/packages/root.js";import{pathExists as m}from"../../core/fs/fs-utils.js";import{isPathWithinDirectory as X}from"../../core/fs/path-utils.js";import{EXIT_CODE as p}from"../../core/shared/constants.js";import{PmCliError as d}from"../../core/shared/errors.js";import{listBundledPackageAliases as Q}from"./bundled-catalog.js";const E=q(J),y="@unbrained/pm-cli",Y={maxArchiveBytes:64*1024*1024,maxEntries:4096,maxExpandedBytes:256*1024*1024,maxEntryBytes:64*1024*1024};let v;async function ee(e,n=process.cwd()){const t=e.trim();if(!/^(@[^/\\\s]+\/[^/\\\s]+|[^@/\\\s][^/\\\s]*)$/u.test(t))return null;let a=c.resolve(n);for(;;){const i=c.join(a,"node_modules",...t.split("/")),r=c.join(i,"package.json");if(await m(r))try{const s=JSON.parse(await l.readFile(r,"utf8"));if(s.name===t)return{package:t,...typeof s.version=="string"?{version:s.version}:{},directory:i}}catch{return null}const o=c.dirname(a);if(o===a)return null;a=o}}function b(e,n,t){const a=e.split("/").map(f=>f.trim()).filter(f=>f.length>0);if(a.length<2)return null;const i=a[0],r=a[1].replace(/\.git$/i,"");if(i.length===0||r.length===0)return null;const o=a.slice(2);let s,u;return o[0]==="tree"&&o.length>=2?(s=o[1],u=o.slice(2).join("/")):o.length>0&&(u=o.join("/")),typeof t=="string"&&t.trim().length>0&&(s=t.trim()),{kind:"github",input:n,owner:i,repo:r,repository:`https://github.com/${i}/${r}.git`,ref:s,subpath:u&&u.length>0?u:void 0}}function te(e,n,t){const a=e.slice(4).trim();if(a.length===0)throw new d('npm package source must include a package spec after "npm:".',p.USAGE);if(n)throw new d('Options "--gh/--github" cannot be combined with npm: package sources.',p.USAGE);if(t)throw new d('Option "--ref" cannot be combined with npm: package sources.',p.USAGE);return{kind:"npm",input:e,spec:a}}function Le(e,n={}){const t=e.trim();if(t.length===0)throw new d("Extension source is required for --install.",p.USAGE);const a=typeof n.ref=="string"&&n.ref.trim().length>0?n.ref.trim():void 0;if(t.startsWith("npm:"))return te(t,n.forceGithub===!0,a);const i=(()=>{try{const o=new URL(t);if(o.hostname!=="github.com")return null;const s=o.pathname.replace(/^\/+/,"");return b(s,t,a)}catch{return null}})();if(i)return i;const r=t.startsWith("github.com/")?t.slice(11):null;if(r){const o=b(r,t,a);if(!o)throw new d(`Invalid GitHub source "${t}".`,p.USAGE);return o}if(n.forceGithub){const o=b(t,t,a);if(!o)throw new d(`Invalid GitHub shorthand "${t}".`,p.USAGE);return o}if(/^https?:\/\//i.test(t))throw new d(`Unsupported extension source URL "${t}". Supported remote source host: github.com.`,p.USAGE);return{kind:"local",input:t,absolute_path:c.resolve(process.cwd(),t)}}async function j(e,n=E,t){try{return((await n("git",e,{encoding:"utf8",timeout:t})).stdout??"").trim()}catch(a){const i=typeof a=="object"&&a!==null&&"stderr"in a?String(a.stderr):"",r=i.trim().length>0?i.trim():a instanceof Error?a.message:String(a);throw new d(`Git command failed: git ${e.join(" ")}
|
|
2
|
+
${r}`,p.GENERIC_FAILURE)}}function ne(e=process.platform){return e==="win32"?"npm.cmd":"npm"}function ae(e=process.platform){return e==="win32"}async function x(e,n,t=E,a=process.platform,i=process.env){const r=ne(a),o=Object.fromEntries(Object.entries(i).filter(([s])=>s.toLowerCase()!=="npm_config_allow_scripts"));o.NPM_CONFIG_ALLOW_SCRIPTS="";try{return((await t(r,e,{cwd:n,encoding:"utf8",env:o,shell:ae(a)})).stdout??"").trim()}catch(s){const u=typeof s=="object"&&s!==null&&"stderr"in s?String(s.stderr):"",f=u.trim().length>0?u.trim():s instanceof Error?s.message:String(s);throw new d(`npm command failed: ${r} ${e.join(" ")}
|
|
3
|
+
${f}`,p.GENERIC_FAILURE)}}function _(e){const n=e.trim(),t=n.includes("@file:")?n.slice(0,n.lastIndexOf("@file:")):n;return t.startsWith("@")?t.match(/^(@[^/@\s]+\/[^/@\s]+)/)?.[1]??t:t.match(/^([^/@\s]+)/)?.[1]??t}function P(e){const n="@file:",t=e.lastIndexOf(n);return t>0&&e.slice(0,t).trim().length>0&&e.slice(t+n.length).trim().length>0}function re(e){const t=(e instanceof Error?e.message:String(e)).toLowerCase();return t.includes("npm err! code e404")||t.includes("404 not found")||t.includes("is not in this registry")}function ie(e){const t=(e instanceof Error?e.message:String(e)).toLowerCase();return re(e)||t.includes("not found")}function oe(e){const n=e.trim().toLowerCase();return n.startsWith("@unbrained/pm-")||n.startsWith("pm-")}function se(e){const n=_(e),t=oe(n),a=n.replace(/^.*\//,""),i=t?`github.com/unbraind/${a}`:void 0,r=i?`pm package install --project ${i}`:void 0;return{message:t?`npm package "${e}" was not found in the registry. If this is an unpublished first-party pm package, install its GitHub repository instead.`:`npm package "${e}" was not found in the registry.`,context:{code:"npm_package_not_found",required:"Use an install source that exists, or publish the npm package before installing it with npm:<name>.",why:"Classifying npm 404s avoids repeated registry retries and gives agents a deterministic fallback path.",examples:r?[r,"pm package catalog --project --json"]:[`npm view ${n}`,"pm package catalog --project --json"],nextSteps:r?[`Try ${r} if the repository exists.`,"Use pm package catalog --project --json to inspect bundled package aliases before installing."]:[`Verify ${n} exists in the npm registry and that you have access to it.`,"Use pm package catalog --project --json to inspect bundled package aliases before installing."],recovery:{attempted_command:`pm install --project npm:${e}`,normalized_args:["install","--project",`npm:${e}`],...i&&r?{fallback_candidates:[{source:i,command:r,reason:"canonical first-party GitHub repository fallback for unpublished pm packages"}],next_best_command:r}:{}}}}}function ce(e,n){if(!ie(n))return null;const t=se(e);return new d(t.message,p.NOT_FOUND,t.context)}async function S(e){if(c.isAbsolute(e)||e.startsWith(".")||e.startsWith("..")){const n=c.resolve(process.cwd(),e);return await m(n)?n:null}try{const n=new URL(e);if(n.protocol==="file:"){const t=M(n);return await m(t)?t:null}}catch{}if(!/^[a-z][a-z0-9+.-]*:/i.test(e)){const n=c.resolve(process.cwd(),e);if(await m(n))return n}return null}async function $(e){const n=await S(e);if(n)return n;const t=le(e);return t!==e?t:(/^[a-z][a-z0-9+.-]*:/i.test(e),e)}function le(e,n=process.cwd()){const t="@file:",a=e.lastIndexOf(t);if(!P(e))return e;const i=e.slice(0,a),r=e.slice(a+t.length);if(r.startsWith("//")&&!r.startsWith("///"))return e;if(!r.startsWith("/"))return`${i}@${c.resolve(n,r)}`;let o;try{o=decodeURIComponent(new URL(`file:${r}`).pathname)}catch{return e}const s=/^\/[A-Za-z]:/.test(o)?o.slice(1):o;return`${i}@${s}`}function A(e,n){const t=c.resolve(e,n),a=c.relative(e,t);if(a.length===0||a===".."||a.startsWith(`..${c.sep}`)||c.isAbsolute(a))throw new d("npm pack reported a package archive outside its isolated destination.",p.GENERIC_FAILURE,{code:"npm_package_archive_unsafe",required:"Retry with a trusted npm client that writes its archive inside the requested pack destination.",why:"pm will not read a package-manager artifact outside the isolated directory created for this install."});return t}function pe(e,n){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e;if(!(typeof t.filename!="string"||t.filename.trim().length===0))return{...n===void 0?{}:{key:n},filename:t.filename,...typeof t.name=="string"?{name:t.name}:{},...typeof t.version=="string"?{version:t.version}:{}}}function de(e){return(Array.isArray(e)?e.map(t=>({value:t})):typeof e=="object"&&e!==null?Object.entries(e).map(([t,a])=>({key:t,value:a})):[]).flatMap(({key:t,value:a})=>{const i=pe(a,t);return i?[i]:[]})}function ue(e,n){const t=n?.trim().toLowerCase(),a=t?e.filter(o=>{const s=o.name?.trim().toLowerCase();return s!==void 0?s===t:o.key?.trim().toLowerCase()===t}):[];if(a.length===1)return a[0];if(e.length!==1)return;const i=e[0],r=i.name??i.key;return t&&r!==void 0&&r.trim().toLowerCase()!==t?void 0:i}function N(e,n,t){let a;try{a=JSON.parse(e)}catch{const o=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0).at(-1);if(!o)throw new d("npm pack did not report a tarball filename.",p.GENERIC_FAILURE);return{tarball:A(n,o)}}const i=de(a),r=ue(i,t);if(!r)throw new d("npm pack --json returned an unsupported or ambiguous package receipt.",p.GENERIC_FAILURE,{code:"npm_pack_json_shape_unsupported",required:"Use an npm client that returns an array of package receipts or an object keyed by package name, with exactly one requested package entry containing filename.",why:`Well-formed JSON contained ${i.length} usable package receipt(s), but pm could not select ${t??"one package"} deterministically.`});return{tarball:A(n,r.filename),package:r.name??r.key,version:r.version}}async function C(e){return L(e,x)}async function L(e,n){const t=await S(e.spec);if(t){if((await l.stat(t)).isFile()&&U(t))return w(t);const o=c.join(t,"package.json"),s=await m(o)?JSON.parse(await l.readFile(o,"utf8")):{};return{directory:await g(t,e.input),package:typeof s.name=="string"?s.name:void 0,version:typeof s.version=="string"?s.version:void 0,cleanup:async()=>{}}}const a=await l.mkdtemp(c.join(k.tmpdir(),"pm-npm-package-source-")),i=c.join(a,"pack");await l.mkdir(i,{recursive:!0});try{const r=await $(e.spec),o=await n(["pack",r,"--json","--pack-destination",i]),s=N(o,i,P(e.spec)?void 0:_(e.spec));if(!await m(s.tarball))throw new d("npm pack did not create its reported package archive.",p.GENERIC_FAILURE,{code:"npm_package_archive_missing",required:"Retry the npm package install with a healthy registry and writable temporary directory.",why:"The package manager reported a tarball filename that was absent before validation, so pm cannot safely extract or install it."});const u=await w(s.tarball);return{directory:u.directory,package:s.package??u.package,version:s.version??u.version,cleanup:async()=>{try{await u.cleanup()}finally{await l.rm(a,{recursive:!0,force:!0})}}}}catch(r){await l.rm(a,{recursive:!0,force:!0});const o=ce(e.spec,r);throw o||r}}function U(e){const n=e.toLowerCase();return n.endsWith(".tgz")||n.endsWith(".tar.gz")}function h(e){throw new d(e,p.USAGE,{code:"local_package_archive_unsafe",required:"Use a bounded npm .tgz or .tar.gz archive with one package/ root and no links or escaping paths.",why:"Package archives are untrusted input and must be validated before any entry reaches the filesystem."})}function R(e,n,t){if(e.meta)return;t.entries+=1,t.entries>n.maxEntries&&h(`Local package archive exceeds the ${n.maxEntries} entry limit.`);const a=e.path,i=a.split("/");(a.includes("\\")||a.startsWith("/")||/^[A-Za-z]:/u.test(a)||i.some(r=>r===".."))&&h(`Local package archive contains an escaping path: "${a}".`),i[0]!=="package"&&h(`Local package archive entry "${a}" is outside the required package/ root.`),(e.type==="SymbolicLink"||e.type==="Link")&&h(`Local package archive link "${a}" is not supported.`),e.type!=="File"&&e.type!=="OldFile"&&e.type!=="Directory"&&h(`Local package archive entry "${a}" uses unsupported type "${e.type}".`),e.size>n.maxEntryBytes&&h(`Local package archive entry "${a}" exceeds the ${n.maxEntryBytes} byte entry limit.`),t.expandedBytes+=e.size,t.expandedBytes>n.maxExpandedBytes&&h(`Local package archive exceeds the ${n.maxExpandedBytes} expanded byte limit.`),a==="package/package.json"&&(t.packageJsonEntries+=1)}async function w(e,n=Y){(await l.stat(e)).size>n.maxArchiveBytes&&h(`Local package archive exceeds the ${n.maxArchiveBytes} archive byte limit.`);const a=await l.mkdtemp(c.join(k.tmpdir(),"pm-local-package-archive-")),i=c.join(a,"extract");await l.mkdir(i,{recursive:!0});const r={entries:0,expandedBytes:0,packageJsonEntries:0};let o;try{if(await K({file:e,strict:!0,maxDecompressionRatio:100,onReadEntry:W=>{if(o===void 0)try{R(W,n,r)}catch(B){o=B}}}),o!==void 0)throw o;r.packageJsonEntries!==1&&h(`Local package archive must contain exactly one package/package.json entry; found ${r.packageJsonEntries}.`),await H({file:e,cwd:i,strict:!0,preservePaths:!1,preserveOwner:!1,noMtime:!0,unlink:!0,maxDepth:64,maxDecompressionRatio:100});const s=c.join(i,"package"),u=c.join(s,"package.json"),f=JSON.parse(await l.readFile(u,"utf8"));return await I(s),{directory:await g(s,e),package:typeof f.name=="string"?f.name:void 0,version:typeof f.version=="string"?f.version:void 0,cleanup:async()=>{await l.rm(a,{recursive:!0,force:!0})}}}catch(s){throw await l.rm(a,{recursive:!0,force:!0}),s}}async function I(e,n=x){const t=c.join(e,"package.json");if(!await m(t))return;let a;try{a=JSON.parse(await l.readFile(t,"utf8"))}catch{return}if(typeof a!="object"||a===null)return;const i=a,r=z(i),o=O(i);if(r.length===0&&!o)return;const s={...a};delete s.devDependencies;const u={...s};G(u),await l.writeFile(t,`${JSON.stringify(u,null,2)}
|
|
4
|
+
`,"utf8");try{await Promise.all([l.rm(c.join(e,"package-lock.json"),{force:!0}),l.rm(c.join(e,"npm-shrinkwrap.json"),{force:!0})]),r.length>0&&await n(["install","--ignore-scripts","--no-audit","--fund=false","--package-lock=false","--no-save","--omit=peer","--"],e),o&&await F(e)}finally{await l.writeFile(t,`${JSON.stringify(s,null,2)}
|
|
5
|
+
`,"utf8")}}function O(e){for(const n of[e.dependencies,e.optionalDependencies,e.peerDependencies])if(typeof n=="object"&&n!==null&&y in n)return!0;return!1}function G(e){for(const n of["dependencies","optionalDependencies","peerDependencies"]){const t=e[n];if(typeof t!="object"||t===null)continue;const a={...t};delete a[y],Object.keys(a).length===0?delete e[n]:e[n]=a}}async function F(e){const n=Z(import.meta.url,["../../.."]),[t,a]=y.split("/"),i=c.join(e,"node_modules",t),r=c.join(i,a);await l.mkdir(i,{recursive:!0}),await l.rm(r,{recursive:!0,force:!0}),await l.symlink(n,r,D(process.platform))}function D(e){return e==="win32"?"junction":"dir"}function me(e,n){if(e.startsWith("-"))throw new d(`Extension runtime dependency name "${e}" is unsafe because npm could interpret it as a command-line option.`,p.USAGE,{code:"extension_dependency_name_unsafe",required:"Use a valid npm package name that does not begin with a dash.",why:"Extension manifests are untrusted input and dependency names must never become npm options."});if([...n].some(a=>{const i=a.charCodeAt(0);return i<=31||i===127||"&|;()`\"'".includes(a)}))throw new d(`Extension runtime dependency "${e}" has an unsafe version specifier.`,p.USAGE,{code:"extension_dependency_version_unsafe",required:"Use an npm version, range, dist-tag, URL, or file specifier without shell metacharacters.",why:"npm.cmd requires a command shell on Windows, so untrusted shell metacharacters cannot be forwarded."});try{T.resolve(e,n)}catch{throw new d(`Extension runtime dependency "${e}@${n}" is not a valid npm dependency specifier.`,p.USAGE,{code:"extension_dependency_spec_invalid",required:"Use a valid npm package name and npm-supported version, range, dist-tag, URL, or file specifier.",why:"Only grammar-validated dependency specs may be written to the isolated runtime install manifest."})}return`${e}@${n}`}function z(e){const n=new Map;for(const t of[e.dependencies,e.optionalDependencies,e.peerDependencies])if(!(typeof t!="object"||t===null))for(const[a,i]of Object.entries(t)){if(a===y||typeof i!="string"||i.trim().length===0||n.has(a))continue;const r=i.trim();n.set(a,me(a,r))}return[...n.values()]}async function g(e,n){const t=await V(e);if(t.length===1)return t[0];if(t.length>1){const a=t.map(i=>c.relative(e,i).replaceAll(c.sep,"/")).sort((i,r)=>i.localeCompare(r));throw new d(`Package source "${n}" contains multiple extension manifests. Provide an explicit extension path. Candidates: ${a.join(", ")}`,p.USAGE)}throw new d(`Unable to locate a pm extension manifest in package source "${n}". Package installs currently activate only extension resources, so add package.json pm.extensions or an extensions/ directory. Metadata-only resources like pm.docs/pm.examples are catalog metadata and do not activate commands.`,p.USAGE)}async function fe(e,n){const t=[];n.subpath&&(t.push(n.subpath),t.push(c.posix.join(".agents/pm/extensions",n.subpath)),t.push(c.posix.join(".custom/pm-extensions",n.subpath)),t.push(c.posix.join(".custom/pm-extension",n.subpath)));for(const i of t){const r=c.resolve(e,i);if(X(e,r)&&await m(c.join(r,"manifest.json")))return{directory:r,resolved_subpath:i}}if(await m(c.join(e,"manifest.json")))return{directory:e,resolved_subpath:"."};const a=await g(e,n.input);return{directory:a,resolved_subpath:c.relative(e,a).replaceAll(c.sep,"/")}}function he(e){const n=e.trim();return n.length===0||n.startsWith(".")||n.startsWith("~")?!1:n.startsWith("@")?n.split("/").length===2:!n.includes("/")&&!n.includes("\\")}async function ge(e){const n=`Local extension source does not exist: "${e.absolute_path}".`,t=e.input.trim();if(!he(t))return new d(n,p.NOT_FOUND);let a=[];try{const r=process.env.PM_CLI_PACKAGE_ROOT,o=typeof r=="string"&&r.trim().length>0?c.resolve(r.trim()):"";v?.key!==o&&(v={key:o,aliases:await Q()}),a=v.aliases}catch{}const i=[`Retry with pm package install npm:${t} if the package is published to npm.`,`Or inspect bundled packages with pm package catalog --project --json before installing by alias. Known aliases (blank means none found): ${a.join(", ")}`];return new d(`${n} "${t}" did not match a local directory, bundled package alias, or bundled package name; if you meant an npm package, install it as "npm:${t}".`,p.NOT_FOUND,{code:"local_source_not_found_bare_name",required:`Use "npm:${t}" for npm registry packages, a bundled catalog alias, or an existing local directory path.`,why:"Bare names resolve as local paths only after bundled aliases, so unmatched names need an explicit npm: source.",examples:[`pm package install npm:${t}`,"pm package catalog --project --json"],nextSteps:i,recovery:{attempted_command:`pm install ${t}`,normalized_args:["install",t],next_best_command:`pm package install npm:${t}`}})}async function Ue(e){if(e.kind==="local"){let a;try{a=await l.stat(e.absolute_path)}catch{throw await ge(e)}if(a.isFile()&&U(e.absolute_path)){const r=await w(e.absolute_path);return{source:e,directory:r.directory,source_root:c.dirname(r.directory),resolved_subpath:c.relative(c.dirname(r.directory),r.directory).replaceAll(c.sep,"/"),npm_package:r.package,npm_version:r.version,cleanup:r.cleanup}}if(!a.isDirectory())throw new d(`Local extension source must be a directory or npm .tgz/.tar.gz archive: "${e.absolute_path}".`,p.USAGE);const i=await g(e.absolute_path,e.input);return{source:e,directory:i,source_root:e.absolute_path}}if(e.kind==="npm"){const a=await C(e);return{source:e,directory:a.directory,source_root:c.dirname(a.directory),cleanup:a.cleanup,resolved_subpath:c.relative(c.dirname(a.directory),a.directory).replaceAll(c.sep,"/"),npm_package:a.package,npm_version:a.version}}const n=await l.mkdtemp(c.join(k.tmpdir(),"pm-extension-source-")),t=["clone","--depth","1"];e.ref&&t.push("--branch",e.ref),t.push(e.repository,n);try{await j(t);const a=await j(["-C",n,"rev-parse","HEAD"]),i=await fe(n,e);return{source:e,directory:i.directory,source_root:n,resolved_subpath:i.resolved_subpath,commit:a,cleanup:async()=>{await l.rm(n,{recursive:!0,force:!0})}}}catch(a){throw await l.rm(n,{recursive:!0,force:!0}),a}}async function Re(e,n){if(!await m(e)||!await m(n))return!1;const[t,a]=await Promise.all([l.realpath(e),l.realpath(n)]);return t===a}const Ie={extractLocalPackageArchive:w,validateLocalPackageArchiveEntry:R,installNpmPackageRuntimeDependencies:I,npmPackageNameFromSpec:_,parsePackedNpmPackage:N,resolveNpmSourceDirectoryWithRunner:L,resolveNpmSourceDirectory:C,resolveNpmPackSpec:$,findInstalledNpmPackageCandidate:ee,resolvePackageExtensionDirectory:g,runtimeDependencyInstallSpecs:z,hasHostedPmCliDependency:O,removeHostedPmCliDependency:G,linkHostedPmCliDependency:F,resolveDirectorySymlinkType:D,runNpmCommand:x};export{Ie as _testOnlyInstallSources,Re as areDirectoriesEquivalent,se as buildNpmNotFoundRecovery,ee as findInstalledNpmPackageCandidate,re as isNpmNotFoundError,ie as isNpmPackNotFoundError,le as normalizeNpmLocalFileAliasSpec,Le as parseExtensionInstallSource,Ue as resolveInstallSource,ne as resolveNpmCommandName,j as runGitCommand,ae as shouldRunNpmCommandInShell,ce as wrapNpmPackResolutionError};
|
|
6
6
|
//# sourceMappingURL=install-sources.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
`,"utf8")}function
|
|
1
|
+
import{isFileMissingError as y}from"../../core/fs/fs-utils.js";import c from"node:fs/promises";import E from"node:path";import{EXIT_CODE as l}from"../../core/shared/constants.js";import{PmCliError as d}from"../../core/shared/errors.js";import{nowIso as u}from"../../core/shared/time.js";import{normalizeExtensionContributionInventory as g}from"../../core/extensions/contribution-inventory.js";import{normalizeExtensionNameForMatch as a,normalizeStringList as k}from"./shared.js";const v=".managed-extensions.json",p=1;function f(t){return E.join(t,v)}function x(){return{version:p,updated_at:u(),entries:[]}}function m(t){return[...t].sort((e,n)=>{const r=e.scope.localeCompare(n.scope);if(r!==0)return r;const i=e.name.localeCompare(n.name);return i!==0?i:e.directory.localeCompare(n.directory)})}function $(t,e){return t.kind!==e.kind||t.input!==e.input||t.location!==e.location?!1:t.kind==="npm"&&e.kind==="npm"?t.package===e.package&&t.version===e.version:t.kind==="github"&&e.kind==="github"?t.repository===e.repository&&t.ref===e.ref&&t.subpath===e.subpath&&t.commit===e.commit:t.kind==="builtin"&&e.kind==="builtin"?t.name===e.name:!0}function o(t){return typeof t=="string"?t:void 0}const h=/^(?:npm_registry|github_remote)_lookup_timed_out$/u;function M(t,e){const n=o(e);return n===void 0||t.kind!=="github"||n.trim().length===0||/^[a-z0-9_]+$/u.test(n.trim())?n:"github_remote_lookup_failed"}function _(t){return typeof t=="string"&&h.test(t.trim())}function S(t,e){return _(t)&&typeof e=="number"&&Number.isSafeInteger(e)&&e>0?{update_check_timeout_ms:e}:{}}function N(t){return typeof t.name=="string"&&t.name.trim().length>0&&typeof t.directory=="string"&&t.directory.trim().length>0&&(t.scope==="project"||t.scope==="global")&&typeof t.manifest_version=="string"&&typeof t.manifest_entry=="string"&&Array.isArray(t.capabilities)&&t.capabilities.every(e=>typeof e=="string")&&typeof t.installed_at=="string"&&typeof t.updated_at=="string"}function A(t){if(typeof t!="object"||t===null)return null;const e=t;return e.kind!=="local"&&e.kind!=="github"&&e.kind!=="npm"&&e.kind!=="builtin"||typeof e.input!="string"||typeof e.location!="string"?null:{kind:e.kind,input:e.input,location:e.location,name:o(e.name),package:o(e.package),version:o(e.version),repository:o(e.repository),owner:o(e.owner),repo:o(e.repo),ref:o(e.ref),subpath:o(e.subpath),commit:o(e.commit)}}function I(t){if(typeof t!="object"||t===null)return null;const e=t;if(!N(e))return null;const n=A(e.source);if(!n)return null;const r=g(e.contributions);return r===null?null:{name:e.name.trim(),directory:e.directory.trim(),scope:e.scope,manifest_version:e.manifest_version,manifest_entry:e.manifest_entry,capabilities:k(e.capabilities),contributions:r,installed_at:e.installed_at,updated_at:e.updated_at,source:n,last_update_check_at:o(e.last_update_check_at),last_update_remote_commit:o(e.last_update_remote_commit),last_update_remote_version:o(e.last_update_remote_version),update_available:_(e.update_error)?null:typeof e.update_available=="boolean"||e.update_available===null?e.update_available:void 0,update_error:M(n,e.update_error),...S(e.update_error,e.update_check_timeout_ms)}}function w(t){if(typeof t!="object"||t===null)return null;const e=t;if(e.version!==p||!Array.isArray(e.entries))return null;const n=[];for(const r of e.entries){const i=I(r);i&&n.push(i)}return{version:p,updated_at:o(e.updated_at)??u(),entries:m(n)}}async function G(t){const e=f(t),n=x();try{const r=await c.readFile(e,"utf8"),i=JSON.parse(r),s=w(i);if(!s)throw new d(`Managed extension state file "${e}" has an invalid schema. Repair or remove it before mutating extension state.`,l.GENERIC_FAILURE);return{path:e,state:s,warnings:[]}}catch(r){if(r instanceof d)throw r;if(typeof r=="object"&&r!==null&&"code"in r&&y(r))return{path:e,state:n,warnings:[]};throw new d(`Managed extension state file "${e}" could not be read. Repair or remove it before mutating extension state.`,l.GENERIC_FAILURE)}}async function R(t,e){const n=f(t),r={version:p,updated_at:u(),entries:m(e.entries)};await c.mkdir(t,{recursive:!0}),await c.writeFile(n,`${JSON.stringify(r,null,2)}
|
|
2
|
+
`,"utf8")}function T(t,e){const n=t.entries.filter(r=>a(r.name)!==a(e.name)&&a(r.directory)!==a(e.directory));return n.push(e),{...t,updated_at:u(),entries:m(n)}}async function L(t,e,n,r){const i=e.entries.find(b=>a(b.name)===a(n));if(!i)return e;const s=T(e,{...i,contributions:r});return await R(t,s),s}export{x as createEmptyManagedExtensionState,$ as managedExtensionSourcesEquivalent,w as normalizeManagedState,L as persistManagedContributionInventory,G as readManagedExtensionState,f as resolveManagedExtensionStatePath,m as sortManagedEntries,T as upsertManagedEntry,R as writeManagedExtensionState};
|
|
3
3
|
//# sourceMappingURL=managed-state.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{mapWithFixedConcurrency as c}from"./concurrency.js";import{sortManagedEntries as _}from"./managed-state.js";import{checkGithubUpdate as m,checkNpmUpdate as p,resolveExtensionUpdateCheckTimeoutMs as f,updateCheckTeardown as l}from"./update-check.js";const u=4;function h(n){let r=n;const a=[];return{acquire:()=>r>0?(r-=1,Promise.resolve()):new Promise(e=>a.push(e)),release:()=>{const e=a.shift();e?e():r+=1}}}function s(n,r){const{update_check_timeout_ms:a,...e}=n;return r===void 0?e:{...e,update_check_timeout_ms:r}}async function w(n,r=!1,a=f(),e=!0){const o=h(u),d=await c(n.entries,u,async i=>{if(!["github","npm"].includes(i.source.kind))return i;if(r)return s({...i,last_update_check_at:void 0,last_update_remote_commit:void 0,last_update_remote_version:void 0,update_available:null,update_error:void 0},void 0);await o.acquire();const t=i.source.kind==="github"?await m(i.source,void 0,a):await p(i.source,void 0,a);return e?l(t).then(o.release):o.release(),s({...i,last_update_check_at:t.checked_at,last_update_remote_commit:"remote_commit"in t?t.remote_commit:void 0,last_update_remote_version:"remote_version"in t?t.remote_version:void 0,update_available:t.available,update_error:t.error},t.timeout_ms)});return{...n,entries:_(d)}}export{w as refreshManagedExtensionUpdates};
|
|
2
2
|
//# sourceMappingURL=managed-update-status.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
`,op:"extension_migrations_apply",author:
|
|
1
|
+
import M from"node:fs/promises";import b from"node:path";import{pathExists as C}from"../../core/fs/fs-utils.js";import{activateExtensions as $,loadExtensions as A}from"../../core/extensions/index.js";import{writeWorkspaceJsonWithHistory as O}from"../../core/history/workspace-history.js";import{readSettings as x}from"../../core/store/settings.js";function y(e){return b.join(e,"extension-migrations.json")}function S(e,a){const o=e.definition.id;return typeof o=="string"&&o.trim().length>0?o.trim():`migration-${String(a+1).padStart(3,"0")}`}function k(e,a){return`${e.layer}:${e.name}:${a}`}async function P(e){const a=y(e);if(!await C(a))return{version:1,updated_at:"",entries:[]};const o=JSON.parse(await M.readFile(a,"utf8"));return{version:1,updated_at:typeof o.updated_at=="string"?o.updated_at:"",entries:Array.isArray(o.entries)?o.entries.filter(n=>typeof n?.key=="string"&&(n.status==="applied"||n.status==="failed")):[]}}async function I(e,a){const o=await P(e),n=new Map(o.entries.map(i=>[i.key,i]));return a.forEach((i,c)=>{const f=S(i,c),l=n.get(k(i,f));l&&(i.definition.status=l.status,l.status==="failed"?i.definition.reason=l.error:(delete i.definition.reason,delete i.definition.error,delete i.definition.message))}),o}async function J(e){const a=await I(e.pmRoot,e.migrations),o=new Map(a.entries.map(t=>[t.key,t])),n=[];let i=!1;const c=e.migrations.map((t,u)=>({migration:t,index:u})).filter(({migration:t})=>e.scope===void 0||t.layer===e.scope);for(const{migration:t,index:u}of c){const s=S(t,u),r=k(t,s),v=o.get(r),m=String(t.definition.status??"pending").toLowerCase(),d=v?.status??(m==="applied"||m==="failed"?m:"pending");if(d==="applied"){n.push({key:r,layer:t.layer,extension:t.name,id:s,before:d,outcome:"skipped"});continue}if(e.dryRun===!0){n.push({key:r,layer:t.layer,extension:t.name,id:s,before:d,outcome:"pending"});continue}const _=t.runtime_definition?.run??t.definition.run;if(typeof _!="function"){n.push({key:r,layer:t.layer,extension:t.name,id:s,before:d,outcome:"pending"});continue}const w=new Date().toISOString();try{await Promise.resolve(_({id:s,command:"migration",layer:t.layer,extension:t.name,pm_root:e.pmRoot,status:d}));const p={key:r,layer:t.layer,extension:t.name,id:s,status:"applied",attempted_at:w};o.set(r,p),t.definition.status="applied",delete t.definition.reason,delete t.definition.error,delete t.definition.message,n.push({key:r,layer:t.layer,extension:t.name,id:s,before:d,outcome:"applied"}),i=!0}catch(p){const g=p instanceof Error?p.message:String(p),E={key:r,layer:t.layer,extension:t.name,id:s,status:"failed",attempted_at:w,error:g};o.set(r,E),t.definition.status="failed",t.definition.reason=g,n.push({key:r,layer:t.layer,extension:t.name,id:s,before:d,outcome:"failed",error:g}),i=!0}}if(i){const t=await x(e.pmRoot),u={version:1,updated_at:new Date().toISOString(),entries:[...o.values()].sort((s,r)=>s.key.localeCompare(r.key))};await O({pmRoot:e.pmRoot,filePath:y(e.pmRoot),raw:`${JSON.stringify(u,null,2)}
|
|
2
|
+
`,op:"extension_migrations_apply",author:e.author,lockTtlSeconds:t.locks.ttl_seconds,lockWaitMs:t.locks.wait_ms})}const f=n.filter(t=>t.outcome==="pending").length,l=n.filter(t=>t.outcome==="applied").length,R=n.filter(t=>t.outcome==="skipped").length,h=n.filter(t=>t.outcome==="failed").length;return{ok:h===0,dry_run:e.dryRun===!0,state_path:y(e.pmRoot),total:n.length,pending_count:f,applied_count:l,skipped_count:R,failed_count:h,migrations:n}}async function F(e){const a=await x(e.resolvedRoots.settings_root),o=await A({pmRoot:e.resolvedRoots.pm_root,settings:a,cwd:process.cwd(),noExtensions:e.global.noExtensions===!0}),n=await $(o);e.warnings.push(...o.warnings,...n.warnings);const i=await J({pmRoot:e.resolvedRoots.pm_root,migrations:n.registrations.migrations,author:typeof e.global.author=="string"&&e.global.author.trim().length>0?e.global.author.trim():"pm-extension-migration",dryRun:e.options.dryRun===!0,...e.scope==="global"?{scope:"global"}:{}});return e.withResult({migration:i,load_failure_count:o.failed.length,activation_failure_count:n.failed.length},i.ok)}export{I as applyStoredExtensionMigrationState,P as readExtensionMigrationState,y as resolveExtensionMigrationStatePath,F as runExtensionMigrateAction,J as runExtensionMigrations};
|
|
3
3
|
//# sourceMappingURL=migrations.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{isCoreCommandPath as o}from"../cli-contracts/runtime-contracts.js";function n(e){return{undeclaredKeys:o(e)?"pass":"refuse"}}export{n as resolveDirectExtensionOptionPolicy};
|
|
2
2
|
//# sourceMappingURL=native-command-options.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{normalizeExtensionNameForMatch as o}from"./shared.js";function m(r,a){const n=new Set((a?.loaded??[]).flatMap(e=>(e.activation?.commands?.length??0)>0?[`${e.layer}:${o(e.name)}`]:[])),i=r.services.overrides.filter(e=>e.service==="output_format").filter(e=>e.passThrough!==!0).filter(e=>!n.has(`${e.layer}:${o(e.name)}`)).map(e=>`extension_output_service_override_global:${e.service}:${e.layer}:${e.name}`),t=r.renderers.overrides.filter(e=>(e.commands?.length??0)===0&&e.resultDiscriminator===void 0).map(e=>`extension_output_renderer_override_global:${e.format}:${e.layer}:${e.name}`);return[...new Set([...i,...t])].sort((e,s)=>e.localeCompare(s))}export{m as collectGlobalOutputOverrideDoctorWarnings};
|
|
2
2
|
//# sourceMappingURL=output-ownership.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{normalizeExtensionNameForMatch as t}from"./shared.js";function i(m,e){const r=t(m),n=e.find(o=>t(o.name)===r);return{command_paths:[...n?.command_paths??[]].sort((o,a)=>o.localeCompare(a)),action_paths:[...n?.action_paths??[]].sort((o,a)=>o.localeCompare(a))}}export{i as summarizeRuntimeCommandPathsForExtension};
|
|
2
2
|
//# sourceMappingURL=runtime-summary.js.map
|