@unbrained/pm-cli 2026.9.10 → 2026.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +53 -11
- package/dist/cli/command-namespaces.d.ts +2 -2
- package/dist/cli/command-namespaces.js +1 -1
- package/dist/cli/error-guidance.d.ts +10 -0
- package/dist/cli/error-guidance.js +1 -1
- package/dist/cli/extension-command-help.js +3 -3
- package/dist/cli/main.d.ts +4 -0
- package/dist/cli/main.js +2 -2
- package/dist/cli/option-values.d.ts +3 -0
- package/dist/cli/option-values.js +2 -0
- package/dist/cli/register-history-maintenance.js +2 -1
- package/dist/cli/register-list-query.js +2 -2
- package/dist/cli/register-mutation.d.ts +5 -0
- package/dist/cli/register-mutation.js +2 -16
- package/dist/cli/schema/registration.d.ts +4 -0
- package/dist/cli/schema/registration.js +16 -0
- package/dist/cli-bundle/bundle-manifest.json +156 -156
- package/dist/cli-bundle/chunks/{chunk-NKOYVKFM.js → chunk-2JAY4LFI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I6XT3DLQ.js → chunk-3ZJDGTYC.js} +53 -53
- package/dist/cli-bundle/chunks/chunk-67H4PKQ5.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-EOCKPCEY.js → chunk-7H33WPDF.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7KF6HCRC.js +20 -0
- package/dist/cli-bundle/chunks/chunk-DEGRLB6Y.js +235 -0
- package/dist/cli-bundle/chunks/chunk-GKY655T7.js +6 -0
- package/dist/cli-bundle/chunks/chunk-I6VQUHK6.js +8 -0
- package/dist/cli-bundle/chunks/chunk-PTX2JRFR.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-PYUITRSV.js → chunk-TAGDYARO.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X6POOZKD.js +29 -0
- package/dist/cli-bundle/chunks/{chunk-4SFBH77G.js → chunk-YU75JRTW.js} +156 -142
- package/dist/cli-bundle/chunks/{register-list-query-CUIW7SSE.js → register-list-query-KEZPDR6X.js} +6 -6
- package/dist/cli-bundle/chunks/register-mutation-HEXA3ZDM.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-XIZPLPQY.js → register-operations-TEZT65JF.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-JVGPCAIL.js → register-setup-IIL74WUG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZAWAL2CG.js → chunk-2BQ4JSJQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5CRND7UA.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-5PSYV3AT.js +164 -0
- package/dist/cli-bundle/focused-chunks/{chunk-SL5YVVPV.js → chunk-7EKXAUKF.js} +53 -52
- package/dist/cli-bundle/focused-chunks/chunk-BIOWOU6S.js +30 -0
- package/dist/cli-bundle/focused-chunks/chunk-EIXGDI77.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-GAKFECOQ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-HFAW3FJQ.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-U5SHHU7E.js → chunk-IURELABV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-KK7KSXUP.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZDNAWWQI.js → chunk-LWJBBM6X.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-MFVABYEU.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7N5MRONP.js → chunk-PERRTPIY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FHUARRMA.js → chunk-SDQOOL34.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-M36SF4GE.js → chunk-TTRB47KM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-VWMP6W7Y.js +20 -0
- package/dist/cli-bundle/focused-chunks/chunk-YNBACVQ2.js +2 -0
- package/dist/cli-bundle/main.js +21 -21
- 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 +10 -10
- package/dist/core/history/digest.d.ts +12 -0
- package/dist/core/history/digest.js +2 -0
- package/dist/core/history/drift-scan.js +1 -1
- package/dist/core/history/history.d.ts +5 -3
- package/dist/core/history/history.js +2 -2
- package/dist/core/history/operation-contract.d.ts +30 -0
- package/dist/core/history/operation-contract.js +2 -0
- package/dist/core/history/replay.d.ts +3 -2
- package/dist/core/history/replay.js +1 -1
- package/dist/core/history/tombstone.d.ts +3 -0
- package/dist/core/history/tombstone.js +2 -0
- package/dist/core/item/id.d.ts +8 -7
- package/dist/core/item/id.js +1 -1
- package/dist/core/output/mutation-projection.d.ts +1 -0
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/shared/command-line.d.ts +10 -0
- package/dist/core/shared/command-line.js +2 -0
- package/dist/core/shared/errors.d.ts +13 -0
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/store/item-store.d.ts +5 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/telemetry/runtime.d.ts +1 -0
- package/dist/core/telemetry/runtime.js +2 -2
- package/dist/sdk/agent/command-recovery.js +1 -1
- package/dist/sdk/agent/item-addressing.js +1 -1
- package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
- package/dist/sdk/agent-capability-contracts.js +1 -1
- package/dist/sdk/cli-bootstrap.d.ts +2 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.d.ts +2 -0
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/command-line.d.ts +1 -6
- package/dist/sdk/command-line.js +1 -1
- package/dist/sdk/comments.js +1 -1
- package/dist/sdk/completion.d.ts +2 -0
- package/dist/sdk/completion.js +26 -14
- package/dist/sdk/contracts.d.ts +2 -0
- package/dist/sdk/contracts.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance/storage-integrity.js +1 -1
- package/dist/sdk/governance/workflow-completeness.js +1 -1
- package/dist/sdk/governance/workflow-policy.js +2 -2
- package/dist/sdk/governance.d.ts +3 -0
- package/dist/sdk/governance.js +1 -1
- package/dist/sdk/history/attestation-command.d.ts +22 -0
- package/dist/sdk/history/attestation-command.js +3 -0
- package/dist/sdk/history/attestation-contract.d.ts +103 -0
- package/dist/sdk/history/attestation-contract.js +2 -0
- package/dist/sdk/history/attestation-scan.d.ts +16 -0
- package/dist/sdk/history/attestation-scan.js +2 -0
- package/dist/sdk/history/attestation.d.ts +8 -0
- package/dist/sdk/history/attestation.js +2 -0
- package/dist/sdk/history/salvage.js +1 -1
- package/dist/sdk/history-compact.js +1 -1
- package/dist/sdk/history-read.js +1 -1
- package/dist/sdk/history-redact.js +1 -1
- package/dist/sdk/history-repair.js +1 -1
- package/dist/sdk/index.d.ts +3 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/learnings.js +1 -1
- package/dist/sdk/lifecycle/claim.d.ts +2 -0
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/mcp-actions.d.ts +4 -0
- package/dist/sdk/lifecycle/mcp-actions.js +1 -1
- package/dist/sdk/lifecycle/task-composition.d.ts +2 -0
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/merge/reconcile.js +1 -1
- package/dist/sdk/merge/three-way.js +2 -2
- package/dist/sdk/notes.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/projection-contracts.d.ts +1 -1
- package/dist/sdk/query/projection-contracts.js +1 -1
- package/dist/sdk/read-output-budget.d.ts +4 -10
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.d.ts +1 -1
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-session.d.ts +1 -1
- package/dist/sdk/read-output-session.js +1 -1
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime.d.ts +3 -0
- package/dist/sdk/runtime.js +1 -1
- package/dist/types.d.ts +5 -1
- package/dist/types.js +1 -1
- package/docs/AGENT_UX_CONTRACTS.md +8 -0
- package/docs/ARCHITECTURE.md +7 -0
- package/docs/CLI_GRAMMAR.md +23 -0
- package/docs/HISTORY_ATTESTATION.md +164 -0
- package/docs/HISTORY_OPERATIONS.md +46 -0
- package/docs/HISTORY_RECOVERY.md +27 -2
- package/docs/LIFECYCLE_COMMANDS.md +19 -2
- package/docs/MERGE_SAFETY.md +64 -3
- package/docs/README.md +1 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +13 -0
- package/docs/WORKFLOW_POLICIES.md +47 -3
- package/docs/generated/AGENT_CAPABILITY_ROUTING.md +4 -4
- package/docs/generated/AGENT_COMMAND_SURFACE.md +5 -0
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +5 -0
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +10 -7
- package/marketplace.json +2 -2
- package/package.json +4 -4
- 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/README.md +31 -7
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +6 -3
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +7 -19
- 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/README.md +9 -5
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +3 -2
- 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/dist/cli-bundle/chunks/chunk-74RGSPLL.js +0 -2
- package/dist/cli-bundle/chunks/chunk-7WIHZI2M.js +0 -5
- package/dist/cli-bundle/chunks/chunk-GLQMKUGP.js +0 -2
- package/dist/cli-bundle/chunks/chunk-MACGGTLQ.js +0 -29
- package/dist/cli-bundle/chunks/chunk-P6BEYAON.js +0 -8
- package/dist/cli-bundle/chunks/chunk-TSWEX72T.js +0 -20
- package/dist/cli-bundle/chunks/chunk-YKQTETJI.js +0 -235
- package/dist/cli-bundle/chunks/register-mutation-5F5CYUWZ.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-26O2WB73.js +0 -10
- package/dist/cli-bundle/focused-chunks/chunk-5YU75QLV.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-B2CMFYRZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CRY5MHEI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-F6WKFXBT.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-OROZM37I.js +0 -177
- package/dist/cli-bundle/focused-chunks/chunk-PNGYYQY7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-TPOL4TWE.js +0 -9
- package/dist/cli-bundle/focused-chunks/chunk-XSMA2W6Q.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-ZJHYQOTM.js +0 -20
package/dist/sdk/completion.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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]="961951cf-e644-50ae-becc-205bea47225d")}catch(e2){}})();import{WORKFLOW_POLICY_ACTIONS}from"./cli-contracts/enum-contracts.js";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,PM_NAMESPACED_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=>!command.includes(" ")&&!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 NAMESPACE_NOUNS=[...new Set(PM_NAMESPACED_COMMAND_ALIASES.map(entry=>entry.canonical_argv[0]))];const NAMESPACE_LEAVES=Object.fromEntries(NAMESPACE_NOUNS.map(noun=>[noun,PM_NAMESPACED_COMMAND_ALIASES.filter(entry=>entry.canonical_argv[0]===noun).map(entry=>entry.canonical_argv[1]).join(" ")]));const HISTORY_LEAVES=NAMESPACE_LEAVES.history;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 SCHEMA_SUBCOMMAND_CHOICES=`${WORKFLOW_POLICY_ACTIONS.join(" ")} 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`;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=toCompletionFlagString(resolveSubcommandFlagContractsForCommand("close"));const CLOSE_TASK_MUTATION_FLAGS=toCompletionFlagString(resolveSubcommandFlagContractsForCommand("close-task"));const RELEASE_MUTATION_FLAGS=toCompletionFlagString(resolveSubcommandFlagContractsForCommand("release"));const CLAIM_MUTATION_FLAGS=toCompletionFlagString(resolveSubcommandFlagContractsForCommand("claim"));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")}
|
|
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]="e647e6ab-8b0b-599a-afa5-334a20354f1b")}catch(e2){}})();import{PM_COMMAND_DESTINATION_CONTRACTS}from"./cli-contracts/grammar-contracts.js";import{WORKFLOW_POLICY_ACTIONS}from"./cli-contracts/enum-contracts.js";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,resolvePmCommandOperation,PM_NAMESPACED_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=>!command.includes(" ")&&!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 ATTEST_INVOCATIONS=enrichCliFlagInvocationContracts("history-attest",resolveSubcommandFlagContractsForCommand("history-attest"));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 NAMESPACE_NOUNS=[...new Set(PM_NAMESPACED_COMMAND_ALIASES.map(entry=>entry.canonical_argv[0]))];const NAMESPACE_PREFIXES=[...new Set(PM_NAMESPACED_COMMAND_ALIASES.flatMap(entry=>entry.canonical_argv.slice(0,-1).map((_,index)=>entry.canonical_argv.slice(0,index+1).join(" "))))];const PACKAGE_NAMESPACE_OPERATIONS=new Set(PM_COMMAND_DESTINATION_CONTRACTS.filter(entry=>entry.disposition==="package_owned").map(entry=>resolvePmCommandOperation(entry.command)));const HISTORY_COMPLETION_ALIASES=PM_NAMESPACED_COMMAND_ALIASES.filter(entry=>entry.canonical_argv[0]==="history");const HISTORY_LEAVES=HISTORY_COMPLETION_ALIASES.map(entry=>entry.canonical_argv[1]).join(" ");function completionNamespaceLeaves(runtime){const available=new Set((runtime.namespace_commands??[]).map(resolvePmCommandOperation));const aliases=PM_NAMESPACED_COMMAND_ALIASES.filter(entry=>!PACKAGE_NAMESPACE_OPERATIONS.has(entry.alias)||available.has(entry.alias));return Object.fromEntries(NAMESPACE_PREFIXES.map(prefix=>[prefix,[...new Set(aliases.filter(entry=>entry.canonical.startsWith(`${prefix} `)).map(entry=>entry.canonical_argv[prefix.split(" ").length]))].join(" ")]))}const HISTORY_OPERATION_FLAGS=HISTORY_COMPLETION_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 SCHEMA_SUBCOMMAND_CHOICES=`${WORKFLOW_POLICY_ACTIONS.join(" ")} 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`;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=toCompletionFlagString(resolveSubcommandFlagContractsForCommand("close"));const CLOSE_TASK_MUTATION_FLAGS=toCompletionFlagString(resolveSubcommandFlagContractsForCommand("close-task"));const RELEASE_MUTATION_FLAGS=toCompletionFlagString(resolveSubcommandFlagContractsForCommand("release"));const CLAIM_MUTATION_FLAGS=toCompletionFlagString(resolveSubcommandFlagContractsForCommand("claim"));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
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,["ops","Workspace maintenance and diagnostics"]].filter(([command])=>!HIDDEN_COMMAND_ALIASES.has(command)).map(([command,description])=>` '${command}:${description}'`).join("\n")}function renderFishCommandDescriptions(){return[...COMMAND_COMPLETION_DESCRIPTIONS,["ops","Workspace maintenance and diagnostics"]].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){const predicate=NAMESPACE_NOUNS.includes(command)||PM_NAMESPACED_COMMAND_ALIASES.some(entry=>entry.alias===command)?"__pm_history_operation":"__fish_seen_subcommand_from";for(const flag of normalizedFlags){lines.push(`complete -c pm -n '${predicate} ${command}' -l ${flag} -d 'Runtime schema field flag' -r`)}}return`${lines.join("\n")}
|
|
3
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`
|
|
4
4
|
_pm_${kind}_choices() {
|
|
@@ -43,7 +43,7 @@ function __pm_${kind}_choices
|
|
|
43
43
|
set -gx PM_COMPLETION_${envKind}_CACHE_TS $now
|
|
44
44
|
printf '%s\\n' $resolved
|
|
45
45
|
end
|
|
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" == "ctx" ]] && cmd="context"',` case "$cmd" in ${NAMESPACE_NOUNS.join("|")}) ;; *) break ;; esac`," else",' case "$cmd $word" in',...PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` "${entry.canonical}") 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)})`," if [[ $word_index -eq $cword ]]; then",` COMPREPLY+=(${compgen(NAMESPACE_LEAVES.update)})`," fi"," ;;"," update-many)",` COMPREPLY=(${compgen(updateManyFlags)})`," ;;"," calendar|cal)",` COMPREPLY=(${compgen(calendarFlags)})`," ;;"," context|ctx)",` COMPREPLY=(${compgen(contextFlags)})`," if [[ $word_index -eq $cword ]]; then",` COMPREPLY+=(${compgen(NAMESPACE_LEAVES.context)})`," fi"," ;;"," ops)",` COMPREPLY=(${compgen(`${GLOBAL_FLAGS} ${NAMESPACE_LEAVES.ops}`)})`," ;;"," 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-completeness --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)",' if [[ "$prev" == "policy-mode" ]]; then',` COMPREPLY=(${compgen("advise refuse")})`," return"," fi",` COMPREPLY=(${compgen(`${SCHEMA_SUBCOMMAND_CHOICES} --definition --policy --message --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-task)",` COMPREPLY=(${compgen(CLOSE_TASK_MUTATION_FLAGS)})`," ;;"," close)",` COMPREPLY=(${compgen(CLOSE_MUTATION_FLAGS)})`,' if [[ "$cmd" == "close" && $word_index -eq $cword ]]; then',` COMPREPLY+=(${compgen(NAMESPACE_LEAVES.close)})`," fi"," ;;"," close-many)",` COMPREPLY=(${compgen(CLOSE_MANY_FLAGS)})`," ;;"," release)",` COMPREPLY=(${compgen(RELEASE_MUTATION_FLAGS)})`," ;;"," delete)",` COMPREPLY=(${compgen(DELETE_MUTATION_FLAGS)})`," ;;"," claim)",` COMPREPLY=(${compgen(CLAIM_MUTATION_FLAGS)})`," ;;"," 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?"":`
|
|
46
|
+
`}function generateBashScript(itemTypes=[],tags=[],eagerTagExpansion=false,runtime={}){const namespaceLeaves=completionNamespaceLeaves(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="" command_path="" 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" == "ctx" ]] && cmd="context"',' command_path="$cmd"',` case "$cmd" in ${NAMESPACE_NOUNS.join("|")}) ;; *) break ;; esac`," else",' case "$command_path $word" in',...PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` "${entry.canonical}") cmd="${entry.alias}"; command_path="${entry.canonical}" ;;`)," *) break ;;"," esac",` case "$command_path" in ${NAMESPACE_PREFIXES.map(prefix=>`"${prefix}"`).join("|")}) ;; *) (( word_index++ )); break ;; esac`," 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)})`," if [[ $word_index -eq $cword ]]; then",` COMPREPLY+=(${compgen(namespaceLeaves.update)})`," fi"," ;;"," update-many)",` COMPREPLY=(${compgen(updateManyFlags)})`," ;;"," calendar|cal)",` COMPREPLY=(${compgen(calendarFlags)})`," ;;"," context|ctx)",` COMPREPLY=(${compgen(contextFlags)})`," if [[ $word_index -eq $cword ]]; then",` COMPREPLY+=(${compgen(namespaceLeaves.context)})`," fi"," ;;"," ops)",` COMPREPLY=(${compgen(`${GLOBAL_FLAGS} ${namespaceLeaves.ops}`)})`," ;;"," 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-completeness --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)",' if [[ "$prev" == "policy-mode" ]]; then',` COMPREPLY=(${compgen("advise refuse")})`," return"," fi",` COMPREPLY=(${compgen(`${SCHEMA_SUBCOMMAND_CHOICES} --definition --policy --message --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-task)",` COMPREPLY=(${compgen(CLOSE_TASK_MUTATION_FLAGS)})`," ;;"," close)",` COMPREPLY=(${compgen(CLOSE_MUTATION_FLAGS)})`,' if [[ "$cmd" == "close" && $word_index -eq $cword ]]; then',` COMPREPLY+=(${compgen(namespaceLeaves.close)})`," fi"," ;;"," close-many)",` COMPREPLY=(${compgen(CLOSE_MANY_FLAGS)})`," ;;"," release)",` COMPREPLY=(${compgen(RELEASE_MUTATION_FLAGS)})`," ;;"," delete)",` COMPREPLY=(${compgen(DELETE_MUTATION_FLAGS)})`," ;;"," claim)",` COMPREPLY=(${compgen(CLAIM_MUTATION_FLAGS)})`," ;;"," 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 [[ $word_index -eq $cword ]]; then",' case "$command_path" in',...Object.entries(namespaceLeaves).filter(([prefix])=>["item","workspace","search"].includes(prefix.split(" ")[0])).map(([prefix,leaves])=>` "${prefix}") COMPREPLY+=(${compgen(leaves)}) ;;`)," esac"," fi",' 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 namespaceLeaves=completionNamespaceLeaves(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?"":`
|
|
47
47
|
_pm_tag_choices() {
|
|
48
48
|
local now ttl cache_ts
|
|
49
49
|
now=\${EPOCHSECONDS:-0}
|
|
@@ -76,7 +76,7 @@ _pm() {
|
|
|
76
76
|
local context state line
|
|
77
77
|
local -a words=("$words[@]")
|
|
78
78
|
local CURRENT=$CURRENT
|
|
79
|
-
local word_index=2 namespace_noun="" operation_index=0 word
|
|
79
|
+
local word_index=2 namespace_noun="" operation_path="" operation_index=0 word
|
|
80
80
|
while (( word_index < CURRENT )); do
|
|
81
81
|
word="$words[word_index]"
|
|
82
82
|
case "\${word//_/-}" in
|
|
@@ -89,21 +89,25 @@ _pm() {
|
|
|
89
89
|
case "$word" in ${NAMESPACE_NOUNS.join("|")}) ;; *) break ;; esac
|
|
90
90
|
namespace_noun="$word"
|
|
91
91
|
else
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
case "$namespace_noun $word" in
|
|
93
|
+
${PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` "${entry.canonical}") namespace_noun="${entry.canonical}"; operation_path="$namespace_noun"; operation_index=$word_index ;;`).join("\n")}
|
|
94
|
+
*) break ;;
|
|
95
|
+
esac
|
|
94
96
|
fi
|
|
95
97
|
(( word_index++ ))
|
|
96
98
|
done
|
|
97
99
|
if [[ -n "$namespace_noun" ]] && (( word_index == CURRENT )) && [[ "$words[CURRENT]" != -* ]]; then
|
|
98
100
|
local -a history_commands
|
|
99
101
|
case "$namespace_noun" in
|
|
100
|
-
${Object.entries(
|
|
102
|
+
${Object.entries(namespaceLeaves).map(([noun,leaves])=>` "${noun}") history_commands=(${leaves}) ;;`).join("\n")}
|
|
101
103
|
esac
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
if (( \${#history_commands} > 0 )); then
|
|
105
|
+
_describe 'command operation' history_commands
|
|
106
|
+
return
|
|
107
|
+
fi
|
|
104
108
|
fi
|
|
105
109
|
if (( operation_index > 0 )); then
|
|
106
|
-
case "$
|
|
110
|
+
case "$operation_path" in
|
|
107
111
|
${PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` "${entry.canonical}") words=("$words[1]" "${entry.alias}" "\${words[@]:$operation_index}"); (( CURRENT -= operation_index - 2 )) ;;`).join("\n")}
|
|
108
112
|
esac
|
|
109
113
|
fi
|
|
@@ -508,6 +512,10 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
|
|
|
508
512
|
'--json[Output JSON]' \\
|
|
509
513
|
'--quiet[Suppress stdout]'
|
|
510
514
|
;;
|
|
515
|
+
history-attest)
|
|
516
|
+
_arguments \\
|
|
517
|
+
${renderZshArgumentSpecs(ATTEST_INVOCATIONS.map(flag=>`'${flag.flag}[${flag.description}]${flag.takes_value?":value":""}'`),{trailingContinuation:false})}
|
|
518
|
+
;;
|
|
511
519
|
history-compact)
|
|
512
520
|
_arguments \\
|
|
513
521
|
'--id[Item ID (alternative to positional ID)]:id' \\
|
|
@@ -1123,7 +1131,7 @@ ${renderZshArgumentSpecs(RESTORE_INVOCATIONS.map(flag=>`'${flag.flag}[${flag.des
|
|
|
1123
1131
|
esac
|
|
1124
1132
|
}
|
|
1125
1133
|
|
|
1126
|
-
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"],runtime.command_flags?.context);const dynamicTagResolver=useEagerTagExpansion?"":`
|
|
1134
|
+
compdef _pm pm`}function generateFishScript(itemTypes=[],tags=[],eagerTagExpansion=false,runtime={}){const namespaceLeaves=completionNamespaceLeaves(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"],runtime.command_flags?.context);const dynamicTagResolver=useEagerTagExpansion?"":`
|
|
1127
1135
|
function __pm_tag_choices
|
|
1128
1136
|
set -l now (date +%s ^/dev/null)
|
|
1129
1137
|
if test -z "$now"
|
|
@@ -1616,6 +1624,7 @@ function __pm_history_tokens
|
|
|
1616
1624
|
set -l tokens (commandline -opc)
|
|
1617
1625
|
set -l skip_value 0
|
|
1618
1626
|
set -l positions 0
|
|
1627
|
+
set -l command_path
|
|
1619
1628
|
for token in $tokens[2..-1]
|
|
1620
1629
|
if test $skip_value -eq 1
|
|
1621
1630
|
set skip_value 0
|
|
@@ -1636,7 +1645,8 @@ function __pm_history_tokens
|
|
|
1636
1645
|
end
|
|
1637
1646
|
printf '%s\\n' "$token"
|
|
1638
1647
|
set positions (math $positions + 1)
|
|
1639
|
-
|
|
1648
|
+
set -a command_path "$token"
|
|
1649
|
+
if not contains -- (string join ' ' -- $command_path) ${NAMESPACE_PREFIXES.map(prefix=>`'${prefix}'`).join(" ")}
|
|
1640
1650
|
return
|
|
1641
1651
|
end
|
|
1642
1652
|
end
|
|
@@ -1648,16 +1658,18 @@ end
|
|
|
1648
1658
|
# Match only the command positions, keeping item history separate from maintenance.
|
|
1649
1659
|
function __pm_history_operation
|
|
1650
1660
|
set -l tokens (__pm_history_tokens)
|
|
1651
|
-
switch
|
|
1652
|
-
${PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` case '${entry.canonical}'
|
|
1661
|
+
switch (string join ' ' -- $tokens)
|
|
1662
|
+
${[...PM_NAMESPACED_COMMAND_ALIASES].sort((left,right)=>right.canonical_argv.length-left.canonical_argv.length).map(entry=>` case '${entry.canonical}' '${entry.canonical} *'
|
|
1653
1663
|
contains -- '${entry.alias}' $argv
|
|
1654
1664
|
return`).join("\n")}
|
|
1655
1665
|
end
|
|
1656
1666
|
contains -- "$tokens[1]" $argv
|
|
1657
1667
|
end
|
|
1658
|
-
${Object.entries(
|
|
1668
|
+
${Object.entries(namespaceLeaves).map(([noun,leaves])=>`complete -c pm -n 'test (string join " " -- (__pm_history_tokens)) = "${noun}"' -a '${leaves}' -d '${noun} operation'`).join("\n")}
|
|
1659
1669
|
${RESTORE_INVOCATIONS.map(flag=>`complete -c pm -n '__pm_history_operation restore restore' -l ${flag.flag.slice(2)}${flag.takes_value?" -r":""}`).join("\n")}
|
|
1660
1670
|
|
|
1671
|
+
${ATTEST_INVOCATIONS.map(flag=>`complete -c pm -n '__pm_history_operation history-attest' -l ${flag.flag.slice(2)}${flag.takes_value?" -r":""}`).join("\n")}
|
|
1672
|
+
|
|
1661
1673
|
# history / activity flags
|
|
1662
1674
|
complete -c pm -n '__pm_history_operation history' -l limit -d 'Max history entries' -r
|
|
1663
1675
|
complete -c pm -n '__pm_history_operation history' -l compact -d 'Condensed history projection'
|
package/dist/sdk/contracts.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export * from "./output-token-accounting.js";
|
|
|
15
15
|
export * from "./output-contracts.js";
|
|
16
16
|
export * from "./agent/task-transcript-contracts.js";
|
|
17
17
|
export * from "./read-output-contracts.js";
|
|
18
|
+
export * from "./history/attestation-contract.js";
|
|
19
|
+
export * from "../core/history/operation-contract.js";
|
|
18
20
|
export * from "./agent/refusal-closure.js";
|
|
19
21
|
export * from "./agent/closed-domain-contracts.js";
|
|
20
22
|
export * from "./agent/tracker-preflight-contracts.js";
|
package/dist/sdk/contracts.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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]="
|
|
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]="3aa255ff-062b-5d25-9589-20b2911e86f9")}catch(e2){}})();export*from"./cli-contracts.js";export*from"./cli-contracts/grammar-contracts.js";export*from"./cli-contracts/command-exit-contracts.js";export*from"./context-intent-contracts.js";export*from"./error-code-catalog.js";export*from"./generated-error-code-catalog.js";export*from"./flag-invocation-contracts.js";export*from"./cli-contracts/flag-lexicon-contracts.js";export*from"./output-token-accounting.js";export*from"./output-contracts.js";export*from"./agent/task-transcript-contracts.js";export*from"./read-output-contracts.js";export*from"./history/attestation-contract.js";export*from"../core/history/operation-contract.js";export*from"./agent/refusal-closure.js";export*from"./agent/closed-domain-contracts.js";export*from"./agent/tracker-preflight-contracts.js";
|
|
2
2
|
//# sourceMappingURL=contracts.js.map
|