@unbrained/pm-cli 2026.8.18 → 2026.8.19

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.
Files changed (139) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +16 -2
  3. package/dist/cli/error-guidance.js +3 -2
  4. package/dist/cli/help-content.js +32 -13
  5. package/dist/cli/help-json-payload.d.ts +15 -0
  6. package/dist/cli/help-json-payload.js +101 -23
  7. package/dist/cli/main.js +6 -2
  8. package/dist/cli/register-list-query.js +8 -5
  9. package/dist/cli/register-mutation.js +8 -8
  10. package/dist/cli/register-operations.js +6 -6
  11. package/dist/cli-bundle/bundle-manifest.json +139 -139
  12. package/dist/cli-bundle/chunks/chunk-4NRRH7AM.js +2 -0
  13. package/dist/cli-bundle/chunks/{chunk-UYCLQVL2.js → chunk-4THEB6PD.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-BSK2IN3C.js → chunk-BHYMXLAE.js} +2 -2
  15. package/dist/cli-bundle/chunks/chunk-GWMXAQOD.js +197 -0
  16. package/dist/cli-bundle/chunks/chunk-HVFQTLYM.js +35 -0
  17. package/dist/cli-bundle/chunks/chunk-OI4XI562.js +5 -0
  18. package/dist/cli-bundle/chunks/{chunk-YRGOLZA7.js → chunk-OIOKV6NO.js} +3 -3
  19. package/dist/cli-bundle/chunks/{chunk-5UZZAJKR.js → chunk-QXSH7BLM.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-RZQTVMRQ.js → chunk-TOXJM4WA.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-GNFAFIJI.js → chunk-YBMRWW4E.js} +44 -44
  22. package/dist/cli-bundle/chunks/{register-list-query-I23LALEE.js → register-list-query-Y56KINDU.js} +11 -11
  23. package/dist/cli-bundle/chunks/register-mutation-AUWVCW4M.js +20 -0
  24. package/dist/cli-bundle/chunks/register-operations-PZQPHXW5.js +2 -0
  25. package/dist/cli-bundle/chunks/{register-setup-PPPEF3SN.js → register-setup-I4LUHGVW.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-5AF3ZBNB.js → chunk-34QBIYZI.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/{chunk-V5XTGLK7.js → chunk-BJRYFVSH.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-DKPLYW3L.js +2 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-ODOVCP45.js → chunk-EF6ZS5GH.js} +44 -44
  30. package/dist/cli-bundle/focused-chunks/{chunk-EX6MKP2X.js → chunk-ESISGDAY.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-EUEGXZ2A.js → chunk-EXBCLIBU.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-UI6AJ5TD.js → chunk-JDOMQ7VQ.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-L623ZPNK.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/chunk-MCZXYZAF.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-ODHQEECS.js +2 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-3TKWMNKF.js → chunk-PRHY2IMX.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-RZU5U6Q7.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-M62NO7EI.js → chunk-US7VEYZG.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-TN4AE665.js → chunk-VXDSU5MC.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/chunk-YBMGXBFV.js +16 -0
  41. package/dist/cli-bundle/focused-chunks/chunk-YLVBJ6GF.js +2 -0
  42. package/dist/cli-bundle/focused-chunks/{chunk-K43KKAFS.js → chunk-ZBIQQYMI.js} +2 -2
  43. package/dist/cli-bundle/main.js +13 -13
  44. package/dist/cli-bundle/sdk-authoring.js +1 -1
  45. package/dist/cli-bundle/sdk-contracts.js +2 -1
  46. package/dist/cli-bundle/sdk-core.js +31 -31
  47. package/dist/cli-bundle/sdk-governance.js +1 -1
  48. package/dist/cli-bundle/sdk-graph.js +1 -1
  49. package/dist/cli-bundle/sdk-merge.js +32 -32
  50. package/dist/cli-bundle/sdk-query.js +1 -1
  51. package/dist/cli-bundle/sdk-runtime.js +1 -1
  52. package/dist/cli-bundle/sdk-testing.js +1 -1
  53. package/dist/cli-bundle/sdk.js +5 -4
  54. package/dist/core/shared/errors.d.ts +2 -0
  55. package/dist/core/shared/errors.js +2 -2
  56. package/dist/sdk/agent/refusal-closure.d.ts +41 -0
  57. package/dist/sdk/agent/refusal-closure.js +92 -0
  58. package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
  59. package/dist/sdk/agent-capability-contracts.d.ts +13 -0
  60. package/dist/sdk/agent-capability-contracts.js +104 -7
  61. package/dist/sdk/cli-contracts/command-aliases.js +18 -2
  62. package/dist/sdk/cli-contracts/commander-mutation-options.js +30 -6
  63. package/dist/sdk/cli-contracts/commander-types.js +5 -4
  64. package/dist/sdk/cli-contracts/flag-contracts.d.ts +5 -0
  65. package/dist/sdk/cli-contracts/flag-contracts.js +75 -8
  66. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +55 -0
  67. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +240 -0
  68. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +81 -0
  69. package/dist/sdk/cli-contracts/grammar-contracts.js +615 -2
  70. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +15 -4
  71. package/dist/sdk/cli-contracts/runtime-contracts.js +42 -12
  72. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +28 -1
  73. package/dist/sdk/cli-contracts/tool-option-contracts.js +38 -3
  74. package/dist/sdk/cli-contracts.d.ts +3 -2
  75. package/dist/sdk/cli-contracts.js +5 -4
  76. package/dist/sdk/context-intent-contracts.d.ts +2 -2
  77. package/dist/sdk/context-intent-contracts.js +22 -7
  78. package/dist/sdk/contracts.d.ts +2 -0
  79. package/dist/sdk/contracts.js +4 -2
  80. package/dist/sdk/flag-invocation-contracts.d.ts +37 -0
  81. package/dist/sdk/flag-invocation-contracts.js +218 -9
  82. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +134 -2
  83. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +154 -22
  84. package/dist/sdk/index.d.ts +7 -5
  85. package/dist/sdk/index.js +7 -5
  86. package/dist/sdk/output-projection.d.ts +2 -0
  87. package/dist/sdk/output-projection.js +11 -5
  88. package/dist/sdk/query/get.js +25 -6
  89. package/dist/sdk/query/list.js +16 -2
  90. package/dist/sdk/query/search-contracts.d.ts +1 -1
  91. package/dist/sdk/query/search-contracts.js +23 -9
  92. package/dist/sdk/query/search.js +3 -3
  93. package/dist/sdk/read-output/continuation.d.ts +1 -1
  94. package/dist/sdk/read-output/continuation.js +7 -24
  95. package/dist/sdk/read-output-contracts.js +55 -6
  96. package/dist/sdk/read-output-rows.d.ts +4 -0
  97. package/dist/sdk/read-output-rows.js +47 -18
  98. package/dist/sdk/runtime.js +9 -5
  99. package/dist/sdk/workspace-snapshot.d.ts +2 -0
  100. package/dist/sdk/workspace-snapshot.js +10 -2
  101. package/docs/COMMANDS.md +16 -4
  102. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +11 -2
  103. package/docs/READ_OUTPUT_CONTRACTS.md +10 -6
  104. package/docs/SDK.md +6 -0
  105. package/docs/TESTING.md +14 -1
  106. package/docs/generated/AGENT_COMMAND_SURFACE.md +78 -78
  107. package/docs/generated/FLAG_LEXICON_BUDGETS.md +76 -0
  108. package/marketplace.json +2 -2
  109. package/package.json +5 -3
  110. package/packages/pm-beads/package.json +1 -1
  111. package/packages/pm-calendar/package.json +1 -1
  112. package/packages/pm-command-kit/package.json +1 -1
  113. package/packages/pm-digital-twin/package.json +1 -1
  114. package/packages/pm-governance-audit/package.json +1 -1
  115. package/packages/pm-guide-shell/package.json +1 -1
  116. package/packages/pm-kanban/package.json +1 -1
  117. package/packages/pm-lifecycle-hooks/package.json +1 -1
  118. package/packages/pm-linked-test-adapters/package.json +1 -1
  119. package/packages/pm-search-advanced/package.json +1 -1
  120. package/packages/pm-templates/package.json +1 -1
  121. package/packages/pm-todos/package.json +1 -1
  122. package/packages/pm-vcs/package.json +1 -1
  123. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  124. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  125. package/scripts/generate-agent-capability-surfaces.mjs +20 -14
  126. package/sdk/public-surface.json +576 -12
  127. package/dist/cli-bundle/chunks/chunk-ALDJGKAK.js +0 -2
  128. package/dist/cli-bundle/chunks/chunk-DY4DMUMC.js +0 -197
  129. package/dist/cli-bundle/chunks/chunk-L5Q2CLPE.js +0 -35
  130. package/dist/cli-bundle/chunks/chunk-PVRUN5ZS.js +0 -5
  131. package/dist/cli-bundle/chunks/register-mutation-6YGU3GPH.js +0 -20
  132. package/dist/cli-bundle/chunks/register-operations-4HTFC6J7.js +0 -2
  133. package/dist/cli-bundle/focused-chunks/chunk-2PN4TJXH.js +0 -2
  134. package/dist/cli-bundle/focused-chunks/chunk-C5IW2NDA.js +0 -2
  135. package/dist/cli-bundle/focused-chunks/chunk-RNDNMARJ.js +0 -16
  136. package/dist/cli-bundle/focused-chunks/chunk-TVV2DONO.js +0 -2
  137. package/dist/cli-bundle/focused-chunks/chunk-WGHQVU6P.js +0 -2
  138. package/dist/cli-bundle/focused-chunks/chunk-XYNBXTDQ.js +0 -2
  139. package/dist/cli-bundle/focused-chunks/chunk-Z56ECT7I.js +0 -2
@@ -14,7 +14,7 @@ import { type PmCommandVisibilityTier } from "../agent-capability-contracts.js";
14
14
  import type { PmErrorCodeContract } from "../error-code-catalog.js";
15
15
  import { type PmCommandOutputEnvelopeContract } from "../output-contracts.js";
16
16
  import { type PmCommandExitContract, type PmCommandExitOutcomeContract } from "./command-exit-contracts.js";
17
- import { type PmCommandDestinationContract } from "./grammar-contracts.js";
17
+ import { type PmCommandPositionalContract, type PmCommandDestinationContract } from "./grammar-contracts.js";
18
18
  /** Documents the contracts command options payload exchanged by command, SDK, and package integrations. */
19
19
  export interface ContractsCommandOptions {
20
20
  /** Value that configures or reports action for this contract. */
@@ -39,6 +39,7 @@ interface CommandFlagSurface {
39
39
  canonical_command?: string;
40
40
  visibility?: PmCommandVisibilityTier;
41
41
  flags: CliFlagContract[];
42
+ positionals?: PmCommandPositionalContract["slots"];
42
43
  flag_invocations?: CliFlagInvocationContract[];
43
44
  provider?: "core" | "extension" | "mixed";
44
45
  extension_sources?: Array<{
@@ -106,6 +107,11 @@ export interface ContractsResult {
106
107
  scope_before_verb: boolean;
107
108
  visible_top_level_ceiling: number;
108
109
  ceiling_raise_requires_pm_item: boolean;
110
+ positional_shape_budget: number;
111
+ positional_shape_count: number;
112
+ positional_action_count: number;
113
+ positional_action_parents: readonly string[];
114
+ positional_signatures?: readonly PmCommandPositionalContract[];
109
115
  destinations?: readonly PmCommandDestinationContract[];
110
116
  };
111
117
  /** Value that configures or reports commander aliases for this contract. */
@@ -251,10 +257,12 @@ interface CommandSummarySurface {
251
257
  command: string;
252
258
  aliases?: string[];
253
259
  intent: string;
254
- intent_source: "command" | "description" | "generated";
260
+ /** Non-default provenance in compact output; exhaustive provenance in full output. */
261
+ intent_source?: "command" | "description" | "generated";
255
262
  flags?: string[];
256
263
  default_max_estimated_tokens: number;
257
- default_max_estimated_tokens_by_format: {
264
+ /** Full-projection format detail; compact summaries retain the canonical default only. */
265
+ default_max_estimated_tokens_by_format?: {
258
266
  toon: number;
259
267
  json: number;
260
268
  };
@@ -302,7 +310,10 @@ declare function buildRuntimeFieldFlagContracts(fieldRegistry: RuntimeFieldRegis
302
310
  export declare function buildCommandAliasSurface(commands: string[], aliasContracts?: readonly PmCommandAliasContract[]): CommandAliasSurface[];
303
311
  declare function attachCreateRequiredOptionContracts(schema: Record<string, unknown>, metadata: Record<string, unknown>): Record<string, unknown>;
304
312
  declare function readContractsSettings(pmRoot: string, readSettingsFn?: typeof readSettings): Promise<Awaited<ReturnType<typeof readSettings>>>;
305
- declare function buildCommandSummarySurface(commands: readonly string[], extensionContracts?: readonly ExtensionCommandContract[]): CommandSummarySurface[];
313
+ declare function buildCommandSummarySurface(commands: readonly string[], extensionContracts?: readonly ExtensionCommandContract[], options?: {
314
+ includeFormatBudgets?: boolean;
315
+ includeIntentProvenance?: boolean;
316
+ }): CommandSummarySurface[];
306
317
  declare function buildCommandOutputContracts(commands: readonly string[]): NonNullable<ContractsResult["command_output_contracts"]>;
307
318
  declare function buildCommandExitContractGroups(commands: readonly string[]): NonNullable<ContractsResult["command_exit_contracts"]>["command_sets"];
308
319
  /** Implements run contracts for the public runtime surface of this module. */
@@ -4,10 +4,11 @@
4
4
  * Implements the pm contracts command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9a66a2a0-94be-595b-983d-347ec95af85e")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="30d9b9dd-f0a1-578e-90d6-3c019e0435b5")}catch(e){}}();
8
8
  import { EXIT_CODE, SETTINGS_DEFAULTS, PmCliError, activateExtensions, getActiveExtensionRegistrations, loadExtensions, pathExists, commandOptionFlagLabel, resolveCommandOptionPolicyState, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, getSettingsPath, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
9
9
  import { buildMcpToolContracts, } from "../../mcp/tool-definitions.js";
10
10
  import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, ASSURANCE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_MIGRATE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_OUTPUT_DEGRADATION_STEPS, PLAN_FLAG_CONTRACTS, PM_CORE_COMMAND_NAMES, PM_DEPRECATED_TOOL_ACTIONS, PM_TOOL_ACTIONS, PM_TOOL_PARAMETERS_SCHEMA, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, PROFILE_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, EVAL_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, compactFlagAliasContracts, PM_COMMAND_ALIAS_CONTRACTS, resolvePmCommandOutputBudget, } from "../cli-contracts.js";
11
+ import { PM_POSITIONAL_ACTION_FLAG_CONTRACTS } from "./flag-contracts.js";
11
12
  import { GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES, GOVERNANCE_CREATE_MODE_DEFAULT_VALUES, GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES, GOVERNANCE_WORKFLOW_ENFORCEMENT_VALUES, } from "../../types.js";
12
13
  import { BRIEF_LIST_FIELDS, DEFAULT_COMPACT_LIST_FIELDS, LIST_COMMAND_DEFAULT_PROJECTIONS, } from "../query/list.js";
13
14
  import { getActiveContextIntentContracts, } from "../context-intent-contracts.js";
@@ -19,7 +20,7 @@ import { resolvePmCommandOutputEnvelope, } from "../output-contracts.js";
19
20
  import { PM_COMMAND_EXIT_OUTCOME_CONTRACTS, resolvePmCommandExitContract, } from "./command-exit-contracts.js";
20
21
  import { BUILTIN_RELATIONSHIP_KINDS } from "../relationship-kinds/contract.js";
21
22
  import { ASSURANCE_GATE_TRIGGERS, ASSURANCE_MEASUREMENT_SOURCE_KINDS, } from "../governance/assurance.js";
22
- import { PM_CLI_GRAMMAR_CONTRACT, PM_COMMAND_DESTINATION_CONTRACTS, } from "./grammar-contracts.js";
23
+ import { PM_CLI_GRAMMAR_CONTRACT, PM_COMMAND_DESTINATION_CONTRACTS, PM_COMMAND_POSITIONAL_CONTRACTS, PM_POSITIONAL_ACTION_CONTRACTS, positionalShapeKey, resolvePmCommandPositionalContract, } from "./grammar-contracts.js";
23
24
  const AGENT_BOOTSTRAP_FLAGS = new Map([
24
25
  [
25
26
  "claim",
@@ -410,6 +411,7 @@ const CORE_COMMAND_FLAG_CONTRACT_ENTRIES = [
410
411
  ["validate", VALIDATE_FLAG_CONTRACTS],
411
412
  ["health", HEALTH_FLAG_CONTRACTS],
412
413
  ["assurance", ASSURANCE_FLAG_CONTRACTS],
414
+ ...PM_POSITIONAL_ACTION_FLAG_CONTRACTS,
413
415
  ["contracts", CONTRACTS_FLAG_CONTRACTS],
414
416
  ["completion", COMPLETION_FLAG_CONTRACTS],
415
417
  ["activity", ACTIVITY_FLAG_CONTRACTS],
@@ -460,7 +462,8 @@ function actionDescriptorMatchesSelectedCommand(descriptor, selectedCommand) {
460
462
  if (commandPath === selectedCommand) {
461
463
  return true;
462
464
  }
463
- return commandPath.startsWith(`${selectedCommand} `);
465
+ return (commandPath.startsWith(`${selectedCommand} `) ||
466
+ selectedCommand.startsWith(`${commandPath} `));
464
467
  });
465
468
  }
466
469
  function splitCommandPathAliases(commandPath) {
@@ -1184,6 +1187,7 @@ function buildCommandFlagSurface(commands, extensionFlagMap, runtimeFieldFlagMap
1184
1187
  ? {
1185
1188
  canonical_command: canonicalSummaryCommand(command),
1186
1189
  visibility: resolvePmCommandVisibilityTier(canonicalSummaryCommand(command)),
1190
+ positionals: resolvePmCommandPositionalContract(command)?.slots ?? [],
1187
1191
  flag_invocations: enrichCliFlagInvocationContracts(command, flags),
1188
1192
  }
1189
1193
  : {}),
@@ -1716,7 +1720,9 @@ function summarizeCommandIntent(command, extensionContracts) {
1716
1720
  intent_source: "generated",
1717
1721
  };
1718
1722
  }
1719
- function buildCommandSummarySurface(commands, extensionContracts = []) {
1723
+ function buildCommandSummarySurface(commands, extensionContracts = [], options = {}) {
1724
+ const includeFormatBudgets = options.includeFormatBudgets ?? true;
1725
+ const includeIntentProvenance = options.includeIntentProvenance ?? true;
1720
1726
  return [...new Set(commands.map(normalizeCommandPath))]
1721
1727
  .filter((command) => command.length > 0)
1722
1728
  .sort((left, right) => left.localeCompare(right))
@@ -1743,12 +1749,19 @@ function buildCommandSummarySurface(commands, extensionContracts = []) {
1743
1749
  const intent = summarizeCommandIntent(command, extensionContracts);
1744
1750
  return {
1745
1751
  command,
1746
- ...intent,
1752
+ intent: intent.intent,
1753
+ ...(includeIntentProvenance || intent.intent_source !== "command"
1754
+ ? { intent_source: intent.intent_source }
1755
+ : {}),
1747
1756
  ...(flags.length > 0 ? { flags } : {}),
1748
1757
  default_max_estimated_tokens: budget.default_max_estimated_tokens,
1749
- default_max_estimated_tokens_by_format: {
1750
- ...budget.default_max_estimated_tokens_by_format,
1751
- },
1758
+ ...(includeFormatBudgets
1759
+ ? {
1760
+ default_max_estimated_tokens_by_format: {
1761
+ ...budget.default_max_estimated_tokens_by_format,
1762
+ },
1763
+ }
1764
+ : {}),
1752
1765
  };
1753
1766
  });
1754
1767
  }
@@ -1927,8 +1940,11 @@ function attachCommanderAliasContractsResult(result, selection) {
1927
1940
  : "unfiltered_default_brief";
1928
1941
  }
1929
1942
  /** Attach the compact agent-facing command semantics shared by summary and full projections. */
1930
- function attachAgentCommandContractsResult(result, outputCommands, extensionCommandContracts) {
1931
- result.command_summaries = buildCommandSummarySurface(outputCommands, extensionCommandContracts);
1943
+ function attachAgentCommandContractsResult(result, outputCommands, extensionCommandContracts, options) {
1944
+ result.command_summaries = buildCommandSummarySurface(outputCommands, extensionCommandContracts, {
1945
+ includeFormatBudgets: options.includeFormatBudgets,
1946
+ includeIntentProvenance: options.includeIntentProvenance,
1947
+ });
1932
1948
  result.output_policy = {
1933
1949
  token_estimate: "ceil(utf8_bytes / 4)",
1934
1950
  degradation_ladder: [...PM_OUTPUT_DEGRADATION_STEPS],
@@ -1940,6 +1956,15 @@ function attachAgentCommandContractsResult(result, outputCommands, extensionComm
1940
1956
  scope_before_verb: PM_CLI_GRAMMAR_CONTRACT.scope_before_verb,
1941
1957
  visible_top_level_ceiling: PM_CLI_GRAMMAR_CONTRACT.visible_top_level_ceiling,
1942
1958
  ceiling_raise_requires_pm_item: PM_CLI_GRAMMAR_CONTRACT.ceiling_raise_requires_pm_item,
1959
+ positional_shape_budget: PM_CLI_GRAMMAR_CONTRACT.positional_shape_budget,
1960
+ positional_shape_count: new Set(PM_COMMAND_POSITIONAL_CONTRACTS.map(({ slots }) => positionalShapeKey(slots))).size,
1961
+ positional_action_count: PM_POSITIONAL_ACTION_CONTRACTS.length,
1962
+ positional_action_parents: [
1963
+ ...new Set(PM_POSITIONAL_ACTION_CONTRACTS.map(({ parent }) => parent)),
1964
+ ].sort((left, right) => left.localeCompare(right)),
1965
+ ...(options.includePositionalSignatures
1966
+ ? { positional_signatures: PM_COMMAND_POSITIONAL_CONTRACTS }
1967
+ : {}),
1943
1968
  };
1944
1969
  }
1945
1970
  /** Implements run contracts for the public runtime surface of this module. */
@@ -1954,8 +1979,13 @@ export async function runContracts(options, global) {
1954
1979
  const outputCommands = resolveOutputCommands(selection, commands);
1955
1980
  const result = createContractsResult(selection, schemaContext, actionContext, outputCommands);
1956
1981
  const extensionCommandContracts = resolveExtensionCommandContracts(selection, runtime, outputCommands);
1982
+ const includeCommandDetails = selection.fullOutput || selection.selectedCommand !== undefined;
1957
1983
  if (selection.summary || selection.fullOutput) {
1958
- attachAgentCommandContractsResult(result, outputCommands, extensionCommandContracts);
1984
+ attachAgentCommandContractsResult(result, outputCommands, extensionCommandContracts, {
1985
+ includeFormatBudgets: includeCommandDetails,
1986
+ includeIntentProvenance: includeCommandDetails,
1987
+ includePositionalSignatures: includeCommandDetails,
1988
+ });
1959
1989
  }
1960
1990
  if (selection.summary) {
1961
1991
  return result;
@@ -2030,4 +2060,4 @@ export const _testOnlyContractsCommand = {
2030
2060
  toRuntimeShortFlagToken,
2031
2061
  };
2032
2062
  //# sourceMappingURL=runtime-contracts.js.map
2033
- //# debugId=9a66a2a0-94be-595b-983d-347ec95af85e
2063
+ //# debugId=30d9b9dd-f0a1-578e-90d6-3c019e0435b5
@@ -3,7 +3,34 @@
3
3
  *
4
4
  * Defines SDK command-contract metadata for Tool Option Contracts.
5
5
  */
6
- import type { ToolOptionFlagContract } from "./flag-contracts.js";
6
+ import type { CliFlagContract, ToolOptionFlagContract } from "./flag-contracts.js";
7
+ /** One SDK/MCP parameter spelling that cannot be executed by the matching CLI. */
8
+ export interface ToolOptionCliParityFinding {
9
+ /** Stable remediation category. */
10
+ code: "missing_cli_flag" | "missing_parameter_alias";
11
+ /** SDK/MCP parameter key. */
12
+ parameter: string;
13
+ /** Canonical CLI flag selected by the tool transport. */
14
+ flag: string;
15
+ /** Executable parameter-shaped flag expected by cross-surface callers. */
16
+ parameter_flag: string;
17
+ }
18
+ /** Fail-closed receipt for one tool option table and executable CLI flag table. */
19
+ export interface ToolOptionCliParityReport {
20
+ /** Whether every mapping and cross-surface spelling is executable. */
21
+ ok: boolean;
22
+ /** Number of tool parameter mappings inspected. */
23
+ parameter_count: number;
24
+ /** Number of executable CLI flag contracts inspected. */
25
+ cli_flag_count: number;
26
+ /** Missing canonical flags or direct parameter aliases. */
27
+ findings: ToolOptionCliParityFinding[];
28
+ }
29
+ /**
30
+ * Verify that every declared tool parameter maps to a real CLI flag and that
31
+ * its kebab-case spelling is accepted either canonically or as an alias.
32
+ */
33
+ export declare function verifyToolOptionCliParity(toolOptions: readonly ToolOptionFlagContract[], cliFlags: readonly CliFlagContract[]): ToolOptionCliParityReport;
7
34
  /** Public contract for tool list filter option contracts, shared by SDK and presentation-layer consumers. */
8
35
  export declare const TOOL_LIST_FILTER_OPTION_CONTRACTS: ToolOptionFlagContract[];
9
36
  /** Public contract for tool aggregate option contracts, shared by SDK and presentation-layer consumers. */
@@ -1,6 +1,41 @@
1
- /** Returns fresh option contract objects so exported arrays cannot share mutable entries. */
1
+ /**
2
+ * Verify that every declared tool parameter maps to a real CLI flag and that
3
+ * its kebab-case spelling is accepted either canonically or as an alias.
4
+ */
2
5
 
3
- !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]="e2028eff-b29e-5850-87b1-4a3e06f28964")}catch(e){}}();
6
+ !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]="88009976-e03f-5a67-b6fc-bf60240dde49")}catch(e){}}();
7
+ export function verifyToolOptionCliParity(toolOptions, cliFlags) {
8
+ const findings = [];
9
+ for (const { param, flag } of toolOptions) {
10
+ const parameterFlag = `--${param.replace(/([a-z\d])([A-Z])/gu, "$1-$2").toLowerCase()}`;
11
+ const cliFlag = cliFlags.find((candidate) => candidate.flag === flag);
12
+ if (!cliFlag) {
13
+ findings.push({
14
+ code: "missing_cli_flag",
15
+ parameter: param,
16
+ flag,
17
+ parameter_flag: parameterFlag,
18
+ });
19
+ continue;
20
+ }
21
+ if (cliFlag.flag !== parameterFlag &&
22
+ !cliFlag.aliases?.includes(parameterFlag)) {
23
+ findings.push({
24
+ code: "missing_parameter_alias",
25
+ parameter: param,
26
+ flag,
27
+ parameter_flag: parameterFlag,
28
+ });
29
+ }
30
+ }
31
+ return {
32
+ ok: findings.length === 0,
33
+ parameter_count: toolOptions.length,
34
+ cli_flag_count: cliFlags.length,
35
+ findings,
36
+ };
37
+ }
38
+ /** Returns fresh option contract objects so exported arrays cannot share mutable entries. */
4
39
  function cloneOptionContracts(contracts) {
5
40
  return contracts.map((contract) => ({ ...contract }));
6
41
  }
@@ -424,4 +459,4 @@ export const TOOL_GRAPH_OPTION_CONTRACTS = [
424
459
  { param: "summary", flag: "--summary" },
425
460
  ];
426
461
  //# sourceMappingURL=tool-option-contracts.js.map
427
- //# debugId=e2028eff-b29e-5850-87b1-4a3e06f28964
462
+ //# debugId=88009976-e03f-5a67-b6fc-bf60240dde49
@@ -16,10 +16,11 @@ export { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_COMMANDER_STRING_O
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 { 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_DEPRECATED_TOOL_ACTIONS, PM_DISCOVERABLE_TOOL_ACTIONS, PM_TOOL_ACTIONS, analyzePmToolActionParity, isPmToolAction, isPmExtensionCapabilityContract, isPmExtensionServiceNameContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, } from "./cli-contracts/enum-contracts.js";
18
18
  export type { PmExtensionCapabilityContract, PmExtensionServiceNameContract, PmExtensionPolicyModeContract, PmExtensionTrustModeContract, PmExtensionSandboxProfileContract, PmExtensionPolicySurfaceContract, PmToolAction, } from "./cli-contracts/enum-contracts.js";
19
- export { 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, } from "./cli-contracts/tool-option-contracts.js";
19
+ export { 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, type ToolOptionCliParityFinding, type ToolOptionCliParityReport, } from "./cli-contracts/tool-option-contracts.js";
20
20
  export type { OptionsFromContracts, PmBulkMutationControlOptions, PmBulkMutationFilterOptions, PmCloseActionOptions, PmCloseManyActionOptions, PmCreateActionOptions, PmMutationAttributionOptions, PmOptionScalar, PmUpdateActionOptions, PmUpdateManyActionOptions, } from "./cli-contracts/typed-action-inputs.js";
21
21
  export type { CliFlagContract, ToolOptionFlagContract, } from "./cli-contracts/flag-contracts.js";
22
- export { withFlagAliasMetadata, compactFlagAliasContracts, 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_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";
22
+ export { PM_POSITIONAL_ACTION_CONTRACTS, type PmPositionalActionContract, } from "./cli-contracts/grammar-contracts.js";
23
+ export { 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_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";
23
24
  export type { PmActionSchemaContract } from "./cli-contracts/tool-schema.js";
24
25
  export { 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";
25
26
  export type { PmActionToolInputSchemaOptions, PmToolCustomFieldCollision, } from "./cli-contracts/tool-schema.js";
@@ -1,5 +1,5 @@
1
1
 
2
- !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]="75bd0f32-d93c-5737-801e-c66cdcc0f3f1")}catch(e){}}();
2
+ !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]="cec9e389-d3ff-57d4-9b9e-505a7dff2970")}catch(e){}}();
3
3
  export { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, } from "./cli-contracts/command-aliases.js";
4
4
  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";
5
5
  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";
@@ -8,10 +8,11 @@ export { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEAT
8
8
  // sites (sdk/index.ts, mcp/server.ts, commands/contracts.ts, completion.ts, …)
9
9
  // keep importing everything from "./cli-contracts.js" unchanged.
10
10
  export { 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_DEPRECATED_TOOL_ACTIONS, PM_DISCOVERABLE_TOOL_ACTIONS, PM_TOOL_ACTIONS, analyzePmToolActionParity, isPmToolAction, isPmExtensionCapabilityContract, isPmExtensionServiceNameContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, } from "./cli-contracts/enum-contracts.js";
11
- export { 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, } from "./cli-contracts/tool-option-contracts.js";
12
- export { withFlagAliasMetadata, compactFlagAliasContracts, 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_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";
11
+ export { 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";
12
+ export { PM_POSITIONAL_ACTION_CONTRACTS, } from "./cli-contracts/grammar-contracts.js";
13
+ export { 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_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";
13
14
  export { 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";
14
15
  export { analyzeSdkCliParameterCompleteness, } from "./cli-contracts/completeness.js";
15
16
  export { PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, resolvePmCommandOutputBudget, } from "./cli-contracts/agent-output-contracts.js";
16
17
  //# sourceMappingURL=cli-contracts.js.map
17
- //# debugId=75bd0f32-d93c-5737-801e-c66cdcc0f3f1
18
+ //# debugId=cec9e389-d3ff-57d4-9b9e-505a7dff2970
@@ -66,9 +66,9 @@ export declare function runWithContextIntentContracts<T>(layers: PmContextIntent
66
66
  /** Validate and compose core, package, and workspace intent declarations. Later layers override earlier layers by command and intent. */
67
67
  export declare function composeContextIntentContracts(workspaceContracts?: readonly PmContextIntentContract[], packageContracts?: readonly PmContextIntentContract[]): PmContextIntentContract[];
68
68
  /** Resolve one intent declaration or fail with the nearest command-local intent. */
69
- export declare function resolveContextIntentContract(command: string, intent: string, contracts?: readonly PmContextIntentContract[]): PmContextIntentContract | undefined;
69
+ export declare function resolveContextIntentContract(command: string, intent: string, contracts?: readonly PmContextIntentContract[], positionalArguments?: readonly string[]): PmContextIntentContract | undefined;
70
70
  /** Apply one declared read intent's defaults while preserving explicit caller options. */
71
- export declare function applyContextIntentProjection(command: "context" | "get" | "list" | "next" | "search", options: Record<string, unknown>): Record<string, unknown>;
71
+ export declare function applyContextIntentProjection(command: "context" | "get" | "list" | "next" | "search", options: Record<string, unknown>, positionalArguments?: readonly string[]): Record<string, unknown>;
72
72
  interface ContextIntentCursorEnvelope {
73
73
  fingerprint: string;
74
74
  after_index: number;
@@ -5,8 +5,9 @@
5
5
  * workspace configuration, and packages.
6
6
  */
7
7
 
8
- !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]="d09393aa-0253-5ad6-a2fe-245f31b9eb87")}catch(e){}}();
8
+ !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]="86db3dad-99b9-5c48-be52-990f110ac81f")}catch(e){}}();
9
9
  import { AsyncLocalStorage } from "node:async_hooks";
10
+ import { renderPmCommand } from "./command-line.js";
10
11
  import { attachOutputOmissionReceipt } from "./output-projection.js";
11
12
  import { encodeQueryCursor } from "./pagination.js";
12
13
  import { applyReadOutputDimensions, stabilizeReadOutputReceiptEstimates, } from "./read-output-contracts.js";
@@ -153,7 +154,7 @@ export function composeContextIntentContracts(workspaceContracts = [], packageCo
153
154
  left.intent.localeCompare(right.intent));
154
155
  }
155
156
  /** Resolve one intent declaration or fail with the nearest command-local intent. */
156
- export function resolveContextIntentContract(command, intent, contracts = getActiveContextIntentContracts()) {
157
+ export function resolveContextIntentContract(command, intent, contracts = getActiveContextIntentContracts(), positionalArguments = []) {
157
158
  const normalizedCommand = command.trim().toLowerCase();
158
159
  const normalizedIntent = intent.trim().toLowerCase();
159
160
  const exact = contracts.find((entry) => entry.command === normalizedCommand && entry.intent === normalizedIntent);
@@ -184,7 +185,19 @@ export function resolveContextIntentContract(command, intent, contracts = getAct
184
185
  })
185
186
  .sort((left, right) => left.distance - right.distance ||
186
187
  left.candidate.localeCompare(right.candidate))[0].candidate;
187
- const suggestedCommand = `pm ${normalizedCommand} --for ${suggestion}`;
188
+ const attemptedArguments = [
189
+ normalizedCommand,
190
+ ...positionalArguments,
191
+ "--for",
192
+ normalizedIntent,
193
+ ];
194
+ const suggestedRetryArguments = [
195
+ normalizedCommand,
196
+ ...positionalArguments,
197
+ "--for",
198
+ suggestion,
199
+ ];
200
+ const suggestedCommand = renderPmCommand(suggestedRetryArguments);
188
201
  throw new PmCliError(`Unknown context intent "${normalizedIntent}" for ${normalizedCommand}. Did you mean "${suggestion}"?`, EXIT_CODE.USAGE, {
189
202
  code: "unknown_context_intent",
190
203
  reason: "unknown_intent",
@@ -194,8 +207,10 @@ export function resolveContextIntentContract(command, intent, contracts = getAct
194
207
  nextSteps: [suggestedCommand],
195
208
  recovery: {
196
209
  recovery_mode: "compact",
197
- attempted_command: `pm ${normalizedCommand} --for ${normalizedIntent}`,
210
+ attempted_command: renderPmCommand(attemptedArguments),
211
+ allowed_values: [...candidates].sort(),
198
212
  suggested_retry: suggestedCommand,
213
+ suggested_retry_args: suggestedRetryArguments,
199
214
  },
200
215
  });
201
216
  }
@@ -266,7 +281,7 @@ const CONTEXT_INTENT_DEFAULT_APPLIERS = {
266
281
  },
267
282
  };
268
283
  /** Apply one declared read intent's defaults while preserving explicit caller options. */
269
- export function applyContextIntentProjection(command, options) {
284
+ export function applyContextIntentProjection(command, options, positionalArguments = []) {
270
285
  const tokenBudget = options.tokenBudget ?? options.token_budget;
271
286
  if (typeof options.for !== "string") {
272
287
  if (tokenBudget !== undefined &&
@@ -289,7 +304,7 @@ export function applyContextIntentProjection(command, options) {
289
304
  delete projected.token_budget;
290
305
  return projected;
291
306
  }
292
- const contract = resolveContextIntentContract(command, options.for);
307
+ const contract = resolveContextIntentContract(command, options.for, undefined, positionalArguments);
293
308
  const explicitTokenBudget = parsePositiveIntentTokenBudget(tokenBudget) !== undefined;
294
309
  const projected = { ...options };
295
310
  if (projected.tokenBudget === undefined && tokenBudget !== undefined) {
@@ -686,4 +701,4 @@ export function attachReadOutputContracts(command, options, result) {
686
701
  return stabilizeSuppressedRowContractReceipts(Object.fromEntries(Object.entries(projected).filter(([key]) => key !== "row_contract")), options);
687
702
  }
688
703
  //# sourceMappingURL=context-intent-contracts.js.map
689
- //# debugId=d09393aa-0253-5ad6-a2fe-245f31b9eb87
704
+ //# debugId=86db3dad-99b9-5c48-be52-990f110ac81f
@@ -10,7 +10,9 @@ export * from "./context-intent-contracts.js";
10
10
  export * from "./error-code-catalog.js";
11
11
  export * from "./generated-error-code-catalog.js";
12
12
  export * from "./flag-invocation-contracts.js";
13
+ export * from "./cli-contracts/flag-lexicon-contracts.js";
13
14
  export * from "./output-token-accounting.js";
14
15
  export * from "./output-contracts.js";
15
16
  export * from "./read-output-contracts.js";
17
+ export * from "./agent/refusal-closure.js";
16
18
  export type { PmReadOutputSessionReceipt, PmReadOutputSessionState, } from "./read-output-session.js";
@@ -4,7 +4,7 @@
4
4
  * Exposes command and action contract data without loading SDK runtime code.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="df504de1-de3b-55fe-baef-08c0d1dcf97f")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c3e3b1f2-1898-5773-8b3f-55fa39f6c4e7")}catch(e){}}();
8
8
  export * from "./cli-contracts.js";
9
9
  export * from "./cli-contracts/grammar-contracts.js";
10
10
  export * from "./cli-contracts/command-exit-contracts.js";
@@ -12,8 +12,10 @@ export * from "./context-intent-contracts.js";
12
12
  export * from "./error-code-catalog.js";
13
13
  export * from "./generated-error-code-catalog.js";
14
14
  export * from "./flag-invocation-contracts.js";
15
+ export * from "./cli-contracts/flag-lexicon-contracts.js";
15
16
  export * from "./output-token-accounting.js";
16
17
  export * from "./output-contracts.js";
17
18
  export * from "./read-output-contracts.js";
19
+ export * from "./agent/refusal-closure.js";
18
20
  //# sourceMappingURL=contracts.js.map
19
- //# debugId=df504de1-de3b-55fe-baef-08c0d1dcf97f
21
+ //# debugId=c3e3b1f2-1898-5773-8b3f-55fa39f6c4e7
@@ -25,7 +25,44 @@ export interface CliFlagInvocationContract extends CliFlagContract {
25
25
  /** Sentinel that redirects the argv value to stdin. */
26
26
  stdin_token?: "-";
27
27
  }
28
+ /** Executable option arity observed from the registered Commander program. */
29
+ export interface CliFlagArityObservation {
30
+ /** Canonical command path owning the option. */
31
+ command: string;
32
+ /** Long option spelling. */
33
+ flag: string;
34
+ /** Whether the option consumes a value token. */
35
+ takes_value: boolean;
36
+ /** Whether the consumed value is mandatory. */
37
+ value_required: boolean;
38
+ /** Whether repeated values accumulate. */
39
+ repeatable: boolean;
40
+ }
41
+ /** One machine-readable mismatch between declared and executable flag arity. */
42
+ export interface CliFlagInvocationParityFinding {
43
+ /** Stable finding code. */
44
+ code: "duplicate_observation" | "missing_observation" | "takes_value_mismatch" | "value_required_mismatch" | "repeatable_mismatch" | "undeclared_observation";
45
+ /** Canonical command path. */
46
+ command: string;
47
+ /** Long option spelling. */
48
+ flag: string;
49
+ /** Human-readable mismatch detail. */
50
+ detail: string;
51
+ }
52
+ /** Complete parity receipt for one command's declared and executable flags. */
53
+ export interface CliFlagInvocationParityReport {
54
+ /** Whether the two surfaces agree exactly. */
55
+ ok: boolean;
56
+ /** Number of declared invocation rows. */
57
+ declared_count: number;
58
+ /** Number of executable observations. */
59
+ observed_count: number;
60
+ /** Stable mismatch list. */
61
+ findings: CliFlagInvocationParityFinding[];
62
+ }
28
63
  /** Enrich one vocabulary row with deterministic invocation and input-channel metadata. */
29
64
  export declare function enrichCliFlagInvocationContract(command: string, contract: CliFlagContract): CliFlagInvocationContract;
30
65
  /** Enrich a complete command flag table without mutating package-owned rows. */
31
66
  export declare function enrichCliFlagInvocationContracts(command: string, contracts: readonly CliFlagContract[]): CliFlagInvocationContract[];
67
+ /** Compare generated invocation rows with independently observed executable arity. */
68
+ export declare function verifyCliFlagInvocationParity(command: string, declarations: readonly CliFlagInvocationContract[], observations: readonly CliFlagArityObservation[]): CliFlagInvocationParityReport;