@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{unicodeSafePrefix as O}from"../shared/text-normalization.js";const s="changed_fields",h="changed_field_count",p="rows",j=new Set(["apply","rollback"]),u=new Set(["deleted","would_delete"]),l=256,y={start_task:["claim","update"],pause_task:["update","release"],close_task:["close","release"]};function E(e,n){if(!r(e)||typeof e.action!="string"||typeof e.id!="string"||e.id.length===0)return null;const t=Object.hasOwn(y,e.action)?y[e.action]:void 0;if(!t||!t.every(o=>{const a=e[o];return r(a)&&r(a.item)&&a.item.id===e.id&&Array.isArray(a.changed_fields)&&a.changed_fields.every(f=>typeof f=="string")}))return null;const i=e[t.at(-1)],c=g(i);return n.idOnly?c:!n.compactEnvelope&&n.changedFields!=="compact"?null:{...e,...n.compactEnvelope?{...c,changed_field_count:new Set(t.flatMap(o=>e[o].changed_fields)).size}:{},...Object.fromEntries(t.map(o=>[o,k(e[o],n)]))}}function m(e){return typeof e!="string"||e.length<=l?e:`${O(e,l-1)}\u2026`}function b(e){if(!r(e))return null;const n={...e};return n.reason=m(n.reason),r(n.previous_terminal)&&(n.previous_terminal=Object.fromEntries(Object.entries(n.previous_terminal).map(([t,i])=>[t,m(i)]))),n}function r(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}function _(e){const n=e[s];if(!Array.isArray(n))return null;const t=Object.getPrototypeOf(e)===null?Object.create(null):{};for(const[i,c]of Object.entries(e))i!==s&&(t[i]=c);return t[h]=n.length,t}function A(e){return"item"in e&&Array.isArray(e[s])}function w(e){return typeof e.mode=="string"&&j.has(e.mode)&&Array.isArray(e[p])}function M(e,n){const t=Object.getPrototypeOf(e)===null?Object.create(null):{};return Object.assign(t,e),t[p]=n,t}function g(e){if(!r(e))return null;const n=r(e.item)?e.item:r(e.plan)?e.plan:null;if(n===null)return null;const t=typeof n.id=="string"?n.id:void 0,i=typeof e.outcome=="string"&&u.has(e.outcome)?e.outcome:typeof n.status=="string"?n.status:void 0;return t?i?{id:t,status:i,...typeof e.deleted=="boolean"?{deleted:e.deleted}:{}}:{id:t}:null}function C(e,n){if(!r(e))return null;if(r(e.plan)&&r(e.mutation_receipt)&&e.mutation_receipt.kind==="plan_mutation"&&e.mutation_receipt.id===e.plan.id&&e.mutation_receipt.action===e.action)return e.mutation_receipt;if(!n||!r(e.item)||typeof e.item.id!="string")return null;const t=e[s];if(!Array.isArray(t))return null;const i={id:e.item.id,...typeof e.outcome=="string"&&u.has(e.outcome)?{status:e.outcome}:typeof e.item.status=="string"?{status:e.item.status}:{},...typeof e.deleted=="boolean"?{deleted:e.deleted}:{},...typeof e.previous_status=="string"?{previous_status:e.previous_status}:{},changed_field_count:t.length};return T(e,e.item,i),i}function T(e,n,t){const i=typeof e.close_reason=="string"?e.close_reason:typeof n.close_reason=="string"?n.close_reason:void 0;i!==void 0&&(t.close_reason=i);const c=b(e.recurrence);c!==null&&(t.recurrence=c),Array.isArray(e.warnings)&&e.warnings.length>0&&(t.warnings=e.warnings);for(const o of["recovery","follow_up","handoff","completion","start","takeover"])r(e[o])&&(t[o]=e[o]);if(typeof e.claimed_by=="string"||typeof e.released_by=="string")for(const o of["claimed_by","released_by","previous_assignee","forced","skipped","available","attempts","start_refused","suggestions"])Object.hasOwn(e,o)&&(t[o]=e[o])}function R(e){const n=w(e)?e[p]:void 0;if(!Array.isArray(n))return{projected:e,changed:!1};let t=!1;const i=n.map(c=>{if(!r(c))return c;const o=_(c);return o?(t=!0,o):c});return t?{projected:M(e,i),changed:!0}:{projected:e,changed:!1}}function k(e,n={}){const t=E(e,n);if(t!==null)return t;if(n.idOnly===!0){const d=g(e);if(d!==null)return d}if(n.compactEnvelope===!0||n.changedFields==="compact"){const d=C(e,n.compactEnvelope===!0);if(d!==null)return d}if((n.changedFields??"full")==="full"||!r(e))return e;let c=!1,o=e;const a=A(e)?_(e):null;a!==null&&(o=a,c=!0);const f=R(o);return f.changed&&(o=f.projected,c=!0),c?o:e}export{k as projectMutationResult};
|
|
2
2
|
//# sourceMappingURL=mutation-projection.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const s="__pm_suppress_host_output",p="@unbrained/pm-cli:suppress-host-output:v1";function u(t){return t===void 0?{__pm_suppress_host_output:p}:{__pm_suppress_host_output:p,result:t}}function _(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&t[s]===p}export{p as SUPPRESS_HOST_OUTPUT_MARKER,_ as isHostOutputSuppressed,u as suppressHostOutput};
|
|
2
2
|
//# sourceMappingURL=output-control.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
`).map(
|
|
3
|
-
`)}function
|
|
4
|
-
${
|
|
5
|
-
${
|
|
6
|
-
${
|
|
7
|
-
`)}return`${
|
|
1
|
+
import{getActiveCommandContext as V,runActiveCommandOverride as G,runActiveRendererOverride as H,runActiveServiceOverrideSync as v,setActiveCommandResult as A}from"../extensions/index.js";import{EXIT_CODE as a}from"../shared/constants.js";import{isHostOutputSuppressed as K}from"./output-control.js";import{projectMutationResult as j}from"./mutation-projection.js";import{projectLinkedTestReply as X}from"./linked-test-projection.js";import{attachReadOutputContracts as k}from"../../sdk/context-intent-contracts.js";import{attachOutputTokenAccounting as Y}from"../../sdk/output-token-accounting.js";import{propagateContextUsageServingReceipt as I}from"../../sdk/context-usage.js";import{isReadResultOmittedForBudget as C,resolveReadOutputEncoding as z,resolveReadOutputSurface as Q}from"../../sdk/read-output-contracts.js";import{readOutputPositionalRowPaths as Z}from"../../sdk/read-output/positional-rows.js";import{GET_FACET_ROOTS as ee}from"../../sdk/query/get-facet-roots.js";import{withDeliveredOutputRenderer as S}from"../../sdk/read-output-budget.js";import{encode as b}from"@toon-format/toon";import{encodePmTableRows as te,projectPmTableEncodingForToon as ne}from"../../sdk/output/table-rows.js";import{projectPmBriefListEnvelope as re,projectPmBriefSearchEnvelope as oe}from"../../sdk/output/list-envelope.js";import{prepareWellFormedOutputText as ie}from"../shared/output-unicode.js";const se=new Set(Object.values(a)),ue=new Map([["notes_count","notes"],["tests_count","tests"]]),x="__pm_native_output";let L=!1;function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function R(e){const t={read_output:{result_omitted:!0}};I(e,t),A(t)}function w(e,t,n){if(n){A(e);return}R(t)}function ce(e){if(!c(e)||e[x]!==!0)return e;const{[x]:t,...n}=e;return n}function y(e){return typeof e=="object"&&e!==null&&e.code==="EPIPE"}function de(){(process.exitCode===void 0||process.exitCode===a.SUCCESS)&&(process.exitCode=a.SUCCESS)}function fe(){(process.exitCode===void 0||process.exitCode===a.SUCCESS)&&(process.exitCode=a.GENERIC_FAILURE)}function T(e){if(e==="stdout"){de();return}fe()}function F(e){const t=e instanceof Error?e:new Error(String(e));setImmediate(()=>{throw t})}function ae(){L||(L=!0,process.stdout.on("error",e=>{if(y(e)){T("stdout");return}F(e)}),process.stderr.on("error",e=>{if(y(e)){T("stderr");return}F(e)}))}function B(e,t){ae();try{return e==="stdout"?process.stdout.write(t):process.stderr.write(t),!0}catch(n){if(y(n))return T(e),!1;throw n}}function le(e){return B("stdout",e)}function M(e){return B("stderr",e)}function U(e){return typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"?String(e):e===null?"null":JSON.stringify(e)}function $(e,t){const n=" ".repeat(t);return e.split(`
|
|
2
|
+
`).map(r=>`${n}${r}`).join(`
|
|
3
|
+
`)}function me(e){const t=new Set;let n=0;for(const r of e){const o=Object.keys(r);n+=o.length;for(const i of o)t.add(i)}return e.length*t.size<=n*2}function pe(e,t,n,r){const o=" ".repeat(n);if(!c(t)&&!Array.isArray(t))return`${o}${e}: ${U(t)}`;const i=e==="omission_receipt"?Oe(t,n):void 0;if(i!==void 0)return i;if(Array.isArray(t)){if(t.length===0)return`${o}${e}: []`;const s=$(b({[e]:t}),n);return r&&t.length>=1&&t.every(c)&&me(t)?[!1,!0].map(d=>{const f=te(t,{compact:d});return $(b({[e]:f.rows,[`${e}_encoding`]:ne(f.encoding)}),n)}).reduce((d,f)=>Buffer.byteLength(f)<Buffer.byteLength(d)?f:d,s):s}return c(t)&&Object.keys(t).length===0?`${o}${e}: {}`:`${o}${e}:
|
|
4
|
+
${_(t,n+1)}`}function Oe(e,t){const n=" ".repeat(t);if(Re(e))return`${n}omission_receipt: complete`;const r=c(e)?ge(e):void 0;if(r===void 0)return;const o=`${n}omission_receipt:
|
|
5
|
+
${_(e,t+1)}`,i=`${n}omission_receipt:
|
|
6
|
+
${_(r,t+1)}`;return Buffer.byteLength(i)<Buffer.byteLength(o)?i:o}function ge(e){const t=e.omitted_field_groups;if(!Array.isArray(t)||t.length===0||Object.hasOwn(e,"restore_with"))return;const n=[];let r;for(const o of t){if(!c(o)||Object.keys(o).length!==2)return;const{name:i,restore_with:s}=o;if(typeof i!="string"||i.length===0||typeof s!="string"||!s.endsWith(i))return;const u=s.slice(0,s.length-i.length);if(r!==void 0&&u!==r)return;r=u,n.push(i)}return Object.fromEntries(Object.entries(e).flatMap(([o,i])=>o==="omitted_field_groups"?[[o,n],["restore_with",`${r}<name>`]]:[[o,i]]))}function _e(e,t,n){const r=e.map(o=>l(o,t,n||t.preserveRowFacts&&c(o))).filter(o=>o!==void 0);return r.length>0||n?r:void 0}function l(e,t={omitDuplicateCountAliases:!0,preserveRowFacts:!0},n=!1){if(e===null)return n?null:void 0;if(Array.isArray(e))return _e(e,t,n);if(c(e)){const r=[],o=Object.entries(e).filter(([i,s])=>{const u=ue.get(i);return!t.omitDuplicateCountAliases||u===void 0||!c(e.collection_counts)||s!==e.collection_counts[u]});for(const[i,s]of o){if(i==="omitted_field_groups"&&Array.isArray(s)&&s.length===0){r.push([i,[]]);continue}const u=l(s,t,n);u!==void 0&&r.push([i,u])}return r.length>0||n?Object.fromEntries(r):void 0}return e}function _(e,t){const n=" ".repeat(t);if(Array.isArray(e))return e.length===0?"[]":$(b(e),t);if(c(e)){const r=Object.entries(e);return r.length===0?"{}":r.map(([o,i])=>pe(o,i,t,!Object.hasOwn(e,`${o}_encoding`)&&!(o==="checks"&&c(e.verdict)&&e.verdict.authority==="ok"))).join(`
|
|
7
|
+
`)}return`${n}${U(e)}`}function he(e){if(!c(e)||e.output_default!=="markdown"||typeof e.view!="string"||!Array.isArray(e.events)||!Array.isArray(e.days))return null;const t=[`# pm calendar (${e.view})`,""],n=c(e.summary)?e.summary:{};if(t.push(`- events: ${String(n.events??0)}`),t.push(""),e.events.length===0)return t.push("No calendar events matched the selected filters."),`${t.join(`
|
|
8
8
|
`)}
|
|
9
|
-
`;for(const
|
|
9
|
+
`;for(const r of e.events){if(!c(r))continue;const o=typeof r.kind=="string"?r.kind:"event",i=typeof r.item_title=="string"?r.item_title:"",s=typeof r.item_id=="string"?r.item_id:"",u=typeof r.reminder_text=="string"&&r.reminder_text.length>0?` ${r.reminder_text}`:"";t.push(`- [${o}] ${s} ${i}${u}`.trim())}return`${t.join(`
|
|
10
10
|
`)}
|
|
11
|
-
`}const
|
|
12
|
-
`}const
|
|
13
|
-
`:`${
|
|
14
|
-
`}const
|
|
15
|
-
`),
|
|
16
|
-
`)?
|
|
17
|
-
`,structuredDeliveryPreserved:!1}:{result:
|
|
18
|
-
`)?
|
|
19
|
-
`,custom:!0}:{text:
|
|
20
|
-
`)?
|
|
21
|
-
`)}const
|
|
11
|
+
`}const Ce=new Set(["filters","now","projection","sorting"]);function Ee(e){const t=l(e,{omitDuplicateCountAliases:!1,preserveRowFacts:!1});if(!c(t)||!Array.isArray(t.items))return t??null;const n=Object.fromEntries(Object.entries(t).filter(([r])=>!Ce.has(r)));return n.has_more!==!0&&delete n.next_cursor,n}function Ae(e){return!c(e)||e.ok!==!0||!c(e.verdict)||e.verdict.authority!=="ok"||!Array.isArray(e.checks)?e:{...e,checks:e.checks.map(je)}}function je(e){if(!c(e)||e.ok!==!0||!c(e.details)||Object.keys(e.details).length!==0)return e;const{details:t,...n}=e;return n}function q(e,t,n=!1,r={}){if(e=ie(e),t==="json"){const i=n?Ee(e):e,s=c(e)&&c(e.projection)&&e.projection.mode==="brief"&&Array.isArray(e.items);return`${JSON.stringify(i,null,s?void 0:2)}
|
|
12
|
+
`}const o=be(e,Se(e,l(Ae(oe(re(e))),E),r.preserveEmptyItemCollections===!0),r.positionalRowPaths??[]);return o===void 0?`{}
|
|
13
|
+
`:`${_(o,0)}
|
|
14
|
+
`}const E={omitDuplicateCountAliases:!0,preserveRowFacts:!0};function P(e,t,n=!1){if(Array.isArray(e)){if(e.length===0)return[];const i=Array.isArray(t)?t:[],s=i.length===e.length;let u=0;const d=e.flatMap(f=>{const m=n||c(f),O=!s&&l(f,E,m)===void 0,g=P(f,O?void 0:i[u++],m);return g===void 0?[]:[g]});return d.length>0?d:t}if(!c(e))return t;const r=c(t)?t:{},o=Object.entries(e).flatMap(([i,s])=>{const u=P(s,Object.hasOwn(r,i)?r[i]:void 0,n);return u===void 0?[]:[[i,u]]});return o.length>0||Object.keys(e).length===0?Object.fromEntries(o):t}function Se(e,t,n){if(!n||!c(e))return t;const r=c(t)?t:{},o=new Map(Object.keys(e).filter(i=>i==="item"||ee.has(i)).map(i=>[i,P(e[i],r[i])]));return W(e,r,o)}function W(e,t,n){const r=Object.entries(t).map(([i,s])=>[i,n.has(i)?n.get(i):s]),o=Object.keys(e);for(const[i,s]of n){if(Object.hasOwn(t,i)||s===void 0)continue;const u=new Set(o.slice(o.indexOf(i)+1)),d=r.findIndex(([f])=>u.has(f));r.splice(d===-1?r.length:d,0,[i,s])}return Object.fromEntries(r)}function be(e,t,n){if(!c(e))return t;const r=n.filter(s=>{const u=e[s];return Array.isArray(u)&&u.some(d=>l(d,E,c(d))===void 0)});if(r.length===0)return t;const o=c(t)?t:{},i=new Map(r.map(s=>[s,e[s].map(u=>l(u,E,!0))]));return W(e,o,i)}const xe=JSON.stringify({has_omissions:!1,omitted_field_group_count:0,omitted_field_groups:[]});function Re(e){const t=Object.entries(Object(e)).sort(([n],[r])=>n.localeCompare(r));return JSON.stringify(Object.fromEntries(t))===xe}function we(e,t,n,r){const o=t?{handled:!1,result:e,warnings:[]}:v("output_format",{command:n.command,args:n.commandArgs,command_options:n.commandOptions,global:{...n},pm_root:n.pmRoot,format:r,options:{...n},result:e}),i=o.warnings.find(s=>s.startsWith("extension_output_format_payload_echo_deprecated:"));return i!==void 0&&M(`Warning: ${i}. Returning context.payload now declines safely for compatibility; migrate the override to declineServiceOverride() or { handled: false }.
|
|
15
|
+
`),o.handled&&typeof o.result=="string"?{result:o.result,rendered:o.result.endsWith(`
|
|
16
|
+
`)?o.result:`${o.result}
|
|
17
|
+
`,structuredDeliveryPreserved:!1}:{result:o.handled?o.result:e,rendered:null,structuredDeliveryPreserved:!o.handled||c(o.result)}}function ye(e,t,n,r){const o=V(),i=n.command??o?.command,s={...o?.options,...n.commandOptions,...Object.fromEntries([["outputInclude",n.outputInclude],["outputLimit",n.outputLimit],["outputBudget",n.outputBudget],["outputFormat",n.outputFormat],["outputSession",n.outputSession],["outputCursor",n.outputCursor],["outputRowContract",n.outputRowContract]].filter(p=>p[1]!==void 0))},u=z(i??"",s)??r,d={...s,resolvedOutputFormat:u},f={...n,command:i,commandOptions:d},m=we(e,t,f,u),O=Te(u,i,d,n.lean===!0);if(m.rendered!==null)return $e(m.rendered,{format:u,renderNative:O,contract:()=>k(i,d,e),effectiveResult:e,quiet:n.quiet===!0});const g=m.result;I(e,g);const J=X(i,g,{lean:n.lean===!0,fullContext:s.checkContext===!0,fullOutput:s.fullOutput===!0});let D=!1;return Pe({format:u,contract:()=>k(i,d,J),renderDelivered:p=>{if(u==="toon"){const N=he(p);if(N!==null)return{text:N,custom:!1}}const h=t||D||C(p)?{rendered:null}:H(u,p);return h.rendered!==null?{text:h.rendered.endsWith(`
|
|
18
|
+
`)?h.rendered:`${h.rendered}
|
|
19
|
+
`,custom:!0}:{text:O(p),custom:!1}},renderNative:O,useNativeRendering:()=>{D=!0},structuredDeliveryPreserved:m.structuredDeliveryPreserved,tokenAccounting:n.tokenAccounting===!0,quiet:n.quiet===!0,effectiveResult:e})}function Te(e,t,n,r){if(e==="json")return u=>q(u,"json",r);const o=n.fields,i=t==="get"&&typeof o=="string"&&o.trim().length>0,s=Z(t===void 0?void 0:Q(t,n));return u=>q(u,"toon",!1,{preserveEmptyItemCollections:i,positionalRowPaths:s})}function $e(e,t){const n=S(t.format,r=>C(r)?t.renderNative(r):e,t.contract);return C(n)?(process.exitCode||=a.USAGE,w(n,t.effectiveResult,!t.quiet),t.renderNative(n)):(R(t.effectiveResult),e)}function Pe(e){let t=S(e.format,u=>e.renderDelivered(u).text,e.contract),n=e.renderDelivered(t);n.custom&&Ne(t,n.text)&&(e.useNativeRendering(),t=S(e.format,e.renderNative,e.contract),n={text:e.renderNative(t),custom:!1}),C(t)&&(process.exitCode||=a.USAGE);let r=e.structuredDeliveryPreserved&&!n.custom;if(!e.tokenAccounting)return w(t,e.effectiveResult,!e.quiet&&r),n.text;const o=u=>{const d=e.renderDelivered(u);return d.custom&&(r=!1),d.text},i=Y(t,o),s=o(i);return w(i,e.effectiveResult,!e.quiet&&r),s}const De=[["read_output","estimated_tokens"],["context_intent","estimated_tokens"],["read_session","spent_this_call_tokens"]];function Ne(e,t){const n=Math.ceil(Buffer.byteLength(t,"utf8")/4),r=Object(e);return De.some(([o,i])=>{const s=r[o],u=c(s)?s[i]:void 0;return typeof u=="number"&&u<n})}function ve(e,t){const n=G(e),r=K(n.result)?n.result:null,o=n.result,i=c(o)&&o[x]===!0,s=r?r.result:ce(n.result);return A(s),r?(R(s),""):ye(s,i,t,ke(t))}function ke(e){return e.json===!0||e.json===void 0&&e.defaultOutputFormat==="json"?"json":"toon"}function Ie(e,t){return t.idOnly?j(e,{idOnly:!0}):t.fullChangedFields?e:t.noChangedFields?j(e,{changedFields:"compact"}):j(e,{compactEnvelope:!0})}function et(e,t){c(e)&&Number.isInteger(e.exit_code)&&se.has(Number(e.exit_code))&&(process.exitCode===void 0||process.exitCode===a.SUCCESS)&&(process.exitCode=Number(e.exit_code));const n=ve(Ie(e,t),t);t.quiet||le(n)}function tt(e){const t=v("error_format",{message:e}),n=t.handled&&typeof t.result=="string"?t.result:e;M(n.endsWith(`
|
|
20
|
+
`)?n:`${n}
|
|
21
|
+
`)}const nt={compactToonValue:l,renderToonValue:_};export{q as formatBuiltInOutput,ve as formatOutput,nt as outputTestOnly,tt as printError,et as printResult,Ie as projectPrintedResult,M as writeStderr,le as writeStdout};
|
|
22
22
|
//# sourceMappingURL=output.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function t(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function n(r){return r.brief===!0?"brief":typeof r.fields=="string"&&r.fields.trim().length>0||Array.isArray(r.fields)&&r.fields.length>0?"fields":r.compact===!0?"compact":"full"}function o(r,i){const e=n(i),f=e==="brief"?e:t(r.projection)&&typeof r.projection.mode=="string"?r.projection.mode:e;return{...r,query_summary:{filters:t(r.filters)?r.filters:{},projection:f}}}export{n as resolveQueryProjectionLabel,o as withQuerySummary};
|
|
2
2
|
//# sourceMappingURL=query-summary.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
`)}function
|
|
3
|
-
`)}export{renderRowsAsCsv,renderRowsAsTable};
|
|
1
|
+
function u(n){const t=[],e=new Set;for(const s of n)for(const i of Object.keys(s))e.has(i)||(e.add(i),t.push(i));return t}function p(n){return n==null?"":Array.isArray(n)?n.map(t=>p(t)).join(";"):typeof n=="object"?JSON.stringify(n):String(n)}function m(n){return/[",\r\n]/.test(n)?`"${n.replace(/"/g,'""')}"`:n}function a(n){if(n.length===0)return"";const t=u(n),e=[t.map(s=>m(s)).join(",")];for(const s of n)e.push(t.map(i=>m(p(s[i]))).join(","));return e.join(`
|
|
2
|
+
`)}function l(n){if(n.length===0)return"";const t=u(n),e=n.map(o=>t.map(r=>p(o[r]))),s=t.map((o,r)=>Math.max(o.length,...e.map(f=>f[r].length))),i=(o,r)=>o.padEnd(s[r]),c=[t.map((o,r)=>i(o,r)).join(" | ")];c.push(s.map(o=>"-".repeat(o)).join("-+-"));for(const o of e)c.push(o.map((r,f)=>i(r,f)).join(" | "));return c.join(`
|
|
3
|
+
`)}export{a as renderRowsAsCsv,l as renderRowsAsTable};
|
|
4
4
|
//# sourceMappingURL=tabular.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import d from"node:fs/promises";import a from"node:path";import{pathExists as u}from"../fs/fs-utils.js";import{isPathWithinDirectory as h}from"../fs/path-utils.js";import{EXIT_CODE as c}from"../shared/constants.js";import{PmCliError as f}from"../shared/errors.js";const j=["extensions","docs","examples","assets","prompts"],A=Object.freeze({extensions:Object.freeze([".agents/pm/extensions","extensions",".custom/pm-extensions",".custom/pm-extension"]),docs:Object.freeze(["docs","documentation"]),examples:Object.freeze(["examples","docs/examples"]),assets:Object.freeze(["assets",".agents/pm/assets"]),prompts:Object.freeze(["prompts",".agents/pm/prompts"])});function k(e){return j.includes(e)}function b(e,t){if(t==null)return[];const o=Array.isArray(t)?t:[t],n=[];for(const r of o){if(typeof r!="string"||r.trim().length===0)throw new f(`Package manifest field pm.${e} must contain string paths.`,c.USAGE);n.push(r.trim())}return[...new Set(n)].sort((r,s)=>r.localeCompare(s))}function x(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new f("Package manifest field pm must be an object.",c.USAGE);const t={},o=e;for(const[n,r]of Object.entries(o)){if(!k(n))continue;const s=b(n,r);s.length>0&&(t[n]=s)}return t}function i(e,t){const o=e[t];return typeof o=="string"&&o.trim().length>0?o.trim():void 0}function m(e){if(!Array.isArray(e))return;const t=e.map(o=>typeof o=="string"?o.trim():"").filter(o=>o.length>0);return t.length>0?[...new Set(t)].sort((o,n)=>o.localeCompare(n)):void 0}function l(e){if(typeof e=="string"&&e.trim().length>0)return e.trim();if(typeof e=="object"&&e!==null&&!Array.isArray(e)){const t=e.url;return typeof t=="string"&&t.trim().length>0?t.trim():void 0}}function _(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e,o={docs:i(t,"docs"),npm:i(t,"npm"),repository:i(t,"repository"),report:i(t,"report")};return Object.values(o).some(n=>typeof n=="string")?o:void 0}function E(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e,o={image:i(t,"image"),video:i(t,"video")};return Object.values(o).some(n=>typeof n=="string")?o:void 0}function P(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e,o={display_name:i(t,"display_name")??i(t,"displayName"),category:i(t,"category"),summary:i(t,"summary"),links:_(t.links),media:E(t.media),tags:m(t.tags)};return Object.values(o).some(n=>n!==void 0)?o:void 0}async function O(e){const t=a.join(e,"package.json");if(!await u(t))return{source:"convention",resources:{}};let o;try{o=JSON.parse(await d.readFile(t,"utf8"))}catch(y){throw new f(`Failed to parse package manifest at "${t}": ${String(y)}`,c.USAGE)}if(typeof o!="object"||o===null||Array.isArray(o))throw new f(`Package manifest at "${t}" must be a JSON object.`,c.USAGE);const n=o,r=n.pm,s=r!=null,p=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{};return{source:s?"pm":"convention",package_json_path:t,package_name:typeof n.name=="string"?n.name:void 0,package_version:typeof n.version=="string"?n.version:void 0,package_private:n.private===!0,package_description:typeof n.description=="string"?n.description:void 0,package_keywords:m(n.keywords),package_homepage:typeof n.homepage=="string"?n.homepage:void 0,package_repository_url:l(n.repository),package_bugs_url:l(n.bugs),aliases:m(p.aliases),resources:x(r),catalog:P(p.catalog)}}async function g(e){if(!await u(e))return[];const t=await d.readdir(e,{withFileTypes:!0}),o=[];for(const n of t){if(!n.isDirectory())continue;const r=a.join(e,n.name);await u(a.join(r,"manifest.json"))&&o.push(r)}return o.sort((n,r)=>n.localeCompare(r))}async function G(e){if(await u(a.join(e,"manifest.json")))return[e];const o=(await O(e)).resources.extensions??[],n=new Set;for(const r of o){if(r.includes("*")||r.startsWith("!"))throw new f(`Package extension entry "${r}" uses a glob/exclusion pattern. pm package installs currently require concrete extension paths or directories.`,c.USAGE);const s=a.resolve(e,r);if(!h(e,s))throw new f(`Package extension entry "${r}" resolves outside package root.`,c.USAGE);if(await u(a.join(s,"manifest.json"))){n.add(s);continue}for(const p of await g(s))n.add(p)}if(o.length===0)for(const r of A.extensions)for(const s of await g(a.join(e,r)))n.add(s);return[...n].sort((r,s)=>r.localeCompare(s))}export{A as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,j as PM_PACKAGE_RESOURCE_KINDS,G as collectPackageExtensionDirectories,O as readPmPackageManifest};
|
|
2
2
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import i from"node:fs";import t from"node:path";import{fileURLToPath as a}from"node:url";const u="@unbrained/pm-cli";function f(e){try{return JSON.parse(i.readFileSync(e,"utf8")).name===u}catch{return!1}}function d(e){let n=i.existsSync(e)&&i.statSync(e).isDirectory()?t.resolve(e):t.dirname(t.resolve(e));for(;;){const r=t.join(n,"package.json");if(i.existsSync(r)&&f(r))return n;const o=t.dirname(n);if(o===n)return;n=o}}function c(e,n=[]){const r=a(e),o=d(r);return o||t.resolve(t.dirname(r),...n)}function P(e,n=[]){try{const r=t.join(c(e,n),"package.json");if(!i.existsSync(r))return;const o=JSON.parse(i.readFileSync(r,"utf8"));return typeof o.version=="string"&&o.version.trim().length>0?o.version:void 0}catch{return}}function g(e=process.env,n="PM_CLI_PACKAGE_ROOT",r,o=[]){const s=e[n];return typeof s=="string"&&s.trim().length>0?t.resolve(s.trim()):r?c(r,o):process.cwd()}export{d as findPmPackageRootFromPath,g as resolveConfiguredPmPackageRoot,P as resolvePmCliVersion,c as resolvePmPackageRootFromModule};
|
|
2
2
|
//# sourceMappingURL=root.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{MAX_WORKFLOW_POLICIES as o,MAX_WORKFLOW_POLICY_TERMS as i}from"./workflow-policy.js";const e={type:"string",minLength:1,maxLength:128,pattern:"\\S"},t={type:"array",minItems:1,maxItems:i,items:e},s={...t,items:{...e,pattern:"^(?!(?:.*\\.)?(?:__proto__|constructor|prototype)(?:\\.|$))[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*){0,7}$"}},a={type:"object",additionalProperties:!1,required:["id","rule"],properties:{id:{type:"string",minLength:1,maxLength:128,pattern:"^[a-zA-Z0-9][a-zA-Z0-9._-]*$"},description:{type:"string",minLength:1,maxLength:500,pattern:"\\S"},effect:{enum:["advise","warn","refuse"]},subject:{type:"object",additionalProperties:!1,properties:{...Object.fromEntries(["types","tags","statuses","operations","parents"].map(r=>[r,t])),dependency:{type:"object",additionalProperties:!1,required:["kind"],properties:{kind:e,id:e}}}},rule:{oneOf:[{type:"object",additionalProperties:!1,required:["kind","fields"],properties:{kind:{const:"require_fields"},fields:s}},{type:"object",additionalProperties:!1,required:["kind","authors"],properties:{kind:{const:"authors"},authors:t}},...["field_writers","approval"].map(r=>({type:"object",additionalProperties:!1,required:["kind","fields","authors"],properties:{kind:{const:r},fields:s,authors:t}})),{type:"object",additionalProperties:!1,required:["kind","allowed"],properties:{kind:{const:"transition"},allowed:{type:"array",maxItems:i,items:{type:"array",minItems:2,maxItems:2,items:e}}}}]}}},p={$schema:"https://json-schema.org/draft/2020-12/schema",title:"pm workflow policy registry",type:"object",additionalProperties:!1,required:["version","policies"],properties:{version:{const:1},enforcement:{enum:["advise","refuse"],default:"advise"},policies:{type:"array",maxItems:o,items:a}}};export{p as WORKFLOW_POLICY_DOCUMENT_SCHEMA,a as WORKFLOW_POLICY_SCHEMA};
|
|
2
2
|
//# sourceMappingURL=workflow-policy-schema.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import u from"node:fs/promises";import d from"node:path";import{renderPmCommand as k}from"../shared/command-line.js";import{canonicalizeCommandOptionKey as v,commandOptionFlagLabel as b}from"../item/type-registry.js";import{isUtf8 as S}from"node:buffer";import{isFileMissingError as y}from"../fs/fs-utils.js";import{appendWorkspaceAuditEvent as O}from"../history/workspace-history.js";import{verifyHistoryChain as C}from"../history/replay.js";import{PmCliError as p}from"../shared/errors.js";import{EXIT_CODE as f}from"../shared/constants.js";import{getHistoryPath as W}from"../store/paths.js";import{ownedTransactionCompensation as R}from"../store/item-mutation-precondition.js";import{evaluateWorkflowPolicies as x,parseWorkflowPolicyDocument as $,workflowPolicyApplies as P}from"./workflow-policy.js";const T=1048576,F=4194304;async function h(e,l){let r=d.dirname(e);for(;r!==d.parse(e).root;){const o=await u.stat(r).catch(a=>{if(y(a))return null;throw a});if(o!==null){if(!o.isDirectory())throw new p("Workflow policy storage ancestor must be a directory.",f.CONFLICT,{code:"workflow_policy_input_unreadable",nextSteps:["Restore the policy or approval history directory before retrying."]});break}r=d.dirname(r)}const i=await u.open(e,"r").catch(o=>{if(y(o))return null;throw o});if(i===null)return null;try{const o=(await i.stat()).size,a=Buffer.alloc(Math.min(l,o)+1);let n=0;for(;n<a.length;){const s=await i.read(a,n,a.length-n,n);if(s.bytesRead===0)break;n+=s.bytesRead}if(n===a.length||!S(a.subarray(0,n)))throw new p("Workflow policy input exceeds its byte bound or is not valid UTF-8.",f.CONFLICT,{code:"workflow_policy_input_unreadable",nextSteps:["Inspect the policy and approval history; reduce the declaration or use verified history compaction before retrying."]});return a.toString("utf8",0,n)}finally{await i.close()}}function I(e){if(e===null)return{version:1,enforcement:"advise",policies:[]};let l;try{l=JSON.parse(e)}catch{throw new p("schema/policies.json must contain valid JSON.",f.CONFLICT,{code:"workflow_policy_registry_invalid",nextSteps:["Restore valid policy JSON before retrying the mutation."]})}return $(l)}async function j(e){return I(await h(d.join(e,"schema","policies.json"),T))}async function L(e,l){const r=await h(W(e,l),F);if(r===null)return[];let i;try{if(i=r.split(/\r?\n/).filter(o=>o.trim()).map(o=>JSON.parse(o)),!C(i).ok)throw new Error("invalid chain")}catch{throw new p("Approval evidence requires a valid item history chain.",f.CONFLICT,{code:"workflow_policy_approval_history_invalid",nextSteps:[`Run pm history ${l} --verify before recording or using an approval.`]})}return i.flatMap(o=>{const a=o.context?.workflow_approval;if(o.op!=="policy_approve"||o.record_hash_version!==1||typeof o.record_hash!="string"||typeof a!="object"||a===null)return[];const n=a;return typeof n.policy_fingerprint!="string"||typeof n.content_fingerprint!="string"?[]:[{policy_fingerprint:n.policy_fingerprint,content_fingerprint:n.content_fingerprint,author:o.author}]})}async function N(e,l,r){const i=r.before?.status!==r.after?.status&&l.policies.some(n=>n.rule.kind==="approval"&&P(n,r)),o=r.before?.id??r.after?.id,a=i&&typeof o=="string"?await L(e,o):[];return x(l,{...r,approvals:a})}function A(e,l){if(e.dryRun===!0)return!1;const r=R(e.pmRoot,[e.before?.metadata.id,e.after?.metadata.id],e.operation);return r===void 0?!1:(r.overrides.push(...l.map(i=>({source:"workflow_policy",policy_id:i.policy_id,rule:i.rule}))),!0)}async function Q(e){const l=await j(e.pmRoot),r=await N(e.pmRoot,l,{operation:e.operation,author:e.author,before:e.before?{...e.before.metadata,body:e.before.body}:null,after:e.after?{...e.after.metadata,body:e.after.body}:null});if(r.allowed)return r;const i=r.decisions.filter(o=>!o.satisfied&&o.effect==="refuse");return A(e,i)?r:E(e,l,r,i)}async function E(e,l,r,i){const o=[];let a="";if(!e.dryRun)try{const t=await O({pmRoot:e.pmRoot,op:"policy_refused",author:e.author,context:{item_id:e.after?.metadata.id??e.before?.metadata.id,operation:e.operation,workflow_policies:r.decisions},message:"Workflow policy refused a proposed item mutation.",lockTtlSeconds:e.settings.locks.ttl_seconds,lockWaitMs:e.settings.locks.wait_ms});o.push({path:"history/_workspace.jsonl",op:"policy_refused",record_hash:t.entry.record_hash}),a=" Audit appended to tracker-relative history/_workspace.jsonl; retain it with the workspace changes. Each refused attempt records its own audit event."}catch(t){const c=new p("Workflow policy refusal could not be recorded in workspace history.",f.CONFLICT,{code:"workflow_policy_audit_failed",nextSteps:["Resolve workspace-history lock or storage failures, then retry the refused mutation; no item changes were written."]});throw c.cause=t,c}const n=i.slice(0,3).map(t=>({policy_id:t.policy_id,rule:t.rule,description:l.policies.find(c=>c.id===t.policy_id).description,missing_fields:t.missing_fields})),s=[...new Set(n.flatMap(t=>t.missing_fields))],w=n.map(t=>`${t.policy_id} (${t.rule})`).join(", "),m=i.length>3?` and ${i.length-3} more`:"",_=e.after?.metadata.id??e.before.metadata.id,g=s.map(t=>{if(e.before===null)return`Supply ${t} in the original ${e.operation} request, then retry; the item was not created.`;const c=v("update",t);return c===void 0?`Supply ${t} using its declared SDK or package mutation contract, then retry.`:k(["update",_,b("update",c),`<${t}>`,"--pm-path",d.resolve(e.pmRoot)])});throw new p(`Workflow policy refused ${e.operation}: ${w}${m}.${s.length?` Missing: ${s.join(", ")}.`:""}${a}`,f.CONFLICT,{code:"workflow_policy_refused",side_effects:o,reason:n.map(t=>t.policy_id).join(","),policy_violations:n,policy_violation_count:i.length,required:s.length?`Supply missing fields: ${s.join(", ")}, then retry the refused mutation.`:"Satisfy the declared workflow policy before retrying.",why:n.map(t=>t.description).filter(Boolean).join(" ")||void 0,recovery:{missing_required_fields:s},nextSteps:[...g,...new Set(i.slice(0,3).filter(t=>t.missing_fields.length===0).map(t=>t.remediation)),...i.length>3?[`Inspect all policies with pm schema policies before retrying ${e.operation}.`]:[]]})}export{F as MAX_WORKFLOW_APPROVAL_HISTORY_BYTES,T as MAX_WORKFLOW_POLICY_BYTES,I as decodeWorkflowPolicyDocument,Q as enforceWorkflowMutation,N as evaluateWorkspacePolicies,L as readWorkflowApprovals,j as readWorkflowPolicies};
|
|
2
2
|
//# sourceMappingURL=workflow-policy-store.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f675993f-c483-5751-baed-d968b4fd24c0")}catch{}})();import{createHash}from"node:crypto";import{stableStringify,stableValueEquals}from"../shared/serialization.js";import{PmCliError}from"../shared/errors.js";import{EXIT_CODE}from"../shared/constants.js";const WORKFLOW_POLICY_ACTIONS=["policies","policy-put","policy-remove","policy-mode","policy-check","policy-approve","policy-presets"],MAX_WORKFLOW_POLICIES=256,MAX_WORKFLOW_POLICY_TERMS=64;function invalidPolicy(detail){throw new PmCliError(`Invalid workflow policy: ${detail}`,EXIT_CODE.USAGE,{code:"workflow_policy_invalid",nextSteps:["Inspect pm schema policies and correct the declaration using pm schema policy-put."]})}function policyObject(value,keys,label){if(typeof value!="object"||value===null||Array.isArray(value))return invalidPolicy(`${label} must be an object`);const record=value;return Object.keys(record).some(key=>!keys.includes(key))?invalidPolicy(`${label} contains an unknown key`):record}function policyText(value,label,max=128){return typeof value!="string"||!value.trim()||value.length>max?invalidPolicy(`${label} must be nonempty text of at most ${max} characters`):value.trim()}function policyTerms(value,label){if(!Array.isArray(value)||value.length===0||value.length>MAX_WORKFLOW_POLICY_TERMS)return invalidPolicy(`${label} requires 1-${MAX_WORKFLOW_POLICY_TERMS} terms`);const terms=value.map(entry=>policyText(entry,label));return label==="fields"&&terms.some(term=>!/^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*){0,7}$/.test(term)||term.split(".").some(part=>["__proto__","constructor","prototype"].includes(part)))?invalidPolicy("fields must be safe metadata paths of at most eight segments"):[...new Set(terms)]}function parsePolicyRule(value){const common=policyObject(value,["kind","fields","authors","allowed"],"rule");return common.kind==="transition"?(policyObject(common,["kind","allowed"],"transition rule"),!Array.isArray(common.allowed)||common.allowed.length>MAX_WORKFLOW_POLICY_TERMS?invalidPolicy("transition.allowed must be a bounded array"):{kind:"transition",allowed:common.allowed.map(pair=>!Array.isArray(pair)||pair.length!==2?invalidPolicy("transition pairs need two statuses"):[policyText(pair[0],"from"),policyText(pair[1],"to")])}):common.kind==="authors"?(policyObject(common,["kind","authors"],"authors rule"),{kind:"authors",authors:policyTerms(common.authors,"authors")}):common.kind==="require_fields"?(policyObject(common,["kind","fields"],"require_fields rule"),{kind:"require_fields",fields:policyTerms(common.fields,"fields")}):common.kind==="field_writers"||common.kind==="approval"?(policyObject(common,["kind","fields","authors"],"field rule"),{kind:common.kind,fields:policyTerms(common.fields,"fields"),authors:policyTerms(common.authors,"authors")}):invalidPolicy("unknown rule kind")}function parsePolicySubject(value){const subject={},source=policyObject(value,["types","tags","statuses","operations","parents","dependency"],"subject");for(const key of["types","tags","statuses","operations","parents"])source[key]!==void 0&&(subject[key]=policyTerms(source[key],key));if(source.dependency!==void 0){const edge=policyObject(source.dependency,["kind","id"],"dependency");subject.dependency={kind:policyText(edge.kind,"dependency kind"),...edge.id===void 0?{}:{id:policyText(edge.id,"dependency id")}}}return subject}function parseWorkflowPolicy(value){const raw=policyObject(value,["id","description","subject","effect","rule"],"policy"),id=policyText(raw.id,"id");return/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(id)?raw.effect!==void 0&&(typeof raw.effect!="string"||!["advise","warn","refuse"].includes(raw.effect))?invalidPolicy("effect must be advise, warn, or refuse"):{id,rule:parsePolicyRule(raw.rule),...raw.subject===void 0?{}:{subject:parsePolicySubject(raw.subject)},...raw.description===void 0?{}:{description:policyText(raw.description,"description",500)},...raw.effect===void 0?{}:{effect:raw.effect}}:invalidPolicy("id must be a stable token")}function parseWorkflowPolicyDocument(value){const raw=policyObject(value,["version","enforcement","policies"],"document");if(raw.version!==1)return invalidPolicy("unsupported version");if(raw.enforcement!==void 0&&raw.enforcement!=="advise"&&raw.enforcement!=="refuse")return invalidPolicy("enforcement must be advise or refuse");if(!Array.isArray(raw.policies)||raw.policies.length>MAX_WORKFLOW_POLICIES)return invalidPolicy(`policies must contain at most ${MAX_WORKFLOW_POLICIES} declarations`);const policies=raw.policies.map(parseWorkflowPolicy);return new Set(policies.map(policy=>policy.id)).size!==policies.length?invalidPolicy("duplicate policy id"):{version:1,enforcement:raw.enforcement??"advise",policies}}function readWorkflowPolicyField(record,field){let value=record;for(const key of field.split(".")){if(typeof value!="object"||value===null||!Object.hasOwn(value,key))return;value=value[key]}return value}function hasPolicyValue(value){return value==null?!1:typeof value=="string"?value.trim().length>0:typeof value=="number"?Number.isFinite(value):Array.isArray(value)?value.length>0:typeof value=="object"?Object.keys(value).length>0:!0}function workflowPolicyFingerprint(policy){return createHash("sha256").update(stableStringify(policy)).digest("hex")}function workflowApprovalFingerprint(policy,record){const fields=policy.rule.kind==="approval"?policy.rule.fields:[];return createHash("sha256").update(stableStringify({id:record.id,fields:fields.map(field=>[field,readWorkflowPolicyField(record,field)])})).digest("hex")}function matchesPolicyDependency(expected,dependencies){return Array.isArray(dependencies)&&dependencies.some(edge=>typeof edge=="object"&&edge!==null&&"kind"in edge&&edge.kind===expected.kind&&(expected.id===void 0||"id"in edge&&edge.id===expected.id))}function matchesPolicySubject(subject,record,operation){return!(subject.types&&!subject.types.some(type=>type.toLowerCase()===String(record.type).toLowerCase())||subject.statuses&&!subject.statuses.includes(String(record.status))||subject.operations&&!subject.operations.includes(operation)||subject.parents&&!subject.parents.includes(String(record.parent))||subject.tags&&(!Array.isArray(record.tags)||!subject.tags.some(tag=>record.tags.includes(tag)))||subject.dependency&&!matchesPolicyDependency(subject.dependency,record.dependencies))}function workflowPolicyApplies(policy,input){if(input.completeness_only&&(policy.rule.kind!=="require_fields"||policy.subject?.operations!==void 0)||policy.rule.kind==="approval"&&input.before===null)return!1;const subject=policy.subject??{},status=input.after?.status??input.before?.status;return[input.before,input.after].some(record=>record!==null&&matchesPolicySubject(subject,{...record,status},input.operation))}function missingRequiredPolicyFields(fields,input,changedStatus,fieldsChanged){const scopeChanged=["type","tags","parent","dependencies"].some(field=>!stableValueEquals(input.before?.[field],input.after?.[field]));return input.after&&(input.completeness_only||changedStatus||fieldsChanged||scopeChanged)?fields.filter(field=>!hasPolicyValue(readWorkflowPolicyField(input.after,field))):[]}function hasMatchingWorkflowApproval(policy,input,authors,policyFingerprint){const record=input.after??input.before,contentFingerprint=workflowApprovalFingerprint(policy,record);return input.approvals?.some(approval=>approval.policy_fingerprint===policyFingerprint&&approval.content_fingerprint===contentFingerprint&&approval.author!==input.author&&authors.includes(approval.author))??!1}function evaluatePolicyRule(policy,input,policyFingerprint){const rule=policy.rule,changedStatus=input.before?.status!==input.after?.status,fieldsChanged="fields"in rule&&rule.fields.some(field=>!stableValueEquals(readWorkflowPolicyField(input.before,field),readWorkflowPolicyField(input.after,field)));switch(rule.kind){case"require_fields":{const missing=missingRequiredPolicyFields(rule.fields,input,changedStatus,fieldsChanged);return{satisfied:missing.length===0,missing_fields:missing,remediation:"Supply the declared required fields before this lifecycle transition."}}case"transition":return{satisfied:!changedStatus||rule.allowed.some(([from,to])=>from===String(input.before?.status??"$create")&&to===String(input.after?.status??"$delete")),missing_fields:[],remediation:"Choose a declared allowed transition; inspect pm schema policies."};case"authors":return{satisfied:rule.authors.includes(input.author),missing_fields:[],remediation:"Have a declared workflow actor perform this operation."};case"field_writers":return{satisfied:!fieldsChanged||rule.authors.includes(input.author),missing_fields:[],remediation:"Have a declared field writer change the protected fields."};case"approval":return{satisfied:!changedStatus||hasMatchingWorkflowApproval(policy,input,rule.authors,policyFingerprint),missing_fields:[],remediation:`Record an independent approval with pm schema policy-approve <item-id> --policy ${policy.id} after preparing the reviewed fields.`}}}function evaluateWorkflowPolicySnapshot(document,input,fingerprint){const decisions=document.policies.filter(policy=>workflowPolicyApplies(policy,input)).map(policy=>{const requested=policy.effect??"advise",policyFingerprint=fingerprint(policy);return{policy_id:policy.id,policy_fingerprint:policyFingerprint,rule:policy.rule.kind,effect:requested==="refuse"&&document.enforcement!=="refuse"?"warn":requested,...evaluatePolicyRule(policy,input,policyFingerprint)}});return{allowed:!decisions.some(decision=>!decision.satisfied&&decision.effect==="refuse"),decisions,warnings:decisions.filter(decision=>!decision.satisfied).map(decision=>`workflow_policy:${decision.effect}:${decision.policy_id}:${decision.rule}`)}}function evaluateWorkflowPolicies(document,input){return evaluateWorkflowPolicySnapshot(document,input,workflowPolicyFingerprint)}function createWorkflowPolicyEvaluator(document){const snapshot=parseWorkflowPolicyDocument(document),fingerprints=new Map(snapshot.policies.map(policy=>[policy,workflowPolicyFingerprint(policy)]));return input=>evaluateWorkflowPolicySnapshot(snapshot,input,policy=>fingerprints.get(policy))}export{MAX_WORKFLOW_POLICIES,MAX_WORKFLOW_POLICY_TERMS,WORKFLOW_POLICY_ACTIONS,createWorkflowPolicyEvaluator,evaluateWorkflowPolicies,parseWorkflowPolicy,parseWorkflowPolicyDocument,readWorkflowPolicyField,workflowApprovalFingerprint,workflowPolicyApplies,workflowPolicyFingerprint};
|
|
1
|
+
import{createHash as p}from"node:crypto";import{stableStringify as m,stableValueEquals as y}from"../shared/serialization.js";import{PmCliError as _}from"../shared/errors.js";import{EXIT_CODE as A}from"../shared/constants.js";const z=["policies","policy-put","policy-remove","policy-mode","policy-check","policy-approve","policy-presets"],h=256,u=64;function o(r){throw new _(`Invalid workflow policy: ${r}`,A.USAGE,{code:"workflow_policy_invalid",nextSteps:["Inspect pm schema policies and correct the declaration using pm schema policy-put."]})}function a(r,e,t){if(typeof r!="object"||r===null||Array.isArray(r))return o(`${t} must be an object`);const n=r;return Object.keys(n).some(i=>!e.includes(i))?o(`${t} contains an unknown key`):n}function d(r,e,t=128){return typeof r!="string"||!r.trim()||r.length>t?o(`${e} must be nonempty text of at most ${t} characters`):r.trim()}function c(r,e){if(!Array.isArray(r)||r.length===0||r.length>u)return o(`${e} requires 1-${u} terms`);const t=r.map(n=>d(n,e));return e==="fields"&&t.some(n=>!/^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*){0,7}$/.test(n)||n.split(".").some(i=>["__proto__","constructor","prototype"].includes(i)))?o("fields must be safe metadata paths of at most eight segments"):[...new Set(t)]}function b(r){const e=a(r,["kind","fields","authors","allowed"],"rule");return e.kind==="transition"?(a(e,["kind","allowed"],"transition rule"),!Array.isArray(e.allowed)||e.allowed.length>u?o("transition.allowed must be a bounded array"):{kind:"transition",allowed:e.allowed.map(t=>!Array.isArray(t)||t.length!==2?o("transition pairs need two statuses"):[d(t[0],"from"),d(t[1],"to")])}):e.kind==="authors"?(a(e,["kind","authors"],"authors rule"),{kind:"authors",authors:c(e.authors,"authors")}):e.kind==="require_fields"?(a(e,["kind","fields"],"require_fields rule"),{kind:"require_fields",fields:c(e.fields,"fields")}):e.kind==="field_writers"||e.kind==="approval"?(a(e,["kind","fields","authors"],"field rule"),{kind:e.kind,fields:c(e.fields,"fields"),authors:c(e.authors,"authors")}):o("unknown rule kind")}function P(r){const e={},t=a(r,["types","tags","statuses","operations","parents","dependency"],"subject");for(const n of["types","tags","statuses","operations","parents"])t[n]!==void 0&&(e[n]=c(t[n],n));if(t.dependency!==void 0){const n=a(t.dependency,["kind","id"],"dependency");e.dependency={kind:d(n.kind,"dependency kind"),...n.id===void 0?{}:{id:d(n.id,"dependency id")}}}return e}function S(r){const e=a(r,["id","description","subject","effect","rule"],"policy"),t=d(e.id,"id");return/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(t)?e.effect!==void 0&&(typeof e.effect!="string"||!["advise","warn","refuse"].includes(e.effect))?o("effect must be advise, warn, or refuse"):{id:t,rule:b(e.rule),...e.subject===void 0?{}:{subject:P(e.subject)},...e.description===void 0?{}:{description:d(e.description,"description",500)},...e.effect===void 0?{}:{effect:e.effect}}:o("id must be a stable token")}function O(r){const e=a(r,["version","enforcement","policies"],"document");if(e.version!==1)return o("unsupported version");if(e.enforcement!==void 0&&e.enforcement!=="advise"&&e.enforcement!=="refuse")return o("enforcement must be advise or refuse");if(!Array.isArray(e.policies)||e.policies.length>h)return o(`policies must contain at most ${h} declarations`);const t=e.policies.map(S);return new Set(t.map(n=>n.id)).size!==t.length?o("duplicate policy id"):{version:1,enforcement:e.enforcement??"advise",policies:t}}function l(r,e){let t=r;for(const n of e.split(".")){if(typeof t!="object"||t===null||!Object.hasOwn(t,n))return;t=t[n]}return t}function $(r){return r==null?!1:typeof r=="string"?r.trim().length>0:typeof r=="number"?Number.isFinite(r):Array.isArray(r)?r.length>0:typeof r=="object"?Object.keys(r).length>0:!0}function w(r){return p("sha256").update(m(r)).digest("hex")}function x(r,e){const t=r.rule.kind==="approval"?r.rule.fields:[];return p("sha256").update(m({id:e.id,fields:t.map(n=>[n,l(e,n)])})).digest("hex")}function W(r,e){return Array.isArray(e)&&e.some(t=>typeof t=="object"&&t!==null&&"kind"in t&&t.kind===r.kind&&(r.id===void 0||"id"in t&&t.id===r.id))}function v(r,e,t){return!(r.types&&!r.types.some(n=>n.toLowerCase()===String(e.type).toLowerCase())||r.statuses&&!r.statuses.includes(String(e.status))||r.operations&&!r.operations.includes(t)||r.parents&&!r.parents.includes(String(e.parent))||r.tags&&(!Array.isArray(e.tags)||!r.tags.some(n=>e.tags.includes(n)))||r.dependency&&!W(r.dependency,e.dependencies))}function C(r,e){if(e.completeness_only&&(r.rule.kind!=="require_fields"||r.subject?.operations!==void 0)||r.rule.kind==="approval"&&e.before===null)return!1;const t=r.subject??{},n=e.after?.status??e.before?.status;return[e.before,e.after].some(i=>i!==null&&v(t,{...i,status:n},e.operation))}function q(r,e,t,n){const i=["type","tags","parent","dependencies"].some(s=>!y(e.before?.[s],e.after?.[s]));return e.after&&(e.completeness_only||t||n||i)?r.filter(s=>!$(l(e.after,s))):[]}function F(r,e,t,n){const i=e.after??e.before,f=x(r,i);return e.approvals?.some(s=>s.policy_fingerprint===n&&s.content_fingerprint===f&&s.author!==e.author&&t.includes(s.author))??!1}function j(r,e,t){const n=r.rule,i=e.before?.status!==e.after?.status,f="fields"in n&&n.fields.some(s=>!y(l(e.before,s),l(e.after,s)));switch(n.kind){case"require_fields":{const s=q(n.fields,e,i,f);return{satisfied:s.length===0,missing_fields:s,remediation:"Supply the declared required fields before this lifecycle transition."}}case"transition":return{satisfied:!i||n.allowed.some(([s,k])=>s===String(e.before?.status??"$create")&&k===String(e.after?.status??"$delete")),missing_fields:[],remediation:"Choose a declared allowed transition; inspect pm schema policies."};case"authors":return{satisfied:n.authors.includes(e.author),missing_fields:[],remediation:"Have a declared workflow actor perform this operation."};case"field_writers":return{satisfied:!f||n.authors.includes(e.author),missing_fields:[],remediation:"Have a declared field writer change the protected fields."};case"approval":return{satisfied:!i||F(r,e,n.authors,t),missing_fields:[],remediation:`Record an independent approval with pm schema policy-approve <item-id> --policy ${r.id} after preparing the reviewed fields.`}}}function g(r,e,t){const n=r.policies.filter(i=>C(i,e)).map(i=>{const f=i.effect??"advise",s=t(i);return{policy_id:i.id,policy_fingerprint:s,rule:i.rule.kind,effect:f==="refuse"&&r.enforcement!=="refuse"?"warn":f,...j(i,e,s)}});return{allowed:!n.some(i=>!i.satisfied&&i.effect==="refuse"),decisions:n,warnings:n.filter(i=>!i.satisfied).map(i=>`workflow_policy:${i.effect}:${i.policy_id}:${i.rule}`)}}function Z(r,e){return g(r,e,w)}function M(r){const e=O(r),t=new Map(e.policies.map(n=>[n,w(n)]));return n=>g(e,n,i=>t.get(i))}export{h as MAX_WORKFLOW_POLICIES,u as MAX_WORKFLOW_POLICY_TERMS,z as WORKFLOW_POLICY_ACTIONS,M as createWorkflowPolicyEvaluator,Z as evaluateWorkflowPolicies,S as parseWorkflowPolicy,O as parseWorkflowPolicyDocument,l as readWorkflowPolicyField,x as workflowApprovalFingerprint,C as workflowPolicyApplies,w as workflowPolicyFingerprint};
|
|
2
2
|
//# sourceMappingURL=workflow-policy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{normalizeAddFieldInput as n}from"../schema/fields-file.js";import{normalizeAddStatusInput as a}from"../schema/status-defs-file.js";import{normalizeAddTypeInput as m}from"../schema/item-types-file.js";function o(t){return{types:t.types.length,statuses:t.statuses.length,fields:t.fields.length,workflows:t.workflows.length,config:t.config.length,templates:t.templates.length,packages:t.packages.length}}function i(t){return{name:t.name,title:t.title,summary:t.summary,composition:o(t),types:t.types.map(e=>s(()=>m(e).name,()=>String(e.name??""))),statuses:t.statuses.map(e=>s(()=>a(e).id,()=>String(e.id??""))),fields:t.fields.map(e=>s(()=>n(e).key,()=>String(e.key??""))),workflows:t.workflows.map(e=>e.type),config:t.config.map(e=>`${e.key}=${e.value}`),templates:t.templates.map(e=>e.name),packages:t.packages.map(e=>({spec:e.spec,reason:e.reason}))}}function s(t,e){try{return t()}catch{return e()}}export{o as describeProfileComposition,i as describeProjectProfile};
|
|
2
2
|
//# sourceMappingURL=profile-describe.js.map
|
|
@@ -6,7 +6,7 @@ export declare const PROFILE_LINT_DIMENSIONS:readonly["profile","types","statuse
|
|
|
6
6
|
/** Restricts profile lint dimension values accepted by command, SDK, and storage contracts. */
|
|
7
7
|
export type ProfileLintDimension=(typeof PROFILE_LINT_DIMENSIONS)[number];
|
|
8
8
|
/** Stable machine-readable codes every {@link ProjectProfileLintFinding} carries. */
|
|
9
|
-
export declare const PROFILE_LINT_CODES:readonly["profile_name_empty","profile_name_not_normalized","profile_title_empty","profile_summary_empty","type_invalid","type_duplicate","status_invalid","status_duplicate","field_invalid","field_duplicate","field_mcp_input_collision","workflow_type_empty","workflow_type_unknown","workflow_duplicate_type","workflow_transition_malformed","workflow_status_unknown","config_key_unknown","config_value_invalid","config_duplicate","template_type_unknown","package_spec_empty"];
|
|
9
|
+
export declare const PROFILE_LINT_CODES:readonly["profile_name_empty","profile_name_not_normalized","profile_title_empty","profile_summary_empty","type_invalid","type_duplicate","status_invalid","status_duplicate","field_invalid","field_duplicate","field_mcp_input_collision","field_option_collision","workflow_type_empty","workflow_type_unknown","workflow_duplicate_type","workflow_transition_malformed","workflow_status_unknown","config_key_unknown","config_value_invalid","config_duplicate","template_type_unknown","package_spec_empty"];
|
|
10
10
|
/** Restricts profile lint code values accepted by command, SDK, and storage contracts. */
|
|
11
11
|
export type ProfileLintCode=(typeof PROFILE_LINT_CODES)[number];
|
|
12
12
|
/** A single graded consistency finding produced by {@link lintProjectProfile}. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{BUILTIN_ITEM_TYPE_VALUES as _}from"../../types/index.js";import{parseNestedSettingValue as g,resolveNestedSettingDescriptor as k}from"../config/nested-settings.js";import{normalizeAddFieldInput as v}from"../schema/fields-file.js";import{normalizeAddStatusInput as S}from"../schema/status-defs-file.js";import{normalizeAddTypeInput as $}from"../schema/item-types-file.js";import{normalizeStatusToken as d}from"../schema/type-workflows.js";import{DEFAULT_RUNTIME_STATUS_DEFINITIONS as T}from"../schema/runtime-schema.js";import{toErrorMessage as m}from"../shared/primitives.js";import{resolvePmToolCustomFieldCollision as I}from"../../sdk/cli-contracts/tool-schema.js";import{describeFieldOptionCollision as b,resolveAddFieldOptionCollisions as C}from"../../sdk/schema/field-option-collisions.js";import{normalizeProfileLookupKey as w}from"./profile-presets.js";const G=["profile","types","statuses","fields","workflows","config","templates","packages"],H=["profile_name_empty","profile_name_not_normalized","profile_title_empty","profile_summary_empty","type_invalid","type_duplicate","status_invalid","status_duplicate","field_invalid","field_duplicate","field_mcp_input_collision","field_option_collision","workflow_type_empty","workflow_type_unknown","workflow_duplicate_type","workflow_transition_malformed","workflow_status_unknown","config_key_unknown","config_value_invalid","config_duplicate","template_type_unknown","package_spec_empty"],P=new Set(T.flatMap(e=>[d(e.id),...(e.aliases??[]).map(t=>d(t))]).filter(e=>e.length>0)),h=new Set(_.map(e=>e.toLowerCase()));function E(e,t){e.name.trim().length===0?t.push({severity:"error",code:"profile_name_empty",dimension:"profile",message:"Profile name must not be empty; profile resolution requires a non-blank name."}):e.name!==w(e.name)&&t.push({severity:"warning",code:"profile_name_not_normalized",dimension:"profile",target:e.name,message:`Profile name "${e.name}" is not in canonical form; resolution folds it to "${w(e.name)}" (lowercase, hyphens as underscores).`}),e.title.trim().length===0&&t.push({severity:"warning",code:"profile_title_empty",dimension:"profile",message:"Profile title is empty; list and show surfaces will render a blank title."}),e.summary.trim().length===0&&t.push({severity:"warning",code:"profile_summary_empty",dimension:"profile",message:"Profile summary is empty; list and show surfaces will render a blank archetype description."})}function L(e,t){const r=new Set,s=new Set;for(const[i,o]of e.types.entries()){let n;try{n=$(o).name}catch(l){t.push({severity:"error",code:"type_invalid",dimension:"types",target:typeof o.name=="string"?o.name:`#${i}`,message:m(l)});continue}const a=n.toLowerCase();if(s.has(a)){t.push({severity:"error",code:"type_duplicate",dimension:"types",target:n,message:`Item type "${n}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}s.add(a),r.add(a)}return r}function N(e,t){const r=new Set,s=new Set;for(const[i,o]of e.statuses.entries()){let n;try{n=S(o)}catch(a){t.push({severity:"error",code:"status_invalid",dimension:"statuses",target:typeof o.id=="string"?o.id:`#${i}`,message:m(a)});continue}if(s.has(n.id)){t.push({severity:"error",code:"status_duplicate",dimension:"statuses",target:n.id,message:`Status "${n.id}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}s.add(n.id),r.add(n.id);for(const a of n.aliases??[])r.add(d(a))}return r}function F(e,t){const r=new Set;for(const[s,i]of e.fields.entries()){let o,n;try{n=v(i),o=n.key}catch(p){t.push({severity:"error",code:"field_invalid",dimension:"fields",target:typeof i.key=="string"?i.key:`#${s}`,message:m(p)});continue}if(r.has(o)){t.push({severity:"error",code:"field_duplicate",dimension:"fields",target:o,message:`Field "${o}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}r.add(o);const a=C(n);a.length>0&&t.push({severity:"error",code:"field_option_collision",dimension:"fields",target:o,message:`Field "${o}" would disable a built-in option: ${a.map(b).join("; ")}. Rename the field or narrow its commands.`});const l=I(o);l&&t.push({severity:"warning",code:"field_mcp_input_collision",dimension:"fields",target:o,message:`Field "${o}" collides with canonical MCP property "${l.property}" owned by ${l.owner}; callers must pass the custom value through ${l.nested_path}.`})}}function z(e,t,r,s){const i=new Set;for(const[o,n]of e.workflows.entries()){const a=n.type.trim().toLowerCase();if(a.length===0){s.push({severity:"error",code:"workflow_type_empty",dimension:"workflows",target:`#${o}`,message:"Workflow has an empty type; the workflow resolver drops entries without a type."});continue}const l=i.has(a);i.add(a),l?s.push({severity:"warning",code:"workflow_duplicate_type",dimension:"workflows",target:n.type,message:`Workflow type "${n.type}" is declared more than once; the later transition set wins.`}):!h.has(a)&&!t.has(a)&&s.push({severity:"warning",code:"workflow_type_unknown",dimension:"workflows",target:n.type,message:`Workflow governs type "${n.type}" which is neither a built-in type nor declared by this profile; it has no effect unless that type already exists.`});const p=new Set;for(const f of n.allowed_transitions){const u=d(f[0]),y=d(f[1]);if(u.length===0||y.length===0){s.push({severity:"error",code:"workflow_transition_malformed",dimension:"workflows",target:n.type,message:`Workflow "${n.type}" has a transition with an empty status; the workflow resolver silently drops it.`});continue}for(const c of[u,y])P.has(c)||r.has(c)||p.has(c)||(p.add(c),s.push({severity:"warning",code:"workflow_status_unknown",dimension:"workflows",target:c,message:`Workflow "${n.type}" references status "${c}" which is neither a built-in status nor declared by this profile; transitions to or from it are unreachable.`}))}}}function x(e,t){const r=new Set;for(const s of e.config){const i=k(s.key);if(i===void 0){t.push({severity:"error",code:"config_key_unknown",dimension:"config",target:s.key,message:`Config knob "${s.key}" is not a recognized setting; apply rejects it with a usage error.`});continue}r.has(i.key)?t.push({severity:"error",code:"config_duplicate",dimension:"config",target:i.key,message:`Config knob "${i.key}" is set more than once; the later value silently overwrites the earlier one.`}):r.add(i.key);const o=g(i,s.value);o.ok||t.push({severity:"error",code:"config_value_invalid",dimension:"config",target:s.key,message:o.error.message})}}function O(e,t,r){for(const s of e.templates){const i=s.options.type;if(typeof i!="string"||i.trim().length===0)continue;const o=i.trim().toLowerCase();!h.has(o)&&!t.has(o)&&r.push({severity:"warning",code:"template_type_unknown",dimension:"templates",target:s.name,message:`Template "${s.name}" creates type "${i}" which is neither a built-in type nor declared by this profile.`})}}function U(e,t){for(const[r,s]of e.packages.entries())s.spec.trim().length===0&&t.push({severity:"warning",code:"package_spec_empty",dimension:"packages",target:`#${r}`,message:"Package recommendation has an empty spec; it cannot be surfaced as an install hint."})}function J(e){const t=[];E(e,t);const r=L(e,t),s=N(e,t);F(e,t),z(e,r,s,t),x(e,t),O(e,r,t),U(e,t);const i=t.filter(n=>n.severity==="error").length,o=t.length-i;return{profile:e.name,ok:i===0,findings:t,errorCount:i,warningCount:o}}export{H as PROFILE_LINT_CODES,G as PROFILE_LINT_DIMENSIONS,J as lintProjectProfile};
|
|
2
2
|
//# sourceMappingURL=profile-lint.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{normalizeAddTypeInput as f,parseItemTypesFile as w,serializeItemTypesFile as k,upsertItemType as F}from"../schema/item-types-file.js";import{normalizeAddStatusInput as m,parseStatusDefsFile as S,serializeStatusDefsFile as I,upsertStatusDef as T}from"../schema/status-defs-file.js";import{normalizeAddFieldInput as g,parseFieldsFile as v,serializeFieldsFile as z,upsertField as N}from"../schema/fields-file.js";import{parseNestedSettingValue as $,readNestedSettingValue as x,resolveNestedSettingDescriptor as A}from"../config/nested-settings.js";function l(s,o,a,e,t){let n=s;const i=[];for(const r of o){const u=e(n),d=t(n,r),c=e(d.file);n=d.file;const p=u===c?"unchanged":d.replaced?"update":"add";i.push({key:a(r),status:p})}return{file:n,changes:i,changed:i.some(r=>r.status!=="unchanged")}}function h(s){return JSON.stringify(s.map(o=>o.join("\0")).sort())}function D(s,o){const a=s.map(t=>({...t})),e=[];for(const t of o){const n=a.findIndex(r=>r.type===t.type),i={type:t.type,allowed_transitions:t.allowed_transitions};n<0?(a.push(i),e.push({type:t.type,status:"add"})):h(a[n].allowed_transitions)===h(t.allowed_transitions)?e.push({type:t.type,status:"unchanged"}):(a[n]=i,e.push({type:t.type,status:"update"}))}return{changes:e,result:a,changed:e.some(t=>t.status!=="unchanged")}}function O(s,o){const a=[];for(const e of s.config){const t=A(e.key);if(t===void 0)throw new Error(`Profile "${s.name}" references unknown config key "${e.key}".`);const n=$(t,e.value);if(!n.ok)throw new Error(`Profile "${s.name}" config ${e.key}: ${n.error.message}`);const i=x(o,t),r=i===null?"add":i===n.parsed.value?"unchanged":"update";a.push({key:t.key,path:t.path,value:n.parsed.value,status:r})}return{changes:a,changed:a.some(e=>e.status!=="unchanged")}}function y(s){const o=Object.entries(s).sort(([a],[e])=>a.localeCompare(e));return JSON.stringify(o)}function P(s,o){const a=[];for(const e of s.templates){const t=o.get(e.name);let n;t===void 0?n="add":y(t)===y(e.options)?n="unchanged":n="update",a.push({name:e.name,options:e.options,status:n})}return{changes:a,changed:a.some(e=>e.status!=="unchanged")}}function j(s,o){const a=l(w(o.typesRaw),s.types,c=>f(c).name,k,(c,p)=>F(c,f(p))),e=l(S(o.statusesRaw),s.statuses,c=>m(c).id,I,(c,p)=>T(c,m(p))),t=l(v(o.fieldsRaw),s.fields,c=>g(c).key,z,(c,p)=>N(c,g(p))),n=D(o.workflows,s.workflows),i=O(s,o.settings),r=P(s,o.templates),u=s.packages.map(c=>({spec:c.spec,reason:c.reason,status:o.installedPackages.has(c.spec)?"installed":"recommended"})),d=a.changed||e.changed||t.changed||n.changed||i.changed||r.changed;return{profile:{name:s.name,title:s.title,summary:s.summary},types:a,statuses:e,fields:t,workflows:n,config:i,templates:r,packages:u,changed:d}}export{j as planProfileApplication};
|
|
2
2
|
//# sourceMappingURL=profile-plan.js.map
|