@unbrained/pm-cli 2026.11.22 → 2026.11.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/cli/after-command-context-usage.js +1 -1
- package/dist/cli/argv-utils.js +1 -1
- package/dist/cli/bootstrap-args.js +1 -1
- package/dist/cli/bundle-integrity.js +2 -2
- package/dist/cli/command-namespaces.js +1 -1
- package/dist/cli/commander-usage.js +11 -11
- package/dist/cli/commands/annotations/comments.js +1 -1
- package/dist/cli/commands/annotations/docs.js +1 -1
- package/dist/cli/commands/annotations/files.js +1 -1
- package/dist/cli/commands/annotations/learnings.js +1 -1
- package/dist/cli/commands/annotations/notes.js +1 -1
- package/dist/cli/commands/extension/describe.js +1 -1
- package/dist/cli/commands/extension/extension.js +1 -1
- package/dist/cli/commands/extension/scaffold.js +1 -1
- package/dist/cli/commands/extension/shared.js +1 -1
- package/dist/cli/commands/governance/gc.js +1 -1
- package/dist/cli/commands/governance/health.js +1 -1
- package/dist/cli/commands/governance/telemetry.js +1 -1
- package/dist/cli/commands/governance/validate.js +1 -1
- package/dist/cli/commands/history/activity.js +1 -1
- package/dist/cli/commands/history/history-compact.js +1 -1
- package/dist/cli/commands/history/history-redact.js +1 -1
- package/dist/cli/commands/history/history-repair.js +1 -1
- package/dist/cli/commands/history/history.js +1 -1
- package/dist/cli/commands/history/restore.js +1 -1
- package/dist/cli/commands/lifecycle/append.js +1 -1
- package/dist/cli/commands/lifecycle/claim.js +1 -1
- package/dist/cli/commands/lifecycle/close-many.js +1 -1
- package/dist/cli/commands/lifecycle/close.js +1 -1
- package/dist/cli/commands/lifecycle/copy.js +1 -1
- package/dist/cli/commands/lifecycle/create.js +1 -1
- package/dist/cli/commands/lifecycle/delete.js +1 -1
- package/dist/cli/commands/lifecycle/focus.js +1 -1
- package/dist/cli/commands/lifecycle/plan.js +1 -1
- package/dist/cli/commands/lifecycle/update-many.js +1 -1
- package/dist/cli/commands/lifecycle/update.js +1 -1
- package/dist/cli/commands/query/aggregate.js +1 -1
- package/dist/cli/commands/query/context.js +1 -1
- package/dist/cli/commands/query/deps.js +1 -1
- package/dist/cli/commands/query/duplicates.js +1 -1
- package/dist/cli/commands/query/eval.js +1 -1
- package/dist/cli/commands/query/get.js +1 -1
- package/dist/cli/commands/query/graph.js +1 -1
- package/dist/cli/commands/query/list.js +1 -1
- package/dist/cli/commands/query/next.js +1 -1
- package/dist/cli/commands/query/search.js +1 -1
- package/dist/cli/commands/query/stats.js +1 -1
- package/dist/cli/commands/test/test-all.js +1 -1
- package/dist/cli/commands/test/test-runs.js +1 -1
- package/dist/cli/commands/test/test.js +1 -1
- package/dist/cli/commands/workspace/config.js +1 -1
- package/dist/cli/commands/workspace/contracts.js +1 -1
- package/dist/cli/commands/workspace/init.js +1 -1
- package/dist/cli/commands/workspace/merge.js +1 -1
- package/dist/cli/commands/workspace/profile.js +1 -1
- package/dist/cli/commands/workspace/schema.js +1 -1
- package/dist/cli/commands/workspace/upgrade.js +1 -1
- package/dist/cli/context-intent-invocation.js +1 -1
- package/dist/cli/description-stdin.js +1 -1
- package/dist/cli/error-guidance.js +5 -5
- package/dist/cli/expected-revisions.js +1 -1
- package/dist/cli/extension-command-help.js +6 -6
- package/dist/cli/extension-recovery.js +1 -1
- package/dist/cli/help-content.js +5 -5
- package/dist/cli/help-json-payload.js +7 -7
- package/dist/cli/invocation-profile.js +2 -2
- package/dist/cli/main.js +5 -5
- package/dist/cli/migration-gates.js +1 -1
- package/dist/cli/option-values.js +1 -1
- package/dist/cli/preflight-warnings.js +3 -3
- package/dist/cli/public.js +1 -1
- package/dist/cli/register-annotations.js +1 -1
- package/dist/cli/register-assurance.js +1 -1
- package/dist/cli/register-files-lookup.js +1 -1
- package/dist/cli/register-history-activity.js +1 -1
- package/dist/cli/register-history-author.js +1 -1
- package/dist/cli/register-history-maintenance.js +2 -2
- package/dist/cli/register-list-query.js +10 -10
- package/dist/cli/register-mutation-options.js +0 -1
- package/dist/cli/register-mutation.js +6 -6
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli/register-structured-mutation.js +1 -1
- package/dist/cli/registration-helpers.js +1 -1
- package/dist/cli/runtime/activation.js +1 -1
- package/dist/cli/runtime/annotation-option-retry.js +1 -1
- package/dist/cli/runtime/close-fields-retry.js +1 -1
- package/dist/cli/runtime/field-route-retry.js +1 -1
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli/runtime/invocation-rewrites.js +1 -1
- package/dist/cli/runtime/projection-retry.js +1 -1
- package/dist/cli/runtime/read-output-mutation-retry.js +1 -1
- package/dist/cli/runtime/refusal-credential-redaction.js +1 -1
- package/dist/cli/runtime/selection.js +1 -1
- package/dist/cli/runtime/telemetry-outcome.js +1 -1
- package/dist/cli/runtime-compatibility-boundary.js +4 -4
- package/dist/cli/schema/registration.js +15 -15
- package/dist/cli/schema-registration-helpers.js +1 -1
- package/dist/cli/search-refresh.js +1 -1
- package/dist/cli/stats-analytics-json.js +1 -1
- package/dist/cli/telemetry-flush.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-23K6DQQY.js +9 -0
- package/dist/cli-bundle/chunks/chunk-37UDIJ2K.js +3 -0
- package/dist/cli-bundle/chunks/chunk-5DUP4AZA.js +2 -0
- package/dist/cli-bundle/chunks/chunk-6H36ZHMI.js +2 -0
- package/dist/cli-bundle/chunks/chunk-7IROAPWI.js +3 -0
- package/dist/cli-bundle/chunks/chunk-7VRFEURZ.js +33 -0
- package/dist/cli-bundle/chunks/chunk-7X253M6Z.js +3 -0
- package/dist/cli-bundle/chunks/chunk-AA52P34H.js +3 -0
- package/dist/cli-bundle/chunks/chunk-AWB5KBJS.js +2 -0
- package/dist/cli-bundle/chunks/chunk-D6PDUKUG.js +9 -0
- package/dist/cli-bundle/chunks/chunk-DQDRA3SW.js +2 -0
- package/dist/cli-bundle/chunks/chunk-FXJYZBWV.js +113 -0
- package/dist/cli-bundle/chunks/chunk-HNKK2UG6.js +8 -0
- package/dist/cli-bundle/chunks/chunk-HZZLSBIJ.js +2 -0
- package/dist/cli-bundle/chunks/chunk-I2OJ5B4A.js +2 -0
- package/dist/cli-bundle/chunks/chunk-I3BFCKZR.js +2 -0
- package/dist/cli-bundle/chunks/chunk-MXUSC5RS.js +31 -0
- package/dist/cli-bundle/chunks/chunk-PLIUU37C.js +3 -0
- package/dist/cli-bundle/chunks/chunk-PQUBVRV5.js +2 -0
- package/dist/cli-bundle/chunks/chunk-PW7U7WCE.js +3 -0
- package/dist/cli-bundle/chunks/chunk-PZA7QECY.js +1 -0
- package/dist/cli-bundle/chunks/chunk-SLFRSZK6.js +1 -0
- package/dist/cli-bundle/chunks/chunk-SSALO4DB.js +2 -0
- package/dist/cli-bundle/chunks/chunk-STOOTHZZ.js +2 -0
- package/dist/cli-bundle/chunks/chunk-TKRY22SO.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-B76TFRO2.js → chunk-TVIJ2VCU.js} +93 -93
- package/dist/cli-bundle/chunks/chunk-VJSGUXGU.js +3 -0
- package/dist/cli-bundle/chunks/chunk-WWTPNIC2.js +6 -0
- package/dist/cli-bundle/chunks/chunk-XFADNMGD.js +2 -0
- package/dist/cli-bundle/chunks/chunk-YOPTAIBD.js +125 -0
- package/dist/cli-bundle/chunks/chunk-YW2HBHRO.js +70 -0
- package/dist/cli-bundle/chunks/chunk-YYT3MIRF.js +3 -0
- package/dist/cli-bundle/chunks/chunk-Z7MFVRDV.js +2 -0
- package/dist/cli-bundle/chunks/chunk-ZOX4SWRL.js +8 -0
- package/dist/cli-bundle/chunks/chunk-ZYCOM4MS.js +9 -0
- package/dist/cli-bundle/chunks/context-budget-recovery-M5RFUEFG.js +2 -0
- package/dist/cli-bundle/chunks/field-option-collisions-W66HSWMK.js +2 -0
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-BPYKN5Q7.js +4 -0
- package/dist/cli-bundle/{focused-chunks/item-revision-2O6MLPEX.js → chunks/item-revision-D3LSBNIR.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-M6NTBYH3.js +2 -0
- package/dist/cli-bundle/chunks/mutation-actor-OKL3CQVX.js +2 -0
- package/dist/cli-bundle/chunks/mutation-admission-EKPEOZMF.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-RR5KACJ3.js → register-list-query-3LBV6CS2.js} +11 -11
- package/dist/cli-bundle/chunks/register-mutation-72AGTMNE.js +21 -0
- package/dist/cli-bundle/chunks/register-operations-XERFG2SH.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-W22L34Z4.js +2 -0
- package/dist/cli-bundle/chunks/runtime-schema-JP2KBHBY.js +2 -0
- package/dist/cli-bundle/chunks/settlement-hook-6MR32OOC.js +7 -0
- package/dist/cli-bundle/chunks/stage-T2LKWN7C.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-24VRBNKE.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-3ELVASVA.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-3GT4A3ZN.js +44 -0
- package/dist/cli-bundle/focused-chunks/chunk-3OCDKITJ.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-3Z7MCUJM.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-46MP7IZN.js +5 -0
- package/dist/cli-bundle/focused-chunks/chunk-5LDBS6MS.js +91 -0
- package/dist/cli-bundle/focused-chunks/chunk-A6VEMCRR.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-AIDL2ZNT.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-B6BNHKUW.js +78 -0
- package/dist/cli-bundle/focused-chunks/chunk-BKPUUW5O.js +1 -0
- package/dist/cli-bundle/focused-chunks/chunk-BWOVFE5B.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-C7WHWI7K.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-EUQGZPGO.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-FDZPRJXJ.js +27 -0
- package/dist/cli-bundle/focused-chunks/chunk-GXP7Q4XM.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-HL47UQZJ.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-IIP6LZ5E.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-K53OIT5J.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-LMFIAQ2V.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-LMU7DDOA.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OZOCEB2Q.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-Q2HY44LV.js +13 -0
- package/dist/cli-bundle/focused-chunks/chunk-REFMQY47.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIE3SJSE.js +9 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIQUIHYU.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-RLO2HCZT.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-SMMOZ3H3.js +100 -0
- package/dist/cli-bundle/focused-chunks/chunk-UVTUX54T.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-X6CXWWNB.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-XDBHD4CY.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-YD66IRSL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Z7W2RQIB.js +2 -0
- package/dist/cli-bundle/focused-chunks/context-budget-recovery-CSJV3TY3.js +2 -0
- package/dist/cli-bundle/focused-chunks/field-option-collisions-UODPSV6W.js +2 -0
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-EGEJMG3G.js +4 -0
- package/dist/cli-bundle/focused-chunks/item-revision-QH7RNBX4.js +2 -0
- package/dist/cli-bundle/focused-chunks/item-transaction-ZO72OINF.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-actor-PHVLKG4I.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-admission-ZSG5OECH.js +2 -0
- package/dist/cli-bundle/focused-chunks/runtime-schema-6RQMIDTN.js +2 -0
- package/dist/cli-bundle/focused-chunks/settlement-hook-FMLGKG7J.js +7 -0
- package/dist/cli-bundle/focused-chunks/stage-AQMKRVX4.js +2 -0
- package/dist/cli-bundle/main.js +27 -27
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +5 -5
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +66 -66
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +13 -13
- package/dist/cli.js +1 -1
- package/dist/core/checkpoint/checkpoint-gc.js +1 -1
- package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
- package/dist/core/checkpoint/mutation-context.js +1 -1
- package/dist/core/config/nested-settings.js +1 -1
- package/dist/core/config/positional-value.js +1 -1
- package/dist/core/diagnostics/remediation.js +1 -1
- package/dist/core/extensions/activation-summary-markdown.js +2 -2
- package/dist/core/extensions/activation-summary.js +1 -1
- package/dist/core/extensions/activation-transaction.js +1 -1
- package/dist/core/extensions/capability-usage.js +1 -1
- package/dist/core/extensions/command-hook-context.js +1 -1
- package/dist/core/extensions/command-metadata-contract.js +1 -1
- package/dist/core/extensions/command-visibility-tier.js +1 -1
- package/dist/core/extensions/contribution-inventory.js +1 -1
- package/dist/core/extensions/exporter-output-contract.js +1 -1
- package/dist/core/extensions/extension-candidate.js +1 -1
- package/dist/core/extensions/extension-capability-aliases.js +1 -1
- package/dist/core/extensions/extension-hook-runtime.js +1 -1
- package/dist/core/extensions/extension-policy.js +1 -1
- package/dist/core/extensions/extension-registries.js +1 -1
- package/dist/core/extensions/extension-runtime-helpers.js +1 -1
- package/dist/core/extensions/extension-types.js +1 -1
- package/dist/core/extensions/flag-definition-validation.js +1 -1
- package/dist/core/extensions/flag-value-types.js +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/item-field-types.js +1 -1
- package/dist/core/extensions/item-fields.js +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/manifest-parser.js +1 -1
- package/dist/core/extensions/manifest-schema.js +1 -1
- package/dist/core/extensions/module-graph-snapshot.js +1 -1
- package/dist/core/extensions/mutation-actor-snapshot.js +1 -1
- package/dist/core/extensions/mutation-actor.js +1 -1
- package/dist/core/extensions/preflight-ownership.js +1 -1
- package/dist/core/extensions/read-output-contract.js +1 -1
- package/dist/core/extensions/registration-contracts.js +1 -1
- package/dist/core/extensions/registration-validation.js +1 -1
- package/dist/core/extensions/registration-values.js +1 -1
- package/dist/core/extensions/reserved-host-flags.js +1 -1
- package/dist/core/extensions/runtime-registrations.js +1 -1
- package/dist/core/extensions/service-ownership.js +1 -1
- package/dist/core/extensions/version-compat.js +1 -1
- package/dist/core/extensions/version-diagnostics.js +1 -1
- package/dist/core/fs/atomic-create.js +1 -1
- package/dist/core/fs/file-glob.js +1 -1
- package/dist/core/fs/fs-utils.js +2 -2
- package/dist/core/fs/host-environment-errors.js +1 -1
- package/dist/core/fs/index.js +1 -1
- package/dist/core/fs/path-utils.js +1 -1
- package/dist/core/governance/content-fields.js +1 -1
- package/dist/core/governance/issue-codes.js +1 -1
- package/dist/core/governance/metadata-coverage.js +1 -1
- package/dist/core/history/bridge.js +1 -1
- package/dist/core/history/digest.js +1 -1
- package/dist/core/history/drift-cache.js +3 -3
- package/dist/core/history/drift-scan.js +1 -1
- package/dist/core/history/event-classification.js +1 -1
- package/dist/core/history/event-index.js +11 -11
- package/dist/core/history/history-compact-bulk.js +1 -1
- package/dist/core/history/history-diff.js +1 -1
- package/dist/core/history/history-rewrite.js +1 -1
- package/dist/core/history/history-storage-stats.js +1 -1
- package/dist/core/history/history-stream-policy.js +1 -1
- package/dist/core/history/history.js +2 -2
- package/dist/core/history/identity.js +1 -1
- package/dist/core/history/index.js +1 -1
- package/dist/core/history/operation-contract.js +1 -1
- package/dist/core/history/projection.js +1 -1
- package/dist/core/history/read.js +1 -1
- package/dist/core/history/replay.js +2 -2
- package/dist/core/history/stream-summary.js +2 -2
- package/dist/core/history/tombstone.js +1 -1
- package/dist/core/history/version-address.js +1 -1
- package/dist/core/history/workspace-history.js +2 -2
- package/dist/core/io/body-file.js +1 -1
- package/dist/core/io/bulk-ids-input.js +2 -2
- package/dist/core/item/actionability.js +1 -1
- package/dist/core/item/deferred-fields.js +1 -1
- package/dist/core/item/dependency-reference.js +1 -1
- package/dist/core/item/id.js +1 -1
- package/dist/core/item/index.js +1 -1
- package/dist/core/item/item-format-version.js +1 -1
- package/dist/core/item/item-format.js +7 -7
- package/dist/core/item/item-record.js +1 -1
- package/dist/core/item/item-type-definition.js +1 -1
- package/dist/core/item/literal-mutation-input.js +1 -1
- package/dist/core/item/parent-reference-policy.js +1 -1
- package/dist/core/item/parse.js +8 -8
- package/dist/core/item/plan-lifecycle.js +1 -1
- package/dist/core/item/priority.js +1 -1
- package/dist/core/item/sprint-release-format.js +1 -1
- package/dist/core/item/status-filter.js +1 -1
- package/dist/core/item/status.js +1 -1
- package/dist/core/item/toon-decode.js +1 -1
- package/dist/core/item/type-registry.js +1 -1
- package/dist/core/item/type-synonyms.js +1 -1
- package/dist/core/lock/index.js +1 -1
- package/dist/core/lock/lock-confinement.js +1 -1
- package/dist/core/lock/lock-gc.js +1 -1
- package/dist/core/lock/lock-owner.js +1 -1
- package/dist/core/lock/lock.js +4 -4
- package/dist/core/output/linked-test-projection.js +5 -5
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/output/output-control.js +1 -1
- package/dist/core/output/output.js +19 -19
- package/dist/core/output/query-summary.js +1 -1
- package/dist/core/output/tabular.js +3 -3
- package/dist/core/packages/manifest.js +1 -1
- package/dist/core/packages/root.js +1 -1
- package/dist/core/policy/workflow-policy-schema.js +1 -1
- package/dist/core/policy/workflow-policy-store.js +1 -1
- package/dist/core/policy/workflow-policy.js +1 -1
- package/dist/core/profile/profile-describe.js +1 -1
- package/dist/core/profile/profile-lint.d.ts +1 -1
- package/dist/core/profile/profile-lint.js +1 -1
- package/dist/core/profile/profile-plan.js +1 -1
- package/dist/core/profile/profile-presets.js +4 -4
- package/dist/core/reproducibility/context.js +1 -1
- package/dist/core/schema/fields-file.js +2 -2
- package/dist/core/schema/item-types-file.js +2 -2
- package/dist/core/schema/runtime-field-filters.js +1 -1
- package/dist/core/schema/runtime-field-values.js +1 -1
- package/dist/core/schema/runtime-schema.d.ts +2 -0
- package/dist/core/schema/runtime-schema.js +2 -2
- package/dist/core/schema/status-defs-file.js +2 -2
- package/dist/core/schema/status-token.js +1 -1
- package/dist/core/schema/type-inference.js +1 -1
- package/dist/core/schema/type-presets.js +1 -1
- package/dist/core/schema/type-workflows.js +1 -1
- package/dist/core/search/background-refresh.js +2 -2
- package/dist/core/search/bm25.js +1 -1
- package/dist/core/search/cache.js +2 -2
- package/dist/core/search/corpus.js +1 -1
- package/dist/core/search/embedding-batches.js +1 -1
- package/dist/core/search/eval-thresholds.js +1 -1
- package/dist/core/search/eval.js +1 -1
- package/dist/core/search/http-client.js +1 -1
- package/dist/core/search/providers.js +1 -1
- package/dist/core/search/relevance.js +1 -1
- package/dist/core/search/semantic-defaults.js +1 -1
- package/dist/core/search/staleness.js +1 -1
- package/dist/core/search/vector-stores.js +2 -2
- package/dist/core/search/vectorization-metadata.js +1 -1
- package/dist/core/sentry/helpers.js +1 -1
- package/dist/core/sentry/instrument.js +1 -1
- package/dist/core/sentry/sensitive-assignments.js +1 -1
- package/dist/core/session/session-state.js +1 -1
- package/dist/core/shared/agent-session-context.js +1 -1
- package/dist/core/shared/author.js +5 -5
- package/dist/core/shared/command-line.js +1 -1
- package/dist/core/shared/command-types.js +0 -1
- package/dist/core/shared/conflict-markers.js +1 -1
- package/dist/core/shared/constants.js +1 -1
- package/dist/core/shared/error-details.js +1 -1
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/shared/html-entity-decode.js +1 -1
- package/dist/core/shared/index.js +1 -1
- package/dist/core/shared/item-metadata-contract.js +1 -1
- package/dist/core/shared/lazy-module.js +1 -1
- package/dist/core/shared/levenshtein.js +1 -1
- package/dist/core/shared/memo.js +1 -1
- package/dist/core/shared/numeric-parsers.js +1 -1
- package/dist/core/shared/option-alias-visibility.js +1 -1
- package/dist/core/shared/output-unicode.js +1 -1
- package/dist/core/shared/primitives.js +1 -1
- package/dist/core/shared/process-tree.js +2 -2
- package/dist/core/shared/secret-rules.js +5 -5
- package/dist/core/shared/serial-queue.js +1 -1
- package/dist/core/shared/serialization.js +1 -1
- package/dist/core/shared/split-comma-list.js +1 -1
- package/dist/core/shared/text-normalization.js +1 -1
- package/dist/core/shared/time.js +2 -2
- package/dist/core/shared/url-credentials.js +1 -1
- package/dist/core/store/index.js +1 -1
- package/dist/core/store/item-format-migration.js +1 -1
- package/dist/core/store/item-metadata-cache.js +1 -1
- package/dist/core/store/item-metadata-query-index.js +11 -11
- package/dist/core/store/item-metadata-read-work.js +1 -1
- package/dist/core/store/item-mutation-precondition.js +1 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/store/paths.js +1 -1
- package/dist/core/store/settings-concurrency.js +1 -1
- package/dist/core/store/settings-read-cache.js +1 -1
- package/dist/core/store/settings-sections.js +2 -2
- package/dist/core/store/settings-validator.js +1 -1
- package/dist/core/store/settings.d.ts +3 -1
- package/dist/core/store/settings.js +6 -6
- package/dist/core/store/sqlite-runtime.js +1 -1
- package/dist/core/store/tracker-preflight.js +1 -1
- package/dist/core/store/transaction-coordinator-scope.js +1 -1
- package/dist/core/telemetry/consent.js +3 -3
- package/dist/core/telemetry/observability.js +1 -1
- package/dist/core/telemetry/policy.js +1 -1
- package/dist/core/telemetry/read-sampling.js +2 -2
- package/dist/core/telemetry/runtime.js +9 -9
- package/dist/core/test/background-runs.js +4 -4
- package/dist/core/test/item-test-run-tracking.js +1 -1
- package/dist/core/test/run-selectors.js +1 -1
- package/dist/core/validate/estimate-defaults.js +1 -1
- package/dist/core/validate/fix-planning.js +1 -1
- package/dist/core/validate/linked-artifact-reference.js +1 -1
- package/dist/core/validate/missing-by-type.js +1 -1
- package/dist/core/validate/missing-link-owners.js +1 -1
- package/dist/core/validate/stale-file-classification.js +1 -1
- package/dist/mcp/http-server.js +5 -5
- package/dist/mcp/legacy-adapter.js +1 -1
- package/dist/mcp/runtime-capabilities.js +1 -1
- package/dist/mcp/server.js +4 -4
- package/dist/mcp/tool-definitions.js +1 -1
- package/dist/sdk/actionability.js +1 -1
- package/dist/sdk/agent/closed-domain-contracts.js +1 -1
- package/dist/sdk/agent/command-recovery.js +1 -1
- package/dist/sdk/agent/command-suggestions.js +1 -1
- package/dist/sdk/agent/create-option-policy.js +1 -1
- package/dist/sdk/agent/identity-config.js +1 -1
- package/dist/sdk/agent/item-addressing.js +1 -1
- package/dist/sdk/agent/linked-resource-recovery.js +1 -1
- package/dist/sdk/agent/refusal-closure-census.js +2 -2
- package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
- package/dist/sdk/agent/subcommand-recovery.js +1 -1
- package/dist/sdk/agent-capability-contracts.js +3 -3
- package/dist/sdk/agent-session-context.js +1 -1
- package/dist/sdk/annotations.js +1 -1
- package/dist/sdk/author-attribution.js +1 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/agent-output-contracts.js +5 -5
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +1 -1
- package/dist/sdk/cli-contracts/completeness.js +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +2 -2
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/registration-helpers.js +7 -7
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -1
- package/dist/sdk/cli-contracts/string-lists.js +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.js +0 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/cli-program.js +1 -1
- package/dist/sdk/command-line.js +1 -1
- package/dist/sdk/comments.js +1 -1
- package/dist/sdk/compile-cache.js +1 -1
- package/dist/sdk/completion/bash.js +2 -2
- package/dist/sdk/completion/fish.js +72 -72
- package/dist/sdk/completion/shared.js +1 -1
- package/dist/sdk/completion/zsh.js +75 -75
- package/dist/sdk/completion.js +1 -1
- package/dist/sdk/config.js +1 -1
- package/dist/sdk/context/recency.js +1 -1
- package/dist/sdk/context/semantic-session-attribution.js +1 -1
- package/dist/sdk/context/usage-egress.js +1 -1
- package/dist/sdk/context/usage-ledger.js +6 -6
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/context-intent-runtime.js +1 -1
- package/dist/sdk/context-packing.js +1 -1
- package/dist/sdk/context-relevance.js +1 -1
- package/dist/sdk/context-signal-store.js +2 -2
- package/dist/sdk/context-usage.js +1 -1
- package/dist/sdk/dependencies/context-budget-recovery.js +1 -1
- package/dist/sdk/dependencies.js +1 -1
- package/dist/sdk/dependency-flag-validation.js +1 -1
- package/dist/sdk/dependency-provenance.js +1 -1
- package/dist/sdk/docs.js +1 -1
- package/dist/sdk/duplicates.js +1 -1
- package/dist/sdk/environment/host-environment-errors.js +1 -1
- package/dist/sdk/environment/project-runtime-compatibility.js +2 -2
- package/dist/sdk/environment/source-context.js +1 -1
- package/dist/sdk/environment/tracker-preflight.js +1 -1
- package/dist/sdk/error-code-catalog.js +1 -1
- package/dist/sdk/error-runtime.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/eval.js +1 -1
- package/dist/sdk/extension/author-manifest.js +1 -1
- package/dist/sdk/extension/bundled-catalog.js +1 -1
- package/dist/sdk/extension/command-options.d.ts +26 -1
- package/dist/sdk/extension/command-options.js +1 -1
- package/dist/sdk/extension/concurrency.js +1 -1
- package/dist/sdk/extension/copy-scope.js +1 -1
- package/dist/sdk/extension/custom-field-collisions.js +1 -1
- package/dist/sdk/extension/describe.js +3 -3
- package/dist/sdk/extension/doctor.js +1 -1
- package/dist/sdk/extension/install-plan.js +1 -1
- package/dist/sdk/extension/install-receipts.js +1 -1
- package/dist/sdk/extension/install-runtime.js +3 -3
- package/dist/sdk/extension/install-snapshot.js +1 -1
- package/dist/sdk/extension/install-sources.js +5 -5
- package/dist/sdk/extension/managed-state.js +2 -2
- package/dist/sdk/extension/managed-update-status.js +1 -1
- package/dist/sdk/extension/migrations.js +2 -2
- package/dist/sdk/extension/native-command-options.js +1 -1
- package/dist/sdk/extension/output-ownership.js +1 -1
- package/dist/sdk/extension/runtime-summary.js +1 -1
- package/dist/sdk/extension/scaffold.js +11 -11
- package/dist/sdk/extension/shared.js +1 -1
- package/dist/sdk/extension/source-resolution.js +1 -1
- package/dist/sdk/extension/static-inventory.js +1 -1
- package/dist/sdk/extension/update-check.js +1 -1
- package/dist/sdk/extension-command-context.js +2 -2
- package/dist/sdk/extension-contracts.js +1 -1
- package/dist/sdk/extension.js +1 -1
- package/dist/sdk/files.js +1 -1
- package/dist/sdk/flag-invocation-contracts.js +1 -1
- package/dist/sdk/generated/error-code-catalog-rows.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/generated-error-code-catalog.js +1 -1
- package/dist/sdk/governance/assurance-action-contracts.js +0 -1
- package/dist/sdk/governance/assurance-action.js +1 -1
- package/dist/sdk/governance/assurance-limits.js +1 -1
- package/dist/sdk/governance/assurance-mutation-error.js +1 -1
- package/dist/sdk/governance/assurance-presets.js +1 -1
- package/dist/sdk/governance/assurance-runtime.js +1 -1
- package/dist/sdk/governance/assurance.js +4 -4
- package/dist/sdk/governance/boundary-fixtures.js +1 -1
- package/dist/sdk/governance/closure-timestamps.js +1 -1
- package/dist/sdk/governance/defect-recurrence-coverage.js +1 -1
- package/dist/sdk/governance/defect-recurrence-graph.js +1 -1
- package/dist/sdk/governance/defect-recurrence-signals.js +1 -1
- package/dist/sdk/governance/defect-recurrence.js +2 -2
- package/dist/sdk/governance/extension-host-version.js +1 -1
- package/dist/sdk/governance/gc.js +1 -1
- package/dist/sdk/governance/health/history-drift-remedies.js +1 -1
- package/dist/sdk/governance/health/projection.js +1 -1
- package/dist/sdk/governance/health-merge-evidence.js +1 -1
- package/dist/sdk/governance/health.js +2 -2
- package/dist/sdk/governance/hierarchy-validation.js +1 -1
- package/dist/sdk/governance/in-progress-work-health.js +1 -1
- package/dist/sdk/governance/lifecycle-dependency-cycles.js +1 -1
- package/dist/sdk/governance/linked-file-report.js +1 -1
- package/dist/sdk/governance/merge-receipt-history.js +1 -1
- package/dist/sdk/governance/provenance-health.js +4 -4
- package/dist/sdk/governance/reindex.js +5 -5
- package/dist/sdk/governance/stale-work.js +1 -1
- package/dist/sdk/governance/status-role-diagnostics.js +1 -1
- package/dist/sdk/governance/storage-integrity.js +1 -1
- package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
- package/dist/sdk/governance/upgrade.js +2 -2
- package/dist/sdk/governance/validate-deferred-fields.js +1 -1
- package/dist/sdk/governance/validate-history-drift.js +1 -1
- package/dist/sdk/governance/validate-item-reader.js +1 -1
- package/dist/sdk/governance/validate-normalization.js +1 -1
- package/dist/sdk/governance/validate.js +1 -1
- package/dist/sdk/governance/workflow-completeness.js +1 -1
- package/dist/sdk/governance/workflow-policy.js +3 -3
- package/dist/sdk/governance/workspace-position.js +2 -2
- package/dist/sdk/graph/analytics.js +1 -1
- package/dist/sdk/graph/assembly.js +1 -1
- package/dist/sdk/graph/cache.js +1 -1
- package/dist/sdk/graph/cardinality-integrity.js +1 -1
- package/dist/sdk/graph/centrality.js +1 -1
- package/dist/sdk/graph/deadline-scheduling.js +1 -1
- package/dist/sdk/graph/durable-cache.js +1 -1
- package/dist/sdk/graph/governance-contracts.js +1 -1
- package/dist/sdk/graph/governance.js +1 -1
- package/dist/sdk/graph/hierarchy-integrity.js +1 -1
- package/dist/sdk/graph/lifecycle-coverage.js +1 -1
- package/dist/sdk/graph/mutation-advisory.js +1 -1
- package/dist/sdk/graph/query-contracts.js +1 -1
- package/dist/sdk/graph/remediation.js +1 -1
- package/dist/sdk/graph/run.js +1 -1
- package/dist/sdk/graph/scheduling.js +1 -1
- package/dist/sdk/graph/traversal.js +1 -1
- package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -1
- package/dist/sdk/guide-topics.js +1 -1
- package/dist/sdk/guide.js +7 -7
- package/dist/sdk/history/append-only-repair.js +4 -4
- package/dist/sdk/history/attestation-command.js +2 -2
- package/dist/sdk/history/attestation-contract.js +1 -1
- package/dist/sdk/history/attestation-scan.js +1 -1
- package/dist/sdk/history/attestation.js +1 -1
- package/dist/sdk/history/maintenance.js +1 -1
- package/dist/sdk/history/reanchor-refusal.js +1 -1
- package/dist/sdk/history/reseed.js +1 -1
- package/dist/sdk/history/salvage.js +5 -5
- package/dist/sdk/history/subject.js +1 -1
- package/dist/sdk/history-analytics.js +1 -1
- package/dist/sdk/history-compact.js +1 -1
- package/dist/sdk/history-mcp.js +1 -1
- package/dist/sdk/history-provenance.js +1 -1
- package/dist/sdk/history-read.js +1 -1
- package/dist/sdk/history-redact.js +1 -1
- package/dist/sdk/history-repair.js +1 -1
- package/dist/sdk/improvement-ledger-validation.js +1 -1
- package/dist/sdk/improvement-ledger.js +2 -2
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/init-agent-guidance.js +10 -10
- package/dist/sdk/init.js +14 -14
- package/dist/sdk/invocation-author.js +1 -1
- package/dist/sdk/item-children.js +1 -1
- package/dist/sdk/item-metadata-index.js +1 -1
- package/dist/sdk/item-schedule.js +1 -1
- package/dist/sdk/item-transaction.js +1 -1
- package/dist/sdk/learnings.js +1 -1
- package/dist/sdk/lifecycle/append.js +3 -3
- package/dist/sdk/lifecycle/checkpoint-rollback.js +1 -1
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/cli-input.js +1 -1
- package/dist/sdk/lifecycle/close-many.js +1 -1
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/copy.js +1 -1
- package/dist/sdk/lifecycle/core-field-recovery.js +1 -1
- package/dist/sdk/lifecycle/core-item-fields.js +1 -1
- package/dist/sdk/lifecycle/create-deferrals.js +1 -1
- package/dist/sdk/lifecycle/create.js +1 -1
- package/dist/sdk/lifecycle/delete.js +1 -1
- package/dist/sdk/lifecycle/dependency-removal.js +1 -1
- package/dist/sdk/lifecycle/event-validation-messages.js +1 -1
- package/dist/sdk/lifecycle/focus.js +1 -1
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
- package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
- package/dist/sdk/lifecycle/mcp-actions.js +1 -1
- package/dist/sdk/lifecycle/metadata-normalizers.js +1 -1
- package/dist/sdk/lifecycle/mutation-command-options.js +0 -1
- package/dist/sdk/lifecycle/mutation-facet-contracts.js +1 -1
- package/dist/sdk/lifecycle/mutation-option-validation.js +1 -1
- package/dist/sdk/lifecycle/plan-mutation-receipt.js +1 -1
- package/dist/sdk/lifecycle/plan.js +1 -1
- package/dist/sdk/lifecycle/recurrence-parsers.js +1 -1
- package/dist/sdk/lifecycle/release-handoff.js +1 -1
- package/dist/sdk/lifecycle/reopen.js +1 -1
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +2 -2
- package/dist/sdk/lifecycle/repeated-terminal-state.js +1 -1
- package/dist/sdk/lifecycle/restore.js +1 -1
- package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
- package/dist/sdk/lifecycle/start-blockers.js +1 -1
- package/dist/sdk/lifecycle/structured-mutation-plan.js +1 -1
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/lifecycle/update-many.js +1 -1
- package/dist/sdk/lifecycle/update.js +2 -2
- package/dist/sdk/lifecycle/workflow-transition.js +1 -1
- package/dist/sdk/lifecycle-completion.js +1 -1
- package/dist/sdk/lifecycle-policy.js +1 -1
- package/dist/sdk/linked-artifacts.js +2 -2
- package/dist/sdk/mcp/apps.js +5 -5
- package/dist/sdk/mcp/authorization.js +1 -1
- package/dist/sdk/mcp/discovery.js +1 -1
- package/dist/sdk/mcp/executable.js +4 -4
- package/dist/sdk/mcp/interactions.js +1 -1
- package/dist/sdk/mcp/protocol.js +1 -1
- package/dist/sdk/mcp/skills.js +3 -3
- package/dist/sdk/mcp/subscriptions.js +1 -1
- package/dist/sdk/mcp/tasks.js +2 -2
- package/dist/sdk/mcp/transport.js +1 -1
- package/dist/sdk/merge/abandoned-receipts.js +1 -1
- package/dist/sdk/merge/driver.js +7 -7
- package/dist/sdk/merge/history-scalar-rebase.js +1 -1
- package/dist/sdk/merge/ignored-artifacts.js +1 -1
- package/dist/sdk/merge/index.js +1 -1
- package/dist/sdk/merge/indexed-receipt-blobs.js +2 -2
- package/dist/sdk/merge/install.js +6 -6
- package/dist/sdk/merge/receipt-file-boundary.js +1 -1
- package/dist/sdk/merge/receipt-operation.js +1 -1
- package/dist/sdk/merge/receipt-schema.js +1 -1
- package/dist/sdk/merge/receipts.js +4 -4
- package/dist/sdk/merge/reconcile.js +1 -1
- package/dist/sdk/merge/settlement-hook.js +4 -4
- package/dist/sdk/merge/stage.js +1 -1
- package/dist/sdk/merge/three-way.js +9 -9
- package/dist/sdk/merge/worktree-config.js +2 -2
- package/dist/sdk/merge.js +1 -1
- package/dist/sdk/mutation-events.js +1 -1
- package/dist/sdk/mutation-guard.js +1 -1
- package/dist/sdk/notes.js +1 -1
- package/dist/sdk/output/fit-envelope.js +1 -1
- package/dist/sdk/output/list-envelope.js +1 -1
- package/dist/sdk/output/table-rows.js +1 -1
- package/dist/sdk/output-contracts.js +1 -1
- package/dist/sdk/output-projection.js +1 -1
- package/dist/sdk/output-token-accounting.js +1 -1
- package/dist/sdk/output.js +2 -2
- package/dist/sdk/ownership-source.js +1 -1
- package/dist/sdk/package-import-adapters.js +1 -1
- package/dist/sdk/package-migrations.js +1 -1
- package/dist/sdk/package-runtime-options.js +1 -1
- package/dist/sdk/pagination.js +1 -1
- package/dist/sdk/profile.js +5 -5
- package/dist/sdk/provenance.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.js +1 -1
- package/dist/sdk/query/aggregate.js +1 -1
- package/dist/sdk/query/calendar.js +4 -4
- package/dist/sdk/query/complete-list.js +1 -1
- package/dist/sdk/query/context.js +2 -2
- package/dist/sdk/query/declared-blockers.js +1 -1
- package/dist/sdk/query/duplicate-candidates.js +1 -1
- package/dist/sdk/query/get-facet-roots.js +1 -1
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/history.js +1 -1
- package/dist/sdk/query/item-filter-options.js +0 -1
- package/dist/sdk/query/light-metadata.js +1 -1
- package/dist/sdk/query/list-filter-shared.js +1 -1
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/query/multi-value-filters.js +1 -1
- package/dist/sdk/query/next-ranking-policy.js +1 -1
- package/dist/sdk/query/next-ready-budget.js +1 -1
- package/dist/sdk/query/next.js +2 -2
- package/dist/sdk/query/parsers.js +1 -1
- package/dist/sdk/query/projection-contracts.js +1 -1
- package/dist/sdk/query/search/corpus.js +2 -2
- package/dist/sdk/query/search/filters.js +1 -1
- package/dist/sdk/query/search/input.js +1 -1
- package/dist/sdk/query/search/lexical.js +1 -1
- package/dist/sdk/query/search/response.js +1 -1
- package/dist/sdk/query/search/semantic.js +3 -3
- package/dist/sdk/query/search/types.js +0 -1
- package/dist/sdk/query/search-contracts.js +1 -1
- package/dist/sdk/query/search-pagination.js +1 -1
- package/dist/sdk/query/search-rendering.js +1 -1
- package/dist/sdk/query/search.js +1 -1
- package/dist/sdk/query/window-pagination.js +1 -1
- package/dist/sdk/query/workspace-contracts.js +1 -1
- package/dist/sdk/read-output/continuation.js +1 -1
- package/dist/sdk/read-output/extension.js +1 -1
- package/dist/sdk/read-output/options.js +1 -1
- package/dist/sdk/read-output/positional-rows.js +1 -1
- package/dist/sdk/read-output/provenance.js +1 -1
- package/dist/sdk/read-output/session-result.js +0 -1
- package/dist/sdk/read-output/surfaces.js +1 -1
- package/dist/sdk/read-output/tail-retention.js +1 -1
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.d.ts +11 -0
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.js +1 -1
- package/dist/sdk/read-output-session.js +1 -1
- package/dist/sdk/relationship-analytics.js +1 -1
- package/dist/sdk/relationship-context.js +1 -1
- package/dist/sdk/relationship-history.js +6 -6
- package/dist/sdk/relationship-kinds/contract.js +1 -1
- package/dist/sdk/relationships.js +1 -1
- package/dist/sdk/reproducibility/process.js +1 -1
- package/dist/sdk/runtime/actions.js +1 -1
- package/dist/sdk/runtime/context.js +1 -1
- package/dist/sdk/runtime/mutation-admission.js +1 -1
- package/dist/sdk/runtime/mutation-value-validation.js +1 -1
- package/dist/sdk/runtime/schema-preview.js +1 -1
- package/dist/sdk/runtime/schema.js +1 -1
- package/dist/sdk/runtime-action-aliases.js +1 -1
- package/dist/sdk/runtime-extended-actions.js +1 -1
- package/dist/sdk/runtime-input.d.ts +2 -0
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime-public-contracts.js +0 -1
- package/dist/sdk/runtime-stats-options.js +1 -1
- package/dist/sdk/runtime.d.ts +5 -3
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/scheduling-shortcuts.js +1 -1
- package/dist/sdk/schema/field-flag-spelling.d.ts +22 -0
- package/dist/sdk/schema/field-flag-spelling.js +2 -0
- package/dist/sdk/schema/field-option-collisions.js +2 -0
- package/dist/sdk/schema-migration.js +4 -4
- package/dist/sdk/schema.js +7 -7
- package/dist/sdk/search-refresh-worker.js +1 -1
- package/dist/sdk/similarity-scoring.js +1 -1
- package/dist/sdk/similarity.js +1 -1
- package/dist/sdk/start-task-status.js +1 -1
- package/dist/sdk/stats.js +1 -1
- package/dist/sdk/structured-mutations.js +1 -1
- package/dist/sdk/telemetry-flush.js +1 -1
- package/dist/sdk/telemetry.js +4 -4
- package/dist/sdk/templates.js +3 -3
- package/dist/sdk/test/batch.js +2 -2
- package/dist/sdk/test/command-args.js +1 -1
- package/dist/sdk/test/command-resolution.js +2 -2
- package/dist/sdk/test/entry.js +2 -2
- package/dist/sdk/test/execution-receipts.js +2 -2
- package/dist/sdk/test/execution.js +5 -5
- package/dist/sdk/test/json-path.js +1 -1
- package/dist/sdk/test/linked-command-detection.js +1 -1
- package/dist/sdk/test/measurements.js +1 -1
- package/dist/sdk/test/parsers.js +1 -1
- package/dist/sdk/test/prerequisites.js +1 -1
- package/dist/sdk/test/receipt-index-snapshot.js +1 -1
- package/dist/sdk/test/run-phases.js +1 -1
- package/dist/sdk/test/runs.js +1 -1
- package/dist/sdk/test/trust.js +2 -2
- package/dist/sdk/test/update.js +1 -1
- package/dist/sdk/test/workspace-snapshot.js +1 -1
- package/dist/sdk/traceability/runtime-files-lookup.js +1 -1
- package/dist/sdk/traceability/source-traceability.js +2 -2
- package/dist/sdk/tracker-root-discovery.js +1 -1
- package/dist/sdk/transactions/item-finalization.js +1 -1
- package/dist/sdk/workspace-contracts-cache.js +1 -1
- package/dist/sdk/workspace-contracts.js +1 -1
- package/dist/sdk/workspace-memory.js +2 -2
- package/dist/sdk/workspace-snapshot.js +5 -5
- package/dist/sdk/workspace-transaction-gc.js +1 -1
- package/dist/sdk/workspace-transaction.js +2 -2
- package/dist/sdk/workspace.js +6 -6
- package/dist/types/index.js +1 -1
- package/dist/types.js +1 -1
- package/docs/COMMANDS.md +1 -1
- package/docs/EXTENSIONS.md +2 -2
- package/docs/READ_OUTPUT_CONTRACTS.md +2 -0
- package/docs/SDK.md +94 -5
- package/docs/SDK_AUDITED_MUTATIONS.md +11 -0
- package/marketplace.json +1 -1
- package/package.json +2 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/scripts/finalize-build.mjs +63 -24
- package/scripts/prepare-build-cache.mjs +28 -1
- package/dist/cli-bundle/chunks/chunk-3W47ZZ5T.js +0 -9
- package/dist/cli-bundle/chunks/chunk-4TB5D6HL.js +0 -125
- package/dist/cli-bundle/chunks/chunk-5ZMVLWE3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-6BBDEIKC.js +0 -33
- package/dist/cli-bundle/chunks/chunk-AR4NP5HI.js +0 -3
- package/dist/cli-bundle/chunks/chunk-B4PPFOPY.js +0 -3
- package/dist/cli-bundle/chunks/chunk-CAR2L5NW.js +0 -8
- package/dist/cli-bundle/chunks/chunk-DEZPZOQ7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-EIGUKEV6.js +0 -2
- package/dist/cli-bundle/chunks/chunk-GTPCAJMZ.js +0 -8
- package/dist/cli-bundle/chunks/chunk-GYP24M7W.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HC2OPETM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HKUV74K3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HXHYDO2R.js +0 -115
- package/dist/cli-bundle/chunks/chunk-IB7UB5TE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J2LABXBL.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J52BEBSS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KQIZ34SF.js +0 -3
- package/dist/cli-bundle/chunks/chunk-LQBWLNZJ.js +0 -3
- package/dist/cli-bundle/chunks/chunk-OJTMGDON.js +0 -31
- package/dist/cli-bundle/chunks/chunk-SPPHDVZE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TC6XLIYO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-U7EL3AYA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-VQFWW4EF.js +0 -6
- package/dist/cli-bundle/chunks/chunk-X6MIWTTT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XC5Q2ZV7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XFHPKXAE.js +0 -71
- package/dist/cli-bundle/chunks/chunk-YHVLVSEZ.js +0 -9
- package/dist/cli-bundle/chunks/chunk-YMUSRWV4.js +0 -9
- package/dist/cli-bundle/chunks/chunk-YR2KEBHP.js +0 -2
- package/dist/cli-bundle/chunks/context-budget-recovery-L2WP5S26.js +0 -2
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-ITTXIN4K.js +0 -4
- package/dist/cli-bundle/chunks/item-revision-4QBMZXKX.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-QY3PUHEI.js +0 -2
- package/dist/cli-bundle/chunks/mutation-actor-FWLYWJ37.js +0 -2
- package/dist/cli-bundle/chunks/mutation-admission-7ZDCK3G2.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-57AJQWFV.js +0 -21
- package/dist/cli-bundle/chunks/register-operations-RKWST7CU.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-CMI23PC5.js +0 -2
- package/dist/cli-bundle/chunks/settlement-hook-BXN5LEQD.js +0 -7
- package/dist/cli-bundle/chunks/stage-4KDVXC5Z.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2ZD7275J.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-324AHXJO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3IRCYJI5.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-3V53UBHN.js +0 -9
- package/dist/cli-bundle/focused-chunks/chunk-3XSWH6QC.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-4JZITIJB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4KTFKSS3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5C5TK3ET.js +0 -78
- package/dist/cli-bundle/focused-chunks/chunk-AKJYOZZP.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-BRZV7BFV.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-C3O6JJPO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CR7CGEB2.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-EGN2HFRU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-GHQVM6K6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HDEKFSOK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-I5LGPUWH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IWOXAUDU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ML3JHCC6.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-OPGOOP25.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-RE7ZWT7D.js +0 -27
- package/dist/cli-bundle/focused-chunks/chunk-RKQNVYGF.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-RQ252B6V.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-SVOOGGAK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-URGHTTT3.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-USPYKWQG.js +0 -13
- package/dist/cli-bundle/focused-chunks/chunk-UWS3FC4D.js +0 -102
- package/dist/cli-bundle/focused-chunks/chunk-UXQGFGAT.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-WZWXGDYY.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-YKSLZPLT.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZWJTY4ID.js +0 -2
- package/dist/cli-bundle/focused-chunks/context-budget-recovery-5MKOCGY5.js +0 -2
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-AF4U3F3D.js +0 -4
- package/dist/cli-bundle/focused-chunks/item-transaction-GLACUTPL.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-actor-TCYDPUGG.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-LY73EJWM.js +0 -2
- package/dist/cli-bundle/focused-chunks/settlement-hook-ARYCZQY4.js +0 -7
- package/dist/cli-bundle/focused-chunks/stage-DQ7RQQ52.js +0 -2
package/dist/sdk/notes.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{EXIT_CODE as a,PmCliError as c,parseLimit as b,stableStringify as E}from"./runtime-primitives.js";import{limitAnnotationEntries as j,parseAnnotationTextInput as A,resolveAnnotationInput as T,runAnnotationCommand as O}from"./annotations.js";function I(t){if(t===void 0)return;if(t.trim().length===0)throw new c("--add-json must contain a JSON value",a.USAGE,{code:"structured_event_json_empty"});let e;try{e=JSON.parse(t)}catch{throw new c("--add-json must be valid JSON",a.USAGE,{code:"structured_event_json_invalid"})}return e}function N(t){if(typeof t!="object"||t===null||Array.isArray(t))return;const e=t.type;return typeof e=="string"&&e.trim().length>0?e.trim():void 0}function x(t){if(t===void 0)return;const e=Date.parse(t);if(!Number.isFinite(e))throw new c("--since must be a valid ISO timestamp",a.USAGE,{code:"structured_event_since_invalid"});return e}function y(t){return Object.prototype.toString.call(t)==="[object Object]"?t:{}}async function F(t,e,_){const r=I(e.addJson),v=[e.add!==void 0,e.stdin===!0,e.file!==void 0,e.edit!==void 0,e.delete!==void 0].includes(!0);if(r!==void 0&&v)throw new c("--add-json cannot be combined with text, edit, delete, stdin, or file inputs",a.USAGE,{code:"structured_event_input_conflict"});const l=r===void 0?void 0:E(r),i=[e.since,e.eventType].some(n=>n!==void 0),f=x(e.since),s=b(e.limit),p=await O(t,{...e,...i?{limit:void 0}:{},includeMeta:[e.includeMeta===!0,i].includes(!0)},_,{input:await T(l===void 0?e:{add:l},"note"),collectionKey:"notes",op:"note_add",editOp:"note_edit",deleteOp:"note_delete",parseText:n=>A(n),createEntry:n=>r===void 0?n:{...n,format:"json",data:r,event_type:N(r)},bypassOwnershipConflict:!![e.edit===void 0,e.delete===void 0,e.ownershipAppendBypass===!0].every(Boolean),conflictGuidance:{required:"Strict ownership also protects annotations. Ask the current owner to run pm release <id>, then run pm claim <id>; use --force only for an explicitly approved override.",examples:["pm claim <id>"],nextSteps:["For an approved append without reassignment: pm package install governance-audit --project; then pm notes --help lists the package-owned append bypass. Edit/delete still require ownership.","For a non-terminal handoff, the current owner runs pm release <id>; then you run pm claim <id> before retrying. Claim refuses work still held by another owner; --force requires an explicitly approved override."]}}),m=e.eventType?.trim(),u=p.notes.filter(n=>{const o=y(n),g=[o.format==="json",o.data!==void 0].every(Boolean),w=[f===void 0,Date.parse(o.created_at??"")>=(f??Number.POSITIVE_INFINITY)].includes(!0),S=[!m,o.event_type===m].includes(!0);return[!i,[g,w,S].every(Boolean)].includes(!0)}),d=i?j(u,s):u,h=d.filter(n=>y(n).format==="json").length;return{...p,notes:d,count:d.length,...i?{total_count:u.length,returned_count:d.length,has_more:d.length<u.length,...s===void 0?{}:{limit:s},structured_event_count:h}:e.includeMeta===!0?{structured_event_count:h}:{}}}export{F as runNotes};
|
|
2
2
|
//# sourceMappingURL=notes.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{estimatePmOutputTokens as g}from"../cli-contracts/agent-output-contracts.js";class p extends RangeError{code;work;minimum_tokens;constructor(e,n,t){super(e),this.name="OutputEnvelopeFitError",this.code=e,this.work=Object.freeze({...n}),this.minimum_tokens=t}}function _(o,e){if(!Number.isSafeInteger(o)||o<1)throw new RangeError(`${e} must be a positive safe integer`)}function k(o,e,n,t){return e.map(([r,l])=>{if(t.render_calls>=t.max_render_calls)throw new p("output_envelope_work_limit",t);t.render_calls+=1;const i=l(o);if(typeof i!="string")throw new TypeError("Envelope renderers must return strings");const s=n(i);if(!Number.isSafeInteger(s)||s<0)throw new RangeError("Envelope token estimates must be non-negative safe integers");return{name:r,text:i,bytes:Buffer.byteLength(i,"utf8"),estimated_tokens:s}})}function b(o,e,n,t){let r=e;const l=Object.entries(n.renderers),i=n.estimateTokens??(s=>g(Buffer.byteLength(s,"utf8")));for(let s=0;s<(n.maxStabilizationPasses??16);s+=1){const a=Object.freeze({...r}),u={...n.buildEnvelope(o,a),output_fit:a},c=k(u,l,i,t),f=Math.max(...c.map(m=>m.bytes)),d=Math.max(...c.map(m=>m.estimated_tokens));if(f===r.output_bytes&&d===r.estimated_tokens)return{envelope:u,renderings:c};r={...r,output_bytes:f,estimated_tokens:d}}throw new p("output_envelope_unstable",t)}function v(o,e){_(e.tokenBudget,"tokenBudget"),_(e.maxRenderCalls??1e4,"maxRenderCalls"),_(e.maxStabilizationPasses??16,"maxStabilizationPasses");const n=e.policy??"prefix";if(n!=="prefix"&&n!=="skip")throw new TypeError("Unknown output envelope fit policy");if(Object.entries(e.renderers).length===0||Object.entries(e.renderers).some(([a,u])=>!a.trim()||typeof u!="function"))throw new TypeError("Envelope fitting requires named callable renderers");const t={evaluated_candidates:0,render_calls:0,max_render_calls:e.maxRenderCalls??1e4};let r=[],l=[];const i=a=>({version:1,policy:n,total_candidates:o.length,included_indices:Object.freeze([...a]),omitted_count:o.length-a.length,token_budget:e.tokenBudget,estimated_tokens:0,output_bytes:0});let s=b(r,i(l),e,t);if(s.envelope.output_fit.estimated_tokens>e.tokenBudget)throw new p("output_envelope_infeasible",t,s.envelope.output_fit.estimated_tokens);for(const[a,u]of o.entries()){t.evaluated_candidates+=1;const c=[...r,u],f=[...l,a],d=b(c,i(f),e,t);if(d.envelope.output_fit.estimated_tokens<=e.tokenBudget)r=c,l=f,s=d;else if(n==="prefix")break}return{rows:r,...s,complete:r.length===o.length,work:Object.freeze({...t})}}export{p as OutputEnvelopeFitError,v as fitOutputEnvelope};
|
|
2
2
|
//# sourceMappingURL=fit-envelope.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function o(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const l=new Set(["brief","compact","fields"]);function p(t){if(!o(t))return!1;const e=t.fields;return l.has(t.mode)&&Object.keys(t).length===2&&Array.isArray(e)&&e.length>0&&e.every(r=>typeof r=="string"&&r.length>0)}function h(t,e){return t.every(r=>o(r)&&Object.keys(r).length===e.fields.length&&e.fields.every(n=>Object.hasOwn(r,n)))}function g(t,e){return t.mode==="fields"&&e===0?{projection:t}:{}}function y(t,e){return typeof t.has_more=="boolean"&&t.truncated===t.has_more&&t.count===e&&typeof t.total=="number"&&Number.isSafeInteger(t.total)&&(t.has_more?t.total>e&&typeof t.next_cursor=="string"&&t.next_cursor.length>0:t.total===e&&t.next_cursor==null)}function A(t){return o(t)&&(t.status==="complete"||t.status==="unchecked")&&t.unreadable_item_count===0&&t.unreadable_directory_count===0}function m(t,e="full_item_fields"){if(!o(t)||!Array.isArray(t.omitted_field_groups))return!1;const r=t.omitted_field_groups,n=r[0];return t.has_omissions===!0&&t.omitted_field_group_count===1&&Object.keys(t).length===3&&r.length===1&&o(n)&&Object.keys(n).length===2&&n.name===e&&n.restore_with==="--full"}function B(t){if(!o(t)||!Array.isArray(t.items)||Object.hasOwn(t,"details")||!p(t.projection)||!h(t.items,t.projection)||!A(t.completeness)||!y(t,t.items.length)||!m(t.omission_receipt))return t;const{total:e,has_more:r,truncated:n,next_cursor:i,completeness:s,projection:f,now:c,omission_receipt:d,sorting:u,filters:a,..._}=t,O=s.status==="complete"&&!r&&Object.keys(s).length===3,{unreadable_item_count:D,unreadable_directory_count:R,...b}=s;return{..._,...O?{}:{total:e,has_more:r,completeness:b},...r?{next_cursor:i}:{},...P(u),...j(a,_.applied_limit,f),...g(f,t.items.length),details:"--full"}}function S(t){return o(t)&&t.sort==="default"&&t.order==="asc"&&Object.keys(t).every(e=>e==="sort"||e==="order"||e==="effective_keys")}function w(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&(t[1]==="asc"||t[1]==="desc")}function P(t){if(!S(t))return{sorting:t};const e=t.effective_keys;return e===void 0?{}:!Array.isArray(e)||!e.every(w)?{sorting:t}:{sorting:{effective_keys:e.map(([r,n])=>`${r} ${n}`).join(", ")}}}function k(t,e){if(typeof t!="string"||e===void 0)return!1;const r=t.split(",").map(n=>n.trim()).filter(Boolean);return r.length===e.fields.length&&r.every((n,i)=>n===e.fields[i])}function j(t,e,r){if(!o(t))return t===void 0?{}:{filters:t};const n=Object.fromEntries(Object.entries(t).filter(([i,s])=>!(i==="limit"&&String(s)===String(e))&&!(i==="fields"&&k(s,r))&&!(i==="runtime_filters"&&o(s)&&Object.keys(s).length===0)));return Object.keys(n).length===0?{}:{filters:n}}function x(t,e){return t.count===e&&!Object.hasOwn(t,"has_more")&&!Object.hasOwn(t,"truncated")&&t.next_cursor==null&&(t.total===void 0||t.total===e)}function E(t){if(!Object.hasOwn(t,"projection"))return m(t.omission_receipt,"projection_metadata")?{}:void 0;const e=t.projection;return p(e)&&e.mode==="fields"&&h(t.items,e)&&typeof t.now=="string"&&m(t.omission_receipt)?{projection:e}:void 0}function C(t){if(!o(t)||typeof t.query!="string"||!Array.isArray(t.items)||Object.hasOwn(t,"details")||!(y(t,t.items.length)||x(t,t.items.length)))return t;const e=E(t);if(e===void 0)return t;const{truncated:r,omission_receipt:n,filters:i,projection:s,now:f,mode_source:c,...d}=t;return{...d,...c==="settings"||e.projection===void 0&&c!==void 0?{mode_source:c}:{},...j(i,d.applied_limit,e.projection),...e.projection?g(e.projection,t.items.length):{},details:"--full"}}export{B as projectPmBriefListEnvelope,C as projectPmBriefSearchEnvelope};
|
|
2
2
|
//# sourceMappingURL=list-envelope.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function O(s,u={}){const c=[...new Set(s.flatMap(e=>Object.keys(e)))],f=u.compact?c.filter(e=>s.every(a=>Object.hasOwn(a,e)&&a[e]===null)):[],n=u.compact?c.filter(e=>s.every(a=>{if(!Object.hasOwn(a,e))return!0;const o=a[e];return Array.isArray(o)&&o.every(m=>typeof m=="string"&&m!==""&&!m.includes(";"))})):[],l=new Set(n),t=new Set(f),r=c.filter(e=>!l.has(e)&&s.some(a=>{const o=a[e];return o!==null&&typeof o=="object"})),i=new Set(r),p=[];return{rows:s.map((e,a)=>Object.fromEntries(c.filter(o=>!t.has(o)).map(o=>{if(!Object.hasOwn(e,o))return p.push([a,o]),[o,null];const m=e[o];return l.has(o)?[o,m.join(";")]:[o,i.has(o)?JSON.stringify(m):m]}))),encoding:{json_columns:r,absent:p,...n.length?{list_columns:Object.fromEntries(n.map(e=>[e,";"]))}:{},...f.length?{null_columns:f,null_column_index:f.map(e=>c.indexOf(e))}:{}}}}function j(s){const{json_columns:u,absent:c,...f}=s,n=new Map;for(const[l,t]of c){const r=n.get(t)??[];r.push(l),n.set(t,r)}return{...u.length>0?{json_columns:u}:{},...n.size>0?{absent_rows:Object.fromEntries(n)}:{},...f}}function g(s,u){const c=u.null_columns??[],f=u.null_column_index??[],n=[...s],l=c.map((t,r)=>({column:t,position:f[r]})).filter(t=>typeof t.position=="number").sort((t,r)=>t.position-r.position);for(const{column:t,position:r}of l)n.splice(Math.min(r,n.length),0,t);for(const t of c)n.includes(t)||n.push(t);return n}function h(s){const u=new Set(s.encoding.json_columns??[]),c=new Map(Object.entries(s.encoding.list_columns??{})),f=new Set([...(s.encoding.absent??[]).map(([n,l])=>JSON.stringify([n,l])),...Object.entries(s.encoding.absent_rows??{}).flatMap(([n,l])=>l.map(t=>JSON.stringify([t,n])))]);return s.rows.map((n,l)=>{const t=new Map(Object.entries(n).flatMap(([i,p])=>{if(f.has(JSON.stringify([l,i])))return[];const d=c.get(i),e=d!==void 0?p===""?[]:String(p).split(d):u.has(i)?JSON.parse(String(p)):p;return[[i,e]]}));for(const i of s.encoding.null_columns??[])t.set(i,null);const r=s.encoding.column_order??g(Object.keys(n),s.encoding);return Object.fromEntries(r.filter(i=>t.has(i)).map(i=>[i,t.get(i)]))})}export{h as decodePmTableRows,O as encodePmTableRows,j as projectPmTableEncodingForToon};
|
|
2
2
|
//# sourceMappingURL=table-rows.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{resolvePmHistoryOperation as s}from"./cli-contracts/command-aliases.js";import{PM_CORE_COMMAND_NAMES as i}from"./cli-contracts/enum-contracts.js";const c=["mutation_receipt","entity","collection","diagnostic","stream"],d=new Set(["append","claim","close","close-task","copy","create","delete","focus","pause-task","release","restore","start-task","update"]),p=new Set(["close-many","update-many"]),m=new Set(["activity","comments","contracts","events","history","learnings","list","notes","search"]),l=new Set(["aggregate","deps","graph","health","history-redact","history-repair","history-compact","stats","validate"]);function o(e){if(e.command.trim().length===0)throw new TypeError("command must be a non-empty command path");if(!c.includes(e.kind))throw new TypeError(`Unsupported output envelope kind: ${e.kind}`);return e}function a(e){const t=e.trim().replace(/\s+/gu," "),[n=t]=t.split(" ");return p.has(n)?o({command:t,kind:"collection",wrapper_key:"rows",cardinality:"many",format_flag:"--json"}):d.has(n)?o({command:t,kind:"mutation_receipt",wrapper_key:null,cardinality:"one",format_flag:"--json"}):m.has(n)?o({command:t,kind:"collection",wrapper_key:n==="contracts"?null:"items",cardinality:"many",format_flag:"--json"}):l.has(n)?o({command:t,kind:"diagnostic",wrapper_key:null,cardinality:"none",format_flag:"--json"}):o({command:t,kind:n==="get"?"entity":"diagnostic",wrapper_key:n==="get"?"item":null,cardinality:n==="get"?"one":"none",format_flag:"--json"})}const u=i.map(e=>a(e)),f=new Map(u.map(e=>[e.command,e]));function O(e){const t=e.trim().replace(/\s+/gu," ");if(t.length===0)throw new TypeError("command must be a non-empty command path");const[n=t]=s(t).split(" "),r=f.get(n);return r?{...r,command:t}:a(t)}function y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _(e){return y(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.status=="string"&&e.status.length>0&&Number.isSafeInteger(e.changed_field_count)&&Number(e.changed_field_count)>=0&&(e.close_reason===void 0||typeof e.close_reason=="string")&&(e.deleted===void 0||typeof e.deleted=="boolean")&&(e.previous_status===void 0||typeof e.previous_status=="string")&&(e.warnings===void 0||Array.isArray(e.warnings))}function w(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(n){throw new TypeError(`Mutation receipt must be valid JSON: ${String(n)}`,{cause:n})}if(!_(t))throw new TypeError("Mutation receipt must be a flat object with top-level id, status, and changed_field_count fields");return{id:t.id,status:t.status,changedFieldCount:t.changed_field_count,...typeof t.close_reason=="string"?{closeReason:t.close_reason}:{},...typeof t.deleted=="boolean"?{deleted:t.deleted}:{},...typeof t.previous_status=="string"?{previousStatus:t.previous_status}:{},...Array.isArray(t.warnings)?{warnings:t.warnings}:{}}}export{u as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,c as PM_OUTPUT_ENVELOPE_KINDS,o as definePmCommandOutputEnvelope,_ as isPmMutationReceipt,w as parseMutationReceipt,O as resolvePmCommandOutputEnvelope};
|
|
2
2
|
//# sourceMappingURL=output-contracts.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]="a65d6520-0e6f-5627-a4dd-bd455c2db0fa")}catch{}})();import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";const MATERIAL_FIELD_GROUPS_BY_RESULT=new WeakMap;function registerOutputMaterialFieldGroups(result,fieldGroups){MATERIAL_FIELD_GROUPS_BY_RESULT.set(result,new Set(fieldGroups))}const PM_READ_ROW_JQ_SELECTOR='.row_contract.row_keys[] as $key | getpath($key | split(".")) | if type == "array" then .[] else if type == "object" then to_entries[] else empty end end',PM_READ_ROW_CONTRACTS={context:{row_keys:["high_level","low_level"],fields:"supported"},get:{row_keys:["children"],fields:"supported"},list:{row_keys:["items"],fields:"supported"},next:{row_keys:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],fields:"unsupported"},search:{row_keys:["items"],fields:"supported"},activity:{row_keys:["activity_digest","compact_activity","provenance_activity","activity"],fields:"unsupported"},history:{row_keys:["compact_history","provenance_history","history","diff"],fields:"unsupported"},deps:{row_keys:["graph.nodes","graph.edges","context.nodes","context.edges"],fields:"unsupported"},health:{row_keys:["checks"],fields:"unsupported"},aggregate:{row_keys:["groups"],fields:"unsupported"},duplicates:{row_keys:["clusters"],fields:"unsupported"},stats:{row_keys:["by_type","by_status"],fields:"unsupported"},comments:{row_keys:["comments"],fields:"unsupported"},notes:{row_keys:["notes"],fields:"unsupported"},learnings:{row_keys:["learnings"],fields:"unsupported"},files:{row_keys:["files"],fields:"unsupported"},docs:{row_keys:["docs"],fields:"unsupported"},validate:{row_keys:["checks","warnings"],fields:"unsupported"},contracts:{row_keys:["command_summaries","commands"],fields:"unsupported"}},PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS=[{command:"activity",complete_mode:"full",omissions_by_mode:{digest:[{name:"event_rows",restore_with:"--raw"}],compact:[{name:"provenance",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}},{command:"history",complete_mode:"full",omissions_by_mode:{compact:[{name:"raw_history",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}}];function assertProjectionModeChoice(compactRequested,fullRequested,compactFlag){if(compactRequested&&fullRequested)throw new PmCliError(`${compactFlag} cannot be combined with --full`,EXIT_CODE.USAGE)}function createOutputOmissionReceipt(declaredGroups,includedGroupNames=new Set){const omittedFieldGroups=declaredGroups.filter(group=>!includedGroupNames.has(group.name)).map(group=>({...group}));return{has_omissions:omittedFieldGroups.length>0,omitted_field_group_count:omittedFieldGroups.length,omitted_field_groups:omittedFieldGroups}}function resolveModePairedOutputOmissionReceipt(command,mode){const contract=PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS.find(candidate=>candidate.command===command);if(contract===void 0)throw new TypeError(`Unknown mode-paired output command: ${command}`);if(mode===contract.complete_mode)return createOutputOmissionReceipt([]);const groups=contract.omissions_by_mode[mode];if(groups===void 0)throw new TypeError(`Unknown ${command} output mode: ${mode}`);return createOutputOmissionReceipt(groups)}const CONTEXT_FIELD_GROUPS=[{name:"hierarchy",restore_with:"--section hierarchy"},{name:"activity",restore_with:"--section activity"},{name:"progress",restore_with:"--section progress"},{name:"blockers",restore_with:"--section blockers"},{name:"recently_created",restore_with:"--section recently_created"},{name:"unparented",restore_with:"--section unparented"},{name:"files",restore_with:"--section files"},{name:"workload",restore_with:"--section workload"},{name:"staleness",restore_with:"--section staleness"},{name:"tests",restore_with:"--section tests"}];function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}const READ_ROW_TOON_ENCODINGS=new Set([void 0,"tabular_when_uniform"]),READ_ROW_KINDS=new Set(["collection","none"]),READ_ROW_FIELD_MODES=new Set(["supported","unsupported"]);function isUniqueNonEmptyStringArray(value,allowEmpty){return Array.isArray(value)&&(allowEmpty||value.length>0)&&value.every(entry=>typeof entry=="string"&&entry.length>0)&&new Set(value).size===value.length}function isReadRowContract(value){return isRecord(value)&&typeof value.command=="string"&&value.command.trim().length>0&&READ_ROW_KINDS.has(value.row_kind)&&isUniqueNonEmptyStringArray(value.row_keys,!0)&&(value.continuation_row_keys===void 0||isUniqueNonEmptyStringArray(value.continuation_row_keys,!1))&&READ_ROW_FIELD_MODES.has(value.fields)&&READ_ROW_TOON_ENCODINGS.has(value.toon_encoding)&&(value.row_kind==="collection"?value.row_keys.length>0&&typeof value.jq_selector=="string"&&value.jq_selector.trim().length>0:value.row_keys.length===0&&value.jq_selector===void 0)}const GRAPH_ROW_KEYS={ancestors:["ids"],descendants:["ids"],predecessors:["ids"],successors:["ids"],paths:["paths"],impact:["affected"],audit:["findings"],communities:["communities"],redundancy:["redundant"],dominators:["bottlenecks"],slack:["rows"],centrality:["rows"],articulation:["articulation_points","bridges"],plan:["steps"]},READ_RESULT_SENTINEL_KEYS={context:["sections_included","high_level","low_level"],get:["item"],list:["items","projection"],next:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items","projection"],activity:["activity_digest","compact_activity","provenance_activity","activity"],history:["compact_history","provenance_history","history","diff"],deps:["tree","graph","projection"],health:["checks"],aggregate:["groups"],duplicates:["clusters"],stats:["totals","by_type","by_status"],comments:["comments"],notes:["notes"],learnings:["learnings"],files:["files"],docs:["docs"],validate:["checks","warnings"],contracts:["command_summaries","commands","selected"]};function resolveReadRowContract(command,result){const rawRootCommand=command.trim().toLowerCase().split(/\s+/u,1)[0],rootCommand=rawRootCommand?.startsWith("list-")?"list":rawRootCommand;if(rootCommand==="graph"){const subcommand=typeof result.subcommand=="string"?result.subcommand:"";if(subcommand.length===0)return;const rowKeys=GRAPH_ROW_KEYS[subcommand];if(rowKeys===void 0)return;const activeRowKeys=rowKeys.filter(key=>Array.isArray(result[key])||isRecord(result[key]));return{command:"graph",row_kind:activeRowKeys.length>0?"collection":"none",row_keys:activeRowKeys,fields:"unsupported",...activeRowKeys.length>0?{jq_selector:PM_READ_ROW_JQ_SELECTOR}:{},toon_encoding:"tabular_when_uniform"}}const declaration=PM_READ_ROW_CONTRACTS[rootCommand],sentinelKeys=READ_RESULT_SENTINEL_KEYS[rootCommand];return declaration===void 0||sentinelKeys===void 0||!sentinelKeys.some(key=>Object.hasOwn(result,key))?void 0:(()=>{const rowKeys=declaration.row_keys.filter(key=>{const value=key.split(".").reduce((current,segment)=>isRecord(current)?current[segment]:void 0,result);return Array.isArray(value)||isRecord(value)});return{command:rootCommand,row_kind:rowKeys.length>0?"collection":"none",row_keys:rowKeys,fields:declaration.fields,...rowKeys.length>0?{jq_selector:PM_READ_ROW_JQ_SELECTOR}:{},toon_encoding:"tabular_when_uniform"}})()}function resolveDeclaredProjectionReceipt(result){if(!isRecord(result.projection)||typeof result.projection.mode!="string"||result.projection.mode.trim().length===0)return;const declared=result.projection.declared_field_groups,included=result.projection.included_field_groups;if(!Array.isArray(declared)||!Array.isArray(included))return;const declaredGroups=declared.filter(entry=>isRecord(entry)&&typeof entry.name=="string"&&entry.name.trim().length>0&&typeof entry.restore_with=="string"&&entry.restore_with.trim().length>0),includedNames=included.filter(entry=>typeof entry=="string");if(declaredGroups.length!==declared.length||includedNames.length!==included.length)return;const declaredNames=new Set(declaredGroups.map(group=>group.name));if(!(declaredNames.size!==declaredGroups.length||new Set(includedNames).size!==includedNames.length||includedNames.some(name=>!declaredNames.has(name))))return createOutputOmissionReceipt(declaredGroups,new Set(includedNames))}function resolveContextReceipt(result){if(!Array.isArray(result.sections_included))return;const receipt=createOutputOmissionReceipt(CONTEXT_FIELD_GROUPS,new Set(result.sections_included.filter(section=>typeof section=="string")));return isRecord(result.summary)&&result.summary.scope==="matching_items"&&(receipt.summary_scope="matching_items"),receipt}function isGetFieldGroupIncluded(name,owner,result){if(name==="dependency_provenance")return!1;const nested=splitNestedGetGroup(name);if(nested!==void 0){const facet=result[nested.facet];return isRecord(facet)&&Object.hasOwn(facet,nested.member)}return Object.hasOwn(owner,name)||(name==="reminders"||name==="events")&&isRecord(result.schedule)&&Object.hasOwn(result.schedule,name)||["files","tests","docs"].includes(name)&&isRecord(result.linked)&&Array.isArray(result.linked[name])&&result.linked[name].length>0}function splitNestedGetGroup(name){const dot=name.indexOf(".");return dot===-1?void 0:{facet:name.slice(0,dot),member:name.slice(dot+1)}}function resolveGetReceipt(result){if(!isRecord(result.item))return;const item=result.item,itemGroups=["comments","notes","learnings","files","tests","docs","reminders","events"],resultGroups=["body","children","claim_state","linked","schedule"],materialGroups=MATERIAL_FIELD_GROUPS_BY_RESULT.get(result),ownerFor=name=>itemGroups.includes(name)||name==="body"||name==="dependency_provenance"?item:result,groups=["body",...itemGroups,...resultGroups.slice(1),...materialGroups?.has("dependency_provenance")?["dependency_provenance"]:[],...materialGroups?.has("blockers")||Object.hasOwn(result,"blockers")?["blockers"]:[],...[...materialGroups??[]].filter(name=>splitNestedGetGroup(name)!==void 0)].filter(name=>materialGroups===void 0||materialGroups.has(name)||Object.hasOwn(ownerFor(name),name)).map(name=>({name,restore_with:name==="blockers"?"--full":name==="dependency_provenance"?"--fields dependencies":`--fields ${name}`}));return createOutputOmissionReceipt(groups,new Set(groups.flatMap(({name})=>isGetFieldGroupIncluded(name,ownerFor(name),result)?[name]:[])))}function resolveListOrSearchReceipt(result){if(isRecord(result.projection))return createOutputOmissionReceipt([{name:"full_item_fields",restore_with:"--full"}],new Set(result.projection.mode==="full"?["full_item_fields"]:[]))}function resolveHealthReceipt(result){if(!isRecord(result.projection))return createOutputOmissionReceipt([]);if(typeof result.projection.mode=="string")return createOutputOmissionReceipt([{name:"full_check_details",restore_with:"--full"}],new Set(result.projection.mode==="full"?["full_check_details"]:[]))}function resolveContractsReceipt(result){if(!(!isRecord(result.selected)||typeof result.selected.summary!="boolean"))return createOutputOmissionReceipt([{name:"full_contract_catalog",restore_with:"--full"}],new Set(result.selected.summary?[]:["full_contract_catalog"]))}function resolveOutputOmissionReceipt(command,result){const declaredReceipt=resolveDeclaredProjectionReceipt(result);if(declaredReceipt!==void 0)return declaredReceipt;const[rootCommand]=command.split(/\s+/u,1);if(rootCommand==="context")return resolveContextReceipt(result);if(rootCommand==="get")return resolveGetReceipt(result);if(rootCommand==="list"||rootCommand.startsWith("list-"))return resolveListOrSearchReceipt(result);if(rootCommand==="search")return resolveListOrSearchReceipt(result)??createOutputOmissionReceipt([{name:"projection_metadata",restore_with:"--full"}]);if(rootCommand==="health")return resolveHealthReceipt(result);if(rootCommand==="contracts")return resolveContractsReceipt(result)}function attachOutputOmissionReceipt(command,result){if(command===void 0||!isRecord(result))return result;const receipt=resolveOutputOmissionReceipt(command,result),declaredRowContract=result.row_contract,rowContract=isReadRowContract(declaredRowContract)?declaredRowContract:resolveReadRowContract(command,result),disclosedResult=rowContract!==void 0?{...result,row_contract:rowContract}:Object.hasOwn(result,"row_contract")?Object.fromEntries(Object.entries(result).filter(([key])=>key!=="row_contract")):result;return isRecord(disclosedResult.omission_receipt)||receipt===void 0?disclosedResult:{...disclosedResult,omission_receipt:receipt}}export{PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,PM_READ_ROW_CONTRACTS,PM_READ_ROW_JQ_SELECTOR,assertProjectionModeChoice,attachOutputOmissionReceipt,createOutputOmissionReceipt,isReadRowContract,registerOutputMaterialFieldGroups,resolveModePairedOutputOmissionReceipt,resolveOutputOmissionReceipt,resolveReadRowContract};
|
|
1
|
+
import{EXIT_CODE as w}from"../core/shared/constants.js";import{PmCliError as g}from"../core/shared/errors.js";const _=new WeakMap;function U(e,t){_.set(e,new Set(t))}const f='.row_contract.row_keys[] as $key | getpath($key | split(".")) | if type == "array" then .[] else if type == "object" then to_entries[] else empty end end',k={context:{row_keys:["high_level","low_level"],fields:"supported"},get:{row_keys:["children"],fields:"supported"},list:{row_keys:["items"],fields:"supported"},next:{row_keys:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],fields:"unsupported"},search:{row_keys:["items"],fields:"supported"},activity:{row_keys:["activity_digest","compact_activity","provenance_activity","activity"],fields:"unsupported"},history:{row_keys:["compact_history","provenance_history","history","diff"],fields:"unsupported"},deps:{row_keys:["graph.nodes","graph.edges","context.nodes","context.edges"],fields:"unsupported"},health:{row_keys:["checks"],fields:"unsupported"},aggregate:{row_keys:["groups"],fields:"unsupported"},duplicates:{row_keys:["clusters"],fields:"unsupported"},stats:{row_keys:["by_type","by_status"],fields:"unsupported"},comments:{row_keys:["comments"],fields:"unsupported"},notes:{row_keys:["notes"],fields:"unsupported"},learnings:{row_keys:["learnings"],fields:"unsupported"},files:{row_keys:["files"],fields:"unsupported"},docs:{row_keys:["docs"],fields:"unsupported"},validate:{row_keys:["checks","warnings"],fields:"unsupported"},contracts:{row_keys:["command_summaries","commands"],fields:"unsupported"}},O=[{command:"activity",complete_mode:"full",omissions_by_mode:{digest:[{name:"event_rows",restore_with:"--raw"}],compact:[{name:"provenance",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}},{command:"history",complete_mode:"full",omissions_by_mode:{compact:[{name:"raw_history",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}}];function W(e,t,n){if(e&&t)throw new g(`${n} cannot be combined with --full`,w.USAGE)}function a(e,t=new Set){const n=e.filter(o=>!t.has(o.name)).map(o=>({...o}));return{has_omissions:n.length>0,omitted_field_group_count:n.length,omitted_field_groups:n}}function F(e,t){const n=O.find(s=>s.command===e);if(n===void 0)throw new TypeError(`Unknown mode-paired output command: ${e}`);if(t===n.complete_mode)return a([]);const o=n.omissions_by_mode[t];if(o===void 0)throw new TypeError(`Unknown ${e} output mode: ${t}`);return a(o)}const b=[{name:"hierarchy",restore_with:"--section hierarchy"},{name:"activity",restore_with:"--section activity"},{name:"progress",restore_with:"--section progress"},{name:"blockers",restore_with:"--section blockers"},{name:"recently_created",restore_with:"--section recently_created"},{name:"unparented",restore_with:"--section unparented"},{name:"files",restore_with:"--section files"},{name:"workload",restore_with:"--section workload"},{name:"staleness",restore_with:"--section staleness"},{name:"tests",restore_with:"--section tests"}];function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const R=new Set([void 0,"tabular_when_uniform"]),j=new Set(["collection","none"]),E=new Set(["supported","unsupported"]);function u(e,t){return Array.isArray(e)&&(t||e.length>0)&&e.every(n=>typeof n=="string"&&n.length>0)&&new Set(e).size===e.length}function A(e){return c(e)&&typeof e.command=="string"&&e.command.trim().length>0&&j.has(e.row_kind)&&u(e.row_keys,!0)&&(e.continuation_row_keys===void 0||u(e.continuation_row_keys,!1))&&E.has(e.fields)&&R.has(e.toon_encoding)&&(e.row_kind==="collection"?e.row_keys.length>0&&typeof e.jq_selector=="string"&&e.jq_selector.trim().length>0:e.row_keys.length===0&&e.jq_selector===void 0)}const S={ancestors:["ids"],descendants:["ids"],predecessors:["ids"],successors:["ids"],paths:["paths"],impact:["affected"],audit:["findings"],communities:["communities"],redundancy:["redundant"],dominators:["bottlenecks"],slack:["rows"],centrality:["rows"],articulation:["articulation_points","bridges"],plan:["steps"]},v={context:["sections_included","high_level","low_level"],get:["item"],list:["items","projection"],next:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items","projection"],activity:["activity_digest","compact_activity","provenance_activity","activity"],history:["compact_history","provenance_history","history","diff"],deps:["tree","graph","projection"],health:["checks"],aggregate:["groups"],duplicates:["clusters"],stats:["totals","by_type","by_status"],comments:["comments"],notes:["notes"],learnings:["learnings"],files:["files"],docs:["docs"],validate:["checks","warnings"],contracts:["command_summaries","commands","selected"]};function C(e,t){const n=e.trim().toLowerCase().split(/\s+/u,1)[0],o=n?.startsWith("list-")?"list":n;if(o==="graph"){const r=typeof t.subcommand=="string"?t.subcommand:"";if(r.length===0)return;const i=S[r];if(i===void 0)return;const l=i.filter(p=>Array.isArray(t[p])||c(t[p]));return{command:"graph",row_kind:l.length>0?"collection":"none",row_keys:l,fields:"unsupported",...l.length>0?{jq_selector:f}:{},toon_encoding:"tabular_when_uniform"}}const s=k[o],d=v[o];return s===void 0||d===void 0||!d.some(r=>Object.hasOwn(t,r))?void 0:(()=>{const r=s.row_keys.filter(i=>{const l=i.split(".").reduce((p,y)=>c(p)?p[y]:void 0,t);return Array.isArray(l)||c(l)});return{command:o,row_kind:r.length>0?"collection":"none",row_keys:r,fields:s.fields,...r.length>0?{jq_selector:f}:{},toon_encoding:"tabular_when_uniform"}})()}function x(e){if(!c(e.projection)||typeof e.projection.mode!="string"||e.projection.mode.trim().length===0)return;const t=e.projection.declared_field_groups,n=e.projection.included_field_groups;if(!Array.isArray(t)||!Array.isArray(n))return;const o=t.filter(r=>c(r)&&typeof r.name=="string"&&r.name.trim().length>0&&typeof r.restore_with=="string"&&r.restore_with.trim().length>0),s=n.filter(r=>typeof r=="string");if(o.length!==t.length||s.length!==n.length)return;const d=new Set(o.map(r=>r.name));if(!(d.size!==o.length||new Set(s).size!==s.length||s.some(r=>!d.has(r))))return a(o,new Set(s))}function T(e){if(!Array.isArray(e.sections_included))return;const t=a(b,new Set(e.sections_included.filter(n=>typeof n=="string")));return c(e.summary)&&e.summary.scope==="matching_items"&&(t.summary_scope="matching_items"),t}function D(e,t,n){if(e==="dependency_provenance")return!1;const o=m(e);if(o!==void 0){const s=n[o.facet];return c(s)&&Object.hasOwn(s,o.member)}return Object.hasOwn(t,e)||(e==="reminders"||e==="events")&&c(n.schedule)&&Object.hasOwn(n.schedule,e)||["files","tests","docs"].includes(e)&&c(n.linked)&&Array.isArray(n.linked[e])&&n.linked[e].length>0}function m(e){const t=e.indexOf(".");return t===-1?void 0:{facet:e.slice(0,t),member:e.slice(t+1)}}function G(e){if(!c(e.item))return;const t=e.item,n=["comments","notes","learnings","files","tests","docs","reminders","events"],o=["body","children","claim_state","linked","schedule"],s=_.get(e),d=i=>n.includes(i)||i==="body"||i==="dependency_provenance"?t:e,r=["body",...n,...o.slice(1),...s?.has("dependency_provenance")?["dependency_provenance"]:[],...s?.has("blockers")||Object.hasOwn(e,"blockers")?["blockers"]:[],...[...s??[]].filter(i=>m(i)!==void 0)].filter(i=>s===void 0||s.has(i)||Object.hasOwn(d(i),i)).map(i=>({name:i,restore_with:i==="blockers"?"--full":i==="dependency_provenance"?"--fields dependencies":`--fields ${i}`}));return a(r,new Set(r.flatMap(({name:i})=>D(i,d(i),e)?[i]:[])))}function h(e){if(c(e.projection))return a([{name:"full_item_fields",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_item_fields"]:[]))}function N(e){if(!c(e.projection))return a([]);if(typeof e.projection.mode=="string")return a([{name:"full_check_details",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_check_details"]:[]))}function P(e){if(!(!c(e.selected)||typeof e.selected.summary!="boolean"))return a([{name:"full_contract_catalog",restore_with:"--full"}],new Set(e.selected.summary?[]:["full_contract_catalog"]))}function I(e,t){const n=x(t);if(n!==void 0)return n;const[o]=e.split(/\s+/u,1);if(o==="context")return T(t);if(o==="get")return G(t);if(o==="list"||o.startsWith("list-"))return h(t);if(o==="search")return h(t)??a([{name:"projection_metadata",restore_with:"--full"}]);if(o==="health")return N(t);if(o==="contracts")return P(t)}function K(e,t){if(e===void 0||!c(t))return t;const n=I(e,t),o=t.row_contract,s=A(o)?o:C(e,t),d=s!==void 0?{...t,row_contract:s}:Object.hasOwn(t,"row_contract")?Object.fromEntries(Object.entries(t).filter(([r])=>r!=="row_contract")):t;return c(d.omission_receipt)||n===void 0?d:{...d,omission_receipt:n}}export{O as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,k as PM_READ_ROW_CONTRACTS,f as PM_READ_ROW_JQ_SELECTOR,W as assertProjectionModeChoice,K as attachOutputOmissionReceipt,a as createOutputOmissionReceipt,A as isReadRowContract,U as registerOutputMaterialFieldGroups,F as resolveModePairedOutputOmissionReceipt,I as resolveOutputOmissionReceipt,C as resolveReadRowContract};
|
|
2
2
|
//# sourceMappingURL=output-projection.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{estimatePmOutputTokens as l}from"./cli-contracts/agent-output-contracts.js";const u=["result_rows","envelope","diagnostics","hints"],p=/^(?:items|results|rows|ready|blocked|recommended|decision_needed|children|dependencies|events|matches|commands|tools)$/u,y=/^(?:diagnostics|errors?|warnings?|findings|violations|failures?)$/u,m=/^(?:hints?|suggestions?|next_steps?|recovery|remediation|examples?)$/u,g=8;function _(e){return Buffer.byteLength(e,"utf8")}function f(e){return _(JSON.stringify(e)??"null")}function v(e,t){return y.test(e)?"diagnostics":m.test(e)?"hints":p.test(e)||Array.isArray(t)?"result_rows":"envelope"}function b(e){const t={result_rows:0,envelope:0,diagnostics:0,hints:0};if(typeof e!="object"||e===null||Array.isArray(e))return t[Array.isArray(e)?"result_rows":"envelope"]=f(e),t;for(const[s,c]of Object.entries(e))t[v(s,c)]+=f({[s]:c});return Object.values(t).every(s=>s===0)&&(t.envelope=1),t}function A(e,t){const s=u.reduce((n,o)=>n+t[o],0),c=u.map(n=>({section:n,value:e*t[n]/s})),a={result_rows:0,envelope:0,diagnostics:0,hints:0};for(const n of c)a[n.section]=Math.floor(n.value);let i=e-u.reduce((n,o)=>n+a[o],0);for(const n of[...c].sort((o,r)=>r.value-Math.floor(r.value)-(o.value-Math.floor(o.value))||u.indexOf(o.section)-u.indexOf(r.section))){if(i===0)break;a[n.section]+=1,i-=1}return a}function d(e,t){return typeof e=="object"&&e!==null&&!Array.isArray(e)?{...e,token_accounting:t}:{result:e,token_accounting:t}}function O(e,t){const s=_(t(e)),c=A(s,b(e)),a=Object.fromEntries(u.map(o=>[o,{bytes:c[o],estimated_tokens:l(c[o])}]));let i={version:1,measurement_scope:"output_before_token_accounting",estimator:"ceil(utf8_bytes / 4)",total_bytes:s,total_estimated_tokens:l(s),sections:a,accounting_receipt_bytes:0,accounting_receipt_estimated_tokens:0,excluded_fields:["token_accounting"],section_allocation:"proportional_canonical_json"},n=d(e,i);for(let o=0;o<g;o+=1){const r=_(t(n))-s;if(r===i.accounting_receipt_bytes)return n;i={...i,accounting_receipt_bytes:r,accounting_receipt_estimated_tokens:l(r)},n=d(e,i)}return n}export{O as attachOutputTokenAccounting};
|
|
2
2
|
//# sourceMappingURL=output-token-accounting.js.map
|
package/dist/sdk/output.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
`)}function
|
|
1
|
+
import{SUPPRESS_HOST_OUTPUT_MARKER as a,isHostOutputSuppressed as u,suppressHostOutput as c}from"../core/output/output-control.js";import{encodePmTableRows as f,decodePmTableRows as y}from"./output/table-rows.js";import{projectPmBriefListEnvelope as N,projectPmBriefSearchEnvelope as S}from"./output/list-envelope.js";import{assertWellFormedOutputText as j,toWellFormedText as O}from"../core/shared/output-unicode.js";function s(t){return t.map((e,o)=>{if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError(`NDJSON row ${o} must be a non-null object.`);const r=JSON.stringify(e);if(r===void 0)throw new TypeError(`NDJSON row ${o} must serialize to a non-null object.`);const n=JSON.parse(r);if(typeof n!="object"||n===null||Array.isArray(n))throw new TypeError(`NDJSON row ${o} must serialize to a non-null object.`);return r}).join(`
|
|
2
|
+
`)}function p(t,e){if(e.count!==t.length)throw new TypeError(`NDJSON trailer count ${e.count} does not match ${t.length} ${t.length===1?"row":"rows"}.`);for(const[o,r]of t.entries())if(typeof r=="object"&&r!==null&&!Array.isArray(r)&&Reflect.get(r,"record_type")==="pm.stream.trailer")throw new TypeError(`NDJSON row ${o} uses reserved record_type pm.stream.trailer`);return s([...t,{...e,record_type:"pm.stream.trailer"}])}export{a as SUPPRESS_HOST_OUTPUT_MARKER,j as assertWellFormedOutputText,y as decodePmTableRows,f as encodePmTableRows,u as isHostOutputSuppressed,N as projectPmBriefListEnvelope,S as projectPmBriefSearchEnvelope,s as serializeNdjsonRows,p as serializeNdjsonStream,c as suppressHostOutput,O as toWellFormedText};
|
|
3
3
|
//# sourceMappingURL=output.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{readHistoryEntries as h}from"../core/history/read.js";import{getWorkspaceHistoryPath as m,WORKSPACE_HISTORY_ID as y}from"../core/history/workspace-history.js";import{redactIdentityCredentials as v}from"../core/shared/url-credentials.js";import{getHistoryPath as w}from"../core/store/paths.js";import{STALE_WORK_THRESHOLD_SETTING as A,isJudgeableHistoryRecord as g,isWellFormedHistoryRecord as b,latestHistoryTimestamp as E,normalizeStaleWorkThresholdHours as H,recordedBaselineActivity as O,resolveLastActivityAt as S,staleEligibleAt as I,unprovenClaimActivity as C,wholeHoursSince as f}from"./governance/stale-work.js";function T(r,n,e){const a=(e.now??new Date).getTime(),t=H(e.threshold_hours),i=S(e.updated_at,n)??null,c=r!==null&&Number.isFinite(Date.parse(r))?r:null,s=i===null?null:f(i,a),o=i!==null&&e.history_unreadable!==!0&&e.unproven_activity===void 0;return{last_activity_at:i,...e.history_unreadable===!0?{history_unreadable:!0}:{},...e.unproven_activity===void 0?{}:{unproven_activity:e.unproven_activity},claim_age_hours:c===null?null:f(c,a),idle_hours:s,stale_policy:{setting:A,threshold_hours:t,stale:o&&s>=t,eligible_at:o?I(i,t):null}}}function R(r){return r===void 0?"unknown":r==="claim"?"claim":"assignment"}const p="/metadata/assignee",P="/metadata/claim_principal";function D(r){return r.patch.some(n=>n.path===p||r.op==="claim"&&n.path===P)}function N(r,n){for(let e=n;e>=0;e-=1){const a=r[e].patch.find(t=>t.path===p);if(a!==void 0)return typeof a.value=="string"?a.value.trim():void 0}}async function _(r,n,e){let a=!0;const t=await Promise.resolve().then(()=>h(w(r,n),n)).then(u=>u.every(g)?u:(a=!1,[])).catch(()=>(a=!1,[]));let i=t.length-1;for(;i>=0&&!D(t[i]);)i-=1;const c=t[i],s=N(t,i)===e.trim()?c:void 0,o=R(s?.op),l=v(e);return{conflict:{phrase:o==="claim"?`claimed by ${l}`:`assigned to ${l}`,holder:l,source:o,since:s?.ts??null},history:t,readable:a,unproven:a?C(t,s===void 0?-1:i):void 0}}function d(r,n){const e=Date.parse(r);return!Number.isFinite(e)||e>=n}const W=new Set(["history_salvage","history_repair","history_redact","merge_reconcile"]);async function k(r,n){let e;try{e=await h(m(r),y)}catch{return!0}const a=Date.parse(n);return e.some(t=>{if(!b(t))return!0;if(t.op==="workspace_snapshot_restore"||W.has(t.op))return d(t.ts,a);if(t.op!=="history_compact_baseline")return!1;const i=O(t);return i===void 0||d(t.ts,a)||i!==null&&d(i,a)})}async function x(r,n,e){return(await _(r,n,e)).conflict}async function G(r,n,e,a){const{conflict:t,history:i,readable:c,unproven:s}=await _(r,n,e),o=u=>T(t.since,E(i),{...a,...c?{}:{history_unreadable:!0},...u===void 0?{}:{unproven_activity:u}}),l=o(s);return!l.stale_policy.stale||!await k(r,t.since)?{...t,activity:l}:{...t,activity:o("workspace_restored")}}async function $(r,n,e){return(await x(r,n,e)).phrase}export{$ as describeItemOwnershipConflict,T as evaluateClaimActivity,G as resolveItemOwnershipActivity,x as resolveItemOwnershipConflict};
|
|
2
2
|
//# sourceMappingURL=ownership-source.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]="22c58419-a041-5176-a3e1-d8786eb5f994")}catch{}})();import{appendHistoryEntry,createHistoryEntry}from"../core/history/history.js";import{acquireLockLease}from"../core/lock/lock.js";import{enforceWorkflowMutation}from"../core/policy/workflow-policy-store.js";import{parseTags}from"../core/item/parse.js";import{normalizeStatusInput}from"../core/item/status.js";import{canonicalDocument,serializeItemDocument}from"../core/item/item-format.js";import{deferrableItemFieldByKey,normalizeDeferredFields,pruneResolvedDeferredFields}from"../core/item/deferred-fields.js";import{getHistoryPath}from"../core/store/paths.js";import{removeFileIfExists,writeFileAtomic}from"../core/fs/fs-utils.js";import{getActiveExtensionRegistrations,runActiveBeforeMutationHooks,runActiveOnWriteHooks}from"../core/extensions/index.js";import{createMutationGuardSdk,locateItem}from"../core/store/item-store.js";import{resolveItemTypeRegistry}from"../core/item/type-registry.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{resolveAuthor}from"../core/shared/author.js";import{nowIso}from"../core/shared/time.js";import{assertInitializedTracker}from"./environment/tracker-preflight.js";import{stampRequiredItemFormat}from"./environment/project-runtime-compatibility.js";function toNonEmptyImportString(value){if(typeof value!="string")return;const trimmed=value.trim();return trimmed.length>0?trimmed:void 0}function toEstimatedMinutesValue(value){if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value;if(typeof value=="string"&&value.trim().length>0){const parsed=Number(value);if(Number.isFinite(parsed)&&parsed>=0)return parsed}}function toImportPriority(value){if(typeof value=="number"&&Number.isInteger(value)&&value>=0&&value<=4)return value;if(typeof value=="string"&&value.trim().length>0){const parsed=Number(value);if(Number.isInteger(parsed)&&parsed>=0&&parsed<=4)return parsed}return 2}function toImportTags(value){if(Array.isArray(value)){const tags=value.filter(entry=>typeof entry=="string").map(entry=>entry.trim().toLowerCase()).filter(entry=>entry.length>0);return Array.from(new Set(tags)).sort((left,right)=>left.localeCompare(right))}return typeof value=="string"?parseTags(value):[]}function toImportStatus(value){const normalized=toNonEmptyImportString(value);if(normalized){const canonical=normalizeStatusInput(normalized);if(canonical)return canonical}return"open"}function toImportInteger(value){if(typeof value=="number"&&Number.isInteger(value))return value;if(typeof value!="string"||value.trim().length===0)return;const parsed=Number(value);return Number.isInteger(parsed)?parsed:void 0}function toImportBoolean(value){if(typeof value=="boolean")return value;if(typeof value=="number")return value===1?!0:value===0?!1:void 0;if(typeof value!="string")return;const normalized=value.trim().toLowerCase();return normalized==="true"||normalized==="1"?!0:normalized==="false"||normalized==="0"?!1:void 0}function toImportStringList(value){if(!Array.isArray(value))return;const entries=value.map(entry=>toNonEmptyImportString(entry)).filter(entry=>entry!==void 0);return entries.length>0?entries:void 0}function toImportStringMap(value){return toImportValueMap(value,toNonEmptyImportString)}function toImportNumberMap(value){return toImportValueMap(value,toImportFiniteNumber)}function toImportConfidence(value,allowedTextValues){if(typeof value=="number"&&Number.isInteger(value)&&value>=0&&value<=100)return value;const normalized=toNonEmptyImportString(value)?.toLowerCase();if(!normalized)return;const candidate=normalized==="med"?"medium":normalized;if(allowedTextValues.some(entry=>entry===candidate))return candidate;const parsed=Number(candidate);return Number.isInteger(parsed)&&parsed>=0&&parsed<=100?parsed:void 0}function toImportNormalizedEnum(value,allowed){const normalized=toNonEmptyImportString(value)?.toLowerCase();if(!normalized)return;const candidate=normalized==="med"?"medium":normalized;return allowed.includes(candidate)?candidate:void 0}function toImportLinkScope(value){return toNonEmptyImportString(value)?.toLowerCase()==="global"?"global":"project"}function toImportLogEntries(value,options){const values=normalizeImportCollection(value,options.allowScalar===!0);if(!values)return;const entries=values.map(entry=>toImportLogEntry(entry,options)).filter(entry=>entry!==void 0);return entries.length>0?entries:void 0}function toImportLinkedFiles(value,options={}){return toImportLinkedArtifacts(value,options,(pathValue,record)=>({path:pathValue,scope:toImportLinkScope(record?.scope),note:toNonEmptyImportString(record?.note)}))}function toImportLinkedDocs(value,options={}){return toImportLinkedArtifacts(value,options,(pathValue,record)=>({path:pathValue,scope:toImportLinkScope(record?.scope),note:toNonEmptyImportString(record?.note)}))}function toImportDeferredFields(value){const entries=(Array.isArray(value)?value:[]).filter(entry=>typeof entry=="object"&&entry!==null&&!Array.isArray(entry)&&typeof entry.field=="string"&&deferrableItemFieldByKey(entry.field)!==void 0&&typeof entry.reason=="string"&&entry.reason.trim().length>0),byField=new Map(entries.map(entry=>[entry.field,{field:entry.field,reason:entry.reason}]));return normalizeDeferredFields([...byField.values()])}function toImportLinkedTests(value,options={}){const values=normalizeImportCollection(value,options.allowScalar===!0);if(!values)return;const entries=values.map(entry=>toImportLinkedTest(entry,options)).filter(entry=>entry!==void 0);return entries.length>0?entries:void 0}function selectImportAuthor(explicitAuthor,settingsAuthor){return resolveAuthor(explicitAuthor,settingsAuthor)}function isImportRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function normalizeImportCollection(value,allowScalar){return Array.isArray(value)?value:allowScalar?[value]:void 0}function firstNonEmptyImportString(record,keys){for(const key of keys){const value=toNonEmptyImportString(record[key]);if(value)return value}}function toImportValueMap(value,coerce){if(!isImportRecord(value))return;const entries=Object.entries(value).map(([key,entryValue])=>[key.trim(),coerce(entryValue)]).filter(entry=>entry[0].length>0&&entry[1]!==void 0);return entries.length>0?Object.fromEntries(entries):void 0}function toImportLogEntry(entry,options){if(typeof entry=="string")return toImportLogEntryFromText(entry,options);if(!isImportRecord(entry))return;const text=firstNonEmptyImportString(entry,options.textKeys??["text"]);if(!text)return;const createdAtKey=options.createdAtKey??"created_at",authorKey=options.authorKey??"author";return{created_at:(options.toIsoString?options.toIsoString(entry[createdAtKey]):toNonEmptyImportString(entry[createdAtKey]))??options.fallbackCreatedAt,author:toNonEmptyImportString(entry[authorKey])??options.fallbackAuthor,text}}function toImportLogEntryFromText(entry,options){const text=toNonEmptyImportString(entry);return text?{created_at:options.fallbackCreatedAt,author:options.fallbackAuthor,text}:void 0}function toImportLinkedArtifacts(value,options,build){const values=normalizeImportCollection(value,options.allowScalar===!0);if(!values)return;const pathKeys=options.pathKeys??["path"],entries=values.map(entry=>toImportLinkedArtifact(entry,pathKeys,build)).filter(entry=>entry!==void 0);return entries.length>0?entries:void 0}function toImportLinkedArtifact(entry,pathKeys,build){if(typeof entry=="string"){const pathValue2=toNonEmptyImportString(entry);return pathValue2?build(pathValue2):void 0}if(!isImportRecord(entry))return;const pathValue=firstNonEmptyImportString(entry,pathKeys);return pathValue?build(pathValue,entry):void 0}function toImportLinkedTest(entry,options){if(typeof entry=="string"){const command2=toNonEmptyImportString(entry);return command2?{command:command2,scope:"project"}:void 0}if(!isImportRecord(entry))return;const command=firstNonEmptyImportString(entry,options.commandKeys??["command"]),testPath=firstNonEmptyImportString(entry,options.pathKeys??["path"]);if(!(!command&&(options.requireCommand===!0||!testPath)))return{...command?{command}:{},...testPath?{path:testPath}:{},scope:toImportLinkScope(entry.scope),timeout_seconds:toImportLinkedTestTimeout(entry.timeout_seconds,options),note:toNonEmptyImportString(entry.note),...typeof entry.phase=="string"&&entry.phase.trim().toLowerCase()==="setup"?{phase:"setup"}:{},...options.includeExtendedAssertions===!0?toImportLinkedTestAssertions(entry):{}}}function toImportLinkedTestTimeout(value,options){const parsed=options.integerTimeout===!0?toImportInteger(value):toImportFiniteNumber(value);if(parsed===void 0)return;const minimum=options.timeoutMinimum??0;return options.timeoutExclusiveMinimum===!0?parsed>minimum?parsed:void 0:parsed>=minimum?parsed:void 0}function toImportFiniteNumber(value){if(typeof value=="number"&&Number.isFinite(value))return value;if(typeof value!="string"||value.trim().length===0)return;const parsed=Number(value);return Number.isFinite(parsed)?parsed:void 0}function toImportLinkedTestAssertions(entry){return{pm_context_mode:toImportNormalizedEnum(entry.pm_context_mode,["schema","tracker","auto"]),env_set:toImportStringMap(entry.env_set),env_clear:toImportStringList(entry.env_clear),shared_host_safe:toImportBoolean(entry.shared_host_safe),assert_stdout_contains:toImportStringList(entry.assert_stdout_contains),assert_stdout_regex:toImportStringList(entry.assert_stdout_regex),assert_stderr_contains:toImportStringList(entry.assert_stderr_contains),assert_stderr_regex:toImportStringList(entry.assert_stderr_regex),assert_stdout_min_lines:toImportInteger(entry.assert_stdout_min_lines),assert_json_field_equals:toImportStringMap(entry.assert_json_field_equals),assert_json_field_gte:toImportNumberMap(entry.assert_json_field_gte)}}async function ensureTrackerInitialized(pmRoot){await assertInitializedTracker(pmRoot)}function emptyImportedDocument(){return{metadata:{},body:""}}function importedChangedFields(document){return[...Object.entries(document.metadata).filter(([,value])=>value!==void 0).map(([key])=>key),...document.body.length>0?["body"]:[]].sort()}async function commitImportedItem(params){const{pmRoot,id,itemPath,author,message,settings,conflictWarningPrefix}=params,stamped={...params.document,metadata:{...params.document.metadata}};pruneResolvedDeferredFields(stamped.metadata),stampRequiredItemFormat(stamped.metadata,pmRoot);const document=canonicalDocument(stamped),historyPath=getHistoryPath(pmRoot,id),beforeDocument=emptyImportedDocument();let lease;try{lease=await acquireLockLease(pmRoot,id,settings.locks.ttl_seconds,author,!1,settings.governance.force_required_for_stale_lock,settings.locks.wait_ms)}catch(error){if(error instanceof PmCliError&&error.exitCode===EXIT_CODE.CONFLICT)return{committed:!1,conflictWarning:`${conflictWarningPrefix}:${id}`};throw error}try{const typeToFolder=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()).type_to_folder;if(await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeToFolder))return{committed:!1,conflictWarning:`${conflictWarningPrefix}:${id}`};const workflowPolicy=await enforceWorkflowMutation({pmRoot,settings,operation:"import",author,before:null,after:document});return await runActiveBeforeMutationHooks({pm_root:pmRoot,operation:"import",before:null,after:document,changed_fields:importedChangedFields(document),author,sdk:createMutationGuardSdk({pmRoot,settings,typeToFolder})}),await lease.fence(async()=>{await writeFileAtomic(itemPath,serializeItemDocument(document,{format:"toon"}));try{const entry=createHistoryEntry({nowIso:nowIso(),author,op:"import",before:beforeDocument,after:document,message,context:workflowPolicy.decisions.length===0?void 0:{workflow_policies:workflowPolicy.decisions}});await appendHistoryEntry(historyPath,entry)}catch(error){throw await removeFileIfExists(itemPath),error}}),{committed:!0,writeWarnings:[...workflowPolicy.warnings,...await runActiveOnWriteHooks({path:itemPath,scope:"project",op:"import",item_id:document.metadata.id,item_type:document.metadata.type,before:beforeDocument,after:document,changed_fields:["imported"]}),...await runActiveOnWriteHooks({path:historyPath,scope:"project",op:"import:history",item_id:document.metadata.id,item_type:document.metadata.type,before:beforeDocument,after:document,changed_fields:["imported"]})]}}finally{await lease.release()}}export{commitImportedItem,emptyImportedDocument,ensureTrackerInitialized,selectImportAuthor,toEstimatedMinutesValue,toImportBoolean,toImportConfidence,toImportDeferredFields,toImportInteger,toImportLinkScope,toImportLinkedDocs,toImportLinkedFiles,toImportLinkedTests,toImportLogEntries,toImportNormalizedEnum,toImportNumberMap,toImportPriority,toImportStatus,toImportStringList,toImportStringMap,toImportTags,toNonEmptyImportString};
|
|
1
|
+
import{appendHistoryEntry as F,createHistoryEntry as E}from"../core/history/history.js";import{acquireLockLease as T}from"../core/lock/lock.js";import{enforceWorkflowMutation as S}from"../core/policy/workflow-policy-store.js";import{parseTags as j}from"../core/item/parse.js";import{normalizeStatusInput as z}from"../core/item/status.js";import{canonicalDocument as K,serializeItemDocument as M}from"../core/item/item-format.js";import{deferrableItemFieldByKey as D,normalizeDeferredFields as P,pruneResolvedDeferredFields as W}from"../core/item/deferred-fields.js";import{getHistoryPath as q}from"../core/store/paths.js";import{removeFileIfExists as O,writeFileAtomic as R}from"../core/fs/fs-utils.js";import{getActiveExtensionRegistrations as H,runActiveBeforeMutationHooks as V,runActiveOnWriteHooks as w}from"../core/extensions/index.js";import{createMutationGuardSdk as $,locateItem as B}from"../core/store/item-store.js";import{resolveItemTypeRegistry as G}from"../core/item/type-registry.js";import{EXIT_CODE as X}from"../core/shared/constants.js";import{PmCliError as J}from"../core/shared/errors.js";import{resolveAuthor as Q}from"../core/shared/author.js";import{nowIso as U}from"../core/shared/time.js";import{assertInitializedTracker as Y}from"./environment/tracker-preflight.js";import{stampRequiredItemFormat as Z}from"./environment/project-runtime-compatibility.js";function i(t){if(typeof t!="string")return;const e=t.trim();return e.length>0?e:void 0}function Et(t){if(typeof t=="number"&&Number.isFinite(t)&&t>=0)return t;if(typeof t=="string"&&t.trim().length>0){const e=Number(t);if(Number.isFinite(e)&&e>=0)return e}}function Tt(t){if(typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=4)return t;if(typeof t=="string"&&t.trim().length>0){const e=Number(t);if(Number.isInteger(e)&&e>=0&&e<=4)return e}return 2}function St(t){if(Array.isArray(t)){const e=t.filter(r=>typeof r=="string").map(r=>r.trim().toLowerCase()).filter(r=>r.length>0);return Array.from(new Set(e)).sort((r,n)=>r.localeCompare(n))}return typeof t=="string"?j(t):[]}function jt(t){const e=i(t);if(e){const r=z(e);if(r)return r}return"open"}function A(t){if(typeof t=="number"&&Number.isInteger(t))return t;if(typeof t!="string"||t.trim().length===0)return;const e=Number(t);return Number.isInteger(e)?e:void 0}function v(t){if(typeof t=="boolean")return t;if(typeof t=="number")return t===1?!0:t===0?!1:void 0;if(typeof t!="string")return;const e=t.trim().toLowerCase();return e==="true"||e==="1"?!0:e==="false"||e==="0"?!1:void 0}function m(t){if(!Array.isArray(t))return;const e=t.map(r=>i(r)).filter(r=>r!==void 0);return e.length>0?e:void 0}function k(t){return L(t,i)}function tt(t){return L(t,C)}function zt(t,e){if(typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=100)return t;const r=i(t)?.toLowerCase();if(!r)return;const n=r==="med"?"medium":r;if(e.some(a=>a===n))return n;const o=Number(n);return Number.isInteger(o)&&o>=0&&o<=100?o:void 0}function et(t,e){const r=i(t)?.toLowerCase();if(!r)return;const n=r==="med"?"medium":r;return e.includes(n)?n:void 0}function I(t){return i(t)?.toLowerCase()==="global"?"global":"project"}function Kt(t,e){const r=b(t,e.allowScalar===!0);if(!r)return;const n=r.map(o=>rt(o,e)).filter(o=>o!==void 0);return n.length>0?n:void 0}function Mt(t,e={}){return N(t,e,(r,n)=>({path:r,scope:I(n?.scope),note:i(n?.note)}))}function Dt(t,e={}){return N(t,e,(r,n)=>({path:r,scope:I(n?.scope),note:i(n?.note)}))}function Pt(t){const e=(Array.isArray(t)?t:[]).filter(n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&typeof n.field=="string"&&D(n.field)!==void 0&&typeof n.reason=="string"&&n.reason.trim().length>0),r=new Map(e.map(n=>[n.field,{field:n.field,reason:n.reason}]));return P([...r.values()])}function Wt(t,e={}){const r=b(t,e.allowScalar===!0);if(!r)return;const n=r.map(o=>it(o,e)).filter(o=>o!==void 0);return n.length>0?n:void 0}function qt(t,e){return Q(t,e)}function u(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function b(t,e){return Array.isArray(t)?t:e?[t]:void 0}function c(t,e){for(const r of e){const n=i(t[r]);if(n)return n}}function L(t,e){if(!u(t))return;const r=Object.entries(t).map(([n,o])=>[n.trim(),e(o)]).filter(n=>n[0].length>0&&n[1]!==void 0);return r.length>0?Object.fromEntries(r):void 0}function rt(t,e){if(typeof t=="string")return nt(t,e);if(!u(t))return;const r=c(t,e.textKeys??["text"]);if(!r)return;const n=e.createdAtKey??"created_at",o=e.authorKey??"author";return{created_at:(e.toIsoString?e.toIsoString(t[n]):i(t[n]))??e.fallbackCreatedAt,author:i(t[o])??e.fallbackAuthor,text:r}}function nt(t,e){const r=i(t);return r?{created_at:e.fallbackCreatedAt,author:e.fallbackAuthor,text:r}:void 0}function N(t,e,r){const n=b(t,e.allowScalar===!0);if(!n)return;const o=e.pathKeys??["path"],a=n.map(s=>ot(s,o,r)).filter(s=>s!==void 0);return a.length>0?a:void 0}function ot(t,e,r){if(typeof t=="string"){const o=i(t);return o?r(o):void 0}if(!u(t))return;const n=c(t,e);return n?r(n,t):void 0}function it(t,e){if(typeof t=="string"){const o=i(t);return o?{command:o,scope:"project"}:void 0}if(!u(t))return;const r=c(t,e.commandKeys??["command"]),n=c(t,e.pathKeys??["path"]);if(!(!r&&(e.requireCommand===!0||!n)))return{...r?{command:r}:{},...n?{path:n}:{},scope:I(t.scope),timeout_seconds:st(t.timeout_seconds,e),note:i(t.note),...typeof t.phase=="string"&&t.phase.trim().toLowerCase()==="setup"?{phase:"setup"}:{},...e.includeExtendedAssertions===!0?ft(t):{}}}function st(t,e){const r=e.integerTimeout===!0?A(t):C(t);if(r===void 0)return;const n=e.timeoutMinimum??0;return e.timeoutExclusiveMinimum===!0?r>n?r:void 0:r>=n?r:void 0}function C(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t!="string"||t.trim().length===0)return;const e=Number(t);return Number.isFinite(e)?e:void 0}function ft(t){return{pm_context_mode:et(t.pm_context_mode,["schema","tracker","auto"]),env_set:k(t.env_set),env_clear:m(t.env_clear),shared_host_safe:v(t.shared_host_safe),assert_stdout_contains:m(t.assert_stdout_contains),assert_stdout_regex:m(t.assert_stdout_regex),assert_stderr_contains:m(t.assert_stderr_contains),assert_stderr_regex:m(t.assert_stderr_regex),assert_stdout_min_lines:A(t.assert_stdout_min_lines),assert_json_field_equals:k(t.assert_json_field_equals),assert_json_field_gte:tt(t.assert_json_field_gte)}}async function Ot(t){await Y(t)}function at(){return{metadata:{},body:""}}function dt(t){return[...Object.entries(t.metadata).filter(([,r])=>r!==void 0).map(([r])=>r),...t.body.length>0?["body"]:[]].sort()}async function Rt(t){const{pmRoot:e,id:r,itemPath:n,author:o,message:a,settings:s,conflictWarningPrefix:y}=t,p={...t.document,metadata:{...t.document.metadata}};W(p.metadata),Z(p.metadata,e);const f=K(p),x=q(e,r),l=at();let g;try{g=await T(e,r,s.locks.ttl_seconds,o,!1,s.governance.force_required_for_stale_lock,s.locks.wait_ms)}catch(d){if(d instanceof J&&d.exitCode===X.CONFLICT)return{committed:!1,conflictWarning:`${y}:${r}`};throw d}try{const d=G(s,H()).type_to_folder;if(await B(e,r,s.id_prefix,s.item_format,d))return{committed:!1,conflictWarning:`${y}:${r}`};const _=await S({pmRoot:e,settings:s,operation:"import",author:o,before:null,after:f});return await V({pm_root:e,operation:"import",before:null,after:f,changed_fields:dt(f),author:o,sdk:$({pmRoot:e,settings:s,typeToFolder:d})}),await g.fence(async()=>{await R(n,M(f,{format:"toon"}));try{const h=E({nowIso:U(),author:o,op:"import",before:l,after:f,message:a,context:_.decisions.length===0?void 0:{workflow_policies:_.decisions}});await F(x,h)}catch(h){throw await O(n),h}}),{committed:!0,writeWarnings:[..._.warnings,...await w({path:n,scope:"project",op:"import",item_id:f.metadata.id,item_type:f.metadata.type,before:l,after:f,changed_fields:["imported"]}),...await w({path:x,scope:"project",op:"import:history",item_id:f.metadata.id,item_type:f.metadata.type,before:l,after:f,changed_fields:["imported"]})]}}finally{await g.release()}}export{Rt as commitImportedItem,at as emptyImportedDocument,Ot as ensureTrackerInitialized,qt as selectImportAuthor,Et as toEstimatedMinutesValue,v as toImportBoolean,zt as toImportConfidence,Pt as toImportDeferredFields,A as toImportInteger,I as toImportLinkScope,Dt as toImportLinkedDocs,Mt as toImportLinkedFiles,Wt as toImportLinkedTests,Kt as toImportLogEntries,et as toImportNormalizedEnum,tt as toImportNumberMap,Tt as toImportPriority,jt as toImportStatus,m as toImportStringList,k as toImportStringMap,St as toImportTags,i as toNonEmptyImportString};
|
|
2
2
|
//# sourceMappingURL=package-import-adapters.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{PmClient as t}from"./runtime.js";function i(e={},n={}){return new t(n).extension(void 0,{...e,migrate:!0})}function a(e={},n={}){return new t(n).packageMigrate(e)}export{i as extensionMigrate,a as packageMigrate};
|
|
2
2
|
//# sourceMappingURL=package-migrations.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const a=new Set(["true","1","yes","on"]),c=new Set(["false","0","no","off"]);function u(o,r,i=[]){const s=[r,...i];for(const n of s){const t=o[n];if(typeof t=="string"&&t.trim().length>0)return t.trim()}}function d(o,r,i=[]){const s=[r,...i];for(const n of s){const t=o[n];if(t!==void 0){if(typeof t=="boolean")return t;if(typeof t=="string"){const f=t.trim().toLowerCase();if(a.has(f))return!0;if(c.has(f))return!1}}}}function l(o,r,i=[]){for(const s of[r,...i]){const n=o[s],f=(typeof n=="string"?n.split(","):Array.isArray(n)?n.flatMap(e=>typeof e=="string"?e.split(","):[]):[]).map(e=>e.trim()).filter(e=>e.length>0);if(f.length>0)return f}return[]}export{d as readBooleanOption,l as readCsvListOption,u as readStringOption};
|
|
2
2
|
//# sourceMappingURL=package-runtime-options.js.map
|
package/dist/sdk/pagination.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{READ_OUTPUT_DIMENSION_FLAGS as m,READ_OUTPUT_COMPOSITION_FLAGS as _}from"./read-output/options.js";import{createHash as y}from"node:crypto";import{PmCliError as u}from"../core/shared/errors.js";import{EXIT_CODE as a}from"../core/shared/constants.js";import{stableStringify as g}from"../core/shared/serialization.js";import{isCompactedCursorArgument as S}from"../core/shared/text-normalization.js";import{decodeReadOutputContinuationCursor as x}from"./read-output/continuation.js";const f=1,h=4096,w=/^[A-Za-z0-9_-]+$/;function d(r){return r.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(e,n)=>n.toUpperCase())}function N(r,e){const n=[...Object.values(m),..._],t=new Set(n.flatMap(o=>[d(o),o.slice(2).replaceAll("-","_")]));for(const o of e)if(o.cursor_semantics==="presentation"){t.add(d(o.flag));for(const i of o.aliases??[])t.add(d(i))}return Object.fromEntries(Object.entries(r).filter(([o])=>!t.has(o)))}function I(r,e){return y("sha256").update(r).update("\0").update(g(e)).digest("hex").slice(0,24)}function C(r,e,n,t){return Buffer.from(JSON.stringify({version:f,fingerprint:r,after_id:e,...n===void 0?{}:{after_index:n},...t===void 0?{}:{snapshot:t}})).toString("base64url")}function s(r,e){return new u(r,a.USAGE,{code:"invalid_query_cursor",nextSteps:[`Repeat the original query without ${e} to obtain a fresh cursor.`]})}function O(r){return new u("Query cursor was shortened by output compaction: it contains an ellipsis, which no cursor encoder emits.",a.USAGE,{code:"invalid_query_cursor",reason:"cursor_compacted",required:"Pass the whole cursor the previous page emitted; a shortened cursor cannot resume the query.",nextSteps:[`Re-read the previous page with a larger --output-budget (or --output-budget unbounded) and pass its whole next_cursor to ${r}.`,`Or repeat the original query without ${r} to obtain a fresh cursor.`]})}function R(r){if(typeof r!="object"||r===null||Array.isArray(r))return!1;const e=r;return e.version===f&&typeof e.fingerprint=="string"&&typeof e.after_id=="string"&&e.after_id.length>0&&(e.after_index===void 0||Number.isSafeInteger(e.after_index)&&e.after_index>=0)&&(e.snapshot===void 0||typeof e.snapshot=="string"&&e.snapshot.length>0)}function E(r,e="--after"){if(typeof r!="string")throw s("Query cursor is malformed.",e);const n=r.trim();if(S(n))throw O(e);if(n.length===0||n.length>h||!w.test(n))throw s("Query cursor is malformed.",e);let t;try{t=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{throw s("Query cursor is malformed.",e)}if(!R(t)){let o=!1;try{x(n),o=!0}catch{}throw o?new u(`An output cursor must be continued with --output-cursor, not ${e}.`,a.USAGE,{code:"invalid_query_cursor",nextSteps:[`Repeat the same query, replacing ${e} with --output-cursor ${n}; retain any producer ${e} cursor from the original page.`]}):s("Query cursor version or payload is unsupported.",e)}return t}function c(r,e,n="--after"){const t=E(r,n);if(t.fingerprint!==e)throw s(`Query cursor does not match the current filters, sort, or query (${t.fingerprint} != ${e}).`,n);return{after_id:t.after_id,...t.after_index===void 0?{}:{after_index:t.after_index},...t.snapshot===void 0?{}:{snapshot:t.snapshot}}}function G(r,e){return c(r,e).after_id}function Q(r,e,n,t,o="--after"){if(e===void 0)return 0;const i=c(e,n,o),p=r.findIndex(l=>t(l)===i.after_id);if(p<0){if(i.after_index!==void 0)return Math.min(i.after_index,r.length);throw s(`Query cursor item ${i.after_id} is no longer present in this result set.`,o)}return p+1}function M(r,e){if(e.cursor!==void 0&&c(e.cursor,e.fingerprint).snapshot!==e.snapshot)throw s("Query cursor does not match the requested snapshot.","--after");const n=Q(r,e.cursor,e.fingerprint,e.readId),t=r.slice(n,n+e.limit),o=t.length>0&&n+t.length<r.length,i=t.at(-1);return{rows:t,has_more:o,...o&&i!==void 0?{next_cursor:C(e.fingerprint,e.readId(i),n+t.length-1,e.snapshot)}:{}}}const P=Object.freeze({version:f,max_length:h});export{P as QUERY_CURSOR_CONTRACT,I as createQueryFingerprint,G as decodeQueryCursor,E as decodeQueryCursorEnvelope,c as decodeQueryCursorState,C as encodeQueryCursor,M as paginateQueryRows,Q as resolveQueryCursorStart,N as selectCursorSemanticOptions};
|
|
2
2
|
//# sourceMappingURL=pagination.js.map
|
package/dist/sdk/profile.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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]="aa4e2ff3-dc3b-5688-bf40-bdd71c65320b")}catch{}})();import{assertInitializedTracker}from"./environment/tracker-preflight.js";import path from"node:path";import{readFileIfExists}from"../core/fs/fs-utils.js";import{writeWorkspaceJsonWithHistory}from"../core/history/workspace-history.js";import{acquireLock}from"../core/lock/lock.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{resolveAuthor}from"../core/shared/author.js";import{nowIso}from"../core/shared/time.js";import{resolvePmRoot}from"../core/store/paths.js";import{readSettings,resolveGovernanceKnobs,writeSettings}from"../core/store/settings.js";import{DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,filePathForSchemaSection,normalizeRuntimeSchemaSettings}from"../core/schema/runtime-schema.js";import{normalizeAddTypeInput,serializeItemTypesFile}from"../core/schema/item-types-file.js";import{serializeStatusDefsFile}from"../core/schema/status-defs-file.js";import{serializeFieldsFile}from"../core/schema/fields-file.js";import{resolveNestedSettingDescriptor,writeNestedSettingValue}from"../core/config/nested-settings.js";import{getActiveExtensionRegistrations,runActiveOnWriteHooks}from"../core/extensions/index.js";import{resolveProfileCatalog,resolveProfileEntry}from"../core/profile/profile-presets.js";import{describeProfileComposition,describeProjectProfile}from"../core/profile/profile-describe.js";import{lintProjectProfile}from"../core/profile/profile-lint.js";import{planProfileApplication}from"../core/profile/profile-plan.js";import{ensureTypeFolderScaffold}from"./schema.js";import{runTemplatesSave}from"./templates.js";const PROFILE_SUBCOMMANDS=["list","show","apply","lint"],PROFILE_TYPES_LOCK_ID="schema-types",PROFILE_STATUSES_LOCK_ID="schema-statuses",PROFILE_FIELDS_LOCK_ID="schema-fields";function collectExtensionProfileContributions(){const registrations=getActiveExtensionRegistrations();return registrations===null?[]:registrations.profiles.map(entry=>({name:entry.name,profile:entry.profile}))}function runProfileList(){const{profiles,warnings}=resolveProfileCatalog(collectExtensionProfileContributions());return{action:"list",profiles:profiles.map(resolved=>({name:resolved.definition.name,title:resolved.definition.title,summary:resolved.definition.summary,source:resolved.source,...resolved.package!==void 0?{package:resolved.package}:{},composition:describeProfileComposition(resolved.definition)})),warnings,generated_at:nowIso()}}function runProfileShow(name){let entry;try{entry=resolveProfileEntry(name,collectExtensionProfileContributions())}catch(error){throw new PmCliError(error instanceof Error?error.message:String(error),EXIT_CODE.USAGE)}const{resolved}=entry;return{action:"show",...describeProjectProfile(resolved.definition),source:resolved.source,...resolved.package!==void 0?{package:resolved.package}:{},warnings:entry.warnings,generated_at:nowIso()}}function runProfileLint(name){let entry;try{entry=resolveProfileEntry(name,collectExtensionProfileContributions())}catch(error){throw new PmCliError(error instanceof Error?error.message:String(error),EXIT_CODE.USAGE)}const{resolved}=entry,report=lintProjectProfile(resolved.definition);return{action:"lint",name:resolved.definition.name,title:resolved.definition.title,source:resolved.source,...resolved.package!==void 0?{package:resolved.package}:{},ok:report.ok,error_count:report.errorCount,warning_count:report.warningCount,findings:report.findings,warnings:entry.warnings,generated_at:nowIso()}}function templateFilePath(pmRoot,name){return path.join(pmRoot,"templates",`${name}.json`)}async function readStoredTemplateOptions(pmRoot,name){const raw=await readFileIfExists(templateFilePath(pmRoot,name));if(raw!==null)try{const parsed=JSON.parse(raw);if(parsed!==null&&typeof parsed=="object"&&!Array.isArray(parsed)){const options=parsed.options;if(options!==null&&typeof options=="object"&&!Array.isArray(options))return options}}catch{}}async function loadProfileCurrentState(pmRoot,schema,settings,profile){const templates=new Map;for(const template of profile.templates){const stored=await readStoredTemplateOptions(pmRoot,template.name);stored!==void 0&&templates.set(template.name,stored)}return{typesRaw:await readFileIfExists(filePathForSchemaSection(pmRoot,schema.files.types,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types)),statusesRaw:await readFileIfExists(filePathForSchemaSection(pmRoot,schema.files.statuses,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses)),fieldsRaw:await readFileIfExists(filePathForSchemaSection(pmRoot,schema.files.fields,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields)),workflows:settings.schema.type_workflows??[],settings,templates,installedPackages:new Set}}function dimensionFrom(changes){const added=[],updated=[],unchanged=[];for(const change of changes)(change.status==="add"?added:change.status==="update"?updated:unchanged).push(change.key);return{added,updated,unchanged}}function buildApplyResult(profile,plan,applied,dryRun,warnings){return{action:"apply",name:profile.name,title:profile.title,applied,dry_run:dryRun,changed:plan.changed,types:dimensionFrom(plan.types.changes),statuses:dimensionFrom(plan.statuses.changes),fields:dimensionFrom(plan.fields.changes),workflows:dimensionFrom(plan.workflows.changes.map(change=>({key:change.type,status:change.status}))),config:dimensionFrom(plan.config.changes),templates:dimensionFrom(plan.templates.changes.map(change=>({key:change.name,status:change.status}))),packages:plan.packages,warnings:[...new Set(warnings)].sort((left,right)=>left.localeCompare(right)),generated_at:nowIso()}}async function assertProfileTrackerInitialized(pmRoot){await assertInitializedTracker(pmRoot)}function resolveProfileForCommand(name){try{const entry=resolveProfileEntry(name,collectExtensionProfileContributions());return{profile:entry.resolved.definition,warnings:entry.warnings}}catch(error){throw new PmCliError(error instanceof Error?error.message:String(error),EXIT_CODE.USAGE)}}async function runProfileApply(name,options,global2){const pmRoot=resolvePmRoot(process.cwd(),global2.path);await assertProfileTrackerInitialized(pmRoot);const resolvedProfile=resolveProfileForCommand(name),profile=resolvedProfile.profile,mergeWarnings=resolvedProfile.warnings,dryRun=options.dryRun===!0,settings=await readSettings(pmRoot),schema=normalizeRuntimeSchemaSettings(settings.schema);if(dryRun){const state=await loadProfileCurrentState(pmRoot,schema,settings,profile),plan2=planProfile(profile,state);return buildApplyResult(profile,plan2,!1,!0,[...mergeWarnings])}const author=resolveAuthor(options.author,settings.author_default),governance=resolveGovernanceKnobs(settings),force=!!options.force,warnings=[...mergeWarnings],releasers=[],acquire=async lockId=>{releasers.push(await acquireLock(pmRoot,lockId,settings.locks.ttl_seconds,author,force,governance.force_required_for_stale_lock,settings.locks.wait_ms))};let plan;try{await acquire(PROFILE_TYPES_LOCK_ID),await acquire(PROFILE_STATUSES_LOCK_ID),await acquire(PROFILE_FIELDS_LOCK_ID);const state=await loadProfileCurrentState(pmRoot,schema,settings,profile);if(plan=planProfile(profile,state),plan.types.changed){const typesPath=filePathForSchemaSection(pmRoot,schema.files.types,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);await writeWorkspaceJsonWithHistory({pmRoot,filePath:typesPath,raw:serializeItemTypesFile(plan.types.file),op:"profile:apply-types",author,lockTtlSeconds:settings.locks.ttl_seconds,lockWaitMs:settings.locks.wait_ms});const stagedNames=new Set(profile.types.map(type=>normalizeAddTypeInput(type).name)),stagedDefinitions=plan.types.file.definitions.filter(definition=>stagedNames.has(definition.name));await ensureTypeFolderScaffold(pmRoot,stagedDefinitions,warnings,"profile:apply-type-folder"),warnings.push(...await runActiveOnWriteHooks({path:typesPath,scope:"project",op:"profile:apply-types"}))}if(plan.statuses.changed){const statusesPath=filePathForSchemaSection(pmRoot,schema.files.statuses,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses);await writeWorkspaceJsonWithHistory({pmRoot,filePath:statusesPath,raw:serializeStatusDefsFile(plan.statuses.file),op:"profile:apply-statuses",author,lockTtlSeconds:settings.locks.ttl_seconds,lockWaitMs:settings.locks.wait_ms}),warnings.push(...await runActiveOnWriteHooks({path:statusesPath,scope:"project",op:"profile:apply-statuses"}))}if(plan.fields.changed){const fieldsPath=filePathForSchemaSection(pmRoot,schema.files.fields,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields);await writeWorkspaceJsonWithHistory({pmRoot,filePath:fieldsPath,raw:serializeFieldsFile(plan.fields.file),op:"profile:apply-fields",author,lockTtlSeconds:settings.locks.ttl_seconds,lockWaitMs:settings.locks.wait_ms}),warnings.push(...await runActiveOnWriteHooks({path:fieldsPath,scope:"project",op:"profile:apply-fields"}))}if(plan.config.changed||plan.workflows.changed){for(const change of plan.config.changes){if(change.status==="unchanged")continue;const descriptor=resolveNestedSettingDescriptor(change.key);descriptor!==void 0&&writeNestedSettingValue(settings,descriptor,change.value)}settings.schema.type_workflows=plan.workflows.result,await writeSettings(pmRoot,settings,"profile:apply-config")}for(const change of plan.templates.changes)change.status!=="unchanged"&&await runTemplatesSave(change.name,{...change.options},global2)}finally{for(const release of releasers.reverse())try{await release()}catch{}}return buildApplyResult(profile,plan,plan.changed,!1,warnings)}function planProfile(profile,state){try{return planProfileApplication(profile,state)}catch(error){throw new PmCliError(error instanceof Error?error.message:String(error),EXIT_CODE.USAGE)}}function formatDimensionLine(label,dimension){const segments=[];if(dimension.added.length>0&&segments.push(`+${dimension.added.join(", ")}`),dimension.updated.length>0&&segments.push(`~${dimension.updated.join(", ")}`),segments.length!==0)return` ${label}: ${segments.join(" ")}`}function formatProfileListHuman(result){const lines=["Project profiles:"];for(const profile of result.profiles){const origin=profile.source==="extension"?` [${profile.package??"extension"}]`:"";lines.push(` ${profile.name} \u2014 ${profile.title}: ${profile.summary}${origin}`)}for(const warning of result.warnings)lines.push(` warning: ${warning}`);return lines.join(`
|
|
2
|
-
`)}function
|
|
3
|
-
`)}function
|
|
4
|
-
`)}function
|
|
5
|
-
`)}export{PROFILE_SUBCOMMANDS,formatProfileApplyHuman,formatProfileLintHuman,formatProfileListHuman,formatProfileShowHuman,runProfileApply,runProfileLint,runProfileList,runProfileShow};
|
|
1
|
+
import{assertInitializedTracker as D}from"./environment/tracker-preflight.js";import z from"node:path";import{readFileIfExists as y}from"../core/fs/fs-utils.js";import{writeWorkspaceJsonWithHistory as j}from"../core/history/workspace-history.js";import{acquireLock as b}from"../core/lock/lock.js";import{EXIT_CODE as k}from"../core/shared/constants.js";import{PmCliError as $}from"../core/shared/errors.js";import{resolveAuthor as H}from"../core/shared/author.js";import{nowIso as P}from"../core/shared/time.js";import{resolvePmRoot as M}from"../core/store/paths.js";import{readSettings as U,resolveGovernanceKnobs as W,writeSettings as N}from"../core/store/settings.js";import{DEFAULT_RUNTIME_SCHEMA_FILE_PATHS as l,filePathForSchemaSection as d,normalizeRuntimeSchemaSettings as G}from"../core/schema/runtime-schema.js";import{normalizeAddTypeInput as K,serializeItemTypesFile as q}from"../core/schema/item-types-file.js";import{serializeStatusDefsFile as B}from"../core/schema/status-defs-file.js";import{normalizeAddFieldInput as J,serializeFieldsFile as V}from"../core/schema/fields-file.js";import{assertFieldOptionsAvailable as X}from"./schema/field-option-collisions.js";import{resolveNestedSettingDescriptor as Y,writeNestedSettingValue as Q}from"../core/config/nested-settings.js";import{getActiveExtensionRegistrations as Z,runActiveOnWriteHooks as A}from"../core/extensions/index.js";import{resolveProfileCatalog as ee,resolveProfileEntry as F}from"../core/profile/profile-presets.js";import{describeProfileComposition as te,describeProjectProfile as ne}from"../core/profile/profile-describe.js";import{lintProjectProfile as oe}from"../core/profile/profile-lint.js";import{planProfileApplication as ie}from"../core/profile/profile-plan.js";import{ensureTypeFolderScaffold as se}from"./schema.js";import{runTemplatesSave as ae}from"./templates.js";const He=["list","show","apply","lint"],re="schema-types",ce="schema-statuses",fe="schema-fields";function _(){const e=Z();return e===null?[]:e.profiles.map(n=>({name:n.name,profile:n.profile}))}function Me(){const{profiles:e,warnings:n}=ee(_());return{action:"list",profiles:e.map(t=>({name:t.definition.name,title:t.definition.title,summary:t.definition.summary,source:t.source,...t.package!==void 0?{package:t.package}:{},composition:te(t.definition)})),warnings:n,generated_at:P()}}function Ue(e){let n;try{n=F(e,_())}catch(o){throw new $(o instanceof Error?o.message:String(o),k.USAGE)}const{resolved:t}=n;return{action:"show",...ne(t.definition),source:t.source,...t.package!==void 0?{package:t.package}:{},warnings:n.warnings,generated_at:P()}}function We(e){let n;try{n=F(e,_())}catch(i){throw new $(i instanceof Error?i.message:String(i),k.USAGE)}const{resolved:t}=n,o=oe(t.definition);return{action:"lint",name:t.definition.name,title:t.definition.title,source:t.source,...t.package!==void 0?{package:t.package}:{},ok:o.ok,error_count:o.errorCount,warning_count:o.warningCount,findings:o.findings,warnings:n.warnings,generated_at:P()}}function pe(e,n){return z.join(e,"templates",`${n}.json`)}async function le(e,n){const t=await y(pe(e,n));if(t!==null)try{const o=JSON.parse(t);if(o!==null&&typeof o=="object"&&!Array.isArray(o)){const i=o.options;if(i!==null&&typeof i=="object"&&!Array.isArray(i))return i}}catch{}}async function I(e,n,t,o){const i=new Map;for(const s of o.templates){const f=await le(e,s.name);f!==void 0&&i.set(s.name,f)}return{typesRaw:await y(d(e,n.files.types,l.types)),statusesRaw:await y(d(e,n.files.statuses,l.statuses)),fieldsRaw:await y(d(e,n.files.fields,l.fields)),workflows:t.schema.type_workflows??[],settings:t,templates:i,installedPackages:new Set}}function m(e){const n=[],t=[],o=[];for(const i of e)(i.status==="add"?n:i.status==="update"?t:o).push(i.key);return{added:n,updated:t,unchanged:o}}function T(e,n,t,o,i){return{action:"apply",name:e.name,title:e.title,applied:t,dry_run:o,changed:n.changed,types:m(n.types.changes),statuses:m(n.statuses.changes),fields:m(n.fields.changes),workflows:m(n.workflows.changes.map(s=>({key:s.type,status:s.status}))),config:m(n.config.changes),templates:m(n.templates.changes.map(s=>({key:s.name,status:s.status}))),packages:n.packages,warnings:[...new Set(i)].sort((s,f)=>s.localeCompare(f)),generated_at:P()}}async function de(e){await D(e)}function me(e){try{const n=F(e,_());return{profile:n.resolved.definition,warnings:n.warnings}}catch(n){throw new $(n instanceof Error?n.message:String(n),k.USAGE)}}async function Ne(e,n,t){const o=M(process.cwd(),t.path);await de(o);const i=me(e),s=i.profile,f=i.warnings;for(const p of s.fields){let a;try{a=J(p)}catch{continue}X(a)}const C=n.dryRun===!0,r=await U(o),u=G(r.schema);if(C){const p=await I(o,u,r,s),a=v(s,p);return T(s,a,!1,!0,[...f])}const w=H(n.author,r.author_default),L=W(r),O=!!n.force,g=[...f],x=[],S=async p=>{x.push(await b(o,p,r.locks.ttl_seconds,w,O,L.force_required_for_stale_lock,r.locks.wait_ms))};let c;try{await S(re),await S(ce),await S(fe);const p=await I(o,u,r,s);if(c=v(s,p),c.types.changed){const a=d(o,u.files.types,l.types);await j({pmRoot:o,filePath:a,raw:q(c.types.file),op:"profile:apply-types",author:w,lockTtlSeconds:r.locks.ttl_seconds,lockWaitMs:r.locks.wait_ms});const h=new Set(s.types.map(E=>K(E).name)),R=c.types.file.definitions.filter(E=>h.has(E.name));await se(o,R,g,"profile:apply-type-folder"),g.push(...await A({path:a,scope:"project",op:"profile:apply-types"}))}if(c.statuses.changed){const a=d(o,u.files.statuses,l.statuses);await j({pmRoot:o,filePath:a,raw:B(c.statuses.file),op:"profile:apply-statuses",author:w,lockTtlSeconds:r.locks.ttl_seconds,lockWaitMs:r.locks.wait_ms}),g.push(...await A({path:a,scope:"project",op:"profile:apply-statuses"}))}if(c.fields.changed){const a=d(o,u.files.fields,l.fields);await j({pmRoot:o,filePath:a,raw:V(c.fields.file),op:"profile:apply-fields",author:w,lockTtlSeconds:r.locks.ttl_seconds,lockWaitMs:r.locks.wait_ms}),g.push(...await A({path:a,scope:"project",op:"profile:apply-fields"}))}if(c.config.changed||c.workflows.changed){for(const a of c.config.changes){if(a.status==="unchanged")continue;const h=Y(a.key);h!==void 0&&Q(r,h,a.value)}r.schema.type_workflows=c.workflows.result,await N(o,r,"profile:apply-config")}for(const a of c.templates.changes)a.status!=="unchanged"&&await ae(a.name,{...a.options},t)}finally{for(const p of x.reverse())try{await p()}catch{}}return T(s,c,c.changed,!1,g)}function v(e,n){try{return ie(e,n)}catch(t){throw new $(t instanceof Error?t.message:String(t),k.USAGE)}}function ue(e,n){const t=[];if(n.added.length>0&&t.push(`+${n.added.join(", ")}`),n.updated.length>0&&t.push(`~${n.updated.join(", ")}`),t.length!==0)return` ${e}: ${t.join(" ")}`}function Ge(e){const n=["Project profiles:"];for(const t of e.profiles){const o=t.source==="extension"?` [${t.package??"extension"}]`:"";n.push(` ${t.name} \u2014 ${t.title}: ${t.summary}${o}`)}for(const t of e.warnings)n.push(` warning: ${t}`);return n.join(`
|
|
2
|
+
`)}function Ke(e){const n=e.source==="extension"?` [${e.package??"extension"}]`:"",t=[`${e.name} \u2014 ${e.title}${n}`,e.summary,""];t.push(`types: ${e.types.join(", ")||"(none)"}`),t.push(`statuses: ${e.statuses.join(", ")||"(none)"}`),t.push(`fields: ${e.fields.join(", ")||"(none)"}`),t.push(`workflows: ${e.workflows.join(", ")||"(none)"}`),t.push(`config: ${e.config.join(", ")||"(none)"}`),t.push(`templates: ${e.templates.join(", ")||"(none)"}`),t.push(`packages: ${e.packages.map(o=>o.spec).join(", ")||"(none)"}`);for(const o of e.warnings)t.push(`warning: ${o}`);return t.join(`
|
|
3
|
+
`)}function qe(e){const n=e.source==="extension"?` [${e.package??"extension"}]`:"",t=e.warning_count+e.warnings.length,i=[e.ok?`Profile ${e.name}${n}: ok (${t} warning${t===1?"":"s"})`:`Profile ${e.name}${n}: ${e.error_count} error${e.error_count===1?"":"s"}, ${t} warning${t===1?"":"s"}`];for(const s of e.findings){const f=s.target!==void 0?` (${s.target})`:"";i.push(` ${s.severity} [${s.code}] ${s.dimension}${f}: ${s.message}`)}for(const s of e.warnings)i.push(` warning: ${s}`);return i.join(`
|
|
4
|
+
`)}function Be(e){const n=e.dry_run?"dry-run":e.applied?"applied":"no changes",t=[`Profile ${e.name} (${n})`];if(!e.changed)t.push(" already up to date");else for(const[i,s]of[["types",e.types],["statuses",e.statuses],["fields",e.fields],["workflows",e.workflows],["config",e.config],["templates",e.templates]]){const f=ue(i,s);f!==void 0&&t.push(f)}const o=e.packages.filter(i=>i.status==="recommended");o.length>0&&t.push(` recommended packages: ${o.map(i=>i.spec).join(", ")}`);for(const i of e.warnings)t.push(` warning: ${i}`);return t.join(`
|
|
5
|
+
`)}export{He as PROFILE_SUBCOMMANDS,Be as formatProfileApplyHuman,qe as formatProfileLintHuman,Ge as formatProfileListHuman,Ke as formatProfileShowHuman,Ne as runProfileApply,We as runProfileLint,Me as runProfileList,Ue as runProfileShow};
|
|
6
6
|
//# sourceMappingURL=profile.js.map
|
package/dist/sdk/provenance.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{AGENT_PROVENANCE_DIMENSIONS as p,BUILTIN_HARNESS_SIGNAL_DESCRIPTORS as g}from"../core/shared/author.js";function v(a){return a.agent_episode!==void 0?{id:a.agent_episode.id,source:"declared"}:{id:a.agent_instance?`inferred:instance:${a.agent_instance}`:`inferred:author:${a.author}:${a.ts.slice(0,13)}`,source:"inferred"}}function f(a,i,r){let e=i;const n=new Set([a.id]);for(;e!==void 0&&!n.has(e.id);)n.add(e.id),e=e.parent_id?r.get(e.parent_id):void 0;return e===void 0}function _(a){const i=[a];for(;i.length>0;){const r=i.pop();r.sort((e,n)=>e.entries[0].ts.localeCompare(n.entries[0].ts)||e.id.localeCompare(n.id)),i.push(...r.map(e=>e.children))}}function b(a=g,i=p){return i.map(r=>{const e=a.filter(n=>((r==="model"?n.model_environment_keys:n.provenance_environment_keys?.[r])?.length??0)>0||n.provenance_resolvers?.[r]!==void 0).map(n=>n.harness).sort();return{dimension:r,harnesses:e,covered:e.length>0}})}function y(a,i=1){const r=new Map;for(const e of a){if(!e.agent_harness)continue;const n=r.get(e.agent_harness)??{harness:e.agent_harness,entries:0,observed:0,unavailable:0,legacy_missing:0};n.entries+=1,e.agent_model||e.agent_provenance?.model&&e.agent_provenance.model.value.length>0?n.observed+=1:e.agent_provenance?.model===null?n.unavailable+=1:n.legacy_missing+=1,r.set(e.agent_harness,n)}return[...r.values()].map(e=>{const n=e.observed+e.unavailable;return{...e,coverage:n===0?null:e.observed/n,inert:n>=i&&e.observed===0}}).sort((e,n)=>e.harness.localeCompare(n.harness))}function C(a,i=p,r=1){const e=new Map;for(const n of a)if(n.agent_harness)for(const s of i){const t=`${n.agent_harness}\0${s}`,c=e.get(t)??{harness:n.agent_harness,dimension:s,entries:0,observed:0,unavailable:0,legacy_missing:0};c.entries+=1;const o=n.agent_provenance?.[s];o!=null&&o.value.length>0?c.observed+=1:o===null?c.unavailable+=1:c.legacy_missing+=1,e.set(t,c)}return[...e.values()].map(n=>{const s=n.observed+n.unavailable;return{...n,coverage:s===0?null:n.observed/s,inert:s>=r&&n.observed===0}}).sort((n,s)=>n.harness.localeCompare(s.harness)||n.dimension.localeCompare(s.dimension))}function E(a,i={}){const r=i.minimumCoverage??.8,e=i.minimumEntries??5;if(![Number.isFinite(r),r>=0,r<=1].every(Boolean))throw new RangeError("Semantic attribution minimum coverage must be from 0 to 1.");if(![Number.isSafeInteger(e),e>=1].every(Boolean))throw new RangeError("Semantic attribution minimum entries must be a positive integer.");const n=new Map;for(const o of a)if(o.agent_harness)for(const l of["role","topic"]){const u=`${o.agent_harness}\0${l}`,d=n.get(u)??{harness:o.agent_harness,dimension:l,entries:0,observed:0,by_source:{},coverage:0};d.entries+=1;const m=o.agent_provenance?.[l];m?.value&&(d.observed+=1,d.by_source[m.source]=(d.by_source[m.source]??0)+1),n.set(u,d)}const s=[...n.values()].map(o=>({...o,coverage:o.observed/o.entries,by_source:Object.fromEntries(Object.entries(o.by_source).sort(([l],[u])=>l.localeCompare(u)))})).sort((o,l)=>o.harness.localeCompare(l.harness)||o.dimension.localeCompare(l.dimension)),t=s.filter(o=>o.entries>=e),c=t.filter(o=>o.coverage<r).map(o=>`${o.harness}:${o.dimension}`);return{passed:t.length>0&&c.length===0,minimum_coverage:r,minimum_entries:e,rows:s,failures:c}}function S(a){const i=[...a].sort((s,t)=>s.ts.localeCompare(t.ts)||s.author.localeCompare(t.author)||s.op.localeCompare(t.op)||s.before_hash.localeCompare(t.before_hash)||s.after_hash.localeCompare(t.after_hash)),r=new Map,e=new Map;for(const s of i){const t=s.agent_episode,c=v(s),o=`${c.source}:${c.id}`,l=r.get(o);if(l){l.entries.push(s);continue}const u={id:c.id,...t?.label===void 0?{}:{label:t.label},...t?.parent_id===void 0?{}:{parent_id:t.parent_id},source:c.source,entries:[s],children:[]};r.set(o,u),t!==void 0&&e.set(c.id,u)}const n=[];for(const s of r.values()){const t=s.parent_id?e.get(s.parent_id):void 0;t&&f(s,t,e)?t.children.push(s):n.push(s)}return _(n),n}export{b as analyzeAgentProvenanceDescriptorCoverage,E as evaluateSemanticAttributionCoverage,S as groupHistoryByEpisode,v as resolveHistoryEpisodeGroupIdentity,y as summarizeAgentModelProvenance,C as summarizeAgentProvenance};
|
|
2
2
|
//# sourceMappingURL=provenance.js.map
|