@unbrained/pm-cli 2026.11.8 → 2026.11.10
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 +31 -0
- package/dist/cli/error-guidance.js +4 -4
- package/dist/cli/main.js +1 -1
- package/dist/cli/public.d.ts +1 -1
- package/dist/cli/register-history-maintenance.js +2 -2
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli/runtime/projection-retry.js +1 -1
- package/dist/cli/runtime/read-output-mutation-retry.js +2 -0
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-NKO42JMT.js → chunk-4AASUCHO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7GC6WIDR.js → chunk-4FLAKTZW.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-5CAMQHEW.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-NH7QX2M2.js → chunk-7NAAW5EX.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-BSJSGDA3.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-DOHZKPPC.js → chunk-CZETQYKO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YUTFMHSG.js → chunk-D727C4RO.js} +33 -33
- package/dist/cli-bundle/chunks/{chunk-XBUZENP4.js → chunk-EHDGHFMJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L5BU5FYN.js → chunk-F6FBGLR7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MKW5LGVQ.js → chunk-F7P2NZEG.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-7V6I6X4G.js → chunk-FYD6LSJA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-L4WWG2H6.js +6 -0
- package/dist/cli-bundle/chunks/{chunk-S4IZIMAO.js → chunk-NNE63MSM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HESIRIVX.js → chunk-NZAFLDSH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Z3LWNF7C.js → chunk-OJ2KEDUX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4BMPGUTG.js → chunk-T2MNRM3S.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YGUUJHSR.js → chunk-TBBWPEF5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-C4MQFWCM.js → chunk-U7LILCUN.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-UFPLZ6LZ.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-CP43BHX3.js → chunk-UL64P6MR.js} +29 -29
- package/dist/cli-bundle/chunks/chunk-WNEUWDUE.js +116 -0
- package/dist/cli-bundle/chunks/{chunk-RC6SSFOF.js → chunk-X7NM5HVQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LI2HP5OX.js → chunk-YSWD2NXB.js} +2 -2
- package/dist/cli-bundle/chunks/item-revision-M7KXLQXF.js +2 -0
- package/dist/cli-bundle/chunks/item-transaction-4N5P34GO.js +2 -0
- package/dist/cli-bundle/chunks/{mutation-admission-FJ3D66PV.js → mutation-admission-374UR7NI.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-GXP77CX7.js → register-list-query-GSB7PP5P.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-XJ2DROUM.js → register-mutation-ZBF6ITYK.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-O5LERXM7.js → register-operations-PWF6GOHE.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-4VOTYLL2.js → register-setup-QDZ2Y3CI.js} +2 -2
- package/dist/cli-bundle/chunks/{stage-ZDJL3FGL.js → stage-67WGPKPH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Z2QWZRSL.js → chunk-2SQUWQP3.js} +18 -18
- package/dist/cli-bundle/focused-chunks/{chunk-P4EHEH4C.js → chunk-2Y4H4LIX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-WPXMPGTY.js → chunk-3DWNH72D.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3K2MYE7R.js +26 -0
- package/dist/cli-bundle/focused-chunks/{chunk-LTPT5TE7.js → chunk-56MIAFEN.js} +20 -20
- package/dist/cli-bundle/focused-chunks/{chunk-3HFENALW.js → chunk-67M7E2Z3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6U5HP6L3.js → chunk-ALLOWZSH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-I4YUZW3J.js → chunk-BE2GK2G7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KNF2QTEZ.js → chunk-HTMQDNVC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UUVRYIKA.js → chunk-LWMPQRJT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-O7K3X4LH.js → chunk-LY3JXL25.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-DIEBSC76.js → chunk-NZQYHPUN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5YPX3QKU.js → chunk-PAGW6A2X.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QCHCEFTO.js +12 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4UOXVFJZ.js → chunk-QHGGO7SY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QK7FX4O5.js +44 -0
- package/dist/cli-bundle/focused-chunks/{chunk-SZ2BKK3M.js → chunk-RFMKS7VD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-U7HWWEJ2.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-UIZVD36C.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ULTSMJYF.js → chunk-WJHDUON5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TSHRBPTI.js → chunk-WK773UVA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZBOCYFBE.js +82 -0
- package/dist/cli-bundle/focused-chunks/item-revision-XC4ZJ7MY.js +2 -0
- package/dist/cli-bundle/focused-chunks/{item-transaction-Q2Z7DDCR.js → item-transaction-CVGK4RJP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-admission-QWC6MLTZ.js → mutation-admission-N27D5H64.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-NKH5SKSZ.js → stage-KPK2UHVO.js} +2 -2
- package/dist/cli-bundle/main.js +26 -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 +9 -9
- package/dist/core/checkpoint/mutation-checkpoint.d.ts +12 -20
- package/dist/core/config/nested-settings.d.ts +14 -45
- package/dist/core/config/nested-settings.js +1 -1
- package/dist/core/config/positional-value.d.ts +11 -14
- package/dist/core/config/positional-value.js +1 -1
- package/dist/core/extensions/activation-summary-markdown.d.ts +4 -5
- package/dist/core/extensions/activation-summary.d.ts +7 -15
- package/dist/core/extensions/capability-usage.d.ts +7 -23
- package/dist/core/extensions/command-hook-context.d.ts +4 -7
- package/dist/core/extensions/command-metadata-contract.d.ts +2 -2
- package/dist/core/extensions/contribution-inventory.d.ts +3 -25
- package/dist/core/extensions/extension-capability-aliases.d.ts +7 -10
- package/dist/core/extensions/extension-hook-runtime.d.ts +2 -2
- package/dist/core/extensions/extension-policy.d.ts +12 -47
- package/dist/core/extensions/extension-registries.d.ts +2 -2
- package/dist/core/extensions/extension-types.d.ts +332 -545
- package/dist/core/extensions/flag-definition-validation.d.ts +11 -13
- package/dist/core/extensions/flag-value-types.d.ts +11 -13
- package/dist/core/extensions/index.d.ts +15 -20
- package/dist/core/extensions/item-field-types.d.ts +5 -5
- package/dist/core/extensions/item-fields.d.ts +4 -7
- package/dist/core/extensions/loader.d.ts +5 -69
- package/dist/core/extensions/manifest-parser.d.ts +3 -3
- package/dist/core/extensions/manifest-schema.d.ts +10 -13
- package/dist/core/extensions/registration-contracts.d.ts +2 -4
- package/dist/core/extensions/registration-validation.d.ts +1 -1
- package/dist/core/extensions/registration-values.d.ts +5 -7
- package/dist/core/extensions/runtime-registrations.d.ts +6 -6
- package/dist/core/extensions/version-compat.d.ts +9 -10
- package/dist/core/fs/fs-utils.d.ts +4 -6
- package/dist/core/fs/host-environment-errors.d.ts +8 -10
- package/dist/core/governance/content-fields.d.ts +10 -14
- package/dist/core/governance/issue-codes.d.ts +12 -18
- package/dist/core/governance/metadata-coverage.d.ts +24 -34
- package/dist/core/history/digest.d.ts +3 -3
- package/dist/core/history/event-classification.d.ts +5 -5
- package/dist/core/history/event-index.d.ts +14 -35
- package/dist/core/history/history-compact-bulk.d.ts +10 -13
- package/dist/core/history/history-diff.d.ts +6 -11
- package/dist/core/history/history-rewrite.d.ts +24 -40
- package/dist/core/history/history-storage-stats.d.ts +9 -17
- package/dist/core/history/history-stream-policy.d.ts +8 -11
- package/dist/core/history/history.d.ts +10 -44
- package/dist/core/history/identity.d.ts +4 -5
- package/dist/core/history/operation-contract.d.ts +5 -15
- package/dist/core/history/projection.d.ts +10 -14
- package/dist/core/history/read.d.ts +6 -7
- package/dist/core/history/replay.d.ts +16 -37
- package/dist/core/history/workspace-history.d.ts +27 -60
- package/dist/core/io/body-file.d.ts +2 -2
- package/dist/core/io/bulk-ids-input.d.ts +7 -8
- package/dist/core/item/actionability.d.ts +16 -22
- package/dist/core/item/dependency-reference.d.ts +2 -2
- package/dist/core/item/id.d.ts +5 -9
- package/dist/core/item/item-format-version.d.ts +11 -13
- package/dist/core/item/item-format.d.ts +20 -60
- package/dist/core/item/item-format.js +1 -1
- package/dist/core/item/item-record.d.ts +2 -2
- package/dist/core/item/literal-mutation-input.d.ts +2 -2
- package/dist/core/item/parent-reference-policy.d.ts +4 -7
- package/dist/core/item/parse.d.ts +10 -26
- package/dist/core/item/plan-lifecycle.d.ts +3 -3
- package/dist/core/item/priority.d.ts +2 -2
- package/dist/core/item/sprint-release-format.d.ts +3 -7
- package/dist/core/item/status-filter.d.ts +5 -7
- package/dist/core/item/status.d.ts +3 -4
- package/dist/core/item/type-registry.d.ts +17 -24
- package/dist/core/item/type-synonyms.d.ts +1 -1
- package/dist/core/lock/lock-owner.d.ts +8 -10
- package/dist/core/lock/lock.d.ts +19 -67
- package/dist/core/output/output-control.d.ts +5 -6
- package/dist/core/output/output.d.ts +18 -20
- package/dist/core/output/output.js +4 -4
- package/dist/core/output/tabular.d.ts +2 -2
- package/dist/core/packages/manifest.d.ts +13 -17
- package/dist/core/packages/root.d.ts +3 -3
- package/dist/core/policy/workflow-policy-schema.d.ts +2 -310
- package/dist/core/policy/workflow-policy-store.d.ts +5 -14
- package/dist/core/policy/workflow-policy.d.ts +25 -52
- package/dist/core/profile/profile-describe.d.ts +8 -11
- package/dist/core/profile/profile-lint.d.ts +11 -13
- package/dist/core/profile/profile-plan.d.ts +30 -49
- package/dist/core/profile/profile-presets.d.ts +25 -36
- package/dist/core/reproducibility/context.d.ts +6 -7
- package/dist/core/schema/fields-file.d.ts +14 -21
- package/dist/core/schema/item-types-file.d.ts +16 -22
- package/dist/core/schema/runtime-field-filters.d.ts +2 -2
- package/dist/core/schema/runtime-field-values.d.ts +6 -13
- package/dist/core/schema/runtime-schema.d.ts +19 -31
- package/dist/core/schema/status-defs-file.d.ts +15 -25
- package/dist/core/schema/status-token.d.ts +1 -1
- package/dist/core/schema/type-inference.d.ts +6 -8
- package/dist/core/schema/type-presets.d.ts +5 -5
- package/dist/core/schema/type-workflows.d.ts +11 -16
- package/dist/core/search/background-refresh.d.ts +6 -12
- package/dist/core/search/bm25.d.ts +11 -19
- package/dist/core/search/cache.d.ts +19 -41
- package/dist/core/search/corpus.d.ts +16 -19
- package/dist/core/search/corpus.js +1 -1
- package/dist/core/search/embedding-batches.d.ts +12 -17
- package/dist/core/search/eval-thresholds.d.ts +3 -3
- package/dist/core/search/eval.d.ts +16 -34
- package/dist/core/search/http-client.d.ts +14 -18
- package/dist/core/search/providers.d.ts +22 -39
- package/dist/core/search/relevance.d.ts +14 -19
- package/dist/core/search/semantic-defaults.d.ts +4 -5
- package/dist/core/search/vector-stores.d.ts +35 -57
- package/dist/core/search/vectorization-metadata.d.ts +9 -11
- package/dist/core/sentry/helpers.d.ts +6 -31
- package/dist/core/sentry/instrument.d.ts +6 -59
- package/dist/core/session/session-state.d.ts +12 -32
- package/dist/core/shared/agent-session-context.d.ts +10 -17
- package/dist/core/shared/author.d.ts +48 -69
- package/dist/core/shared/command-line.d.ts +3 -3
- package/dist/core/shared/command-types.d.ts +3 -4
- package/dist/core/shared/constants.d.ts +14 -32
- package/dist/core/shared/error-details.d.ts +5 -18
- package/dist/core/shared/errors.d.ts +42 -83
- package/dist/core/shared/html-entity-decode.d.ts +1 -1
- package/dist/core/shared/item-metadata-contract.d.ts +2 -2
- package/dist/core/shared/lazy-module.d.ts +1 -1
- package/dist/core/shared/levenshtein.d.ts +1 -1
- package/dist/core/shared/numeric-parsers.d.ts +1 -1
- package/dist/core/shared/option-alias-visibility.d.ts +2 -2
- package/dist/core/shared/output-unicode.d.ts +1 -1
- package/dist/core/shared/primitives.d.ts +10 -10
- package/dist/core/shared/secret-rules.d.ts +7 -93
- package/dist/core/shared/serial-queue.d.ts +7 -9
- package/dist/core/shared/serialization.d.ts +1 -1
- package/dist/core/shared/split-comma-list.d.ts +4 -5
- package/dist/core/shared/text-normalization.d.ts +1 -1
- package/dist/core/shared/time.d.ts +6 -20
- package/dist/core/store/item-format-migration.d.ts +4 -5
- package/dist/core/store/item-metadata-cache.d.ts +22 -27
- package/dist/core/store/item-metadata-query-index.d.ts +20 -61
- package/dist/core/store/item-metadata-read-work.d.ts +3 -7
- package/dist/core/store/item-mutation-precondition.d.ts +19 -35
- package/dist/core/store/item-store.d.ts +18 -141
- package/dist/core/store/paths.d.ts +5 -10
- package/dist/core/store/settings-read-cache.d.ts +7 -9
- package/dist/core/store/settings-sections.d.ts +15 -19
- package/dist/core/store/settings-validator.d.ts +27 -143
- package/dist/core/store/settings-validator.js +1 -1
- package/dist/core/store/settings.d.ts +19 -94
- package/dist/core/store/sqlite-runtime.d.ts +3 -3
- package/dist/core/store/tracker-preflight.d.ts +2 -2
- package/dist/core/telemetry/consent.d.ts +2 -2
- package/dist/core/telemetry/observability.d.ts +8 -19
- package/dist/core/telemetry/policy.d.ts +8 -23
- package/dist/core/telemetry/runtime.d.ts +44 -254
- package/dist/core/test/background-runs.d.ts +35 -79
- package/dist/core/test/run-selectors.d.ts +10 -12
- package/dist/core/validate/fix-planning.d.ts +19 -28
- package/dist/core/validate/missing-by-type.d.ts +3 -4
- package/dist/core/validate/missing-link-owners.d.ts +12 -16
- package/dist/core/validate/stale-file-classification.d.ts +5 -6
- package/dist/mcp/tool-definitions.d.ts +7 -30
- package/dist/mcp/tool-definitions.js +1 -1
- package/dist/sdk/actionability.d.ts +1 -1
- package/dist/sdk/agent/closed-domain-contracts.d.ts +4 -5
- package/dist/sdk/agent/command-recovery.d.ts +9 -13
- package/dist/sdk/agent/command-suggestions.d.ts +2 -2
- package/dist/sdk/agent/create-option-policy.d.ts +2 -2
- package/dist/sdk/agent/identity-config.d.ts +13 -18
- package/dist/sdk/agent/item-addressing.d.ts +4 -5
- package/dist/sdk/agent/linked-resource-recovery.d.ts +3 -4
- package/dist/sdk/agent/refusal-closure-census.d.ts +13 -25
- package/dist/sdk/agent/refusal-closure.d.ts +8 -11
- package/dist/sdk/agent/refusal-corpus-contracts.d.ts +15 -21
- package/dist/sdk/agent/refusal-reachability.d.ts +38 -52
- package/dist/sdk/agent/subcommand-recovery.d.ts +7 -15
- package/dist/sdk/agent/task-transcript-contracts.d.ts +12 -15
- package/dist/sdk/agent/tracker-preflight-contracts.d.ts +13 -17
- package/dist/sdk/agent-capability-contracts.d.ts +19 -32
- package/dist/sdk/agent-session-context.d.ts +1 -1
- package/dist/sdk/annotations.d.ts +32 -68
- package/dist/sdk/annotations.js +1 -1
- package/dist/sdk/author-attribution.d.ts +22 -33
- package/dist/sdk/authoring.d.ts +1 -19
- package/dist/sdk/cli-bootstrap.d.ts +22 -59
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +31 -57
- package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -8
- package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +19 -65
- package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +2 -2
- package/dist/sdk/cli-contracts/commander-types.d.ts +6 -11
- package/dist/sdk/cli-contracts/completeness.d.ts +11 -15
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +25 -37
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +16 -20
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +14 -19
- package/dist/sdk/cli-contracts/grammar-contracts.d.ts +29 -47
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +44 -265
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +11 -564
- package/dist/sdk/cli-contracts/tool-schema.d.ts +18 -51
- package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +18 -37
- package/dist/sdk/cli-contracts.d.ts +1 -16
- package/dist/sdk/cli-program.d.ts +2 -2
- package/dist/sdk/command-line.d.ts +3 -4
- package/dist/sdk/comments.d.ts +6 -10
- package/dist/sdk/compile-cache.d.ts +4 -5
- package/dist/sdk/completion/bash.d.ts +2 -2
- package/dist/sdk/completion/fish.d.ts +2 -2
- package/dist/sdk/completion/shared.d.ts +10 -77
- package/dist/sdk/completion/shared.js +1 -1
- package/dist/sdk/completion/zsh.d.ts +2 -2
- package/dist/sdk/completion.d.ts +2 -6
- package/dist/sdk/compose.d.ts +49 -74
- package/dist/sdk/config.d.ts +18 -94
- package/dist/sdk/config.js +1 -1
- package/dist/sdk/context/recency.d.ts +2 -2
- package/dist/sdk/context/semantic-session-attribution.d.ts +6 -25
- package/dist/sdk/context/usage-ledger.d.ts +9 -21
- package/dist/sdk/context-intent-contracts.d.ts +24 -35
- package/dist/sdk/context-intent-runtime.d.ts +7 -9
- package/dist/sdk/context-packing.d.ts +16 -34
- package/dist/sdk/context-relevance.d.ts +58 -93
- package/dist/sdk/context-signal-store.d.ts +29 -60
- package/dist/sdk/context-usage.d.ts +22 -69
- package/dist/sdk/contracts.d.ts +1 -24
- package/dist/sdk/core-governance.d.ts +1 -5
- package/dist/sdk/core.d.ts +1 -27
- package/dist/sdk/corpus-shape.d.ts +16 -28
- package/dist/sdk/define.d.ts +10 -14
- package/dist/sdk/dependencies.d.ts +32 -50
- package/dist/sdk/dependency-provenance.d.ts +19 -23
- package/dist/sdk/docs.d.ts +6 -10
- package/dist/sdk/duplicates.d.ts +8 -15
- package/dist/sdk/environment/agent-environment.d.ts +60 -101
- package/dist/sdk/environment/host-environment-errors.d.ts +1 -1
- package/dist/sdk/environment/project-runtime-compatibility.d.ts +15 -29
- package/dist/sdk/environment/source-context.d.ts +6 -7
- package/dist/sdk/environment/tracker-preflight.d.ts +1 -1
- package/dist/sdk/error-code-catalog.d.ts +9 -26
- package/dist/sdk/error-runtime.d.ts +6 -8
- package/dist/sdk/errors.d.ts +10 -17
- package/dist/sdk/eval.d.ts +11 -21
- package/dist/sdk/extension/command-options.d.ts +14 -26
- package/dist/sdk/extension/describe.d.ts +14 -19
- package/dist/sdk/extension/doctor.d.ts +8 -48
- package/dist/sdk/extension/install-plan.d.ts +12 -26
- package/dist/sdk/extension/install-runtime.d.ts +10 -11
- package/dist/sdk/extension/install-sources.d.ts +22 -104
- package/dist/sdk/extension/managed-state.d.ts +13 -18
- package/dist/sdk/extension/migrations.d.ts +22 -37
- package/dist/sdk/extension/output-ownership.d.ts +3 -30
- package/dist/sdk/extension/shared.d.ts +9 -15
- package/dist/sdk/extension/source-resolution.d.ts +13 -18
- package/dist/sdk/extension/static-inventory.d.ts +17 -21
- package/dist/sdk/extension/update-check.d.ts +7 -11
- package/dist/sdk/extension-command-context.d.ts +2 -3
- package/dist/sdk/extension-contracts.d.ts +11 -14
- package/dist/sdk/extension.d.ts +31 -192
- package/dist/sdk/files.d.ts +27 -68
- package/dist/sdk/flag-invocation-contracts.d.ts +13 -17
- package/dist/sdk/generated/error-code-catalog-rows.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/generated-error-code-catalog.d.ts +1 -1
- package/dist/sdk/governance/artifact-ledgers.d.ts +9 -16
- package/dist/sdk/governance/assurance-action-contracts.d.ts +1 -1
- package/dist/sdk/governance/assurance-action.d.ts +13 -45
- package/dist/sdk/governance/assurance-mutation-error.d.ts +12 -17
- package/dist/sdk/governance/assurance-presets.d.ts +10 -21
- package/dist/sdk/governance/assurance-runtime.d.ts +5 -6
- package/dist/sdk/governance/assurance.d.ts +97 -154
- package/dist/sdk/governance/boundary-fixtures.d.ts +17 -23
- package/dist/sdk/governance/closure-timestamps.d.ts +5 -15
- package/dist/sdk/governance/coverage-assurance.d.ts +5 -6
- package/dist/sdk/governance/defect-recurrence-coverage.d.ts +13 -23
- package/dist/sdk/governance/defect-recurrence-graph.d.ts +9 -13
- package/dist/sdk/governance/defect-recurrence.d.ts +43 -67
- package/dist/sdk/governance/extension-host-version.d.ts +8 -10
- package/dist/sdk/governance/gc.d.ts +12 -20
- package/dist/sdk/governance/health/projection.d.ts +8 -23
- package/dist/sdk/governance/health.d.ts +23 -167
- package/dist/sdk/governance/hierarchy-validation.d.ts +2 -18
- package/dist/sdk/governance/linked-file-report.d.ts +6 -10
- package/dist/sdk/governance/merge-receipt-history.d.ts +12 -16
- package/dist/sdk/governance/provenance-health.d.ts +17 -23
- package/dist/sdk/governance/reindex.d.ts +13 -116
- package/dist/sdk/governance/reliability.d.ts +13 -17
- package/dist/sdk/governance/stale-work.d.ts +8 -11
- package/dist/sdk/governance/status-role-diagnostics.d.ts +4 -6
- package/dist/sdk/governance/storage-integrity.d.ts +16 -23
- package/dist/sdk/governance/upgrade.d.ts +17 -57
- package/dist/sdk/governance/validate-item-reader.d.ts +3 -11
- package/dist/sdk/governance/validate-normalization.d.ts +2 -2
- package/dist/sdk/governance/validate.d.ts +29 -175
- package/dist/sdk/governance/workflow-completeness.d.ts +5 -17
- package/dist/sdk/governance/workflow-policy.d.ts +8 -16
- package/dist/sdk/governance/workspace-position.d.ts +12 -43
- package/dist/sdk/governance.d.ts +1 -39
- package/dist/sdk/graph/adapter.d.ts +23 -41
- package/dist/sdk/graph/analytics.d.ts +20 -31
- package/dist/sdk/graph/assembly.d.ts +24 -35
- package/dist/sdk/graph/cache.d.ts +13 -25
- package/dist/sdk/graph/cardinality-integrity.d.ts +4 -6
- package/dist/sdk/graph/centrality.d.ts +14 -20
- package/dist/sdk/graph/conformance.d.ts +12 -19
- package/dist/sdk/graph/deadline-scheduling.d.ts +14 -20
- package/dist/sdk/graph/durable-cache.d.ts +11 -14
- package/dist/sdk/graph/governance-contracts.d.ts +2 -2
- package/dist/sdk/graph/governance.d.ts +22 -36
- package/dist/sdk/graph/hierarchy-integrity.d.ts +18 -26
- package/dist/sdk/graph/index.d.ts +1 -17
- package/dist/sdk/graph/lifecycle-coverage.d.ts +8 -12
- package/dist/sdk/graph/mutation-advisory.d.ts +5 -16
- package/dist/sdk/graph/query-contracts.d.ts +1 -2
- package/dist/sdk/graph/remediation.d.ts +11 -18
- package/dist/sdk/graph/run.d.ts +73 -115
- package/dist/sdk/graph/scheduling.d.ts +8 -15
- package/dist/sdk/graph/traversal.d.ts +9 -15
- package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +2 -2
- package/dist/sdk/graph.d.ts +1 -12
- package/dist/sdk/guide-topics.d.ts +7 -10
- package/dist/sdk/guide.d.ts +21 -43
- package/dist/sdk/history/attestation-command.d.ts +7 -10
- package/dist/sdk/history/attestation-contract.d.ts +19 -34
- package/dist/sdk/history/attestation.d.ts +2 -3
- package/dist/sdk/history/maintenance.d.ts +17 -27
- package/dist/sdk/history/salvage.d.ts +5 -22
- package/dist/sdk/history/subject.d.ts +5 -11
- package/dist/sdk/history-analytics.d.ts +28 -59
- package/dist/sdk/history-compact.d.ts +25 -66
- package/dist/sdk/history-provenance.d.ts +16 -33
- package/dist/sdk/history-read.d.ts +9 -16
- package/dist/sdk/history-redact.d.ts +19 -74
- package/dist/sdk/history-redact.js +1 -1
- package/dist/sdk/history-repair.d.ts +26 -71
- package/dist/sdk/improvement-ledger-validation.d.ts +2 -2
- package/dist/sdk/improvement-ledger.d.ts +20 -39
- package/dist/sdk/index.d.ts +1 -268
- package/dist/sdk/init-agent-guidance.d.ts +13 -68
- package/dist/sdk/init.d.ts +24 -94
- package/dist/sdk/invocation-author.d.ts +1 -1
- package/dist/sdk/item-children.d.ts +10 -13
- package/dist/sdk/item-metadata-index.d.ts +1 -2
- package/dist/sdk/item-schedule.d.ts +8 -9
- package/dist/sdk/item-transaction.d.ts +46 -90
- package/dist/sdk/learnings.d.ts +6 -10
- package/dist/sdk/lifecycle/append.d.ts +7 -9
- package/dist/sdk/lifecycle/claim.d.ts +26 -42
- package/dist/sdk/lifecycle/cli-input.d.ts +1 -1
- package/dist/sdk/lifecycle/close-many.d.ts +14 -65
- package/dist/sdk/lifecycle/close.d.ts +10 -26
- package/dist/sdk/lifecycle/copy.d.ts +6 -10
- package/dist/sdk/lifecycle/create.d.ts +15 -83
- package/dist/sdk/lifecycle/delete.d.ts +7 -9
- package/dist/sdk/lifecycle/focus.d.ts +9 -11
- package/dist/sdk/lifecycle/item-revision.d.ts +31 -45
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/lifecycle/lifecycle-transitions.d.ts +4 -5
- package/dist/sdk/lifecycle/mutation-command-options.d.ts +6 -9
- package/dist/sdk/lifecycle/plan-mutation-receipt.d.ts +5 -13
- package/dist/sdk/lifecycle/plan.d.ts +34 -74
- package/dist/sdk/lifecycle/reopen.d.ts +8 -14
- package/dist/sdk/lifecycle/restore.d.ts +9 -38
- package/dist/sdk/lifecycle/shared-unset-fields.d.ts +23 -614
- package/dist/sdk/lifecycle/start-blockers.d.ts +7 -27
- package/dist/sdk/lifecycle/structured-mutation-plan.d.ts +8 -16
- package/dist/sdk/lifecycle/task-composition.d.ts +6 -14
- package/dist/sdk/lifecycle/update-many.d.ts +15 -65
- package/dist/sdk/lifecycle/update.d.ts +21 -104
- package/dist/sdk/lifecycle/workflow-transition.d.ts +2 -11
- package/dist/sdk/lifecycle-completion.d.ts +11 -14
- package/dist/sdk/lifecycle-policy.d.ts +23 -32
- package/dist/sdk/linked-artifacts.d.ts +31 -41
- package/dist/sdk/mcp/apps.d.ts +12 -27
- package/dist/sdk/mcp/authorization.d.ts +30 -63
- package/dist/sdk/mcp/discovery.d.ts +23 -52
- package/dist/sdk/mcp/executable.d.ts +3 -10
- package/dist/sdk/mcp/interactions.d.ts +25 -47
- package/dist/sdk/mcp/protocol.d.ts +32 -64
- package/dist/sdk/mcp/skills.d.ts +21 -71
- package/dist/sdk/mcp/subscriptions.d.ts +14 -28
- package/dist/sdk/mcp/tasks.d.ts +21 -55
- package/dist/sdk/mcp/transport.d.ts +7 -15
- package/dist/sdk/merge/driver.d.ts +13 -37
- package/dist/sdk/merge/index.d.ts +1 -6
- package/dist/sdk/merge/install.d.ts +27 -55
- package/dist/sdk/merge/receipt-operation.d.ts +5 -6
- package/dist/sdk/merge/receipt-schema.d.ts +6 -9
- package/dist/sdk/merge/receipts.d.ts +29 -79
- package/dist/sdk/merge/reconcile.d.ts +9 -18
- package/dist/sdk/merge/three-way.d.ts +21 -30
- package/dist/sdk/merge.d.ts +1 -5
- package/dist/sdk/mutation-events.d.ts +21 -53
- package/dist/sdk/mutation-guard.d.ts +15 -135
- package/dist/sdk/notes.d.ts +6 -10
- package/dist/sdk/output/fit-envelope.d.ts +21 -28
- package/dist/sdk/output/list-envelope.d.ts +1 -1
- package/dist/sdk/output/table-rows.d.ts +8 -12
- package/dist/sdk/output-contracts.d.ts +11 -14
- package/dist/sdk/output-projection.d.ts +18 -130
- package/dist/sdk/output-token-accounting.d.ts +8 -15
- package/dist/sdk/output.d.ts +10 -15
- package/dist/sdk/ownership-source.d.ts +4 -5
- package/dist/sdk/package-import-adapters.d.ts +27 -37
- package/dist/sdk/package-migrations.d.ts +2 -2
- package/dist/sdk/package-runtime-options.d.ts +3 -3
- package/dist/sdk/pagination.d.ts +12 -24
- package/dist/sdk/profile.d.ts +25 -42
- package/dist/sdk/provenance.d.ts +21 -32
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.d.ts +24 -77
- package/dist/sdk/query/aggregate.d.ts +20 -95
- package/dist/sdk/query/calendar.d.ts +26 -74
- package/dist/sdk/query/complete-list.d.ts +19 -35
- package/dist/sdk/query/context.d.ts +69 -240
- package/dist/sdk/query/declared-blockers.d.ts +2 -9
- package/dist/sdk/query/duplicate-candidates.d.ts +3 -5
- package/dist/sdk/query/get-facet-roots.js +2 -0
- package/dist/sdk/query/get.d.ts +13 -55
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/history.d.ts +18 -29
- package/dist/sdk/query/item-filter-options.d.ts +7 -12
- package/dist/sdk/query/list-filter-shared.d.ts +4 -8
- package/dist/sdk/query/list.d.ts +44 -168
- package/dist/sdk/query/multi-value-filters.d.ts +7 -9
- package/dist/sdk/query/next-ranking-policy.d.ts +4 -10
- package/dist/sdk/query/next-ready-budget.d.ts +4 -5
- package/dist/sdk/query/next.d.ts +27 -86
- package/dist/sdk/query/parsers.d.ts +4 -6
- package/dist/sdk/query/projection-contracts.d.ts +12 -21
- package/dist/sdk/query/search/corpus.d.ts +5 -20
- package/dist/sdk/query/search/filters.d.ts +5 -17
- package/dist/sdk/query/search/input.d.ts +4 -9
- package/dist/sdk/query/search/lexical.d.ts +5 -9
- package/dist/sdk/query/search/response.d.ts +5 -22
- package/dist/sdk/query/search/semantic.d.ts +24 -170
- package/dist/sdk/query/search/types.d.ts +19 -73
- package/dist/sdk/query/search-contracts.d.ts +24 -34
- package/dist/sdk/query/search-pagination.d.ts +5 -24
- package/dist/sdk/query/search-rendering.d.ts +8 -32
- package/dist/sdk/query/search.d.ts +3 -63
- package/dist/sdk/query/workspace-contracts.d.ts +2 -2
- package/dist/sdk/query.d.ts +1 -43
- package/dist/sdk/read-output/continuation.d.ts +5 -6
- package/dist/sdk/read-output/options.d.ts +3 -8
- package/dist/sdk/read-output/positional-rows.js +2 -0
- package/dist/sdk/read-output/session-result.d.ts +2 -33
- package/dist/sdk/read-output/tail-retention.d.ts +6 -8
- package/dist/sdk/read-output-budget.d.ts +14 -16
- package/dist/sdk/read-output-contracts.d.ts +62 -102
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.d.ts +5 -9
- package/dist/sdk/read-output-session.d.ts +11 -14
- package/dist/sdk/relationship-analytics.d.ts +17 -37
- package/dist/sdk/relationship-context.d.ts +15 -33
- package/dist/sdk/relationship-history.d.ts +29 -50
- package/dist/sdk/relationship-kinds/contract.d.ts +11 -12
- package/dist/sdk/relationship-migration.d.ts +6 -10
- package/dist/sdk/relationships.d.ts +22 -34
- package/dist/sdk/reproducibility/process.d.ts +7 -11
- package/dist/sdk/runtime/actions.js +1 -1
- package/dist/sdk/runtime/context.d.ts +6 -22
- package/dist/sdk/runtime/schema-preview.d.ts +1 -1
- package/dist/sdk/runtime-input.d.ts +9 -20
- package/dist/sdk/runtime-primitives.d.ts +3 -82
- package/dist/sdk/runtime-public-contracts.d.ts +30 -50
- package/dist/sdk/runtime.d.ts +77 -302
- package/dist/sdk/scheduling-shortcuts.d.ts +8 -12
- package/dist/sdk/schema-migration.d.ts +18 -80
- package/dist/sdk/schema.d.ts +89 -192
- package/dist/sdk/search-refresh-worker.d.ts +1 -1
- package/dist/sdk/similarity-scoring.d.ts +6 -8
- package/dist/sdk/similarity.d.ts +33 -64
- package/dist/sdk/start-task-status.d.ts +2 -2
- package/dist/sdk/stats.d.ts +13 -48
- package/dist/sdk/structured-mutations.d.ts +18 -26
- package/dist/sdk/telemetry-flush.d.ts +1 -1
- package/dist/sdk/telemetry.d.ts +14 -20
- package/dist/sdk/templates.d.ts +14 -35
- package/dist/sdk/test/batch.d.ts +10 -25
- package/dist/sdk/test/execution.d.ts +44 -209
- package/dist/sdk/test/json-path.d.ts +2 -5
- package/dist/sdk/test/linked-command-detection.d.ts +10 -25
- package/dist/sdk/test/measurements.d.ts +10 -13
- package/dist/sdk/test/parsers.d.ts +16 -20
- package/dist/sdk/test/prerequisites.d.ts +2 -3
- package/dist/sdk/test/runs.d.ts +19 -52
- package/dist/sdk/test/trust.d.ts +8 -12
- package/dist/sdk/test/update.d.ts +9 -25
- package/dist/sdk/testing.d.ts +97 -206
- package/dist/sdk/traceability/source-traceability.d.ts +25 -56
- package/dist/sdk/tracker-root-discovery.d.ts +1 -1
- package/dist/sdk/workspace-contracts-cache.d.ts +2 -2
- package/dist/sdk/workspace-contracts.d.ts +8 -14
- package/dist/sdk/workspace-memory.d.ts +24 -42
- package/dist/sdk/workspace-recipe.d.ts +10 -14
- package/dist/sdk/workspace-snapshot.d.ts +26 -53
- package/dist/sdk/workspace-transaction-gc.d.ts +12 -16
- package/dist/sdk/workspace-transaction.d.ts +26 -40
- package/dist/sdk/workspace.d.ts +8 -10
- package/dist/types/index.d.ts +1 -1
- package/dist/types.d.ts +210 -353
- package/docs/AGENT_OUTPUT_ENCODINGS.md +16 -0
- package/docs/COMMANDS.md +8 -0
- package/docs/CONFIGURATION.md +17 -0
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +28 -9
- package/docs/README.md +1 -1
- package/docs/READ_OUTPUT_CONTRACTS.md +21 -0
- package/docs/RELEASING.md +52 -5
- package/docs/SDK.md +17 -2
- package/docs/TESTING.md +11 -0
- package/marketplace.json +1 -1
- package/package.json +2 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/scripts/finalize-build.mjs +41 -4
- package/dist/cli-bundle/chunks/chunk-3A5DJZCC.js +0 -116
- package/dist/cli-bundle/chunks/chunk-AFZS6WFV.js +0 -3
- package/dist/cli-bundle/chunks/chunk-JAE5MWLX.js +0 -2
- package/dist/cli-bundle/chunks/chunk-LLTRUVKK.js +0 -6
- package/dist/cli-bundle/chunks/chunk-PE6CZ3PE.js +0 -3
- package/dist/cli-bundle/chunks/item-revision-TUGZYYXX.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-2RRBAQN3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2A3QZELL.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-KBRSA4OK.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-P6TG33FV.js +0 -82
- package/dist/cli-bundle/focused-chunks/chunk-PL6EO4GJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PSLDGAEY.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-UNNLBJRI.js +0 -2
- package/dist/cli-bundle/focused-chunks/item-revision-XNSRDTFB.js +0 -2
- package/docs/ECOSYSTEM_PLANNING_REVIEW.md +0 -274
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* Declares and scores executable recovery for tracker filesystem preflight failures.
|
|
5
5
|
*/
|
|
6
6
|
/** Filesystem states distinguished by the shared tracker preflight. */
|
|
7
|
-
export type PmTrackerPreflightFailureKind
|
|
7
|
+
export type PmTrackerPreflightFailureKind="missing_root"|"settings_missing"|"not_directory"|"unreadable_root";
|
|
8
8
|
/** Recovery behavior that is safe for a tracker preflight failure. */
|
|
9
|
-
export type PmTrackerPreflightRecoveryKind
|
|
9
|
+
export type PmTrackerPreflightRecoveryKind="initialize"|"select_directory"|"repair_permissions";
|
|
10
10
|
/** Static refusal and recovery obligation for one tracker filesystem state. */
|
|
11
|
-
export interface PmTrackerPreflightRecoveryContract
|
|
11
|
+
export interface PmTrackerPreflightRecoveryContract{
|
|
12
12
|
/** Stable probe identifier used by repository gates and evidence. */
|
|
13
13
|
probe_id:string;
|
|
14
14
|
/** Filesystem state created by the executable probe. */
|
|
@@ -16,12 +16,11 @@ failure_kind:PmTrackerPreflightFailureKind;
|
|
|
16
16
|
/** Stable structured error code required from CLI and SDK transports. */
|
|
17
17
|
expected_error_code:string;
|
|
18
18
|
/** Process exit code required from the CLI transport. */
|
|
19
|
-
expected_exit_code:1
|
|
19
|
+
expected_exit_code:1|2|3;
|
|
20
20
|
/** Safe recovery behavior for this filesystem state. */
|
|
21
|
-
recovery_kind:PmTrackerPreflightRecoveryKind;
|
|
22
|
-
}
|
|
21
|
+
recovery_kind:PmTrackerPreflightRecoveryKind;}
|
|
23
22
|
/** Runtime evidence captured from one executable tracker preflight probe. */
|
|
24
|
-
export interface PmTrackerPreflightRecoveryObservation
|
|
23
|
+
export interface PmTrackerPreflightRecoveryObservation{
|
|
25
24
|
/** Stable probe identifier from the corresponding contract. */
|
|
26
25
|
probe_id:string;
|
|
27
26
|
/** Structured error code emitted by the refusal. */
|
|
@@ -35,19 +34,17 @@ suggested_retry_args:string[];
|
|
|
35
34
|
/** Whether the emitted retry or safe alternate-root retry executed successfully. */
|
|
36
35
|
retry_succeeded:boolean;
|
|
37
36
|
/** Whether a file-path refusal incorrectly recommended tracker initialization. */
|
|
38
|
-
unsafe_init_recommended:boolean;
|
|
39
|
-
}
|
|
37
|
+
unsafe_init_recommended:boolean;}
|
|
40
38
|
/** Actionable failure emitted by the tracker preflight closure scorer. */
|
|
41
|
-
export interface PmTrackerPreflightRecoveryFinding
|
|
39
|
+
export interface PmTrackerPreflightRecoveryFinding{
|
|
42
40
|
/** Stable finding code for automation and ratchets. */
|
|
43
|
-
code:"missing_probe"
|
|
41
|
+
code:"missing_probe"|"error_code_mismatch"|"exit_code_mismatch"|"recovery_kind_mismatch"|"missing_init_recovery"|"unsafe_init_recovery"|"retry_failed";
|
|
44
42
|
/** Probe that failed its recovery obligation. */
|
|
45
43
|
probe_id:string;
|
|
46
44
|
/** Human-readable explanation of the failed obligation. */
|
|
47
|
-
detail:string;
|
|
48
|
-
}
|
|
45
|
+
detail:string;}
|
|
49
46
|
/** Aggregate executable-closure report for the tracker preflight corpus. */
|
|
50
|
-
export interface PmTrackerPreflightRecoveryReport
|
|
47
|
+
export interface PmTrackerPreflightRecoveryReport{
|
|
51
48
|
/** Whether every declared probe met its refusal and recovery contract. */
|
|
52
49
|
ok:boolean;
|
|
53
50
|
/** Number of declared tracker preflight probes. */
|
|
@@ -55,9 +52,8 @@ probe_count:number;
|
|
|
55
52
|
/** Number of probes with no findings. */
|
|
56
53
|
closed_probe_count:number;
|
|
57
54
|
/** Deterministically ordered failed obligations. */
|
|
58
|
-
findings:PmTrackerPreflightRecoveryFinding[];
|
|
59
|
-
}
|
|
55
|
+
findings:PmTrackerPreflightRecoveryFinding[];}
|
|
60
56
|
/** Return defensive copies of every core tracker preflight recovery contract. */
|
|
61
57
|
export declare function listTrackerPreflightRecoveryContracts():PmTrackerPreflightRecoveryContract[];
|
|
62
58
|
/** Score runtime observations against the complete tracker preflight recovery corpus. */
|
|
63
|
-
export declare function scoreTrackerPreflightRecoveryClosure(observations:readonly PmTrackerPreflightRecoveryObservation[]):PmTrackerPreflightRecoveryReport;
|
|
59
|
+
export declare function scoreTrackerPreflightRecoveryClosure(observations:readonly PmTrackerPreflightRecoveryObservation[]):PmTrackerPreflightRecoveryReport;
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type{ExtensionCommandCapabilityFamily}from "../core/extensions/command-metadata-contract.js";
|
|
2
2
|
/** Visibility tiers shared by CLI help, completions, docs, extensions, and MCP. */
|
|
3
|
-
export type PmCommandVisibilityTier
|
|
3
|
+
export type PmCommandVisibilityTier="core"|"standard"|"full"|"internal";
|
|
4
4
|
/** Stable capability families shared by every agent-facing command surface. */
|
|
5
|
-
export type PmCommandCapabilityFamily
|
|
5
|
+
export type PmCommandCapabilityFamily=ExtensionCommandCapabilityFamily;
|
|
6
6
|
/** One command's canonical agent-surface visibility declaration. */
|
|
7
|
-
export interface PmCommandVisibilityContract
|
|
7
|
+
export interface PmCommandVisibilityContract{
|
|
8
8
|
/** Canonical command path. */
|
|
9
9
|
command:string;
|
|
10
10
|
/** Minimum surface tier that advertises the command. */
|
|
11
|
-
tier:PmCommandVisibilityTier;
|
|
12
|
-
}
|
|
11
|
+
tier:PmCommandVisibilityTier;}
|
|
13
12
|
/** Complete command capability contract with visibility and family ownership. */
|
|
14
|
-
export interface PmCommandCapabilityContract extends PmCommandVisibilityContract
|
|
13
|
+
export interface PmCommandCapabilityContract extends PmCommandVisibilityContract{
|
|
15
14
|
/** Exactly one stable capability family used to group the command. */
|
|
16
|
-
family:PmCommandCapabilityFamily;
|
|
17
|
-
}
|
|
15
|
+
family:PmCommandCapabilityFamily;}
|
|
18
16
|
/** One generated family route shared by guides, skills, and documentation. */
|
|
19
|
-
export interface PmCommandCapabilityGroup
|
|
17
|
+
export interface PmCommandCapabilityGroup{
|
|
20
18
|
/** Stable capability family. */
|
|
21
19
|
family:PmCommandCapabilityFamily;
|
|
22
20
|
/** Non-internal commands owned by the family. */
|
|
23
|
-
commands:readonly string[];
|
|
24
|
-
}
|
|
21
|
+
commands:readonly string[];}
|
|
25
22
|
/** Resolve one command's stable capability family. */
|
|
26
23
|
export declare function resolvePmCommandCapabilityFamily(command:string):PmCommandCapabilityFamily;
|
|
27
24
|
/**
|
|
@@ -35,18 +32,11 @@ export declare const PM_COMMAND_CAPABILITY_CONTRACTS:readonly PmCommandCapabilit
|
|
|
35
32
|
/** Backward-compatible tier-only projection of the capability contract. */
|
|
36
33
|
export declare const PM_COMMAND_VISIBILITY_CONTRACTS:readonly PmCommandVisibilityContract[];
|
|
37
34
|
/** Bounded compact-help contract: one conventional terminal screen. */
|
|
38
|
-
export declare const PM_CORE_HELP_BUDGET:Readonly<{
|
|
39
|
-
max_lines:50;
|
|
40
|
-
max_utf8_bytes:6000;
|
|
41
|
-
}>;
|
|
35
|
+
export declare const PM_CORE_HELP_BUDGET:Readonly<{max_lines:50;max_utf8_bytes:6000;}>;
|
|
42
36
|
/** Root options retained in the compact progressive-disclosure help screen. */
|
|
43
37
|
export declare const PM_CORE_HELP_OPTION_FLAGS:readonly string[];
|
|
44
38
|
/** Measure rendered core help against its line and byte ceilings. */
|
|
45
|
-
export declare function measurePmCoreHelp(text:string):{
|
|
46
|
-
lines:number;
|
|
47
|
-
utf8_bytes:number;
|
|
48
|
-
within_budget:boolean;
|
|
49
|
-
};
|
|
39
|
+
export declare function measurePmCoreHelp(text:string):{lines:number;utf8_bytes:number;within_budget:boolean;};
|
|
50
40
|
/** Resolve one command's declared tier; extension commands default to standard. */
|
|
51
41
|
export declare function resolvePmCommandVisibilityTier(command:string,extensionTier?:PmCommandVisibilityTier):PmCommandVisibilityTier;
|
|
52
42
|
/** Return commands visible at a requested tier, preserving contract order. */
|
|
@@ -60,7 +50,7 @@ export declare function listPmCommandsForFamilyFromContracts(family:PmCommandCap
|
|
|
60
50
|
/** Group the command registry for progressive-disclosure routing surfaces. */
|
|
61
51
|
export declare function listPmCommandCapabilityGroups(contracts?:readonly PmCommandCapabilityContract[]):PmCommandCapabilityGroup[];
|
|
62
52
|
/** MCP profile names accepted by the server and embedding hosts. */
|
|
63
|
-
export type PmMcpToolProfile
|
|
53
|
+
export type PmMcpToolProfile="core"|"standard"|"full"|"custom";
|
|
64
54
|
/** Mapping from one narrow MCP tool to the command contract that tiers it. */
|
|
65
55
|
export declare const PM_MCP_TOOL_COMMAND_CONTRACTS:Readonly<Record<string,string>>;
|
|
66
56
|
/** Resolve the tools visible in a named MCP profile from command tiers. */
|
|
@@ -68,7 +58,7 @@ export declare function listPmMcpToolsForProfile(availableTools:readonly string[
|
|
|
68
58
|
/** Project an explicit command registry into one MCP tool profile. */
|
|
69
59
|
export declare function listPmMcpToolsForProfileFromContracts(availableTools:readonly string[],profile:Exclude<PmMcpToolProfile,"custom">,contracts:readonly PmCommandCapabilityContract[]):string[];
|
|
70
60
|
/** Stable MCP resource contract generated from the same agent surface table. */
|
|
71
|
-
export interface PmMcpResourceContract
|
|
61
|
+
export interface PmMcpResourceContract{
|
|
72
62
|
/** Stable resource URI. */
|
|
73
63
|
uri:string;
|
|
74
64
|
/** Human-readable resource name. */
|
|
@@ -76,21 +66,19 @@ name:string;
|
|
|
76
66
|
/** Agent-facing resource description. */
|
|
77
67
|
description:string;
|
|
78
68
|
/** Resource MIME type. */
|
|
79
|
-
mimeType:"application/json"
|
|
80
|
-
}
|
|
69
|
+
mimeType:"application/json"|"text/markdown";}
|
|
81
70
|
/** Addressable, bounded workspace context resources. */
|
|
82
71
|
export declare const PM_MCP_RESOURCE_CONTRACTS:readonly PmMcpResourceContract[];
|
|
83
72
|
/** One parameter accepted by a canonical MCP workflow prompt. */
|
|
84
|
-
export interface PmMcpPromptArgumentContract
|
|
73
|
+
export interface PmMcpPromptArgumentContract{
|
|
85
74
|
/** Stable prompt argument name. */
|
|
86
75
|
name:string;
|
|
87
76
|
/** Argument description shown by the MCP host. */
|
|
88
77
|
description:string;
|
|
89
78
|
/** Whether the host must provide the argument. */
|
|
90
|
-
required:boolean;
|
|
91
|
-
}
|
|
79
|
+
required:boolean;}
|
|
92
80
|
/** Canonical MCP workflow prompt generated from the agent operating contract. */
|
|
93
|
-
export interface PmMcpPromptContract
|
|
81
|
+
export interface PmMcpPromptContract{
|
|
94
82
|
/** Stable prompt name. */
|
|
95
83
|
name:string;
|
|
96
84
|
/** Agent-facing workflow description. */
|
|
@@ -98,8 +86,7 @@ description:string;
|
|
|
98
86
|
/** Parameters accepted by the workflow. */
|
|
99
87
|
arguments:readonly PmMcpPromptArgumentContract[];
|
|
100
88
|
/** Template rendered into a user message after argument substitution. */
|
|
101
|
-
template:string;
|
|
102
|
-
}
|
|
89
|
+
template:string;}
|
|
103
90
|
/** Canonical orient, start, and evidence-close workflows. */
|
|
104
91
|
export declare const PM_MCP_PROMPT_CONTRACTS:readonly PmMcpPromptContract[];
|
|
105
92
|
/** Render the generated command visibility reference used by docs drift gates. */
|
|
@@ -107,4 +94,4 @@ export declare function renderPmCommandVisibilityMarkdown():string;
|
|
|
107
94
|
/** Render an explicit registry for mutation-sensitivity and host tooling. */
|
|
108
95
|
export declare function renderPmCommandVisibilityMarkdownFromContracts(contracts:readonly PmCommandCapabilityContract[]):string;
|
|
109
96
|
/** Render family routing for generated docs and skill progressive disclosure. */
|
|
110
|
-
export declare function renderPmCapabilityRoutingMarkdown(contracts?:readonly PmCommandCapabilityContract[]):string;
|
|
97
|
+
export declare function renderPmCapabilityRoutingMarkdown(contracts?:readonly PmCommandCapabilityContract[]):string;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Public SDK entrypoint for session-scoped provenance and episode identity.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export{agentSessionEnvironment,boundAgentEpisodeIdentity,runWithAgentSessionContext,resolveAgentSessionContextFromSignals,type AgentEpisodeIdentity,type AgentSessionContext,}from "../core/shared/agent-session-context.js";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { PmCliError } from "../core/shared/errors.js";
|
|
3
|
-
import { mutateItem } from "../core/store/item-store.js";
|
|
1
|
+
import type{GlobalOptions}from "../core/shared/command-types.js";import{PmCliError}from "../core/shared/errors.js";import{mutateItem}from "../core/store/item-store.js";
|
|
4
2
|
/** Common persisted shape shared by comments, notes, and learnings. */
|
|
5
|
-
export interface AnnotationEntry
|
|
3
|
+
export interface AnnotationEntry{
|
|
6
4
|
/** Creation timestamp for the persisted entry. */
|
|
7
5
|
created_at:string;
|
|
8
6
|
/** Stable author attribution recorded with the entry. */
|
|
@@ -10,10 +8,9 @@ author:string;
|
|
|
10
8
|
/** Human-readable annotation body. */
|
|
11
9
|
text:string;
|
|
12
10
|
/** Last edit timestamp when the entry was changed in place. */
|
|
13
|
-
edited_at?:string;
|
|
14
|
-
}
|
|
11
|
+
edited_at?:string;}
|
|
15
12
|
/** Common options accepted by annotation primitive operations. */
|
|
16
|
-
export interface AnnotationCommandOptions
|
|
13
|
+
export interface AnnotationCommandOptions{
|
|
17
14
|
/** Maximum number of newest entries returned. */
|
|
18
15
|
limit?:string;
|
|
19
16
|
/** Author override for mutation attribution. */
|
|
@@ -33,29 +30,25 @@ ifAbsent?:boolean;
|
|
|
33
30
|
* that index. The write is refused when the addressed entry has a different
|
|
34
31
|
* `created_at`; this compares timestamps, not entry identities.
|
|
35
32
|
*/
|
|
36
|
-
expectAt?:string;
|
|
37
|
-
}
|
|
33
|
+
expectAt?:string;}
|
|
38
34
|
/**
|
|
39
35
|
* One listed annotation entry carrying its absolute one-based position in the
|
|
40
36
|
* stored collection: the address `--edit` and `--delete` accept, whatever
|
|
41
37
|
* page, limit or filter delivered the row (pm-hka7ep).
|
|
42
38
|
*/
|
|
43
|
-
export type IndexedAnnotationEntry<TEntry
|
|
44
|
-
index:number;
|
|
45
|
-
} & TEntry;
|
|
39
|
+
export type IndexedAnnotationEntry<TEntry=AnnotationEntry>={index:number;}&TEntry;
|
|
46
40
|
/** Identifies the single annotation mutation represented by a bounded response. */
|
|
47
|
-
export interface AnnotationMutationReceipt
|
|
41
|
+
export interface AnnotationMutationReceipt{
|
|
48
42
|
/** Mutation applied to the annotation collection. */
|
|
49
|
-
action:"add"
|
|
43
|
+
action:"add"|"edit"|"delete";
|
|
50
44
|
/** Stable one-based collection position targeted by the mutation. */
|
|
51
45
|
entry_index:number;
|
|
52
46
|
/** Number of stored entries changed by the mutation attempt. */
|
|
53
|
-
changed_count:0
|
|
47
|
+
changed_count:0|1;
|
|
54
48
|
/** Whether the response includes the complete post-mutation collection. */
|
|
55
|
-
full_history_included:boolean;
|
|
56
|
-
}
|
|
49
|
+
full_history_included:boolean;}
|
|
57
50
|
/** Transport-neutral selectors that restore a complete annotation collection. */
|
|
58
|
-
export interface AnnotationHistoryRestoration
|
|
51
|
+
export interface AnnotationHistoryRestoration{
|
|
59
52
|
/** Stable semantic selector shared by every transport. */
|
|
60
53
|
selector:"full_history";
|
|
61
54
|
/** Equivalent CLI flag. */
|
|
@@ -63,24 +56,19 @@ cli_flag:"--full-history";
|
|
|
63
56
|
/** Equivalent direct SDK option. */
|
|
64
57
|
sdk_option:"fullHistory";
|
|
65
58
|
/** Equivalent MCP tool option. */
|
|
66
|
-
mcp_option:"full";
|
|
67
|
-
}
|
|
59
|
+
mcp_option:"full";}
|
|
68
60
|
/** Describes annotation history withheld from a bounded mutation response. */
|
|
69
|
-
export interface AnnotationOmissionReceipt
|
|
61
|
+
export interface AnnotationOmissionReceipt{
|
|
70
62
|
/** Whether any historical collection entries were withheld. */
|
|
71
63
|
has_omissions:boolean;
|
|
72
64
|
/** Number of independently restorable field groups withheld. */
|
|
73
65
|
omitted_field_group_count:number;
|
|
74
66
|
/** Omitted groups and the transport-neutral selectors that restore them. */
|
|
75
|
-
omitted_field_groups:Array<{
|
|
76
|
-
name:string;
|
|
77
|
-
restore_with:AnnotationHistoryRestoration;
|
|
78
|
-
}>;
|
|
79
|
-
}
|
|
67
|
+
omitted_field_groups:Array<{name:string;restore_with:AnnotationHistoryRestoration;}>;}
|
|
80
68
|
/** Map transport-level `full` onto the SDK annotation history option. */
|
|
81
69
|
export declare function normalizeAnnotationTransportOptions(options:Record<string,unknown>):Record<string,unknown>;
|
|
82
70
|
/** Presentation-layer inputs accepted by the shared annotation source resolver. */
|
|
83
|
-
export interface AnnotationSourceOptions
|
|
71
|
+
export interface AnnotationSourceOptions{
|
|
84
72
|
/** Inline annotation text or the stdin token (`-`). */
|
|
85
73
|
add?:string;
|
|
86
74
|
/** Read annotation text directly from stdin. */
|
|
@@ -90,12 +78,11 @@ file?:string;
|
|
|
90
78
|
/** One-based entry index to replace. */
|
|
91
79
|
edit?:number;
|
|
92
80
|
/** One-based entry index to delete. */
|
|
93
|
-
delete?:number;
|
|
94
|
-
}
|
|
81
|
+
delete?:number;}
|
|
95
82
|
/** Normalized annotation operation supplied by a presentation layer. */
|
|
96
|
-
export interface AnnotationInput
|
|
83
|
+
export interface AnnotationInput{
|
|
97
84
|
/** Normalized operation selected by the presentation layer. */
|
|
98
|
-
mode:"list"
|
|
85
|
+
mode:"list"|"add"|"stdin"|"file"|"edit"|"delete";
|
|
99
86
|
/** Resolved annotation text. */
|
|
100
87
|
value?:string;
|
|
101
88
|
/** Original input used for flag-like value validation. */
|
|
@@ -103,19 +90,17 @@ rawValue?:string;
|
|
|
103
90
|
/** Flag name used in validation messages. */
|
|
104
91
|
emptyFlag?:string;
|
|
105
92
|
/** One-based entry index for edit and delete operations. */
|
|
106
|
-
index?:number;
|
|
107
|
-
}
|
|
93
|
+
index?:number;}
|
|
108
94
|
/** Agent-facing recovery guidance for ownership conflicts. */
|
|
109
|
-
export interface OwnershipConflictGuidance
|
|
95
|
+
export interface OwnershipConflictGuidance{
|
|
110
96
|
/** Actionable requirement shown to the caller. */
|
|
111
97
|
required:string;
|
|
112
98
|
/** Copyable retry examples. */
|
|
113
99
|
examples:string[];
|
|
114
100
|
/** Ordered recovery guidance. */
|
|
115
|
-
nextSteps:string[];
|
|
116
|
-
}
|
|
101
|
+
nextSteps:string[];}
|
|
117
102
|
/** Domain configuration for one annotation collection primitive. */
|
|
118
|
-
export interface AnnotationCommandConfig<TKey extends string,TEntry extends AnnotationEntry
|
|
103
|
+
export interface AnnotationCommandConfig<TKey extends string,TEntry extends AnnotationEntry=AnnotationEntry>{
|
|
119
104
|
/** Normalized annotation operation. */
|
|
120
105
|
input:AnnotationInput;
|
|
121
106
|
/** Metadata collection that stores this annotation family. */
|
|
@@ -127,43 +112,23 @@ editOp?:Parameters<typeof mutateItem>[0]["op"];
|
|
|
127
112
|
/** History operation used for deletions. */
|
|
128
113
|
deleteOp?:Parameters<typeof mutateItem>[0]["op"];
|
|
129
114
|
/** Domain parser that normalizes resolved text. */
|
|
130
|
-
parseText:(raw:string)
|
|
115
|
+
parseText:(raw:string)=> string;
|
|
131
116
|
/** Whether this operation may bypass ownership for a caller-authorized annotation workflow. */
|
|
132
117
|
bypassOwnershipConflict:boolean;
|
|
133
118
|
/** Recovery guidance for ownership conflicts. */
|
|
134
119
|
conflictGuidance:OwnershipConflictGuidance;
|
|
135
120
|
/** Entry factory that preserves or enriches the collection's typed annotation shape. */
|
|
136
|
-
createEntry:(input:{
|
|
137
|
-
created_at:string;
|
|
138
|
-
author:string;
|
|
139
|
-
text:string;
|
|
140
|
-
}) => TEntry;
|
|
141
|
-
}
|
|
121
|
+
createEntry:(input:{created_at:string;author:string;text:string;})=> TEntry;}
|
|
142
122
|
/** Structured result returned by an annotation primitive. */
|
|
143
|
-
export type AnnotationCommandResult<TKey extends string,TEntry extends AnnotationEntry
|
|
144
|
-
id:string;
|
|
145
|
-
count:number;
|
|
146
|
-
} & Record<TKey,Array<IndexedAnnotationEntry<TEntry>>> & {
|
|
147
|
-
total_count?:number;
|
|
148
|
-
returned_count?:number;
|
|
149
|
-
has_more?:boolean;
|
|
150
|
-
limit?:number;
|
|
151
|
-
mutation_receipt?:AnnotationMutationReceipt;
|
|
152
|
-
omission_receipt?:AnnotationOmissionReceipt;
|
|
153
|
-
changed?:boolean;
|
|
154
|
-
};
|
|
123
|
+
export type AnnotationCommandResult<TKey extends string,TEntry extends AnnotationEntry>={id:string;count:number;}&Record<TKey,Array<IndexedAnnotationEntry<TEntry>>>&{total_count?:number;returned_count?:number;has_more?:boolean;limit?:number;mutation_receipt?:AnnotationMutationReceipt;omission_receipt?:AnnotationOmissionReceipt;changed?:boolean;};
|
|
155
124
|
/** Implements limit annotation entries for the public runtime surface of this module. */
|
|
156
|
-
export declare function limitAnnotationEntries<TEntry>(values:TEntry[],limit:number
|
|
125
|
+
export declare function limitAnnotationEntries<TEntry>(values:TEntry[],limit:number|undefined):TEntry[];
|
|
157
126
|
/** Implements read annotation entries for the public runtime surface of this module. */
|
|
158
127
|
export declare function readAnnotationEntries<TEntry>(source:Record<string,unknown>,collectionKey:string):TEntry[];
|
|
159
128
|
/** Implements parse annotation text input for the public runtime surface of this module. */
|
|
160
|
-
export declare function parseAnnotationTextInput(raw:string,options?:{
|
|
161
|
-
stripPlainTextPrefix?:boolean;
|
|
162
|
-
}):string;
|
|
129
|
+
export declare function parseAnnotationTextInput(raw:string,options?:{stripPlainTextPrefix?:boolean;}):string;
|
|
163
130
|
/** Returns whether an unknown file-system failure exposes an errno-like code. */
|
|
164
|
-
export declare function isErrnoError(error:unknown):error is
|
|
165
|
-
code?:unknown;
|
|
166
|
-
};
|
|
131
|
+
export declare function isErrnoError(error:unknown):error is{code?:unknown;};
|
|
167
132
|
/** Refuse presentation-level stdin directives when JSON-RPC owns the process stream. */
|
|
168
133
|
export declare function assertAnnotationStdinTransportAvailable(options:AnnotationSourceOptions,optionName:string):void;
|
|
169
134
|
/** Resolves mutually exclusive annotation input flags into one normalized SDK operation. */
|
|
@@ -171,11 +136,11 @@ export declare function resolveAnnotationInput(options:AnnotationSourceOptions,n
|
|
|
171
136
|
/** Implements wrap ownership conflict for the public runtime surface of this module. */
|
|
172
137
|
export declare function wrapOwnershipConflict(error:unknown,guidance:OwnershipConflictGuidance):never;
|
|
173
138
|
/** Refusal code for annotation text that is an option token a parser bound as a text flag's value; the refusals spell it literally for the error catalog. */
|
|
174
|
-
export declare const ANNOTATION_FLAG_LIKE_VALUE_CODE
|
|
139
|
+
export declare const ANNOTATION_FLAG_LIKE_VALUE_CODE="annotation_flag_like_value";
|
|
175
140
|
/** Whether annotation text is an option token such as `--file` or `--file=x`; `text=` escapes literal dash-leading text. */
|
|
176
141
|
export declare function isFlagLikeAnnotationValue(raw:string):boolean;
|
|
177
142
|
/** Inputs for the refusal raised when annotation text is an option token. */
|
|
178
|
-
export interface FlagLikeAnnotationValueRefusalInput
|
|
143
|
+
export interface FlagLikeAnnotationValueRefusalInput{
|
|
179
144
|
/** Annotation collection key: `comments`, `notes`, or `learnings`. */
|
|
180
145
|
collectionKey:string;
|
|
181
146
|
/** Text option that received the token, such as `--add`. */
|
|
@@ -187,8 +152,7 @@ commandPrefix:string;
|
|
|
187
152
|
/** Executable retry of the caller's invocation, when the caller knows one. */
|
|
188
153
|
retryArgs?:string[];
|
|
189
154
|
/** Positional text that followed the token and that the source option cannot be combined with. */
|
|
190
|
-
conflictingOperand?:string;
|
|
191
|
-
}
|
|
155
|
+
conflictingOperand?:string;}
|
|
192
156
|
/**
|
|
193
157
|
* Build the refusal for annotation text that is an option token. A source
|
|
194
158
|
* option (`--file`, `--stdin`) is named in its own form so the agent learns
|
|
@@ -201,4 +165,4 @@ export declare function createFlagLikeAnnotationValueRefusal(input:FlagLikeAnnot
|
|
|
201
165
|
/** Implements run annotation command for the public runtime surface of this module. */
|
|
202
166
|
export declare function runAnnotationCommand<TKey extends string,TEntry extends AnnotationEntry>(id:string,options:AnnotationCommandOptions,global:GlobalOptions,config:AnnotationCommandConfig<TKey,TEntry>):Promise<AnnotationCommandResult<TKey,TEntry>>;
|
|
203
167
|
/** Implements resolve annotation index for the public runtime surface of this module. */
|
|
204
|
-
export declare function resolveAnnotationIndex(oneBasedIndex:number
|
|
168
|
+
export declare function resolveAnnotationIndex(oneBasedIndex:number|undefined,count:number,collectionKey:string):number;
|
package/dist/sdk/annotations.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]="3f833046-5961-57e6-a680-c1f23abf26c3")}catch{}})();import{assertInitializedTracker}from"./environment/tracker-preflight.js";import{readFile}from"node:fs/promises";import{isFileAbsentError}from"../core/fs/fs-utils.js";import{getActiveExtensionRegistrations}from"../core/extensions/index.js";import{resolveItemTypeRegistry}from"../core/item/type-registry.js";import{createStdinTokenResolver,parseCsvKv,shouldResolveMutationStdinTokens,transferMutationStdinTokenPolicy}from"../core/item/parse.js";import{renderPmCommand}from"../core/shared/command-line.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{parseLimit}from"../core/shared/numeric-parsers.js";import{nowIso}from"../core/shared/time.js";import{resolveAuthor}from"../core/shared/author.js";import{locateItem,mutateItem,readLocatedItem}from"../core/store/item-store.js";import{resolvePmRoot}from"../core/store/paths.js";import{readSettings}from"../core/store/settings.js";import{CANONICALLY_ORDERED_LOG_COLLECTIONS,compareLogValues}from"../core/item/item-format.js";function normalizeAnnotationTransportOptions(options){const normalized={...options,...options.full===!0?{fullHistory:!0}:{}};return delete normalized.full,transferMutationStdinTokenPolicy(options,normalized)}function assertAnnotationEntryMutable(entry,operation){if(typeof entry=="object"&&entry!==null&&"format"in entry&&entry.format==="json")throw new PmCliError(`Structured context events are append-only and cannot be ${operation}.`,EXIT_CODE.USAGE,{code:"structured_event_immutable"})}function limitAnnotationEntries(values,limit){return limit===void 0?values:limit===0?[]:values.slice(Math.max(0,values.length-limit))}function readAnnotationEntries(source,collectionKey){const value=source[collectionKey];return Array.isArray(value)?value:[]}function parseAnnotationTextInput(raw,options={}){const trimmed=raw.trim();if(!trimmed)return"";const textPrefixMatch=/^(?:[-*+]\s*)?text\s*[:=]/i.exec(trimmed);if(options.stripPlainTextPrefix===!0&&textPrefixMatch&&!trimmed.startsWith("```"))return trimmed.slice(textPrefixMatch[0].length).trim()||trimmed;if(!(/^(?:[-*+]\s*)?text\s*[:=]/im.test(trimmed)||trimmed.startsWith("```")))return trimmed;try{const kv=parseCsvKv(trimmed,"--add");return Object.keys(kv).map(key=>key.trim().toLowerCase()).some(key=>key!=="text")?trimmed:kv.text?.trim()||trimmed}catch{return trimmed}}function isErrnoError(error){return typeof error=="object"&&error!==null&&"code"in error}function assertAnnotationStdinTransportAvailable(options,optionName){if(!shouldResolveMutationStdinTokens(options))throw new PmCliError(`${optionName} cannot read process stdin through the MCP JSON-RPC transport. Pass annotation text in options.add instead.`,EXIT_CODE.USAGE,{code:"mcp_stdin_unavailable",required:"Pass annotation text as JSON data; the MCP protocol already owns process stdin."})}async function resolveAnnotationTextSource(options,noun){if(+(options.add!==void 0)+ +(options.stdin===!0)+ +(typeof options.file=="string")>1)throw new PmCliError(`Specify ${noun} text using only one input source: --add, --stdin, or --file`,EXIT_CODE.USAGE);const stdinResolver=createStdinTokenResolver(),resolveStdinTokens=shouldResolveMutationStdinTokens(options);if(options.add!==void 0)return{value:await stdinResolver.resolveValue(options.add,"--add",resolveStdinTokens)??"",rawValue:options.add,emptyFlag:"--add"};if(options.stdin===!0)return assertAnnotationStdinTransportAvailable(options,"--stdin"),{value:await stdinResolver.resolveValue("-","--stdin")??"",emptyFlag:"--stdin"};if(typeof options.file!="string")return;const filePath=options.file.trim();if(!filePath)throw new PmCliError("--file path cannot be empty",EXIT_CODE.USAGE);if(filePath==="-")return assertAnnotationStdinTransportAvailable(options,"--file -"),{value:await stdinResolver.resolveValue("-","--file")??"",emptyFlag:"--file"};try{return{value:await readFile(filePath,"utf8"),emptyFlag:"--file"}}catch(error){if(isErrnoError(error)&&isFileAbsentError(error))throw new PmCliError(`--file path not found: ${filePath}. Use --file - to read stdin.`,EXIT_CODE.USAGE);const detail=error instanceof Error?error.message:String(error);throw new PmCliError(`Failed to read --file path "${filePath}": ${detail}. Use --file - to read stdin.`,EXIT_CODE.USAGE)}}async function resolveAnnotationInput(options,noun){if(options.edit!==void 0&&options.delete!==void 0)throw new PmCliError("Specify only one of --edit or --delete",EXIT_CODE.USAGE);if(options.delete!==void 0){if(options.add!==void 0||options.stdin===!0||typeof options.file=="string")throw new PmCliError("--delete cannot be combined with replacement text",EXIT_CODE.USAGE);if(!Number.isInteger(options.delete)||options.delete<1)throw new PmCliError("--delete must be a positive integer",EXIT_CODE.USAGE);return{mode:"delete",index:options.delete}}if(options.edit!==void 0&&(!Number.isInteger(options.edit)||options.edit<1))throw new PmCliError("--edit must be a positive integer",EXIT_CODE.USAGE);const resolved=await resolveAnnotationTextSource(options,noun);if(options.edit!==void 0){if(!resolved)throw new PmCliError("--edit requires replacement text from --add, --stdin, or --file",EXIT_CODE.USAGE);return{mode:"edit",index:options.edit,...resolved}}return resolved?{mode:"add",...resolved}:{mode:"list"}}function wrapOwnershipConflict(error,guidance){throw error instanceof PmCliError&&error.exitCode===EXIT_CODE.CONFLICT&&error.message.includes("is assigned to")&&error.message.includes("Use --force to override")?new PmCliError(error.message,error.exitCode,{code:"ownership_conflict",required:guidance.required,examples:guidance.examples,nextSteps:guidance.nextSteps}):error}function annotationStdinHint(collectionKey){return collectionKey==="comments"?"--stdin":"--add -"}const ANNOTATION_FLAG_LIKE_VALUE_CODE="annotation_flag_like_value";function isFlagLikeAnnotationValue(raw){return/^-{1,2}[A-Za-z][\w-]*(?:=.*)?$/.test(raw.trim())}function annotationSourceOptionForm(token){return token==="--file"?"--file <path>":token.startsWith("--file=")?token:token==="--stdin"?"--stdin":void 0}function createFlagLikeAnnotationValueRefusal(input){const trimmed=input.value.trim(),noun=input.collectionKey.replace(/s$/,""),sourceForm=annotationSourceOptionForm(trimmed),stdinHint=annotationStdinHint(input.collectionKey),retry=input.retryArgs===void 0?{}:{field:input.textFlag,recovery:{suggested_flags:[trimmed],suggested_retry:renderPmCommand(input.retryArgs),suggested_retry_args:[...input.retryArgs]}};if(sourceForm!==void 0){const sourceFlag=sourceForm.split(/[ =]/,1)[0],source=sourceFlag==="--file"?"that file":"stdin",operandNote=input.conflictingOperand===void 0?"":` "${input.conflictingOperand}" was read as positional text, which ${sourceFlag} cannot be combined with: drop it, or pass it as the text without ${sourceFlag}.`;return new PmCliError(`${input.textFlag} value "${trimmed}" looks like an option, not annotation text: ${input.textFlag} took ${sourceFlag} as its value. Drop ${input.textFlag} and pass ${sourceForm} on its own.${operandNote}`,EXIT_CODE.USAGE,{code:"annotation_flag_like_value",required:`Drop ${input.textFlag}: ${sourceForm} reads the ${noun} text from ${source} by itself. Use ${input.textFlag} text=${trimmed} only when the text really is "${trimmed}".`,examples:[`${input.commandPrefix} ${sourceForm}`,`${input.commandPrefix} ${input.textFlag} text=${trimmed}`],...retry})}return new PmCliError(`${input.textFlag} value "${trimmed}" looks like an option, not annotation text. Use ${stdinHint} to read stdin, or use text=${trimmed} for literal dash-leading text.`,EXIT_CODE.USAGE,{code:"annotation_flag_like_value",required:`Use ${stdinHint} for stdin input, pass plain text, or use text=${trimmed} when the text really starts with "-".`,examples:[`${input.commandPrefix} ${stdinHint}`,`${input.commandPrefix} ${input.textFlag} text=${trimmed}`],...retry})}function assertAnnotationAddValueIsNotFlagLike(raw,config){if(!((config.input.emptyFlag??"--add")!=="--add"||!isFlagLikeAnnotationValue(raw)))throw createFlagLikeAnnotationValueRefusal({collectionKey:config.collectionKey,textFlag:"--add",value:raw,commandPrefix:config.input.mode==="edit"?`pm ${config.collectionKey} <id> --edit <index>`:`pm ${config.collectionKey} <id>`})}function assertAnnotationMessageHasTextSource(config,options){if(options.ifAbsent===!0&&!["add","stdin","file"].includes(config.input.mode))throw new PmCliError(`--if-absent requires a ${config.collectionKey.replace(/s$/,"")} append`,EXIT_CODE.USAGE,{code:"annotation_if_absent_without_append",required:"Combine --if-absent with one append text source; omit it for list, edit, and delete operations."});if(assertAnnotationExpectationTargetsEntry(config,options),config.input.mode!=="list"||options.message===void 0)return;const noun=config.collectionKey.replace(/s$/,"");throw new PmCliError(`--message labels a ${noun} mutation but does not provide ${noun} text. Pass text positionally or with --add, --stdin, or --file.`,EXIT_CODE.USAGE,{code:"annotation_message_without_text",required:`Provide ${noun} text through a content source; --message only annotates the history entry of a mutation.`,examples:[`pm ${config.collectionKey} <id> --add "text" --message "why"`,`pm ${config.collectionKey} <id> ${annotationStdinHint(config.collectionKey)}`]})}function assertAnnotationExpectationTargetsEntry(config,options){if(options.expectAt!==void 0){if(config.input.mode!=="edit"&&config.input.mode!=="delete")throw new PmCliError(`--expect-at guards an --edit or --delete of one ${config.collectionKey.replace(/s$/,"")}`,EXIT_CODE.USAGE,{code:"annotation_expectation_without_target",required:"Combine --expect-at with --edit <index> or --delete <index>; omit it for list and append operations.",examples:[`pm ${config.collectionKey} <id> --edit <index> --expect-at <created_at> --add "<text>"`,`pm ${config.collectionKey} <id> --delete <index> --expect-at <created_at>`]});if(typeof options.expectAt!="string"||options.expectAt.trim().length===0)throw new PmCliError("--expect-at must be the non-empty created_at timestamp of the entry you read",EXIT_CODE.USAGE,{code:"annotation_expectation_invalid",required:"Pass the created_at value of the row you read at that index, as a string."})}}function assertExpectedAnnotationEntry(id,entries,arrayIndex,config,expectAt){if(expectAt===void 0)return;const actual=entries[arrayIndex].created_at;if(actual===expectAt)return;const matchingIndexes=entries.flatMap((entry,position)=>entry.created_at===expectAt?[position+1]:[]),noun=config.collectionKey.replace(/s$/,""),action=config.input.mode==="delete"?"--delete":"--edit",entryIndex=arrayIndex+1,retarget=matchingIndexes.length===1?` The ${noun} created at ${expectAt} is at index ${matchingIndexes[0]}.`:matchingIndexes.length>1?` ${matchingIndexes.length} ${config.collectionKey} were created at ${expectAt}: indexes ${matchingIndexes.join(", ")}.`:` No ${noun} on ${id} was created at ${expectAt}.`;throw new PmCliError(`${noun.charAt(0).toUpperCase()}${noun.slice(1)} ${entryIndex} on ${id} was created at ${actual}, not ${expectAt}; refusing ${action} of an entry the caller did not read. Nothing was written.${retarget}`,EXIT_CODE.CONFLICT,{code:"annotation_entry_mismatch",item_id:id,details:{collection:config.collectionKey,entry_index:entryIndex,expected_created_at:expectAt,actual_created_at:actual,matching_indexes:matchingIndexes},required:`Address the ${noun} by the index its listing row reports and keep --expect-at set to that row's created_at. When several indexes share the timestamp, inspect those rows before retrying, because the guard compares timestamps, not entry identities.`,why:"A listing page's position or count is not an entry address; only the row's index is, and the expectation checks that the entry at that index still carries the created_at that was read.",examples:[`pm ${config.collectionKey} ${id} --limit 5`,`pm ${config.collectionKey} ${id} ${action} ${matchingIndexes.length===1?matchingIndexes[0]:"<index>"} --expect-at ${expectAt}${action==="--edit"?' --add "<text>"':""}`]})}function appendAnnotationEntry(document,collectionKey,author,text,ifAbsent,createEntry){const entries=readAnnotationEntries(document.metadata,collectionKey),existingIndex=ifAbsent?entries.findIndex(entry=>entry.author===author&&entry.text===text):-1;return existingIndex>=0?{changedFields:[],written:entries,position:existingIndex}:(entries.push(createEntry({created_at:nowIso(),author,text})),document.metadata[collectionKey]=entries,{changedFields:[collectionKey],written:entries,position:entries.length-1})}function canonicalAnnotationAddress(collectionKey,written,position){return CANONICALLY_ORDERED_LOG_COLLECTIONS.has(collectionKey)?written.map((_entry,index)=>index).sort((left,right)=>compareLogValues(written[left],written[right])||left-right).indexOf(position)+1:position+1}async function runAnnotationCommand(id,options,global2,config){assertAnnotationMessageHasTextSource(config,options);const pmRoot=resolvePmRoot(process.cwd(),global2.path);await assertInitializedTracker(pmRoot);const settings=await readSettings(pmRoot),typeRegistry=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()),limit=parseLimit(options.limit);if(config.input.mode==="list"){const located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder);if(!located)throw new PmCliError(`Item ${id} not found`,EXIT_CODE.NOT_FOUND);const loaded=await readLocatedItem(located,{schema:settings.schema}),allEntries2=readAnnotationEntries(loaded.document.metadata,config.collectionKey);return renderAnnotationResult(located.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0)}const author=resolveAuthor(options.author,settings.author_default);if(config.input.mode==="delete"){const op=config.deleteOp??config.op;let result2;try{result2=await mutateItem({pmRoot,settings,id,op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,mutate(document){const entries=readAnnotationEntries(document.metadata,config.collectionKey),arrayIndex=resolveAnnotationIndex(config.input.index,entries.length,config.collectionKey);return assertExpectedAnnotationEntry(id,entries,arrayIndex,config,options.expectAt),assertAnnotationEntryMutable(entries[arrayIndex],"deleted"),entries.splice(arrayIndex,1),document.metadata[config.collectionKey]=entries,{changedFields:[config.collectionKey]}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries2=readAnnotationEntries(result2.item,config.collectionKey);return renderAnnotationResult(result2.item.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0,{action:"delete",entryIndex:config.input.index},options.fullHistory===!0)}const rawText=config.input.rawValue??config.input.value??"";assertAnnotationAddValueIsNotFlagLike(rawText,config);const text=config.parseText(config.input.value??"");if(!text.trim())throw new PmCliError(`${config.input.emptyFlag??"--add"} text cannot be empty`,EXIT_CODE.USAGE);if(config.input.mode==="edit"){const op=config.editOp??config.op;let result2,editedAddress=0;try{result2=await mutateItem({pmRoot,settings,id,op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,mutate(document){const entries=readAnnotationEntries(document.metadata,config.collectionKey),arrayIndex=resolveAnnotationIndex(config.input.index,entries.length,config.collectionKey);assertExpectedAnnotationEntry(id,entries,arrayIndex,config,options.expectAt);const existing=entries[arrayIndex];return assertAnnotationEntryMutable(existing,"edited"),entries[arrayIndex]={...existing,text,edited_at:nowIso()},editedAddress=canonicalAnnotationAddress(config.collectionKey,entries,arrayIndex),document.metadata[config.collectionKey]=entries,{changedFields:[config.collectionKey]}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries2=readAnnotationEntries(result2.item,config.collectionKey),editedIndex=editedAddress;return renderAnnotationResult(result2.item.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0,{action:"edit",entryIndex:editedIndex,entry:allEntries2[editedIndex-1]},options.fullHistory===!0)}let result,entryIndex=0;try{result=await mutateItem({pmRoot,settings,id,op:config.op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,skipNoop:options.ifAbsent===!0,mutate(document){const appended=appendAnnotationEntry(document,config.collectionKey,author,text,options.ifAbsent===!0,config.createEntry);return entryIndex=canonicalAnnotationAddress(config.collectionKey,appended.written,appended.position),{changedFields:appended.changedFields}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries=readAnnotationEntries(result.item,config.collectionKey);return renderAnnotationResult(result.item.id,config.collectionKey,allEntries,limit,options.includeMeta===!0,{action:"add",entryIndex,entry:allEntries[entryIndex-1],changedCount:options.ifAbsent===!0?Math.min(result.changedFields.length,1):void 0},options.fullHistory===!0)}function resolveAnnotationIndex(oneBasedIndex,count,collectionKey){if(oneBasedIndex===void 0||!Number.isInteger(oneBasedIndex)||oneBasedIndex<1||oneBasedIndex>count){const singular=collectionKey.replace(/s$/,""),label=`${singular.charAt(0).toUpperCase()}${singular.slice(1)}`,noun=count===1?`1 ${singular}`:`${count} ${collectionKey}`;throw new PmCliError(`${label} index ${oneBasedIndex??"(missing)"} out of range (item has ${noun})`,EXIT_CODE.USAGE)}return oneBasedIndex-1}function renderAnnotationMutationReceipts(collectionKey,mutation,historyOmitted){return mutation===void 0?{}:{mutation_receipt:{action:mutation.action,entry_index:mutation.entryIndex,changed_count:mutation.changedCount??1,full_history_included:!historyOmitted},omission_receipt:{has_omissions:historyOmitted,omitted_field_group_count:historyOmitted?1:0,omitted_field_groups:historyOmitted?[{name:`${collectionKey}_history`,restore_with:{selector:"full_history",cli_flag:"--full-history",sdk_option:"fullHistory",mcp_option:"full"}}]:[]}}}function indexAnnotationEntry(entry,index){if(Object.prototype.toString.call(entry)!=="[object Object]")return entry;const indexed={index,...entry};return indexed.index=index,indexed}function indexRetainedAnnotationEntries(allEntries,retained){const offset=allEntries.length-retained.length;return retained.map((entry,position)=>indexAnnotationEntry(entry,offset+position+1))}function renderAnnotationResult(id,collectionKey,allEntries,limit,includeMeta,mutation,fullHistory=!1){const entries=mutation===void 0||fullHistory?indexRetainedAnnotationEntries(allEntries,limitAnnotationEntries(allEntries,mutation!==void 0&&fullHistory?void 0:limit)):mutation.entry===void 0?[]:[indexAnnotationEntry(mutation.entry,mutation.entryIndex)],historyOmitted=mutation!==void 0&&entries.length<allEntries.length;return{id,[collectionKey]:entries,count:entries.length,...mutation?.changedCount===void 0?{}:{changed:mutation.changedCount===1},...[includeMeta,mutation!==void 0].includes(!0)?{total_count:allEntries.length,returned_count:entries.length,has_more:historyOmitted||entries.length<allEntries.length,...limit!==void 0?{limit}:{}}:{},...renderAnnotationMutationReceipts(collectionKey,mutation,historyOmitted)}}export{ANNOTATION_FLAG_LIKE_VALUE_CODE,assertAnnotationStdinTransportAvailable,createFlagLikeAnnotationValueRefusal,isErrnoError,isFlagLikeAnnotationValue,limitAnnotationEntries,normalizeAnnotationTransportOptions,parseAnnotationTextInput,readAnnotationEntries,resolveAnnotationIndex,resolveAnnotationInput,runAnnotationCommand,wrapOwnershipConflict};
|
|
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]="9c3ae5d4-5437-543d-90a3-67e92b073c18")}catch{}})();import{assertInitializedTracker}from"./environment/tracker-preflight.js";import{readFile}from"node:fs/promises";import{isFileAbsentError}from"../core/fs/fs-utils.js";import{getActiveExtensionRegistrations}from"../core/extensions/index.js";import{resolveItemTypeRegistry}from"../core/item/type-registry.js";import{createStdinTokenResolver,parseCsvKv,shouldResolveMutationStdinTokens,transferMutationStdinTokenPolicy}from"../core/item/parse.js";import{renderPmCommand}from"../core/shared/command-line.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{parseLimit}from"../core/shared/numeric-parsers.js";import{nowIso}from"../core/shared/time.js";import{resolveAuthor}from"../core/shared/author.js";import{locateItem,mutateItem,readLocatedItem}from"../core/store/item-store.js";import{resolvePmRoot}from"../core/store/paths.js";import{readSettings}from"../core/store/settings.js";import{CANONICALLY_ORDERED_LOG_COLLECTIONS,compareLogValues}from"../core/item/item-format.js";function normalizeAnnotationTransportOptions(options){const normalized={...options,...options.full===!0?{fullHistory:!0}:{}};return delete normalized.full,transferMutationStdinTokenPolicy(options,normalized)}function isAnnotationRecord(entry){return Object.prototype.toString.call(entry)==="[object Object]"}function editedAnnotationEntry(existing,text,author,createEntry){const now=nowIso();if(!isAnnotationRecord(existing))return{...createEntry({created_at:now,author,text}),text,edited_at:now};const usable=value=>typeof value=="string"&&value!=="";return{...existing,...usable(existing.created_at)?{}:{created_at:now},...usable(existing.author)?{}:{author},text,edited_at:now}}function assertAnnotationEntryMutable(entry,operation){if(typeof entry=="object"&&entry!==null&&"format"in entry&&entry.format==="json")throw new PmCliError(`Structured context events are append-only and cannot be ${operation}.`,EXIT_CODE.USAGE,{code:"structured_event_immutable"})}function limitAnnotationEntries(values,limit){return limit===void 0?values:limit===0?[]:values.slice(Math.max(0,values.length-limit))}function readAnnotationEntries(source,collectionKey){const value=source[collectionKey];return Array.isArray(value)?value:[]}function parseAnnotationTextInput(raw,options={}){const trimmed=raw.trim();if(!trimmed)return"";const textPrefixMatch=/^(?:[-*+]\s*)?text\s*[:=]/i.exec(trimmed);if(options.stripPlainTextPrefix===!0&&textPrefixMatch&&!trimmed.startsWith("```"))return trimmed.slice(textPrefixMatch[0].length).trim()||trimmed;if(!(/^(?:[-*+]\s*)?text\s*[:=]/im.test(trimmed)||trimmed.startsWith("```")))return trimmed;try{const kv=parseCsvKv(trimmed,"--add");return Object.keys(kv).map(key=>key.trim().toLowerCase()).some(key=>key!=="text")?trimmed:kv.text?.trim()||trimmed}catch{return trimmed}}function isErrnoError(error){return typeof error=="object"&&error!==null&&"code"in error}function assertAnnotationStdinTransportAvailable(options,optionName){if(!shouldResolveMutationStdinTokens(options))throw new PmCliError(`${optionName} cannot read process stdin through the MCP JSON-RPC transport. Pass annotation text in options.add instead.`,EXIT_CODE.USAGE,{code:"mcp_stdin_unavailable",required:"Pass annotation text as JSON data; the MCP protocol already owns process stdin."})}async function resolveAnnotationTextSource(options,noun){if(+(options.add!==void 0)+ +(options.stdin===!0)+ +(typeof options.file=="string")>1)throw new PmCliError(`Specify ${noun} text using only one input source: --add, --stdin, or --file`,EXIT_CODE.USAGE);const stdinResolver=createStdinTokenResolver(),resolveStdinTokens=shouldResolveMutationStdinTokens(options);if(options.add!==void 0)return{value:await stdinResolver.resolveValue(options.add,"--add",resolveStdinTokens)??"",rawValue:options.add,emptyFlag:"--add"};if(options.stdin===!0)return assertAnnotationStdinTransportAvailable(options,"--stdin"),{value:await stdinResolver.resolveValue("-","--stdin")??"",emptyFlag:"--stdin"};if(typeof options.file!="string")return;const filePath=options.file.trim();if(!filePath)throw new PmCliError("--file path cannot be empty",EXIT_CODE.USAGE);if(filePath==="-")return assertAnnotationStdinTransportAvailable(options,"--file -"),{value:await stdinResolver.resolveValue("-","--file")??"",emptyFlag:"--file"};try{return{value:await readFile(filePath,"utf8"),emptyFlag:"--file"}}catch(error){if(isErrnoError(error)&&isFileAbsentError(error))throw new PmCliError(`--file path not found: ${filePath}. Use --file - to read stdin.`,EXIT_CODE.USAGE);const detail=error instanceof Error?error.message:String(error);throw new PmCliError(`Failed to read --file path "${filePath}": ${detail}. Use --file - to read stdin.`,EXIT_CODE.USAGE)}}async function resolveAnnotationInput(options,noun){if(options.edit!==void 0&&options.delete!==void 0)throw new PmCliError("Specify only one of --edit or --delete",EXIT_CODE.USAGE);if(options.delete!==void 0){if(options.add!==void 0||options.stdin===!0||typeof options.file=="string")throw new PmCliError("--delete cannot be combined with replacement text",EXIT_CODE.USAGE);if(!Number.isInteger(options.delete)||options.delete<1)throw new PmCliError("--delete must be a positive integer",EXIT_CODE.USAGE);return{mode:"delete",index:options.delete}}if(options.edit!==void 0&&(!Number.isInteger(options.edit)||options.edit<1))throw new PmCliError("--edit must be a positive integer",EXIT_CODE.USAGE);const resolved=await resolveAnnotationTextSource(options,noun);if(options.edit!==void 0){if(!resolved)throw new PmCliError("--edit requires replacement text from --add, --stdin, or --file",EXIT_CODE.USAGE);return{mode:"edit",index:options.edit,...resolved}}return resolved?{mode:"add",...resolved}:{mode:"list"}}function wrapOwnershipConflict(error,guidance){throw error instanceof PmCliError&&error.exitCode===EXIT_CODE.CONFLICT&&error.message.includes("is assigned to")&&error.message.includes("Use --force to override")?new PmCliError(error.message,error.exitCode,{code:"ownership_conflict",required:guidance.required,examples:guidance.examples,nextSteps:guidance.nextSteps}):error}function annotationStdinHint(collectionKey){return collectionKey==="comments"?"--stdin":"--add -"}const ANNOTATION_FLAG_LIKE_VALUE_CODE="annotation_flag_like_value";function isFlagLikeAnnotationValue(raw){return/^-{1,2}[A-Za-z][\w-]*(?:=.*)?$/.test(raw.trim())}function annotationSourceOptionForm(token){return token==="--file"?"--file <path>":token.startsWith("--file=")?token:token==="--stdin"?"--stdin":void 0}function createFlagLikeAnnotationValueRefusal(input){const trimmed=input.value.trim(),noun=input.collectionKey.replace(/s$/,""),sourceForm=annotationSourceOptionForm(trimmed),stdinHint=annotationStdinHint(input.collectionKey),retry=input.retryArgs===void 0?{}:{field:input.textFlag,recovery:{suggested_flags:[trimmed],suggested_retry:renderPmCommand(input.retryArgs),suggested_retry_args:[...input.retryArgs]}};if(sourceForm!==void 0){const sourceFlag=sourceForm.split(/[ =]/,1)[0],source=sourceFlag==="--file"?"that file":"stdin",operandNote=input.conflictingOperand===void 0?"":` "${input.conflictingOperand}" was read as positional text, which ${sourceFlag} cannot be combined with: drop it, or pass it as the text without ${sourceFlag}.`;return new PmCliError(`${input.textFlag} value "${trimmed}" looks like an option, not annotation text: ${input.textFlag} took ${sourceFlag} as its value. Drop ${input.textFlag} and pass ${sourceForm} on its own.${operandNote}`,EXIT_CODE.USAGE,{code:"annotation_flag_like_value",required:`Drop ${input.textFlag}: ${sourceForm} reads the ${noun} text from ${source} by itself. Use ${input.textFlag} text=${trimmed} only when the text really is "${trimmed}".`,examples:[`${input.commandPrefix} ${sourceForm}`,`${input.commandPrefix} ${input.textFlag} text=${trimmed}`],...retry})}return new PmCliError(`${input.textFlag} value "${trimmed}" looks like an option, not annotation text. Use ${stdinHint} to read stdin, or use text=${trimmed} for literal dash-leading text.`,EXIT_CODE.USAGE,{code:"annotation_flag_like_value",required:`Use ${stdinHint} for stdin input, pass plain text, or use text=${trimmed} when the text really starts with "-".`,examples:[`${input.commandPrefix} ${stdinHint}`,`${input.commandPrefix} ${input.textFlag} text=${trimmed}`],...retry})}function assertAnnotationAddValueIsNotFlagLike(raw,config){if(!((config.input.emptyFlag??"--add")!=="--add"||!isFlagLikeAnnotationValue(raw)))throw createFlagLikeAnnotationValueRefusal({collectionKey:config.collectionKey,textFlag:"--add",value:raw,commandPrefix:config.input.mode==="edit"?`pm ${config.collectionKey} <id> --edit <index>`:`pm ${config.collectionKey} <id>`})}function assertAnnotationMessageHasTextSource(config,options){if(options.ifAbsent===!0&&!["add","stdin","file"].includes(config.input.mode))throw new PmCliError(`--if-absent requires a ${config.collectionKey.replace(/s$/,"")} append`,EXIT_CODE.USAGE,{code:"annotation_if_absent_without_append",required:"Combine --if-absent with one append text source; omit it for list, edit, and delete operations."});if(assertAnnotationExpectationTargetsEntry(config,options),config.input.mode!=="list"||options.message===void 0)return;const noun=config.collectionKey.replace(/s$/,"");throw new PmCliError(`--message labels a ${noun} mutation but does not provide ${noun} text. Pass text positionally or with --add, --stdin, or --file.`,EXIT_CODE.USAGE,{code:"annotation_message_without_text",required:`Provide ${noun} text through a content source; --message only annotates the history entry of a mutation.`,examples:[`pm ${config.collectionKey} <id> --add "text" --message "why"`,`pm ${config.collectionKey} <id> ${annotationStdinHint(config.collectionKey)}`]})}function assertAnnotationExpectationTargetsEntry(config,options){if(options.expectAt!==void 0){if(config.input.mode!=="edit"&&config.input.mode!=="delete")throw new PmCliError(`--expect-at guards an --edit or --delete of one ${config.collectionKey.replace(/s$/,"")}`,EXIT_CODE.USAGE,{code:"annotation_expectation_without_target",required:"Combine --expect-at with --edit <index> or --delete <index>; omit it for list and append operations.",examples:[`pm ${config.collectionKey} <id> --edit <index> --expect-at <created_at> --add "<text>"`,`pm ${config.collectionKey} <id> --delete <index> --expect-at <created_at>`]});if(typeof options.expectAt!="string"||options.expectAt.trim().length===0)throw new PmCliError("--expect-at must be the non-empty created_at timestamp of the entry you read",EXIT_CODE.USAGE,{code:"annotation_expectation_invalid",required:"Pass the created_at value of the row you read at that index, as a string."})}}function assertExpectedAnnotationEntry(id,entries,arrayIndex,config,expectAt){if(expectAt===void 0)return;const stored=entries[arrayIndex]?.created_at,actual=typeof stored=="string"?stored:null;if(actual===expectAt)return;const matchingIndexes=entries.flatMap((entry,position)=>entry?.created_at===expectAt?[position+1]:[]),noun=config.collectionKey.replace(/s$/,""),action=config.input.mode==="delete"?"--delete":"--edit",entryIndex=arrayIndex+1,retarget=matchingIndexes.length===1?` The ${noun} created at ${expectAt} is at index ${matchingIndexes[0]}.`:matchingIndexes.length>1?` ${matchingIndexes.length} ${config.collectionKey} were created at ${expectAt}: indexes ${matchingIndexes.join(", ")}.`:` No ${noun} on ${id} was created at ${expectAt}.`;throw new PmCliError(`${noun.charAt(0).toUpperCase()}${noun.slice(1)} ${entryIndex} on ${id} was created at ${actual||"an unrecorded time (malformed entry)"}, not ${expectAt}; refusing ${action} of an entry the caller did not read. Nothing was written.${retarget}`,EXIT_CODE.CONFLICT,{code:"annotation_entry_mismatch",item_id:id,details:{collection:config.collectionKey,entry_index:entryIndex,expected_created_at:expectAt,actual_created_at:actual,matching_indexes:matchingIndexes},required:`Address the ${noun} by the index its listing row reports and keep --expect-at set to that row's created_at. When several indexes share the timestamp, inspect those rows before retrying, because the guard compares timestamps, not entry identities.`,why:"A listing page's position or count is not an entry address; only the row's index is, and the expectation checks that the entry at that index still carries the created_at that was read.",examples:[`pm ${config.collectionKey} ${id} --limit 5`,`pm ${config.collectionKey} ${id} ${action} ${matchingIndexes.length===1?matchingIndexes[0]:"<index>"} --expect-at ${expectAt}${action==="--edit"?' --add "<text>"':""}`]})}function appendAnnotationEntry(document,collectionKey,author,text,ifAbsent,createEntry){const entries=readAnnotationEntries(document.metadata,collectionKey),existingIndex=ifAbsent?entries.findIndex(entry=>isAnnotationRecord(entry)&&entry.author===author&&entry.text===text):-1;return existingIndex>=0?{changedFields:[],written:entries,position:existingIndex}:(entries.push(createEntry({created_at:nowIso(),author,text})),document.metadata[collectionKey]=entries,{changedFields:[collectionKey],written:entries,position:entries.length-1})}function canonicalAnnotationAddress(collectionKey,written,position){return CANONICALLY_ORDERED_LOG_COLLECTIONS.has(collectionKey)?written.map((_entry,index)=>index).sort((left,right)=>compareLogValues(written[left],written[right])||left-right).indexOf(position)+1:position+1}async function runAnnotationCommand(id,options,global2,config){assertAnnotationMessageHasTextSource(config,options);const pmRoot=resolvePmRoot(process.cwd(),global2.path);await assertInitializedTracker(pmRoot);const settings=await readSettings(pmRoot),typeRegistry=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()),limit=parseLimit(options.limit);if(config.input.mode==="list"){const located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder);if(!located)throw new PmCliError(`Item ${id} not found`,EXIT_CODE.NOT_FOUND);const loaded=await readLocatedItem(located,{schema:settings.schema}),allEntries2=readAnnotationEntries(loaded.document.metadata,config.collectionKey);return renderAnnotationResult(located.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0)}const author=resolveAuthor(options.author,settings.author_default);if(config.input.mode==="delete"){const op=config.deleteOp??config.op;let result2;try{result2=await mutateItem({pmRoot,settings,id,op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,mutate(document){const entries=readAnnotationEntries(document.metadata,config.collectionKey),arrayIndex=resolveAnnotationIndex(config.input.index,entries.length,config.collectionKey);return assertExpectedAnnotationEntry(id,entries,arrayIndex,config,options.expectAt),assertAnnotationEntryMutable(entries[arrayIndex],"deleted"),entries.splice(arrayIndex,1),document.metadata[config.collectionKey]=entries,{changedFields:[config.collectionKey]}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries2=readAnnotationEntries(result2.item,config.collectionKey);return renderAnnotationResult(result2.item.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0,{action:"delete",entryIndex:config.input.index},options.fullHistory===!0)}const rawText=config.input.rawValue??config.input.value??"";assertAnnotationAddValueIsNotFlagLike(rawText,config);const text=config.parseText(config.input.value??"");if(!text.trim())throw new PmCliError(`${config.input.emptyFlag??"--add"} text cannot be empty`,EXIT_CODE.USAGE);if(config.input.mode==="edit"){const op=config.editOp??config.op;let result2,editedAddress=0;try{result2=await mutateItem({pmRoot,settings,id,op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,mutate(document){const entries=readAnnotationEntries(document.metadata,config.collectionKey),arrayIndex=resolveAnnotationIndex(config.input.index,entries.length,config.collectionKey);assertExpectedAnnotationEntry(id,entries,arrayIndex,config,options.expectAt);const existing=entries[arrayIndex];return assertAnnotationEntryMutable(existing,"edited"),entries[arrayIndex]=editedAnnotationEntry(existing,text,author,config.createEntry),editedAddress=canonicalAnnotationAddress(config.collectionKey,entries,arrayIndex),document.metadata[config.collectionKey]=entries,{changedFields:[config.collectionKey]}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries2=readAnnotationEntries(result2.item,config.collectionKey),editedIndex=editedAddress;return renderAnnotationResult(result2.item.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0,{action:"edit",entryIndex:editedIndex,entry:allEntries2[editedIndex-1]},options.fullHistory===!0)}let result,entryIndex=0;try{result=await mutateItem({pmRoot,settings,id,op:config.op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,skipNoop:options.ifAbsent===!0,mutate(document){const appended=appendAnnotationEntry(document,config.collectionKey,author,text,options.ifAbsent===!0,config.createEntry);return entryIndex=canonicalAnnotationAddress(config.collectionKey,appended.written,appended.position),{changedFields:appended.changedFields}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries=readAnnotationEntries(result.item,config.collectionKey);return renderAnnotationResult(result.item.id,config.collectionKey,allEntries,limit,options.includeMeta===!0,{action:"add",entryIndex,entry:allEntries[entryIndex-1],changedCount:options.ifAbsent===!0?Math.min(result.changedFields.length,1):void 0},options.fullHistory===!0)}function resolveAnnotationIndex(oneBasedIndex,count,collectionKey){if(oneBasedIndex===void 0||!Number.isInteger(oneBasedIndex)||oneBasedIndex<1||oneBasedIndex>count){const singular=collectionKey.replace(/s$/,""),label=`${singular.charAt(0).toUpperCase()}${singular.slice(1)}`,noun=count===1?`1 ${singular}`:`${count} ${collectionKey}`;throw new PmCliError(`${label} index ${oneBasedIndex??"(missing)"} out of range (item has ${noun})`,EXIT_CODE.USAGE)}return oneBasedIndex-1}function renderAnnotationMutationReceipts(collectionKey,mutation,historyOmitted){return mutation===void 0?{}:{mutation_receipt:{action:mutation.action,entry_index:mutation.entryIndex,changed_count:mutation.changedCount??1,full_history_included:!historyOmitted},omission_receipt:{has_omissions:historyOmitted,omitted_field_group_count:historyOmitted?1:0,omitted_field_groups:historyOmitted?[{name:`${collectionKey}_history`,restore_with:{selector:"full_history",cli_flag:"--full-history",sdk_option:"fullHistory",mcp_option:"full"}}]:[]}}}function indexAnnotationEntry(entry,index){if(Object.prototype.toString.call(entry)!=="[object Object]")return entry;const indexed={index,...entry};return indexed.index=index,indexed}function indexRetainedAnnotationEntries(allEntries,retained){const offset=allEntries.length-retained.length;return retained.map((entry,position)=>indexAnnotationEntry(entry,offset+position+1))}function renderAnnotationResult(id,collectionKey,allEntries,limit,includeMeta,mutation,fullHistory=!1){const entries=mutation===void 0||fullHistory?indexRetainedAnnotationEntries(allEntries,limitAnnotationEntries(allEntries,mutation!==void 0&&fullHistory?void 0:limit)):mutation.entry===void 0?[]:[indexAnnotationEntry(mutation.entry,mutation.entryIndex)],historyOmitted=mutation!==void 0&&entries.length<allEntries.length;return{id,[collectionKey]:entries,count:entries.length,...mutation?.changedCount===void 0?{}:{changed:mutation.changedCount===1},...[includeMeta,mutation!==void 0].includes(!0)?{total_count:allEntries.length,returned_count:entries.length,has_more:historyOmitted||entries.length<allEntries.length,...limit!==void 0?{limit}:{}}:{},...renderAnnotationMutationReceipts(collectionKey,mutation,historyOmitted)}}export{ANNOTATION_FLAG_LIKE_VALUE_CODE,assertAnnotationStdinTransportAvailable,createFlagLikeAnnotationValueRefusal,isErrnoError,isFlagLikeAnnotationValue,limitAnnotationEntries,normalizeAnnotationTransportOptions,parseAnnotationTextInput,readAnnotationEntries,resolveAnnotationIndex,resolveAnnotationInput,runAnnotationCommand,wrapOwnershipConflict};
|
|
2
2
|
//# sourceMappingURL=annotations.js.map
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/** First release-governance anchor after which unknown authors require remediation. */
|
|
2
|
-
export declare const HISTORY_AUTHOR_ATTRIBUTION_BASELINE
|
|
2
|
+
export declare const HISTORY_AUTHOR_ATTRIBUTION_BASELINE="2026-07-15T06:22:12.276Z";
|
|
3
3
|
/** Identifies one history event whose mutation author is absent or explicitly unknown. */
|
|
4
|
-
export interface UnknownAuthorHistoryEvent
|
|
4
|
+
export interface UnknownAuthorHistoryEvent{
|
|
5
5
|
/** Item whose history stream contains the event. */
|
|
6
6
|
item_id:string;
|
|
7
7
|
/** One-based JSONL line number. */
|
|
8
|
-
line:number;
|
|
9
|
-
}
|
|
8
|
+
line:number;}
|
|
10
9
|
/** Summarizes mutation-author provenance across all readable tracker history streams. */
|
|
11
|
-
export interface HistoryAuthorAttributionScan
|
|
10
|
+
export interface HistoryAuthorAttributionScan{
|
|
12
11
|
/** Number of readable history streams inspected. */
|
|
13
12
|
checked_streams:number;
|
|
14
13
|
/** Number of non-empty history events inspected. */
|
|
@@ -28,19 +27,18 @@ samples:UnknownAuthorHistoryEvent[];
|
|
|
28
27
|
/** Whether additional undispositioned unknown-author examples were omitted. */
|
|
29
28
|
samples_truncated:boolean;
|
|
30
29
|
/** Complete actionable coordinates when explicitly requested by a trusted caller. */
|
|
31
|
-
actionable_events?:UnknownAuthorHistoryEvent[];
|
|
32
|
-
}
|
|
30
|
+
actionable_events?:UnknownAuthorHistoryEvent[];}
|
|
33
31
|
/** Classifies one parsed history event by author provenance and baseline age. */
|
|
34
|
-
export declare const classifyHistoryAuthorEvent:(parsed:unknown)
|
|
32
|
+
export declare const classifyHistoryAuthorEvent:(parsed:unknown)=> "attributed"|"legacy_unknown"|"actionable_unknown";
|
|
35
33
|
/** Inspect one readable JSONL stream without performing filesystem I/O. */
|
|
36
|
-
export declare const inspectHistoryAuthorStream:(itemId:string,raw:string,sampleLimit?:number,acknowledgedEvents?:ReadonlySet<string>)
|
|
34
|
+
export declare const inspectHistoryAuthorStream:(itemId:string,raw:string,sampleLimit?:number,acknowledgedEvents?:ReadonlySet<string>)=> Pick<HistoryAuthorAttributionScan,"checked_events"|"unknown_event_count"|"legacy_unknown_event_count"|"actionable_unknown_event_count"|"acknowledged_actionable_event_count"|"samples"|"samples_truncated"|"actionable_events">;
|
|
37
35
|
/**
|
|
38
36
|
* Scan append-only tracker history for missing or `unknown` author values.
|
|
39
37
|
* Malformed and unreadable streams are deliberately left to integrity diagnostics.
|
|
40
38
|
*/
|
|
41
|
-
export declare const scanHistoryAuthorAttribution:(pmRoot:string,sampleLimit?:number,includeActionableEvents?:boolean)
|
|
39
|
+
export declare const scanHistoryAuthorAttribution:(pmRoot:string,sampleLimit?:number,includeActionableEvents?:boolean)=> Promise<HistoryAuthorAttributionScan>;
|
|
42
40
|
/** Parameters for append-only disposition of immutable unknown-author events. */
|
|
43
|
-
export interface AcknowledgeUnknownAuthorEventsOptions
|
|
41
|
+
export interface AcknowledgeUnknownAuthorEventsOptions{
|
|
44
42
|
/** Events identified by item id and one-based history line. */
|
|
45
43
|
events?:UnknownAuthorHistoryEvent[];
|
|
46
44
|
/** Select every currently actionable, undispositioned event in the tracker. */
|
|
@@ -56,21 +54,17 @@ dry_run?:boolean;
|
|
|
56
54
|
/** Fingerprint from the exact preview plan being applied. */
|
|
57
55
|
plan_fingerprint?:string;
|
|
58
56
|
/** Maximum coordinate rows included in the returned plan. */
|
|
59
|
-
coordinate_limit?:number;
|
|
60
|
-
}
|
|
57
|
+
coordinate_limit?:number;}
|
|
61
58
|
/** One source-bound coordinate in an author-acknowledgement plan. */
|
|
62
|
-
export interface UnknownAuthorAcknowledgmentPlanCoordinate extends UnknownAuthorHistoryEvent
|
|
59
|
+
export interface UnknownAuthorAcknowledgmentPlanCoordinate extends UnknownAuthorHistoryEvent{
|
|
63
60
|
/** SHA-256 of the exact immutable JSONL source line. */
|
|
64
61
|
source_event_hash:string;
|
|
65
62
|
/** Whether the row is undispositioned or an explicit apply would supersede it. */
|
|
66
|
-
disposition:"actionable"
|
|
67
|
-
}
|
|
63
|
+
disposition:"actionable"|"already_acknowledged";}
|
|
68
64
|
/** Deterministic preview shared by CLI, SDK, and MCP apply paths. */
|
|
69
|
-
export interface UnknownAuthorAcknowledgmentPlan
|
|
65
|
+
export interface UnknownAuthorAcknowledgmentPlan{
|
|
70
66
|
/** Selector family resolved by the plan. */
|
|
71
|
-
selection:{
|
|
72
|
-
kind:"events" | "all_actionable";
|
|
73
|
-
};
|
|
67
|
+
selection:{kind:"events"|"all_actionable";};
|
|
74
68
|
/** Complete number of unique selected coordinates. */
|
|
75
69
|
selected_count:number;
|
|
76
70
|
/** Selected coordinates not covered by an earlier disposition. */
|
|
@@ -82,10 +76,9 @@ omitted_count:number;
|
|
|
82
76
|
/** Stable ordered prefix of the complete selected set. */
|
|
83
77
|
coordinates:UnknownAuthorAcknowledgmentPlanCoordinate[];
|
|
84
78
|
/** SHA-256 over selection kind and every complete source-bound coordinate. */
|
|
85
|
-
plan_fingerprint:string;
|
|
86
|
-
}
|
|
79
|
+
plan_fingerprint:string;}
|
|
87
80
|
/** Structured preview or apply result for immutable author acknowledgement. */
|
|
88
|
-
export interface UnknownAuthorAcknowledgmentResult
|
|
81
|
+
export interface UnknownAuthorAcknowledgmentResult{
|
|
89
82
|
/** Whether this invocation was a read-only preview. */
|
|
90
83
|
dry_run:boolean;
|
|
91
84
|
/** Whether an append-only workspace event was written. */
|
|
@@ -93,21 +86,17 @@ mutated:boolean;
|
|
|
93
86
|
/** Number of coordinates written to the appended disposition. */
|
|
94
87
|
acknowledged:number;
|
|
95
88
|
/** Effect-aware command outcome. */
|
|
96
|
-
outcome:"preview"
|
|
89
|
+
outcome:"preview"|"effect"|"no_effect"|"partial_effect";
|
|
97
90
|
/** Stable shell and transport exit paired with the outcome. */
|
|
98
|
-
exit_code:0
|
|
91
|
+
exit_code:0|6|7;
|
|
99
92
|
/** Exact plan used for preview or apply. */
|
|
100
93
|
plan:UnknownAuthorAcknowledgmentPlan;
|
|
101
94
|
/** Appended workspace history path when mutation occurred. */
|
|
102
|
-
history_path?:string;
|
|
103
|
-
}
|
|
95
|
+
history_path?:string;}
|
|
104
96
|
/** Resolve a deterministic, source-bound author-acknowledgement preview. */
|
|
105
|
-
export declare function planUnknownAuthorHistoryAcknowledgment(pmRoot:string,selector:Pick<AcknowledgeUnknownAuthorEventsOptions,"events"
|
|
97
|
+
export declare function planUnknownAuthorHistoryAcknowledgment(pmRoot:string,selector:Pick<AcknowledgeUnknownAuthorEventsOptions,"events"|"all_actionable">,coordinateLimit?:number):Promise<UnknownAuthorAcknowledgmentPlan>;
|
|
106
98
|
/** Resolve the mutually exclusive CLI and SDK acknowledgment selectors. */
|
|
107
|
-
export declare function resolveUnknownAuthorAcknowledgmentSelector(rawEvents:readonly string[],allActionable:boolean):{
|
|
108
|
-
events:UnknownAuthorHistoryEvent[];
|
|
109
|
-
all_actionable:boolean;
|
|
110
|
-
};
|
|
99
|
+
export declare function resolveUnknownAuthorAcknowledgmentSelector(rawEvents:readonly string[],allActionable:boolean):{events:UnknownAuthorHistoryEvent[];all_actionable:boolean;};
|
|
111
100
|
/** Parse user-facing item or workspace history coordinates into SDK events. */
|
|
112
101
|
export declare function parseUnknownAuthorHistoryEventCoordinates(values:readonly string[]):UnknownAuthorHistoryEvent[];
|
|
113
102
|
/** Normalize an untyped transport payload and execute author acknowledgment. */
|
|
@@ -116,4 +105,4 @@ export declare function acknowledgeUnknownAuthorHistoryEventsFromTransport(pmRoo
|
|
|
116
105
|
* Append an audited disposition for immutable unknown-author events without
|
|
117
106
|
* rewriting their original streams.
|
|
118
107
|
*/
|
|
119
|
-
export declare function acknowledgeUnknownAuthorHistoryEvents(pmRoot:string,options:AcknowledgeUnknownAuthorEventsOptions):Promise<UnknownAuthorAcknowledgmentResult>;
|
|
108
|
+
export declare function acknowledgeUnknownAuthorHistoryEvents(pmRoot:string,options:AcknowledgeUnknownAuthorEventsOptions):Promise<UnknownAuthorAcknowledgmentResult>;
|