@unbrained/pm-cli 2026.9.6 → 2026.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/pm-developer/SKILL.md +12 -4
- package/.agents/skills/pm-developer/references/MULTI_AGENT_MERGE.md +19 -10
- package/.agents/skills/pm-extensions/SKILL.md +6 -0
- package/.agents/skills/pm-sdk/SKILL.md +11 -2
- package/.agents/skills/pm-user/SKILL.md +5 -0
- package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +95 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +218 -182
- package/dist/cli/after-command-context-usage.js +1 -48
- package/dist/cli/argv-utils.js +1 -40
- package/dist/cli/bootstrap-args.js +1 -9
- package/dist/cli/bundle-integrity.js +2 -110
- package/dist/cli/commander-usage.js +11 -771
- package/dist/cli/commands/activity.js +1 -9
- package/dist/cli/commands/aggregate.js +1 -5
- package/dist/cli/commands/append.js +1 -5
- package/dist/cli/commands/claim.js +1 -5
- package/dist/cli/commands/close-many.js +1 -5
- package/dist/cli/commands/close.js +1 -9
- package/dist/cli/commands/comments.js +1 -5
- package/dist/cli/commands/config.js +1 -9
- package/dist/cli/commands/context.js +1 -9
- package/dist/cli/commands/contracts.js +1 -5
- package/dist/cli/commands/copy.js +1 -9
- package/dist/cli/commands/create.js +1 -9
- package/dist/cli/commands/delete.js +1 -9
- package/dist/cli/commands/deps.js +1 -9
- package/dist/cli/commands/docs.js +1 -9
- package/dist/cli/commands/duplicates.js +1 -9
- package/dist/cli/commands/eval.js +1 -9
- package/dist/cli/commands/extension/describe.js +1 -5
- package/dist/cli/commands/extension/scaffold.js +1 -5
- package/dist/cli/commands/extension/shared.js +1 -5
- package/dist/cli/commands/extension.js +1 -9
- package/dist/cli/commands/files.js +1 -9
- package/dist/cli/commands/focus.js +1 -9
- package/dist/cli/commands/gc.js +1 -9
- package/dist/cli/commands/get.js +1 -9
- package/dist/cli/commands/graph.js +1 -10
- package/dist/cli/commands/health.js +1 -9
- package/dist/cli/commands/history-compact.js +1 -10
- package/dist/cli/commands/history-redact.js +1 -11
- package/dist/cli/commands/history-repair.js +1 -10
- package/dist/cli/commands/history.js +1 -5
- package/dist/cli/commands/index.js +1 -58
- package/dist/cli/commands/init-agent-guidance.js +1 -9
- package/dist/cli/commands/init.js +1 -9
- package/dist/cli/commands/learnings.js +1 -5
- package/dist/cli/commands/lifecycle-transitions.js +1 -5
- package/dist/cli/commands/list.js +1 -9
- package/dist/cli/commands/merge.js +1 -11
- package/dist/cli/commands/next.js +1 -9
- package/dist/cli/commands/notes.js +1 -5
- package/dist/cli/commands/plan.js +1 -9
- package/dist/cli/commands/profile.js +1 -9
- package/dist/cli/commands/restore.js +1 -9
- package/dist/cli/commands/scheduling-shortcuts.js +1 -9
- package/dist/cli/commands/schema.js +1 -10
- package/dist/cli/commands/search.js +1 -9
- package/dist/cli/commands/stats.js +1 -9
- package/dist/cli/commands/telemetry.js +1 -9
- package/dist/cli/commands/test-all.js +1 -9
- package/dist/cli/commands/test-runs.js +1 -9
- package/dist/cli/commands/test.js +1 -9
- package/dist/cli/commands/update-many.js +1 -5
- package/dist/cli/commands/update.js +1 -9
- package/dist/cli/commands/upgrade.js +1 -5
- package/dist/cli/commands/validate.js +1 -15
- package/dist/cli/context-intent-invocation.js +1 -20
- package/dist/cli/description-stdin.js +1 -17
- package/dist/cli/error-guidance.js +1 -1353
- package/dist/cli/extension-command-help.js +5 -636
- package/dist/cli/extension-command-options.js +1 -427
- package/dist/cli/extension-recovery.js +1 -126
- package/dist/cli/help-content.js +2 -1001
- package/dist/cli/help-json-payload.js +4 -570
- package/dist/cli/main.d.ts +4 -0
- package/dist/cli/main.js +5 -2573
- package/dist/cli/migration-gates.js +1 -289
- package/dist/cli/public.js +1 -20
- package/dist/cli/register-annotations.js +1 -270
- package/dist/cli/register-assurance.js +1 -62
- package/dist/cli/register-files-lookup.js +1 -56
- package/dist/cli/register-history-activity.d.ts +8 -0
- package/dist/cli/register-history-activity.js +2 -0
- package/dist/cli/register-history-author.js +1 -38
- package/dist/cli/register-history-maintenance.d.ts +9 -0
- package/dist/cli/register-history-maintenance.js +2 -0
- package/dist/cli/register-list-query.js +10 -943
- package/dist/cli/register-mutation-options.js +1 -9
- package/dist/cli/register-mutation.js +19 -1893
- package/dist/cli/register-operations.js +1 -920
- package/dist/cli/register-setup.js +1 -716
- package/dist/cli/register-structured-mutation.js +1 -196
- package/dist/cli/registration-helpers.js +1 -5
- package/dist/cli/runtime-compatibility-boundary.js +4 -42
- package/dist/cli/schema-registration-helpers.js +1 -73
- package/dist/cli/search-refresh.js +1 -13
- package/dist/cli/stats-analytics-json.js +1 -68
- package/dist/cli/telemetry-flush.js +1 -10
- package/dist/cli-bundle/bundle-manifest.json +164 -156
- package/dist/cli-bundle/chunks/chunk-3BZZA6A3.js +5 -0
- package/dist/cli-bundle/chunks/chunk-AMRDVX36.js +235 -0
- package/dist/cli-bundle/chunks/chunk-DAM4CBBR.js +2202 -0
- package/dist/cli-bundle/chunks/{chunk-WYRZZ5ZE.js → chunk-DEZPZOQ7.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-FLDWYEND.js +77 -0
- package/dist/cli-bundle/chunks/{chunk-NPN5I67J.js → chunk-G5ADGQ2D.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-JAAEYHUA.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-JX4DH4WC.js → chunk-KR3RP4FH.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-LEZOUXG6.js +2 -0
- package/dist/cli-bundle/chunks/chunk-NSAPNEYH.js +2 -0
- package/dist/cli-bundle/chunks/chunk-QOEKOECV.js +29 -0
- package/dist/cli-bundle/chunks/chunk-RHSFOMHU.js +2 -0
- package/dist/cli-bundle/chunks/chunk-XOD2PCB6.js +20 -0
- package/dist/cli-bundle/chunks/{chunk-JT6XF6GE.js → chunk-YVEQ2AMO.js} +4 -4
- package/dist/cli-bundle/chunks/register-list-query-KSK3R63M.js +11 -0
- package/dist/cli-bundle/chunks/register-mutation-IQ5C7U6O.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-I5W3KMGB.js → register-operations-DWVHR2NC.js} +2 -2
- package/dist/cli-bundle/chunks/register-setup-BQ5SVD4B.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-3WRPWLA7.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-7MBUII7U.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-COPBO5HW.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-DUN4IXYN.js +20 -0
- package/dist/cli-bundle/focused-chunks/{chunk-LIJIA4TY.js → chunk-EE5QSM4Z.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-HJVARYM3.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-IAUOUGVR.js +177 -0
- package/dist/cli-bundle/focused-chunks/chunk-KOOMJ54F.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-MZDXX7JY.js +56 -0
- package/dist/cli-bundle/focused-chunks/{chunk-M6PBRFSH.js → chunk-OPFHFGDD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QHNETP77.js +9 -0
- package/dist/cli-bundle/focused-chunks/{chunk-3BZEOXLT.js → chunk-RMWES4M6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-RXT4P5QH.js +10 -0
- package/dist/cli-bundle/focused-chunks/chunk-SDOL6FM2.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-SQV4AAUC.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-PEFABF7E.js → chunk-WE3IUNIW.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-YALOUBWJ.js +2 -0
- package/dist/cli-bundle/main.js +20 -20
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +29 -29
- 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 +42 -42
- 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 +11 -11
- package/dist/cli.js +1 -104
- package/dist/core/checkpoint/checkpoint-gc.js +1 -169
- package/dist/core/checkpoint/mutation-checkpoint.js +2 -133
- package/dist/core/config/nested-settings.js +1 -534
- package/dist/core/config/positional-value.js +1 -109
- package/dist/core/diagnostics/remediation.js +1 -506
- package/dist/core/extensions/activation-summary-markdown.js +2 -145
- package/dist/core/extensions/activation-summary.js +1 -92
- package/dist/core/extensions/activation-transaction.js +1 -46
- package/dist/core/extensions/capability-usage.js +1 -173
- package/dist/core/extensions/command-hook-context.js +1 -13
- package/dist/core/extensions/command-metadata-contract.js +1 -22
- package/dist/core/extensions/command-visibility-tier.js +1 -29
- package/dist/core/extensions/contribution-inventory.js +1 -173
- package/dist/core/extensions/exporter-output-contract.js +1 -66
- package/dist/core/extensions/extension-candidate.js +1 -18
- package/dist/core/extensions/extension-capability-aliases.js +1 -158
- package/dist/core/extensions/extension-hook-runtime.js +1 -699
- package/dist/core/extensions/extension-policy.js +1 -599
- package/dist/core/extensions/extension-registries.js +1 -62
- package/dist/core/extensions/extension-runtime-helpers.js +1 -33
- package/dist/core/extensions/extension-types.js +1 -102
- package/dist/core/extensions/flag-definition-validation.js +1 -52
- package/dist/core/extensions/flag-value-types.js +1 -64
- package/dist/core/extensions/index.js +1 -526
- package/dist/core/extensions/item-field-types.js +1 -39
- package/dist/core/extensions/item-fields.js +1 -261
- package/dist/core/extensions/loader.js +1 -2223
- package/dist/core/extensions/manifest-schema.js +1 -69
- package/dist/core/extensions/module-graph-snapshot.js +1 -33
- package/dist/core/extensions/preflight-ownership.js +1 -41
- package/dist/core/extensions/registration-validation.js +1 -82
- package/dist/core/extensions/registration-values.js +1 -209
- package/dist/core/extensions/reserved-host-flags.js +1 -36
- package/dist/core/extensions/runtime-registrations.js +1 -67
- package/dist/core/extensions/service-ownership.js +1 -19
- package/dist/core/extensions/version-compat.js +1 -216
- package/dist/core/fs/fs-utils.js +2 -158
- package/dist/core/fs/host-environment-errors.js +1 -141
- package/dist/core/fs/index.js +1 -9
- package/dist/core/fs/path-utils.js +1 -17
- package/dist/core/governance/content-fields.js +1 -160
- package/dist/core/governance/issue-codes.js +1 -151
- package/dist/core/governance/metadata-coverage.js +1 -358
- package/dist/core/history/drift-cache.js +3 -72
- package/dist/core/history/drift-scan.js +1 -342
- package/dist/core/history/event-classification.js +1 -109
- package/dist/core/history/event-index.js +8 -784
- package/dist/core/history/history-compact-bulk.js +1 -104
- package/dist/core/history/history-diff.js +1 -158
- package/dist/core/history/history-rewrite.d.ts +6 -1
- package/dist/core/history/history-rewrite.js +1 -107
- package/dist/core/history/history-storage-stats.js +1 -102
- package/dist/core/history/history-stream-policy.js +1 -62
- package/dist/core/history/history.js +2 -617
- package/dist/core/history/identity.js +1 -30
- package/dist/core/history/index.js +1 -9
- package/dist/core/history/projection.js +1 -196
- package/dist/core/history/read.d.ts +9 -0
- package/dist/core/history/read.js +1 -57
- package/dist/core/history/replay.js +2 -439
- package/dist/core/history/version-address.js +1 -32
- package/dist/core/history/workspace-history.js +2 -433
- package/dist/core/io/body-file.js +1 -62
- package/dist/core/io/bulk-ids-input.js +1 -112
- package/dist/core/item/actionability.js +1 -327
- package/dist/core/item/dependency-reference.js +1 -20
- package/dist/core/item/id.js +1 -112
- package/dist/core/item/index.js +1 -12
- package/dist/core/item/item-format-version.js +1 -78
- package/dist/core/item/item-format.js +5 -1473
- package/dist/core/item/item-record.js +1 -23
- package/dist/core/item/item-type-definition.js +1 -133
- package/dist/core/item/parent-reference-policy.js +1 -57
- package/dist/core/item/parse.js +2 -603
- package/dist/core/item/plan-lifecycle.js +1 -19
- package/dist/core/item/priority.js +1 -61
- package/dist/core/item/sprint-release-format.js +1 -38
- package/dist/core/item/status-filter.js +1 -115
- package/dist/core/item/status.js +1 -43
- package/dist/core/item/toon-decode.js +1 -29
- package/dist/core/item/type-registry.js +1 -715
- package/dist/core/item/type-synonyms.js +1 -38
- package/dist/core/lock/index.js +1 -9
- package/dist/core/lock/lock-gc.js +1 -240
- package/dist/core/lock/lock.js +3 -590
- package/dist/core/output/mutation-projection.js +1 -217
- package/dist/core/output/output-control.js +1 -25
- package/dist/core/output/output.js +11 -494
- package/dist/core/output/query-summary.js +1 -58
- package/dist/core/output/tabular.js +1 -77
- package/dist/core/packages/manifest.js +1 -244
- package/dist/core/packages/root.js +1 -84
- package/dist/core/profile/profile-describe.js +1 -83
- package/dist/core/profile/profile-lint.js +1 -415
- package/dist/core/profile/profile-plan.js +0 -0
- package/dist/core/profile/profile-presets.js +1 -370
- package/dist/core/reproducibility/context.js +1 -82
- package/dist/core/schema/fields-file.js +2 -288
- package/dist/core/schema/item-types-file.js +2 -296
- package/dist/core/schema/runtime-field-filters.js +1 -49
- package/dist/core/schema/runtime-field-values.js +1 -313
- package/dist/core/schema/runtime-schema.js +2 -826
- package/dist/core/schema/status-defs-file.js +2 -227
- package/dist/core/schema/status-token.js +1 -31
- package/dist/core/schema/type-inference.js +1 -95
- package/dist/core/schema/type-presets.js +1 -87
- package/dist/core/schema/type-workflows.js +1 -104
- package/dist/core/search/background-refresh.js +2 -286
- package/dist/core/search/bm25.js +1 -146
- package/dist/core/search/cache.js +2 -534
- package/dist/core/search/corpus.js +1 -311
- package/dist/core/search/embedding-batches.js +1 -163
- package/dist/core/search/eval.js +1 -225
- package/dist/core/search/http-client.js +1 -75
- package/dist/core/search/providers.js +1 -242
- package/dist/core/search/relevance.js +1 -244
- package/dist/core/search/semantic-defaults.js +1 -199
- package/dist/core/search/staleness.js +1 -30
- package/dist/core/search/vector-stores.js +2 -664
- package/dist/core/search/vectorization-metadata.js +1 -81
- package/dist/core/sentry/helpers.js +1 -272
- package/dist/core/sentry/instrument.js +1 -387
- package/dist/core/session/session-state.js +1 -260
- package/dist/core/shared/agent-session-context.js +1 -133
- package/dist/core/shared/author.js +1 -1172
- package/dist/core/shared/command-types.js +1 -4
- package/dist/core/shared/conflict-markers.js +1 -31
- package/dist/core/shared/constants.js +1 -405
- package/dist/core/shared/errors.js +1 -20
- package/dist/core/shared/html-entity-decode.js +1 -131
- package/dist/core/shared/index.js +1 -12
- package/dist/core/shared/item-metadata-contract.js +1 -89
- package/dist/core/shared/lazy-module.js +1 -16
- package/dist/core/shared/levenshtein.js +1 -61
- package/dist/core/shared/memo.js +1 -19
- package/dist/core/shared/numeric-parsers.js +1 -20
- package/dist/core/shared/option-alias-visibility.js +1 -67
- package/dist/core/shared/primitives.js +1 -127
- package/dist/core/shared/serial-queue.js +1 -79
- package/dist/core/shared/serialization.js +1 -210
- package/dist/core/shared/split-comma-list.js +1 -30
- package/dist/core/shared/text-normalization.js +1 -38
- package/dist/core/shared/time.js +1 -306
- package/dist/core/store/index.js +1 -12
- package/dist/core/store/item-format-migration.js +1 -125
- package/dist/core/store/item-metadata-cache.js +1 -1116
- package/dist/core/store/item-metadata-query-index.js +9 -394
- package/dist/core/store/item-metadata-read-work.js +1 -43
- package/dist/core/store/item-store.js +1 -693
- package/dist/core/store/paths.d.ts +1 -1
- package/dist/core/store/paths.js +1 -214
- package/dist/core/store/settings-read-cache.js +1 -85
- package/dist/core/store/settings-validator.js +1 -421
- package/dist/core/store/settings.js +3 -1309
- package/dist/core/store/tracker-preflight.js +1 -141
- package/dist/core/telemetry/consent.js +5 -108
- package/dist/core/telemetry/observability.js +1 -246
- package/dist/core/telemetry/runtime.js +4 -1988
- package/dist/core/test/background-runs.js +4 -945
- package/dist/core/test/item-test-run-tracking.js +1 -63
- package/dist/core/test/run-selectors.js +1 -120
- package/dist/core/validate/estimate-defaults.js +1 -89
- package/dist/core/validate/fix-planning.js +1 -189
- package/dist/core/validate/linked-artifact-reference.js +1 -36
- package/dist/core/validate/missing-by-type.js +1 -34
- package/dist/core/validate/missing-link-owners.js +1 -95
- package/dist/core/validate/stale-file-classification.js +1 -82
- package/dist/mcp/http-server.js +5 -448
- package/dist/mcp/legacy-adapter.js +1 -77
- package/dist/mcp/runtime-capabilities.js +1 -200
- package/dist/mcp/server.js +4 -1233
- package/dist/mcp/tool-definitions.js +1 -804
- package/dist/sdk/actionability.js +1 -13
- package/dist/sdk/agent/closed-domain-contracts.js +1 -161
- package/dist/sdk/agent/command-recovery.js +1 -59
- package/dist/sdk/agent/command-suggestions.js +1 -66
- package/dist/sdk/agent/create-option-policy.js +1 -31
- package/dist/sdk/agent/identity-config.js +1 -106
- package/dist/sdk/agent/item-addressing.js +1 -207
- package/dist/sdk/agent/refusal-closure-census.js +1 -151
- package/dist/sdk/agent/refusal-closure.js +1 -133
- package/dist/sdk/agent/refusal-corpus-contracts.js +1 -193
- package/dist/sdk/agent/refusal-reachability.js +1 -593
- package/dist/sdk/agent/subcommand-recovery.js +1 -83
- package/dist/sdk/agent/task-transcript-contracts.js +1 -197
- package/dist/sdk/agent/tracker-preflight-contracts.js +1 -126
- package/dist/sdk/agent-capability-contracts.js +1 -428
- package/dist/sdk/agent-session-context.js +1 -9
- package/dist/sdk/annotations.js +1 -448
- package/dist/sdk/author-attribution.js +1 -468
- package/dist/sdk/authoring.js +1 -20
- package/dist/sdk/cli-bootstrap.js +1 -838
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/agent-output-contracts.js +4 -476
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -79
- package/dist/sdk/cli-contracts/command-aliases.d.ts +4 -0
- package/dist/sdk/cli-contracts/command-aliases.js +1 -107
- package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -151
- package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1081
- package/dist/sdk/cli-contracts/commander-types.js +1 -159
- package/dist/sdk/cli-contracts/completeness.js +1 -393
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -222
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1947
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -347
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -986
- package/dist/sdk/cli-contracts/registration-helpers.js +7 -990
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +5 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -2090
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -324
- package/dist/sdk/cli-contracts/string-lists.js +1 -16
- package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -461
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -2167
- package/dist/sdk/cli-contracts/tool-schema.d.ts +3 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1664
- package/dist/sdk/cli-contracts/typed-action-inputs.js +1 -4
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -17
- package/dist/sdk/cli-program.js +1 -49
- package/dist/sdk/command-line.d.ts +2 -5
- package/dist/sdk/command-line.js +1 -78
- package/dist/sdk/comments.js +1 -133
- package/dist/sdk/compile-cache.js +1 -73
- package/dist/sdk/completion.js +157 -837
- package/dist/sdk/compose.js +1 -1090
- package/dist/sdk/config.js +1 -1204
- package/dist/sdk/context/recency.js +1 -33
- package/dist/sdk/context/semantic-session-attribution.js +1 -82
- package/dist/sdk/context/usage-egress.js +1 -29
- package/dist/sdk/context/usage-ledger.js +3 -185
- package/dist/sdk/context-intent-contracts.js +1 -709
- package/dist/sdk/context-intent-runtime.js +1 -115
- package/dist/sdk/context-packing.js +1 -218
- package/dist/sdk/context-relevance.js +1 -503
- package/dist/sdk/context-signal-store.js +2 -426
- package/dist/sdk/context-usage.js +1 -367
- package/dist/sdk/contracts.js +1 -23
- package/dist/sdk/core-governance.js +1 -14
- package/dist/sdk/core.js +1 -14
- package/dist/sdk/corpus-shape.js +1 -401
- package/dist/sdk/define.js +1 -220
- package/dist/sdk/dependencies.js +1 -718
- package/dist/sdk/dependency-flag-validation.js +1 -156
- package/dist/sdk/dependency-provenance.js +1 -135
- package/dist/sdk/docs.js +1 -14
- package/dist/sdk/duplicates.js +1 -40
- package/dist/sdk/environment/agent-environment.js +1 -466
- package/dist/sdk/environment/host-environment-errors.js +1 -8
- package/dist/sdk/environment/project-runtime-compatibility.js +1 -481
- package/dist/sdk/environment/source-context.js +1 -28
- package/dist/sdk/environment/tracker-preflight.js +1 -9
- package/dist/sdk/error-code-catalog.js +1 -153
- package/dist/sdk/error-runtime.js +1 -58
- package/dist/sdk/errors.js +1 -58
- package/dist/sdk/eval.js +1 -190
- package/dist/sdk/extension/author-manifest.js +1 -92
- package/dist/sdk/extension/bundled-catalog.js +1 -332
- package/dist/sdk/extension/concurrency.js +1 -25
- package/dist/sdk/extension/copy-scope.d.ts +2 -0
- package/dist/sdk/extension/copy-scope.js +2 -0
- package/dist/sdk/extension/custom-field-collisions.js +1 -30
- package/dist/sdk/extension/describe.js +3 -189
- package/dist/sdk/extension/doctor.js +1 -606
- package/dist/sdk/extension/install-plan.d.ts +69 -0
- package/dist/sdk/extension/install-plan.js +2 -0
- package/dist/sdk/extension/install-receipts.d.ts +7 -0
- package/dist/sdk/extension/install-receipts.js +2 -0
- package/dist/sdk/extension/install-runtime.js +3 -313
- package/dist/sdk/extension/install-snapshot.js +1 -66
- package/dist/sdk/extension/install-sources.js +5 -1057
- package/dist/sdk/extension/managed-state.js +2 -252
- package/dist/sdk/extension/migrations.js +2 -174
- package/dist/sdk/extension/output-ownership.js +1 -25
- package/dist/sdk/extension/runtime-summary.js +1 -18
- package/dist/sdk/extension/scaffold.js +4 -2308
- package/dist/sdk/extension/shared.js +1 -147
- package/dist/sdk/extension/source-resolution.js +1 -65
- package/dist/sdk/extension/update-check.js +1 -67
- package/dist/sdk/extension-command-context.js +1 -44
- package/dist/sdk/extension-contracts.js +1 -73
- package/dist/sdk/extension.d.ts +7 -2
- package/dist/sdk/extension.js +1 -2196
- package/dist/sdk/files.js +1 -535
- package/dist/sdk/flag-invocation-contracts.d.ts +0 -5
- package/dist/sdk/flag-invocation-contracts.js +1 -344
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -2224
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -2236
- package/dist/sdk/generated-error-code-catalog.js +1 -16
- package/dist/sdk/governance/assurance-action-contracts.js +1 -4
- package/dist/sdk/governance/assurance-action.js +1 -411
- package/dist/sdk/governance/assurance-limits.js +1 -10
- package/dist/sdk/governance/assurance-mutation-error.js +1 -81
- package/dist/sdk/governance/assurance-presets.js +1 -135
- package/dist/sdk/governance/assurance-runtime.js +1 -238
- package/dist/sdk/governance/assurance.js +4 -1182
- package/dist/sdk/governance/boundary-fixtures.js +1 -200
- package/dist/sdk/governance/coverage-assurance.js +1 -60
- package/dist/sdk/governance/defect-recurrence-coverage.js +1 -188
- package/dist/sdk/governance/defect-recurrence-graph.js +1 -120
- package/dist/sdk/governance/defect-recurrence-signals.js +1 -24
- package/dist/sdk/governance/defect-recurrence.js +1 -623
- package/dist/sdk/governance/extension-host-version.js +1 -115
- package/dist/sdk/governance/gc.js +1 -368
- package/dist/sdk/governance/health.js +1 -2367
- package/dist/sdk/governance/hierarchy-validation.js +1 -108
- package/dist/sdk/governance/linked-file-report.js +1 -71
- package/dist/sdk/governance/merge-receipt-history.js +1 -206
- package/dist/sdk/governance/provenance-health.js +1 -282
- package/dist/sdk/governance/reindex.js +4 -761
- package/dist/sdk/governance/stale-work.js +1 -82
- package/dist/sdk/governance/status-role-diagnostics.js +1 -35
- package/dist/sdk/governance/storage-integrity.js +1 -280
- package/dist/sdk/governance/tracked-runtime-cache.js +1 -106
- package/dist/sdk/governance/upgrade.js +2 -327
- package/dist/sdk/governance/validate-history-drift.js +1 -81
- package/dist/sdk/governance/validate-item-reader.js +1 -17
- package/dist/sdk/governance/validate-normalization.js +1 -36
- package/dist/sdk/governance/validate.js +1 -2261
- package/dist/sdk/governance/workspace-position.js +1 -163
- package/dist/sdk/governance.d.ts +1 -0
- package/dist/sdk/governance.js +1 -31
- package/dist/sdk/graph/adapter.js +1 -181
- package/dist/sdk/graph/analytics.js +1 -474
- package/dist/sdk/graph/assembly.js +1 -377
- package/dist/sdk/graph/cache.js +1 -160
- package/dist/sdk/graph/centrality.js +1 -258
- package/dist/sdk/graph/conformance.js +1 -130
- package/dist/sdk/graph/deadline-scheduling.d.ts +90 -0
- package/dist/sdk/graph/deadline-scheduling.js +2 -0
- package/dist/sdk/graph/durable-cache.d.ts +1 -1
- package/dist/sdk/graph/durable-cache.js +1 -361
- package/dist/sdk/graph/governance-contracts.js +1 -34
- package/dist/sdk/graph/governance.d.ts +13 -1
- package/dist/sdk/graph/governance.js +1 -735
- package/dist/sdk/graph/hierarchy-integrity.js +1 -310
- package/dist/sdk/graph/index.d.ts +3 -2
- package/dist/sdk/graph/index.js +1 -26
- package/dist/sdk/graph/lifecycle-coverage.d.ts +32 -0
- package/dist/sdk/graph/lifecycle-coverage.js +2 -0
- package/dist/sdk/graph/mutation-advisory.js +1 -176
- package/dist/sdk/graph/remediation.js +1 -197
- package/dist/sdk/graph/run.d.ts +15 -1
- package/dist/sdk/graph/run.js +1 -768
- package/dist/sdk/graph/scheduling.js +1 -124
- package/dist/sdk/graph/traversal.js +1 -284
- package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -27
- package/dist/sdk/graph.js +1 -15
- package/dist/sdk/guide-topics.js +1 -707
- package/dist/sdk/guide.js +1 -279
- package/dist/sdk/history/maintenance.d.ts +71 -0
- package/dist/sdk/history/maintenance.js +2 -0
- package/dist/sdk/history/salvage.js +2 -247
- package/dist/sdk/history/subject.d.ts +19 -0
- package/dist/sdk/history/subject.js +2 -0
- package/dist/sdk/history-analytics.js +1 -282
- package/dist/sdk/history-compact.js +1 -527
- package/dist/sdk/history-mcp.js +1 -68
- package/dist/sdk/history-provenance.js +1 -182
- package/dist/sdk/history-read.js +1 -96
- package/dist/sdk/history-redact.d.ts +1 -14
- package/dist/sdk/history-redact.js +1 -643
- package/dist/sdk/history-repair.d.ts +5 -0
- package/dist/sdk/history-repair.js +1 -657
- package/dist/sdk/improvement-ledger-validation.js +1 -62
- package/dist/sdk/improvement-ledger.js +2 -257
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/index.js +1 -183
- package/dist/sdk/init-agent-guidance.js +2 -496
- package/dist/sdk/init.js +2 -820
- package/dist/sdk/invocation-author.js +1 -39
- package/dist/sdk/item-children.js +1 -90
- package/dist/sdk/item-metadata-index.js +1 -15
- package/dist/sdk/item-schedule.js +1 -27
- package/dist/sdk/item-transaction.js +1 -396
- package/dist/sdk/learnings.js +1 -29
- package/dist/sdk/lifecycle/append.js +2 -53
- package/dist/sdk/lifecycle/claim.d.ts +2 -0
- package/dist/sdk/lifecycle/claim.js +1 -242
- package/dist/sdk/lifecycle/close-many.js +1 -438
- package/dist/sdk/lifecycle/close.js +1 -468
- package/dist/sdk/lifecycle/copy.js +1 -212
- package/dist/sdk/lifecycle/create.js +1 -1949
- package/dist/sdk/lifecycle/delete.js +1 -45
- package/dist/sdk/lifecycle/event-validation-messages.js +1 -91
- package/dist/sdk/lifecycle/focus.js +1 -91
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -24
- package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -149
- package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -40
- package/dist/sdk/lifecycle/mcp-actions.d.ts +2 -0
- package/dist/sdk/lifecycle/mcp-actions.js +1 -51
- package/dist/sdk/lifecycle/metadata-normalizers.js +1 -46
- package/dist/sdk/lifecycle/mutation-command-options.js +1 -9
- package/dist/sdk/lifecycle/plan.js +1 -1606
- package/dist/sdk/lifecycle/recurrence-parsers.js +1 -147
- package/dist/sdk/lifecycle/reopen.js +1 -68
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +1 -143
- package/dist/sdk/lifecycle/restore.d.ts +1 -0
- package/dist/sdk/lifecycle/restore.js +1 -330
- package/dist/sdk/lifecycle/shared-unset-fields.js +1 -295
- package/dist/sdk/lifecycle/update-many.js +1 -861
- package/dist/sdk/lifecycle/update.js +1 -2136
- package/dist/sdk/lifecycle-completion.js +1 -92
- package/dist/sdk/lifecycle-policy.js +1 -120
- package/dist/sdk/linked-artifacts.js +1 -530
- package/dist/sdk/mcp/apps.js +4 -133
- package/dist/sdk/mcp/authorization.js +1 -404
- package/dist/sdk/mcp/discovery.js +1 -494
- package/dist/sdk/mcp/interactions.js +1 -336
- package/dist/sdk/mcp/protocol.d.ts +7 -0
- package/dist/sdk/mcp/protocol.js +1 -184
- package/dist/sdk/mcp/skills.js +1 -389
- package/dist/sdk/mcp/subscriptions.js +1 -211
- package/dist/sdk/mcp/tasks.js +2 -430
- package/dist/sdk/mcp/transport.js +1 -260
- package/dist/sdk/merge/abandoned-receipts.js +1 -46
- package/dist/sdk/merge/driver.js +1 -212
- package/dist/sdk/merge/index.js +1 -16
- package/dist/sdk/merge/install.js +3 -561
- package/dist/sdk/merge/receipt-file-boundary.js +1 -46
- package/dist/sdk/merge/receipt-operation.js +1 -96
- package/dist/sdk/merge/receipt-schema.js +1 -397
- package/dist/sdk/merge/receipts.js +4 -525
- package/dist/sdk/merge/reconcile.js +1 -352
- package/dist/sdk/merge/three-way.js +3 -775
- package/dist/sdk/merge.js +1 -10
- package/dist/sdk/mutation-events.js +1 -292
- package/dist/sdk/mutation-guard.js +1 -216
- package/dist/sdk/notes.js +1 -139
- package/dist/sdk/output-contracts.js +1 -172
- package/dist/sdk/output-projection.js +1 -430
- package/dist/sdk/output-token-accounting.js +1 -140
- package/dist/sdk/output.js +1 -64
- package/dist/sdk/ownership-source.js +1 -21
- package/dist/sdk/package-import-adapters.js +1 -442
- package/dist/sdk/package-migrations.js +1 -20
- package/dist/sdk/package-runtime-options.js +1 -80
- package/dist/sdk/pagination.js +1 -162
- package/dist/sdk/profile.js +1 -454
- package/dist/sdk/provenance.js +1 -258
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.js +1 -401
- package/dist/sdk/query/aggregate.d.ts +16 -0
- package/dist/sdk/query/aggregate.js +1 -390
- package/dist/sdk/query/calendar.js +1 -964
- package/dist/sdk/query/complete-list.js +1 -215
- package/dist/sdk/query/context.js +1 -1702
- package/dist/sdk/query/duplicate-candidates.js +1 -70
- package/dist/sdk/query/get.js +1 -450
- package/dist/sdk/query/history.js +1 -186
- package/dist/sdk/query/item-filter-options.js +1 -9
- package/dist/sdk/query/light-metadata.js +1 -18
- package/dist/sdk/query/list-filter-shared.js +1 -81
- package/dist/sdk/query/list.js +1 -1304
- package/dist/sdk/query/multi-value-filters.js +1 -78
- package/dist/sdk/query/next.js +1 -513
- package/dist/sdk/query/parsers.js +1 -44
- package/dist/sdk/query/projection-contracts.js +1 -184
- package/dist/sdk/query/search-contracts.js +1 -230
- package/dist/sdk/query/search-pagination.js +1 -35
- package/dist/sdk/query/search-rendering.js +1 -105
- package/dist/sdk/query/search.js +2 -1987
- package/dist/sdk/query.js +1 -35
- package/dist/sdk/read-output/continuation.js +1 -194
- package/dist/sdk/read-output-budget.js +1 -135
- package/dist/sdk/read-output-contracts.js +1 -1225
- package/dist/sdk/read-output-rows.js +1 -186
- package/dist/sdk/read-output-session.js +1 -208
- package/dist/sdk/relationship-analytics.js +1 -410
- package/dist/sdk/relationship-context.js +1 -284
- package/dist/sdk/relationship-history.js +4 -519
- package/dist/sdk/relationship-kinds/contract.js +1 -22
- package/dist/sdk/relationship-migration.js +1 -77
- package/dist/sdk/relationships.js +1 -579
- package/dist/sdk/reproducibility/process.js +1 -87
- package/dist/sdk/runtime-action-aliases.js +1 -59
- package/dist/sdk/runtime-extended-actions.js +1 -177
- package/dist/sdk/runtime-input.js +1 -614
- package/dist/sdk/runtime-primitives.js +1 -84
- package/dist/sdk/runtime-public-contracts.js +1 -4
- package/dist/sdk/runtime-stats-options.js +1 -38
- package/dist/sdk/runtime.js +1 -1928
- package/dist/sdk/scheduling-shortcuts.js +1 -63
- package/dist/sdk/schema-migration.js +3 -856
- package/dist/sdk/schema.js +1 -1376
- package/dist/sdk/search-refresh-worker.js +1 -18
- package/dist/sdk/similarity-scoring.js +1 -53
- package/dist/sdk/similarity.js +1 -326
- package/dist/sdk/start-task-status.js +1 -14
- package/dist/sdk/stats.js +1 -270
- package/dist/sdk/structured-mutations.js +1 -580
- package/dist/sdk/telemetry-flush.js +1 -13
- package/dist/sdk/telemetry.js +1 -405
- package/dist/sdk/templates.js +2 -292
- package/dist/sdk/test/batch.js +2 -509
- package/dist/sdk/test/entry.js +1 -70
- package/dist/sdk/test/execution.js +6 -2211
- package/dist/sdk/test/linked-command-detection.js +1 -546
- package/dist/sdk/test/measurements.js +1 -91
- package/dist/sdk/test/parsers.js +1 -545
- package/dist/sdk/test/runs.js +1 -193
- package/dist/sdk/test/trust.js +2 -206
- package/dist/sdk/testing.js +4 -1391
- package/dist/sdk/traceability/runtime-files-lookup.js +1 -32
- package/dist/sdk/traceability/source-traceability.js +1 -292
- package/dist/sdk/tracker-root-discovery.js +1 -9
- package/dist/sdk/workspace-contracts-cache.js +1 -28
- package/dist/sdk/workspace-contracts.js +1 -33
- package/dist/sdk/workspace-memory.js +2 -318
- package/dist/sdk/workspace-recipe.js +1 -71
- package/dist/sdk/workspace-snapshot.js +4 -613
- package/dist/sdk/workspace-transaction-gc.js +1 -149
- package/dist/sdk/workspace-transaction.js +2 -363
- package/dist/sdk/workspace.js +3 -127
- package/dist/types/index.js +1 -9
- package/dist/types.js +1 -245
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/CONTEXT_ALGORITHM_PORTFOLIO.md +167 -0
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +9 -3
- package/docs/EXTENSIONS.md +1 -0
- package/docs/HISTORY_MAINTENANCE.md +125 -0
- package/docs/MCP_2026_07_28_CONFORMANCE.md +20 -10
- package/docs/PACKAGE_EVIDENCE.md +92 -0
- package/docs/PLANNING_MEASUREMENTS.md +183 -0
- package/docs/README.md +3 -0
- package/docs/RELEASING.md +1 -0
- package/docs/SCRIPTING.md +21 -0
- package/docs/TESTING.md +23 -0
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +5 -5
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +2 -2
- package/marketplace.json +2 -2
- package/package.json +1 -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-codex/.codex-plugin/plugin.json +1 -1
- package/scripts/finalize-build.mjs +45 -3
- package/dist/cli-bundle/chunks/chunk-AZDFJGH6.js +0 -9
- package/dist/cli-bundle/chunks/chunk-BAX2BYUW.js +0 -2111
- package/dist/cli-bundle/chunks/chunk-CKOL5U7J.js +0 -77
- package/dist/cli-bundle/chunks/chunk-OF76PSDQ.js +0 -5
- package/dist/cli-bundle/chunks/chunk-QUWFABDM.js +0 -232
- package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-RWWBOWJ5.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WGAOYSYH.js +0 -40
- package/dist/cli-bundle/chunks/chunk-WI2AYPA7.js +0 -2
- package/dist/cli-bundle/chunks/register-list-query-5JL52D33.js +0 -11
- package/dist/cli-bundle/chunks/register-mutation-ZPG7KMVP.js +0 -20
- package/dist/cli-bundle/chunks/register-setup-H4SVAVX7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-AL5ON6K6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CHC2IDXA.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-CK6QFAPZ.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-EZR3GHFE.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-H2WJWK7L.js +0 -56
- package/dist/cli-bundle/focused-chunks/chunk-NTPY5GSO.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-P5O7MP5Y.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PDMW2E36.js +0 -177
- package/dist/cli-bundle/focused-chunks/chunk-QTVCLMSZ.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-QTZRBUYA.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-SGQST3PQ.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-UKHASMMP.js +0 -10
- package/dist/cli-bundle/focused-chunks/chunk-ZPEKQHOC.js +0 -2
package/dist/sdk/completion.js
CHANGED
|
@@ -1,415 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
* Implements the pm completion command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4bf2b42b-91f3-5850-b1f1-d8a01525860c")}catch(e){}}();
|
|
8
|
-
import { EXIT_CODE, PmCliError } from "./runtime-primitives.js";
|
|
9
|
-
import { listPmCommandsForTier } from "./agent-capability-contracts.js";
|
|
10
|
-
import { SCAFFOLD_CAPABILITIES } from "./extension/scaffold.js";
|
|
11
|
-
import { AGGREGATE_FLAG_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, CREATE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, PM_COMMAND_ALIAS_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PLAN_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, toCompletionFlagString, } from "./cli-contracts.js";
|
|
12
|
-
import { BUILTIN_ITEM_TYPE_VALUES, STATUS_VALUES } from "../types/index.js";
|
|
13
|
-
import { listGuideTopicIds } from "./guide-topics.js";
|
|
14
|
-
const VALID_SHELLS = ["bash", "zsh", "fish"];
|
|
15
|
-
const DEFAULT_ITEM_TYPES = [...BUILTIN_ITEM_TYPE_VALUES];
|
|
16
|
-
const DEFAULT_STATUS_VALUES = [...STATUS_VALUES];
|
|
17
|
-
const HIDDEN_COMMAND_ALIASES = new Set(PM_COMMAND_ALIAS_CONTRACTS.filter((contract) => contract.hidden).map((contract) => contract.alias));
|
|
18
|
-
const ALL_COMMANDS = listPmCommandsForTier("full").filter((command) => !HIDDEN_COMMAND_ALIASES.has(command));
|
|
19
|
-
const LIST_FLAGS = toCompletionFlagString(LIST_FILTER_FLAG_CONTRACTS);
|
|
20
|
-
const AGGREGATE_FLAGS = toCompletionFlagString(AGGREGATE_FLAG_CONTRACTS);
|
|
21
|
-
const APPEND_FLAGS = toCompletionFlagString(APPEND_FLAG_CONTRACTS);
|
|
22
|
-
const COPY_FLAGS = toCompletionFlagString(COPY_FLAG_CONTRACTS);
|
|
23
|
-
const FOCUS_FLAGS = toCompletionFlagString(FOCUS_FLAG_CONTRACTS);
|
|
24
|
-
const MEET_FLAGS = toCompletionFlagString(MEET_FLAG_CONTRACTS);
|
|
25
|
-
const REMIND_FLAGS = toCompletionFlagString(REMIND_FLAG_CONTRACTS);
|
|
26
|
-
const CREATE_FLAGS = toCompletionFlagString(CREATE_FLAG_CONTRACTS);
|
|
27
|
-
const GET_FLAGS = toCompletionFlagString(GET_FLAG_CONTRACTS);
|
|
28
|
-
const UPDATE_FLAGS = toCompletionFlagString(UPDATE_FLAG_CONTRACTS);
|
|
29
|
-
const UPDATE_MANY_FLAGS = toCompletionFlagString(UPDATE_MANY_FLAG_CONTRACTS);
|
|
30
|
-
const CLOSE_MANY_FLAGS = toCompletionFlagString(CLOSE_MANY_FLAG_CONTRACTS);
|
|
31
|
-
const ACTIVITY_FLAGS = toCompletionFlagString(ACTIVITY_FLAG_CONTRACTS);
|
|
32
|
-
const HISTORY_FLAGS = toCompletionFlagString(HISTORY_FLAG_CONTRACTS);
|
|
33
|
-
const HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS = toCompletionFlagString(HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, false);
|
|
34
|
-
const EVENTS_FLAGS = toCompletionFlagString(EVENTS_FLAG_CONTRACTS);
|
|
35
|
-
const CALENDAR_FLAGS = toCompletionFlagString(CALENDAR_FLAG_CONTRACTS);
|
|
36
|
-
const CONTEXT_FLAGS = toCompletionFlagString(CONTEXT_FLAG_CONTRACTS);
|
|
37
|
-
const NEXT_FLAGS = toCompletionFlagString(NEXT_FLAG_CONTRACTS);
|
|
38
|
-
const DEPS_FLAGS = toCompletionFlagString(DEPS_FLAG_CONTRACTS);
|
|
39
|
-
const DUPLICATES_FLAGS = toCompletionFlagString(DUPLICATES_FLAG_CONTRACTS);
|
|
40
|
-
const GRAPH_FLAGS = toCompletionFlagString(GRAPH_FLAG_CONTRACTS);
|
|
41
|
-
const GUIDE_FLAGS = toCompletionFlagString(GUIDE_FLAG_CONTRACTS);
|
|
42
|
-
const SEARCH_FLAGS = toCompletionFlagString(SEARCH_FLAG_CONTRACTS);
|
|
43
|
-
const STATS_FLAGS = toCompletionFlagString(STATS_FLAG_CONTRACTS);
|
|
44
|
-
const HEALTH_FLAGS = toCompletionFlagString(HEALTH_FLAG_CONTRACTS);
|
|
45
|
-
const INIT_FLAGS = toCompletionFlagString(INIT_FLAG_CONTRACTS);
|
|
46
|
-
const CONTRACTS_FLAGS = toCompletionFlagString(CONTRACTS_FLAG_CONTRACTS);
|
|
47
|
-
const PLAN_FLAGS = toCompletionFlagString(PLAN_FLAG_CONTRACTS);
|
|
48
|
-
const PLAN_SUBCOMMANDS_LIST = "create show add-step update-step complete-step block-step reorder-step remove-step link unlink decision discovery validation resume approve materialize";
|
|
49
|
-
const COMPLETION_FLAGS = toCompletionFlagString(COMPLETION_FLAG_CONTRACTS);
|
|
50
|
-
const COMPLETION_SHELL_CHOICES = `${COMPLETION_FLAGS} bash zsh fish`;
|
|
51
|
-
const GUIDE_TOPIC_CHOICES = joinCompletionValues(listGuideTopicIds());
|
|
52
|
-
const EXTENSION_LIFECYCLE_ACTIONS = "init scaffold install uninstall explore manage describe reload doctor catalog adopt adopt-all activate deactivate migrate";
|
|
53
|
-
const PACKAGE_LIFECYCLE_ACTIONS = `${EXTENSION_LIFECYCLE_ACTIONS} upgrade`;
|
|
54
|
-
const EXTENSION_LIFECYCLE_FLAGS = toCompletionFlagString(EXTENSION_FLAG_CONTRACTS);
|
|
55
|
-
const PACKAGE_LIFECYCLE_FLAGS = toCompletionFlagString(PACKAGE_FLAG_CONTRACTS);
|
|
56
|
-
const UPGRADE_FLAGS = toCompletionFlagString(UPGRADE_FLAG_CONTRACTS);
|
|
57
|
-
const MUTATION_FLAGS = "--author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";
|
|
58
|
-
const DELETE_MUTATION_FLAGS = "--dry-run --author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";
|
|
59
|
-
const CLOSE_MUTATION_FLAGS = "--author --message --validate-close --duplicate-of --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";
|
|
60
|
-
const RELEASE_MUTATION_FLAGS = "--author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";
|
|
61
|
-
const COMMAND_COMPLETION_DESCRIPTIONS = [
|
|
62
|
-
["init", "Initialize pm storage for the current workspace"],
|
|
63
|
-
["config", "Read or update pm settings"],
|
|
64
|
-
["package", "Manage package lifecycle operations"],
|
|
65
|
-
["packages", "Alias for package"],
|
|
66
|
-
["create", "Create a new project management item"],
|
|
67
|
-
["copy", "Copy an existing item to a new ID"],
|
|
68
|
-
["focus", "Set/clear/show the session focused parent for new items"],
|
|
69
|
-
["list", "List active items with optional filters"],
|
|
70
|
-
[
|
|
71
|
-
"aggregate",
|
|
72
|
-
"Aggregate grouped item counts and numeric stats for governance queries",
|
|
73
|
-
],
|
|
74
|
-
["duplicates", "Find bounded duplicate clusters across lifecycle statuses"],
|
|
75
|
-
["guide", "Browse local progressive-disclosure guides"],
|
|
76
|
-
["calendar", "Show calendar views for deadlines and reminders"],
|
|
77
|
-
["cal", "Alias for calendar"],
|
|
78
|
-
["context", "Show a token-efficient project context snapshot"],
|
|
79
|
-
["ctx", "Alias for context"],
|
|
80
|
-
["get", "Show item details by ID"],
|
|
81
|
-
["next", "Recommend the next actionable (unblocked, ready) work item"],
|
|
82
|
-
["search", "Search items with keyword, semantic, or hybrid modes"],
|
|
83
|
-
["reindex", "Rebuild search artifacts"],
|
|
84
|
-
["history", "Show item history entries"],
|
|
85
|
-
[
|
|
86
|
-
"history-compact",
|
|
87
|
-
"Compact history streams into a synthetic baseline + retained tail",
|
|
88
|
-
],
|
|
89
|
-
[
|
|
90
|
-
"history-redact",
|
|
91
|
-
"Redact sensitive literals/patterns and recompute history hashes",
|
|
92
|
-
],
|
|
93
|
-
[
|
|
94
|
-
"history-repair",
|
|
95
|
-
"Re-anchor a drifted history chain so pm health/validate report ok",
|
|
96
|
-
],
|
|
97
|
-
[
|
|
98
|
-
"schema",
|
|
99
|
-
"Manage custom item types and statuses in .agents/pm/schema/*.json",
|
|
100
|
-
],
|
|
101
|
-
[
|
|
102
|
-
"profile",
|
|
103
|
-
"List, show, apply, and lint project profiles (archetype schema/config/template/package bundles)",
|
|
104
|
-
],
|
|
105
|
-
[
|
|
106
|
-
"plan",
|
|
107
|
-
"Agent-optimized Plan item workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)",
|
|
108
|
-
],
|
|
109
|
-
["activity", "Show recent activity across items"],
|
|
110
|
-
["restore", "Restore an item to an earlier state"],
|
|
111
|
-
["update", "Update item fields and metadata"],
|
|
112
|
-
[
|
|
113
|
-
"update-many",
|
|
114
|
-
"Bulk-update matched items with dry-run and rollback checkpoints",
|
|
115
|
-
],
|
|
116
|
-
["close", "Close an item (reason requirement follows governance settings)"],
|
|
117
|
-
[
|
|
118
|
-
"close-many",
|
|
119
|
-
"Bulk-close matched items with an optional shared reason and rollback checkpoint",
|
|
120
|
-
],
|
|
121
|
-
["delete", "Delete an item and record the change"],
|
|
122
|
-
["append", "Append text to an item body"],
|
|
123
|
-
["comments", "List or add comments for an item"],
|
|
124
|
-
["notes", "List or add notes for an item"],
|
|
125
|
-
["learnings", "List or add learnings for an item"],
|
|
126
|
-
["files", "Manage linked files"],
|
|
127
|
-
["docs", "Manage linked docs"],
|
|
128
|
-
["deps", "Show dependency relationships for an item"],
|
|
129
|
-
["graph", "Bounded graph traversal, analytics, and governance-audit queries"],
|
|
130
|
-
["test", "Manage linked tests and optionally run them"],
|
|
131
|
-
["test-all", "Run linked tests across matching items"],
|
|
132
|
-
["test-runs", "Manage background linked-test runs"],
|
|
133
|
-
["stats", "Show project tracker statistics"],
|
|
134
|
-
["health", "Show project tracker health checks"],
|
|
135
|
-
["validate", "Run standalone validation checks"],
|
|
136
|
-
["gc", "Clean optional cache artifacts"],
|
|
137
|
-
["contracts", "Show machine-readable command and schema contracts"],
|
|
138
|
-
["claim", "Claim an item for active work"],
|
|
139
|
-
["release", "Release the active claim for an item"],
|
|
140
|
-
["start-task", "Lifecycle alias to claim and set in_progress"],
|
|
141
|
-
["pause-task", "Lifecycle alias to reopen and release claim"],
|
|
142
|
-
["close-task", "Lifecycle alias to close and release claim"],
|
|
143
|
-
["meet", "Shortcut to create a Meeting with scheduling defaults"],
|
|
144
|
-
["event", "Shortcut to create an Event with scheduling defaults"],
|
|
145
|
-
["remind", "Shortcut to create a Reminder from a point in time"],
|
|
146
|
-
["templates", "Manage reusable create templates"],
|
|
147
|
-
["completion", "Generate shell completion"],
|
|
148
|
-
["help", "Display help for a command"],
|
|
149
|
-
];
|
|
150
|
-
const FISH_COMMAND_DESCRIPTION_OVERRIDES = new Map([
|
|
151
|
-
["calendar", "Show deadline/reminder calendar views"],
|
|
152
|
-
["schema", "Inspect and manage runtime schema"],
|
|
153
|
-
[
|
|
154
|
-
"profile",
|
|
155
|
-
"List, show, apply, and lint project profiles (archetype bundles)",
|
|
156
|
-
],
|
|
157
|
-
[
|
|
158
|
-
"plan",
|
|
159
|
-
"Agent-optimized Plan workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)",
|
|
160
|
-
],
|
|
161
|
-
["start-task", "Lifecycle alias to claim and set in-progress"],
|
|
162
|
-
]);
|
|
163
|
-
const GLOBAL_FLAGS = GLOBAL_FLAG_CONTRACTS.flatMap((entry) => [
|
|
164
|
-
entry.short,
|
|
165
|
-
entry.flag,
|
|
166
|
-
...(entry.aliases ?? []),
|
|
167
|
-
])
|
|
168
|
-
.filter((value) => Boolean(value))
|
|
169
|
-
.join(" ");
|
|
170
|
-
function joinCompletionValues(values) {
|
|
171
|
-
return [
|
|
172
|
-
...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0)),
|
|
173
|
-
]
|
|
174
|
-
.sort((left, right) => left.localeCompare(right))
|
|
175
|
-
.join(" ");
|
|
176
|
-
}
|
|
177
|
-
function joinCompletionValuesInOrder(values) {
|
|
178
|
-
return [
|
|
179
|
-
...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0)),
|
|
180
|
-
].join(" ");
|
|
181
|
-
}
|
|
182
|
-
function shellDoubleQuote(value) {
|
|
183
|
-
return value
|
|
184
|
-
.replaceAll("\\", "\\\\")
|
|
185
|
-
.replaceAll('"', '\\"')
|
|
186
|
-
.replaceAll("$", "\\$")
|
|
187
|
-
.replaceAll("`", "\\`");
|
|
188
|
-
}
|
|
189
|
-
function completionTypeValues(itemTypes, runtime) {
|
|
190
|
-
return joinCompletionValuesInOrder(itemTypes.length > 0
|
|
191
|
-
? itemTypes
|
|
192
|
-
: (runtime.item_types ?? DEFAULT_ITEM_TYPES));
|
|
193
|
-
}
|
|
194
|
-
function completionStatusValues(runtime) {
|
|
195
|
-
return joinCompletionValues(runtime.statuses ?? DEFAULT_STATUS_VALUES);
|
|
196
|
-
}
|
|
197
|
-
function mergeFlagStrings(baseFlags, runtimeFlags) {
|
|
198
|
-
const merged = [
|
|
199
|
-
...baseFlags.split(/\s+/u).filter((value) => value.length > 0),
|
|
200
|
-
...(runtimeFlags ?? []),
|
|
201
|
-
];
|
|
202
|
-
return joinCompletionValues(merged);
|
|
203
|
-
}
|
|
204
|
-
function normalizeRuntimeCompletionFlags(runtimeFlags) {
|
|
205
|
-
const normalized = (runtimeFlags ?? [])
|
|
206
|
-
.map((value) => value.trim())
|
|
207
|
-
.filter((value) => value.startsWith("--") && value.length > 2)
|
|
208
|
-
.map((value) => `--${value.slice(2).replaceAll("_", "-")}`);
|
|
209
|
-
return [...new Set(normalized)].sort((left, right) => left.localeCompare(right));
|
|
210
|
-
}
|
|
211
|
-
function renderZshRuntimeFieldFlagSpecs(runtimeFlags) {
|
|
212
|
-
const normalized = normalizeRuntimeCompletionFlags(runtimeFlags);
|
|
213
|
-
if (normalized.length === 0) {
|
|
214
|
-
return "";
|
|
215
|
-
}
|
|
216
|
-
return `${normalized.map((flag) => ` '${flag}[Runtime schema field flag]:value' \\`).join("\n")}\n`;
|
|
217
|
-
}
|
|
218
|
-
function renderZshArgumentSpecs(specs, options = {}) {
|
|
219
|
-
const trailingContinuation = options.trailingContinuation ?? true;
|
|
220
|
-
const lastSpecIndex = specs.length - 1;
|
|
221
|
-
return specs
|
|
222
|
-
.map((spec, index) => ` ${spec}${trailingContinuation || index !== lastSpecIndex ? " \\" : ""}`)
|
|
223
|
-
.join("\n");
|
|
224
|
-
}
|
|
225
|
-
function renderZshCommandDescriptions() {
|
|
226
|
-
return COMMAND_COMPLETION_DESCRIPTIONS.map(([command, description]) => ` '${command}:${description}'`).join("\n");
|
|
227
|
-
}
|
|
228
|
-
function renderFishCommandDescriptions() {
|
|
229
|
-
return COMMAND_COMPLETION_DESCRIPTIONS.filter(([command]) => command !== "help")
|
|
230
|
-
.map(([command, description]) => {
|
|
231
|
-
const fishDescription = FISH_COMMAND_DESCRIPTION_OVERRIDES.get(command) ?? description;
|
|
232
|
-
return `complete -c pm -n __pm_no_subcommand -a ${command.padEnd(16)} -d '${fishDescription}'`;
|
|
233
|
-
})
|
|
234
|
-
.join("\n");
|
|
235
|
-
}
|
|
236
|
-
function renderZshPresenceFilterSpecs(options) {
|
|
237
|
-
const missingSpecs = [
|
|
238
|
-
"reviewer-missing[Select only items missing reviewer]",
|
|
239
|
-
"risk-missing[Select only items missing risk]",
|
|
240
|
-
"confidence-missing[Select only items missing confidence]",
|
|
241
|
-
"sprint-missing[Select only items missing sprint]",
|
|
242
|
-
"release-missing[Select only items missing release]",
|
|
243
|
-
];
|
|
244
|
-
const contentMissingAliasSpecs = options.includeContentMissingAliases === true
|
|
245
|
-
? [
|
|
246
|
-
"files-missing[Alias for --no-files]",
|
|
247
|
-
"docs-missing[Alias for --no-docs]",
|
|
248
|
-
]
|
|
249
|
-
: [];
|
|
250
|
-
const pairedSpecs = [
|
|
251
|
-
[
|
|
252
|
-
"has-notes[Select only items that have notes]",
|
|
253
|
-
"no-notes[Select only items with no notes]",
|
|
254
|
-
],
|
|
255
|
-
[
|
|
256
|
-
"has-learnings[Select only items that have learnings]",
|
|
257
|
-
"no-learnings[Select only items with no learnings]",
|
|
258
|
-
],
|
|
259
|
-
[
|
|
260
|
-
"has-files[Select only items that have linked files]",
|
|
261
|
-
"no-files[Select only items with no linked files]",
|
|
262
|
-
],
|
|
263
|
-
[
|
|
264
|
-
"has-docs[Select only items that have linked docs]",
|
|
265
|
-
"no-docs[Select only items with no linked docs]",
|
|
266
|
-
],
|
|
267
|
-
[
|
|
268
|
-
"has-tests[Select only items that have linked tests]",
|
|
269
|
-
"no-tests[Select only items with no linked tests]",
|
|
270
|
-
],
|
|
271
|
-
[
|
|
272
|
-
"has-comments[Select only items that have comments]",
|
|
273
|
-
"no-comments[Select only items with no comments]",
|
|
274
|
-
],
|
|
275
|
-
[
|
|
276
|
-
"has-deps[Select only items that have dependencies]",
|
|
277
|
-
"no-deps[Select only items with no dependencies]",
|
|
278
|
-
],
|
|
279
|
-
[
|
|
280
|
-
"has-body[Select only items with non-empty body]",
|
|
281
|
-
"empty-body[Select only items with empty body]",
|
|
282
|
-
],
|
|
283
|
-
[
|
|
284
|
-
"has-linked-command[Select only items that have a linked command]",
|
|
285
|
-
"no-linked-command[Select only items with no linked command]",
|
|
286
|
-
],
|
|
287
|
-
];
|
|
288
|
-
return renderZshArgumentSpecs([
|
|
289
|
-
...[...missingSpecs, ...contentMissingAliasSpecs].map((spec) => `'--${options.missingPrefix}${spec}'`),
|
|
290
|
-
...pairedSpecs.flatMap(([positive, negative]) => [
|
|
291
|
-
`'--${options.pairedPrefix}${positive}'`,
|
|
292
|
-
`'--${options.pairedPrefix}${negative}'`,
|
|
293
|
-
]),
|
|
294
|
-
]);
|
|
295
|
-
}
|
|
296
|
-
const ZSH_MUTATION_COLLECTION_ARGUMENT_SPECS = [
|
|
297
|
-
"'--comment[Comment seed author=<value>,created_at=<iso|now>,text=<value>]:comment'",
|
|
298
|
-
"'--note[Note seed author=<value>,created_at=<iso|now>,text=<value>]:note'",
|
|
299
|
-
"'--learning[Learning seed author=<value>,created_at=<iso|now>,text=<value>]:learning'",
|
|
300
|
-
"'--file[Linked file path=<value>,scope=<project|global>,note=<text>]:file'",
|
|
301
|
-
"'--test[Linked test command=<value>,path=<value>,scope=<project|global>]:test'",
|
|
302
|
-
"'--doc[Linked doc path=<value>,scope=<project|global>,note=<text>]:doc'",
|
|
303
|
-
"'--reminder[Reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>]:reminder'",
|
|
304
|
-
"'--event[Event entry start=<iso|relative>,end=<iso|relative>,recur_*]:event'",
|
|
305
|
-
"'--type-option[Type option key=value or key=<name>,value=<value>]:type_option'",
|
|
306
|
-
"'--unset[Clear scalar metadata field by name]:field'",
|
|
307
|
-
"'--replace-files[Atomically replace linked files with provided --file values]'",
|
|
308
|
-
"'--replace-docs[Atomically replace linked docs with provided --doc values]'",
|
|
309
|
-
"'--clear-deps[Clear dependency entries]'",
|
|
310
|
-
"'--clear-comments[Clear comments]'",
|
|
311
|
-
"'--clear-notes[Clear notes]'",
|
|
312
|
-
"'--clear-learnings[Clear learnings]'",
|
|
313
|
-
"'--clear-files[Clear linked files]'",
|
|
314
|
-
"'--clear-tests[Clear linked tests]'",
|
|
315
|
-
"'--clear-docs[Clear linked docs]'",
|
|
316
|
-
"'--clear-reminders[Clear reminders]'",
|
|
317
|
-
"'--clear-events[Clear events]'",
|
|
318
|
-
"'--clear-type-options[Clear type options]'",
|
|
319
|
-
];
|
|
320
|
-
function renderZshScheduleItemSpecs(kind) {
|
|
321
|
-
const leadingSpecs = kind === "reminder"
|
|
322
|
-
? [
|
|
323
|
-
"'--at[Reminder time (default +1d)]:at'",
|
|
324
|
-
"'--text[Reminder text (defaults to title)]:text'",
|
|
325
|
-
]
|
|
326
|
-
: [
|
|
327
|
-
"'--start[Start time (ISO, now, or relative)]:start'",
|
|
328
|
-
"'--duration[Duration from start (default 1h)]:duration'",
|
|
329
|
-
"'--end[End time (overrides --duration)]:end'",
|
|
330
|
-
"'--location[Location]:location'",
|
|
331
|
-
"'--timezone[IANA timezone]:timezone'",
|
|
332
|
-
"'--all-day[Mark as an all-day event]'",
|
|
333
|
-
];
|
|
334
|
-
return renderZshArgumentSpecs([
|
|
335
|
-
...leadingSpecs,
|
|
336
|
-
"'--parent[Parent item id]:parent'",
|
|
337
|
-
"'--allow-missing-parent[Permit a parent id that does not exist yet]'",
|
|
338
|
-
"'--tags[Comma-separated tags]:tags'",
|
|
339
|
-
"'(-p --priority)'{-p,--priority}'[Priority (0-4)]:(0 1 2 3 4)'",
|
|
340
|
-
"'(-b --body)'{-b,--body}'[Item body]:body'",
|
|
341
|
-
"'(-d --description)'{-d,--description}'[Short description]:description'",
|
|
342
|
-
"'--author[Mutation author]:author'",
|
|
343
|
-
"'--message[History message]:message'",
|
|
344
|
-
"'--json[Output JSON]'",
|
|
345
|
-
"'--quiet[Suppress stdout]'",
|
|
346
|
-
], { trailingContinuation: false });
|
|
347
|
-
}
|
|
348
|
-
function renderZshBulkSelectionFilterSpecs(action, statusChoices, typeChoices, tagChoices) {
|
|
349
|
-
return renderZshArgumentSpecs([
|
|
350
|
-
`'--filter-status[Filter by status before ${action}]:(${statusChoices})'`,
|
|
351
|
-
`'--filter-type[Filter by type before ${action}]:(${typeChoices})'`,
|
|
352
|
-
`'--filter-tag[Filter by tag before ${action}]:(${tagChoices})'`,
|
|
353
|
-
`'--filter-priority[Filter by priority before ${action}]:(0 1 2 3 4)'`,
|
|
354
|
-
"'--filter-deadline-before[Filter by deadline upper bound]:deadline'",
|
|
355
|
-
"'--filter-deadline-after[Filter by deadline lower bound]:deadline'",
|
|
356
|
-
"'--filter-updated-after[Filter by updated_at lower bound (ISO/relative)]:timestamp'",
|
|
357
|
-
"'--filter-updated-before[Filter by updated_at upper bound (ISO/relative)]:timestamp'",
|
|
358
|
-
"'--filter-created-after[Filter by created_at lower bound (ISO/relative)]:timestamp'",
|
|
359
|
-
"'--filter-created-before[Filter by created_at upper bound (ISO/relative)]:timestamp'",
|
|
360
|
-
`'--filter-assignee[Filter by assignee before ${action}]:assignee'`,
|
|
361
|
-
"'--filter-assignee-filter[Filter assignee presence]:(assigned unassigned)'",
|
|
362
|
-
"'--filter-parent[Filter by parent item ID]:parent'",
|
|
363
|
-
"'--filter-sprint[Filter by sprint]:sprint'",
|
|
364
|
-
"'--filter-release[Filter by release]:release'",
|
|
365
|
-
]);
|
|
366
|
-
}
|
|
367
|
-
function renderFishRuntimeFieldFlagSpecs(commands, runtimeFlags) {
|
|
368
|
-
const normalizedFlags = normalizeRuntimeCompletionFlags(runtimeFlags).map((flag) => flag.slice(2));
|
|
369
|
-
if (commands.length === 0 || normalizedFlags.length === 0) {
|
|
370
|
-
return "";
|
|
371
|
-
}
|
|
372
|
-
const lines = [];
|
|
373
|
-
for (const command of commands) {
|
|
374
|
-
for (const flag of normalizedFlags) {
|
|
375
|
-
lines.push(`complete -c pm -n '__fish_seen_subcommand_from ${command}' -l ${flag} -d 'Runtime schema field flag' -r`);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
return `${lines.join("\n")}\n`;
|
|
379
|
-
}
|
|
380
|
-
function renderBashDynamicChoiceResolver(kind, command, fallback) {
|
|
381
|
-
const envKind = kind.toUpperCase();
|
|
382
|
-
const cacheVar = `PM_COMPLETION_${envKind}_CACHE`;
|
|
383
|
-
const cacheTsVar = `PM_COMPLETION_${envKind}_CACHE_TS`;
|
|
384
|
-
const ttlVar = `PM_COMPLETION_${envKind}_TTL`;
|
|
385
|
-
const escapedFallback = shellDoubleQuote(fallback);
|
|
386
|
-
return [
|
|
387
|
-
`_pm_completion_${kind}_choices() {`,
|
|
388
|
-
" local now ttl cache_ts resolved",
|
|
389
|
-
' now="$(date +%s 2>/dev/null || echo 0)"',
|
|
390
|
-
` ttl="\${${ttlVar}:-120}"`,
|
|
391
|
-
` cache_ts="\${${cacheTsVar}:-0}"`,
|
|
392
|
-
` if [[ -n "\${${cacheVar}:-}" && "$now" -ne 0 && $((now - cache_ts)) -lt "$ttl" ]]; then`,
|
|
393
|
-
` printf '%s\\n' "$${cacheVar}"`,
|
|
394
|
-
" return 0",
|
|
395
|
-
" fi",
|
|
396
|
-
` resolved="$(pm ${command} 2>/dev/null)"`,
|
|
397
|
-
' if [[ -z "$resolved" ]]; then',
|
|
398
|
-
` resolved="${escapedFallback}"`,
|
|
399
|
-
" fi",
|
|
400
|
-
` ${cacheVar}="$resolved"`,
|
|
401
|
-
` ${cacheTsVar}="$now"`,
|
|
402
|
-
` printf '%s\\n' "$${cacheVar}"`,
|
|
403
|
-
"}",
|
|
404
|
-
];
|
|
405
|
-
}
|
|
406
|
-
function renderZshDynamicChoiceResolver(kind, command, fallback) {
|
|
407
|
-
const envKind = kind.toUpperCase();
|
|
408
|
-
const cacheVar = `PM_COMPLETION_${envKind}_CACHE`;
|
|
409
|
-
const cacheTsVar = `PM_COMPLETION_${envKind}_CACHE_TS`;
|
|
410
|
-
const ttlVar = `PM_COMPLETION_${envKind}_TTL`;
|
|
411
|
-
const escapedFallback = shellDoubleQuote(fallback);
|
|
412
|
-
return `
|
|
1
|
+
!(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="56fd6790-568a-5c97-ab94-4b645aaa3718")}catch(e2){}})();import{EXIT_CODE,PmCliError}from"./runtime-primitives.js";import{listPmCommandsForTier}from"./agent-capability-contracts.js";import{SCAFFOLD_CAPABILITIES}from"./extension/scaffold.js";import{AGGREGATE_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,CALENDAR_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,CONTEXT_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,CREATE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,NEXT_FLAG_CONTRACTS,PM_COMMAND_ALIAS_CONTRACTS,PM_HISTORY_COMMAND_ALIASES,resolveSubcommandFlagContractsForCommand,PACKAGE_FLAG_CONTRACTS,PLAN_FLAG_CONTRACTS,SEARCH_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,toCompletionFlagString}from"./cli-contracts.js";import{BUILTIN_ITEM_TYPE_VALUES,STATUS_VALUES}from"../types/index.js";import{listGuideTopicIds}from"./guide-topics.js";import{enrichCliFlagInvocationContracts}from"./flag-invocation-contracts.js";import{GLOBAL_VALUE_CONSUMING_FLAGS}from"./cli-contracts/bootstrap-command-scanner.js";const VALID_SHELLS=["bash","zsh","fish"];const DEFAULT_ITEM_TYPES=[...BUILTIN_ITEM_TYPE_VALUES];const DEFAULT_STATUS_VALUES=[...STATUS_VALUES];const HIDDEN_COMMAND_ALIASES=new Set(PM_COMMAND_ALIAS_CONTRACTS.filter(contract=>contract.hidden).map(contract=>contract.alias));const ALL_COMMANDS=listPmCommandsForTier("full").filter(command=>!HIDDEN_COMMAND_ALIASES.has(command));const LIST_FLAGS=toCompletionFlagString(LIST_FILTER_FLAG_CONTRACTS);const AGGREGATE_FLAGS=toCompletionFlagString(AGGREGATE_FLAG_CONTRACTS);const APPEND_FLAGS=toCompletionFlagString(APPEND_FLAG_CONTRACTS);const COPY_FLAGS=toCompletionFlagString(COPY_FLAG_CONTRACTS);const RESTORE_INVOCATIONS=enrichCliFlagInvocationContracts("restore",resolveSubcommandFlagContractsForCommand("restore"));const FOCUS_FLAGS=toCompletionFlagString(FOCUS_FLAG_CONTRACTS);const MEET_FLAGS=toCompletionFlagString(MEET_FLAG_CONTRACTS);const REMIND_FLAGS=toCompletionFlagString(REMIND_FLAG_CONTRACTS);const CREATE_FLAGS=toCompletionFlagString(CREATE_FLAG_CONTRACTS);const GET_FLAGS=toCompletionFlagString(GET_FLAG_CONTRACTS);const UPDATE_FLAGS=toCompletionFlagString(UPDATE_FLAG_CONTRACTS);const UPDATE_MANY_FLAGS=toCompletionFlagString(UPDATE_MANY_FLAG_CONTRACTS);const CLOSE_MANY_FLAGS=toCompletionFlagString(CLOSE_MANY_FLAG_CONTRACTS);const HISTORY_LEAVES=PM_HISTORY_COMMAND_ALIASES.map(entry=>entry.canonical_argv[1]).join(" ");const HISTORY_OPERATION_FLAGS=PM_HISTORY_COMMAND_ALIASES.map(entry=>({...entry,flags:toCompletionFlagString(resolveSubcommandFlagContractsForCommand(entry.alias))}));const HISTORY_FLAGS=toCompletionFlagString(HISTORY_FLAG_CONTRACTS);const HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS=toCompletionFlagString(HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,false);const EVENTS_FLAGS=toCompletionFlagString(EVENTS_FLAG_CONTRACTS);const CALENDAR_FLAGS=toCompletionFlagString(CALENDAR_FLAG_CONTRACTS);const CONTEXT_FLAGS=toCompletionFlagString(CONTEXT_FLAG_CONTRACTS);const NEXT_FLAGS=toCompletionFlagString(NEXT_FLAG_CONTRACTS);const DEPS_FLAGS=toCompletionFlagString(DEPS_FLAG_CONTRACTS);const DUPLICATES_FLAGS=toCompletionFlagString(DUPLICATES_FLAG_CONTRACTS);const GRAPH_FLAGS=toCompletionFlagString(GRAPH_FLAG_CONTRACTS);const GUIDE_FLAGS=toCompletionFlagString(GUIDE_FLAG_CONTRACTS);const SEARCH_FLAGS=toCompletionFlagString(SEARCH_FLAG_CONTRACTS);const STATS_FLAGS=toCompletionFlagString(STATS_FLAG_CONTRACTS);const HEALTH_FLAGS=toCompletionFlagString(HEALTH_FLAG_CONTRACTS);const INIT_FLAGS=toCompletionFlagString(INIT_FLAG_CONTRACTS);const CONTRACTS_FLAGS=toCompletionFlagString(CONTRACTS_FLAG_CONTRACTS);const PLAN_FLAGS=toCompletionFlagString(PLAN_FLAG_CONTRACTS);const PLAN_SUBCOMMANDS_LIST="create show add-step update-step complete-step block-step reorder-step remove-step link unlink decision discovery validation resume approve materialize";const COMPLETION_FLAGS=toCompletionFlagString(COMPLETION_FLAG_CONTRACTS);const COMPLETION_SHELL_CHOICES=`${COMPLETION_FLAGS} bash zsh fish`;const GUIDE_TOPIC_CHOICES=joinCompletionValues(listGuideTopicIds());const EXTENSION_LIFECYCLE_ACTIONS="init scaffold install uninstall explore manage describe reload doctor catalog adopt adopt-all activate deactivate migrate";const PACKAGE_LIFECYCLE_ACTIONS=`${EXTENSION_LIFECYCLE_ACTIONS} upgrade`;const EXTENSION_LIFECYCLE_FLAGS=toCompletionFlagString(EXTENSION_FLAG_CONTRACTS);const PACKAGE_LIFECYCLE_FLAGS=toCompletionFlagString(PACKAGE_FLAG_CONTRACTS);const UPGRADE_FLAGS=toCompletionFlagString(UPGRADE_FLAG_CONTRACTS);const MUTATION_FLAGS="--author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";const DELETE_MUTATION_FLAGS="--dry-run --author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";const CLOSE_MUTATION_FLAGS="--author --message --validate-close --duplicate-of --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";const RELEASE_MUTATION_FLAGS="--author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";const COMMAND_COMPLETION_DESCRIPTIONS=[["init","Initialize pm storage for the current workspace"],["config","Read or update pm settings"],["package","Manage package lifecycle operations"],["packages","Alias for package"],["create","Create a new project management item"],["copy","Copy an existing item to a new ID"],["focus","Set/clear/show the session focused parent for new items"],["list","List active items with optional filters"],["aggregate","Aggregate grouped item counts and numeric stats for governance queries"],["duplicates","Find bounded duplicate clusters across lifecycle statuses"],["guide","Browse local progressive-disclosure guides"],["calendar","Show calendar views for deadlines and reminders"],["cal","Alias for calendar"],["context","Show a token-efficient project context snapshot"],["ctx","Alias for context"],["get","Show item details by ID"],["next","Recommend the next actionable (unblocked, ready) work item"],["search","Search items with keyword, semantic, or hybrid modes"],["reindex","Rebuild search artifacts"],["history","Show item history entries"],["history-compact","Compact history streams into a synthetic baseline + retained tail"],["history-redact","Redact sensitive literals/patterns and recompute history hashes"],["history-repair","Re-anchor a drifted history chain so pm health/validate report ok"],["schema","Manage custom item types and statuses in .agents/pm/schema/*.json"],["profile","List, show, apply, and lint project profiles (archetype schema/config/template/package bundles)"],["plan","Agent-optimized Plan item workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)"],["activity","Show recent activity across items"],["restore","Restore an item to an earlier state"],["update","Update item fields and metadata"],["update-many","Bulk-update matched items with dry-run and rollback checkpoints"],["close","Close an item (reason requirement follows governance settings)"],["close-many","Bulk-close matched items with an optional shared reason and rollback checkpoint"],["delete","Delete an item and record the change"],["append","Append text to an item body"],["comments","List or add comments for an item"],["notes","List or add notes for an item"],["learnings","List or add learnings for an item"],["files","Manage linked files"],["docs","Manage linked docs"],["deps","Show dependency relationships for an item"],["graph","Bounded graph traversal, analytics, and governance-audit queries"],["test","Manage linked tests and optionally run them"],["test-all","Run linked tests across matching items"],["test-runs","Manage background linked-test runs"],["stats","Show project tracker statistics"],["health","Show project tracker health checks"],["validate","Run standalone validation checks"],["gc","Clean optional cache artifacts"],["contracts","Show machine-readable command and schema contracts"],["claim","Claim an item for active work"],["release","Release the active claim for an item"],["start-task","Lifecycle alias to claim and set in_progress"],["pause-task","Lifecycle alias to reopen and release claim"],["close-task","Lifecycle alias to close and release claim"],["meet","Shortcut to create a Meeting with scheduling defaults"],["event","Shortcut to create an Event with scheduling defaults"],["remind","Shortcut to create a Reminder from a point in time"],["templates","Manage reusable create templates"],["completion","Generate shell completion"],["help","Display help for a command"]];const FISH_COMMAND_DESCRIPTION_OVERRIDES=new Map([["calendar","Show deadline/reminder calendar views"],["schema","Inspect and manage runtime schema"],["profile","List, show, apply, and lint project profiles (archetype bundles)"],["plan","Agent-optimized Plan workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)"],["start-task","Lifecycle alias to claim and set in-progress"]]);const GLOBAL_FLAGS=GLOBAL_FLAG_CONTRACTS.flatMap(entry=>[entry.short,entry.flag,...entry.aliases??[]]).filter(value=>Boolean(value)).join(" ");const GLOBAL_COMPLETION_VALUE_PATTERNS=[...GLOBAL_VALUE_CONSUMING_FLAGS].join("|");const GLOBAL_COMPLETION_INLINE_PATTERNS=[...GLOBAL_VALUE_CONSUMING_FLAGS].map(flag=>`${flag}=*`).join("|");const GLOBAL_COMPLETION_SWITCH_PATTERNS=[...GLOBAL_FLAGS.split(" ").filter(flag=>!GLOBAL_VALUE_CONSUMING_FLAGS.has(flag)),"-h","-V"].join("|");function joinCompletionValues(values){return[...new Set(values.map(value=>value.trim()).filter(value=>value.length>0))].sort((left,right)=>left.localeCompare(right)).join(" ")}function joinCompletionValuesInOrder(values){return[...new Set(values.map(value=>value.trim()).filter(value=>value.length>0))].join(" ")}function shellDoubleQuote(value){return value.replaceAll("\\","\\\\").replaceAll('"','\\"').replaceAll("$","\\$").replaceAll("`","\\`")}function completionTypeValues(itemTypes,runtime){return joinCompletionValuesInOrder(itemTypes.length>0?itemTypes:runtime.item_types??DEFAULT_ITEM_TYPES)}function completionStatusValues(runtime){return joinCompletionValues(runtime.statuses??DEFAULT_STATUS_VALUES)}function mergeFlagStrings(baseFlags,runtimeFlags){const merged=[...baseFlags.split(/\s+/u).filter(value=>value.length>0),...runtimeFlags??[]];return joinCompletionValues(merged)}function normalizeRuntimeCompletionFlags(runtimeFlags){const normalized=(runtimeFlags??[]).map(value=>value.trim()).filter(value=>value.startsWith("--")&&value.length>2).map(value=>`--${value.slice(2).replaceAll("_","-")}`);return[...new Set(normalized)].sort((left,right)=>left.localeCompare(right))}function renderZshRuntimeFieldFlagSpecs(runtimeFlags){const normalized=normalizeRuntimeCompletionFlags(runtimeFlags);if(normalized.length===0){return""}return`${normalized.map(flag=>` '${flag}[Runtime schema field flag]:value' \\`).join("\n")}
|
|
2
|
+
`}function renderZshArgumentSpecs(specs,options={}){const trailingContinuation=options.trailingContinuation??true;const lastSpecIndex=specs.length-1;return specs.map((spec,index)=>` ${spec}${trailingContinuation||index!==lastSpecIndex?" \\":""}`).join("\n")}function renderZshCommandDescriptions(){return COMMAND_COMPLETION_DESCRIPTIONS.filter(([command])=>!HIDDEN_COMMAND_ALIASES.has(command)).map(([command,description])=>` '${command}:${description}'`).join("\n")}function renderFishCommandDescriptions(){return COMMAND_COMPLETION_DESCRIPTIONS.filter(([command])=>command!=="help"&&!HIDDEN_COMMAND_ALIASES.has(command)).map(([command,description])=>{const fishDescription=FISH_COMMAND_DESCRIPTION_OVERRIDES.get(command)??description;return`complete -c pm -n __pm_no_subcommand -a ${command.padEnd(16)} -d '${fishDescription}'`}).join("\n")}function renderZshPresenceFilterSpecs(options){const missingSpecs=["reviewer-missing[Select only items missing reviewer]","risk-missing[Select only items missing risk]","confidence-missing[Select only items missing confidence]","sprint-missing[Select only items missing sprint]","release-missing[Select only items missing release]"];const contentMissingAliasSpecs=options.includeContentMissingAliases===true?["files-missing[Alias for --no-files]","docs-missing[Alias for --no-docs]"]:[];const pairedSpecs=[["has-notes[Select only items that have notes]","no-notes[Select only items with no notes]"],["has-learnings[Select only items that have learnings]","no-learnings[Select only items with no learnings]"],["has-files[Select only items that have linked files]","no-files[Select only items with no linked files]"],["has-docs[Select only items that have linked docs]","no-docs[Select only items with no linked docs]"],["has-tests[Select only items that have linked tests]","no-tests[Select only items with no linked tests]"],["has-comments[Select only items that have comments]","no-comments[Select only items with no comments]"],["has-deps[Select only items that have dependencies]","no-deps[Select only items with no dependencies]"],["has-body[Select only items with non-empty body]","empty-body[Select only items with empty body]"],["has-linked-command[Select only items that have a linked command]","no-linked-command[Select only items with no linked command]"]];return renderZshArgumentSpecs([...[...missingSpecs,...contentMissingAliasSpecs].map(spec=>`'--${options.missingPrefix}${spec}'`),...pairedSpecs.flatMap(([positive,negative])=>[`'--${options.pairedPrefix}${positive}'`,`'--${options.pairedPrefix}${negative}'`])])}const ZSH_MUTATION_COLLECTION_ARGUMENT_SPECS=["'--comment[Comment seed author=<value>,created_at=<iso|now>,text=<value>]:comment'","'--note[Note seed author=<value>,created_at=<iso|now>,text=<value>]:note'","'--learning[Learning seed author=<value>,created_at=<iso|now>,text=<value>]:learning'","'--file[Linked file path=<value>,scope=<project|global>,note=<text>]:file'","'--test[Linked test command=<value>,path=<value>,scope=<project|global>]:test'","'--doc[Linked doc path=<value>,scope=<project|global>,note=<text>]:doc'","'--reminder[Reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>]:reminder'","'--event[Event entry start=<iso|relative>,end=<iso|relative>,recur_*]:event'","'--type-option[Type option key=value or key=<name>,value=<value>]:type_option'","'--unset[Clear scalar metadata field by name]:field'","'--replace-files[Atomically replace linked files with provided --file values]'","'--replace-docs[Atomically replace linked docs with provided --doc values]'","'--clear-deps[Clear dependency entries]'","'--clear-comments[Clear comments]'","'--clear-notes[Clear notes]'","'--clear-learnings[Clear learnings]'","'--clear-files[Clear linked files]'","'--clear-tests[Clear linked tests]'","'--clear-docs[Clear linked docs]'","'--clear-reminders[Clear reminders]'","'--clear-events[Clear events]'","'--clear-type-options[Clear type options]'"];function renderZshScheduleItemSpecs(kind){const leadingSpecs=kind==="reminder"?["'--at[Reminder time (default +1d)]:at'","'--text[Reminder text (defaults to title)]:text'"]:["'--start[Start time (ISO, now, or relative)]:start'","'--duration[Duration from start (default 1h)]:duration'","'--end[End time (overrides --duration)]:end'","'--location[Location]:location'","'--timezone[IANA timezone]:timezone'","'--all-day[Mark as an all-day event]'"];return renderZshArgumentSpecs([...leadingSpecs,"'--parent[Parent item id]:parent'","'--allow-missing-parent[Permit a parent id that does not exist yet]'","'--tags[Comma-separated tags]:tags'","'(-p --priority)'{-p,--priority}'[Priority (0-4)]:(0 1 2 3 4)'","'(-b --body)'{-b,--body}'[Item body]:body'","'(-d --description)'{-d,--description}'[Short description]:description'","'--author[Mutation author]:author'","'--message[History message]:message'","'--json[Output JSON]'","'--quiet[Suppress stdout]'"],{trailingContinuation:false})}function renderZshBulkSelectionFilterSpecs(action,statusChoices,typeChoices,tagChoices){return renderZshArgumentSpecs([`'--filter-status[Filter by status before ${action}]:(${statusChoices})'`,`'--filter-type[Filter by type before ${action}]:(${typeChoices})'`,`'--filter-tag[Filter by tag before ${action}]:(${tagChoices})'`,`'--filter-priority[Filter by priority before ${action}]:(0 1 2 3 4)'`,"'--filter-deadline-before[Filter by deadline upper bound]:deadline'","'--filter-deadline-after[Filter by deadline lower bound]:deadline'","'--filter-updated-after[Filter by updated_at lower bound (ISO/relative)]:timestamp'","'--filter-updated-before[Filter by updated_at upper bound (ISO/relative)]:timestamp'","'--filter-created-after[Filter by created_at lower bound (ISO/relative)]:timestamp'","'--filter-created-before[Filter by created_at upper bound (ISO/relative)]:timestamp'",`'--filter-assignee[Filter by assignee before ${action}]:assignee'`,"'--filter-assignee-filter[Filter assignee presence]:(assigned unassigned)'","'--filter-parent[Filter by parent item ID]:parent'","'--filter-sprint[Filter by sprint]:sprint'","'--filter-release[Filter by release]:release'"])}function renderFishRuntimeFieldFlagSpecs(commands,runtimeFlags){const normalizedFlags=normalizeRuntimeCompletionFlags(runtimeFlags).map(flag=>flag.slice(2));if(commands.length===0||normalizedFlags.length===0){return""}const lines=[];for(const command of commands){for(const flag of normalizedFlags){lines.push(`complete -c pm -n '__fish_seen_subcommand_from ${command}' -l ${flag} -d 'Runtime schema field flag' -r`)}}return`${lines.join("\n")}
|
|
3
|
+
`}function renderBashDynamicChoiceResolver(kind,command,fallback){const envKind=kind.toUpperCase();const cacheVar=`PM_COMPLETION_${envKind}_CACHE`;const cacheTsVar=`PM_COMPLETION_${envKind}_CACHE_TS`;const ttlVar=`PM_COMPLETION_${envKind}_TTL`;const escapedFallback=shellDoubleQuote(fallback);return[`_pm_completion_${kind}_choices() {`," local now ttl cache_ts resolved",' now="$(date +%s 2>/dev/null || echo 0)"',` ttl="\${${ttlVar}:-120}"`,` cache_ts="\${${cacheTsVar}:-0}"`,` if [[ -n "\${${cacheVar}:-}" && "$now" -ne 0 && $((now - cache_ts)) -lt "$ttl" ]]; then`,` printf '%s\\n' "$${cacheVar}"`," return 0"," fi",` resolved="$(pm ${command} 2>/dev/null)"`,' if [[ -z "$resolved" ]]; then',` resolved="${escapedFallback}"`," fi",` ${cacheVar}="$resolved"`,` ${cacheTsVar}="$now"`,` printf '%s\\n' "$${cacheVar}"`,"}"]}function renderZshDynamicChoiceResolver(kind,command,fallback){const envKind=kind.toUpperCase();const cacheVar=`PM_COMPLETION_${envKind}_CACHE`;const cacheTsVar=`PM_COMPLETION_${envKind}_CACHE_TS`;const ttlVar=`PM_COMPLETION_${envKind}_TTL`;const escapedFallback=shellDoubleQuote(fallback);return`
|
|
413
4
|
_pm_${kind}_choices() {
|
|
414
5
|
local now ttl cache_ts resolved
|
|
415
6
|
now=\${EPOCHSECONDS:-0}
|
|
@@ -427,12 +18,7 @@ _pm_${kind}_choices() {
|
|
|
427
18
|
${cacheTsVar}="$now"
|
|
428
19
|
print -r -- "$${cacheVar}"
|
|
429
20
|
}
|
|
430
|
-
|
|
431
|
-
}
|
|
432
|
-
function renderFishDynamicChoiceResolver(kind, command, fallback) {
|
|
433
|
-
const envKind = kind.toUpperCase();
|
|
434
|
-
const escapedFallback = fallback.replaceAll("'", "\\'");
|
|
435
|
-
return `
|
|
21
|
+
`}function renderFishDynamicChoiceResolver(kind,command,fallback){const envKind=kind.toUpperCase();const escapedFallback=fallback.replaceAll("'","\\'");return`
|
|
436
22
|
function __pm_${kind}_choices
|
|
437
23
|
set -l now (date +%s ^/dev/null)
|
|
438
24
|
if test -z "$now"
|
|
@@ -457,303 +43,7 @@ function __pm_${kind}_choices
|
|
|
457
43
|
set -gx PM_COMPLETION_${envKind}_CACHE_TS $now
|
|
458
44
|
printf '%s\\n' $resolved
|
|
459
45
|
end
|
|
460
|
-
`;
|
|
461
|
-
}
|
|
462
|
-
/** Implements generate bash script for the public runtime surface of this module. */
|
|
463
|
-
export function generateBashScript(itemTypes = [], tags = [], eagerTagExpansion = false, runtime = {}) {
|
|
464
|
-
const cmds = ALL_COMMANDS.join(" ");
|
|
465
|
-
const useDynamicTypeExpansion = itemTypes.length === 0;
|
|
466
|
-
const typeValues = completionTypeValues(itemTypes, runtime);
|
|
467
|
-
const statusValues = completionStatusValues(runtime);
|
|
468
|
-
const tagValues = joinCompletionValues(tags);
|
|
469
|
-
const listFlags = mergeFlagStrings(LIST_FLAGS, runtime.command_flags?.list);
|
|
470
|
-
const createFlags = mergeFlagStrings(CREATE_FLAGS, runtime.command_flags?.create);
|
|
471
|
-
const updateFlags = mergeFlagStrings(UPDATE_FLAGS, runtime.command_flags?.update);
|
|
472
|
-
const updateManyFlags = mergeFlagStrings(UPDATE_MANY_FLAGS, runtime.command_flags?.["update-many"]);
|
|
473
|
-
const searchFlags = mergeFlagStrings(SEARCH_FLAGS, runtime.command_flags?.search);
|
|
474
|
-
const calendarFlags = mergeFlagStrings(CALENDAR_FLAGS, runtime.command_flags?.calendar);
|
|
475
|
-
const contextFlags = mergeFlagStrings(CONTEXT_FLAGS, runtime.command_flags?.context);
|
|
476
|
-
const useEagerTagExpansion = eagerTagExpansion || tags.length > 0;
|
|
477
|
-
// Note: "${...}" inside regular (non-template) strings are literal characters,
|
|
478
|
-
// not JS interpolation. Only backtick template literals interpolate ${...}.
|
|
479
|
-
const compgen = (flags) => `$(compgen -W "${flags}" -- "$cur")`;
|
|
480
|
-
return [
|
|
481
|
-
"# bash completion for pm",
|
|
482
|
-
"# Source this file or add 'eval \"$(pm completion bash)\"' to ~/.bashrc",
|
|
483
|
-
"",
|
|
484
|
-
...(useDynamicTypeExpansion
|
|
485
|
-
? [
|
|
486
|
-
...renderBashDynamicChoiceResolver("type", "completion-types", typeValues),
|
|
487
|
-
"",
|
|
488
|
-
]
|
|
489
|
-
: []),
|
|
490
|
-
...renderBashDynamicChoiceResolver("status", "completion-statuses", statusValues),
|
|
491
|
-
"",
|
|
492
|
-
"_pm_completion() {",
|
|
493
|
-
" local cur prev words cword",
|
|
494
|
-
" _init_completion 2>/dev/null || {",
|
|
495
|
-
' cur="${COMP_WORDS[COMP_CWORD]}"',
|
|
496
|
-
' prev="${COMP_WORDS[COMP_CWORD-1]}"',
|
|
497
|
-
" cword=$COMP_CWORD",
|
|
498
|
-
" }",
|
|
499
|
-
"",
|
|
500
|
-
" if [[ $cword -eq 1 ]]; then",
|
|
501
|
-
` COMPREPLY=(${compgen(cmds)})`,
|
|
502
|
-
" return 0",
|
|
503
|
-
" fi",
|
|
504
|
-
"",
|
|
505
|
-
' if [[ "$prev" == "--type" ]]; then',
|
|
506
|
-
useDynamicTypeExpansion
|
|
507
|
-
? ' COMPREPLY=($(compgen -W "$(_pm_completion_type_choices)" -- "$cur"))'
|
|
508
|
-
: ` COMPREPLY=(${compgen(typeValues)})`,
|
|
509
|
-
" return 0",
|
|
510
|
-
" fi",
|
|
511
|
-
"",
|
|
512
|
-
' if [[ "$prev" == "--status" ]]; then',
|
|
513
|
-
' COMPREPLY=($(compgen -W "$(_pm_completion_status_choices)" -- "$cur"))',
|
|
514
|
-
" return 0",
|
|
515
|
-
" fi",
|
|
516
|
-
"",
|
|
517
|
-
...(useEagerTagExpansion
|
|
518
|
-
? [
|
|
519
|
-
' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then',
|
|
520
|
-
` COMPREPLY=(${compgen(tagValues)})`,
|
|
521
|
-
" return 0",
|
|
522
|
-
" fi",
|
|
523
|
-
]
|
|
524
|
-
: [
|
|
525
|
-
' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then',
|
|
526
|
-
" local now ttl cache_ts tag_values",
|
|
527
|
-
' now="$(date +%s 2>/dev/null || echo 0)"',
|
|
528
|
-
' ttl="${PM_COMPLETION_TAG_TTL:-120}"',
|
|
529
|
-
' cache_ts="${PM_COMPLETION_TAG_CACHE_TS:-0}"',
|
|
530
|
-
' tag_values="${PM_COMPLETION_TAG_CACHE:-}"',
|
|
531
|
-
' if [[ -z "$tag_values" || "$now" -eq 0 || $((now - cache_ts)) -ge "$ttl" ]]; then',
|
|
532
|
-
' tag_values="$(pm completion-tags 2>/dev/null)"',
|
|
533
|
-
' PM_COMPLETION_TAG_CACHE="$tag_values"',
|
|
534
|
-
' PM_COMPLETION_TAG_CACHE_TS="$now"',
|
|
535
|
-
" fi",
|
|
536
|
-
' COMPREPLY=($(compgen -W "$tag_values" -- "$cur"))',
|
|
537
|
-
" return 0",
|
|
538
|
-
" fi",
|
|
539
|
-
]),
|
|
540
|
-
"",
|
|
541
|
-
' if [[ "$prev" == "--tag" && ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then',
|
|
542
|
-
" COMPREPLY=()",
|
|
543
|
-
" return 0",
|
|
544
|
-
" fi",
|
|
545
|
-
"",
|
|
546
|
-
' local cmd="${COMP_WORDS[1]}"',
|
|
547
|
-
"",
|
|
548
|
-
' case "$cmd" in',
|
|
549
|
-
" list)",
|
|
550
|
-
` COMPREPLY=(${compgen(listFlags)})`,
|
|
551
|
-
" ;;",
|
|
552
|
-
" aggregate)",
|
|
553
|
-
` COMPREPLY=(${compgen(AGGREGATE_FLAGS)})`,
|
|
554
|
-
" ;;",
|
|
555
|
-
" duplicates)",
|
|
556
|
-
` COMPREPLY=(${compgen(DUPLICATES_FLAGS)})`,
|
|
557
|
-
" ;;",
|
|
558
|
-
" create)",
|
|
559
|
-
` COMPREPLY=(${compgen(createFlags)})`,
|
|
560
|
-
" ;;",
|
|
561
|
-
" copy)",
|
|
562
|
-
` COMPREPLY=(${compgen(COPY_FLAGS)})`,
|
|
563
|
-
" ;;",
|
|
564
|
-
" focus)",
|
|
565
|
-
` COMPREPLY=(${compgen(FOCUS_FLAGS)})`,
|
|
566
|
-
" ;;",
|
|
567
|
-
" update)",
|
|
568
|
-
` COMPREPLY=(${compgen(updateFlags)})`,
|
|
569
|
-
" ;;",
|
|
570
|
-
" update-many)",
|
|
571
|
-
` COMPREPLY=(${compgen(updateManyFlags)})`,
|
|
572
|
-
" ;;",
|
|
573
|
-
" calendar|cal)",
|
|
574
|
-
` COMPREPLY=(${compgen(calendarFlags)})`,
|
|
575
|
-
" ;;",
|
|
576
|
-
" context|ctx)",
|
|
577
|
-
` COMPREPLY=(${compgen(contextFlags)})`,
|
|
578
|
-
" ;;",
|
|
579
|
-
" next)",
|
|
580
|
-
` COMPREPLY=(${compgen(NEXT_FLAGS)})`,
|
|
581
|
-
" ;;",
|
|
582
|
-
" guide)",
|
|
583
|
-
` COMPREPLY=(${compgen(`${GUIDE_FLAGS} ${GUIDE_TOPIC_CHOICES}`)})`,
|
|
584
|
-
" ;;",
|
|
585
|
-
" search)",
|
|
586
|
-
` COMPREPLY=(${compgen(searchFlags)})`,
|
|
587
|
-
" ;;",
|
|
588
|
-
" reindex)",
|
|
589
|
-
` COMPREPLY=(${compgen("--mode --progress --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
590
|
-
" ;;",
|
|
591
|
-
" init)",
|
|
592
|
-
` COMPREPLY=(${compgen(`${INIT_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)})`,
|
|
593
|
-
" ;;",
|
|
594
|
-
" config)",
|
|
595
|
-
` COMPREPLY=(${compgen("--criterion --clear-criteria --format --policy --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
596
|
-
" ;;",
|
|
597
|
-
" extension)",
|
|
598
|
-
` COMPREPLY=(${compgen(`${EXTENSION_LIFECYCLE_ACTIONS} ${EXTENSION_LIFECYCLE_FLAGS}`)})`,
|
|
599
|
-
" ;;",
|
|
600
|
-
" package|packages)",
|
|
601
|
-
` COMPREPLY=(${compgen(`${PACKAGE_LIFECYCLE_ACTIONS} ${PACKAGE_LIFECYCLE_FLAGS} ${UPGRADE_FLAGS}`)})`,
|
|
602
|
-
" ;;",
|
|
603
|
-
" comments)",
|
|
604
|
-
` COMPREPLY=(${compgen("--add --body --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
605
|
-
" ;;",
|
|
606
|
-
" notes)",
|
|
607
|
-
` COMPREPLY=(${compgen("--add --add-json --stdin --file --edit --delete --limit --since --event-type --include-meta --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
608
|
-
" ;;",
|
|
609
|
-
" learnings)",
|
|
610
|
-
` COMPREPLY=(${compgen("--add --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
611
|
-
" ;;",
|
|
612
|
-
" files)",
|
|
613
|
-
` COMPREPLY=(${compgen("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --explain --lines --decision-depth --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
614
|
-
" ;;",
|
|
615
|
-
" docs)",
|
|
616
|
-
` COMPREPLY=(${compgen("--add --add-glob --remove --migrate --note --validate-paths --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
617
|
-
" ;;",
|
|
618
|
-
" append)",
|
|
619
|
-
` COMPREPLY=(${compgen(APPEND_FLAGS)})`,
|
|
620
|
-
" ;;",
|
|
621
|
-
" deps)",
|
|
622
|
-
` COMPREPLY=(${compgen(DEPS_FLAGS)})`,
|
|
623
|
-
" ;;",
|
|
624
|
-
" graph)",
|
|
625
|
-
` COMPREPLY=(${compgen(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index ${GRAPH_FLAGS}`)})`,
|
|
626
|
-
" ;;",
|
|
627
|
-
" test)",
|
|
628
|
-
` COMPREPLY=(${compgen("--add --add-json --remove --remove-index --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
629
|
-
" ;;",
|
|
630
|
-
" test-all)",
|
|
631
|
-
` COMPREPLY=(${compgen("--status --limit --offset --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
632
|
-
" ;;",
|
|
633
|
-
" test-runs)",
|
|
634
|
-
` COMPREPLY=(${compgen("list status logs stop resume --status --limit --stream --tail --force --author --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
635
|
-
" ;;",
|
|
636
|
-
" validate)",
|
|
637
|
-
` COMPREPLY=(${compgen("--check-metadata --metadata-profile --check-resolution --check-lifecycle --check-stale-blockers --dependency-cycle-severity --parent-cycle-severity --check-files --scan-mode --include-pm-internals --verbose-file-lists --verbose-diagnostics --all-affected-ids --strict-exit --fail-on-warn --fix-hints --auto-fix --dry-run --fix-scope --prune-missing --check-history-drift --check-command-references --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
638
|
-
" ;;",
|
|
639
|
-
" health)",
|
|
640
|
-
` COMPREPLY=(${compgen(HEALTH_FLAGS)})`,
|
|
641
|
-
" ;;",
|
|
642
|
-
" history)",
|
|
643
|
-
` COMPREPLY=(${compgen(HISTORY_FLAGS)})`,
|
|
644
|
-
" ;;",
|
|
645
|
-
" events)",
|
|
646
|
-
` COMPREPLY=(${compgen(EVENTS_FLAGS)})`,
|
|
647
|
-
" ;;",
|
|
648
|
-
" history-compact)",
|
|
649
|
-
` COMPREPLY=(${compgen("--before --ids --all-over --closed --all-streams --min-entries --dry-run --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
650
|
-
" ;;",
|
|
651
|
-
" history-author-acknowledge)",
|
|
652
|
-
` COMPREPLY=(${compgen(`${HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)})`,
|
|
653
|
-
" ;;",
|
|
654
|
-
" get)",
|
|
655
|
-
` COMPREPLY=(${compgen(GET_FLAGS)})`,
|
|
656
|
-
" ;;",
|
|
657
|
-
" history-redact)",
|
|
658
|
-
` COMPREPLY=(${compgen("--literal --regex --replacement --dry-run --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
659
|
-
" ;;",
|
|
660
|
-
" history-repair)",
|
|
661
|
-
` COMPREPLY=(${compgen("--all --dry-run --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
662
|
-
" ;;",
|
|
663
|
-
" schema)",
|
|
664
|
-
` COMPREPLY=(${compgen("list show show-status add-type remove-type add-status remove-status add-field remove-field list-fields show-field apply-preset rename-type rename-field remap-status --description --default-status --folder --alias --role --order --type --commands --cli-flag --required --required-on-create --no-allow-unset --required-types --infer --min-count --apply --to --migration-id --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
665
|
-
" ;;",
|
|
666
|
-
" profile)",
|
|
667
|
-
` COMPREPLY=(${compgen("list show apply lint agile ops research --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
668
|
-
" ;;",
|
|
669
|
-
" plan)",
|
|
670
|
-
` COMPREPLY=(${compgen(`${PLAN_SUBCOMMANDS_LIST} ${PLAN_FLAGS}`)})`,
|
|
671
|
-
" ;;",
|
|
672
|
-
" activity)",
|
|
673
|
-
` COMPREPLY=(${compgen(ACTIVITY_FLAGS)})`,
|
|
674
|
-
" ;;",
|
|
675
|
-
" contracts)",
|
|
676
|
-
` COMPREPLY=(${compgen(CONTRACTS_FLAGS)})`,
|
|
677
|
-
" ;;",
|
|
678
|
-
" gc)",
|
|
679
|
-
` COMPREPLY=(${compgen("--dry-run --scope --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
|
|
680
|
-
" ;;",
|
|
681
|
-
" stats)",
|
|
682
|
-
` COMPREPLY=(${compgen(STATS_FLAGS)})`,
|
|
683
|
-
" ;;",
|
|
684
|
-
" close|close-task)",
|
|
685
|
-
` COMPREPLY=(${compgen(CLOSE_MUTATION_FLAGS)})`,
|
|
686
|
-
" ;;",
|
|
687
|
-
" close-many)",
|
|
688
|
-
` COMPREPLY=(${compgen(CLOSE_MANY_FLAGS)})`,
|
|
689
|
-
" ;;",
|
|
690
|
-
" release)",
|
|
691
|
-
` COMPREPLY=(${compgen(RELEASE_MUTATION_FLAGS)})`,
|
|
692
|
-
" ;;",
|
|
693
|
-
" delete)",
|
|
694
|
-
` COMPREPLY=(${compgen(DELETE_MUTATION_FLAGS)})`,
|
|
695
|
-
" ;;",
|
|
696
|
-
" claim|restore|start-task|pause-task)",
|
|
697
|
-
` COMPREPLY=(${compgen(MUTATION_FLAGS)})`,
|
|
698
|
-
" ;;",
|
|
699
|
-
" meet|event)",
|
|
700
|
-
` COMPREPLY=(${compgen(MEET_FLAGS)})`,
|
|
701
|
-
" ;;",
|
|
702
|
-
" remind)",
|
|
703
|
-
` COMPREPLY=(${compgen(REMIND_FLAGS)})`,
|
|
704
|
-
" ;;",
|
|
705
|
-
" completion)",
|
|
706
|
-
` COMPREPLY=(${compgen(COMPLETION_SHELL_CHOICES)})`,
|
|
707
|
-
" ;;",
|
|
708
|
-
" templates)",
|
|
709
|
-
` COMPREPLY=(${compgen("save list show")})`,
|
|
710
|
-
" ;;",
|
|
711
|
-
" *)",
|
|
712
|
-
` COMPREPLY=(${compgen(GLOBAL_FLAGS)})`,
|
|
713
|
-
" ;;",
|
|
714
|
-
" esac",
|
|
715
|
-
' if [[ "$cmd" == "comments" || "$cmd" == "notes" || "$cmd" == "learnings" ]]; then',
|
|
716
|
-
` COMPREPLY+=(${compgen("--text")})`,
|
|
717
|
-
" fi",
|
|
718
|
-
" return 0",
|
|
719
|
-
"}",
|
|
720
|
-
"",
|
|
721
|
-
"complete -F _pm_completion pm",
|
|
722
|
-
].join("\n");
|
|
723
|
-
}
|
|
724
|
-
/** Implements generate zsh script for the public runtime surface of this module. */
|
|
725
|
-
export function generateZshScript(itemTypes = [], tags = [], eagerTagExpansion = false, runtime = {}) {
|
|
726
|
-
const useDynamicTypeExpansion = itemTypes.length === 0;
|
|
727
|
-
const typeFallbackChoices = completionTypeValues(itemTypes, runtime);
|
|
728
|
-
const statusFallbackChoices = completionStatusValues(runtime);
|
|
729
|
-
const typeChoices = useDynamicTypeExpansion
|
|
730
|
-
? '${(f)"$(_pm_type_choices)"}'
|
|
731
|
-
: typeFallbackChoices;
|
|
732
|
-
const statusChoices = '${(f)"$(_pm_status_choices)"}';
|
|
733
|
-
const guideTopicChoices = GUIDE_TOPIC_CHOICES;
|
|
734
|
-
const tagChoices = joinCompletionValues(tags);
|
|
735
|
-
const useEagerTagExpansion = eagerTagExpansion || tags.length > 0;
|
|
736
|
-
const zshTagChoices = useEagerTagExpansion
|
|
737
|
-
? tagChoices
|
|
738
|
-
: '${(f)"$(_pm_tag_choices)"}';
|
|
739
|
-
const zshListRuntimeFieldFlags = renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.list);
|
|
740
|
-
const zshCreateRuntimeFieldFlags = renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.create);
|
|
741
|
-
const zshSearchRuntimeFieldFlags = renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.search);
|
|
742
|
-
const zshCalendarRuntimeFieldFlags = renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.calendar);
|
|
743
|
-
const zshContextRuntimeFieldFlags = renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.context);
|
|
744
|
-
const zshPresenceFilterFlags = renderZshPresenceFilterSpecs({
|
|
745
|
-
missingPrefix: "filter-",
|
|
746
|
-
pairedPrefix: "",
|
|
747
|
-
includeContentMissingAliases: true,
|
|
748
|
-
});
|
|
749
|
-
const zshBulkPresenceFilterFlags = renderZshPresenceFilterSpecs({
|
|
750
|
-
missingPrefix: "filter-",
|
|
751
|
-
pairedPrefix: "filter-",
|
|
752
|
-
});
|
|
753
|
-
const zshMutationCollectionFlags = renderZshArgumentSpecs(ZSH_MUTATION_COLLECTION_ARGUMENT_SPECS);
|
|
754
|
-
const dynamicTagResolver = useEagerTagExpansion
|
|
755
|
-
? ""
|
|
756
|
-
: `
|
|
46
|
+
`}function generateBashScript(itemTypes=[],tags=[],eagerTagExpansion=false,runtime={}){const cmds=ALL_COMMANDS.join(" ");const useDynamicTypeExpansion=itemTypes.length===0;const typeValues=completionTypeValues(itemTypes,runtime);const statusValues=completionStatusValues(runtime);const tagValues=joinCompletionValues(tags);const listFlags=mergeFlagStrings(LIST_FLAGS,runtime.command_flags?.list);const createFlags=mergeFlagStrings(CREATE_FLAGS,runtime.command_flags?.create);const updateFlags=mergeFlagStrings(UPDATE_FLAGS,runtime.command_flags?.update);const updateManyFlags=mergeFlagStrings(UPDATE_MANY_FLAGS,runtime.command_flags?.["update-many"]);const searchFlags=mergeFlagStrings(SEARCH_FLAGS,runtime.command_flags?.search);const calendarFlags=mergeFlagStrings(CALENDAR_FLAGS,runtime.command_flags?.calendar);const contextFlags=mergeFlagStrings(CONTEXT_FLAGS,runtime.command_flags?.context);const useEagerTagExpansion=eagerTagExpansion||tags.length>0;const compgen=flags=>`$(compgen -W "${flags}" -- "$cur")`;return["# bash completion for pm",`# Source this file or add 'eval "$(pm completion bash)"' to ~/.bashrc`,"",...useDynamicTypeExpansion?[...renderBashDynamicChoiceResolver("type","completion-types",typeValues),""]:[],...renderBashDynamicChoiceResolver("status","completion-statuses",statusValues),"","_pm_completion() {"," local cur prev words cword"," _init_completion 2>/dev/null || {",' cur="${COMP_WORDS[COMP_CWORD]}"',' prev="${COMP_WORDS[COMP_CWORD-1]}"'," cword=$COMP_CWORD"," }",""," if [[ $cword -eq 1 ]]; then",` COMPREPLY=(${compgen(cmds)})`," return 0"," fi","",' if [[ "$prev" == "--type" ]]; then',useDynamicTypeExpansion?' COMPREPLY=($(compgen -W "$(_pm_completion_type_choices)" -- "$cur"))':` COMPREPLY=(${compgen(typeValues)})`," return 0"," fi","",' if [[ "$prev" == "--status" ]]; then',' COMPREPLY=($(compgen -W "$(_pm_completion_status_choices)" -- "$cur"))'," return 0"," fi","",...useEagerTagExpansion?[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then',` COMPREPLY=(${compgen(tagValues)})`," return 0"," fi"]:[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," local now ttl cache_ts tag_values",' now="$(date +%s 2>/dev/null || echo 0)"',' ttl="${PM_COMPLETION_TAG_TTL:-120}"',' cache_ts="${PM_COMPLETION_TAG_CACHE_TS:-0}"',' tag_values="${PM_COMPLETION_TAG_CACHE:-}"',' if [[ -z "$tag_values" || "$now" -eq 0 || $((now - cache_ts)) -ge "$ttl" ]]; then',' tag_values="$(pm completion-tags 2>/dev/null)"',' PM_COMPLETION_TAG_CACHE="$tag_values"',' PM_COMPLETION_TAG_CACHE_TS="$now"'," fi",' COMPREPLY=($(compgen -W "$tag_values" -- "$cur"))'," return 0"," fi"],"",' if [[ "$prev" == "--tag" && ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," COMPREPLY=()"," return 0"," fi","",' local cmd="" word_index=1 word'," while (( word_index < cword )); do",' word="${COMP_WORDS[word_index]}"',' case "${word//_/-}" in',` ${GLOBAL_COMPLETION_VALUE_PATTERNS}) (( word_index += 2 )); continue ;;`,` ${GLOBAL_COMPLETION_INLINE_PATTERNS}|${GLOBAL_COMPLETION_SWITCH_PATTERNS}) (( word_index++ )); continue ;;`," --) break ;;"," esac",' if [[ -z "$cmd" ]]; then',' cmd="$word"',' [[ "$cmd" == "history" ]] || break'," else",' case "$word" in',...PM_HISTORY_COMMAND_ALIASES.map(entry=>` ${entry.canonical_argv[1]}) cmd="${entry.alias}" ;;`)," esac"," break"," fi"," (( word_index++ ))"," done",' case "$cmd" in',...HISTORY_OPERATION_FLAGS.flatMap(entry=>[` ${entry.alias})`,` COMPREPLY=(${compgen(entry.flags)})`," return 0"," ;;"])," list)",` COMPREPLY=(${compgen(listFlags)})`," ;;"," aggregate)",` COMPREPLY=(${compgen(AGGREGATE_FLAGS)})`," ;;"," duplicates)",` COMPREPLY=(${compgen(DUPLICATES_FLAGS)})`," ;;"," create)",` COMPREPLY=(${compgen(createFlags)})`," ;;"," copy)",` COMPREPLY=(${compgen(COPY_FLAGS)})`," ;;"," focus)",` COMPREPLY=(${compgen(FOCUS_FLAGS)})`," ;;"," update)",` COMPREPLY=(${compgen(updateFlags)})`," ;;"," update-many)",` COMPREPLY=(${compgen(updateManyFlags)})`," ;;"," calendar|cal)",` COMPREPLY=(${compgen(calendarFlags)})`," ;;"," context|ctx)",` COMPREPLY=(${compgen(contextFlags)})`," ;;"," next)",` COMPREPLY=(${compgen(NEXT_FLAGS)})`," ;;"," guide)",` COMPREPLY=(${compgen(`${GUIDE_FLAGS} ${GUIDE_TOPIC_CHOICES}`)})`," ;;"," search)",` COMPREPLY=(${compgen(searchFlags)})`," ;;"," reindex)",` COMPREPLY=(${compgen("--mode --progress --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," init)",` COMPREPLY=(${compgen(`${INIT_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)})`," ;;"," config)",` COMPREPLY=(${compgen("--criterion --clear-criteria --format --policy --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," extension)",` COMPREPLY=(${compgen(`${EXTENSION_LIFECYCLE_ACTIONS} ${EXTENSION_LIFECYCLE_FLAGS}`)})`," ;;"," package|packages)",` COMPREPLY=(${compgen(`${PACKAGE_LIFECYCLE_ACTIONS} ${PACKAGE_LIFECYCLE_FLAGS} ${UPGRADE_FLAGS}`)})`," ;;"," comments)",` COMPREPLY=(${compgen("--add --body --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," notes)",` COMPREPLY=(${compgen("--add --add-json --stdin --file --edit --delete --limit --since --event-type --include-meta --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," learnings)",` COMPREPLY=(${compgen("--add --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," files)",` COMPREPLY=(${compgen("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --explain --lines --decision-depth --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," docs)",` COMPREPLY=(${compgen("--add --add-glob --remove --migrate --note --validate-paths --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," append)",` COMPREPLY=(${compgen(APPEND_FLAGS)})`," ;;"," deps)",` COMPREPLY=(${compgen(DEPS_FLAGS)})`," ;;"," graph)",` COMPREPLY=(${compgen(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index ${GRAPH_FLAGS}`)})`," ;;"," test)",` COMPREPLY=(${compgen("--add --add-json --remove --remove-index --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," test-all)",` COMPREPLY=(${compgen("--status --limit --offset --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," test-runs)",` COMPREPLY=(${compgen("list status logs stop resume --status --limit --stream --tail --force --author --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," validate)",` COMPREPLY=(${compgen("--check-metadata --metadata-profile --check-resolution --check-lifecycle --check-stale-blockers --dependency-cycle-severity --parent-cycle-severity --check-files --scan-mode --include-pm-internals --verbose-file-lists --verbose-diagnostics --all-affected-ids --strict-exit --fail-on-warn --fix-hints --auto-fix --dry-run --fix-scope --prune-missing --check-history-drift --check-command-references --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," health)",` COMPREPLY=(${compgen(HEALTH_FLAGS)})`," ;;"," history)"," if [[ $word_index -eq $cword ]]; then",` COMPREPLY=(${compgen(`${HISTORY_FLAGS} ${HISTORY_LEAVES}`)})`," else",` COMPREPLY=(${compgen(HISTORY_FLAGS)})`," fi"," ;;"," events)",` COMPREPLY=(${compgen(EVENTS_FLAGS)})`," ;;"," history-author-acknowledge)",` COMPREPLY=(${compgen(`${HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)})`," ;;"," get)",` COMPREPLY=(${compgen(GET_FLAGS)})`," ;;"," schema)",` COMPREPLY=(${compgen("list show show-status add-type remove-type add-status remove-status add-field remove-field list-fields show-field apply-preset rename-type rename-field remap-status --description --default-status --folder --alias --role --order --type --commands --cli-flag --required --required-on-create --no-allow-unset --required-types --infer --min-count --apply --to --migration-id --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," profile)",` COMPREPLY=(${compgen("list show apply lint agile ops research --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," plan)",` COMPREPLY=(${compgen(`${PLAN_SUBCOMMANDS_LIST} ${PLAN_FLAGS}`)})`," ;;"," contracts)",` COMPREPLY=(${compgen(CONTRACTS_FLAGS)})`," ;;"," gc)",` COMPREPLY=(${compgen("--dry-run --scope --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`," ;;"," stats)",` COMPREPLY=(${compgen(STATS_FLAGS)})`," ;;"," close|close-task)",` COMPREPLY=(${compgen(CLOSE_MUTATION_FLAGS)})`," ;;"," close-many)",` COMPREPLY=(${compgen(CLOSE_MANY_FLAGS)})`," ;;"," release)",` COMPREPLY=(${compgen(RELEASE_MUTATION_FLAGS)})`," ;;"," delete)",` COMPREPLY=(${compgen(DELETE_MUTATION_FLAGS)})`," ;;"," claim|start-task|pause-task)",` COMPREPLY=(${compgen(MUTATION_FLAGS)})`," ;;"," meet|event)",` COMPREPLY=(${compgen(MEET_FLAGS)})`," ;;"," remind)",` COMPREPLY=(${compgen(REMIND_FLAGS)})`," ;;"," completion)",` COMPREPLY=(${compgen(COMPLETION_SHELL_CHOICES)})`," ;;"," templates)",` COMPREPLY=(${compgen("save list show")})`," ;;"," *)",` COMPREPLY=(${compgen(GLOBAL_FLAGS)})`," ;;"," esac",' if [[ "$cmd" == "comments" || "$cmd" == "notes" || "$cmd" == "learnings" ]]; then',` COMPREPLY+=(${compgen("--text")})`," fi"," return 0","}","","complete -F _pm_completion pm"].join("\n")}function generateZshScript(itemTypes=[],tags=[],eagerTagExpansion=false,runtime={}){const useDynamicTypeExpansion=itemTypes.length===0;const typeFallbackChoices=completionTypeValues(itemTypes,runtime);const statusFallbackChoices=completionStatusValues(runtime);const typeChoices=useDynamicTypeExpansion?'${(f)"$(_pm_type_choices)"}':typeFallbackChoices;const statusChoices='${(f)"$(_pm_status_choices)"}';const guideTopicChoices=GUIDE_TOPIC_CHOICES;const tagChoices=joinCompletionValues(tags);const useEagerTagExpansion=eagerTagExpansion||tags.length>0;const zshTagChoices=useEagerTagExpansion?tagChoices:'${(f)"$(_pm_tag_choices)"}';const zshListRuntimeFieldFlags=renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.list);const zshCreateRuntimeFieldFlags=renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.create);const zshSearchRuntimeFieldFlags=renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.search);const zshCalendarRuntimeFieldFlags=renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.calendar);const zshContextRuntimeFieldFlags=renderZshRuntimeFieldFlagSpecs(runtime.command_flags?.context);const zshPresenceFilterFlags=renderZshPresenceFilterSpecs({missingPrefix:"filter-",pairedPrefix:"",includeContentMissingAliases:true});const zshBulkPresenceFilterFlags=renderZshPresenceFilterSpecs({missingPrefix:"filter-",pairedPrefix:"filter-"});const zshMutationCollectionFlags=renderZshArgumentSpecs(ZSH_MUTATION_COLLECTION_ARGUMENT_SPECS);const dynamicTagResolver=useEagerTagExpansion?"":`
|
|
757
47
|
_pm_tag_choices() {
|
|
758
48
|
local now ttl cache_ts
|
|
759
49
|
now=\${EPOCHSECONDS:-0}
|
|
@@ -767,8 +57,7 @@ _pm_tag_choices() {
|
|
|
767
57
|
PM_COMPLETION_TAG_CACHE_TS="$now"
|
|
768
58
|
print -r -- "$PM_COMPLETION_TAG_CACHE"
|
|
769
59
|
}
|
|
770
|
-
`;
|
|
771
|
-
return `#compdef pm
|
|
60
|
+
`;return`#compdef pm
|
|
772
61
|
# zsh completion for pm
|
|
773
62
|
# Source this file or add 'eval "$(pm completion zsh)"' to ~/.zshrc
|
|
774
63
|
|
|
@@ -780,11 +69,41 @@ ${renderZshCommandDescriptions()}
|
|
|
780
69
|
_describe 'command' commands
|
|
781
70
|
}
|
|
782
71
|
${dynamicTagResolver}
|
|
783
|
-
${useDynamicTypeExpansion
|
|
784
|
-
${renderZshDynamicChoiceResolver("status",
|
|
72
|
+
${useDynamicTypeExpansion?renderZshDynamicChoiceResolver("type","completion-types",typeFallbackChoices):""}
|
|
73
|
+
${renderZshDynamicChoiceResolver("status","completion-statuses",statusFallbackChoices)}
|
|
785
74
|
|
|
786
75
|
_pm() {
|
|
787
76
|
local context state line
|
|
77
|
+
local -a words=("$words[@]")
|
|
78
|
+
local CURRENT=$CURRENT
|
|
79
|
+
local word_index=2 history_seen=0 operation_index=0 word
|
|
80
|
+
while (( word_index < CURRENT )); do
|
|
81
|
+
word="$words[word_index]"
|
|
82
|
+
case "\${word//_/-}" in
|
|
83
|
+
${GLOBAL_COMPLETION_VALUE_PATTERNS}) (( word_index += 2 )); continue ;;
|
|
84
|
+
${GLOBAL_COMPLETION_INLINE_PATTERNS}|${GLOBAL_COMPLETION_SWITCH_PATTERNS}) (( word_index++ )); continue ;;
|
|
85
|
+
--) break ;;
|
|
86
|
+
esac
|
|
87
|
+
if (( history_seen == 0 )); then
|
|
88
|
+
[[ "$word" == "history" ]] || break
|
|
89
|
+
history_seen=1
|
|
90
|
+
else
|
|
91
|
+
operation_index=$word_index
|
|
92
|
+
break
|
|
93
|
+
fi
|
|
94
|
+
(( word_index++ ))
|
|
95
|
+
done
|
|
96
|
+
if (( history_seen && word_index == CURRENT )) && [[ "$words[CURRENT]" != -* ]]; then
|
|
97
|
+
local -a history_commands
|
|
98
|
+
history_commands=(${HISTORY_LEAVES})
|
|
99
|
+
_describe 'history operation' history_commands
|
|
100
|
+
return
|
|
101
|
+
fi
|
|
102
|
+
if (( operation_index > 0 )); then
|
|
103
|
+
case "$words[operation_index]" in
|
|
104
|
+
${PM_HISTORY_COMMAND_ALIASES.map(entry=>` ${entry.canonical_argv[1]}) words=("$words[1]" "${entry.alias}" "\${words[@]:$operation_index}"); (( CURRENT -= operation_index - 2 )) ;;`).join("\n")}
|
|
105
|
+
esac
|
|
106
|
+
fi
|
|
788
107
|
_arguments -C \\
|
|
789
108
|
'--json[Output JSON instead of TOON]' \\
|
|
790
109
|
'--all[Reveal every public command and compatibility alias]' \\
|
|
@@ -962,7 +281,7 @@ ${zshMutationCollectionFlags}
|
|
|
962
281
|
;;
|
|
963
282
|
update-many)
|
|
964
283
|
_arguments \\
|
|
965
|
-
${renderZshBulkSelectionFilterSpecs("applying updates",
|
|
284
|
+
${renderZshBulkSelectionFilterSpecs("applying updates",statusChoices,typeChoices,zshTagChoices)}
|
|
966
285
|
'--filter-ac-missing[Select only items missing acceptance_criteria]' \\
|
|
967
286
|
'--filter-estimates-missing[Select only items missing estimated_minutes]' \\
|
|
968
287
|
'--filter-resolution-missing[Select only terminal items missing resolution]' \\
|
|
@@ -1027,7 +346,7 @@ ${zshMutationCollectionFlags}
|
|
|
1027
346
|
;;
|
|
1028
347
|
close-many)
|
|
1029
348
|
_arguments \\
|
|
1030
|
-
${renderZshBulkSelectionFilterSpecs("closing",
|
|
349
|
+
${renderZshBulkSelectionFilterSpecs("closing",statusChoices,typeChoices,zshTagChoices)}
|
|
1031
350
|
${zshBulkPresenceFilterFlags}
|
|
1032
351
|
'--ids[Explicit comma-separated ID allowlist]:ids' \\
|
|
1033
352
|
'--limit[Limit matched item count]:number' \\
|
|
@@ -1188,6 +507,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
1188
507
|
;;
|
|
1189
508
|
history-compact)
|
|
1190
509
|
_arguments \\
|
|
510
|
+
'--id[Item ID (alternative to positional ID)]:id' \\
|
|
1191
511
|
'--before[Compact entries strictly before this version number or ISO timestamp]:before' \\
|
|
1192
512
|
'--ids[Bulk: compact an explicit comma-separated list of item ids]:ids' \\
|
|
1193
513
|
'--all-over[Bulk: compact every stream with more than N entries]:all-over' \\
|
|
@@ -1226,6 +546,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
1226
546
|
;;
|
|
1227
547
|
history-redact)
|
|
1228
548
|
_arguments \\
|
|
549
|
+
'--id[Item ID (alternative to positional ID)]:id' \\
|
|
1229
550
|
'--literal[Literal string matcher to redact from history/item payloads]:literal' \\
|
|
1230
551
|
'--regex[Regex matcher to redact (/pattern/flags or raw pattern)]:regex' \\
|
|
1231
552
|
'--replacement[Replacement text (defaults to [redacted])]:replacement' \\
|
|
@@ -1238,6 +559,9 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
1238
559
|
;;
|
|
1239
560
|
history-repair)
|
|
1240
561
|
_arguments \\
|
|
562
|
+
'--id[Item ID (alternative to positional ID)]:id' \\
|
|
563
|
+
'--salvage-tail[Recover an invalid suffix after a verified prefix]' \\
|
|
564
|
+
'--normalize-provenance[Remove invalid provenance with aggregate evidence]' \\
|
|
1241
565
|
'--all[Repair every drifted stream in one audited pass]' \\
|
|
1242
566
|
'--dry-run[Preview the re-anchor impact without writing the history file]' \\
|
|
1243
567
|
'--author[Mutation author]:author' \\
|
|
@@ -1314,6 +638,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
1314
638
|
'--from[Lower timestamp bound (ISO/date string or relative)]:date' \\
|
|
1315
639
|
'--to[Upper timestamp bound (ISO/date string or relative)]:date' \\
|
|
1316
640
|
'--limit[Max entries]:number' \\
|
|
641
|
+
'--unbounded[Return every matching activity entry]' \\
|
|
1317
642
|
'--compact[Condensed activity projection]' \\
|
|
1318
643
|
'--raw[Emit raw compact per-event activity output]' \\
|
|
1319
644
|
'--full[Show full activity entries]' \\
|
|
@@ -1322,7 +647,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
1322
647
|
'*--harness[Filter by recorded or vocabulary-resolved harness]:harness' \\
|
|
1323
648
|
'*--agent-instance[Filter by privacy-safe agent instance]:instance' \\
|
|
1324
649
|
'*--provenance-filter[Filter by exact declared provenance value]:dimension=value' \\
|
|
1325
|
-
'--stream[Emit line-delimited JSON rows (requires --json)]:
|
|
650
|
+
'--stream[Emit line-delimited JSON rows (requires --json)]::mode:(rows ndjson jsonl)' \\
|
|
1326
651
|
'--json[Output JSON]' \\
|
|
1327
652
|
'--quiet[Suppress stdout]'
|
|
1328
653
|
;;
|
|
@@ -1620,6 +945,10 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
1620
945
|
'--json[Output JSON]' \\
|
|
1621
946
|
'--quiet[Suppress stdout]'
|
|
1622
947
|
;;
|
|
948
|
+
restore)
|
|
949
|
+
_arguments \\
|
|
950
|
+
${renderZshArgumentSpecs(RESTORE_INVOCATIONS.map(flag=>`'${flag.flag}[${flag.description}]${flag.takes_value?":value":""}'`),{trailingContinuation:false})}
|
|
951
|
+
;;
|
|
1623
952
|
start-task|pause-task)
|
|
1624
953
|
_arguments \\
|
|
1625
954
|
'--author[Mutation author]:author' \\
|
|
@@ -1779,36 +1108,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
1779
1108
|
esac
|
|
1780
1109
|
}
|
|
1781
1110
|
|
|
1782
|
-
compdef _pm pm
|
|
1783
|
-
}
|
|
1784
|
-
/** Implements generate fish script for the public runtime surface of this module. */
|
|
1785
|
-
export function generateFishScript(itemTypes = [], tags = [], eagerTagExpansion = false, runtime = {}) {
|
|
1786
|
-
const listCommandNames = ALL_COMMANDS.filter((command) => command === "list" || command.startsWith("list-"));
|
|
1787
|
-
const listCmds = listCommandNames.join(" ");
|
|
1788
|
-
const noSubcommandList = ALL_COMMANDS.join(" ");
|
|
1789
|
-
const useDynamicTypeExpansion = itemTypes.length === 0;
|
|
1790
|
-
const typeFallbackChoices = completionTypeValues(itemTypes, runtime);
|
|
1791
|
-
const statusFallbackChoices = completionStatusValues(runtime);
|
|
1792
|
-
const typeChoices = useDynamicTypeExpansion
|
|
1793
|
-
? "(__pm_type_choices)"
|
|
1794
|
-
: typeFallbackChoices;
|
|
1795
|
-
const statusChoices = "(__pm_status_choices)";
|
|
1796
|
-
const guideTopicChoices = GUIDE_TOPIC_CHOICES;
|
|
1797
|
-
const tagChoices = joinCompletionValues(tags);
|
|
1798
|
-
const useEagerTagExpansion = eagerTagExpansion || tags.length > 0;
|
|
1799
|
-
const fishTagChoices = useEagerTagExpansion
|
|
1800
|
-
? `'${tagChoices}'`
|
|
1801
|
-
: "'(__pm_tag_choices)'";
|
|
1802
|
-
const fishListRuntimeFieldFlags = renderFishRuntimeFieldFlagSpecs(listCommandNames, runtime.command_flags?.list);
|
|
1803
|
-
const fishCreateRuntimeFieldFlags = renderFishRuntimeFieldFlagSpecs(["create"], runtime.command_flags?.create);
|
|
1804
|
-
const fishUpdateRuntimeFieldFlags = renderFishRuntimeFieldFlagSpecs(["update"], runtime.command_flags?.update);
|
|
1805
|
-
const fishUpdateManyRuntimeFieldFlags = renderFishRuntimeFieldFlagSpecs(["update-many"], runtime.command_flags?.["update-many"]);
|
|
1806
|
-
const fishSearchRuntimeFieldFlags = renderFishRuntimeFieldFlagSpecs(["search"], runtime.command_flags?.search);
|
|
1807
|
-
const fishCalendarRuntimeFieldFlags = renderFishRuntimeFieldFlagSpecs(["calendar", "cal"], runtime.command_flags?.calendar);
|
|
1808
|
-
const fishContextRuntimeFieldFlags = renderFishRuntimeFieldFlagSpecs(["context", "ctx"], runtime.command_flags?.context);
|
|
1809
|
-
const dynamicTagResolver = useEagerTagExpansion
|
|
1810
|
-
? ""
|
|
1811
|
-
: `
|
|
1111
|
+
compdef _pm pm`}function generateFishScript(itemTypes=[],tags=[],eagerTagExpansion=false,runtime={}){const listCommandNames=ALL_COMMANDS.filter(command=>command==="list"||command.startsWith("list-"));const listCmds=listCommandNames.join(" ");const noSubcommandList=ALL_COMMANDS.join(" ");const useDynamicTypeExpansion=itemTypes.length===0;const typeFallbackChoices=completionTypeValues(itemTypes,runtime);const statusFallbackChoices=completionStatusValues(runtime);const typeChoices=useDynamicTypeExpansion?"(__pm_type_choices)":typeFallbackChoices;const statusChoices="(__pm_status_choices)";const guideTopicChoices=GUIDE_TOPIC_CHOICES;const tagChoices=joinCompletionValues(tags);const useEagerTagExpansion=eagerTagExpansion||tags.length>0;const fishTagChoices=useEagerTagExpansion?`'${tagChoices}'`:"'(__pm_tag_choices)'";const fishListRuntimeFieldFlags=renderFishRuntimeFieldFlagSpecs(listCommandNames,runtime.command_flags?.list);const fishCreateRuntimeFieldFlags=renderFishRuntimeFieldFlagSpecs(["create"],runtime.command_flags?.create);const fishUpdateRuntimeFieldFlags=renderFishRuntimeFieldFlagSpecs(["update"],runtime.command_flags?.update);const fishUpdateManyRuntimeFieldFlags=renderFishRuntimeFieldFlagSpecs(["update-many"],runtime.command_flags?.["update-many"]);const fishSearchRuntimeFieldFlags=renderFishRuntimeFieldFlagSpecs(["search"],runtime.command_flags?.search);const fishCalendarRuntimeFieldFlags=renderFishRuntimeFieldFlagSpecs(["calendar","cal"],runtime.command_flags?.calendar);const fishContextRuntimeFieldFlags=renderFishRuntimeFieldFlagSpecs(["context","ctx"],runtime.command_flags?.context);const dynamicTagResolver=useEagerTagExpansion?"":`
|
|
1812
1112
|
function __pm_tag_choices
|
|
1813
1113
|
set -l now (date +%s ^/dev/null)
|
|
1814
1114
|
if test -z "$now"
|
|
@@ -1821,17 +1121,18 @@ function __pm_tag_choices
|
|
|
1821
1121
|
if set -q PM_COMPLETION_TAG_CACHE; and set -q PM_COMPLETION_TAG_CACHE_TS
|
|
1822
1122
|
set -l age (math "$now - $PM_COMPLETION_TAG_CACHE_TS")
|
|
1823
1123
|
if test $age -lt $ttl
|
|
1824
|
-
printf '%s
|
|
1124
|
+
printf '%s
|
|
1125
|
+
' $PM_COMPLETION_TAG_CACHE
|
|
1825
1126
|
return
|
|
1826
1127
|
end
|
|
1827
1128
|
end
|
|
1828
1129
|
set -l resolved (pm completion-tags ^/dev/null)
|
|
1829
1130
|
set -gx PM_COMPLETION_TAG_CACHE $resolved
|
|
1830
1131
|
set -gx PM_COMPLETION_TAG_CACHE_TS $now
|
|
1831
|
-
printf '%s
|
|
1132
|
+
printf '%s
|
|
1133
|
+
' $resolved
|
|
1832
1134
|
end
|
|
1833
|
-
`;
|
|
1834
|
-
return `# Fish shell completion for pm
|
|
1135
|
+
`;return`# Fish shell completion for pm
|
|
1835
1136
|
# Save to ~/.config/fish/completions/pm.fish
|
|
1836
1137
|
# or run: pm completion fish > ~/.config/fish/completions/pm.fish
|
|
1837
1138
|
|
|
@@ -1862,8 +1163,8 @@ function __pm_no_subcommand
|
|
|
1862
1163
|
not __fish_seen_subcommand_from ${noSubcommandList}
|
|
1863
1164
|
end
|
|
1864
1165
|
${dynamicTagResolver}
|
|
1865
|
-
${useDynamicTypeExpansion
|
|
1866
|
-
${renderFishDynamicChoiceResolver("status",
|
|
1166
|
+
${useDynamicTypeExpansion?renderFishDynamicChoiceResolver("type","completion-types",typeFallbackChoices):""}
|
|
1167
|
+
${renderFishDynamicChoiceResolver("status","completion-statuses",statusFallbackChoices)}
|
|
1867
1168
|
|
|
1868
1169
|
# Subcommands
|
|
1869
1170
|
${renderFishCommandDescriptions()}
|
|
@@ -2295,18 +1596,61 @@ complete -c pm -n '__fish_seen_subcommand_from get' -l fields -d 'Render custom
|
|
|
2295
1596
|
complete -c pm -n '__fish_seen_subcommand_from get' -l tree -d 'Include descendant subtree in result payload'
|
|
2296
1597
|
complete -c pm -n '__fish_seen_subcommand_from get' -l tree-depth -d 'Cap subtree depth for --tree (0 = root only)' -r
|
|
2297
1598
|
|
|
1599
|
+
# Read the first command positions after consuming recognized global options.
|
|
1600
|
+
function __pm_history_tokens
|
|
1601
|
+
set -l tokens (commandline -opc)
|
|
1602
|
+
set -l skip_value 0
|
|
1603
|
+
set -l positions 0
|
|
1604
|
+
for token in $tokens[2..-1]
|
|
1605
|
+
if test $skip_value -eq 1
|
|
1606
|
+
set skip_value 0
|
|
1607
|
+
continue
|
|
1608
|
+
end
|
|
1609
|
+
switch (string replace -a _ - -- "$token")
|
|
1610
|
+
case ${GLOBAL_COMPLETION_VALUE_PATTERNS.replaceAll("|"," ")}
|
|
1611
|
+
set skip_value 1
|
|
1612
|
+
continue
|
|
1613
|
+
case ${GLOBAL_COMPLETION_INLINE_PATTERNS.split("|").map(pattern=>`'${pattern}'`).join(" ")} ${GLOBAL_COMPLETION_SWITCH_PATTERNS.replaceAll("|"," ")}
|
|
1614
|
+
continue
|
|
1615
|
+
case --
|
|
1616
|
+
printf '%s\\n' --
|
|
1617
|
+
return
|
|
1618
|
+
end
|
|
1619
|
+
printf '%s\\n' "$token"
|
|
1620
|
+
set positions (math $positions + 1)
|
|
1621
|
+
if test $positions -eq 2; or test "$token" != history
|
|
1622
|
+
return
|
|
1623
|
+
end
|
|
1624
|
+
end
|
|
1625
|
+
if test $skip_value -eq 1
|
|
1626
|
+
printf '%s\\n' --value
|
|
1627
|
+
end
|
|
1628
|
+
end
|
|
1629
|
+
|
|
1630
|
+
# Match only the command positions, keeping item history separate from maintenance.
|
|
1631
|
+
function __pm_history_operation
|
|
1632
|
+
set -l tokens (__pm_history_tokens)
|
|
1633
|
+
if test "$tokens[1]" = history; and contains -- "$tokens[2]" ${HISTORY_LEAVES}
|
|
1634
|
+
test "$tokens[2]" = "$argv[2]"
|
|
1635
|
+
else
|
|
1636
|
+
test "$tokens[1]" = "$argv[1]"
|
|
1637
|
+
end
|
|
1638
|
+
end
|
|
1639
|
+
complete -c pm -n 'test (count (__pm_history_tokens)) -eq 1; and __pm_history_operation history' -a '${HISTORY_LEAVES}' -d 'History operation'
|
|
1640
|
+
${RESTORE_INVOCATIONS.map(flag=>`complete -c pm -n '__pm_history_operation restore restore' -l ${flag.flag.slice(2)}${flag.takes_value?" -r":""}`).join("\n")}
|
|
1641
|
+
|
|
2298
1642
|
# history / activity flags
|
|
2299
|
-
complete -c pm -n '
|
|
2300
|
-
complete -c pm -n '
|
|
2301
|
-
complete -c pm -n '
|
|
2302
|
-
complete -c pm -n '
|
|
2303
|
-
complete -c pm -n '
|
|
2304
|
-
complete -c pm -n '
|
|
2305
|
-
complete -c pm -n '
|
|
2306
|
-
complete -c pm -n '
|
|
2307
|
-
complete -c pm -n '
|
|
2308
|
-
complete -c pm -n '
|
|
2309
|
-
complete -c pm -n '
|
|
1643
|
+
complete -c pm -n '__pm_history_operation history' -l limit -d 'Max history entries' -r
|
|
1644
|
+
complete -c pm -n '__pm_history_operation history' -l compact -d 'Condensed history projection'
|
|
1645
|
+
complete -c pm -n '__pm_history_operation history' -l full -d 'Show full history entries'
|
|
1646
|
+
complete -c pm -n '__pm_history_operation history' -l provenance -d 'Patch-free identity and agent provenance projection'
|
|
1647
|
+
complete -c pm -n '__pm_history_operation history' -l provenance-summary -d 'Include bounded provenance completeness counts'
|
|
1648
|
+
complete -c pm -n '__pm_history_operation history' -l harness -d 'Filter by recorded or vocabulary-resolved harness' -r
|
|
1649
|
+
complete -c pm -n '__pm_history_operation history' -l agent-instance -d 'Filter by privacy-safe agent instance' -r
|
|
1650
|
+
complete -c pm -n '__pm_history_operation history' -l provenance-filter -d 'Filter by exact declared provenance value' -r
|
|
1651
|
+
complete -c pm -n '__pm_history_operation history' -l diff -d 'Include per-entry field-level before/after value diffs'
|
|
1652
|
+
complete -c pm -n '__pm_history_operation history' -l field -d 'With --diff, show only entries that changed this field' -r
|
|
1653
|
+
complete -c pm -n '__pm_history_operation history' -l verify -d 'Verify history hash chain and replay integrity'
|
|
2310
1654
|
complete -c pm -n '__fish_seen_subcommand_from events' -l since -d 'Resume after a cursor or from an ISO timestamp' -r
|
|
2311
1655
|
complete -c pm -n '__fish_seen_subcommand_from events' -l type -d 'Filter by mutation operation' -r
|
|
2312
1656
|
complete -c pm -n '__fish_seen_subcommand_from events' -l author -d 'Filter by mutation author' -r
|
|
@@ -2320,16 +1664,17 @@ complete -c pm -n '__fish_seen_subcommand_from events' -l agent-instance -d 'Fil
|
|
|
2320
1664
|
complete -c pm -n '__fish_seen_subcommand_from events' -l provenance-filter -d 'Filter by exact declared provenance value' -r
|
|
2321
1665
|
complete -c pm -n '__fish_seen_subcommand_from events' -l follow -d 'Continue emitting committed events'
|
|
2322
1666
|
complete -c pm -n '__fish_seen_subcommand_from events' -l interval-ms -d 'Empty-read delay while following' -r
|
|
2323
|
-
complete -c pm -n '
|
|
2324
|
-
complete -c pm -n '
|
|
2325
|
-
complete -c pm -n '
|
|
2326
|
-
complete -c pm -n '
|
|
2327
|
-
complete -c pm -n '
|
|
2328
|
-
complete -c pm -n '
|
|
2329
|
-
complete -c pm -n '
|
|
2330
|
-
complete -c pm -n '
|
|
2331
|
-
complete -c pm -n '
|
|
2332
|
-
complete -c pm -n '
|
|
1667
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l before -d 'Compact entries strictly before this version number or ISO timestamp' -r
|
|
1668
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l id -d 'Item ID (alternative to positional ID)' -r
|
|
1669
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l ids -d 'Bulk: compact an explicit comma-separated list of item ids' -r
|
|
1670
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l all-over -d 'Bulk: compact every stream with more than N entries' -r
|
|
1671
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l closed -d 'Bulk: compact only closed (terminal) items streams'
|
|
1672
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l all-streams -d 'Bulk: compact every history stream regardless of lifecycle state'
|
|
1673
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l min-entries -d 'Bulk: skip streams with at most N entries' -r
|
|
1674
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l dry-run -d 'Preview compaction impact without writing the history file'
|
|
1675
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l author -d 'Mutation author' -r
|
|
1676
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l message -d 'Audit history message' -r
|
|
1677
|
+
complete -c pm -n '__pm_history_operation history-compact compact' -l force -d 'Force ownership/lock override'
|
|
2333
1678
|
complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l event -d 'Actionable unknown-author event' -r
|
|
2334
1679
|
complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l all-actionable -d 'Select every currently actionable event'
|
|
2335
1680
|
complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l dry-run -d 'Preview a deterministic source-bound plan'
|
|
@@ -2338,18 +1683,22 @@ complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l li
|
|
|
2338
1683
|
complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l attributed-author -d 'Principal attributed by maintainer review' -r
|
|
2339
1684
|
complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l reviewer -d 'Reviewer recording the disposition' -r
|
|
2340
1685
|
complete -c pm -n '__fish_seen_subcommand_from history-author-acknowledge' -l reason -d 'Evidence-backed review rationale' -r
|
|
2341
|
-
complete -c pm -n '
|
|
2342
|
-
complete -c pm -n '
|
|
2343
|
-
complete -c pm -n '
|
|
2344
|
-
complete -c pm -n '
|
|
2345
|
-
complete -c pm -n '
|
|
2346
|
-
complete -c pm -n '
|
|
2347
|
-
complete -c pm -n '
|
|
2348
|
-
complete -c pm -n '
|
|
2349
|
-
complete -c pm -n '
|
|
2350
|
-
complete -c pm -n '
|
|
2351
|
-
complete -c pm -n '
|
|
2352
|
-
complete -c pm -n '
|
|
1686
|
+
complete -c pm -n '__pm_history_operation history-redact redact' -l literal -d 'Literal string matcher to redact from history/item payloads' -r
|
|
1687
|
+
complete -c pm -n '__pm_history_operation history-redact redact' -l id -d 'Item ID (alternative to positional ID)' -r
|
|
1688
|
+
complete -c pm -n '__pm_history_operation history-redact redact' -l regex -d 'Regex matcher to redact (/pattern/flags or raw pattern)' -r
|
|
1689
|
+
complete -c pm -n '__pm_history_operation history-redact redact' -l replacement -d 'Replacement text (defaults to [redacted])' -r
|
|
1690
|
+
complete -c pm -n '__pm_history_operation history-redact redact' -l dry-run -d 'Preview redaction impact without writing files'
|
|
1691
|
+
complete -c pm -n '__pm_history_operation history-redact redact' -l author -d 'Mutation author' -r
|
|
1692
|
+
complete -c pm -n '__pm_history_operation history-redact redact' -l message -d 'Audit history message' -r
|
|
1693
|
+
complete -c pm -n '__pm_history_operation history-redact redact' -l force -d 'Force ownership/lock override'
|
|
1694
|
+
complete -c pm -n '__pm_history_operation history-repair repair' -l salvage-tail -d 'Recover an invalid suffix after a verified prefix'
|
|
1695
|
+
complete -c pm -n '__pm_history_operation history-repair repair' -l id -d 'Item ID (alternative to positional ID)' -r
|
|
1696
|
+
complete -c pm -n '__pm_history_operation history-repair repair' -l normalize-provenance -d 'Remove invalid provenance with aggregate evidence'
|
|
1697
|
+
complete -c pm -n '__pm_history_operation history-repair repair' -l all -d 'Repair every drifted stream in one audited pass'
|
|
1698
|
+
complete -c pm -n '__pm_history_operation history-repair repair' -l dry-run -d 'Preview the re-anchor impact without writing the history file'
|
|
1699
|
+
complete -c pm -n '__pm_history_operation history-repair repair' -l author -d 'Mutation author' -r
|
|
1700
|
+
complete -c pm -n '__pm_history_operation history-repair repair' -l message -d 'Audit history message' -r
|
|
1701
|
+
complete -c pm -n '__pm_history_operation history-repair repair' -l force -d 'Force ownership/lock override'
|
|
2353
1702
|
complete -c pm -n '__fish_seen_subcommand_from schema' -a 'list show show-status add-type remove-type add-status remove-status add-field remove-field list-fields show-field apply-preset rename-type rename-field remap-status' -d 'Schema subcommand'
|
|
2354
1703
|
complete -c pm -n '__fish_seen_subcommand_from schema' -l description -d 'Human description for the custom item type, status, or field' -r
|
|
2355
1704
|
complete -c pm -n '__fish_seen_subcommand_from schema' -l default-status -d 'Default status hint for the custom item type' -r
|
|
@@ -2395,21 +1744,22 @@ complete -c pm -n '__fish_seen_subcommand_from plan' -l promote-to-item-dep -d '
|
|
|
2395
1744
|
complete -c pm -n '__fish_seen_subcommand_from plan' -l author -d 'Mutation author' -r
|
|
2396
1745
|
complete -c pm -n '__fish_seen_subcommand_from plan' -l message -d 'Mutation message' -r
|
|
2397
1746
|
complete -c pm -n '__fish_seen_subcommand_from plan' -l force -d 'Force ownership override'
|
|
2398
|
-
complete -c pm -n '
|
|
2399
|
-
complete -c pm -n '
|
|
2400
|
-
complete -c pm -n '
|
|
2401
|
-
complete -c pm -n '
|
|
2402
|
-
complete -c pm -n '
|
|
2403
|
-
complete -c pm -n '
|
|
2404
|
-
complete -c pm -n '
|
|
2405
|
-
complete -c pm -n '
|
|
2406
|
-
complete -c pm -n '
|
|
2407
|
-
complete -c pm -n '
|
|
2408
|
-
complete -c pm -n '
|
|
2409
|
-
complete -c pm -n '
|
|
2410
|
-
complete -c pm -n '
|
|
2411
|
-
complete -c pm -n '
|
|
2412
|
-
complete -c pm -n '
|
|
1747
|
+
complete -c pm -n '__pm_history_operation activity activity' -l id -d 'Filter by item ID' -r
|
|
1748
|
+
complete -c pm -n '__pm_history_operation activity activity' -l op -d 'Filter by history operation' -r
|
|
1749
|
+
complete -c pm -n '__pm_history_operation activity activity' -l author -d 'Filter by history author' -r
|
|
1750
|
+
complete -c pm -n '__pm_history_operation activity activity' -l from -d 'Lower timestamp bound (ISO/date string or relative)' -r
|
|
1751
|
+
complete -c pm -n '__pm_history_operation activity activity' -l to -d 'Upper timestamp bound (ISO/date string or relative)' -r
|
|
1752
|
+
complete -c pm -n '__pm_history_operation activity activity' -l limit -d 'Max activity entries' -r
|
|
1753
|
+
complete -c pm -n '__pm_history_operation activity activity' -l unbounded -d 'Return every matching activity entry'
|
|
1754
|
+
complete -c pm -n '__pm_history_operation activity activity' -l compact -d 'Condensed activity projection'
|
|
1755
|
+
complete -c pm -n '__pm_history_operation activity activity' -l raw -d 'Emit raw compact per-event activity output'
|
|
1756
|
+
complete -c pm -n '__pm_history_operation activity activity' -l full -d 'Show full activity entries'
|
|
1757
|
+
complete -c pm -n '__pm_history_operation activity activity' -l provenance -d 'Patch-free identity and agent provenance projection'
|
|
1758
|
+
complete -c pm -n '__pm_history_operation activity activity' -l provenance-summary -d 'Include bounded provenance completeness counts'
|
|
1759
|
+
complete -c pm -n '__pm_history_operation activity activity' -l harness -d 'Filter by recorded or vocabulary-resolved harness' -r
|
|
1760
|
+
complete -c pm -n '__pm_history_operation activity activity' -l agent-instance -d 'Filter by privacy-safe agent instance' -r
|
|
1761
|
+
complete -c pm -n '__pm_history_operation activity activity' -l provenance-filter -d 'Filter by exact declared provenance value' -r
|
|
1762
|
+
complete -c pm -n '__pm_history_operation activity activity' -l stream -d 'Emit line-delimited JSON rows (requires --json)'
|
|
2413
1763
|
complete -c pm -n '__fish_seen_subcommand_from contracts' -l action -d 'Filter schema by tool action' -r
|
|
2414
1764
|
complete -c pm -n '__fish_seen_subcommand_from contracts' -l command -d 'Scope output to one command (narrow-by-default)' -r
|
|
2415
1765
|
complete -c pm -n '__fish_seen_subcommand_from contracts' -l summary -d 'Return compact command intent summary'
|
|
@@ -2767,35 +2117,5 @@ for package_cmd in package packages
|
|
|
2767
2117
|
complete -c pm -n "__fish_seen_subcommand_from $package_cmd" -l repair -d 'Force npm global reinstall for the CLI/SDK'
|
|
2768
2118
|
complete -c pm -n "__fish_seen_subcommand_from $package_cmd" -l tag -d 'npm version or dist-tag for upgrades' -r
|
|
2769
2119
|
complete -c pm -n "__fish_seen_subcommand_from $package_cmd" -l package-name -d 'Override the CLI package name' -r
|
|
2770
|
-
end
|
|
2771
|
-
}
|
|
2772
|
-
const SETUP_HINTS = {
|
|
2773
|
-
bash: 'Add to ~/.bashrc or ~/.bash_profile: eval "$(pm completion bash)"',
|
|
2774
|
-
zsh: 'Add to ~/.zshrc: eval "$(pm completion zsh)"',
|
|
2775
|
-
fish: "Run: pm completion fish > ~/.config/fish/completions/pm.fish",
|
|
2776
|
-
};
|
|
2777
|
-
/** Implements run completion for the public runtime surface of this module. */
|
|
2778
|
-
export function runCompletion(shell, itemTypes = [], tags = [], eagerTagExpansion = false, runtime = {}) {
|
|
2779
|
-
const normalized = shell.trim().toLowerCase();
|
|
2780
|
-
if (!VALID_SHELLS.includes(normalized)) {
|
|
2781
|
-
throw new PmCliError(`Unknown shell: "${shell}". Supported shells: ${VALID_SHELLS.join(", ")}.`, EXIT_CODE.USAGE);
|
|
2782
|
-
}
|
|
2783
|
-
const validShell = normalized;
|
|
2784
|
-
let script;
|
|
2785
|
-
if (validShell === "bash") {
|
|
2786
|
-
script = generateBashScript(itemTypes, tags, eagerTagExpansion, runtime);
|
|
2787
|
-
}
|
|
2788
|
-
else if (validShell === "zsh") {
|
|
2789
|
-
script = generateZshScript(itemTypes, tags, eagerTagExpansion, runtime);
|
|
2790
|
-
}
|
|
2791
|
-
else {
|
|
2792
|
-
script = generateFishScript(itemTypes, tags, eagerTagExpansion, runtime);
|
|
2793
|
-
}
|
|
2794
|
-
return {
|
|
2795
|
-
shell: validShell,
|
|
2796
|
-
script,
|
|
2797
|
-
setup_hint: SETUP_HINTS[validShell],
|
|
2798
|
-
};
|
|
2799
|
-
}
|
|
2120
|
+
end`}const SETUP_HINTS={bash:'Add to ~/.bashrc or ~/.bash_profile: eval "$(pm completion bash)"',zsh:'Add to ~/.zshrc: eval "$(pm completion zsh)"',fish:"Run: pm completion fish > ~/.config/fish/completions/pm.fish"};function runCompletion(shell,itemTypes=[],tags=[],eagerTagExpansion=false,runtime={}){const normalized=shell.trim().toLowerCase();if(!VALID_SHELLS.includes(normalized)){throw new PmCliError(`Unknown shell: "${shell}". Supported shells: ${VALID_SHELLS.join(", ")}.`,EXIT_CODE.USAGE)}const validShell=normalized;let script;if(validShell==="bash"){script=generateBashScript(itemTypes,tags,eagerTagExpansion,runtime)}else if(validShell==="zsh"){script=generateZshScript(itemTypes,tags,eagerTagExpansion,runtime)}else{script=generateFishScript(itemTypes,tags,eagerTagExpansion,runtime)}return{shell:validShell,script,setup_hint:SETUP_HINTS[validShell]}}export{generateBashScript,generateFishScript,generateZshScript,runCompletion};
|
|
2800
2121
|
//# sourceMappingURL=completion.js.map
|
|
2801
|
-
//# debugId=4bf2b42b-91f3-5850-b1f1-d8a01525860c
|