@unbrained/pm-cli 2026.11.6 → 2026.11.8
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/CHANGELOG.md +82 -48
- package/dist/cli/expected-revisions.js +1 -1
- package/dist/cli/extension-command-help.js +4 -3
- package/dist/cli/help-json-payload.js +1 -1
- package/dist/cli/main.js +1 -1
- package/dist/cli/register-annotations.js +1 -1
- package/dist/cli/register-list-query.js +5 -5
- package/dist/cli/runtime/annotation-option-retry.js +2 -0
- package/dist/cli/runtime/close-fields-retry.js +2 -0
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-3A5DJZCC.js +116 -0
- package/dist/cli-bundle/chunks/chunk-4BMPGUTG.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-D7KYPRK4.js → chunk-7GC6WIDR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DAX3AOFI.js → chunk-7V6I6X4G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OH6WQ7VT.js → chunk-AFZS6WFV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PE3ASURT.js → chunk-C4MQFWCM.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-CP43BHX3.js +31 -0
- package/dist/cli-bundle/chunks/{chunk-S4LPZ4TN.js → chunk-DOHZKPPC.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-LS3GI3H4.js → chunk-HESIRIVX.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-JAE5MWLX.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-335BZ75D.js → chunk-L5BU5FYN.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-LI2HP5OX.js +3 -0
- package/dist/cli-bundle/chunks/chunk-LLTRUVKK.js +6 -0
- package/dist/cli-bundle/chunks/{chunk-X3URBPMV.js → chunk-MKW5LGVQ.js} +66 -62
- package/dist/cli-bundle/chunks/chunk-NH7QX2M2.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-HRFGFIYU.js → chunk-NKO42JMT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7DEKAXVA.js → chunk-PE6CZ3PE.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-RC6SSFOF.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-TSQCUBUX.js → chunk-S4IZIMAO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UEGXWXUZ.js → chunk-XBUZENP4.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-YGUUJHSR.js +2 -0
- package/dist/cli-bundle/chunks/chunk-YUTFMHSG.js +122 -0
- package/dist/cli-bundle/chunks/{chunk-SLC5UWCM.js → chunk-Z3LWNF7C.js} +2 -2
- package/dist/cli-bundle/chunks/item-revision-TUGZYYXX.js +2 -0
- package/dist/cli-bundle/chunks/item-transaction-2RRBAQN3.js +2 -0
- package/dist/cli-bundle/chunks/{mutation-admission-INMM3HHG.js → mutation-admission-FJ3D66PV.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-5Y5JKWU5.js → register-list-query-GXP77CX7.js} +11 -11
- package/dist/cli-bundle/chunks/register-mutation-XJ2DROUM.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-WJHZJFK2.js → register-operations-O5LERXM7.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-RRFOS7IT.js → register-setup-4VOTYLL2.js} +2 -2
- package/dist/cli-bundle/chunks/{stage-E3MMV4TV.js → stage-ZDJL3FGL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2A3QZELL.js +26 -0
- package/dist/cli-bundle/focused-chunks/{chunk-MC7IE7D7.js → chunk-3HFENALW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-4UOXVFJZ.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7KK66ISG.js → chunk-5YPX3QKU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CPMSL4HS.js → chunk-6U5HP6L3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-DIEBSC76.js +3 -0
- package/dist/cli-bundle/focused-chunks/{chunk-WSOAASCY.js → chunk-I4YUZW3J.js} +8 -8
- package/dist/cli-bundle/focused-chunks/chunk-KBRSA4OK.js +44 -0
- package/dist/cli-bundle/focused-chunks/{chunk-AHWJPZSJ.js → chunk-KNF2QTEZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-LTPT5TE7.js +24 -0
- package/dist/cli-bundle/focused-chunks/chunk-O7K3X4LH.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-P4EHEH4C.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-P6TG33FV.js +82 -0
- package/dist/cli-bundle/focused-chunks/chunk-PL6EO4GJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-PSLDGAEY.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-SZ2BKK3M.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-TSHRBPTI.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-ULTSMJYF.js +91 -0
- package/dist/cli-bundle/focused-chunks/chunk-UNNLBJRI.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-UUVRYIKA.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-F62XGAAY.js → chunk-WPXMPGTY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-Z2QWZRSL.js +26 -0
- package/dist/cli-bundle/focused-chunks/item-revision-XNSRDTFB.js +2 -0
- package/dist/cli-bundle/focused-chunks/item-transaction-Q2Z7DDCR.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-admission-QWC6MLTZ.js +2 -0
- package/dist/cli-bundle/focused-chunks/stage-NKH5SKSZ.js +2 -0
- package/dist/cli-bundle/main.js +27 -26
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +4 -4
- 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 +57 -57
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +12 -12
- package/dist/core/extensions/flag-definition-validation.js +1 -1
- package/dist/core/extensions/reserved-host-flags.js +1 -1
- package/dist/core/history/history-stream-policy.d.ts +12 -3
- package/dist/core/history/history-stream-policy.js +1 -1
- package/dist/core/history/projection.d.ts +7 -2
- package/dist/core/history/projection.js +1 -1
- package/dist/core/item/item-format.d.ts +5 -1
- package/dist/core/item/item-format.js +2 -2
- package/dist/core/lock/lock.d.ts +1 -1
- package/dist/core/lock/lock.js +1 -1
- package/dist/core/output/output.d.ts +10 -1
- package/dist/core/output/output.js +7 -7
- package/dist/core/search/providers.d.ts +3 -2
- package/dist/core/search/providers.js +1 -1
- package/dist/core/search/vector-stores.d.ts +3 -2
- package/dist/core/search/vector-stores.js +1 -1
- package/dist/core/sentry/instrument.d.ts +2 -1
- package/dist/core/sentry/instrument.js +1 -1
- package/dist/core/store/item-mutation-precondition.d.ts +58 -0
- package/dist/core/store/item-mutation-precondition.js +1 -1
- package/dist/mcp/tool-definitions.js +1 -1
- package/dist/sdk/annotations.d.ts +44 -1
- package/dist/sdk/annotations.js +1 -1
- package/dist/sdk/authoring.d.ts +6 -0
- package/dist/sdk/authoring.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +15 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +6 -0
- package/dist/sdk/cli-contracts/runtime-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/command-line.d.ts +7 -2
- package/dist/sdk/command-line.js +1 -1
- package/dist/sdk/comments.d.ts +4 -2
- package/dist/sdk/comments.js +1 -1
- package/dist/sdk/completion/bash.js +1 -1
- package/dist/sdk/completion/fish.js +2 -1
- package/dist/sdk/completion/zsh.js +4 -1
- package/dist/sdk/context-intent-contracts.d.ts +5 -1
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/contracts.d.ts +3 -0
- package/dist/sdk/contracts.js +1 -1
- package/dist/sdk/core.d.ts +14 -0
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/corpus-shape.d.ts +2 -2
- package/dist/sdk/corpus-shape.js +1 -1
- package/dist/sdk/define.d.ts +14 -8
- package/dist/sdk/define.js +1 -1
- package/dist/sdk/extension/command-options.d.ts +123 -0
- package/dist/sdk/extension/command-options.js +2 -0
- package/dist/sdk/extension-contracts.d.ts +1 -2
- package/dist/sdk/extension-contracts.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance.d.ts +8 -0
- package/dist/sdk/governance.js +1 -1
- package/dist/sdk/graph.d.ts +5 -0
- package/dist/sdk/graph.js +1 -1
- package/dist/sdk/index.d.ts +61 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/learnings.d.ts +4 -2
- package/dist/sdk/learnings.js +1 -1
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/item-revision.d.ts +15 -4
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/lifecycle/restore.d.ts +1 -1
- package/dist/sdk/merge.d.ts +3 -0
- package/dist/sdk/merge.js +1 -1
- package/dist/sdk/notes.d.ts +4 -2
- package/dist/sdk/notes.js +1 -1
- package/dist/sdk/output/list-envelope.d.ts +18 -7
- package/dist/sdk/output/list-envelope.js +1 -1
- package/dist/sdk/output-projection.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/get.d.ts +16 -6
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/list.d.ts +5 -1
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/query/search/response.js +1 -1
- package/dist/sdk/query/search/semantic.d.ts +11 -3
- package/dist/sdk/query/search/semantic.js +1 -1
- package/dist/sdk/query/search-rendering.d.ts +9 -3
- package/dist/sdk/query/search-rendering.js +1 -1
- package/dist/sdk/query.d.ts +11 -0
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/read-output/continuation.d.ts +8 -0
- package/dist/sdk/read-output/continuation.js +1 -1
- package/dist/sdk/read-output/options.d.ts +1 -1
- package/dist/sdk/read-output/options.js +1 -1
- package/dist/sdk/read-output/surfaces.js +1 -1
- package/dist/sdk/read-output/tail-retention.d.ts +34 -0
- package/dist/sdk/read-output/tail-retention.js +2 -0
- package/dist/sdk/read-output-budget.d.ts +14 -2
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.d.ts +20 -4
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.d.ts +7 -3
- package/dist/sdk/read-output-rows.js +1 -1
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime.d.ts +26 -3
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/test/execution.d.ts +29 -2
- package/dist/sdk/test/execution.js +1 -1
- package/dist/sdk/testing.d.ts +14 -1
- package/dist/sdk/testing.js +1 -1
- package/dist/sdk/traceability/source-traceability.d.ts +4 -1
- package/dist/sdk/traceability/source-traceability.js +1 -1
- package/dist/sdk/workspace-recipe.d.ts +2 -2
- package/dist/sdk/workspace-recipe.js +1 -1
- package/docs/ARCHITECTURE.md +2 -1
- package/docs/CLOSE_EVIDENCE_RECOVERY.md +36 -2
- package/docs/COMMANDS.md +14 -2
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +1 -1
- package/docs/EXTENSIONS.md +1 -1
- package/docs/GET_READ_EVIDENCE.md +24 -3
- package/docs/MCP_OPTION_CONFORMANCE.md +13 -0
- package/docs/README.md +1 -1
- package/docs/READ_OUTPUT_CONTRACTS.md +78 -0
- package/docs/RELEASING.md +17 -0
- package/docs/SDK.md +124 -9
- package/docs/SDK_CONTEXT_INTEGRITY.md +2 -0
- package/docs/agent-task-token-baseline.json +1 -1
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +6 -6
- 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/dist/cli/after-command-context-usage.d.ts +0 -21
- package/dist/cli/argv-utils.d.ts +0 -12
- package/dist/cli/bootstrap-args.d.ts +0 -6
- package/dist/cli/bundle-integrity.d.ts +0 -49
- package/dist/cli/command-namespaces.d.ts +0 -9
- package/dist/cli/commander-usage.d.ts +0 -73
- package/dist/cli/commands/annotations/comments.d.ts +0 -2
- package/dist/cli/commands/annotations/docs.d.ts +0 -6
- package/dist/cli/commands/annotations/files.d.ts +0 -6
- package/dist/cli/commands/annotations/learnings.d.ts +0 -2
- package/dist/cli/commands/annotations/notes.d.ts +0 -2
- package/dist/cli/commands/extension/describe.d.ts +0 -2
- package/dist/cli/commands/extension/extension.d.ts +0 -6
- package/dist/cli/commands/extension/scaffold.d.ts +0 -2
- package/dist/cli/commands/extension/shared.d.ts +0 -2
- package/dist/cli/commands/governance/gc.d.ts +0 -6
- package/dist/cli/commands/governance/health.d.ts +0 -6
- package/dist/cli/commands/governance/telemetry.d.ts +0 -6
- package/dist/cli/commands/governance/validate.d.ts +0 -9
- package/dist/cli/commands/history/activity.d.ts +0 -6
- package/dist/cli/commands/history/history-compact.d.ts +0 -7
- package/dist/cli/commands/history/history-redact.d.ts +0 -8
- package/dist/cli/commands/history/history-repair.d.ts +0 -7
- package/dist/cli/commands/history/history.d.ts +0 -2
- package/dist/cli/commands/history/restore.d.ts +0 -6
- package/dist/cli/commands/lifecycle/append.d.ts +0 -6
- package/dist/cli/commands/lifecycle/claim.d.ts +0 -2
- package/dist/cli/commands/lifecycle/close-many.d.ts +0 -2
- package/dist/cli/commands/lifecycle/close.d.ts +0 -6
- package/dist/cli/commands/lifecycle/copy.d.ts +0 -6
- package/dist/cli/commands/lifecycle/create.d.ts +0 -10
- package/dist/cli/commands/lifecycle/delete.d.ts +0 -6
- package/dist/cli/commands/lifecycle/focus.d.ts +0 -6
- package/dist/cli/commands/lifecycle/plan.d.ts +0 -9
- package/dist/cli/commands/lifecycle/update-many.d.ts +0 -6
- package/dist/cli/commands/lifecycle/update.d.ts +0 -10
- package/dist/cli/commands/query/aggregate.d.ts +0 -2
- package/dist/cli/commands/query/context.d.ts +0 -6
- package/dist/cli/commands/query/deps.d.ts +0 -6
- package/dist/cli/commands/query/duplicates.d.ts +0 -6
- package/dist/cli/commands/query/eval.d.ts +0 -6
- package/dist/cli/commands/query/get.d.ts +0 -6
- package/dist/cli/commands/query/graph.d.ts +0 -7
- package/dist/cli/commands/query/list.d.ts +0 -6
- package/dist/cli/commands/query/next.d.ts +0 -6
- package/dist/cli/commands/query/search.d.ts +0 -6
- package/dist/cli/commands/query/stats.d.ts +0 -6
- package/dist/cli/commands/test/test-all.d.ts +0 -6
- package/dist/cli/commands/test/test-runs.d.ts +0 -6
- package/dist/cli/commands/test/test.d.ts +0 -6
- package/dist/cli/commands/workspace/config.d.ts +0 -6
- package/dist/cli/commands/workspace/contracts.d.ts +0 -2
- package/dist/cli/commands/workspace/init.d.ts +0 -6
- package/dist/cli/commands/workspace/merge.d.ts +0 -8
- package/dist/cli/commands/workspace/profile.d.ts +0 -6
- package/dist/cli/commands/workspace/schema.d.ts +0 -7
- package/dist/cli/commands/workspace/upgrade.d.ts +0 -2
- package/dist/cli/context-intent-invocation.d.ts +0 -2
- package/dist/cli/description-stdin.d.ts +0 -2
- package/dist/cli/error-guidance.d.ts +0 -276
- package/dist/cli/expected-revisions.d.ts +0 -55
- package/dist/cli/extension-command-help.d.ts +0 -137
- package/dist/cli/extension-command-options.d.ts +0 -37
- package/dist/cli/extension-command-options.js +0 -2
- package/dist/cli/extension-recovery.d.ts +0 -31
- package/dist/cli/help-content.d.ts +0 -57
- package/dist/cli/help-json-payload.d.ts +0 -83
- package/dist/cli/invocation-profile.d.ts +0 -26
- package/dist/cli/main.d.ts +0 -263
- package/dist/cli/migration-gates.d.ts +0 -55
- package/dist/cli/option-values.d.ts +0 -3
- package/dist/cli/preflight-warnings.d.ts +0 -11
- package/dist/cli/register-annotations.d.ts +0 -11
- package/dist/cli/register-assurance.d.ts +0 -8
- package/dist/cli/register-files-lookup.d.ts +0 -9
- package/dist/cli/register-history-activity.d.ts +0 -8
- package/dist/cli/register-history-author.d.ts +0 -8
- package/dist/cli/register-history-maintenance.d.ts +0 -9
- package/dist/cli/register-list-query.d.ts +0 -27
- package/dist/cli/register-mutation-options.d.ts +0 -10
- package/dist/cli/register-mutation.d.ts +0 -16
- package/dist/cli/register-operations.d.ts +0 -85
- package/dist/cli/register-setup.d.ts +0 -16
- package/dist/cli/register-structured-mutation.d.ts +0 -15
- package/dist/cli/registration-helpers.d.ts +0 -2
- package/dist/cli/runtime/activation.d.ts +0 -51
- package/dist/cli/runtime/field-route-retry.d.ts +0 -15
- package/dist/cli/runtime/invocation-options.d.ts +0 -43
- package/dist/cli/runtime/projection-retry.d.ts +0 -9
- package/dist/cli/runtime/selection.d.ts +0 -35
- package/dist/cli/runtime/telemetry-outcome.d.ts +0 -20
- package/dist/cli/runtime-compatibility-boundary.d.ts +0 -17
- package/dist/cli/schema/registration.d.ts +0 -4
- package/dist/cli/schema-registration-helpers.d.ts +0 -24
- package/dist/cli/search-refresh.d.ts +0 -2
- package/dist/cli/stats-analytics-json.d.ts +0 -9
- package/dist/cli/telemetry-flush.d.ts +0 -2
- package/dist/cli-bundle/chunks/chunk-5GWEY4P6.js +0 -122
- package/dist/cli-bundle/chunks/chunk-6VRX2CM7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-7ZRCYESH.js +0 -116
- package/dist/cli-bundle/chunks/chunk-AUEKTX7V.js +0 -6
- package/dist/cli-bundle/chunks/chunk-FRNMQM45.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HNGLDMSZ.js +0 -9
- package/dist/cli-bundle/chunks/chunk-QNWUIPBO.js +0 -31
- package/dist/cli-bundle/chunks/chunk-WC4M2H6R.js +0 -8
- package/dist/cli-bundle/chunks/chunk-YKXATU2G.js +0 -3
- package/dist/cli-bundle/chunks/item-revision-OJJVPQY7.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-TBKEATN6.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-MDSUU3G7.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-2KTJY7BV.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-4PW5XWVI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-C6P6HPCX.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CZM75DE3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-D2TBEBNW.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-E56OXRYH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-G4QP365K.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-G5PJCR7R.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-GS3JC5UU.js +0 -23
- package/dist/cli-bundle/focused-chunks/chunk-LW64TINU.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-M6V7UMWL.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-MG7C3JUY.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-MK4HV4JO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-O7EI33NP.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-RFTJZ5VB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-SNOXXRSJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-UPJUTP2V.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-VWWTIX5L.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-XHOBYCVE.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-YMGB2O4E.js +0 -81
- package/dist/cli-bundle/focused-chunks/item-revision-CTDO4H3I.js +0 -2
- package/dist/cli-bundle/focused-chunks/item-transaction-H2XACBOP.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-4WM7TNHZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/stage-WV7QXR4C.js +0 -2
- package/dist/cli.d.ts +0 -13
- package/dist/core/checkpoint/checkpoint-gc.d.ts +0 -61
- package/dist/core/checkpoint/mutation-context.d.ts +0 -10
- package/dist/core/diagnostics/remediation.d.ts +0 -52
- package/dist/core/extensions/activation-transaction.d.ts +0 -22
- package/dist/core/extensions/command-visibility-tier.d.ts +0 -8
- package/dist/core/extensions/exporter-output-contract.d.ts +0 -12
- package/dist/core/extensions/extension-candidate.d.ts +0 -26
- package/dist/core/extensions/extension-runtime-helpers.d.ts +0 -16
- package/dist/core/extensions/module-graph-snapshot.d.ts +0 -19
- package/dist/core/extensions/preflight-ownership.d.ts +0 -5
- package/dist/core/extensions/read-output-contract.d.ts +0 -5
- package/dist/core/extensions/reserved-host-flags.d.ts +0 -18
- package/dist/core/extensions/service-ownership.d.ts +0 -8
- package/dist/core/extensions/version-diagnostics.d.ts +0 -2
- package/dist/core/fs/atomic-create.d.ts +0 -7
- package/dist/core/fs/index.d.ts +0 -6
- package/dist/core/fs/path-utils.d.ts +0 -2
- package/dist/core/history/drift-cache.d.ts +0 -4
- package/dist/core/history/drift-scan.d.ts +0 -51
- package/dist/core/history/index.d.ts +0 -6
- package/dist/core/history/tombstone.d.ts +0 -3
- package/dist/core/history/version-address.d.ts +0 -13
- package/dist/core/item/index.d.ts +0 -9
- package/dist/core/item/item-type-definition.d.ts +0 -51
- package/dist/core/item/toon-decode.d.ts +0 -25
- package/dist/core/lock/index.d.ts +0 -6
- package/dist/core/lock/lock-confinement.d.ts +0 -55
- package/dist/core/lock/lock-gc.d.ts +0 -93
- package/dist/core/output/mutation-projection.d.ts +0 -13
- package/dist/core/output/query-summary.d.ts +0 -30
- package/dist/core/search/staleness.d.ts +0 -23
- package/dist/core/sentry/sensitive-assignments.d.ts +0 -9
- package/dist/core/shared/conflict-markers.d.ts +0 -18
- package/dist/core/shared/index.d.ts +0 -9
- package/dist/core/shared/memo.d.ts +0 -7
- package/dist/core/store/index.d.ts +0 -9
- package/dist/core/store/settings-concurrency.d.ts +0 -7
- package/dist/core/telemetry/read-sampling.d.ts +0 -8
- package/dist/core/test/item-test-run-tracking.d.ts +0 -12
- package/dist/core/validate/estimate-defaults.d.ts +0 -21
- package/dist/core/validate/linked-artifact-reference.d.ts +0 -20
- package/dist/mcp/http-server.d.ts +0 -60
- package/dist/mcp/legacy-adapter.d.ts +0 -59
- package/dist/mcp/runtime-capabilities.d.ts +0 -57
- package/dist/mcp/server.d.ts +0 -101
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +0 -23
- package/dist/sdk/cli-contracts/registration-helpers.d.ts +0 -123
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +0 -796
- package/dist/sdk/cli-contracts/string-lists.d.ts +0 -9
- package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +0 -35
- package/dist/sdk/context/usage-egress.d.ts +0 -9
- package/dist/sdk/dependencies/context-budget-recovery.d.ts +0 -21
- package/dist/sdk/dependency-flag-validation.d.ts +0 -32
- package/dist/sdk/extension/author-manifest.d.ts +0 -22
- package/dist/sdk/extension/bundled-catalog.d.ts +0 -35
- package/dist/sdk/extension/concurrency.d.ts +0 -7
- package/dist/sdk/extension/copy-scope.d.ts +0 -2
- package/dist/sdk/extension/custom-field-collisions.d.ts +0 -6
- package/dist/sdk/extension/install-receipts.d.ts +0 -7
- package/dist/sdk/extension/install-snapshot.d.ts +0 -34
- package/dist/sdk/extension/managed-update-status.d.ts +0 -3
- package/dist/sdk/extension/runtime-summary.d.ts +0 -9
- package/dist/sdk/extension/scaffold.d.ts +0 -38
- package/dist/sdk/generated/error-code-catalog-rows.d.ts +0 -39
- package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +0 -8
- package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +0 -8
- package/dist/sdk/governance/assurance-limits.d.ts +0 -7
- package/dist/sdk/governance/defect-recurrence-signals.d.ts +0 -10
- package/dist/sdk/governance/health-merge-evidence.d.ts +0 -23
- package/dist/sdk/governance/tracked-runtime-cache.d.ts +0 -24
- package/dist/sdk/governance/validate-history-drift.d.ts +0 -7
- package/dist/sdk/history/attestation-scan.d.ts +0 -16
- package/dist/sdk/history-mcp.d.ts +0 -17
- package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +0 -15
- package/dist/sdk/lifecycle/core-field-recovery.d.ts +0 -33
- package/dist/sdk/lifecycle/core-item-fields.d.ts +0 -6
- package/dist/sdk/lifecycle/event-validation-messages.d.ts +0 -6
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +0 -15
- package/dist/sdk/lifecycle/legacy-none-tokens.d.ts +0 -71
- package/dist/sdk/lifecycle/mcp-actions.d.ts +0 -24
- package/dist/sdk/lifecycle/metadata-normalizers.d.ts +0 -8
- package/dist/sdk/lifecycle/mutation-facet-contracts.d.ts +0 -6
- package/dist/sdk/lifecycle/mutation-option-validation.d.ts +0 -2
- package/dist/sdk/lifecycle/recurrence-parsers.d.ts +0 -34
- package/dist/sdk/lifecycle/release-handoff.d.ts +0 -12
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.d.ts +0 -18
- package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +0 -45
- package/dist/sdk/merge/abandoned-receipts.d.ts +0 -15
- package/dist/sdk/merge/history-scalar-rebase.d.ts +0 -9
- package/dist/sdk/merge/ignored-artifacts.d.ts +0 -13
- package/dist/sdk/merge/indexed-receipt-blobs.d.ts +0 -4
- package/dist/sdk/merge/receipt-file-boundary.d.ts +0 -23
- package/dist/sdk/merge/settlement-hook.d.ts +0 -12
- package/dist/sdk/merge/stage.d.ts +0 -13
- package/dist/sdk/merge/worktree-config.d.ts +0 -11
- package/dist/sdk/query/light-metadata.d.ts +0 -3
- package/dist/sdk/query/window-pagination.d.ts +0 -20
- package/dist/sdk/read-output/extension.d.ts +0 -7
- package/dist/sdk/read-output/provenance.d.ts +0 -20
- package/dist/sdk/read-output/surfaces.d.ts +0 -27
- package/dist/sdk/runtime/actions.d.ts +0 -4
- package/dist/sdk/runtime/mutation-admission.d.ts +0 -2
- package/dist/sdk/runtime/mutation-value-validation.d.ts +0 -16
- package/dist/sdk/runtime/schema.d.ts +0 -4
- package/dist/sdk/runtime-action-aliases.d.ts +0 -7
- package/dist/sdk/runtime-extended-actions.d.ts +0 -27
- package/dist/sdk/runtime-stats-options.d.ts +0 -9
- package/dist/sdk/test/command-args.d.ts +0 -4
- package/dist/sdk/test/command-resolution.d.ts +0 -5
- package/dist/sdk/test/entry.d.ts +0 -18
- package/dist/sdk/test/execution-receipts.d.ts +0 -34
- package/dist/sdk/test/receipt-index-snapshot.d.ts +0 -2
- package/dist/sdk/test/workspace-snapshot.d.ts +0 -11
- package/dist/sdk/traceability/runtime-files-lookup.d.ts +0 -8
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +0 -472
package/dist/sdk/index.js
CHANGED
|
@@ -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]="e8053a05-36e4-58a6-ad9c-6d03ef7435db")}catch{}})();import{isItemAlreadyExistsError,isPmTokenBudgetRecovery,PM_CLI_ERROR_DETAILS_LIMITS,isPmCliErrorDetails,projectPmCliErrorDetails,projectPmCliErrorContextDetails,snapshotPmCliErrorContext}from"./errors.js";import{PM_COMMAND_CAPABILITY_CONTRACTS,PM_COMMAND_VISIBILITY_CONTRACTS,PM_MCP_PROMPT_CONTRACTS,PM_MCP_RESOURCE_CONTRACTS,PM_MCP_TOOL_COMMAND_CONTRACTS,listPmCommandsForFamily,listPmCommandsForTier,listPmMcpToolsForProfile,renderPmCommandVisibilityMarkdown,resolvePmCommandCapabilityFamily,resolvePmCommandVisibilityTier}from"./agent-capability-contracts.js";export*from"./mcp/protocol.js";export*from"./mcp/executable.js";export*from"./mcp/interactions.js";export*from"./mcp/tasks.js";export*from"./mcp/subscriptions.js";export*from"./mcp/transport.js";export*from"./mcp/authorization.js";export*from"./mcp/apps.js";export*from"./mcp/skills.js";export*from"./cli-contracts/grammar-contracts.js";export*from"./agent-session-context.js";export*from"./environment/agent-environment.js";import{isErrnoError,limitAnnotationEntries,parseAnnotationTextInput,readAnnotationEntries,normalizeAnnotationTransportOptions,resolveAnnotationInput,resolveAnnotationIndex,runAnnotationCommand,wrapOwnershipConflict}from"./annotations.js";import{acknowledgeUnknownAuthorHistoryEvents,acknowledgeUnknownAuthorHistoryEventsFromTransport,inspectHistoryAuthorStream,parseUnknownAuthorHistoryEventCoordinates,planUnknownAuthorHistoryAcknowledgment,resolveUnknownAuthorAcknowledgmentSelector,scanHistoryAuthorAttribution}from"./author-attribution.js";import{BUILTIN_CORPUS_SHAPES,PM_CORPUS_SHAPE_SCHEMA,buildCorpusShapeItemPlan,createCorpusShapeMeasurement,defineCorpusShape,listBuiltinCorpusShapes,measureCorpusShapePlan,resolveBuiltinCorpusShape}from"./corpus-shape.js";export*from"./core-governance.js";import{createPmCliProgram}from"./cli-program.js";import{runSearchRefreshWorkerEntrypoint}from"./search-refresh-worker.js";import{PM_REPRODUCIBLE_PROCESS_ENV,createReproducibleProcessRunner,resolveReproducibleProcessEnvironment,runWithReproducibleProcessEnvironment}from"./reproducibility/process.js";import{PM_WORKSPACE_RECIPE_SCHEMA,defineWorkspaceRecipe,executeWorkspaceRecipe,runWithWorkspaceRecipe}from"./workspace-recipe.js";import{SNAPSHOT_SCHEMA,WORKSPACE_SNAPSHOT_ACTIONS,createWorkspaceSnapshot,deleteWorkspaceSnapshot,inspectWorkspaceSnapshot,listWorkspaceSnapshots,planWorkspaceSnapshotRestore,restoreWorkspaceSnapshot,restoreWorkspaceSnapshotWithRecovery}from"./workspace-snapshot.js";import{flushTelemetryQueue}from"./telemetry-flush.js";import{PM_HISTORY_COMMAND_ALIASES,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_RELOCATED_COMMAND_ALIASES,PM_NAMESPACED_COMMAND_ALIASES,findPmNamespacedCommand,resolvePmCommandOperation,resolvePmHistoryOperation}from"./cli-contracts.js";import{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,applyBootstrapPagerPolicy,coalesceRepeatedListFlags,listAliasPluralKeys,mergeLinkedTestTwoTokenEntries,normalizeBootstrapInvocation,normalizeLegacyExtensionActionSyntax,parseBootstrapCommandName,parseBootstrapGlobalOptions,parseBootstrapHelpRequest,parseBootstrapTypeValue,stripGlobalBootstrapTokens}from"./cli-bootstrap.js";import{quoteCommandArg,quoteWindowsCommandArg,renderPmCommand,resolvePmCommandScopeArgs}from"./command-line.js";export*from"./agent/command-recovery.js";export*from"./agent/linked-resource-recovery.js";export*from"./agent/command-suggestions.js";export*from"./agent/item-addressing.js";export*from"./agent/create-option-policy.js";import{runGc}from"./governance/gc.js";import{PM_EXACT_COVERAGE_METRICS,findCoverageDeficits}from"./governance/coverage-assurance.js";import{_testOnlyHealthCommand,runHealth}from"./governance/health.js";import{_testOnlyValidateCommand,projectValidateCounts,runValidate}from"./governance/validate.js";import{runExtension}from"./extension.js";import{inspectStaticExtensionInventory}from"./extension/static-inventory.js";import{buildExtensionInstallPlan,planExtensionDirectoryCopy}from"./extension/install-plan.js";import{resolveExtensionInstallSourceIdentity}from"./extension/source-resolution.js";import{applyStoredExtensionMigrationState,readExtensionMigrationState,resolveExtensionMigrationStatePath,runExtensionMigrateAction,runExtensionMigrations}from"./extension/migrations.js";import{findInstalledNpmPackageCandidate}from"./extension/install-sources.js";import{buildExtensionDescribeResult,renderExtensionDescribeMarkdown}from"./extension/describe.js";import{runEvent,runMeet,runRemind}from"./scheduling-shortcuts.js";import{createExtensionCommandSdk}from"./extension-command-context.js";import{isRuntimeRecord}from"./runtime-input.js";import{resolveStartTaskInProgressStatus}from"./start-task-status.js";import{auditMergeAttributeFence,buildMergeAttributePatterns,findGitWorkspaceRoot,installMergeFence,refreshMergeAttributeFenceIfInstalled,resolveMergeInstallContext,resolveProjectMergeTypeFolders,runMergeInstall}from"./merge/install.js";import{deriveSchemaEvolutionMigrationId,formatSchemaEvolutionMigrationHuman,planSchemaEvolutionMigration,runSchemaEvolutionMigration}from"./schema-migration.js";import{runWithActiveExtensions}from"./runtime.js";import{applyInvocationAuthorOverride}from"./invocation-author.js";import{describeItemRevisionChanges,isItemRevisionConflict,ITEM_REVISION_CONFLICT_CHANGE_LIMIT,ITEM_REVISION_CONFLICT_CODE,normalizeExpectedItemHash,parseExpectHashSpecs,readItemRevision,withExpectedItemRevisions}from"./lifecycle/item-revision.js";import{admitStartWithOpenBlockers,isStartTransition,START_BLOCKED_REFUSAL_CODE,START_BLOCKER_ENFORCEMENT_DEFAULT}from"./lifecycle/start-blockers.js";import{resolveDeclaredBlockers}from"./query/declared-blockers.js";import{evaluateMutationGuard,getMutationActionContract,isMutationAction,listMutationActions,PM_MUTATION_ACTION_CONTRACTS,scanMutationSecrets}from"./mutation-guard.js";import{findSimilarItems,findDuplicateClusters,evaluateSimilarityGovernance,similarityAdvisoryWarnings,jaccardSimilarity,normalizeSimilarityText,prepareSimilarityText,scoreItemSimilarity,scorePreparedItemSimilarity,tokenizeSimilarityText}from"./similarity.js";import{inspectStaleInProgressItems,scanStaleInProgressItems}from"./governance/stale-work.js";import{describeItemOwnershipConflict,resolveItemOwnershipConflict}from"./ownership-source.js";import{discoverNearbyPmRoot}from"./tracker-root-discovery.js";import{assertInitializedTracker,assertReadableTrackerRoot,buildTrackerInitializationRecovery}from"./environment/tracker-preflight.js";import{_testOnly}from"./templates.js";import{runConfig,_testOnlyConfigCommand}from"./config.js";export*from"./agent/identity-config.js";import{INIT_AGENT_GUIDANCE_MODE_VALUES,runInitAgentGuidance,_testOnly as _testOnly2}from"./init-agent-guidance.js";import{runInit,summarizeInitResult,_testOnly as _testOnly3}from"./init.js";import{PROFILE_SUBCOMMANDS,formatProfileApplyHuman,formatProfileLintHuman,formatProfileListHuman,formatProfileShowHuman,runProfileApply,runProfileLint,runProfileList,runProfileShow}from"./profile.js";export*from"./extension-contracts.js";import{RESERVED_ITEM_FIELD_NAMES}from"../core/extensions/item-fields.js";import{PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,PM_PACKAGE_RESOURCE_KINDS,collectPackageExtensionDirectories,readPmPackageManifest}from"../core/packages/manifest.js";import{ACTIVITY_FLAG_CONTRACTS,ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,CLOSE_ACTION_OPTION_KEYS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,CREATE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,LIST_COMMANDER_STRING_OPTION_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PLAN_FLAG_CONTRACTS,PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_CORE_COMMAND_NAMES,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_ITEM_ACTION_SUBCOMMANDS,PM_DEPRECATED_TOOL_ACTIONS,PM_DISCOVERABLE_TOOL_ACTIONS,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_ACTIONS,analyzePmToolActionParity,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,PROFILE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,verifyToolOptionCliParity,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,buildPmActionToolInputSchema,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,compactFlagAliasContracts,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,inferPmOutputBudgetClass,projectPmDiagnosticOutput,projectPmDiagnosticText,PM_GENERIC_REFUSAL_GUIDANCE,PM_RECOVERY_ECHO_FIELDS,isGenericRefusalRequired,isGenericRefusalWhy,projectLeanRecoveryPayload,withoutGenericRefusalExamples,analyzeSdkCliParameterCompleteness,isPmExtensionCapabilityContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract,isPmExtensionServiceNameContract,isPmToolAction,hasSubcommandFlagContractsForCommand,readFirstStringFromCommanderOptions,readFirstValueFromCommanderOptions,readStringArrayFromCommanderOptions,resolvePmPositionalActionFlagContracts,resolveSubcommandFlagContractsForCommand,resolvePmCommandOutputBudget,resolvePmDiagnosticOutputBudget,resolvePmToolCustomFieldCollision,toCompletionFlagString,withFlagAliasMetadata}from"./cli-contracts.js";export*from"./compose.js";export*from"./governance/assurance.js";export*from"./governance/assurance-action.js";export*from"./governance/assurance-runtime.js";export*from"./governance/assurance-presets.js";export*from"./governance/boundary-fixtures.js";export*from"./governance/defect-recurrence.js";export*from"./governance/merge-receipt-history.js";export*from"./compile-cache.js";export*from"./environment/project-runtime-compatibility.js";export*from"./environment/source-context.js";export*from"./environment/host-environment-errors.js";export*from"./cli-contracts/command-exit-contracts.js";export*from"./context-relevance.js";export*from"./context/recency.js";export*from"./context-intent-contracts.js";export*from"./context-intent-runtime.js";export*from"./context-signal-store.js";export*from"./workspace-memory.js";export*from"./lifecycle-completion.js";export*from"./lifecycle-policy.js";export*from"./output-projection.js";export*from"./read-output-contracts.js";export*from"./read-output-rows.js";export*from"./read-output-session.js";export*from"./output-token-accounting.js";export*from"./output/fit-envelope.js";export*from"./context-packing.js";export*from"./context-usage.js";import{classifyHistoryEvent,HISTORY_EVENT_CLASSIFICATION_VERSION,MAINTENANCE_HISTORY_OPERATIONS,SUBSTANTIVE_HISTORY_OPERATIONS}from"../core/history/event-classification.js";export*from"./dependency-provenance.js";export*from"./duplicates.js";export*from"./lifecycle/reopen.js";export*from"./history-compact.js";export*from"./history-read.js";export*from"../core/history/operation-contract.js";export*from"./history/maintenance.js";import{readHistorySnapshot}from"../core/history/read.js";export*from"./history-provenance.js";export*from"./mutation-events.js";export*from"./history-redact.js";import{_testOnly as _testOnly4}from"./history-redact.js";export*from"./history-repair.js";export*from"./item-children.js";export*from"./item-schedule.js";export*from"./merge/index.js";import{runDeps}from"./dependencies.js";export*from"./graph/index.js";import{runDocs}from"./docs.js";import{runFiles,runFilesDiscover,runFilesLookup}from"./files.js";import{applyPathMigrations,applyStandaloneNote,artifactKey,assertLinkedArtifactMutationIsUnambiguous,dedupeLinkedArtifacts,ensureScope,expandAddGlobEntries,normalizeLinkedPath,parseAddEntries,parseAddGlobEntries,parseMigrateEntries,parseRemoveEntries,renameArtifactsResultKey,runLinkedArtifacts,sortLinkedArtifacts,validateLinkedPaths}from"./linked-artifacts.js";export*from"./pagination.js";export*from"./query/item-filter-options.js";export*from"./query/parsers.js";export*from"./output.js";export*from"./output-contracts.js";export*from"./agent/task-transcript-contracts.js";export*from"./relationship-analytics.js";export*from"./relationship-context.js";export*from"./relationship-history.js";export*from"./relationship-migration.js";export*from"./workspace-transaction.js";export*from"./workspace-transaction-gc.js";export*from"./item-transaction.js";export*from"./item-metadata-index.js";export*from"./structured-mutations.js";export*from"./lifecycle/structured-mutation-plan.js";export*from"./runtime-primitives.js";export*from"./error-runtime.js";export*from"./error-code-catalog.js";export*from"./generated-error-code-catalog.js";export*from"./agent/refusal-reachability.js";export*from"./agent/refusal-closure-census.js";export*from"./agent/refusal-closure.js";export*from"./agent/closed-domain-contracts.js";export*from"./agent/refusal-corpus-contracts.js";import{MERGE_SUBCOMMAND_VALUES}from"./cli-contracts.js";export*from"./agent/tracker-preflight-contracts.js";export*from"./agent/subcommand-recovery.js";export*from"./flag-invocation-contracts.js";export*from"./cli-contracts/flag-lexicon-contracts.js";export*from"./relationships.js";export*from"./actionability.js";import{runCreate}from"./lifecycle/create.js";import{runPlan}from"./lifecycle/plan.js";import{runAppend}from"./lifecycle/append.js";import{isAlreadyClaimedError,runClaim,runClaimNext,runRelease}from"./lifecycle/claim.js";import{runStartTask,runPauseTask,runCloseTask}from"./lifecycle/task-composition.js";import{runCloseMany}from"./lifecycle/close-many.js";import{runUpdateMany}from"./lifecycle/update-many.js";import{runComments}from"./comments.js";import{runNotes}from"./notes.js";import{runLearnings}from"./learnings.js";import{runUpgrade}from"./governance/upgrade.js";import{PLAN_SHOW_DEPTH_VALUES,PLAN_SUBCOMMANDS,PLAN_TEMPLATE_NAMES}from"./lifecycle/plan.js";export*from"./define.js";import{BASELINE_ITEM_FORMAT_VERSION,BUILTIN_ITEM_TYPE_VALUES,CONFIDENCE_TEXT_VALUES,CURRENT_ITEM_FORMAT_VERSION,DEPENDENCY_KIND_VALUES,EXIT_CODE,ISSUE_SEVERITY_VALUES,ITEM_TYPE_VALUES,PM_CLI_EXPECTED_ERROR_NAME,PmCliError,PmClient,RISK_VALUES,STATUS_VALUES,acquireLock,acquireLockLease,appendHistoryEntry,canonicalDocument,classifyItemFormatVersion,clearWorkspaceContractsCache,commitImportedItem,createHistoryEntry,createPmCliExpectedError,effectiveItemFormatVersion,emptyImportedDocument,ensureTrackerInitialized,generateItemId,getActiveExtensionRegistrations,getContracts,getHistoryPath,getItemPath,getSettingsPath,getWorkspaceContracts,isPmCliExpectedError,isTimestampLiteral,listAllItemMetadata,loadCreateTemplateOptions,locateItem,normalizeItemMetadata,normalizeItemFormatVersion,normalizeItemId,normalizeRawItemId,normalizeStatusInput,nowIso,parseTags,pathExists,readBooleanOption,readCsvListOption,readFileIfExists,readLocatedItem,readRequiredString,readSettings,readStringOption,removeFileIfExists,renderCalendarMarkdown,renderCalendarToon,renderGuideMarkdown,resolveCalendarOutputFormat,resolveGuideOutputFormat,resolveItemTypeRegistry,resolveImplicitPmRoot,resolvePmRoot,resolveRuntimeFieldRegistry,resolveRuntimeStatusRegistry,runAction,runActiveOnReadHooks,runActiveOnWriteHooks,runCalendar,runCompletion,runGuide,runList,runReindex,runSearch,runTemplatesList,runTemplatesSave,runTemplatesShow,runTestRunsList,runTestRunsLogs,runTestRunsResume,runTestRunsStatus,runTestRunsStop,scanItemFormatVersions,selectImportAuthor,serializeItemDocument,splitFrontMatter,toEstimatedMinutesValue,toImportBoolean,toImportConfidence,toImportInteger,toImportLinkedDocs,toImportLinkedFiles,toImportLinkedTests,toImportLogEntries,toImportNormalizedEnum,toImportNumberMap,toImportPriority,toImportStatus,toImportStringList,toImportStringMap,toImportTags,toNonEmptyImportString,writeFileAtomic,aggregate,append,claim,claimNext,close,reopen,closeTask,comments,config,context,copy,create,deleteItem,deps,docs,duplicates,extension,extensionActivate,extensionDeactivate,extensionList,files,filesDiscover,filesLookup,focus,gc,get,graph,health,historyCompact,historyCompactBulk,historyRedact,historyRepair,historyRepairAll,init,learnings,list,listAllComplete,next,notes,packageActivate,packageCatalog,packageDeactivate,packageDescribe,packageDoctor,packageInstall,packageLifecycle,packageList,packageManage,packageReload,packageUninstall,pauseTask,profile,profileApply,profileLint,profileList,profileShow,release,restore,schema,schemaAddField,schemaAddStatus,schemaAddType,schemaApplyPreset,schemaInferTypes,schemaList,schemaListFields,schemaRemapStatus,schemaRemoveField,schemaRemoveStatus,schemaRemoveType,schemaShow,schemaShowField,schemaShowStatus,schemaRenameField,schemaRenameType,search,startTask,stats,update,upgrade,validate}from"./runtime.js";import{extensionMigrate,packageMigrate}from"./package-migrations.js";import{CONTEXT_OUTPUT_VALUES,NEXT_OUTPUT_VALUES,PM_GITIGNORE_END,PM_GITIGNORE_START,analyzeSdkActionCoverage,ensurePmGitignore,getPmGitignoreBlock,closeItem,runAggregate,runClose,runCopy,runContext,runDelete,runFocus,runGet,runNext,runRestore,runUpdate}from"./runtime.js";import{runStats}from"./stats.js";import{readImprovementLedger,recordImprovementObservation}from"./improvement-ledger.js";import{evaluateProvenanceCoverage,projectFleetAttributionAnalytics,projectProvenanceCoverageAnalytics,readHistoryAnalyticsWindow,runFleetAttributionAnalytics,runProvenanceCoverageAnalytics}from"./history-analytics.js";import{DEFAULT_EVAL_QUERIES_RELATIVE_PATH,EVAL_QUERY_SET_CONTRACT,EVAL_QUERY_SET_EXAMPLE,EVAL_QUERY_SET_SCHEMA_ID,parseEvalQuerySet,runEval}from"./eval.js";import{runTelemetry,TELEMETRY_SUBCOMMANDS}from"./telemetry.js";import{classifyLinkedTestCommandSafety,classifyLinkedTestFailure,countFailureCategories,extractReferencedPmItemIdsFromCommand,resolveLinkedTestFailureExitCode,runLinkedTests,runTest,summarizeContextPreflight}from"./test/execution.js";import{assertTestMeasurementRun}from"./test/prerequisites.js";import{TEST_RUN_MEASUREMENT_LIMIT,diffTestRunMeasurements,parseTestRunMeasurements,queryTestRunMeasurementsBelow}from"./test/measurements.js";import{runTestAll}from"./test/batch.js";import{LINKED_TEST_ENV_NAME_PATTERN,LINKED_TEST_PM_CONTEXT_MODE_VALUES,LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,LINKED_TEST_PROTECTED_ENV_KEYS,parseLinkedTestAssertionEqualsMap,parseLinkedTestAssertionGteMap,parseLinkedTestBoolean,parseLinkedTestContextMode,parseLinkedTestEnvClear,parseLinkedTestEnvSet,parseLinkedTestJsonEntries,parseLinkedTestMinLines,parseLinkedTestRegexList,parseLinkedTestStringList,parseLinkedTestWorkspaceContextMode}from"./test/parsers.js";import{acknowledgeLinkedTests,attachLinkedTestMutationProvenance,attachLinkedTestProvenance,linkedTestTrustFingerprint,resolveLinkedTestSourceRef,resolveLinkedTestSourceWorkspaceRoot,resolveLinkedTestTrust,resolveLinkedTestTrustBatch}from"./test/trust.js";import{updateLinkedTest}from"./test/update.js";import{runStartBackgroundRun,runTestRunsWorker}from"./test/runs.js";import{BUILTIN_PROFILES,listProfiles,normalizeProfileName,PROFILE_NAMES,resolveProfile}from"../core/profile/profile-presets.js";import{planProfileApplication}from"../core/profile/profile-plan.js";import{describeProfileComposition,describeProjectProfile}from"../core/profile/profile-describe.js";import{lintProjectProfile,PROFILE_LINT_CODES,PROFILE_LINT_DIMENSIONS}from"../core/profile/profile-lint.js";export*from"./authoring.js";export*from"./governance.js";export*from"./mcp/discovery.js";export*from"./query.js";export*from"./testing.js";export{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,ACTIVITY_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,BASELINE_ITEM_FORMAT_VERSION,BUILTIN_CORPUS_SHAPES,BUILTIN_ITEM_TYPE_VALUES,BUILTIN_PROFILES,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,CLOSE_ACTION_OPTION_KEYS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,CONFIDENCE_TEXT_VALUES,CONFIG_FLAG_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_FLAG_CONTRACTS,CONTEXT_OUTPUT_VALUES,CONTRACTS_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,CREATE_FLAG_CONTRACTS,CURRENT_ITEM_FORMAT_VERSION,DEFAULT_EVAL_QUERIES_RELATIVE_PATH,DELETE_FLAG_CONTRACTS,DEPENDENCY_KIND_VALUES,DEPS_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,EVAL_QUERY_SET_CONTRACT,EVAL_QUERY_SET_EXAMPLE,EVAL_QUERY_SET_SCHEMA_ID,EVENTS_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EXECUTABLE_COMMAND_ALIASES,EXIT_CODE,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,HISTORY_EVENT_CLASSIFICATION_VERSION,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,INIT_AGENT_GUIDANCE_MODE_VALUES,INIT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,ISSUE_SEVERITY_VALUES,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,ITEM_REVISION_CONFLICT_CHANGE_LIMIT,ITEM_REVISION_CONFLICT_CODE,ITEM_TYPE_VALUES,LEARNINGS_FLAG_CONTRACTS,LINKED_TEST_ENV_NAME_PATTERN,LINKED_TEST_PM_CONTEXT_MODE_VALUES,LINKED_TEST_PROTECTED_ENV_KEYS,LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,LIST_COMMANDER_STRING_OPTION_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,MAINTENANCE_HISTORY_OPERATIONS,MEET_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,MERGE_SUBCOMMAND_VALUES,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_FLAG_CONTRACTS,NEXT_OUTPUT_VALUES,NOTES_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PLAN_FLAG_CONTRACTS,PLAN_SHOW_DEPTH_VALUES,PLAN_SUBCOMMANDS,PLAN_TEMPLATE_NAMES,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_CLI_ERROR_DETAILS_LIMITS,PM_CLI_EXPECTED_ERROR_NAME,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_COMMAND_ALIAS_CONTRACTS,PM_COMMAND_CAPABILITY_CONTRACTS,PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_COMMAND_VISIBILITY_CONTRACTS,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_CORE_COMMAND_NAMES,PM_CORPUS_SHAPE_SCHEMA,PM_DEPRECATED_TOOL_ACTIONS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_DISCOVERABLE_TOOL_ACTIONS,PM_EXACT_COVERAGE_METRICS,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_GENERIC_REFUSAL_GUIDANCE,PM_GITIGNORE_END,PM_GITIGNORE_START,PM_HISTORY_COMMAND_ALIASES,PM_ITEM_ACTION_SUBCOMMANDS,PM_MCP_PROMPT_CONTRACTS,PM_MCP_RESOURCE_CONTRACTS,PM_MCP_TOOL_COMMAND_CONTRACTS,PM_MUTATION_ACTION_CONTRACTS,PM_NAMESPACED_COMMAND_ALIASES,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_PACKAGE_RESOURCE_KINDS,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_RECOVERY_ECHO_FIELDS,PM_RELOCATED_COMMAND_ALIASES,PM_REPRODUCIBLE_PROCESS_ENV,PM_TOOL_ACTIONS,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,PM_WORKSPACE_RECIPE_SCHEMA,PROFILE_FLAG_CONTRACTS,PROFILE_LINT_CODES,PROFILE_LINT_DIMENSIONS,PROFILE_NAMES,PROFILE_SUBCOMMANDS,PmCliError,PmClient,REINDEX_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,RESERVED_ITEM_FIELD_NAMES,RESTORE_FLAG_CONTRACTS,RISK_VALUES,SCHEMA_FLAG_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_FLAG_CONTRACTS,SNAPSHOT_SCHEMA,START_BLOCKED_REFUSAL_CODE,START_BLOCKER_ENFORCEMENT_DEFAULT,START_TASK_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,STATUS_VALUES,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,SUBSTANTIVE_HISTORY_OPERATIONS,TELEMETRY_FLAG_CONTRACTS,TELEMETRY_SUBCOMMANDS,TEST_ALL_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,TEST_RUN_MEASUREMENT_LIMIT,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,WORKSPACE_SNAPSHOT_ACTIONS,_testOnly4 as _testOnly,_testOnlyConfigCommand,_testOnlyHealthCommand,_testOnly3 as _testOnlyInit,_testOnly2 as _testOnlyInitAgentGuidance,_testOnly as _testOnlyTemplates,_testOnlyValidateCommand,acknowledgeLinkedTests,acknowledgeUnknownAuthorHistoryEvents,acknowledgeUnknownAuthorHistoryEventsFromTransport,acquireLock,acquireLockLease,admitStartWithOpenBlockers,aggregate,analyzePmToolActionParity,analyzeSdkActionCoverage,analyzeSdkCliParameterCompleteness,append,appendHistoryEntry,applyBootstrapPagerPolicy,applyInvocationAuthorOverride,applyPathMigrations,applyStandaloneNote,applyStoredExtensionMigrationState,artifactKey,assertInitializedTracker,assertLinkedArtifactMutationIsUnambiguous,assertReadableTrackerRoot,assertTestMeasurementRun,attachLinkedTestMutationProvenance,attachLinkedTestProvenance,auditMergeAttributeFence,buildCorpusShapeItemPlan,buildExtensionDescribeResult,buildExtensionInstallPlan,buildMergeAttributePatterns,buildPmActionToolInputSchema,buildTrackerInitializationRecovery,canonicalDocument,claim,claimNext,classifyHistoryEvent,classifyItemFormatVersion,classifyLinkedTestCommandSafety,classifyLinkedTestFailure,clearWorkspaceContractsCache,close,closeItem,closeTask,coalesceRepeatedListFlags,collectPackageExtensionDirectories,comments,commitImportedItem,compactFlagAliasContracts,config,context,copy,countFailureCategories,create,createCorpusShapeMeasurement,createExtensionCommandSdk,createHistoryEntry,createPmCliExpectedError,createPmCliProgram,createPmCommandOutputBudget,createReproducibleProcessRunner,createWorkspaceSnapshot,dedupeLinkedArtifacts,defineCorpusShape,definePmCommandOutputBudget,defineWorkspaceRecipe,deleteItem,deleteWorkspaceSnapshot,deps,deriveSchemaEvolutionMigrationId,describeItemOwnershipConflict,describeItemRevisionChanges,describeProfileComposition,describeProjectProfile,diffTestRunMeasurements,discoverNearbyPmRoot,docs,duplicates,effectiveItemFormatVersion,emptyImportedDocument,ensurePmGitignore,ensureScope,ensureTrackerInitialized,estimatePmOutputTokens,evaluateMutationGuard,evaluateProvenanceCoverage,evaluateSimilarityGovernance,executeWorkspaceRecipe,expandAddGlobEntries,extension,extensionActivate,extensionDeactivate,extensionList,extensionMigrate,extractReferencedPmItemIdsFromCommand,files,filesDiscover,filesLookup,findCoverageDeficits,findDuplicateClusters,findGitWorkspaceRoot,findInstalledNpmPackageCandidate,findPmNamespacedCommand,findSimilarItems,flushTelemetryQueue,focus,formatProfileApplyHuman,formatProfileLintHuman,formatProfileListHuman,formatProfileShowHuman,formatSchemaEvolutionMigrationHuman,gc,generateItemId,get,getActiveExtensionRegistrations,getContracts,getHistoryPath,getItemPath,getMutationActionContract,getPmGitignoreBlock,getSettingsPath,getWorkspaceContracts,graph,hasSubcommandFlagContractsForCommand,health,historyCompact,historyCompactBulk,historyRedact,historyRepair,historyRepairAll,inferPmOutputBudgetClass,init,inspectHistoryAuthorStream,inspectStaleInProgressItems,inspectStaticExtensionInventory,inspectWorkspaceSnapshot,installMergeFence,isAlreadyClaimedError,isErrnoError,isGenericRefusalRequired,isGenericRefusalWhy,isItemAlreadyExistsError,isItemRevisionConflict,isMutationAction,isPmCliErrorDetails,isPmCliExpectedError,isPmExtensionCapabilityContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract,isPmExtensionServiceNameContract,isPmTokenBudgetRecovery,isPmToolAction,isRuntimeRecord,isStartTransition,isTimestampLiteral,jaccardSimilarity,learnings,limitAnnotationEntries,linkedTestTrustFingerprint,lintProjectProfile,list,listAliasPluralKeys,listAllComplete,listAllItemMetadata,listBuiltinCorpusShapes,listMutationActions,listPmCommandsForFamily,listPmCommandsForTier,listPmMcpToolsForProfile,listProfiles,listWorkspaceSnapshots,loadCreateTemplateOptions,locateItem,measureCorpusShapePlan,mergeLinkedTestTwoTokenEntries,next,normalizeAnnotationTransportOptions,normalizeBootstrapInvocation,normalizeExpectedItemHash,normalizeItemFormatVersion,normalizeItemId,normalizeItemMetadata,normalizeLegacyExtensionActionSyntax,normalizeLinkedPath,normalizeProfileName,normalizeRawItemId,normalizeSimilarityText,normalizeStatusInput,notes,nowIso,packageActivate,packageCatalog,packageDeactivate,packageDescribe,packageDoctor,packageInstall,packageLifecycle,packageList,packageManage,packageMigrate,packageReload,packageUninstall,parseAddEntries,parseAddGlobEntries,parseAnnotationTextInput,parseBootstrapCommandName,parseBootstrapGlobalOptions,parseBootstrapHelpRequest,parseBootstrapTypeValue,parseEvalQuerySet,parseExpectHashSpecs,parseLinkedTestAssertionEqualsMap,parseLinkedTestAssertionGteMap,parseLinkedTestBoolean,parseLinkedTestContextMode,parseLinkedTestEnvClear,parseLinkedTestEnvSet,parseLinkedTestJsonEntries,parseLinkedTestMinLines,parseLinkedTestRegexList,parseLinkedTestStringList,parseLinkedTestWorkspaceContextMode,parseMigrateEntries,parseRemoveEntries,parseTags,parseTestRunMeasurements,parseUnknownAuthorHistoryEventCoordinates,pathExists,pauseTask,planExtensionDirectoryCopy,planProfileApplication,planSchemaEvolutionMigration,planUnknownAuthorHistoryAcknowledgment,planWorkspaceSnapshotRestore,prepareSimilarityText,profile,profileApply,profileLint,profileList,profileShow,projectFleetAttributionAnalytics,projectLeanRecoveryPayload,projectPmCliErrorContextDetails,projectPmCliErrorDetails,projectPmDiagnosticOutput,projectPmDiagnosticText,projectProvenanceCoverageAnalytics,projectValidateCounts,queryTestRunMeasurementsBelow,quoteCommandArg,quoteWindowsCommandArg,readAnnotationEntries,readBooleanOption,readCsvListOption,readExtensionMigrationState,readFileIfExists,readFirstStringFromCommanderOptions,readFirstValueFromCommanderOptions,readHistoryAnalyticsWindow,readHistorySnapshot,readImprovementLedger,readItemRevision,readLocatedItem,readPmPackageManifest,readRequiredString,readSettings,readStringArrayFromCommanderOptions,readStringOption,recordImprovementObservation,refreshMergeAttributeFenceIfInstalled,release,removeFileIfExists,renameArtifactsResultKey,renderCalendarMarkdown,renderCalendarToon,renderExtensionDescribeMarkdown,renderGuideMarkdown,renderPmCommand,renderPmCommandAliasMigrationHint,renderPmCommandVisibilityMarkdown,reopen,resolveAnnotationIndex,resolveAnnotationInput,resolveBuiltinCorpusShape,resolveCalendarOutputFormat,resolveDeclaredBlockers,resolveExtensionInstallSourceIdentity,resolveExtensionMigrationStatePath,resolveGuideOutputFormat,resolveImplicitPmRoot,resolveItemOwnershipConflict,resolveItemTypeRegistry,resolveLinkedTestFailureExitCode,resolveLinkedTestSourceRef,resolveLinkedTestSourceWorkspaceRoot,resolveLinkedTestTrust,resolveLinkedTestTrustBatch,resolveMergeInstallContext,resolvePmCommandAlias,resolvePmCommandCapabilityFamily,resolvePmCommandOperation,resolvePmCommandOutputBudget,resolvePmCommandScopeArgs,resolvePmCommandVisibilityTier,resolvePmDiagnosticOutputBudget,resolvePmHistoryOperation,resolvePmPositionalActionFlagContracts,resolvePmRoot,resolvePmToolCustomFieldCollision,resolveProfile,resolveProjectMergeTypeFolders,resolveReproducibleProcessEnvironment,resolveRuntimeFieldRegistry,resolveRuntimeStatusRegistry,resolveStartTaskInProgressStatus,resolveSubcommandFlagContractsForCommand,resolveUnknownAuthorAcknowledgmentSelector,restore,restoreWorkspaceSnapshot,restoreWorkspaceSnapshotWithRecovery,runAction,runActiveOnReadHooks,runActiveOnWriteHooks,runAggregate,runAnnotationCommand,runAppend,runCalendar,runClaim,runClaimNext,runClose,runCloseMany,runCloseTask,runComments,runCompletion,runConfig,runContext,runCopy,runCreate,runDelete,runDeps,runDocs,runEval,runEvent,runExtension,runExtensionMigrateAction,runExtensionMigrations,runFiles,runFilesDiscover,runFilesLookup,runFleetAttributionAnalytics,runFocus,runGc,runGet,runGuide,runHealth,runInit,runInitAgentGuidance,runLearnings,runLinkedArtifacts,runLinkedTests,runList,runMeet,runMergeInstall,runNext,runNotes,runPauseTask,runPlan,runProfileApply,runProfileLint,runProfileList,runProfileShow,runProvenanceCoverageAnalytics,runReindex,runRelease,runRemind,runRestore,runSchemaEvolutionMigration,runSearch,runSearchRefreshWorkerEntrypoint,runStartBackgroundRun,runStartTask,runStats,runTelemetry,runTemplatesList,runTemplatesSave,runTemplatesShow,runTest,runTestAll,runTestRunsList,runTestRunsLogs,runTestRunsResume,runTestRunsStatus,runTestRunsStop,runTestRunsWorker,runUpdate,runUpdateMany,runUpgrade,runValidate,runWithActiveExtensions,runWithReproducibleProcessEnvironment,runWithWorkspaceRecipe,scanHistoryAuthorAttribution,scanItemFormatVersions,scanMutationSecrets,scanStaleInProgressItems,schema,schemaAddField,schemaAddStatus,schemaAddType,schemaApplyPreset,schemaInferTypes,schemaList,schemaListFields,schemaRemapStatus,schemaRemoveField,schemaRemoveStatus,schemaRemoveType,schemaRenameField,schemaRenameType,schemaShow,schemaShowField,schemaShowStatus,scoreItemSimilarity,scorePreparedItemSimilarity,search,selectImportAuthor,serializeItemDocument,similarityAdvisoryWarnings,snapshotPmCliErrorContext,sortLinkedArtifacts,splitFrontMatter,startTask,stats,stripGlobalBootstrapTokens,summarizeContextPreflight,summarizeInitResult,toCompletionFlagString,toEstimatedMinutesValue,toImportBoolean,toImportConfidence,toImportInteger,toImportLinkedDocs,toImportLinkedFiles,toImportLinkedTests,toImportLogEntries,toImportNormalizedEnum,toImportNumberMap,toImportPriority,toImportStatus,toImportStringList,toImportStringMap,toImportTags,toNonEmptyImportString,tokenizeSimilarityText,update,updateLinkedTest,upgrade,validate,validateLinkedPaths,verifyToolOptionCliParity,withExpectedItemRevisions,withFlagAliasMetadata,withoutGenericRefusalExamples,wrapOwnershipConflict,writeFileAtomic};
|
|
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]="438f2063-2307-5945-b1a8-67c0fc24091b")}catch{}})();import{isItemAlreadyExistsError,isPmTokenBudgetRecovery,PM_CLI_ERROR_DETAILS_LIMITS,isPmCliErrorDetails,projectPmCliErrorDetails,projectPmCliErrorContextDetails,snapshotPmCliErrorContext}from"./errors.js";import{PM_COMMAND_CAPABILITY_CONTRACTS,PM_COMMAND_VISIBILITY_CONTRACTS,PM_MCP_PROMPT_CONTRACTS,PM_MCP_RESOURCE_CONTRACTS,PM_MCP_TOOL_COMMAND_CONTRACTS,listPmCommandsForFamily,listPmCommandsForTier,listPmMcpToolsForProfile,renderPmCommandVisibilityMarkdown,resolvePmCommandCapabilityFamily,resolvePmCommandVisibilityTier}from"./agent-capability-contracts.js";export*from"./mcp/protocol.js";export*from"./mcp/executable.js";export*from"./mcp/interactions.js";export*from"./mcp/tasks.js";export*from"./mcp/subscriptions.js";export*from"./mcp/transport.js";export*from"./mcp/authorization.js";export*from"./mcp/apps.js";export*from"./mcp/skills.js";export*from"./cli-contracts/grammar-contracts.js";export*from"./agent-session-context.js";export*from"./environment/agent-environment.js";import{isErrnoError,limitAnnotationEntries,parseAnnotationTextInput,readAnnotationEntries,normalizeAnnotationTransportOptions,resolveAnnotationInput,resolveAnnotationIndex,runAnnotationCommand,wrapOwnershipConflict}from"./annotations.js";import{acknowledgeUnknownAuthorHistoryEvents,acknowledgeUnknownAuthorHistoryEventsFromTransport,inspectHistoryAuthorStream,parseUnknownAuthorHistoryEventCoordinates,planUnknownAuthorHistoryAcknowledgment,resolveUnknownAuthorAcknowledgmentSelector,scanHistoryAuthorAttribution}from"./author-attribution.js";import{BUILTIN_CORPUS_SHAPES,PM_CORPUS_SHAPE_SCHEMA,buildCorpusShapeItemPlan,createCorpusShapeMeasurement,defineCorpusShape,listBuiltinCorpusShapes,measureCorpusShapePlan,resolveBuiltinCorpusShape}from"./corpus-shape.js";export*from"./core-governance.js";import{createPmCliProgram}from"./cli-program.js";import{runSearchRefreshWorkerEntrypoint}from"./search-refresh-worker.js";import{PM_REPRODUCIBLE_PROCESS_ENV,createReproducibleProcessRunner,resolveReproducibleProcessEnvironment,runWithReproducibleProcessEnvironment}from"./reproducibility/process.js";import{PM_WORKSPACE_RECIPE_SCHEMA,defineWorkspaceRecipe,executeWorkspaceRecipe,runWithWorkspaceRecipe}from"./workspace-recipe.js";import{SNAPSHOT_SCHEMA,WORKSPACE_SNAPSHOT_ACTIONS,createWorkspaceSnapshot,deleteWorkspaceSnapshot,inspectWorkspaceSnapshot,listWorkspaceSnapshots,planWorkspaceSnapshotRestore,restoreWorkspaceSnapshot,restoreWorkspaceSnapshotWithRecovery}from"./workspace-snapshot.js";import{flushTelemetryQueue}from"./telemetry-flush.js";import{PM_HISTORY_COMMAND_ALIASES,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_RELOCATED_COMMAND_ALIASES,PM_NAMESPACED_COMMAND_ALIASES,findPmNamespacedCommand,resolvePmCommandOperation,resolvePmHistoryOperation}from"./cli-contracts.js";import{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,applyBootstrapPagerPolicy,coalesceRepeatedListFlags,listAliasPluralKeys,mergeLinkedTestTwoTokenEntries,normalizeBootstrapInvocation,normalizeLegacyExtensionActionSyntax,parseBootstrapCommandName,parseBootstrapGlobalOptions,parseBootstrapHelpRequest,parseBootstrapTypeValue,stripGlobalBootstrapTokens}from"./cli-bootstrap.js";import{quoteCommandArg,quoteWindowsCommandArg,renderPmCommand,resolvePmCommandScopeArgs}from"./command-line.js";export*from"./agent/command-recovery.js";export*from"./agent/linked-resource-recovery.js";export*from"./agent/command-suggestions.js";export*from"./agent/item-addressing.js";export*from"./agent/create-option-policy.js";import{runGc}from"./governance/gc.js";import{PM_EXACT_COVERAGE_METRICS,findCoverageDeficits}from"./governance/coverage-assurance.js";import{_testOnlyHealthCommand,runHealth}from"./governance/health.js";import{_testOnlyValidateCommand,projectValidateCounts,runValidate}from"./governance/validate.js";import{runExtension}from"./extension.js";import{inspectStaticExtensionInventory}from"./extension/static-inventory.js";import{buildExtensionInstallPlan,planExtensionDirectoryCopy}from"./extension/install-plan.js";import{resolveExtensionInstallSourceIdentity}from"./extension/source-resolution.js";import{applyStoredExtensionMigrationState,readExtensionMigrationState,resolveExtensionMigrationStatePath,runExtensionMigrateAction,runExtensionMigrations}from"./extension/migrations.js";import{findInstalledNpmPackageCandidate}from"./extension/install-sources.js";import{buildExtensionDescribeResult,renderExtensionDescribeMarkdown}from"./extension/describe.js";import{runEvent,runMeet,runRemind}from"./scheduling-shortcuts.js";import{createExtensionCommandSdk}from"./extension-command-context.js";import{isRuntimeRecord}from"./runtime-input.js";import{resolveStartTaskInProgressStatus}from"./start-task-status.js";import{auditMergeAttributeFence,buildMergeAttributePatterns,findGitWorkspaceRoot,installMergeFence,refreshMergeAttributeFenceIfInstalled,resolveMergeInstallContext,resolveProjectMergeTypeFolders,runMergeInstall}from"./merge/install.js";import{deriveSchemaEvolutionMigrationId,formatSchemaEvolutionMigrationHuman,planSchemaEvolutionMigration,runSchemaEvolutionMigration}from"./schema-migration.js";import{runWithActiveExtensions}from"./runtime.js";import{applyInvocationAuthorOverride}from"./invocation-author.js";import{describeItemRevisionChanges,isItemRevisionConflict,ITEM_REVISION_CONFLICT_CHANGE_LIMIT,ITEM_REVISION_CONFLICT_CODE,normalizeExpectedItemHash,parseExpectHashSpecs,readItemRevision,withExpectedItemRevisions}from"./lifecycle/item-revision.js";import{admitStartWithOpenBlockers,isStartTransition,START_BLOCKED_REFUSAL_CODE,START_BLOCKER_ENFORCEMENT_DEFAULT}from"./lifecycle/start-blockers.js";import{resolveDeclaredBlockers}from"./query/declared-blockers.js";import{evaluateMutationGuard,getMutationActionContract,isMutationAction,listMutationActions,PM_MUTATION_ACTION_CONTRACTS,scanMutationSecrets}from"./mutation-guard.js";import{findSimilarItems,findDuplicateClusters,evaluateSimilarityGovernance,similarityAdvisoryWarnings,jaccardSimilarity,normalizeSimilarityText,prepareSimilarityText,scoreItemSimilarity,scorePreparedItemSimilarity,tokenizeSimilarityText}from"./similarity.js";import{inspectStaleInProgressItems,scanStaleInProgressItems}from"./governance/stale-work.js";import{describeItemOwnershipConflict,resolveItemOwnershipConflict}from"./ownership-source.js";import{discoverNearbyPmRoot}from"./tracker-root-discovery.js";import{assertInitializedTracker,assertReadableTrackerRoot,buildTrackerInitializationRecovery}from"./environment/tracker-preflight.js";import{_testOnly}from"./templates.js";import{runConfig,_testOnlyConfigCommand}from"./config.js";export*from"./agent/identity-config.js";import{INIT_AGENT_GUIDANCE_MODE_VALUES,runInitAgentGuidance,_testOnly as _testOnly2}from"./init-agent-guidance.js";import{runInit,summarizeInitResult,_testOnly as _testOnly3}from"./init.js";import{PROFILE_SUBCOMMANDS,formatProfileApplyHuman,formatProfileLintHuman,formatProfileListHuman,formatProfileShowHuman,runProfileApply,runProfileLint,runProfileList,runProfileShow}from"./profile.js";export*from"./extension-contracts.js";import{RESERVED_ITEM_FIELD_NAMES}from"../core/extensions/item-fields.js";import{PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,PM_PACKAGE_RESOURCE_KINDS,collectPackageExtensionDirectories,readPmPackageManifest}from"../core/packages/manifest.js";import{ACTIVITY_FLAG_CONTRACTS,ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,CLOSE_ACTION_OPTION_KEYS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,CREATE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,LIST_COMMANDER_STRING_OPTION_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PLAN_FLAG_CONTRACTS,PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_CORE_COMMAND_NAMES,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_ITEM_ACTION_SUBCOMMANDS,PM_DEPRECATED_TOOL_ACTIONS,PM_DISCOVERABLE_TOOL_ACTIONS,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_ACTIONS,analyzePmToolActionParity,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,PROFILE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,verifyToolOptionCliParity,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,buildPmActionToolInputSchema,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,compactFlagAliasContracts,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,inferPmOutputBudgetClass,projectPmDiagnosticOutput,projectPmDiagnosticText,PM_GENERIC_REFUSAL_GUIDANCE,PM_RECOVERY_ECHO_FIELDS,isGenericRefusalRequired,isGenericRefusalWhy,projectLeanRecoveryPayload,withoutGenericRefusalExamples,analyzeSdkCliParameterCompleteness,isPmExtensionCapabilityContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract,isPmExtensionServiceNameContract,isPmToolAction,hasSubcommandFlagContractsForCommand,readFirstStringFromCommanderOptions,readFirstValueFromCommanderOptions,readStringArrayFromCommanderOptions,resolvePmPositionalActionFlagContracts,resolveSubcommandFlagContractsForCommand,resolvePmCommandOutputBudget,resolvePmDiagnosticOutputBudget,resolvePmToolCustomFieldCollision,toCompletionFlagString,withFlagAliasMetadata}from"./cli-contracts.js";export*from"./compose.js";export*from"./governance/assurance.js";export*from"./governance/assurance-action.js";export*from"./governance/assurance-runtime.js";export*from"./governance/assurance-presets.js";export*from"./governance/boundary-fixtures.js";export*from"./governance/defect-recurrence.js";export*from"./governance/merge-receipt-history.js";export*from"./compile-cache.js";export*from"./environment/project-runtime-compatibility.js";export*from"./environment/source-context.js";export*from"./environment/host-environment-errors.js";export*from"./cli-contracts/command-exit-contracts.js";export*from"./context-relevance.js";export*from"./context/recency.js";export*from"./context-intent-contracts.js";export*from"./context-intent-runtime.js";export*from"./context-signal-store.js";export*from"./workspace-memory.js";export*from"./lifecycle-completion.js";export*from"./lifecycle-policy.js";export*from"./output-projection.js";export*from"./read-output-contracts.js";export*from"./read-output-rows.js";export*from"./read-output-session.js";export*from"./output-token-accounting.js";export*from"./output/fit-envelope.js";export*from"./context-packing.js";export*from"./context-usage.js";import{classifyHistoryEvent,HISTORY_EVENT_CLASSIFICATION_VERSION,MAINTENANCE_HISTORY_OPERATIONS,SUBSTANTIVE_HISTORY_OPERATIONS}from"../core/history/event-classification.js";export*from"./dependency-provenance.js";export*from"./duplicates.js";export*from"./lifecycle/reopen.js";export*from"./history-compact.js";export*from"./history-read.js";export*from"../core/history/operation-contract.js";export*from"./history/maintenance.js";import{readHistorySnapshot}from"../core/history/read.js";export*from"./history-provenance.js";export*from"./mutation-events.js";export*from"./history-redact.js";import{_testOnly as _testOnly4}from"./history-redact.js";export*from"./history-repair.js";export*from"./item-children.js";export*from"./item-schedule.js";export*from"./merge/index.js";import{runDeps}from"./dependencies.js";export*from"./graph/index.js";import{runDocs}from"./docs.js";import{runFiles,runFilesDiscover,runFilesLookup}from"./files.js";import{applyPathMigrations,applyStandaloneNote,artifactKey,assertLinkedArtifactMutationIsUnambiguous,dedupeLinkedArtifacts,ensureScope,expandAddGlobEntries,normalizeLinkedPath,parseAddEntries,parseAddGlobEntries,parseMigrateEntries,parseRemoveEntries,renameArtifactsResultKey,runLinkedArtifacts,sortLinkedArtifacts,validateLinkedPaths}from"./linked-artifacts.js";export*from"./pagination.js";export*from"./query/item-filter-options.js";export*from"./query/parsers.js";export*from"./output.js";export*from"./output-contracts.js";export*from"./agent/task-transcript-contracts.js";export*from"./relationship-analytics.js";export*from"./relationship-context.js";export*from"./relationship-history.js";export*from"./relationship-migration.js";export*from"./workspace-transaction.js";export*from"./workspace-transaction-gc.js";export*from"./item-transaction.js";export*from"./item-metadata-index.js";export*from"./structured-mutations.js";export*from"./lifecycle/structured-mutation-plan.js";export*from"./runtime-primitives.js";export*from"./error-runtime.js";export*from"./error-code-catalog.js";export*from"./generated-error-code-catalog.js";export*from"./agent/refusal-reachability.js";export*from"./agent/refusal-closure-census.js";export*from"./agent/refusal-closure.js";export*from"./agent/closed-domain-contracts.js";export*from"./agent/refusal-corpus-contracts.js";import{MERGE_SUBCOMMAND_VALUES}from"./cli-contracts.js";export*from"./agent/tracker-preflight-contracts.js";export*from"./agent/subcommand-recovery.js";export*from"./flag-invocation-contracts.js";export*from"./cli-contracts/flag-lexicon-contracts.js";export*from"./relationships.js";export*from"./actionability.js";import{runCreate}from"./lifecycle/create.js";import{runPlan}from"./lifecycle/plan.js";import{runAppend}from"./lifecycle/append.js";import{isAlreadyClaimedError,runClaim,runClaimNext,runRelease}from"./lifecycle/claim.js";import{runStartTask,runPauseTask,runCloseTask}from"./lifecycle/task-composition.js";import{runCloseMany}from"./lifecycle/close-many.js";import{runUpdateMany}from"./lifecycle/update-many.js";import{runComments}from"./comments.js";import{runNotes}from"./notes.js";import{runLearnings}from"./learnings.js";import{runUpgrade}from"./governance/upgrade.js";import{PLAN_SHOW_DEPTH_VALUES,PLAN_SUBCOMMANDS,PLAN_TEMPLATE_NAMES}from"./lifecycle/plan.js";export*from"./define.js";import{BASELINE_ITEM_FORMAT_VERSION,BUILTIN_ITEM_TYPE_VALUES,CONFIDENCE_TEXT_VALUES,CURRENT_ITEM_FORMAT_VERSION,DEPENDENCY_KIND_VALUES,EXIT_CODE,ISSUE_SEVERITY_VALUES,ITEM_TYPE_VALUES,PM_CLI_EXPECTED_ERROR_NAME,PmCliError,PmClient,RISK_VALUES,STATUS_VALUES,acquireLock,acquireLockLease,appendHistoryEntry,canonicalDocument,classifyItemFormatVersion,clearWorkspaceContractsCache,commitImportedItem,createHistoryEntry,createPmCliExpectedError,effectiveItemFormatVersion,emptyImportedDocument,ensureTrackerInitialized,generateItemId,getActiveExtensionRegistrations,getContracts,getHistoryPath,getItemPath,getSettingsPath,getWorkspaceContracts,isPmCliExpectedError,isTimestampLiteral,listAllItemMetadata,loadCreateTemplateOptions,locateItem,normalizeItemMetadata,normalizeItemFormatVersion,normalizeItemId,normalizeRawItemId,normalizeStatusInput,nowIso,parseTags,pathExists,readBooleanOption,readCsvListOption,readFileIfExists,readLocatedItem,readRequiredString,readSettings,readStringOption,removeFileIfExists,renderCalendarMarkdown,renderCalendarToon,renderGuideMarkdown,resolveCalendarOutputFormat,resolveGuideOutputFormat,resolveItemTypeRegistry,resolveImplicitPmRoot,resolvePmRoot,resolveRuntimeFieldRegistry,resolveRuntimeStatusRegistry,runAction,runActiveOnReadHooks,runActiveOnWriteHooks,runCalendar,runCompletion,runGuide,runList,runReindex,runSearch,runTemplatesList,runTemplatesSave,runTemplatesShow,runTestRunsList,runTestRunsLogs,runTestRunsResume,runTestRunsStatus,runTestRunsStop,scanItemFormatVersions,selectImportAuthor,serializeItemDocument,splitFrontMatter,toEstimatedMinutesValue,toImportBoolean,toImportConfidence,toImportInteger,toImportLinkedDocs,toImportLinkedFiles,toImportLinkedTests,toImportLogEntries,toImportNormalizedEnum,toImportNumberMap,toImportPriority,toImportStatus,toImportStringList,toImportStringMap,toImportTags,toNonEmptyImportString,writeFileAtomic,aggregate,append,claim,claimNext,close,reopen,closeTask,comments,config,context,copy,create,deleteItem,deps,docs,duplicates,extension,extensionActivate,extensionDeactivate,extensionList,files,filesDiscover,filesLookup,focus,gc,get,graph,health,historyCompact,historyCompactBulk,historyRedact,historyRepair,historyRepairAll,init,learnings,list,listAllComplete,next,notes,packageActivate,packageCatalog,packageDeactivate,packageDescribe,packageDoctor,packageInstall,packageLifecycle,packageList,packageManage,packageReload,packageUninstall,pauseTask,profile,profileApply,profileLint,profileList,profileShow,release,restore,schema,schemaAddField,schemaAddStatus,schemaAddType,schemaApplyPreset,schemaInferTypes,schemaList,schemaListFields,schemaRemapStatus,schemaRemoveField,schemaRemoveStatus,schemaRemoveType,schemaShow,schemaShowField,schemaShowStatus,schemaRenameField,schemaRenameType,search,startTask,stats,update,upgrade,validate}from"./runtime.js";import{extensionMigrate,packageMigrate}from"./package-migrations.js";import{CONTEXT_OUTPUT_VALUES,NEXT_OUTPUT_VALUES,PM_GITIGNORE_END,PM_GITIGNORE_START,analyzeSdkActionCoverage,ensurePmGitignore,getPmGitignoreBlock,closeItem,runAggregate,runClose,runCopy,runContext,runDelete,runFocus,runGet,runNext,runRestore,runUpdate}from"./runtime.js";import{runStats}from"./stats.js";import{readImprovementLedger,recordImprovementObservation}from"./improvement-ledger.js";import{evaluateProvenanceCoverage,projectFleetAttributionAnalytics,projectProvenanceCoverageAnalytics,readHistoryAnalyticsWindow,runFleetAttributionAnalytics,runProvenanceCoverageAnalytics}from"./history-analytics.js";import{DEFAULT_EVAL_QUERIES_RELATIVE_PATH,EVAL_QUERY_SET_CONTRACT,EVAL_QUERY_SET_EXAMPLE,EVAL_QUERY_SET_SCHEMA_ID,parseEvalQuerySet,runEval}from"./eval.js";import{runTelemetry,TELEMETRY_SUBCOMMANDS}from"./telemetry.js";import{classifyLinkedTestCommandSafety,classifyLinkedTestFailure,countFailureCategories,extractReferencedPmItemIdsFromCommand,resolveLinkedTestFailureExitCode,runLinkedTests,runTest,summarizeContextPreflight}from"./test/execution.js";import{assertTestMeasurementRun}from"./test/prerequisites.js";import{TEST_RUN_MEASUREMENT_LIMIT,diffTestRunMeasurements,parseTestRunMeasurements,queryTestRunMeasurementsBelow}from"./test/measurements.js";import{runTestAll}from"./test/batch.js";import{LINKED_TEST_ENV_NAME_PATTERN,LINKED_TEST_PM_CONTEXT_MODE_VALUES,LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,LINKED_TEST_PROTECTED_ENV_KEYS,parseLinkedTestAssertionEqualsMap,parseLinkedTestAssertionGteMap,parseLinkedTestBoolean,parseLinkedTestContextMode,parseLinkedTestEnvClear,parseLinkedTestEnvSet,parseLinkedTestJsonEntries,parseLinkedTestMinLines,parseLinkedTestRegexList,parseLinkedTestStringList,parseLinkedTestWorkspaceContextMode}from"./test/parsers.js";import{acknowledgeLinkedTests,attachLinkedTestMutationProvenance,attachLinkedTestProvenance,linkedTestTrustFingerprint,resolveLinkedTestSourceRef,resolveLinkedTestSourceWorkspaceRoot,resolveLinkedTestTrust,resolveLinkedTestTrustBatch}from"./test/trust.js";import{updateLinkedTest}from"./test/update.js";import{runStartBackgroundRun,runTestRunsWorker}from"./test/runs.js";import{BUILTIN_PROFILES,listProfiles,normalizeProfileName,PROFILE_NAMES,resolveProfile}from"../core/profile/profile-presets.js";import{planProfileApplication}from"../core/profile/profile-plan.js";import{describeProfileComposition,describeProjectProfile}from"../core/profile/profile-describe.js";import{lintProjectProfile,PROFILE_LINT_CODES,PROFILE_LINT_DIMENSIONS}from"../core/profile/profile-lint.js";export*from"./authoring.js";export*from"./governance.js";export*from"./mcp/discovery.js";export*from"./query.js";export*from"./testing.js";import{normalizeDirectExtensionCommandOptions,resolveExtensionFlagOptionKey}from"./extension/command-options.js";export{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,ACTIVITY_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,BASELINE_ITEM_FORMAT_VERSION,BUILTIN_CORPUS_SHAPES,BUILTIN_ITEM_TYPE_VALUES,BUILTIN_PROFILES,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,CLOSE_ACTION_OPTION_KEYS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,CONFIDENCE_TEXT_VALUES,CONFIG_FLAG_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_FLAG_CONTRACTS,CONTEXT_OUTPUT_VALUES,CONTRACTS_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,CREATE_FLAG_CONTRACTS,CURRENT_ITEM_FORMAT_VERSION,DEFAULT_EVAL_QUERIES_RELATIVE_PATH,DELETE_FLAG_CONTRACTS,DEPENDENCY_KIND_VALUES,DEPS_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,EVAL_QUERY_SET_CONTRACT,EVAL_QUERY_SET_EXAMPLE,EVAL_QUERY_SET_SCHEMA_ID,EVENTS_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EXECUTABLE_COMMAND_ALIASES,EXIT_CODE,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,HISTORY_EVENT_CLASSIFICATION_VERSION,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,INIT_AGENT_GUIDANCE_MODE_VALUES,INIT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,ISSUE_SEVERITY_VALUES,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,ITEM_REVISION_CONFLICT_CHANGE_LIMIT,ITEM_REVISION_CONFLICT_CODE,ITEM_TYPE_VALUES,LEARNINGS_FLAG_CONTRACTS,LINKED_TEST_ENV_NAME_PATTERN,LINKED_TEST_PM_CONTEXT_MODE_VALUES,LINKED_TEST_PROTECTED_ENV_KEYS,LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,LIST_COMMANDER_STRING_OPTION_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,MAINTENANCE_HISTORY_OPERATIONS,MEET_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,MERGE_SUBCOMMAND_VALUES,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_FLAG_CONTRACTS,NEXT_OUTPUT_VALUES,NOTES_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PLAN_FLAG_CONTRACTS,PLAN_SHOW_DEPTH_VALUES,PLAN_SUBCOMMANDS,PLAN_TEMPLATE_NAMES,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_CLI_ERROR_DETAILS_LIMITS,PM_CLI_EXPECTED_ERROR_NAME,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_COMMAND_ALIAS_CONTRACTS,PM_COMMAND_CAPABILITY_CONTRACTS,PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_COMMAND_VISIBILITY_CONTRACTS,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_CORE_COMMAND_NAMES,PM_CORPUS_SHAPE_SCHEMA,PM_DEPRECATED_TOOL_ACTIONS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_DISCOVERABLE_TOOL_ACTIONS,PM_EXACT_COVERAGE_METRICS,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_GENERIC_REFUSAL_GUIDANCE,PM_GITIGNORE_END,PM_GITIGNORE_START,PM_HISTORY_COMMAND_ALIASES,PM_ITEM_ACTION_SUBCOMMANDS,PM_MCP_PROMPT_CONTRACTS,PM_MCP_RESOURCE_CONTRACTS,PM_MCP_TOOL_COMMAND_CONTRACTS,PM_MUTATION_ACTION_CONTRACTS,PM_NAMESPACED_COMMAND_ALIASES,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_PACKAGE_RESOURCE_KINDS,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_RECOVERY_ECHO_FIELDS,PM_RELOCATED_COMMAND_ALIASES,PM_REPRODUCIBLE_PROCESS_ENV,PM_TOOL_ACTIONS,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,PM_WORKSPACE_RECIPE_SCHEMA,PROFILE_FLAG_CONTRACTS,PROFILE_LINT_CODES,PROFILE_LINT_DIMENSIONS,PROFILE_NAMES,PROFILE_SUBCOMMANDS,PmCliError,PmClient,REINDEX_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,RESERVED_ITEM_FIELD_NAMES,RESTORE_FLAG_CONTRACTS,RISK_VALUES,SCHEMA_FLAG_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_FLAG_CONTRACTS,SNAPSHOT_SCHEMA,START_BLOCKED_REFUSAL_CODE,START_BLOCKER_ENFORCEMENT_DEFAULT,START_TASK_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,STATUS_VALUES,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,SUBSTANTIVE_HISTORY_OPERATIONS,TELEMETRY_FLAG_CONTRACTS,TELEMETRY_SUBCOMMANDS,TEST_ALL_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,TEST_RUN_MEASUREMENT_LIMIT,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,WORKSPACE_SNAPSHOT_ACTIONS,_testOnly4 as _testOnly,_testOnlyConfigCommand,_testOnlyHealthCommand,_testOnly3 as _testOnlyInit,_testOnly2 as _testOnlyInitAgentGuidance,_testOnly as _testOnlyTemplates,_testOnlyValidateCommand,acknowledgeLinkedTests,acknowledgeUnknownAuthorHistoryEvents,acknowledgeUnknownAuthorHistoryEventsFromTransport,acquireLock,acquireLockLease,admitStartWithOpenBlockers,aggregate,analyzePmToolActionParity,analyzeSdkActionCoverage,analyzeSdkCliParameterCompleteness,append,appendHistoryEntry,applyBootstrapPagerPolicy,applyInvocationAuthorOverride,applyPathMigrations,applyStandaloneNote,applyStoredExtensionMigrationState,artifactKey,assertInitializedTracker,assertLinkedArtifactMutationIsUnambiguous,assertReadableTrackerRoot,assertTestMeasurementRun,attachLinkedTestMutationProvenance,attachLinkedTestProvenance,auditMergeAttributeFence,buildCorpusShapeItemPlan,buildExtensionDescribeResult,buildExtensionInstallPlan,buildMergeAttributePatterns,buildPmActionToolInputSchema,buildTrackerInitializationRecovery,canonicalDocument,claim,claimNext,classifyHistoryEvent,classifyItemFormatVersion,classifyLinkedTestCommandSafety,classifyLinkedTestFailure,clearWorkspaceContractsCache,close,closeItem,closeTask,coalesceRepeatedListFlags,collectPackageExtensionDirectories,comments,commitImportedItem,compactFlagAliasContracts,config,context,copy,countFailureCategories,create,createCorpusShapeMeasurement,createExtensionCommandSdk,createHistoryEntry,createPmCliExpectedError,createPmCliProgram,createPmCommandOutputBudget,createReproducibleProcessRunner,createWorkspaceSnapshot,dedupeLinkedArtifacts,defineCorpusShape,definePmCommandOutputBudget,defineWorkspaceRecipe,deleteItem,deleteWorkspaceSnapshot,deps,deriveSchemaEvolutionMigrationId,describeItemOwnershipConflict,describeItemRevisionChanges,describeProfileComposition,describeProjectProfile,diffTestRunMeasurements,discoverNearbyPmRoot,docs,duplicates,effectiveItemFormatVersion,emptyImportedDocument,ensurePmGitignore,ensureScope,ensureTrackerInitialized,estimatePmOutputTokens,evaluateMutationGuard,evaluateProvenanceCoverage,evaluateSimilarityGovernance,executeWorkspaceRecipe,expandAddGlobEntries,extension,extensionActivate,extensionDeactivate,extensionList,extensionMigrate,extractReferencedPmItemIdsFromCommand,files,filesDiscover,filesLookup,findCoverageDeficits,findDuplicateClusters,findGitWorkspaceRoot,findInstalledNpmPackageCandidate,findPmNamespacedCommand,findSimilarItems,flushTelemetryQueue,focus,formatProfileApplyHuman,formatProfileLintHuman,formatProfileListHuman,formatProfileShowHuman,formatSchemaEvolutionMigrationHuman,gc,generateItemId,get,getActiveExtensionRegistrations,getContracts,getHistoryPath,getItemPath,getMutationActionContract,getPmGitignoreBlock,getSettingsPath,getWorkspaceContracts,graph,hasSubcommandFlagContractsForCommand,health,historyCompact,historyCompactBulk,historyRedact,historyRepair,historyRepairAll,inferPmOutputBudgetClass,init,inspectHistoryAuthorStream,inspectStaleInProgressItems,inspectStaticExtensionInventory,inspectWorkspaceSnapshot,installMergeFence,isAlreadyClaimedError,isErrnoError,isGenericRefusalRequired,isGenericRefusalWhy,isItemAlreadyExistsError,isItemRevisionConflict,isMutationAction,isPmCliErrorDetails,isPmCliExpectedError,isPmExtensionCapabilityContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract,isPmExtensionServiceNameContract,isPmTokenBudgetRecovery,isPmToolAction,isRuntimeRecord,isStartTransition,isTimestampLiteral,jaccardSimilarity,learnings,limitAnnotationEntries,linkedTestTrustFingerprint,lintProjectProfile,list,listAliasPluralKeys,listAllComplete,listAllItemMetadata,listBuiltinCorpusShapes,listMutationActions,listPmCommandsForFamily,listPmCommandsForTier,listPmMcpToolsForProfile,listProfiles,listWorkspaceSnapshots,loadCreateTemplateOptions,locateItem,measureCorpusShapePlan,mergeLinkedTestTwoTokenEntries,next,normalizeAnnotationTransportOptions,normalizeBootstrapInvocation,normalizeDirectExtensionCommandOptions,normalizeExpectedItemHash,normalizeItemFormatVersion,normalizeItemId,normalizeItemMetadata,normalizeLegacyExtensionActionSyntax,normalizeLinkedPath,normalizeProfileName,normalizeRawItemId,normalizeSimilarityText,normalizeStatusInput,notes,nowIso,packageActivate,packageCatalog,packageDeactivate,packageDescribe,packageDoctor,packageInstall,packageLifecycle,packageList,packageManage,packageMigrate,packageReload,packageUninstall,parseAddEntries,parseAddGlobEntries,parseAnnotationTextInput,parseBootstrapCommandName,parseBootstrapGlobalOptions,parseBootstrapHelpRequest,parseBootstrapTypeValue,parseEvalQuerySet,parseExpectHashSpecs,parseLinkedTestAssertionEqualsMap,parseLinkedTestAssertionGteMap,parseLinkedTestBoolean,parseLinkedTestContextMode,parseLinkedTestEnvClear,parseLinkedTestEnvSet,parseLinkedTestJsonEntries,parseLinkedTestMinLines,parseLinkedTestRegexList,parseLinkedTestStringList,parseLinkedTestWorkspaceContextMode,parseMigrateEntries,parseRemoveEntries,parseTags,parseTestRunMeasurements,parseUnknownAuthorHistoryEventCoordinates,pathExists,pauseTask,planExtensionDirectoryCopy,planProfileApplication,planSchemaEvolutionMigration,planUnknownAuthorHistoryAcknowledgment,planWorkspaceSnapshotRestore,prepareSimilarityText,profile,profileApply,profileLint,profileList,profileShow,projectFleetAttributionAnalytics,projectLeanRecoveryPayload,projectPmCliErrorContextDetails,projectPmCliErrorDetails,projectPmDiagnosticOutput,projectPmDiagnosticText,projectProvenanceCoverageAnalytics,projectValidateCounts,queryTestRunMeasurementsBelow,quoteCommandArg,quoteWindowsCommandArg,readAnnotationEntries,readBooleanOption,readCsvListOption,readExtensionMigrationState,readFileIfExists,readFirstStringFromCommanderOptions,readFirstValueFromCommanderOptions,readHistoryAnalyticsWindow,readHistorySnapshot,readImprovementLedger,readItemRevision,readLocatedItem,readPmPackageManifest,readRequiredString,readSettings,readStringArrayFromCommanderOptions,readStringOption,recordImprovementObservation,refreshMergeAttributeFenceIfInstalled,release,removeFileIfExists,renameArtifactsResultKey,renderCalendarMarkdown,renderCalendarToon,renderExtensionDescribeMarkdown,renderGuideMarkdown,renderPmCommand,renderPmCommandAliasMigrationHint,renderPmCommandVisibilityMarkdown,reopen,resolveAnnotationIndex,resolveAnnotationInput,resolveBuiltinCorpusShape,resolveCalendarOutputFormat,resolveDeclaredBlockers,resolveExtensionFlagOptionKey,resolveExtensionInstallSourceIdentity,resolveExtensionMigrationStatePath,resolveGuideOutputFormat,resolveImplicitPmRoot,resolveItemOwnershipConflict,resolveItemTypeRegistry,resolveLinkedTestFailureExitCode,resolveLinkedTestSourceRef,resolveLinkedTestSourceWorkspaceRoot,resolveLinkedTestTrust,resolveLinkedTestTrustBatch,resolveMergeInstallContext,resolvePmCommandAlias,resolvePmCommandCapabilityFamily,resolvePmCommandOperation,resolvePmCommandOutputBudget,resolvePmCommandScopeArgs,resolvePmCommandVisibilityTier,resolvePmDiagnosticOutputBudget,resolvePmHistoryOperation,resolvePmPositionalActionFlagContracts,resolvePmRoot,resolvePmToolCustomFieldCollision,resolveProfile,resolveProjectMergeTypeFolders,resolveReproducibleProcessEnvironment,resolveRuntimeFieldRegistry,resolveRuntimeStatusRegistry,resolveStartTaskInProgressStatus,resolveSubcommandFlagContractsForCommand,resolveUnknownAuthorAcknowledgmentSelector,restore,restoreWorkspaceSnapshot,restoreWorkspaceSnapshotWithRecovery,runAction,runActiveOnReadHooks,runActiveOnWriteHooks,runAggregate,runAnnotationCommand,runAppend,runCalendar,runClaim,runClaimNext,runClose,runCloseMany,runCloseTask,runComments,runCompletion,runConfig,runContext,runCopy,runCreate,runDelete,runDeps,runDocs,runEval,runEvent,runExtension,runExtensionMigrateAction,runExtensionMigrations,runFiles,runFilesDiscover,runFilesLookup,runFleetAttributionAnalytics,runFocus,runGc,runGet,runGuide,runHealth,runInit,runInitAgentGuidance,runLearnings,runLinkedArtifacts,runLinkedTests,runList,runMeet,runMergeInstall,runNext,runNotes,runPauseTask,runPlan,runProfileApply,runProfileLint,runProfileList,runProfileShow,runProvenanceCoverageAnalytics,runReindex,runRelease,runRemind,runRestore,runSchemaEvolutionMigration,runSearch,runSearchRefreshWorkerEntrypoint,runStartBackgroundRun,runStartTask,runStats,runTelemetry,runTemplatesList,runTemplatesSave,runTemplatesShow,runTest,runTestAll,runTestRunsList,runTestRunsLogs,runTestRunsResume,runTestRunsStatus,runTestRunsStop,runTestRunsWorker,runUpdate,runUpdateMany,runUpgrade,runValidate,runWithActiveExtensions,runWithReproducibleProcessEnvironment,runWithWorkspaceRecipe,scanHistoryAuthorAttribution,scanItemFormatVersions,scanMutationSecrets,scanStaleInProgressItems,schema,schemaAddField,schemaAddStatus,schemaAddType,schemaApplyPreset,schemaInferTypes,schemaList,schemaListFields,schemaRemapStatus,schemaRemoveField,schemaRemoveStatus,schemaRemoveType,schemaRenameField,schemaRenameType,schemaShow,schemaShowField,schemaShowStatus,scoreItemSimilarity,scorePreparedItemSimilarity,search,selectImportAuthor,serializeItemDocument,similarityAdvisoryWarnings,snapshotPmCliErrorContext,sortLinkedArtifacts,splitFrontMatter,startTask,stats,stripGlobalBootstrapTokens,summarizeContextPreflight,summarizeInitResult,toCompletionFlagString,toEstimatedMinutesValue,toImportBoolean,toImportConfidence,toImportInteger,toImportLinkedDocs,toImportLinkedFiles,toImportLinkedTests,toImportLogEntries,toImportNormalizedEnum,toImportNumberMap,toImportPriority,toImportStatus,toImportStringList,toImportStringMap,toImportTags,toNonEmptyImportString,tokenizeSimilarityText,update,updateLinkedTest,upgrade,validate,validateLinkedPaths,verifyToolOptionCliParity,withExpectedItemRevisions,withFlagAliasMetadata,withoutGenericRefusalExamples,wrapOwnershipConflict,writeFileAtomic};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/sdk/learnings.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type GlobalOptions } from "./runtime-primitives.js";
|
|
7
7
|
import type { LogNote } from "../types/index.js";
|
|
8
|
-
import { type AnnotationMutationReceipt,type AnnotationOmissionReceipt } from "./annotations.js";
|
|
8
|
+
import { type AnnotationMutationReceipt,type IndexedAnnotationEntry,type AnnotationOmissionReceipt } from "./annotations.js";
|
|
9
9
|
/** Documents the learnings command options payload exchanged by command, SDK, and package integrations. */
|
|
10
10
|
export interface LearningsCommandOptions {
|
|
11
11
|
/** Value that configures or reports add for this contract. */
|
|
@@ -24,6 +24,8 @@ limit?:string;
|
|
|
24
24
|
fullHistory?:boolean;
|
|
25
25
|
/** Append only when no learning has the same resolved author and text. */
|
|
26
26
|
ifAbsent?:boolean;
|
|
27
|
+
/** For edit/delete: the created_at of the learning read at that index. Compares timestamps, not identities: an entry with a different created_at is refused, one sharing the timestamp is not. */
|
|
28
|
+
expectAt?:string;
|
|
27
29
|
/** Value that configures or reports author for this contract. */
|
|
28
30
|
author?:string;
|
|
29
31
|
/** Human-readable explanation suitable for logs and agent-facing output. */
|
|
@@ -36,7 +38,7 @@ export interface LearningsResult {
|
|
|
36
38
|
/** Stable identifier used to reference this record across commands and storage. */
|
|
37
39
|
id:string;
|
|
38
40
|
/** Value that configures or reports learnings for this contract. */
|
|
39
|
-
learnings:LogNote
|
|
41
|
+
learnings:Array<IndexedAnnotationEntry<LogNote>>;
|
|
40
42
|
/** Value that configures or reports count for this contract. */
|
|
41
43
|
count:number;
|
|
42
44
|
/** Total learning count after the mutation. */
|
package/dist/sdk/learnings.js
CHANGED
|
@@ -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]="
|
|
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]="61d1a8d4-3d60-5fa5-9f51-d0f14717fffa")}catch{}})();import{parseAnnotationTextInput,resolveAnnotationInput,runAnnotationCommand}from"./annotations.js";async function runLearnings(id,options,global2){return runAnnotationCommand(id,options,global2,{input:await resolveAnnotationInput(options,"learning"),collectionKey:"learnings",op:"learning_add",editOp:"learning_edit",deleteOp:"learning_delete",parseText:raw=>parseAnnotationTextInput(raw),createEntry:entry=>entry,bypassOwnershipConflict:!!(options.edit===void 0&&options.delete===void 0&&options.ownershipAppendBypass),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 learnings --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."]}})}export{runLearnings};
|
|
2
2
|
//# sourceMappingURL=learnings.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]="1ae551f9-53e5-5f63-a6a2-231a40c61c62")}catch{}})();import{assertInitializedTracker}from"../environment/tracker-preflight.js";import{enrichItemRevisionConflict,isItemRevisionConflict,itemRevisionConflictRowFields}from"./item-revision.js";import{toErrorMessage}from"../runtime-primitives.js";import{toItemRecord,isTerminalStatus,resolveItemTypeRegistry,resolveRuntimeStatusRegistry,EXIT_CODE,PmCliError,buildItemNotFoundError,listAllItemMetadataLight,locateItem,readLocatedItem,mutateItem,resolvePmRoot,readSettings,resolveAuthor,resolveIsoOrRelative,shouldCompletePlanOnClose,getActiveExtensionRegistrations}from"../runtime-primitives.js";import{collectBlockedByIds,indexBlockedByIds}from"../actionability.js";import{applyTerminalOrderingPolicy,requireTerminalReason}from"../lifecycle-policy.js";import{nowIso}from"../../core/shared/time.js";import{isPmCliErrorDetails}from"../../core/shared/error-details.js";import{unicodeSafePrefix}from"../../core/shared/text-normalization.js";import{renderPmCommand,resolvePmCommandScopeArgs}from"../command-line.js";import{mutateItemWithHistoryContextResolver}from"../../core/store/item-store.js";const CLOSE_VALIDATION_FIELDS=[{key:"resolution",label:"resolution (--resolution)"},{key:"expected_result",label:"expected_result (--expected-result)"},{key:"actual_result",label:"actual_result (--actual-result)"}];function parseValidateCloseMode(raw){if(raw===void 0)return;const normalized=raw.trim().toLowerCase();if(normalized.length===0||normalized==="warn")return"warn";if(normalized==="off"||normalized==="none"||normalized==="disabled")return"off";if(normalized==="strict")return"strict";throw new PmCliError(`Invalid --validate-close mode "${raw}" (expected "off", "warn", or "strict")`,EXIT_CODE.USAGE)}function findMissingCloseValidationFields(itemMetadata){const missing=[];for(const field of CLOSE_VALIDATION_FIELDS){const rawValue=itemMetadata[field.key];(typeof rawValue!="string"||rawValue.trim().length===0)&&missing.push(field)}return missing}function closeEvidenceRecovery(metadata,commandScope,options={}){const missing=findMissingCloseValidationFields(metadata);if(missing.length===0)return;const values={resolution:options.resolution,expected_result:options.expectedResult,actual_result:options.actualResult},missingFlags=missing.map(field=>`--${field.key.replaceAll("_","-")}`),args=[...commandScope,"update",metadata.id,...missing.flatMap((field,index)=>[missingFlags[index],values[field.key]?.trim()||"<value>"])];return{missing:missingFlags,suggested_retry:renderPmCommand(args),suggested_retry_args:args}}async function duplicateChainReferencesClosingItem(loadItemById,initialDuplicateOf,closingId){const visited=new Set;let current=initialDuplicateOf;for(;typeof current=="string"&¤t.trim().length>0;){const currentId=current.trim();if(currentId===closingId)return!0;if(visited.has(currentId))return!1;visited.add(currentId),current=(await loadItemById(currentId))?.duplicate_of}return!1}function shouldApplyDuplicateFallback(value){return typeof value!="string"||value.trim().length===0}async function assertDuplicateTargetExists(pmRoot,settings,duplicateOf,closingId){const rawTarget=duplicateOf?.trim();if(!rawTarget)return;if(rawTarget===closingId)throw new PmCliError("An item cannot be closed as a duplicate of itself.",EXIT_CODE.USAGE,{code:"duplicate_target_self",why:"--duplicate-of must identify the canonical item that should remain open or already represent the work."});const typeRegistry=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()),itemCache=new Map,loadItemById=async id=>{if(itemCache.has(id))return itemCache.get(id)??null;const located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder);if(!located)return itemCache.set(id,null),null;const{document}=await readLocatedItem(located,{schema:settings.schema});return itemCache.set(id,document.metadata),document.metadata},target=await loadItemById(rawTarget);if(!target)throw new PmCliError(`Duplicate target "${rawTarget}" was not found. Create or locate the canonical item first.`,EXIT_CODE.USAGE,{code:"duplicate_target_missing",why:"Duplicate closure should point at a real canonical pm item so future dedupe and changelog tooling can trace the relationship.",examples:[`pm close ${closingId} "Duplicate of ${rawTarget}" --duplicate-of ${rawTarget}`],nextSteps:["Run pm search/list to find the canonical item, then retry with --duplicate-of <id>."]});if(await duplicateChainReferencesClosingItem(loadItemById,target.duplicate_of,closingId))throw new PmCliError(`Circular duplicate reference detected. Target "${rawTarget}" points back to "${closingId}".`,EXIT_CODE.USAGE,{code:"duplicate_target_circular",why:"Circular duplicate relationships create loops for dedupe and status propagation tooling.",nextSteps:["Choose the existing canonical item, or clear the target duplicate_of metadata before closing this item as a duplicate."]});if(typeof target.duplicate_of=="string"&&target.duplicate_of.trim().length>0)throw new PmCliError(`Duplicate target "${rawTarget}" is already marked as a duplicate of "${target.duplicate_of.trim()}".`,EXIT_CODE.USAGE,{code:"duplicate_target_is_duplicate",why:"Duplicate closure should point directly at the canonical item, not another duplicate.",examples:[`pm close ${closingId} "Duplicate of ${target.duplicate_of.trim()}" --duplicate-of ${target.duplicate_of.trim()}`],nextSteps:["Use the canonical item referenced by duplicate_of as the --duplicate-of target."]});return target.id}function findActiveChildIds(items,parentId,statusRegistry){return items.filter(item=>item.parent===parentId&&!isTerminalStatus(item.status,statusRegistry)).map(item=>item.id).sort((left,right)=>left.localeCompare(right))}function findAutoUnblockCandidates(items,closedId,statusRegistry){const itemsById=new Map(items.map(item=>[item.id.trim().toLowerCase(),item])),blockerIdsByItem=indexBlockedByIds(items),normalizedClosedId=closedId.trim().toLowerCase(),blockedStatuses=statusRegistry.blocked_statuses;return items.filter(item=>blockedStatuses.has(item.status)).map(item=>({item,blockerIds:blockerIdsByItem.get(item.id.trim().toLowerCase())})).filter(({blockerIds})=>blockerIds.includes(normalizedClosedId)).filter(({blockerIds})=>blockerIds.every(blockerId=>{if(blockerId===normalizedClosedId)return!0;const blocker=itemsById.get(blockerId);return blocker!==void 0&&isTerminalStatus(blocker.status,statusRegistry)})).map(({item,blockerIds})=>({id:item.id,blocker_ids:blockerIds})).sort((left,right)=>left.id.localeCompare(right.id))}async function autoUnblockResolvedDependents(pmRoot,settings,items,closedId,author,statusRegistry,commandScope){const candidates=findAutoUnblockCandidates(items,closedId,statusRegistry),warnings=[],unblockedIds=[],conflictIds=[],failed=[];let conflict;for(const candidate of candidates)try{const unblocked=await mutateItem({pmRoot,settings,id:candidate.id,op:"update",author,message:`Auto-unblocked after blocker ${closedId} closed`,mutate(document){const dependencies=document.metadata.dependencies??[],remainingDependencies=dependencies.filter(dependency=>{const dependencyId=dependency.id.trim().toLowerCase();return dependency.kind!=="blocked_by"||!candidate.blocker_ids.includes(dependencyId)});document.metadata.status=statusRegistry.open_status,delete document.metadata.blocked_by,delete document.metadata.blocked_reason,document.metadata.unblock_note=`Auto-unblocked after blocker ${closedId} closed; all blockers resolved (${candidate.blocker_ids.join(", ")}).`,remainingDependencies.length>0?document.metadata.dependencies=remainingDependencies:delete document.metadata.dependencies;const changedFields=["status","blocked_by","blocked_reason","unblock_note"];return remainingDependencies.length!==dependencies.length&&changedFields.push("dependencies"),{changedFields}}});warnings.push(`auto_unblocked:${unblocked.item.id}:resolved_blockers=${candidate.blocker_ids.join(",")}`),unblockedIds.push(unblocked.item.id)}catch(error){const reason=error instanceof Error?error.message.replace(/\s+/g," ").trim():"unknown";isItemRevisionConflict(error)?(conflict??=error,conflictIds.push(candidate.id)):failed.push({id:candidate.id,reason}),warnings.push(`auto_unblock_failed:${candidate.id}:${reason}`)}if(conflict!==void 0){const enriched=await enrichItemRevisionConflict(conflict,pmRoot),blockedStatuses=[...statusRegistry.blocked_statuses].sort().join(",");throw postCloseDependentConflict(enriched,{closedId,unblockedIds,conflictIds,failed,openStatus:statusRegistry.open_status,blockedStatuses,commandScope})}return warnings}const POST_CLOSE_REPORT_LIMIT=10,POST_CLOSE_STEP_LIMIT=20,POST_CLOSE_DETAIL_TRIMS=[{list:"auto_unblock_failed",omitted:"auto_unblock_failed_omitted",floor:0},{list:"changes_since",omitted:"changes_since_omitted",floor:0},{list:"pending_unblock",omitted:"pending_unblock_omitted",floor:1}];function fitPostCloseDetails(details){for(const trim of POST_CLOSE_DETAIL_TRIMS){const list=details[trim.list];if(Array.isArray(list))for(;list.length>trim.floor&&!isPmCliErrorDetails(details);)list.pop(),Reflect.set(details,trim.omitted,Number(details[trim.omitted])+1)}return details}function boundedIdList(ids){const omitted=ids.length-POST_CLOSE_REPORT_LIMIT;return`${ids.slice(0,POST_CLOSE_REPORT_LIMIT).join(", ")}${omitted>0?`, and ${omitted} more`:""}`}function postCloseDependentConflict(conflict,fanOut){const{closedId,conflictIds,failed,commandScope}=fanOut,dependent=String(conflict.context.item_id),unblock=id=>renderPmCommand([...commandScope,"update",id,"--status",fanOut.openStatus,"--unset","blocked_by","--unset","blocked_reason","--expect-hash",`${id}=<item_hash>`]),reported=failed.slice(0,POST_CLOSE_REPORT_LIMIT).map(entry=>({id:entry.id,reason:unicodeSafePrefix(entry.reason,160)})),otherFailures=failed.length===0?"":` Auto-unblocking also failed for ${boundedIdList(failed.map(entry=>entry.id))}; details.auto_unblock_failed gives the reasons it kept (auto_unblock_failed_omitted counts the rest; their get step shows the item). Fix that cause before unblocking it.`,discovery=renderPmCommand([...commandScope,"list","--status",fanOut.blockedStatuses,"--fields","id,title,blocked_by,dependencies","--limit","200"]),allSteps=[...conflictIds.slice(0,POST_CLOSE_REPORT_LIMIT).flatMap(id=>[renderPmCommand([...commandScope,"get",id,"--json"]),unblock(id)]),...reported.map(entry=>renderPmCommand([...commandScope,"get",entry.id,"--json"]))],truncated=conflictIds.length>POST_CLOSE_REPORT_LIMIT||failed.length>POST_CLOSE_REPORT_LIMIT||allSteps.length>POST_CLOSE_STEP_LIMIT,steps=allSteps.slice(0,truncated?POST_CLOSE_STEP_LIMIT-1:POST_CLOSE_STEP_LIMIT);return new PmCliError(`${closedId} was closed, but auto-unblocking ${dependent} was refused. ${conflict.message}`,conflict.exitCode,{...conflict.context,required:`The close of ${closedId} is complete; do not retry it. Only unblocking ${conflictIds.length===1?dependent:`the guarded dependents it refused (${boundedIdList(conflictIds)})`} remains: re-read each one (pm get <id> --json reports item_hash), check that every blocker it declares is resolved, then unblock it with ${unblock(dependent)}${conflictIds.length===1?"":" for each id"}.${otherFailures}${truncated?` This refusal does not list a step for every dependent left blocked; list them with ${discovery}, and while it reports has_more, continue with --after <next_cursor>.`:""}`,nextSteps:truncated?[...steps,discovery]:steps,details:fitPostCloseDetails({...structuredClone(conflict.context.details),pending_unblock:conflictIds.slice(0,POST_CLOSE_REPORT_LIMIT),pending_unblock_omitted:Math.max(0,conflictIds.length-POST_CLOSE_REPORT_LIMIT),auto_unblock_failed:reported,auto_unblock_failed_omitted:Math.max(0,failed.length-POST_CLOSE_REPORT_LIMIT)}),side_effects:[{path:`history/${closedId}.jsonl`,op:"close"},...fanOut.unblockedIds.map(id=>({path:`history/${id}.jsonl`,op:"update"}))]})}async function committedCloseDependentConflict(error,id,pmRoot){if(!isItemRevisionConflict(error)||!error.context.side_effects?.some(effect=>`${effect.op}:${effect.path}`==`close:history/${id}.jsonl`))return;const dependent=String(error.context.item_id);return{warnings:[...error.context.side_effects.filter(effect=>effect.op==="update").map(effect=>effect.path.slice(8,-6)).map(unblockedId=>`auto_unblocked:${unblockedId}`),`auto_unblock_refused:${dependent}:item_revision_conflict`],dependent_revision_conflict:{item_id:dependent,error:toErrorMessage(error),...await itemRevisionConflictRowFields(error,pmRoot)}}}function applyInlineCloseFields(metadata,options){const changedFields=[],inlineCloseFields=[{option:options.resolution,key:"resolution"},{option:options.expectedResult,key:"expected_result"},{option:options.actualResult,key:"actual_result"}];for(const{option,key}of inlineCloseFields){if(typeof option!="string")continue;const trimmed=option.trim();trimmed.length!==0&&(metadata[key]=trimmed,changedFields.push(key))}return changedFields}function applyDuplicateCloseMetadata(metadata,duplicateOf){if(duplicateOf===void 0)return[];metadata.duplicate_of=duplicateOf;const duplicateFallbackFields=[],fallbackValues=[{key:"resolution",value:`Duplicate of ${duplicateOf}`},{key:"expected_result",value:`Canonical item ${duplicateOf} tracks the work.`},{key:"actual_result",value:`Closed as duplicate of ${duplicateOf}.`}];for(const{key,value}of fallbackValues)shouldApplyDuplicateFallback(metadata[key])&&(metadata[key]=value,duplicateFallbackFields.push(key));return duplicateFallbackFields}function collectCloseValidationWarnings(metadata,validateCloseMode,activeChildIds,commandScope){const warnings=[];if(validateCloseMode!=="off"){const missingFields=findMissingCloseValidationFields(metadata);if(missingFields.length>0){const missingLabels=missingFields.map(field=>field.label);if(validateCloseMode==="strict"){const missingFlags=missingFields.map(field=>`--${field.key.replaceAll("_","-")}`),updateTokens=[...commandScope,"update",metadata.id,...missingFlags.flatMap(flag=>[flag,"<value>"])];throw new PmCliError(`Cannot close item ${metadata.id}: missing ${missingLabels.join(", ")}. Populate fields or use --validate-close warn.`,EXIT_CODE.USAGE,{code:"close_validation_missing_fields",recovery:{missing:missingFlags,suggested_retry:renderPmCommand(updateTokens),suggested_retry_args:updateTokens},nextSteps:["Run the suggested pm update, then retry the original pm close invocation.","Use --validate-close warn only when governance permits an evidenced exception."]})}warnings.push(`close_validation_missing_fields:${metadata.id}:${missingLabels.join(",")}`)}if(activeChildIds.length>0){if(validateCloseMode==="strict")throw new PmCliError(`Cannot close item ${metadata.id}: active child items remain open (${activeChildIds.join(", ")}). Close, cancel, or re-parent them first, or use --validate-close warn.`,EXIT_CODE.USAGE);warnings.push(`close_validation_active_children:${metadata.id}:${activeChildIds.join(",")}`)}return warnings}return activeChildIds.length>0&&warnings.push(`closed_with_active_children:${metadata.id}:${activeChildIds.join(",")}`),warnings}function applyCloseReason(metadata,closeReason){return closeReason!==void 0?(metadata.close_reason=closeReason,["close_reason"]):[]}function clearCloseAssignee(metadata){const cleared=["assignee","claim_principal"].filter(key=>metadata[key]!==void 0);for(const key of cleared)delete metadata[key];return[...cleared]}function mutateCloseMetadata(metadata,context){if(isTerminalStatus(metadata.status,context.statusRegistry)&&!context.force)throw new PmCliError(`Item ${metadata.id} is already terminal; use pm update to append acceptance evidence, or --force only for an intentional repeat closure.`,EXIT_CODE.CONFLICT,{recovery:closeEvidenceRecovery(metadata,context.commandScope,context.options)});const inlineChangedFields=applyInlineCloseFields(metadata,context.options),duplicateFallbackFields=applyDuplicateCloseMetadata(metadata,context.duplicateOf),mutationWarnings=collectCloseValidationWarnings(metadata,context.validateCloseMode,context.activeChildIds,context.commandScope);metadata.status=context.statusRegistry.close_status,metadata.closed_at=context.closedAt;const shouldWriteCompletedAt=context.options.completedAt!==void 0||metadata.completed_at===void 0;shouldWriteCompletedAt&&(metadata.completed_at=context.completedAt);const changedFields=["status","closed_at",...shouldWriteCompletedAt?["completed_at"]:[],...applyCloseReason(metadata,context.closeReason),...inlineChangedFields];if(shouldCompletePlanOnClose(metadata)&&(metadata.plan_mode="completed",changedFields.push("plan_mode")),context.duplicateOf!==void 0){changedFields.push("duplicate_of");for(const key of duplicateFallbackFields)changedFields.includes(key)||changedFields.push(key)}changedFields.push(...clearCloseAssignee(metadata));const blockerCleanup=applyTerminalOrderingPolicy(metadata,context.lifecyclePolicy);return changedFields.push(...blockerCleanup.changedFields),mutationWarnings.push(...blockerCleanup.warnings),{changedFields,...mutationWarnings.length>0?{warnings:mutationWarnings}:{}}}const _testOnlyCloseCommand={blockedByIds:collectBlockedByIds,fitPostCloseDetails};async function closeItem(id,closeReasonText,options,global2){const pmRoot=resolvePmRoot(process.cwd(),global2.path),commandScope=resolvePmCommandScopeArgs(global2);await assertInitializedTracker(pmRoot);const settings=await readSettings(pmRoot),statusRegistry=resolveRuntimeStatusRegistry(settings.schema),author=resolveAuthor(options.author,settings.author_default),typeToFolder=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()).type_to_folder,located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeToFolder);if(!located)throw await buildItemNotFoundError(pmRoot,id,settings.id_prefix,typeToFolder);const duplicateOf=await assertDuplicateTargetExists(pmRoot,settings,options.duplicateOf,located.id),lifecyclePolicy={requireCloseReason:options.lifecyclePolicy?.requireCloseReason??settings.governance.require_close_reason,orderingEdges:options.lifecyclePolicy?.orderingEdges??"preserve"},closeReason=requireTerminalReason({explicit:closeReasonText,duplicateOf,resolution:options.resolution,message:options.message},lifecyclePolicy.requireCloseReason).closeReason,validateCloseMode=parseValidateCloseMode(options.validateClose)??settings.governance.close_validation_default,trackerItems=await listAllItemMetadataLight(pmRoot,settings.item_format,typeToFolder,void 0,settings.schema),activeChildIds=findActiveChildIds(trackerItems,located.id,statusRegistry),closedAt=nowIso(),completedAt=options.completedAt===void 0?closedAt:resolveIsoOrRelative(options.completedAt,new Date(closedAt),"completed-at");let completion={timestamp:completedAt,source:options.completedAt===void 0?"close_time":"asserted",...options.completedAt===void 0?{hint:`completed_at defaults to the close time. If work finished earlier, correct it with ${renderPmCommand([...commandScope,"update",located.id,"--completed-at","<ISO>"])}.`}:{}};const result=await mutateItemWithHistoryContextResolver({pmRoot,settings,id:located.id,op:"close",author,message:options.message,force:options.force,resolveHistoryContext:()=>({completion:{timestamp:completion.timestamp,source:completion.source}}),mutate(document){return options.completedAt===void 0&&document.metadata.completed_at!==void 0&&(completion={timestamp:document.metadata.completed_at,source:"existing"}),mutateCloseMetadata(document.metadata,{pmRoot,commandScope,statusRegistry,force:options.force,options,duplicateOf,validateCloseMode,activeChildIds,closeReason,closedAt,completedAt,lifecyclePolicy})}}),evidence=validateCloseMode==="warn"?closeEvidenceRecovery(result.item,commandScope):void 0;return{item:toItemRecord(result.item),changed_fields:result.changedFields,...evidence?{follow_up:{kind:"complete_close_evidence",missing:evidence.missing,suggested_command:evidence.suggested_retry,suggested_command_args:evidence.suggested_retry_args}}:{},warnings:[...result.warnings,...await autoUnblockResolvedDependents(pmRoot,settings,trackerItems,located.id,author,statusRegistry,commandScope)],completion}}function runClose(id,closeReasonText,options,global2){return closeItem(id,closeReasonText,options,global2)}export{_testOnlyCloseCommand,closeItem,committedCloseDependentConflict,runClose};
|
|
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]="7d2d8230-afd3-5f97-b1f6-110264b520eb")}catch{}})();import{assertInitializedTracker}from"../environment/tracker-preflight.js";import{enrichItemRevisionConflict,isItemRevisionConflict,itemRevisionConflictRowFields}from"./item-revision.js";import{toErrorMessage}from"../runtime-primitives.js";import{toItemRecord,isTerminalStatus,resolveItemTypeRegistry,resolveRuntimeStatusRegistry,EXIT_CODE,PmCliError,buildItemNotFoundError,listAllItemMetadataLight,locateItem,readLocatedItem,mutateItem,resolvePmRoot,readSettings,resolveAuthor,resolveIsoOrRelative,shouldCompletePlanOnClose,getActiveExtensionRegistrations}from"../runtime-primitives.js";import{collectBlockedByIds,indexBlockedByIds}from"../actionability.js";import{applyTerminalOrderingPolicy,requireTerminalReason}from"../lifecycle-policy.js";import{nowIso}from"../../core/shared/time.js";import{isPmCliErrorDetails}from"../../core/shared/error-details.js";import{unicodeSafePrefix}from"../../core/shared/text-normalization.js";import{renderPmCommand,resolvePmCommandScopeArgs}from"../command-line.js";import{mutateItemWithHistoryContextResolver}from"../../core/store/item-store.js";import{activeItemRevisionExpectations,itemRevisionConflictGuidance}from"../../core/store/item-mutation-precondition.js";const CLOSE_VALIDATION_FIELDS=[{key:"resolution",label:"resolution (--resolution)"},{key:"expected_result",label:"expected_result (--expected-result)"},{key:"actual_result",label:"actual_result (--actual-result)"}];function parseValidateCloseMode(raw){if(raw===void 0)return;const normalized=raw.trim().toLowerCase();if(normalized.length===0||normalized==="warn")return"warn";if(normalized==="off"||normalized==="none"||normalized==="disabled")return"off";if(normalized==="strict")return"strict";throw new PmCliError(`Invalid --validate-close mode "${raw}" (expected "off", "warn", or "strict")`,EXIT_CODE.USAGE)}function findMissingCloseValidationFields(itemMetadata){const missing=[];for(const field of CLOSE_VALIDATION_FIELDS){const rawValue=itemMetadata[field.key];(typeof rawValue!="string"||rawValue.trim().length===0)&&missing.push(field)}return missing}function closeEvidenceRecovery(metadata,commandScope,options={}){const missing=findMissingCloseValidationFields(metadata);if(missing.length===0)return;const values={resolution:options.resolution,expected_result:options.expectedResult,actual_result:options.actualResult},missingFlags=missing.map(field=>`--${field.key.replaceAll("_","-")}`),args=[...commandScope,"update",metadata.id,...missing.flatMap((field,index)=>[missingFlags[index],values[field.key]?.trim()||"<value>"])];return{missing:missingFlags,suggested_retry:renderPmCommand(args),suggested_retry_args:args}}async function duplicateChainReferencesClosingItem(loadItemById,initialDuplicateOf,closingId){const visited=new Set;let current=initialDuplicateOf;for(;typeof current=="string"&¤t.trim().length>0;){const currentId=current.trim();if(currentId===closingId)return!0;if(visited.has(currentId))return!1;visited.add(currentId),current=(await loadItemById(currentId))?.duplicate_of}return!1}function shouldApplyDuplicateFallback(value){return typeof value!="string"||value.trim().length===0}async function assertDuplicateTargetExists(pmRoot,settings,duplicateOf,closingId){const rawTarget=duplicateOf?.trim();if(!rawTarget)return;if(rawTarget===closingId)throw new PmCliError("An item cannot be closed as a duplicate of itself.",EXIT_CODE.USAGE,{code:"duplicate_target_self",why:"--duplicate-of must identify the canonical item that should remain open or already represent the work."});const typeRegistry=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()),itemCache=new Map,loadItemById=async id=>{if(itemCache.has(id))return itemCache.get(id)??null;const located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder);if(!located)return itemCache.set(id,null),null;const{document}=await readLocatedItem(located,{schema:settings.schema});return itemCache.set(id,document.metadata),document.metadata},target=await loadItemById(rawTarget);if(!target)throw new PmCliError(`Duplicate target "${rawTarget}" was not found. Create or locate the canonical item first.`,EXIT_CODE.USAGE,{code:"duplicate_target_missing",why:"Duplicate closure should point at a real canonical pm item so future dedupe and changelog tooling can trace the relationship.",examples:[`pm close ${closingId} "Duplicate of ${rawTarget}" --duplicate-of ${rawTarget}`],nextSteps:["Run pm search/list to find the canonical item, then retry with --duplicate-of <id>."]});if(await duplicateChainReferencesClosingItem(loadItemById,target.duplicate_of,closingId))throw new PmCliError(`Circular duplicate reference detected. Target "${rawTarget}" points back to "${closingId}".`,EXIT_CODE.USAGE,{code:"duplicate_target_circular",why:"Circular duplicate relationships create loops for dedupe and status propagation tooling.",nextSteps:["Choose the existing canonical item, or clear the target duplicate_of metadata before closing this item as a duplicate."]});if(typeof target.duplicate_of=="string"&&target.duplicate_of.trim().length>0)throw new PmCliError(`Duplicate target "${rawTarget}" is already marked as a duplicate of "${target.duplicate_of.trim()}".`,EXIT_CODE.USAGE,{code:"duplicate_target_is_duplicate",why:"Duplicate closure should point directly at the canonical item, not another duplicate.",examples:[`pm close ${closingId} "Duplicate of ${target.duplicate_of.trim()}" --duplicate-of ${target.duplicate_of.trim()}`],nextSteps:["Use the canonical item referenced by duplicate_of as the --duplicate-of target."]});return target.id}function findActiveChildIds(items,parentId,statusRegistry){return items.filter(item=>item.parent===parentId&&!isTerminalStatus(item.status,statusRegistry)).map(item=>item.id).sort((left,right)=>left.localeCompare(right))}function findAutoUnblockCandidates(items,closedId,statusRegistry){const itemsById=new Map(items.map(item=>[item.id.trim().toLowerCase(),item])),blockerIdsByItem=indexBlockedByIds(items),normalizedClosedId=closedId.trim().toLowerCase(),blockedStatuses=statusRegistry.blocked_statuses;return items.filter(item=>blockedStatuses.has(item.status)).map(item=>({item,blockerIds:blockerIdsByItem.get(item.id.trim().toLowerCase())})).filter(({blockerIds})=>blockerIds.includes(normalizedClosedId)).filter(({blockerIds})=>blockerIds.every(blockerId=>{if(blockerId===normalizedClosedId)return!0;const blocker=itemsById.get(blockerId);return blocker!==void 0&&isTerminalStatus(blocker.status,statusRegistry)})).map(({item,blockerIds})=>({id:item.id,blocker_ids:blockerIds})).sort((left,right)=>left.id.localeCompare(right.id))}async function autoUnblockResolvedDependents(pmRoot,settings,items,closedId,author,statusRegistry,commandScope){const candidates=findAutoUnblockCandidates(items,closedId,statusRegistry),warnings=[],unblockedIds=[],conflictIds=[],failed=[];let conflict;for(const candidate of candidates)try{const unblocked=await mutateItem({pmRoot,settings,id:candidate.id,op:"update",author,message:`Auto-unblocked after blocker ${closedId} closed`,mutate(document){const dependencies=document.metadata.dependencies??[],remainingDependencies=dependencies.filter(dependency=>{const dependencyId=dependency.id.trim().toLowerCase();return dependency.kind!=="blocked_by"||!candidate.blocker_ids.includes(dependencyId)});document.metadata.status=statusRegistry.open_status,delete document.metadata.blocked_by,delete document.metadata.blocked_reason,document.metadata.unblock_note=`Auto-unblocked after blocker ${closedId} closed; all blockers resolved (${candidate.blocker_ids.join(", ")}).`,remainingDependencies.length>0?document.metadata.dependencies=remainingDependencies:delete document.metadata.dependencies;const changedFields=["status","blocked_by","blocked_reason","unblock_note"];return remainingDependencies.length!==dependencies.length&&changedFields.push("dependencies"),{changedFields}}});warnings.push(`auto_unblocked:${unblocked.item.id}:resolved_blockers=${candidate.blocker_ids.join(",")}`),unblockedIds.push(unblocked.item.id)}catch(error){const reason=error instanceof Error?error.message.replace(/\s+/g," ").trim():"unknown";isItemRevisionConflict(error)?(conflict??=error,conflictIds.push(candidate.id)):failed.push({id:candidate.id,reason}),warnings.push(`auto_unblock_failed:${candidate.id}:${reason}`)}if(conflict!==void 0){const enriched=await enrichItemRevisionConflict(conflict,pmRoot),blockedStatuses=[...statusRegistry.blocked_statuses].sort().join(",");throw postCloseDependentConflict(enriched,{closedId,unblockedIds,conflictIds,failed,openStatus:statusRegistry.open_status,blockedStatuses,commandScope})}return warnings}const POST_CLOSE_REPORT_LIMIT=10,POST_CLOSE_STEP_LIMIT=20,POST_CLOSE_DETAIL_TRIMS=[{list:"auto_unblock_failed",omitted:"auto_unblock_failed_omitted",floor:0},{list:"changes_since",omitted:"changes_since_omitted",floor:0},{list:"pending_unblock",omitted:"pending_unblock_omitted",floor:1}];function fitPostCloseDetails(details){for(const trim of POST_CLOSE_DETAIL_TRIMS){const list=details[trim.list];if(Array.isArray(list))for(;list.length>trim.floor&&!isPmCliErrorDetails(details);)list.pop(),Reflect.set(details,trim.omitted,Number(details[trim.omitted])+1)}return details}function boundedIdList(ids){const omitted=ids.length-POST_CLOSE_REPORT_LIMIT;return`${ids.slice(0,POST_CLOSE_REPORT_LIMIT).join(", ")}${omitted>0?`, and ${omitted} more`:""}`}const POST_CLOSE_AUTO_UNBLOCK_REFUSED_REASON="post_close_auto_unblock_refused";function postCloseDependentConflict(conflict,fanOut){const{closedId,conflictIds,failed,commandScope}=fanOut,dependent=String(conflict.context.item_id),unblock=id=>renderPmCommand([...commandScope,"update",id,"--status",fanOut.openStatus,"--unset","blocked_by","--unset","blocked_reason","--expect-hash",`${id}=<item_hash>`]),reported=failed.slice(0,POST_CLOSE_REPORT_LIMIT).map(entry=>({id:entry.id,reason:unicodeSafePrefix(entry.reason,160)})),otherFailures=failed.length===0?"":` Auto-unblocking also failed for ${boundedIdList(failed.map(entry=>entry.id))}; details.auto_unblock_failed gives the reasons it kept (auto_unblock_failed_omitted counts the rest; their get step shows the item). Fix that cause before unblocking it.`,discovery=renderPmCommand([...commandScope,"list","--status",fanOut.blockedStatuses,"--fields","id,title,blocked_by,dependencies","--limit","200"]),allSteps=[...conflictIds.slice(0,POST_CLOSE_REPORT_LIMIT).flatMap(id=>[renderPmCommand([...commandScope,"get",id,"--json"]),unblock(id)]),...reported.map(entry=>renderPmCommand([...commandScope,"get",entry.id,"--json"]))],truncated=conflictIds.length>POST_CLOSE_REPORT_LIMIT||failed.length>POST_CLOSE_REPORT_LIMIT||allSteps.length>POST_CLOSE_STEP_LIMIT,steps=allSteps.slice(0,truncated?POST_CLOSE_STEP_LIMIT-1:POST_CLOSE_STEP_LIMIT);return new PmCliError(`${closedId} was closed, but auto-unblocking ${dependent} was refused. ${conflict.message}`,conflict.exitCode,{...conflict.context,reason:POST_CLOSE_AUTO_UNBLOCK_REFUSED_REASON,examples:itemRevisionConflictGuidance(dependent,!1,{scopeArgs:commandScope}).examples,required:`The close of ${closedId} is complete; do not retry it. Only unblocking ${conflictIds.length===1?dependent:`the guarded dependents it refused (${boundedIdList(conflictIds)})`} remains: re-read each one (pm get <id> --json reports item_hash), check that every blocker it declares is resolved, then unblock it with ${unblock(dependent)}${conflictIds.length===1?"":" for each id"}.${otherFailures}${truncated?` This refusal does not list a step for every dependent left blocked; list them with ${discovery}, and while it reports has_more, continue with --after <next_cursor>.`:""}`,nextSteps:truncated?[...steps,discovery]:steps,details:fitPostCloseDetails({...structuredClone(conflict.context.details),pending_unblock:conflictIds.slice(0,POST_CLOSE_REPORT_LIMIT),pending_unblock_omitted:Math.max(0,conflictIds.length-POST_CLOSE_REPORT_LIMIT),auto_unblock_failed:reported,auto_unblock_failed_omitted:Math.max(0,failed.length-POST_CLOSE_REPORT_LIMIT)}),side_effects:[{path:`history/${closedId}.jsonl`,op:"close"},...fanOut.unblockedIds.map(id=>({path:`history/${id}.jsonl`,op:"update"}))]})}async function committedCloseDependentConflict(error,id,pmRoot){if(!isItemRevisionConflict(error)||!error.context.side_effects?.some(effect=>`${effect.op}:${effect.path}`==`close:history/${id}.jsonl`))return;const dependent=String(error.context.item_id);return{warnings:[...error.context.side_effects.filter(effect=>effect.op==="update").map(effect=>effect.path.slice(8,-6)).map(unblockedId=>`auto_unblocked:${unblockedId}`),`auto_unblock_refused:${dependent}:item_revision_conflict`],dependent_revision_conflict:{item_id:dependent,error:toErrorMessage(error),...await itemRevisionConflictRowFields(error,pmRoot)}}}function applyInlineCloseFields(metadata,options){const changedFields=[],inlineCloseFields=[{option:options.resolution,key:"resolution"},{option:options.expectedResult,key:"expected_result"},{option:options.actualResult,key:"actual_result"}];for(const{option,key}of inlineCloseFields){if(typeof option!="string")continue;const trimmed=option.trim();trimmed.length!==0&&(metadata[key]=trimmed,changedFields.push(key))}return changedFields}function applyDuplicateCloseMetadata(metadata,duplicateOf){if(duplicateOf===void 0)return[];metadata.duplicate_of=duplicateOf;const duplicateFallbackFields=[],fallbackValues=[{key:"resolution",value:`Duplicate of ${duplicateOf}`},{key:"expected_result",value:`Canonical item ${duplicateOf} tracks the work.`},{key:"actual_result",value:`Closed as duplicate of ${duplicateOf}.`}];for(const{key,value}of fallbackValues)shouldApplyDuplicateFallback(metadata[key])&&(metadata[key]=value,duplicateFallbackFields.push(key));return duplicateFallbackFields}function suppliedCloseOptionTokens(options,missingFlags){const tokens=[["--resolution",options.resolution],["--expected-result",options.expectedResult],["--actual-result",options.actualResult],["--validate-close",options.validateClose],["--completed-at",options.completedAt],["--message",options.message],["--author",options.author]].flatMap(([flag,value])=>missingFlags.has(flag)||value===void 0||value.trim().length===0?[]:[`${flag}=${value}`]);return options.force===!0?[...tokens,"--force"]:tokens}function closeValidationMissingFieldsError(metadata,missingFields,context){const missingLabels=missingFields.map(field=>field.label),missingFlags=missingFields.map(field=>`--${field.key.replaceAll("_","-")}`),placeholders=missingFlags.flatMap(flag=>[flag,"<value>"]),updateTokens=[...context.commandScope,"update",metadata.id,...placeholders],message=`Cannot close item ${metadata.id}: missing ${missingLabels.join(", ")}. Populate fields or use --validate-close warn.`,warnStep="Use --validate-close warn only when governance permits an evidenced exception.",overrides=Object.entries(context.options.lifecyclePolicy??{}).filter(([,value])=>value!==void 0).map(([key])=>key),expectations=activeItemRevisionExpectations(context.pmRoot),blankAuthor=typeof context.options.author=="string"&&context.options.author.trim().length===0,unreplayable=overrides.length>0?`its lifecyclePolicy override (${overrides.join(", ")}) has no CLI spelling`:blankAuthor?"its explicitly blank author has no CLI spelling (pm close refuses an empty --author)":expectations===void 0?"its revision guards cannot be replayed as typed (nested revision guards expect different revisions of one item, or a write in the same operation advanced a guarded revision)":void 0;if(unreplayable!==void 0)return new PmCliError(message,EXIT_CODE.USAGE,{code:"close_validation_missing_fields",required:`Pass ${missingFields.map(field=>field.key).join(", ")} on the same SDK close; ${unreplayable}, so no CLI retry reproduces it.`,recovery:{missing:missingFlags,next_best_command:renderPmCommand(updateTokens)},nextSteps:["Retry the same SDK close with the missing evidence supplied, inside the same lifecycle policy and revision guards.",warnStep]});const reason=context.closeReason===void 0?[]:[`--reason=${context.closeReason}`],guards=expectations.map(guard=>`--expect-hash=${guard}`),closeTokens=[...context.commandScope,"close",metadata.id,...reason,...suppliedCloseOptionTokens(context.options,new Set(missingFlags)),...guards,...placeholders];return new PmCliError(message,EXIT_CODE.USAGE,{code:"close_validation_missing_fields",required:`Supply ${missingFlags.join(", ")}: pm close accepts them and records them in the same write as the closure.`,recovery:{missing:missingFlags,suggested_retry:renderPmCommand(closeTokens),suggested_retry_args:closeTokens,next_best_command:renderPmCommand(updateTokens)},nextSteps:["Run recovery.suggested_retry when it is present: the same close with the missing flags added, so one write records the evidence and the closure.","Without it, record the evidence with recovery.next_best_command, then repeat the original close.",warnStep]})}function collectCloseValidationWarnings(metadata,validateCloseMode,activeChildIds,context){const warnings=[];if(validateCloseMode!=="off"){const missingFields=findMissingCloseValidationFields(metadata);if(missingFields.length>0){const missingLabels=missingFields.map(field=>field.label);if(validateCloseMode==="strict")throw closeValidationMissingFieldsError(metadata,missingFields,context);warnings.push(`close_validation_missing_fields:${metadata.id}:${missingLabels.join(",")}`)}if(activeChildIds.length>0){if(validateCloseMode==="strict")throw new PmCliError(`Cannot close item ${metadata.id}: active child items remain open (${activeChildIds.join(", ")}). Close, cancel, or re-parent them first, or use --validate-close warn.`,EXIT_CODE.USAGE);warnings.push(`close_validation_active_children:${metadata.id}:${activeChildIds.join(",")}`)}return warnings}return activeChildIds.length>0&&warnings.push(`closed_with_active_children:${metadata.id}:${activeChildIds.join(",")}`),warnings}function applyCloseReason(metadata,closeReason){return closeReason!==void 0?(metadata.close_reason=closeReason,["close_reason"]):[]}function clearCloseAssignee(metadata){const cleared=["assignee","claim_principal"].filter(key=>metadata[key]!==void 0);for(const key of cleared)delete metadata[key];return[...cleared]}function mutateCloseMetadata(metadata,context){if(isTerminalStatus(metadata.status,context.statusRegistry)&&!context.force)throw new PmCliError(`Item ${metadata.id} is already terminal; use pm update to append acceptance evidence, or --force only for an intentional repeat closure.`,EXIT_CODE.CONFLICT,{recovery:closeEvidenceRecovery(metadata,context.commandScope,context.options)});const inlineChangedFields=applyInlineCloseFields(metadata,context.options),duplicateFallbackFields=applyDuplicateCloseMetadata(metadata,context.duplicateOf),mutationWarnings=collectCloseValidationWarnings(metadata,context.validateCloseMode,context.activeChildIds,context);metadata.status=context.statusRegistry.close_status,metadata.closed_at=context.closedAt;const shouldWriteCompletedAt=context.options.completedAt!==void 0||metadata.completed_at===void 0;shouldWriteCompletedAt&&(metadata.completed_at=context.completedAt);const changedFields=["status","closed_at",...shouldWriteCompletedAt?["completed_at"]:[],...applyCloseReason(metadata,context.closeReason),...inlineChangedFields];if(shouldCompletePlanOnClose(metadata)&&(metadata.plan_mode="completed",changedFields.push("plan_mode")),context.duplicateOf!==void 0){changedFields.push("duplicate_of");for(const key of duplicateFallbackFields)changedFields.includes(key)||changedFields.push(key)}changedFields.push(...clearCloseAssignee(metadata));const blockerCleanup=applyTerminalOrderingPolicy(metadata,context.lifecyclePolicy);return changedFields.push(...blockerCleanup.changedFields),mutationWarnings.push(...blockerCleanup.warnings),{changedFields,...mutationWarnings.length>0?{warnings:mutationWarnings}:{}}}const _testOnlyCloseCommand={blockedByIds:collectBlockedByIds,fitPostCloseDetails};async function closeItem(id,closeReasonText,options,global2){const pmRoot=resolvePmRoot(process.cwd(),global2.path),commandScope=resolvePmCommandScopeArgs(global2);await assertInitializedTracker(pmRoot);const settings=await readSettings(pmRoot),statusRegistry=resolveRuntimeStatusRegistry(settings.schema),author=resolveAuthor(options.author,settings.author_default),typeToFolder=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()).type_to_folder,located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeToFolder);if(!located)throw await buildItemNotFoundError(pmRoot,id,settings.id_prefix,typeToFolder);const duplicateOf=await assertDuplicateTargetExists(pmRoot,settings,options.duplicateOf,located.id),lifecyclePolicy={requireCloseReason:options.lifecyclePolicy?.requireCloseReason??settings.governance.require_close_reason,orderingEdges:options.lifecyclePolicy?.orderingEdges??"preserve"},closeReason=requireTerminalReason({explicit:closeReasonText,duplicateOf,resolution:options.resolution,message:options.message},lifecyclePolicy.requireCloseReason).closeReason,validateCloseMode=parseValidateCloseMode(options.validateClose)??settings.governance.close_validation_default,trackerItems=await listAllItemMetadataLight(pmRoot,settings.item_format,typeToFolder,void 0,settings.schema),activeChildIds=findActiveChildIds(trackerItems,located.id,statusRegistry),closedAt=nowIso(),completedAt=options.completedAt===void 0?closedAt:resolveIsoOrRelative(options.completedAt,new Date(closedAt),"completed-at");let completion={timestamp:completedAt,source:options.completedAt===void 0?"close_time":"asserted",...options.completedAt===void 0?{hint:`completed_at defaults to the close time. If work finished earlier, correct it with ${renderPmCommand([...commandScope,"update",located.id,"--completed-at","<ISO>"])}.`}:{}};const result=await mutateItemWithHistoryContextResolver({pmRoot,settings,id:located.id,op:"close",author,message:options.message,force:options.force,resolveHistoryContext:()=>({completion:{timestamp:completion.timestamp,source:completion.source}}),mutate(document){return options.completedAt===void 0&&document.metadata.completed_at!==void 0&&(completion={timestamp:document.metadata.completed_at,source:"existing"}),mutateCloseMetadata(document.metadata,{pmRoot,commandScope,statusRegistry,force:options.force,options,duplicateOf,validateCloseMode,activeChildIds,closeReason,closedAt,completedAt,lifecyclePolicy})}}),evidence=validateCloseMode==="warn"?closeEvidenceRecovery(result.item,commandScope):void 0;return{item:toItemRecord(result.item),changed_fields:result.changedFields,...evidence?{follow_up:{kind:"complete_close_evidence",missing:evidence.missing,suggested_command:evidence.suggested_retry,suggested_command_args:evidence.suggested_retry_args}}:{},warnings:[...result.warnings,...await autoUnblockResolvedDependents(pmRoot,settings,trackerItems,located.id,author,statusRegistry,commandScope)],completion}}function runClose(id,closeReasonText,options,global2){return closeItem(id,closeReasonText,options,global2)}export{_testOnlyCloseCommand,closeItem,committedCloseDependentConflict,runClose};
|
|
2
2
|
//# sourceMappingURL=close.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { bindItemRevisionScope,createItemRevisionScope,itemRevisionScopeReceipt,runWithItemRevisionScope,type ItemRevisionScope } from "../../core/store/item-mutation-precondition.js";
|
|
1
|
+
import { bindItemRevisionScope,createItemRevisionScope,itemRevisionScopeReceipt,runWithItemRevisionScope,type ItemRevisionRecoveryInvocation,type ItemRevisionScope } from "../../core/store/item-mutation-precondition.js";
|
|
2
2
|
import { PmCliError,type PmCliErrorDetails } from "../../core/shared/errors.js";
|
|
3
|
-
export type { ItemRevisionScope } from "../../core/store/item-mutation-precondition.js";
|
|
3
|
+
export type { ItemRevisionRecoveryInvocation,ItemRevisionScope } from "../../core/store/item-mutation-precondition.js";
|
|
4
4
|
/** Refusal code for a locked write that found a revision other than the declared one. */
|
|
5
5
|
export declare const ITEM_REVISION_CONFLICT_CODE = "item_revision_conflict";
|
|
6
6
|
/** Most recent history entries a conflict refusal describes. */
|
|
@@ -106,17 +106,26 @@ export declare function isItemRevisionConflict(error:unknown):error is PmCliErro
|
|
|
106
106
|
export declare function throwFirstItemRevisionConflict(errors:readonly unknown[]):void;
|
|
107
107
|
/** Refusal for a guard on an invocation an extension parser or preflight override rewrote. */
|
|
108
108
|
export declare function expectHashInvocationRewrittenError():PmCliError;
|
|
109
|
+
/**
|
|
110
|
+
* Re-render a revision refusal's read-only recovery (`required`, `examples`,
|
|
111
|
+
* `next_steps`) for the invocation that raised it (pm-gh1677), so replaying
|
|
112
|
+
* them reads the same tracker in the same output mode. Other errors, and an
|
|
113
|
+
* omitted invocation, pass through unchanged.
|
|
114
|
+
*/
|
|
115
|
+
export declare function scopeItemRevisionConflict(error:unknown,invocation:ItemRevisionRecoveryInvocation | undefined):unknown;
|
|
109
116
|
/**
|
|
110
117
|
* Attach bounded change evidence to a revision conflict. The evidence is read
|
|
111
118
|
* after the lock is released, so it describes the record as it was then; the
|
|
112
119
|
* refusal's `current_revision` remains the revision the locked write found.
|
|
120
|
+
* With an `invocation`, the recovery commands are also re-rendered for it. A
|
|
121
|
+
* refusal raised by another tracker's guard is returned unchanged.
|
|
113
122
|
*/
|
|
114
|
-
export declare function enrichItemRevisionConflict(error:unknown,pmRoot:string):Promise<unknown>;
|
|
123
|
+
export declare function enrichItemRevisionConflict(error:unknown,pmRoot:string,invocation?:ItemRevisionRecoveryInvocation):Promise<unknown>;
|
|
115
124
|
/**
|
|
116
125
|
* Run an operation under an already-bound scope and return its receipt,
|
|
117
126
|
* enriching a revision refusal with bounded change evidence.
|
|
118
127
|
*/
|
|
119
|
-
export declare function runWithBoundItemRevisionScope<T>(scope:ItemRevisionScope,operation:() => Promise<T
|
|
128
|
+
export declare function runWithBoundItemRevisionScope<T>(scope:ItemRevisionScope,operation:() => Promise<T>,invocation?:ItemRevisionRecoveryInvocation):Promise<ExpectedItemRevisionsOutcome<T>>;
|
|
120
129
|
/**
|
|
121
130
|
* Run `operation` so every locked write to an expected item first proves the
|
|
122
131
|
* item is still at the declared revision. A mismatch refuses that write with
|
|
@@ -159,4 +168,6 @@ run:() => Promise<T>;
|
|
|
159
168
|
options?:Record<string,unknown>;
|
|
160
169
|
/** Top-level background flag, consulted like `options.background`. */
|
|
161
170
|
background?:unknown;
|
|
171
|
+
/** Invocation whose tracker scope a revision refusal's recovery commands replay. */
|
|
172
|
+
invocation?:ItemRevisionRecoveryInvocation;
|
|
162
173
|
}):Promise<T>;
|
|
@@ -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]="aca1dfc0-e0c9-5554-96e3-bb9b2cdeb7f9")}catch{}})();import{getActiveExtensionRegistrations}from"../../core/extensions/index.js";import{hashDocument}from"../../core/history/history.js";import{readHistoryEntries}from"../../core/history/read.js";import{resolveItemTypeRegistry}from"../../core/item/type-registry.js";import{bindItemRevisionScope,createItemRevisionScope,itemRevisionScopeReceipt,runWithItemRevisionScope}from"../../core/store/item-mutation-precondition.js";import{buildItemNotFoundError,locateItem,readLocatedItem}from"../../core/store/item-store.js";import{getHistoryPath,resolvePmRoot}from"../../core/store/paths.js";import{readSettings}from"../../core/store/settings.js";import{EXIT_CODE}from"../../core/shared/constants.js";import{PmCliError}from"../../core/shared/errors.js";import{PM_EXPECT_HASH_ACTIONS,PM_TOOL_ACTIONS}from"../cli-contracts/enum-contracts.js";import{resolveHistorySubject}from"../history/subject.js";import{resolvePhysicalItemId}from"../query/declared-blockers.js";import{EMPTY_CANONICAL_DOCUMENT}from"../../core/shared/constants.js";import{isMutationAction}from"../mutation-guard.js";import{isPmCliExpectedError}from"../errors.js";const ITEM_REVISION_CONFLICT_CODE="item_revision_conflict",ITEM_REVISION_CONFLICT_CHANGE_LIMIT=10,ITEM_HASH_PATTERN=/^[0-9a-f]{64}$/u;function invalidExpectHash(value,reason){return new PmCliError(`Invalid expected revision ${JSON.stringify(value)}: ${reason}.`,EXIT_CODE.USAGE,{code:"expect_hash_invalid",value,required:"Pass the 64-character item_hash from pm get <id> --json, optionally as <id>=<item_hash>.",examples:["--expect-hash <item_hash>","--expect-hash pm-a1b2=<item_hash>"]})}function normalizeExpectedItemHash(value){const normalized=typeof value=="string"?value.trim().toLowerCase():"";if(!ITEM_HASH_PATTERN.test(normalized))throw invalidExpectHash(String(value),"the revision is not a 64-character hexadecimal item_hash");return normalized}function parseExpectHashSpecs(values){return(values===void 0?[]:typeof values=="string"?[values]:values).flatMap(raw=>{if(typeof raw!="string")throw invalidExpectHash(String(raw),"expected a string");const parts=raw.split(",").map(token=>token.trim()).filter(token=>token.length>0);if(parts.length===0)throw invalidExpectHash(raw,"the value is empty");return parts.map(token=>{const separator=token.lastIndexOf("="),id=separator===-1?void 0:token.slice(0,separator).trim();if(id!==void 0&&id.length===0)throw invalidExpectHash(token,"the item id before = is empty");const itemHash=normalizeExpectedItemHash(separator===-1?token:token.slice(separator+1));return id===void 0?{itemHash}:{id,itemHash}})})}async function locateRevisionTarget(pmRoot,id){const settings=await readSettings(pmRoot),typeToFolder=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()).type_to_folder,located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeToFolder);if(located){const{document}=await readLocatedItem(located,{schema:settings.schema});if(document.metadata.id!==await resolvePhysicalItemId(located.itemPath,located.id))throw new PmCliError(`Item file ${located.id} embeds the id ${document.metadata.id}; no revision can be bound to an item whose identity is in conflict.`,EXIT_CODE.CONFLICT,{code:"item_identity_conflict",item_id:located.id,required:`Repair ${located.id}'s identity first (pm validate reports it; pm restore ${located.id} <version> recovers a recorded state), then read its item_hash again.`});return{id:document.metadata.id,document}}try{return{id:(await resolveHistorySubject(pmRoot,id,settings,typeToFolder)).id,document:EMPTY_CANONICAL_DOCUMENT}}catch{throw await buildItemNotFoundError(pmRoot,id,settings.id_prefix,typeToFolder)}}function resolveRevisionRoot(context){return resolvePmRoot(context.cwd??process.cwd(),context.pmRoot)}async function readItemRevision(id,context={}){const target=await locateRevisionTarget(resolveRevisionRoot(context),id);return{id:target.id,item_hash:hashDocument(target.document)}}async function resolveExpectedItemRevisions(pmRoot,specs,defaultId){const resolved=[];for(const spec of specs){const target=spec.id??defaultId;if(target===void 0||target.trim().length===0)throw new PmCliError("A bare expected revision needs an item to bind to.",EXIT_CODE.USAGE,{code:"expect_hash_target_required",required:"This command has no single item argument; name each target as --expect-hash <id>=<item_hash>.",examples:["--expect-hash pm-a1b2=<item_hash>"]});resolved.push({id:(await locateRevisionTarget(pmRoot,target)).id,itemHash:spec.itemHash})}return resolved}function changedTopLevelFields(entry){return[...new Set(entry.patch.map(change=>{const segments=change.path.split("/");return String(segments[1]==="metadata"?segments[2]:segments[1])}))].sort()}async function describeItemRevisionChanges(pmRoot,id,expectedHash){let history;try{history=await readHistoryEntries(getHistoryPath(pmRoot,id),id)}catch{return}let start=-1;for(let index=history.length-1;index>=0;index-=1){const entry=history[index];if(entry.after_hash===expectedHash){start=index+1;break}if(entry.before_hash===expectedHash){start=index;break}}if(start===-1)return{expected_revision_recorded:!1,changes_since:[],changes_since_omitted:0};const later=history.slice(start),shown=later.slice(-ITEM_REVISION_CONFLICT_CHANGE_LIMIT);return{expected_revision_recorded:!0,changes_since:shown.map(entry=>({ts:entry.ts,op:entry.op,author:entry.author,fields:changedTopLevelFields(entry)})),changes_since_omitted:later.length-shown.length}}async function itemRevisionConflictRowFields(error,pmRoot){if(!isItemRevisionConflict(error))return{};const enriched=await enrichItemRevisionConflict(error,pmRoot);return{error_code:ITEM_REVISION_CONFLICT_CODE,expected_revision:String(enriched.context.expected_revision),current_revision:String(enriched.context.current_revision),details:enriched.context.details}}function isItemRevisionConflict(error){return isPmCliExpectedError(error)&&error.context.code===ITEM_REVISION_CONFLICT_CODE}function throwFirstItemRevisionConflict(errors){const conflict=errors.find(error=>isItemRevisionConflict(error));if(conflict!==void 0)throw conflict}function expectHashInvocationRewrittenError(){return new PmCliError("--expect-hash cannot guard an invocation an extension override rewrote: which item it writes is not provable.",EXIT_CODE.USAGE,{code:"expect_hash_invocation_rewritten",required:"Run the command without the rewriting extension (--no-extensions), or drop --expect-hash.",why:"An extension parser or preflight override changed this invocation's tracker or arguments, and final dispatch, the extension SDK client and the guard do not share one rewritten view."})}async function enrichItemRevisionConflict(error,pmRoot){if(!isItemRevisionConflict(error)||error.context.details!==void 0)return error;const id=error.context.item_id,expected=error.context.expected_revision;if(typeof id!="string"||typeof expected!="string")return error;let changes;try{changes=await describeItemRevisionChanges(pmRoot,id,expected)}catch{return error}if(changes===void 0)return error;const details={expected_revision_recorded:changes.expected_revision_recorded,changes_since:changes.changes_since.map(change=>({ts:change.ts,op:change.op,author:change.author,fields:[...change.fields]})),changes_since_omitted:changes.changes_since_omitted},enriched=new PmCliError(error.message,error.exitCode,{...error.context,details});return enriched.stack=error.stack,enriched}async function runWithBoundItemRevisionScope(scope,operation){try{return{result:await runWithItemRevisionScope(scope,operation),...itemRevisionScopeReceipt(scope)}}catch(error){throw scope.pmRoot===void 0?error:await enrichItemRevisionConflict(error,scope.pmRoot)}}async function withExpectedItemRevisions(expectations,operation,context={}){return runWithBoundItemRevisionScope(await bindExpectedItemRevisions(expectations,context),operation)}async function bindExpectedItemRevisions(expectations,context={}){const pmRoot=resolveRevisionRoot(context),specs=expectations.map(({id,itemHash})=>({id,itemHash:normalizeExpectedItemHash(itemHash)})),scope=createItemRevisionScope();return bindItemRevisionScope(scope,pmRoot,await resolveExpectedItemRevisions(pmRoot,specs)),scope}function itemRevisionUncheckedWarning(id){return`expect_hash_unchecked:${id}:no_locked_write_reached_this_item`}const NATIVE_ACTIONS=new Set(PM_TOOL_ACTIONS);function assertExpectHashAdmissible(path,options={}){const hyphenated=path.trim().replace(/\s+/gu,"-"),action=NATIVE_ACTIONS.has(hyphenated)?hyphenated:path;if(NATIVE_ACTIONS.has(action)&&(!isMutationAction(action)||action==="deps")&&!PM_EXPECT_HASH_ACTIONS.has(action))throw expectHashRequiresMutationError(action);if((action==="test"||action==="test-all")&&options.background===!0)throw new PmCliError(`--expect-hash cannot guard ${action} --background: the worker runs in another process.`,EXIT_CODE.USAGE,{code:"expect_hash_background_unsupported",required:`Run ${action} in the foreground to guard its result recording, or drop --expect-hash for a background run.`})}function expectHashRequiresMutationError(action){return new PmCliError(`--expect-hash guards item writes, and ${action} is not a mutation.`,EXIT_CODE.USAGE,{code:"expect_hash_requires_mutation",required:"Use --expect-hash (MCP/SDK expectHash) only on a command or action that writes items."})}function withUncheckedRevisionWarnings(result,unchecked){if(unchecked.length===0||typeof result!="object"||result===null||Array.isArray(result))return result;const record=result,warnings=Array.isArray(record.warnings)?record.warnings:[];return{...record,warnings:[...warnings,...unchecked.map(itemRevisionUncheckedWarning)]}}async function dispatchWithExpectedItemRevisions(params){const raw=params.expectHash;if(raw!==void 0&&typeof raw!="string"&&!(Array.isArray(raw)&&raw.every(entry=>typeof entry=="string")))throw invalidExpectHash(JSON.stringify(raw)??String(raw),"expected a string or an array of strings");const specs=parseExpectHashSpecs(raw);if(specs.length===0)return params.run();assertExpectHashAdmissible(params.action,{background:params.background===!0||params.options?.background===!0});const scope=createItemRevisionScope();bindItemRevisionScope(scope,params.pmRoot,await resolveExpectedItemRevisions(params.pmRoot,specs,params.defaultId));const outcome=await runWithBoundItemRevisionScope(scope,params.run);return withUncheckedRevisionWarnings(outcome.result,outcome.unchecked)}export{ITEM_REVISION_CONFLICT_CHANGE_LIMIT,ITEM_REVISION_CONFLICT_CODE,assertExpectHashAdmissible,bindExpectedItemRevisions,bindItemRevisionScope,createItemRevisionScope,describeItemRevisionChanges,dispatchWithExpectedItemRevisions,enrichItemRevisionConflict,expectHashInvocationRewrittenError,expectHashRequiresMutationError,isItemRevisionConflict,itemRevisionConflictRowFields,itemRevisionScopeReceipt,itemRevisionUncheckedWarning,normalizeExpectedItemHash,parseExpectHashSpecs,readItemRevision,resolveExpectedItemRevisions,runWithBoundItemRevisionScope,runWithItemRevisionScope,throwFirstItemRevisionConflict,withExpectedItemRevisions};
|
|
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]="2277d018-a882-57ee-bcd5-52bc61cd8efe")}catch{}})();import{getActiveExtensionRegistrations}from"../../core/extensions/index.js";import{hashDocument}from"../../core/history/history.js";import{readHistoryEntries}from"../../core/history/read.js";import{resolveItemTypeRegistry}from"../../core/item/type-registry.js";import{bindItemRevisionScope,createItemRevisionScope,ITEM_REVISION_CONFLICT_CHANGED_REASON,ITEM_REVISION_CONFLICT_UNREADABLE_REASON,isItemRevisionRefusalFrom,isItemRevisionRefusalScoped,itemRevisionConflictGuidance,markItemRevisionRefusalScoped,retainItemRevisionRefusalTracker,itemRevisionScopeReceipt,runWithItemRevisionScope}from"../../core/store/item-mutation-precondition.js";import{buildItemNotFoundError,locateItem,readLocatedItem}from"../../core/store/item-store.js";import{getHistoryPath,resolvePmRoot}from"../../core/store/paths.js";import{readSettings}from"../../core/store/settings.js";import{EXIT_CODE}from"../../core/shared/constants.js";import{PmCliError}from"../../core/shared/errors.js";import{PM_EXPECT_HASH_ACTIONS,PM_TOOL_ACTIONS}from"../cli-contracts/enum-contracts.js";import{resolveHistorySubject}from"../history/subject.js";import{resolvePhysicalItemId}from"../query/declared-blockers.js";import{EMPTY_CANONICAL_DOCUMENT}from"../../core/shared/constants.js";import{isMutationAction}from"../mutation-guard.js";import{isPmCliExpectedError}from"../errors.js";const ITEM_REVISION_CONFLICT_CODE="item_revision_conflict",ITEM_REVISION_CONFLICT_CHANGE_LIMIT=10,ITEM_HASH_PATTERN=/^[0-9a-f]{64}$/u;function invalidExpectHash(value,reason){return new PmCliError(`Invalid expected revision ${JSON.stringify(value)}: ${reason}.`,EXIT_CODE.USAGE,{code:"expect_hash_invalid",value,required:"Pass the 64-character item_hash from pm get <id> --json, optionally as <id>=<item_hash>.",examples:["--expect-hash <item_hash>","--expect-hash pm-a1b2=<item_hash>"]})}function normalizeExpectedItemHash(value){const normalized=typeof value=="string"?value.trim().toLowerCase():"";if(!ITEM_HASH_PATTERN.test(normalized))throw invalidExpectHash(String(value),"the revision is not a 64-character hexadecimal item_hash");return normalized}function parseExpectHashSpecs(values){return(values===void 0?[]:typeof values=="string"?[values]:values).flatMap(raw=>{if(typeof raw!="string")throw invalidExpectHash(String(raw),"expected a string");const parts=raw.split(",").map(token=>token.trim()).filter(token=>token.length>0);if(parts.length===0)throw invalidExpectHash(raw,"the value is empty");return parts.map(token=>{const separator=token.lastIndexOf("="),id=separator===-1?void 0:token.slice(0,separator).trim();if(id!==void 0&&id.length===0)throw invalidExpectHash(token,"the item id before = is empty");const itemHash=normalizeExpectedItemHash(separator===-1?token:token.slice(separator+1));return id===void 0?{itemHash}:{id,itemHash}})})}async function locateRevisionTarget(pmRoot,id){const settings=await readSettings(pmRoot),typeToFolder=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()).type_to_folder,located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeToFolder);if(located){const{document}=await readLocatedItem(located,{schema:settings.schema});if(document.metadata.id!==await resolvePhysicalItemId(located.itemPath,located.id))throw new PmCliError(`Item file ${located.id} embeds the id ${document.metadata.id}; no revision can be bound to an item whose identity is in conflict.`,EXIT_CODE.CONFLICT,{code:"item_identity_conflict",item_id:located.id,required:`Repair ${located.id}'s identity first (pm validate reports it; pm restore ${located.id} <version> recovers a recorded state), then read its item_hash again.`});return{id:document.metadata.id,document}}try{return{id:(await resolveHistorySubject(pmRoot,id,settings,typeToFolder)).id,document:EMPTY_CANONICAL_DOCUMENT}}catch{throw await buildItemNotFoundError(pmRoot,id,settings.id_prefix,typeToFolder)}}function resolveRevisionRoot(context){return resolvePmRoot(context.cwd??process.cwd(),context.pmRoot)}async function readItemRevision(id,context={}){const target=await locateRevisionTarget(resolveRevisionRoot(context),id);return{id:target.id,item_hash:hashDocument(target.document)}}async function resolveExpectedItemRevisions(pmRoot,specs,defaultId){const resolved=[];for(const spec of specs){const target=spec.id??defaultId;if(target===void 0||target.trim().length===0)throw new PmCliError("A bare expected revision needs an item to bind to.",EXIT_CODE.USAGE,{code:"expect_hash_target_required",required:"This command has no single item argument; name each target as --expect-hash <id>=<item_hash>.",examples:["--expect-hash pm-a1b2=<item_hash>"]});resolved.push({id:(await locateRevisionTarget(pmRoot,target)).id,itemHash:spec.itemHash})}return resolved}function changedTopLevelFields(entry){return[...new Set(entry.patch.map(change=>{const segments=change.path.split("/");return String(segments[1]==="metadata"?segments[2]:segments[1])}))].sort()}async function describeItemRevisionChanges(pmRoot,id,expectedHash){let history;try{history=await readHistoryEntries(getHistoryPath(pmRoot,id),id)}catch{return}let start=-1;for(let index=history.length-1;index>=0;index-=1){const entry=history[index];if(entry.after_hash===expectedHash){start=index+1;break}if(entry.before_hash===expectedHash){start=index;break}}if(start===-1)return{expected_revision_recorded:!1,changes_since:[],changes_since_omitted:0};const later=history.slice(start),shown=later.slice(-ITEM_REVISION_CONFLICT_CHANGE_LIMIT);return{expected_revision_recorded:!0,changes_since:shown.map(entry=>({ts:entry.ts,op:entry.op,author:entry.author,fields:changedTopLevelFields(entry)})),changes_since_omitted:later.length-shown.length}}async function itemRevisionConflictRowFields(error,pmRoot){if(!isItemRevisionConflict(error))return{};const enriched=await enrichItemRevisionConflict(error,pmRoot);return{error_code:ITEM_REVISION_CONFLICT_CODE,expected_revision:String(enriched.context.expected_revision),current_revision:String(enriched.context.current_revision),details:enriched.context.details}}function isItemRevisionConflict(error){return isPmCliExpectedError(error)&&error.context.code===ITEM_REVISION_CONFLICT_CODE}function throwFirstItemRevisionConflict(errors){const conflict=errors.find(error=>isItemRevisionConflict(error));if(conflict!==void 0)throw conflict}function expectHashInvocationRewrittenError(){return new PmCliError("--expect-hash cannot guard an invocation an extension override rewrote: which item it writes is not provable.",EXIT_CODE.USAGE,{code:"expect_hash_invocation_rewritten",required:"Run the command without the rewriting extension (--no-extensions), or drop --expect-hash.",why:"An extension parser or preflight override changed this invocation's tracker or arguments, and final dispatch, the extension SDK client and the guard do not share one rewritten view."})}function scopeItemRevisionConflict(error,invocation){if(invocation===void 0||!isItemRevisionConflict(error)||typeof error.context.item_id!="string"||isItemRevisionRefusalScoped(error))return error;const unreadable=error.context.reason===ITEM_REVISION_CONFLICT_UNREADABLE_REASON;if(!unreadable&&error.context.reason!==ITEM_REVISION_CONFLICT_CHANGED_REASON)return error;const scoped=markItemRevisionRefusalScoped(retainItemRevisionRefusalTracker(error,new PmCliError(error.message,error.exitCode,{...error.context,...itemRevisionConflictGuidance(error.context.item_id,unreadable,invocation)})));return scoped.stack=error.stack,scoped}async function enrichItemRevisionConflict(error,pmRoot,invocation){if(!isItemRevisionRefusalFrom(error,pmRoot))return error;const scoped=scopeItemRevisionConflict(error,invocation);if(!isItemRevisionConflict(scoped)||scoped.context.details!==void 0)return scoped;const id=scoped.context.item_id,expected=scoped.context.expected_revision;if(typeof id!="string"||typeof expected!="string")return scoped;let changes;try{changes=await describeItemRevisionChanges(pmRoot,id,expected)}catch{return scoped}if(changes===void 0)return scoped;const details={expected_revision_recorded:changes.expected_revision_recorded,changes_since:changes.changes_since.map(change=>({ts:change.ts,op:change.op,author:change.author,fields:[...change.fields]})),changes_since_omitted:changes.changes_since_omitted},enriched=retainItemRevisionRefusalTracker(scoped,new PmCliError(scoped.message,scoped.exitCode,{...scoped.context,details}));return enriched.stack=scoped.stack,enriched}async function runWithBoundItemRevisionScope(scope,operation,invocation){try{return{result:await runWithItemRevisionScope(scope,operation),...itemRevisionScopeReceipt(scope)}}catch(error){throw scope.pmRoot===void 0?error:await enrichItemRevisionConflict(error,scope.pmRoot,invocation)}}function revisionRecoveryInvocation(context){return context.cwd===void 0&&context.pmRoot===void 0?void 0:{scopeArgs:["--pm-path",resolveRevisionRoot(context)]}}async function withExpectedItemRevisions(expectations,operation,context={}){return runWithBoundItemRevisionScope(await bindExpectedItemRevisions(expectations,context),operation,revisionRecoveryInvocation(context))}async function bindExpectedItemRevisions(expectations,context={}){const pmRoot=resolveRevisionRoot(context),specs=expectations.map(({id,itemHash})=>({id,itemHash:normalizeExpectedItemHash(itemHash)})),scope=createItemRevisionScope();return bindItemRevisionScope(scope,pmRoot,await resolveExpectedItemRevisions(pmRoot,specs)),scope}function itemRevisionUncheckedWarning(id){return`expect_hash_unchecked:${id}:no_locked_write_reached_this_item`}const NATIVE_ACTIONS=new Set(PM_TOOL_ACTIONS);function assertExpectHashAdmissible(path,options={}){const hyphenated=path.trim().replace(/\s+/gu,"-"),action=NATIVE_ACTIONS.has(hyphenated)?hyphenated:path;if(NATIVE_ACTIONS.has(action)&&(!isMutationAction(action)||action==="deps")&&!PM_EXPECT_HASH_ACTIONS.has(action))throw expectHashRequiresMutationError(action);if((action==="test"||action==="test-all")&&options.background===!0)throw new PmCliError(`--expect-hash cannot guard ${action} --background: the worker runs in another process.`,EXIT_CODE.USAGE,{code:"expect_hash_background_unsupported",required:`Run ${action} in the foreground to guard its result recording, or drop --expect-hash for a background run.`})}function expectHashRequiresMutationError(action){return new PmCliError(`--expect-hash guards item writes, and ${action} is not a mutation.`,EXIT_CODE.USAGE,{code:"expect_hash_requires_mutation",required:"Use --expect-hash (MCP/SDK expectHash) only on a command or action that writes items."})}function withUncheckedRevisionWarnings(result,unchecked){if(unchecked.length===0||typeof result!="object"||result===null||Array.isArray(result))return result;const record=result,warnings=Array.isArray(record.warnings)?record.warnings:[];return{...record,warnings:[...warnings,...unchecked.map(itemRevisionUncheckedWarning)]}}async function dispatchWithExpectedItemRevisions(params){const raw=params.expectHash;if(raw!==void 0&&typeof raw!="string"&&!(Array.isArray(raw)&&raw.every(entry=>typeof entry=="string")))throw invalidExpectHash(JSON.stringify(raw)??String(raw),"expected a string or an array of strings");const specs=parseExpectHashSpecs(raw);if(specs.length===0)return params.run();assertExpectHashAdmissible(params.action,{background:params.background===!0||params.options?.background===!0});const scope=createItemRevisionScope();bindItemRevisionScope(scope,params.pmRoot,await resolveExpectedItemRevisions(params.pmRoot,specs,params.defaultId));const outcome=await runWithBoundItemRevisionScope(scope,params.run,params.invocation);return withUncheckedRevisionWarnings(outcome.result,outcome.unchecked)}export{ITEM_REVISION_CONFLICT_CHANGE_LIMIT,ITEM_REVISION_CONFLICT_CODE,assertExpectHashAdmissible,bindExpectedItemRevisions,bindItemRevisionScope,createItemRevisionScope,describeItemRevisionChanges,dispatchWithExpectedItemRevisions,enrichItemRevisionConflict,expectHashInvocationRewrittenError,expectHashRequiresMutationError,isItemRevisionConflict,itemRevisionConflictRowFields,itemRevisionScopeReceipt,itemRevisionUncheckedWarning,normalizeExpectedItemHash,parseExpectHashSpecs,readItemRevision,resolveExpectedItemRevisions,runWithBoundItemRevisionScope,runWithItemRevisionScope,scopeItemRevisionConflict,throwFirstItemRevisionConflict,withExpectedItemRevisions};
|
|
2
2
|
//# sourceMappingURL=item-revision.js.map
|
|
@@ -35,7 +35,7 @@ changed_fields:string[];
|
|
|
35
35
|
warnings:string[];
|
|
36
36
|
}
|
|
37
37
|
/** Resolve restore targets with the command's established wording and at-or-before timestamp semantics. */
|
|
38
|
-
declare function ensureReplayTarget(target:string,history:readonly HistoryEntry[]):import("
|
|
38
|
+
declare function ensureReplayTarget(target:string,history:readonly HistoryEntry[]):import("../index.js").ResolvedHistoryTarget;
|
|
39
39
|
declare function replayCurrentDocument(history:HistoryEntry[]):ItemDocument;
|
|
40
40
|
/** Resolve live or deleted history and enforce the current item's stream policy before restoring a historical version. */
|
|
41
41
|
declare function resolveRestoreSubject(pmRoot:string,id:string,settings:Awaited<ReturnType<typeof readSettings>>,typeToFolder:Record<string,string>):Promise<ResolvedRestoreSubject>;
|
package/dist/sdk/merge.d.ts
CHANGED
|
@@ -5,3 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export * from "./merge/index.js";
|
|
7
7
|
export * from "./merge/install.js";
|
|
8
|
+
export type { ItemDocumentFormatOptions } from "../core/item/item-format.js";
|
|
9
|
+
export type { GlobalOptions } from "../core/shared/command-types.js";
|
|
10
|
+
export type { PmSettings } from "../types.js";
|
package/dist/sdk/merge.js
CHANGED
|
@@ -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]="
|
|
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]="a0dade99-4f2f-57e4-8a38-84316b0bb57c")}catch{}})();export*from"./merge/index.js";export*from"./merge/install.js";
|
|
2
2
|
//# sourceMappingURL=merge.js.map
|
package/dist/sdk/notes.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type GlobalOptions } from "./runtime-primitives.js";
|
|
7
7
|
import type { LogNote } from "../types/index.js";
|
|
8
|
-
import { type AnnotationMutationReceipt,type AnnotationOmissionReceipt } from "./annotations.js";
|
|
8
|
+
import { type AnnotationMutationReceipt,type IndexedAnnotationEntry,type AnnotationOmissionReceipt } from "./annotations.js";
|
|
9
9
|
/** Documents the notes command options payload exchanged by command, SDK, and package integrations. */
|
|
10
10
|
export interface NotesCommandOptions {
|
|
11
11
|
/** Value that configures or reports add for this contract. */
|
|
@@ -32,6 +32,8 @@ includeMeta?:boolean;
|
|
|
32
32
|
fullHistory?:boolean;
|
|
33
33
|
/** Append only when no note has the same resolved author and text. */
|
|
34
34
|
ifAbsent?:boolean;
|
|
35
|
+
/** For edit/delete: the created_at of the note read at that index. Compares timestamps, not identities: an entry with a different created_at is refused, one sharing the timestamp is not. */
|
|
36
|
+
expectAt?:string;
|
|
35
37
|
/** Value that configures or reports author for this contract. */
|
|
36
38
|
author?:string;
|
|
37
39
|
/** Human-readable explanation suitable for logs and agent-facing output. */
|
|
@@ -44,7 +46,7 @@ export interface NotesResult {
|
|
|
44
46
|
/** Stable identifier used to reference this record across commands and storage. */
|
|
45
47
|
id:string;
|
|
46
48
|
/** Value that configures or reports notes for this contract. */
|
|
47
|
-
notes:LogNote
|
|
49
|
+
notes:Array<IndexedAnnotationEntry<LogNote>>;
|
|
48
50
|
/** Value that configures or reports count for this contract. */
|
|
49
51
|
count:number;
|
|
50
52
|
/** Total entries before limit and structured-event filters. */
|
package/dist/sdk/notes.js
CHANGED
|
@@ -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]="
|
|
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]="be7de7b1-db32-543c-a3ae-c4958ee3b395")}catch{}})();import{EXIT_CODE,PmCliError,parseLimit,stableStringify}from"./runtime-primitives.js";import{limitAnnotationEntries,parseAnnotationTextInput,resolveAnnotationInput,runAnnotationCommand}from"./annotations.js";function parseStructuredEventPayload(raw){if(raw===void 0)return;if(raw.trim().length===0)throw new PmCliError("--add-json must contain a JSON value",EXIT_CODE.USAGE,{code:"structured_event_json_empty"});let parsed;try{parsed=JSON.parse(raw)}catch{throw new PmCliError("--add-json must be valid JSON",EXIT_CODE.USAGE,{code:"structured_event_json_invalid"})}return parsed}function structuredEventType(value){if(typeof value!="object"||value===null||Array.isArray(value))return;const candidate=value.type;return typeof candidate=="string"&&candidate.trim().length>0?candidate.trim():void 0}function parseSinceTimestamp(value){if(value===void 0)return;const timestamp=Date.parse(value);if(!Number.isFinite(timestamp))throw new PmCliError("--since must be a valid ISO timestamp",EXIT_CODE.USAGE,{code:"structured_event_since_invalid"});return timestamp}function storedNoteFields(entry){return Object.prototype.toString.call(entry)==="[object Object]"?entry:{}}async function runNotes(id,options,global2){const structuredPayload=parseStructuredEventPayload(options.addJson),conflictingStructuredInputs=[options.add!==void 0,options.stdin===!0,options.file!==void 0,options.edit!==void 0,options.delete!==void 0].includes(!0);if(structuredPayload!==void 0&&conflictingStructuredInputs)throw new PmCliError("--add-json cannot be combined with text, edit, delete, stdin, or file inputs",EXIT_CODE.USAGE,{code:"structured_event_input_conflict"});const canonicalJson=structuredPayload===void 0?void 0:stableStringify(structuredPayload),filteringEvents=[options.since,options.eventType].some(value=>value!==void 0),sinceTimestamp=parseSinceTimestamp(options.since),limit=parseLimit(options.limit),result=await runAnnotationCommand(id,{...options,...filteringEvents?{limit:void 0}:{},includeMeta:[options.includeMeta===!0,filteringEvents].includes(!0)},global2,{input:await resolveAnnotationInput(canonicalJson===void 0?options:{add:canonicalJson},"note"),collectionKey:"notes",op:"note_add",editOp:"note_edit",deleteOp:"note_delete",parseText:raw=>parseAnnotationTextInput(raw),createEntry:entry=>structuredPayload===void 0?entry:{...entry,format:"json",data:structuredPayload,event_type:structuredEventType(structuredPayload)},bypassOwnershipConflict:!![options.edit===void 0,options.delete===void 0,options.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."]}}),eventType=options.eventType?.trim(),matching=result.notes.filter(entry=>{const note=storedNoteFields(entry),isStructured=[note.format==="json",note.data!==void 0].every(Boolean),matchesSince=[sinceTimestamp===void 0,Date.parse(note.created_at??"")>=(sinceTimestamp??Number.POSITIVE_INFINITY)].includes(!0),matchesType=[!eventType,note.event_type===eventType].includes(!0);return[!filteringEvents,[isStructured,matchesSince,matchesType].every(Boolean)].includes(!0)}),filtered=filteringEvents?limitAnnotationEntries(matching,limit):matching,structuredEventCount=filtered.filter(entry=>storedNoteFields(entry).format==="json").length;return{...result,notes:filtered,count:filtered.length,...filteringEvents?{total_count:matching.length,returned_count:filtered.length,has_more:filtered.length<matching.length,...limit===void 0?{}:{limit},structured_event_count:structuredEventCount}:options.includeMeta===!0?{structured_event_count:structuredEventCount}:{}}}export{runNotes};
|
|
2
2
|
//# sourceMappingURL=notes.js.map
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* @module sdk/output/list-envelope
|
|
3
|
+
*
|
|
4
|
+
* Projects standard list and search read receipts for agent presentation while
|
|
5
|
+
* retaining source uncertainty, pagination and producer-owned diagnostics. The
|
|
6
|
+
* brief default, `--compact` and `--fields` row projections share one lean
|
|
7
|
+
* envelope (GH-1642, GH-1674); `--full` and JSON keep the typed result.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Compact a standard brief, compact or fields list envelope without mutating
|
|
11
|
+
* its typed SDK result. Full, custom, partial and inconsistent receipts pass
|
|
12
|
+
* through unchanged. Unchecked pages retain their explicit source status,
|
|
13
|
+
* including empty pages. JSON hosts should retain the original result when full
|
|
14
|
+
* receipts are required.
|
|
6
15
|
*/
|
|
7
16
|
export declare function projectPmBriefListEnvelope(value:unknown):unknown;
|
|
8
17
|
/**
|
|
9
18
|
* Compact a standard search page without mutating its typed SDK result:
|
|
10
19
|
* drops `truncated` when it repeats `has_more`, a `filters.limit` echo of
|
|
11
|
-
* `applied_limit`, and the single default
|
|
12
|
-
*
|
|
13
|
-
*
|
|
20
|
+
* `applied_limit`, and the single default omission receipt in favour of
|
|
21
|
+
* `details: "--full"`. A `--fields` page also drops its projection and `fields`
|
|
22
|
+
* echo, `now`, and a `mode_source` the caller already knows (GH-1674). Custom,
|
|
23
|
+
* partial and inconsistent receipts pass through unchanged; JSON hosts should
|
|
24
|
+
* keep the original result.
|
|
14
25
|
*/
|
|
15
26
|
export declare function projectPmBriefSearchEnvelope(value:unknown):unknown;
|