@unbrained/pm-cli 2026.9.10 → 2026.9.11
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 +31 -11
- package/dist/cli/command-namespaces.d.ts +2 -2
- package/dist/cli/command-namespaces.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/register-history-maintenance.js +2 -1
- package/dist/cli/register-list-query.js +2 -2
- package/dist/cli-bundle/bundle-manifest.json +147 -155
- package/dist/cli-bundle/chunks/{chunk-EOCKPCEY.js → chunk-BN5QVWNY.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-DAWH7TGV.js +3 -0
- package/dist/cli-bundle/chunks/chunk-FBY6PEIR.js +20 -0
- package/dist/cli-bundle/chunks/chunk-IRUNFLLG.js +2 -0
- package/dist/cli-bundle/chunks/chunk-JMQKJ7CJ.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-I6XT3DLQ.js → chunk-QER6OSOP.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-RJQSCK74.js +6 -0
- package/dist/cli-bundle/chunks/chunk-RJZFAXBW.js +235 -0
- package/dist/cli-bundle/chunks/{chunk-MACGGTLQ.js → chunk-SGAKQIGQ.js} +29 -29
- package/dist/cli-bundle/chunks/{chunk-NKOYVKFM.js → chunk-TDKWJQD7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4SFBH77G.js → chunk-TFVKBJJ4.js} +164 -150
- package/dist/cli-bundle/chunks/{chunk-PYUITRSV.js → chunk-VFKBNGF6.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-CUIW7SSE.js → register-list-query-U6MY437C.js} +6 -6
- package/dist/cli-bundle/chunks/{register-mutation-5F5CYUWZ.js → register-mutation-HAPHD4S7.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-XIZPLPQY.js → register-operations-EHWIZW3X.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-JVGPCAIL.js → register-setup-BZYL3HBL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZJHYQOTM.js → chunk-3JVTLBCW.js} +4 -4
- package/dist/cli-bundle/focused-chunks/chunk-6JF66HAG.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-SL5YVVPV.js → chunk-7WISPJRZ.js} +53 -52
- package/dist/cli-bundle/focused-chunks/chunk-BEQAW7OT.js +12 -0
- package/dist/cli-bundle/focused-chunks/{chunk-CRY5MHEI.js → chunk-DZ3ATEFS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FHUARRMA.js → chunk-FJDEFA64.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-7N5MRONP.js → chunk-GKUF7TM5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-U5SHHU7E.js → chunk-HM6JS6Q3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-M74YW332.js +164 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZDNAWWQI.js → chunk-MOT32PR2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ONDKO4EL.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-M36SF4GE.js → chunk-TGMSSI3Z.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-TWE3GPQM.js +30 -0
- package/dist/cli-bundle/focused-chunks/chunk-UJCQXUD2.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZAWAL2CG.js → chunk-VS6MR2HT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5YU75QLV.js → chunk-YOPNRWSX.js} +2 -2
- 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 +37 -37
- 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/replay.d.ts +3 -2
- package/dist/core/history/replay.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.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/completion.d.ts +2 -0
- package/dist/sdk/completion.js +26 -14
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +1 -1
- 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 +2 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/public-surface.json +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/CLI_GRAMMAR.md +23 -0
- package/docs/HISTORY_ATTESTATION.md +164 -0
- package/docs/README.md +1 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +13 -0
- 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 +4 -4
- 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 +9 -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-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/focused-chunks/chunk-26O2WB73.js +0 -10
- package/dist/cli-bundle/focused-chunks/chunk-B2CMFYRZ.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
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* here.)
|
|
12
12
|
*/
|
|
13
13
|
export type { CommanderOptionAliasContract, CommanderOptionRegistrationContract, } from "./cli-contracts/commander-types.js";
|
|
14
|
-
export { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, PM_HISTORY_COMMAND_ALIASES, PM_CONTEXT_OPS_COMMAND_ALIASES, PM_BULK_LIFECYCLE_COMMAND_ALIASES, PM_RELOCATED_COMMAND_ALIASES, PM_NAMESPACED_COMMAND_ALIASES, resolvePmCommandOperation, resolvePmHistoryOperation, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, type PmCommandAliasContract, type PmCommandAliasLifecycle, type PmCommandAliasRegistration, } from "./cli-contracts/command-aliases.js";
|
|
14
|
+
export { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, PM_HISTORY_COMMAND_ALIASES, PM_CONTEXT_OPS_COMMAND_ALIASES, PM_BULK_LIFECYCLE_COMMAND_ALIASES, PM_RELOCATED_COMMAND_ALIASES, PM_NAMESPACED_COMMAND_ALIASES, findPmNamespacedCommand, resolvePmCommandOperation, resolvePmHistoryOperation, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, type PmCommandAliasContract, type PmCommandAliasLifecycle, type PmCommandAliasRegistration, } from "./cli-contracts/command-aliases.js";
|
|
15
15
|
export { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, readFirstValueFromCommanderOptions, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "./cli-contracts/commander-types.js";
|
|
16
16
|
export { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, } from "./cli-contracts/commander-mutation-options.js";
|
|
17
17
|
export { MERGE_SUBCOMMAND_VALUES, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_CORE_COMMAND_NAMES, PM_CLI_ONLY_TOOL_ACTION_WAIVERS, PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS, PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS, PM_ITEM_ACTION_SUBCOMMANDS, PM_DEPRECATED_TOOL_ACTIONS, PM_DISCOVERABLE_TOOL_ACTIONS, PM_TOOL_ACTIONS, analyzePmToolActionParity, isPmToolAction, isPmExtensionCapabilityContract, isPmExtensionServiceNameContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, } from "./cli-contracts/enum-contracts.js";
|
|
@@ -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]="09ec0086-29c3-5c62-9e32-b875798c1995")}catch(e2){}})();import{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,PM_HISTORY_COMMAND_ALIASES,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_RELOCATED_COMMAND_ALIASES,PM_NAMESPACED_COMMAND_ALIASES,resolvePmCommandOperation,resolvePmHistoryOperation,renderPmCommandAliasMigrationHint,resolvePmCommandAlias}from"./cli-contracts/command-aliases.js";import{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,LIST_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,readFirstValueFromCommanderOptions,readFirstStringFromCommanderOptions,readStringArrayFromCommanderOptions}from"./cli-contracts/commander-types.js";import{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS}from"./cli-contracts/commander-mutation-options.js";import{MERGE_SUBCOMMAND_VALUES,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_CORE_COMMAND_NAMES,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_ITEM_ACTION_SUBCOMMANDS,PM_DEPRECATED_TOOL_ACTIONS,PM_DISCOVERABLE_TOOL_ACTIONS,PM_TOOL_ACTIONS,analyzePmToolActionParity,isPmToolAction,isPmExtensionCapabilityContract,isPmExtensionServiceNameContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract}from"./cli-contracts/enum-contracts.js";import{TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,verifyToolOptionCliParity}from"./cli-contracts/tool-option-contracts.js";import{PM_COMMAND_POSITIONAL_CONTRACTS,PM_POSITIONAL_ACTION_CONTRACTS}from"./cli-contracts/grammar-contracts.js";import{withFlagAliasMetadata,compactFlagAliasContracts,resolvePmPositionalActionFlagContracts,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,PROFILE_FLAG_CONTRACTS,PLAN_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,CREATE_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,CALENDAR_FLAG_CONTRACTS,ACTIVITY_FLAG_CONTRACTS,CONTEXT_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,NEXT_FLAG_CONTRACTS,SEARCH_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,hasSubcommandFlagContractsForCommand,resolveSubcommandFlagContractsForCommand,toCompletionFlagString}from"./cli-contracts/flag-contracts.js";import{buildPmActionToolInputSchema,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,resolvePmToolCustomFieldCollision,CLOSE_ACTION_OPTION_KEYS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,_testOnlyCliContracts}from"./cli-contracts/tool-schema.js";import{analyzeSdkCliParameterCompleteness}from"./cli-contracts/completeness.js";import{PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,inferPmOutputBudgetClass,projectPmDiagnosticOutput,projectPmDiagnosticText,resolvePmDiagnosticOutputBudget,resolvePmCommandOutputBudget}from"./cli-contracts/agent-output-contracts.js";export{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,ACTIVITY_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,CLOSE_ACTION_OPTION_KEYS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,CREATE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EXECUTABLE_COMMAND_ALIASES,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,LIST_COMMANDER_STRING_OPTION_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,MERGE_SUBCOMMAND_VALUES,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PLAN_FLAG_CONTRACTS,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_COMMAND_ALIAS_CONTRACTS,PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_COMMAND_POSITIONAL_CONTRACTS,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_CORE_COMMAND_NAMES,PM_DEPRECATED_TOOL_ACTIONS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_DISCOVERABLE_TOOL_ACTIONS,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_HISTORY_COMMAND_ALIASES,PM_ITEM_ACTION_SUBCOMMANDS,PM_NAMESPACED_COMMAND_ALIASES,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_POSITIONAL_ACTION_CONTRACTS,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_RELOCATED_COMMAND_ALIASES,PM_TOOL_ACTIONS,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,PROFILE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,_testOnlyCliContracts,analyzePmToolActionParity,analyzeSdkCliParameterCompleteness,buildPmActionToolInputSchema,compactFlagAliasContracts,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,hasSubcommandFlagContractsForCommand,inferPmOutputBudgetClass,isPmExtensionCapabilityContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract,isPmExtensionServiceNameContract,isPmToolAction,projectPmDiagnosticOutput,projectPmDiagnosticText,readFirstStringFromCommanderOptions,readFirstValueFromCommanderOptions,readStringArrayFromCommanderOptions,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,resolvePmCommandOperation,resolvePmCommandOutputBudget,resolvePmDiagnosticOutputBudget,resolvePmHistoryOperation,resolvePmPositionalActionFlagContracts,resolvePmToolCustomFieldCollision,resolveSubcommandFlagContractsForCommand,toCompletionFlagString,verifyToolOptionCliParity,withFlagAliasMetadata};
|
|
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]="92c17dbe-3868-5fa5-a873-0744d3e7ca8e")}catch(e2){}})();import{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,PM_HISTORY_COMMAND_ALIASES,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_RELOCATED_COMMAND_ALIASES,PM_NAMESPACED_COMMAND_ALIASES,findPmNamespacedCommand,resolvePmCommandOperation,resolvePmHistoryOperation,renderPmCommandAliasMigrationHint,resolvePmCommandAlias}from"./cli-contracts/command-aliases.js";import{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,LIST_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,readFirstValueFromCommanderOptions,readFirstStringFromCommanderOptions,readStringArrayFromCommanderOptions}from"./cli-contracts/commander-types.js";import{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS}from"./cli-contracts/commander-mutation-options.js";import{MERGE_SUBCOMMAND_VALUES,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_CORE_COMMAND_NAMES,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_ITEM_ACTION_SUBCOMMANDS,PM_DEPRECATED_TOOL_ACTIONS,PM_DISCOVERABLE_TOOL_ACTIONS,PM_TOOL_ACTIONS,analyzePmToolActionParity,isPmToolAction,isPmExtensionCapabilityContract,isPmExtensionServiceNameContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract}from"./cli-contracts/enum-contracts.js";import{TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,verifyToolOptionCliParity}from"./cli-contracts/tool-option-contracts.js";import{PM_COMMAND_POSITIONAL_CONTRACTS,PM_POSITIONAL_ACTION_CONTRACTS}from"./cli-contracts/grammar-contracts.js";import{withFlagAliasMetadata,compactFlagAliasContracts,resolvePmPositionalActionFlagContracts,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,PROFILE_FLAG_CONTRACTS,PLAN_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,CREATE_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,CALENDAR_FLAG_CONTRACTS,ACTIVITY_FLAG_CONTRACTS,CONTEXT_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,NEXT_FLAG_CONTRACTS,SEARCH_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,hasSubcommandFlagContractsForCommand,resolveSubcommandFlagContractsForCommand,toCompletionFlagString}from"./cli-contracts/flag-contracts.js";import{buildPmActionToolInputSchema,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,resolvePmToolCustomFieldCollision,CLOSE_ACTION_OPTION_KEYS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,_testOnlyCliContracts}from"./cli-contracts/tool-schema.js";import{analyzeSdkCliParameterCompleteness}from"./cli-contracts/completeness.js";import{PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,inferPmOutputBudgetClass,projectPmDiagnosticOutput,projectPmDiagnosticText,resolvePmDiagnosticOutputBudget,resolvePmCommandOutputBudget}from"./cli-contracts/agent-output-contracts.js";export{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,ACTIVITY_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,CLOSE_ACTION_OPTION_KEYS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,CREATE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EXECUTABLE_COMMAND_ALIASES,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,LIST_COMMANDER_STRING_OPTION_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,MERGE_SUBCOMMAND_VALUES,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PLAN_FLAG_CONTRACTS,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_COMMAND_ALIAS_CONTRACTS,PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_COMMAND_POSITIONAL_CONTRACTS,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_CORE_COMMAND_NAMES,PM_DEPRECATED_TOOL_ACTIONS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_DISCOVERABLE_TOOL_ACTIONS,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_HISTORY_COMMAND_ALIASES,PM_ITEM_ACTION_SUBCOMMANDS,PM_NAMESPACED_COMMAND_ALIASES,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_POSITIONAL_ACTION_CONTRACTS,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_RELOCATED_COMMAND_ALIASES,PM_TOOL_ACTIONS,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,PROFILE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,_testOnlyCliContracts,analyzePmToolActionParity,analyzeSdkCliParameterCompleteness,buildPmActionToolInputSchema,compactFlagAliasContracts,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,findPmNamespacedCommand,hasSubcommandFlagContractsForCommand,inferPmOutputBudgetClass,isPmExtensionCapabilityContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract,isPmExtensionServiceNameContract,isPmToolAction,projectPmDiagnosticOutput,projectPmDiagnosticText,readFirstStringFromCommanderOptions,readFirstValueFromCommanderOptions,readStringArrayFromCommanderOptions,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,resolvePmCommandOperation,resolvePmCommandOutputBudget,resolvePmDiagnosticOutputBudget,resolvePmHistoryOperation,resolvePmPositionalActionFlagContracts,resolvePmToolCustomFieldCollision,resolveSubcommandFlagContractsForCommand,toCompletionFlagString,verifyToolOptionCliParity,withFlagAliasMetadata};
|
|
2
2
|
//# sourceMappingURL=cli-contracts.js.map
|
package/dist/sdk/completion.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface CompletionResult {
|
|
|
12
12
|
type CompletionFlagCommand = "list" | "create" | "update" | "update-many" | "search" | "calendar" | "context";
|
|
13
13
|
/** Documents the completion runtime config payload exchanged by command, SDK, and package integrations. */
|
|
14
14
|
export interface CompletionRuntimeConfig {
|
|
15
|
+
/** Active package command paths whose namespace facets may be advertised. Legacy aliases are accepted. */
|
|
16
|
+
namespace_commands?: readonly string[];
|
|
15
17
|
/** Value that configures or reports item types for this contract. */
|
|
16
18
|
item_types?: string[];
|
|
17
19
|
/** Value that configures or reports statuses for this contract. */
|
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,7 @@ 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";
|
|
18
19
|
export * from "./agent/refusal-closure.js";
|
|
19
20
|
export * from "./agent/closed-domain-contracts.js";
|
|
20
21
|
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]="8cf6fe11-f0da-55a4-aafd-527277ff097f")}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"./agent/refusal-closure.js";export*from"./agent/closed-domain-contracts.js";export*from"./agent/tracker-preflight-contracts.js";
|
|
2
2
|
//# sourceMappingURL=contracts.js.map
|
package/dist/sdk/governance.d.ts
CHANGED
|
@@ -28,3 +28,6 @@ export * from "./mutation-guard.js";
|
|
|
28
28
|
export * from "./governance/provenance-health.js";
|
|
29
29
|
export * from "./similarity.js";
|
|
30
30
|
export * from "./history/maintenance.js";
|
|
31
|
+
export * from "./history/attestation.js";
|
|
32
|
+
export * from "./history/attestation-command.js";
|
|
33
|
+
export * from "../core/history/digest.js";
|
package/dist/sdk/governance.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]="ae8f06a0-a2e6-5f91-99f7-e822270b491d")}catch(e2){}})();export*from"./governance/gc.js";export*from"./governance/health.js";export*from"./governance/extension-host-version.js";export*from"./governance/assurance.js";export*from"./governance/assurance-action.js";export*from"./governance/assurance-mutation-error.js";export*from"./governance/assurance-presets.js";export*from"./governance/assurance-runtime.js";export*from"./governance/boundary-fixtures.js";export*from"./governance/defect-recurrence.js";export*from"./governance/defect-recurrence-coverage.js";import{runReindex}from"./governance/reindex.js";export*from"./governance/stale-work.js";export*from"./governance/storage-integrity.js";export*from"./governance/status-role-diagnostics.js";export*from"./governance/workspace-position.js";export*from"./governance/workflow-policy.js";import{runUpgrade}from"./governance/upgrade.js";export*from"./governance/validate.js";export*from"./governance/linked-file-report.js";export*from"./author-attribution.js";export*from"./mutation-guard.js";export*from"./governance/provenance-health.js";export*from"./similarity.js";export*from"./history/maintenance.js";export*from"./history/attestation.js";export*from"./history/attestation-command.js";export*from"../core/history/digest.js";export{runReindex,runUpgrade};
|
|
2
2
|
//# sourceMappingURL=governance.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { GlobalOptions } from "../../core/shared/command-types.js";
|
|
2
|
+
import type { HistoryAttestation, HistoryAttestationVerification } from "./attestation-contract.js";
|
|
3
|
+
/** Proof transport options; local CLI/SDK callers may also use filesystem paths. */
|
|
4
|
+
export interface HistoryAttestCommandOptions {
|
|
5
|
+
/** Compare current streams with a retained bundle, or a local CLI/SDK proof path. */
|
|
6
|
+
verify?: string | HistoryAttestation;
|
|
7
|
+
/** Create a new proof file exclusively; existing files are never overwritten. */
|
|
8
|
+
output?: string;
|
|
9
|
+
/** Digest used for new bundles, independently from record algorithms. */
|
|
10
|
+
hashAlgorithm?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Bounded receipt after a complete bundle has been saved separately. */
|
|
13
|
+
export interface HistoryAttestationExportReceipt {
|
|
14
|
+
/** File created by this export. */
|
|
15
|
+
output: string;
|
|
16
|
+
/** Digest committing to the entire bundle. */
|
|
17
|
+
workspace_digest: string;
|
|
18
|
+
/** Number of streams represented by the saved proof. */
|
|
19
|
+
streams: number;
|
|
20
|
+
}
|
|
21
|
+
/** Export a complete proof or verify one; no tracker mutations or extension hooks occur. */
|
|
22
|
+
export declare function runHistoryAttest(options: HistoryAttestCommandOptions, global: GlobalOptions): Promise<HistoryAttestation | HistoryAttestationVerification | HistoryAttestationExportReceipt>;
|
|
@@ -0,0 +1,3 @@
|
|
|
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]="825d7132-a49d-584a-b4ac-0801cfe6ad49")}catch(e2){}})();import fs from"node:fs/promises";import{PmCliError}from"../../core/shared/errors.js";import{EXIT_CODE}from"../../core/shared/constants.js";import{resolveHistoryHashAlgorithm}from"../../core/history/digest.js";import{exportAttestation,verifyAttestation}from"./attestation.js";async function runHistoryAttest(options,global2){for(const key of["verify","output","hashAlgorithm"]){const value=options[key];if(key==="verify"&&typeof value==="object"&&value!==null)continue;if(value!==void 0&&(typeof value!=="string"||value.trim().length===0)){throw new PmCliError(`history attest ${key} requires a nonempty string.`,EXIT_CODE.USAGE)}}if(options.verify!==void 0){if(options.output!==void 0||options.hashAlgorithm!==void 0)throw new PmCliError("history attest --verify cannot be combined with --output or --hash-algorithm",EXIT_CODE.USAGE);let proof;try{proof=typeof options.verify==="string"?JSON.parse(await fs.readFile(options.verify,"utf8")):options.verify}catch{throw new PmCliError("Cannot read history attestation proof. Provide --verify with a readable JSON proof file.",EXIT_CODE.USAGE)}return verifyAttestation(proof,{pmRoot:global2.path})}const bundle=await exportAttestation({pmRoot:global2.path,hashAlgorithm:resolveHistoryHashAlgorithm(options.hashAlgorithm)});if(options.output===void 0)return bundle;try{await fs.writeFile(options.output,`${JSON.stringify(bundle,null,2)}
|
|
2
|
+
`,{flag:"wx",mode:384})}catch{throw new PmCliError("Cannot create history attestation proof. Choose --output with a new filename in a writable directory; existing files are never overwritten.",EXIT_CODE.USAGE)}return{output:options.output,workspace_digest:bundle.workspace_digest,streams:bundle.streams.length}}export{runHistoryAttest};
|
|
3
|
+
//# sourceMappingURL=attestation-command.js.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/** @module sdk/history/attestation-contract
|
|
2
|
+
* Portable, payload-free commitments to the exact bytes of history streams.
|
|
3
|
+
*/
|
|
4
|
+
import type { HistoryHashAlgorithm } from "../../core/history/digest.js";
|
|
5
|
+
/** Wire format, hashing rules and trust boundary for detached history proofs. */
|
|
6
|
+
export declare const PM_HISTORY_ATTESTATION_CONTRACT: {
|
|
7
|
+
readonly format: "pm-history-attestation";
|
|
8
|
+
readonly version: 1;
|
|
9
|
+
readonly stream_hash: "exact_file_bytes";
|
|
10
|
+
readonly rollup_hash: "stable_json_without_workspace_digest";
|
|
11
|
+
readonly ordering: "stream_id_code_unit_ascending";
|
|
12
|
+
readonly consistency: "per_stream_snapshot_with_change_detection";
|
|
13
|
+
readonly trust: "independently_retained_bundle";
|
|
14
|
+
};
|
|
15
|
+
/** Last maintenance event, bounded independently of stream length. */
|
|
16
|
+
export interface HistoryAttestationMaintenance {
|
|
17
|
+
/** Maintenance operation recorded in the stream. */
|
|
18
|
+
op: string;
|
|
19
|
+
/** Timestamp claimed by the recorded event; not trusted wall-clock proof. */
|
|
20
|
+
ts: string;
|
|
21
|
+
/** Record digest when the event carries whole-record integrity. */
|
|
22
|
+
record_hash: string | null;
|
|
23
|
+
}
|
|
24
|
+
/** Constant-size commitment for one item, deleted-item or workspace stream. */
|
|
25
|
+
export interface HistoryAttestationStream {
|
|
26
|
+
/** Filename stem; no path components are allowed. */
|
|
27
|
+
id: string;
|
|
28
|
+
/** Number of nonblank JSONL records. */
|
|
29
|
+
entries: number;
|
|
30
|
+
/** Exact byte length, including whitespace and line endings. */
|
|
31
|
+
bytes: number;
|
|
32
|
+
/** Digest of the complete file using the bundle's algorithm. */
|
|
33
|
+
stream_digest: string;
|
|
34
|
+
/** Latest item-state anchor, absent for an empty stream. */
|
|
35
|
+
latest_after_hash: string | null;
|
|
36
|
+
/** Latest whole-record digest, absent for legacy or empty streams. */
|
|
37
|
+
latest_record_hash: string | null;
|
|
38
|
+
/** Algorithm used by the latest entry, absent for empty streams. */
|
|
39
|
+
latest_hash_algorithm: HistoryHashAlgorithm | null;
|
|
40
|
+
/** Number of retained rewrite evidence records across the stream. */
|
|
41
|
+
rewrite_count: number;
|
|
42
|
+
/** SHA-256 commitment to the pruned prefix, when a compact checkpoint exists. */
|
|
43
|
+
checkpoint_digest: string | null;
|
|
44
|
+
/** Last maintenance operation visible in this snapshot. */
|
|
45
|
+
last_maintenance: HistoryAttestationMaintenance | null;
|
|
46
|
+
}
|
|
47
|
+
/** Versioned detached proof; no item content, actors or filesystem roots are embedded. */
|
|
48
|
+
export interface HistoryAttestation {
|
|
49
|
+
/** Identifies the public wire format. */
|
|
50
|
+
format: typeof PM_HISTORY_ATTESTATION_CONTRACT.format;
|
|
51
|
+
/** Format revision governing canonicalization and verification. */
|
|
52
|
+
version: 1;
|
|
53
|
+
/** Algorithm for stream byte commitments and the workspace rollup. */
|
|
54
|
+
hash_algorithm: HistoryHashAlgorithm;
|
|
55
|
+
/** Export timestamp bound by the rollup; an assertion, not an external timestamp. */
|
|
56
|
+
generated_at: string;
|
|
57
|
+
/** Sorted complete inventory of retained history streams. */
|
|
58
|
+
streams: HistoryAttestationStream[];
|
|
59
|
+
/** Digest of every other field using deterministic stable JSON. */
|
|
60
|
+
workspace_digest: string;
|
|
61
|
+
}
|
|
62
|
+
/** Workspace selection without settings, extensions, locks or derived caches. */
|
|
63
|
+
export interface HistoryAttestationOptions {
|
|
64
|
+
/** Explicit tracker root containing the history directory. */
|
|
65
|
+
pmRoot?: string;
|
|
66
|
+
/** Directory used for ordinary tracker discovery when pmRoot is omitted. */
|
|
67
|
+
cwd?: string;
|
|
68
|
+
}
|
|
69
|
+
/** Optional reproducibility controls for proof export. */
|
|
70
|
+
export interface ExportAttestationOptions extends HistoryAttestationOptions {
|
|
71
|
+
/** Defaults to SHA-256; independent of each stream's record algorithm. */
|
|
72
|
+
hashAlgorithm?: HistoryHashAlgorithm;
|
|
73
|
+
/** RFC 3339 timestamp for reproducible exports; defaults to current time. */
|
|
74
|
+
generatedAt?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Exact comparison against an independently retained proof. */
|
|
77
|
+
export interface HistoryAttestationVerification {
|
|
78
|
+
/** True only when all attested streams verify and the complete inventory matches. */
|
|
79
|
+
ok: boolean;
|
|
80
|
+
/** Rollup from the validated input bundle. */
|
|
81
|
+
workspace_digest: string;
|
|
82
|
+
/** Number of current streams inspected, including added streams. */
|
|
83
|
+
streams_checked: number;
|
|
84
|
+
/** Streams whose bytes differ, even when their rewritten chains remain valid. */
|
|
85
|
+
changed_streams: string[];
|
|
86
|
+
/** Attested streams absent from the current inventory. */
|
|
87
|
+
missing_streams: string[];
|
|
88
|
+
/** Current streams absent from the attested inventory. */
|
|
89
|
+
added_streams: string[];
|
|
90
|
+
/** Streams that cannot be decoded, read or verified. */
|
|
91
|
+
invalid_streams: string[];
|
|
92
|
+
/** Digest transitions with bounded maintenance context; never silently accepted as unchanged. */
|
|
93
|
+
transitions: Array<{
|
|
94
|
+
/** Changed stream identity. */
|
|
95
|
+
id: string;
|
|
96
|
+
/** Previously attested exact-byte digest. */
|
|
97
|
+
before_digest: string;
|
|
98
|
+
/** Current exact-byte digest, or null if unreadable. */
|
|
99
|
+
after_digest: string | null;
|
|
100
|
+
/** Current maintenance marker, useful when reviewing an intentional rewrite. */
|
|
101
|
+
last_maintenance: HistoryAttestationMaintenance | null;
|
|
102
|
+
}>;
|
|
103
|
+
}
|
|
@@ -0,0 +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]="63c96190-0df9-5803-aa61-b973493a7277")}catch(e2){}})();const PM_HISTORY_ATTESTATION_CONTRACT={format:"pm-history-attestation",version:1,stream_hash:"exact_file_bytes",rollup_hash:"stable_json_without_workspace_digest",ordering:"stream_id_code_unit_ascending",consistency:"per_stream_snapshot_with_change_detection",trust:"independently_retained_bundle"};export{PM_HISTORY_ATTESTATION_CONTRACT};
|
|
2
|
+
//# sourceMappingURL=attestation-contract.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HistoryHashAlgorithm } from "../../core/history/digest.js";
|
|
2
|
+
import type { HistoryAttestationStream } from "./attestation-contract.js";
|
|
3
|
+
/** Snapshot row retained even when a stream is malformed or unreadable. */
|
|
4
|
+
export interface AttestationScanRow {
|
|
5
|
+
/** Filename stem from the complete directory inventory. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Byte digest when reading succeeded. */
|
|
8
|
+
digest: string | null;
|
|
9
|
+
/** Verified payload-free stream summary, or null on invalid input. */
|
|
10
|
+
stream: HistoryAttestationStream | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Capture all retained streams and reject observed concurrent changes. This is
|
|
14
|
+
* a per-stream snapshot, not a transaction across unrelated history writers.
|
|
15
|
+
*/
|
|
16
|
+
export declare function scanAttestationStreams(pmRoot: string, algorithm: HistoryHashAlgorithm): Promise<AttestationScanRow[]>;
|
|
@@ -0,0 +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]="d0001f37-7941-5cad-8950-2c6925056d10")}catch(e2){}})();import{createHash}from"node:crypto";import{isUtf8}from"node:buffer";import fs from"node:fs/promises";import path from"node:path";import{isFileMissingError}from"../../core/fs/fs-utils.js";import{resolveHistoryHashAlgorithm}from"../../core/history/digest.js";import{verifyHistoryChain}from"../../core/history/replay.js";import{stableStringify}from"../../core/shared/serialization.js";async function historyNames(directory){try{return(await fs.readdir(directory)).filter(name=>name.endsWith(".jsonl")).sort()}catch(error){if(isFileMissingError(error))return[];throw error}}function summarizeStream(id,entries,bytes,digest){const latest=entries.at(-1);let maintenance;for(let index=entries.length-1;index>=0;index-=1){if(["history_compact","history_compact_baseline","history_redact","history_repair","history_salvage","merge_reconcile"].includes(entries[index].op)){maintenance=entries[index];break}}const checkpoint=entries[0]?.context?.history_compaction;const checkpointDigest=typeof checkpoint==="object"&&checkpoint!==null&&"pruned_stream_digest"in checkpoint&&typeof checkpoint.pruned_stream_digest==="string"?checkpoint.pruned_stream_digest:null;return{id,entries:entries.length,bytes,stream_digest:digest,latest_after_hash:latest?.after_hash??null,latest_record_hash:latest?.record_hash??null,latest_hash_algorithm:latest?resolveHistoryHashAlgorithm(latest.hash_algorithm):null,rewrite_count:entries.reduce((count,entry)=>count+(entry.reanchor_evidence?.length??0),0),checkpoint_digest:checkpointDigest,last_maintenance:maintenance?{op:maintenance.op,ts:maintenance.ts,record_hash:maintenance.record_hash??null}:null}}function decodeAttestedStream(id,bytes,digest){try{if(!/^[A-Za-z0-9_-]+$/u.test(id))return null;if(!isUtf8(bytes))return null;const entries=[];for(const line of bytes.toString("utf8").split(/\r?\n/u)){if(!line.trim())continue;const entry=JSON.parse(line);if(typeof entry!=="object"||entry===null||Array.isArray(entry))return null;const record=entry;if(![record.op,record.author,record.ts,record.before_hash,record.after_hash].every(field=>typeof field==="string")||!Array.isArray(record.patch))return null;entries.push(record)}return verifyHistoryChain(entries).ok?summarizeStream(id,entries,bytes.length,digest):null}catch{return null}}async function scanAttestationStreams(pmRoot,algorithm){if(!(await fs.stat(pmRoot)).isDirectory())throw new TypeError("attestation tracker root must be a directory");const directory=path.join(pmRoot,"history");const names=await historyNames(directory);const observations=new Map;const rows=[];for(const name of names){const id=name.slice(0,-6);const row={id,digest:null,stream:null};rows.push(row);const filename=path.join(directory,name);try{const before=await fs.lstat(filename);observations.set(name,stableStringify([before.ino,before.size,before.mtimeMs,before.ctimeMs]));if(!before.isFile())continue;const bytes=await fs.readFile(filename);row.digest=createHash(algorithm).update(bytes).digest("hex");row.stream=decodeAttestedStream(id,bytes,row.digest)}catch{}}if(stableStringify(names)!==stableStringify(await historyNames(directory)))throw new TypeError("attestation history inventory changed during read; retry");for(const[name,observed]of observations){const after=await fs.lstat(path.join(directory,name));if(observed!==stableStringify([after.ino,after.size,after.mtimeMs,after.ctimeMs]))throw new TypeError("attestation history stream changed during read; retry")}return rows}export{scanAttestationStreams};
|
|
2
|
+
//# sourceMappingURL=attestation-scan.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ExportAttestationOptions, type HistoryAttestation, type HistoryAttestationOptions, type HistoryAttestationVerification } from "./attestation-contract.js";
|
|
2
|
+
export * from "./attestation-contract.js";
|
|
3
|
+
/** Validate untrusted JSON and its rollup before treating it as an expected commitment. */
|
|
4
|
+
export declare function parseHistoryAttestation(value: unknown): HistoryAttestation;
|
|
5
|
+
/** Export every retained item/workspace stream; refuse incomplete or invalid evidence. */
|
|
6
|
+
export declare function exportAttestation(options?: ExportAttestationOptions): Promise<HistoryAttestation>;
|
|
7
|
+
/** Compare exact bytes with a trusted detached bundle; append and maintenance changes remain visible. */
|
|
8
|
+
export declare function verifyAttestation(bundleInput: unknown, options?: HistoryAttestationOptions): Promise<HistoryAttestationVerification>;
|