@unbrained/pm-cli 2026.8.19 → 2026.8.20

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 (146) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +19 -0
  3. package/dist/cli/register-list-query.js +12 -10
  4. package/dist/cli/register-structured-mutation.d.ts +2 -0
  5. package/dist/cli/register-structured-mutation.js +29 -6
  6. package/dist/cli-bundle/bundle-manifest.json +151 -143
  7. package/dist/cli-bundle/chunks/{chunk-4THEB6PD.js → chunk-2RDVGYWE.js} +12 -12
  8. package/dist/cli-bundle/chunks/{chunk-BHYMXLAE.js → chunk-4GB2LTOQ.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-TOXJM4WA.js → chunk-7BRF2BX2.js} +2 -2
  10. package/dist/cli-bundle/chunks/chunk-BLVQHFSY.js +35 -0
  11. package/dist/cli-bundle/chunks/chunk-CU25EQVV.js +5 -0
  12. package/dist/cli-bundle/chunks/{chunk-4NRRH7AM.js → chunk-K3EN3LK2.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-OIOKV6NO.js → chunk-L4LGPBJU.js} +49 -49
  14. package/dist/cli-bundle/chunks/chunk-RS3IV2R6.js +197 -0
  15. package/dist/cli-bundle/chunks/chunk-TSMWLCHS.js +3 -0
  16. package/dist/cli-bundle/chunks/chunk-US2ZQW2M.js +77 -0
  17. package/dist/cli-bundle/chunks/{chunk-QXSH7BLM.js → chunk-XYDDWBZN.js} +2 -2
  18. package/dist/cli-bundle/chunks/register-list-query-JSAQCVOC.js +11 -0
  19. package/dist/cli-bundle/chunks/{register-mutation-AUWVCW4M.js → register-mutation-XJPAW63D.js} +20 -20
  20. package/dist/cli-bundle/chunks/{register-operations-PZQPHXW5.js → register-operations-DSOSB2XQ.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-setup-I4LUHGVW.js → register-setup-QUR6QL2C.js} +2 -2
  22. package/dist/cli-bundle/focused-chunks/{chunk-DKPLYW3L.js → chunk-325UXIO7.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/chunk-5L7M4AI7.js +2 -0
  24. package/dist/cli-bundle/focused-chunks/{chunk-EF6ZS5GH.js → chunk-6AHG2YW7.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-MCZXYZAF.js → chunk-AZBACT5T.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-VXDSU5MC.js → chunk-BLJCGGID.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/chunk-FUREQLQN.js +18 -0
  28. package/dist/cli-bundle/focused-chunks/{chunk-US7VEYZG.js → chunk-G3C5ERXG.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-ZBIQQYMI.js → chunk-GXWQBE3T.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-JDOMQ7VQ.js → chunk-JWKEDZJI.js} +3 -3
  31. package/dist/cli-bundle/focused-chunks/chunk-KYZ6JGPL.js +155 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-ESISGDAY.js → chunk-M32HFIQB.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-EXBCLIBU.js → chunk-OM65KHGF.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-Q47EX4DI.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-BJRYFVSH.js → chunk-RIHDMCUM.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-T4ZFY7ZJ.js +16 -0
  37. package/dist/cli-bundle/focused-chunks/chunk-TDR5OGG3.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-ODHQEECS.js → chunk-UGSS4F5X.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/chunk-Z3PLWSGM.js +2 -0
  40. package/dist/cli-bundle/main.js +2 -2
  41. package/dist/cli-bundle/sdk-authoring.js +1 -1
  42. package/dist/cli-bundle/sdk-contracts.js +2 -2
  43. package/dist/cli-bundle/sdk-core.js +41 -41
  44. package/dist/cli-bundle/sdk-governance.js +1 -1
  45. package/dist/cli-bundle/sdk-graph.js +1 -1
  46. package/dist/cli-bundle/sdk-merge.js +31 -31
  47. package/dist/cli-bundle/sdk-query.js +1 -1
  48. package/dist/cli-bundle/sdk-runtime.js +1 -1
  49. package/dist/cli-bundle/sdk-testing.js +1 -1
  50. package/dist/cli-bundle/sdk.js +5 -5
  51. package/dist/core/output/mutation-projection.js +26 -2
  52. package/dist/core/shared/constants.d.ts +1 -5
  53. package/dist/core/shared/constants.js +3 -81
  54. package/dist/core/shared/item-metadata-contract.d.ts +14 -0
  55. package/dist/core/shared/item-metadata-contract.js +90 -0
  56. package/dist/core/store/item-store.d.ts +60 -0
  57. package/dist/core/store/item-store.js +22 -5
  58. package/dist/sdk/agent/closed-domain-contracts.d.ts +25 -0
  59. package/dist/sdk/agent/closed-domain-contracts.js +140 -0
  60. package/dist/sdk/agent/refusal-closure.d.ts +13 -1
  61. package/dist/sdk/agent/refusal-closure.js +45 -3
  62. package/dist/sdk/agent/refusal-reachability.d.ts +26 -0
  63. package/dist/sdk/agent/refusal-reachability.js +26 -2
  64. package/dist/sdk/agent-capability-contracts.js +6 -11
  65. package/dist/sdk/cli-contracts/completeness.js +8 -2
  66. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -2
  67. package/dist/sdk/cli-contracts/enum-contracts.js +16 -6
  68. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  69. package/dist/sdk/cli-contracts/flag-contracts.js +11 -2
  70. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +19 -2
  71. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +105 -5
  72. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +2 -2
  73. package/dist/sdk/cli-contracts/grammar-contracts.js +5 -2
  74. package/dist/sdk/cli-contracts/runtime-contracts.js +7 -3
  75. package/dist/sdk/cli-contracts/tool-schema.js +7 -2
  76. package/dist/sdk/cli-contracts.d.ts +2 -2
  77. package/dist/sdk/cli-contracts.js +4 -4
  78. package/dist/sdk/contracts.d.ts +1 -0
  79. package/dist/sdk/contracts.js +3 -2
  80. package/dist/sdk/core.d.ts +1 -1
  81. package/dist/sdk/core.js +3 -3
  82. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +74 -2
  83. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +112 -40
  84. package/dist/sdk/index.d.ts +5 -3
  85. package/dist/sdk/index.js +6 -4
  86. package/dist/sdk/init-agent-guidance.d.ts +5 -3
  87. package/dist/sdk/init-agent-guidance.js +69 -9
  88. package/dist/sdk/lifecycle/mcp-actions.d.ts +18 -0
  89. package/dist/sdk/lifecycle/mcp-actions.js +52 -0
  90. package/dist/sdk/lifecycle/reopen.d.ts +44 -0
  91. package/dist/sdk/lifecycle/reopen.js +69 -0
  92. package/dist/sdk/lifecycle/update.d.ts +31 -0
  93. package/dist/sdk/lifecycle/update.js +95 -13
  94. package/dist/sdk/query/get.d.ts +1 -1
  95. package/dist/sdk/query/get.js +18 -52
  96. package/dist/sdk/query/list.d.ts +7 -21
  97. package/dist/sdk/query/list.js +35 -49
  98. package/dist/sdk/query/projection-contracts.d.ts +33 -0
  99. package/dist/sdk/query/projection-contracts.js +185 -0
  100. package/dist/sdk/query/search-contracts.d.ts +2 -1
  101. package/dist/sdk/query/search-contracts.js +18 -87
  102. package/dist/sdk/query/search.d.ts +15 -0
  103. package/dist/sdk/query/search.js +31 -5
  104. package/dist/sdk/runtime-primitives.d.ts +1 -1
  105. package/dist/sdk/runtime-primitives.js +3 -3
  106. package/dist/sdk/runtime.d.ts +6 -0
  107. package/dist/sdk/runtime.js +18 -14
  108. package/dist/sdk/similarity.d.ts +13 -0
  109. package/dist/sdk/similarity.js +32 -6
  110. package/docs/COMMANDS.md +13 -1
  111. package/docs/README.md +1 -0
  112. package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +114 -0
  113. package/docs/SDK.md +10 -2
  114. package/docs/SDK_CONTEXT_INTEGRITY.md +45 -0
  115. package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
  116. package/docs/performance/sdk-entrypoint-import-costs.md +14 -21
  117. package/marketplace.json +2 -2
  118. package/package.json +5 -5
  119. package/packages/pm-beads/package.json +1 -1
  120. package/packages/pm-calendar/package.json +1 -1
  121. package/packages/pm-command-kit/package.json +1 -1
  122. package/packages/pm-digital-twin/package.json +1 -1
  123. package/packages/pm-governance-audit/package.json +1 -1
  124. package/packages/pm-guide-shell/package.json +1 -1
  125. package/packages/pm-kanban/package.json +1 -1
  126. package/packages/pm-lifecycle-hooks/package.json +1 -1
  127. package/packages/pm-linked-test-adapters/package.json +1 -1
  128. package/packages/pm-search-advanced/package.json +1 -1
  129. package/packages/pm-templates/package.json +1 -1
  130. package/packages/pm-todos/package.json +1 -1
  131. package/packages/pm-vcs/package.json +1 -1
  132. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  133. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  134. package/sdk/public-surface.json +387 -25
  135. package/dist/cli-bundle/chunks/chunk-GWMXAQOD.js +0 -197
  136. package/dist/cli-bundle/chunks/chunk-HVFQTLYM.js +0 -35
  137. package/dist/cli-bundle/chunks/chunk-OI4XI562.js +0 -5
  138. package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +0 -3
  139. package/dist/cli-bundle/chunks/chunk-YBMRWW4E.js +0 -77
  140. package/dist/cli-bundle/chunks/register-list-query-Y56KINDU.js +0 -11
  141. package/dist/cli-bundle/focused-chunks/chunk-34QBIYZI.js +0 -155
  142. package/dist/cli-bundle/focused-chunks/chunk-L623ZPNK.js +0 -2
  143. package/dist/cli-bundle/focused-chunks/chunk-PRHY2IMX.js +0 -18
  144. package/dist/cli-bundle/focused-chunks/chunk-RZU5U6Q7.js +0 -2
  145. package/dist/cli-bundle/focused-chunks/chunk-YBMGXBFV.js +0 -16
  146. package/dist/cli-bundle/focused-chunks/chunk-YLVBJ6GF.js +0 -2
@@ -0,0 +1,185 @@
1
+ /**
2
+ * @module sdk/query/projection-contracts
3
+ *
4
+ * Declares dependency-light projection vocabularies for list, get, and search
5
+ * so contract-only SDK imports do not initialize query runtimes or storage.
6
+ */
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]="5bb71ec1-7eb1-558e-a965-acd779570c2e")}catch(e){}}();
9
+ import { ITEM_METADATA_KEY_ORDER } from "../../core/shared/item-metadata-contract.js";
10
+ /** Stable field order for the compact list projection. */
11
+ export const DEFAULT_COMPACT_LIST_FIELDS = [
12
+ "id",
13
+ "title",
14
+ "status",
15
+ "type",
16
+ "priority",
17
+ "parent",
18
+ "updated_at",
19
+ ];
20
+ /** Stable field order for the agent-optimized brief list projection. */
21
+ export const BRIEF_LIST_FIELDS = ["id", "status", "type", "title"];
22
+ /** Machine-readable default projection contract for every list command. */
23
+ export const LIST_COMMAND_DEFAULT_PROJECTIONS = {
24
+ list: "brief",
25
+ "list-all": "full",
26
+ "list-draft": "full",
27
+ "list-open": "brief",
28
+ "list-in-progress": "brief",
29
+ "list-blocked": "brief",
30
+ "list-closed": "full",
31
+ "list-canceled": "full",
32
+ };
33
+ const TREE_METADATA_FIELDS = [
34
+ "tree_depth",
35
+ "tree_parent",
36
+ "tree_children",
37
+ "tree_title",
38
+ ];
39
+ /** Return every accepted list projection selector for core and runtime metadata. */
40
+ export function listListProjectionFields(runtimeMetadataKeys = []) {
41
+ return [
42
+ ...new Set([
43
+ ...ITEM_METADATA_KEY_ORDER,
44
+ "body",
45
+ ...TREE_METADATA_FIELDS,
46
+ ...runtimeMetadataKeys,
47
+ ]),
48
+ ]
49
+ .flatMap((field) => [field, `item.${field}`])
50
+ .sort();
51
+ }
52
+ /** Canonical get depth values. The CLI also accepts full as an alias for deep. */
53
+ export const GET_DEPTH_VALUES = ["brief", "standard", "deep"];
54
+ const GET_ROOT_PROJECTION_FIELDS = [
55
+ "body",
56
+ "linked",
57
+ "claim_state",
58
+ "children",
59
+ "schedule",
60
+ ];
61
+ const GET_LINKED_PROJECTION_FIELDS = [
62
+ "linked.files",
63
+ "linked.tests",
64
+ "linked.docs",
65
+ ];
66
+ const GET_CLAIM_STATE_PROJECTION_FIELDS = [
67
+ "claim_state.claimed",
68
+ "claim_state.assignee",
69
+ "claim_state.last_claim",
70
+ "claim_state.last_release",
71
+ ];
72
+ const GET_SCHEDULE_PROJECTION_FIELDS = [
73
+ "schedule.deadline",
74
+ "schedule.start_at",
75
+ "schedule.end_at",
76
+ "schedule.location",
77
+ "schedule.reminders",
78
+ "schedule.events",
79
+ ];
80
+ /** Return every accepted get projection selector for core and runtime metadata. */
81
+ export function listGetProjectionFields(runtimeMetadataKeys = []) {
82
+ const itemFields = [
83
+ ...new Set([
84
+ ...ITEM_METADATA_KEY_ORDER,
85
+ ...runtimeMetadataKeys,
86
+ "notes_count",
87
+ "tests_count",
88
+ "collection_counts",
89
+ ]),
90
+ ];
91
+ return [
92
+ ...itemFields.flatMap((field) => [field, `item.${field}`]),
93
+ ...GET_ROOT_PROJECTION_FIELDS,
94
+ ...GET_LINKED_PROJECTION_FIELDS,
95
+ ...GET_CLAIM_STATE_PROJECTION_FIELDS,
96
+ ...GET_SCHEDULE_PROJECTION_FIELDS,
97
+ ].sort();
98
+ }
99
+ /** Stable field order for compact search results. */
100
+ export const DEFAULT_COMPACT_SEARCH_FIELDS = [
101
+ "id",
102
+ "title",
103
+ "status",
104
+ "type",
105
+ "priority",
106
+ "updated_at",
107
+ "score",
108
+ "matched_fields",
109
+ ];
110
+ /** Search-result fields that live beside the nested item projection. */
111
+ export const SEARCH_HIT_FIELD_KEYS = [
112
+ "score",
113
+ "matched_fields",
114
+ "highlights",
115
+ ];
116
+ /** Core item fields accepted by explicit search projections. */
117
+ export const SEARCH_ITEM_FIELD_KEYS = [
118
+ "id",
119
+ "title",
120
+ "description",
121
+ "type",
122
+ "status",
123
+ "priority",
124
+ "tags",
125
+ "created_at",
126
+ "updated_at",
127
+ "deadline",
128
+ "assignee",
129
+ "author",
130
+ "estimated_minutes",
131
+ "acceptance_criteria",
132
+ "dependencies",
133
+ "comments",
134
+ "notes",
135
+ "learnings",
136
+ "reminders",
137
+ "events",
138
+ "files",
139
+ "tests",
140
+ "docs",
141
+ "close_reason",
142
+ "parent",
143
+ "reviewer",
144
+ "risk",
145
+ "confidence",
146
+ "sprint",
147
+ "release",
148
+ "blocked_by",
149
+ "blocked_reason",
150
+ "reporter",
151
+ "severity",
152
+ "environment",
153
+ "repro_steps",
154
+ "resolution",
155
+ "expected_result",
156
+ "actual_result",
157
+ "affected_version",
158
+ "fixed_version",
159
+ "component",
160
+ "regression",
161
+ "customer_impact",
162
+ "definition_of_ready",
163
+ "order",
164
+ "rank",
165
+ "goal",
166
+ "objective",
167
+ "value",
168
+ "impact",
169
+ "outcome",
170
+ "why_now",
171
+ "plan",
172
+ ];
173
+ /** Return every accepted search projection selector for core and runtime metadata. */
174
+ export function listSearchProjectionFields(runtimeMetadataKeys = []) {
175
+ const runtimeKeys = [...new Set(runtimeMetadataKeys)];
176
+ return [
177
+ ...SEARCH_HIT_FIELD_KEYS,
178
+ ...SEARCH_ITEM_FIELD_KEYS,
179
+ ...SEARCH_ITEM_FIELD_KEYS.map((field) => `item.${field}`),
180
+ ...runtimeKeys,
181
+ ...runtimeKeys.map((field) => `item.${field}`),
182
+ ].sort();
183
+ }
184
+ //# sourceMappingURL=projection-contracts.js.map
185
+ //# debugId=5bb71ec1-7eb1-558e-a965-acd779570c2e
@@ -1,6 +1,7 @@
1
1
  import type { RuntimeFieldRegistry } from "../../core/schema/runtime-schema.js";
2
2
  import type { SharedItemFilterOptions } from "./item-filter-options.js";
3
3
  import type { SearchMode } from "./search-rendering.js";
4
+ export { DEFAULT_COMPACT_SEARCH_FIELDS, SEARCH_HIT_FIELD_KEYS, SEARCH_ITEM_FIELD_KEYS, listSearchProjectionFields, } from "./projection-contracts.js";
4
5
  /** Documents the search options payload exchanged by command, SDK, and package integrations. */
5
6
  export interface SearchOptions extends SharedItemFilterOptions {
6
7
  /** Value that configures or reports mode for this contract. */
@@ -60,7 +61,7 @@ export declare function normalizeSearchPhrase(value: string): string;
60
61
  /** Parse an optional deadline filter. */
61
62
  export declare function parseSearchDeadline(raw: string | undefined, fieldLabel: string): string | undefined;
62
63
  /** Resolve mutually exclusive compact, full, or explicit-field projection. */
63
- export declare function parseSearchProjection(options: SearchOptions): SearchProjectionConfig;
64
+ export declare function parseSearchProjection(options: SearchOptions, query?: string): SearchProjectionConfig;
64
65
  /** Validate explicit projection fields against core and runtime metadata. */
65
66
  export declare function validateSearchProjectionFields(projection: SearchProjectionConfig, runtimeFieldRegistry: RuntimeFieldRegistry, query?: string): void;
66
67
  /** Parse a non-empty normalized query into lexical tokens. */
@@ -4,83 +4,13 @@
4
4
  * Owns search input parsing, output projection contracts, and tuning defaults.
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]="e737cdf9-734c-5010-864f-60e8052dd9c1")}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]="d20ab01b-a8ae-5fe8-988a-d05fe87951f6")}catch(e){}}();
8
8
  import { coerceNumberInRange } from "../../core/shared/primitives.js";
9
- import { EXIT_CODE } from "../../core/shared/constants.js";
10
- import { PmCliError } from "../../core/shared/errors.js";
11
9
  import { resolveIsoOrRelative } from "../../core/shared/time.js";
12
10
  import { renderPmCommand } from "../command-line.js";
13
- const DEFAULT_COMPACT_SEARCH_FIELDS = [
14
- "id",
15
- "title",
16
- "status",
17
- "type",
18
- "priority",
19
- "updated_at",
20
- "score",
21
- "matched_fields",
22
- ];
23
- const SEARCH_HIT_FIELD_KEYS = new Set([
24
- "score",
25
- "matched_fields",
26
- "highlights",
27
- ]);
28
- const SEARCH_ITEM_FIELD_KEYS = new Set([
29
- "id",
30
- "title",
31
- "description",
32
- "type",
33
- "status",
34
- "priority",
35
- "tags",
36
- "created_at",
37
- "updated_at",
38
- "deadline",
39
- "assignee",
40
- "author",
41
- "estimated_minutes",
42
- "acceptance_criteria",
43
- "dependencies",
44
- "comments",
45
- "notes",
46
- "learnings",
47
- "reminders",
48
- "events",
49
- "files",
50
- "tests",
51
- "docs",
52
- "close_reason",
53
- "parent",
54
- "reviewer",
55
- "risk",
56
- "confidence",
57
- "sprint",
58
- "release",
59
- "blocked_by",
60
- "blocked_reason",
61
- "reporter",
62
- "severity",
63
- "environment",
64
- "repro_steps",
65
- "resolution",
66
- "expected_result",
67
- "actual_result",
68
- "affected_version",
69
- "fixed_version",
70
- "component",
71
- "regression",
72
- "customer_impact",
73
- "definition_of_ready",
74
- "order",
75
- "rank",
76
- "goal",
77
- "objective",
78
- "value",
79
- "impact",
80
- "outcome",
81
- "why_now",
82
- "plan",
83
- ]);
11
+ import { EXIT_CODE, PmCliError } from "../runtime-primitives.js";
12
+ import { DEFAULT_COMPACT_SEARCH_FIELDS, listSearchProjectionFields, } from "./projection-contracts.js";
13
+ export { DEFAULT_COMPACT_SEARCH_FIELDS, SEARCH_HIT_FIELD_KEYS, SEARCH_ITEM_FIELD_KEYS, listSearchProjectionFields, } from "./projection-contracts.js";
84
14
  /** Parse the configured search execution mode. */
85
15
  export function parseSearchMode(raw) {
86
16
  if (raw === undefined)
@@ -155,7 +85,7 @@ function parseFieldSelectors(raw) {
155
85
  return [...new Set(selectors)];
156
86
  }
157
87
  /** Resolve mutually exclusive compact, full, or explicit-field projection. */
158
- export function parseSearchProjection(options) {
88
+ export function parseSearchProjection(options, query = "<query>") {
159
89
  const compactRequested = options.compact === true;
160
90
  const fullRequested = options.full === true;
161
91
  const fieldSelectors = parseFieldSelectors(options.fields);
@@ -163,7 +93,13 @@ export function parseSearchProjection(options) {
163
93
  Number(fullRequested) +
164
94
  Number(fieldSelectors !== undefined);
165
95
  if (enabledModes > 1) {
166
- throw new PmCliError("Search projection options are mutually exclusive. Use one of --compact, --full, or --fields.", EXIT_CODE.USAGE);
96
+ throw new PmCliError("Search projection options are mutually exclusive. Use one of --compact, --full, or --fields.", EXIT_CODE.USAGE, {
97
+ code: "projection_options_mutually_exclusive",
98
+ recovery: {
99
+ suggested_retry: renderPmCommand(["search", query, "--full"]),
100
+ suggested_retry_args: ["search", query, "--full"],
101
+ },
102
+ });
167
103
  }
168
104
  if (compactRequested) {
169
105
  return { mode: "compact", fields: [...DEFAULT_COMPACT_SEARCH_FIELDS] };
@@ -178,20 +114,14 @@ export function parseSearchProjection(options) {
178
114
  export function validateSearchProjectionFields(projection, runtimeFieldRegistry, query = "<query>") {
179
115
  if (projection.mode !== "fields")
180
116
  return;
181
- const runtimeKeys = new Set(runtimeFieldRegistry.definitions.flatMap((field) => [
117
+ const allowedValues = listSearchProjectionFields(runtimeFieldRegistry.definitions.flatMap((field) => [
182
118
  field.key,
183
119
  field.metadata_key,
184
120
  ]));
185
- const allowedValues = new Set([
186
- ...SEARCH_HIT_FIELD_KEYS,
187
- ...SEARCH_ITEM_FIELD_KEYS,
188
- ...[...SEARCH_ITEM_FIELD_KEYS].map((field) => `item.${field}`),
189
- ...runtimeKeys,
190
- ...[...runtimeKeys].map((field) => `item.${field}`),
191
- ]);
121
+ const allowed = new Set(allowedValues);
192
122
  const unknown = projection.fields.filter((field) => {
193
123
  const normalized = field.trim();
194
- return !allowedValues.has(normalized);
124
+ return !allowed.has(normalized);
195
125
  });
196
126
  if (unknown.length > 0) {
197
127
  const suggestedRetryArguments = [
@@ -201,6 +131,7 @@ export function validateSearchProjectionFields(projection, runtimeFieldRegistry,
201
131
  "id,title,status,score",
202
132
  ];
203
133
  throw new PmCliError(`Unknown search --fields value(s): ${unknown.join(", ")}`, EXIT_CODE.USAGE, {
134
+ code: "unknown_field_projection",
204
135
  examples: [
205
136
  "pm search <query> --fields id,title,status,score",
206
137
  "pm search <query> --fields id,title,item.description,matched_fields",
@@ -209,7 +140,7 @@ export function validateSearchProjectionFields(projection, runtimeFieldRegistry,
209
140
  "Use item.<field> for explicit item metadata fields, or run pm search --help for projection examples.",
210
141
  ],
211
142
  recovery: {
212
- allowed_values: [...allowedValues].sort(),
143
+ allowed_values: allowedValues,
213
144
  suggested_retry: renderPmCommand(suggestedRetryArguments),
214
145
  suggested_retry_args: suggestedRetryArguments,
215
146
  },
@@ -297,4 +228,4 @@ export function resolveSearchTuning(settings) {
297
228
  };
298
229
  }
299
230
  //# sourceMappingURL=search-contracts.js.map
300
- //# debugId=e737cdf9-734c-5010-864f-60e8052dd9c1
231
+ //# debugId=d20ab01b-a8ae-5fe8-988a-d05fe87951f6
@@ -183,8 +183,23 @@ export declare function collectErrorCauseCodes(error: unknown): string;
183
183
  */
184
184
  export declare function classifyImplicitSemanticFallbackReason(error: unknown): ImplicitSemanticFallbackReason;
185
185
  declare function buildExplicitSemanticFallbackWarning(requestedMode: SearchMode, error: unknown): string;
186
+ interface VectorIndexRecoveryRegistrations {
187
+ commands?: readonly {
188
+ command: string;
189
+ }[];
190
+ }
191
+ interface VectorIndexRecovery {
192
+ command: string;
193
+ args: string[];
194
+ follow_up_command?: string;
195
+ follow_up_args?: string[];
196
+ }
197
+ /** Resolve an executable reindex path from the active extension capability surface. */
198
+ export declare function resolveVectorIndexRecovery(registrations: VectorIndexRecoveryRegistrations | null): VectorIndexRecovery;
186
199
  /** Compare the vectorization-status ledger against the filtered corpus and, when the vector index is behind, emit a one-line stderr warning plus a structured `vector_index_stale:N` entry in the JSON warnings array. Best-effort: ledger read failures fall through silently — the existing semantic/hybrid fallback paths cover backend errors. */
187
200
  declare function maybeEmitVectorIndexStaleWarning(pmRoot: string, filteredDocuments: ItemDocument[], warnings: string[]): Promise<void>;
201
+ /** Format token-efficient vector-index staleness and executable recovery warnings. */
202
+ export declare function formatVectorIndexRecoveryWarnings(staleCount: number, recovery: VectorIndexRecovery): string[];
188
203
  /** Public contract for test only search command, shared by SDK and presentation-layer consumers. */
189
204
  export declare const _testOnlySearchCommand: {
190
205
  applyFilters: typeof applyFilters;
@@ -4,7 +4,7 @@
4
4
  * Implements the pm search 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]="0582c462-43fc-563c-b209-d6e3c39948f4")}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]="c650f22f-5fcd-5489-aa9b-da11c2d1db63")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { toNonEmptyStringOrUndefined } from "../../core/shared/primitives.js";
@@ -128,6 +128,21 @@ function buildExplicitSemanticFallbackWarning(requestedMode, error) {
128
128
  const reason = classifyImplicitSemanticFallbackReason(error);
129
129
  return `search_${requestedMode}_fallback:${reason}:using_keyword_mode`;
130
130
  }
131
+ /** Resolve an executable reindex path from the active extension capability surface. */
132
+ export function resolveVectorIndexRecovery(registrations) {
133
+ const hasReindex = registrations?.commands?.some((registration) => registration.command.trim() === "reindex") === true;
134
+ return hasReindex
135
+ ? {
136
+ command: "pm reindex --mode hybrid",
137
+ args: ["reindex", "--mode", "hybrid"],
138
+ }
139
+ : {
140
+ command: "pm install search-advanced --project",
141
+ args: ["install", "search-advanced", "--project"],
142
+ follow_up_command: "pm reindex --mode hybrid",
143
+ follow_up_args: ["reindex", "--mode", "hybrid"],
144
+ };
145
+ }
131
146
  /** Compare the vectorization-status ledger against the filtered corpus and, when the vector index is behind, emit a one-line stderr warning plus a structured `vector_index_stale:N` entry in the JSON warnings array. Best-effort: ledger read failures fall through silently — the existing semantic/hybrid fallback paths cover backend errors. */
132
147
  async function maybeEmitVectorIndexStaleWarning(pmRoot, filteredDocuments, warnings) {
133
148
  try {
@@ -142,15 +157,26 @@ async function maybeEmitVectorIndexStaleWarning(pmRoot, filteredDocuments, warni
142
157
  if (staleIds.length === 0) {
143
158
  return;
144
159
  }
145
- warnings.push(`vector_index_stale:${staleIds.length}`);
160
+ const recovery = resolveVectorIndexRecovery(getActiveExtensionRegistrations());
161
+ warnings.push(...formatVectorIndexRecoveryWarnings(staleIds.length, recovery));
146
162
  /* c8 ignore start -- singular/plural warning text branches are cosmetic and validated in integration UX tests */
147
- process.stderr.write(`[pm] warning: ${staleIds.length} item${staleIds.length === 1 ? " is" : "s are"} new or modified since the last reindex and ${staleIds.length === 1 ? "is" : "are"} NOT in the semantic index yet — they will be missing from semantic/hybrid results until you run 'pm reindex --mode hybrid'. (Write-time embedding is governed by search.mutation_refresh_policy; staleness means the embed was skipped, failed, or the backend was unreachable.)\n`);
163
+ process.stderr.write(`[pm] warning: ${staleIds.length} item${staleIds.length === 1 ? " is" : "s are"} new or modified since the last reindex and ${staleIds.length === 1 ? "is" : "are"} NOT in the semantic index yet — run '${recovery.command}'${recovery.follow_up_command ? `, then '${recovery.follow_up_command}'` : ""}. (Write-time embedding is governed by search.mutation_refresh_policy; staleness means the embed was skipped, failed, or the backend was unreachable.)\n`);
148
164
  /* c8 ignore stop */
149
165
  }
150
166
  catch {
151
167
  // Best-effort: missing/unreadable ledger is not a query-blocking concern.
152
168
  }
153
169
  }
170
+ /** Format token-efficient vector-index staleness and executable recovery warnings. */
171
+ export function formatVectorIndexRecoveryWarnings(staleCount, recovery) {
172
+ return [
173
+ `vector_index_stale:${staleCount}`,
174
+ `vector_index_recovery:${recovery.args.join(" ")}`,
175
+ ...(recovery.follow_up_args
176
+ ? [`vector_index_recovery_follow_up:${recovery.follow_up_args.join(" ")}`]
177
+ : []),
178
+ ];
179
+ }
154
180
  /** Public contract for test only search command, shared by SDK and presentation-layer consumers. */
155
181
  export const _testOnlySearchCommand = {
156
182
  applyFilters,
@@ -1539,7 +1565,7 @@ function prepareSearchInput(rawQuery, rawOptions) {
1539
1565
  tokens: parseSearchTokens(query),
1540
1566
  normalizedQuery: normalizeSearchPhrase(query),
1541
1567
  limit: parseLimit(options.limit),
1542
- projection: parseSearchProjection(options),
1568
+ projection: parseSearchProjection(options, rawQuery),
1543
1569
  modeWasExplicit: typeof options.mode === "string" && options.mode.trim().length > 0,
1544
1570
  };
1545
1571
  }
@@ -1961,4 +1987,4 @@ export async function runSearch(rawQuery, rawOptions, global) {
1961
1987
  return withSearchWorkspaceMemory(buildSearchResultForHits(response, projectedItems, total, page.limited.length, effectiveProjection, page.pageExtras), workspaceMemoryResult);
1962
1988
  }
1963
1989
  //# sourceMappingURL=search.js.map
1964
- //# debugId=0582c462-43fc-563c-b209-d6e3c39948f4
1990
+ //# debugId=c650f22f-5fcd-5489-aa9b-da11c2d1db63
@@ -72,7 +72,7 @@ export { splitCommaList } from "../core/shared/split-comma-list.js";
72
72
  export { compareTimestampStrings, nowIso, resolveIsoOrRelative, } from "../core/shared/time.js";
73
73
  export { migrateItemFilesToFormat } from "../core/store/item-format-migration.js";
74
74
  export { type CachedDocumentCandidate, listAllDocumentCandidatesCached, } from "../core/store/item-metadata-cache.js";
75
- export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadata, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
75
+ export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadata, listAllItemMetadataLight, locateItem, mutateItem, mutateItemWithHistoryContext, readLocatedItem, } from "../core/store/item-store.js";
76
76
  export { isTerminalPlanMode, shouldCompletePlanOnClose, } from "../core/item/plan-lifecycle.js";
77
77
  export { getHistoryPath, getItemPath, getSettingsPath, resolveImplicitPmRoot, resolvePmRoot, } from "../core/store/paths.js";
78
78
  export { persistSelectedItemFormat, readSettings, readSettingsWithMetadata, writeSettings, } from "../core/store/settings.js";
@@ -7,7 +7,7 @@
7
7
  * prefer the typed operations exported by the main SDK barrel.
8
8
  */
9
9
 
10
- !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]="a678b9f8-ba36-5127-877f-96bb4acc38c5")}catch(e){}}();
10
+ !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]="1bcfba24-e761-571c-96e6-36bbc12d2814")}catch(e){}}();
11
11
  export { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, } from "../core/checkpoint/mutation-checkpoint.js";
12
12
  export { flattenFlagListValue, resolveFlagValueKind, } from "../core/extensions/flag-value-types.js";
13
13
  export { createUnknownSubcommandError, } from "./agent/subcommand-recovery.js";
@@ -73,7 +73,7 @@ export { splitCommaList } from "../core/shared/split-comma-list.js";
73
73
  export { compareTimestampStrings, nowIso, resolveIsoOrRelative, } from "../core/shared/time.js";
74
74
  export { migrateItemFilesToFormat } from "../core/store/item-format-migration.js";
75
75
  export { listAllDocumentCandidatesCached, } from "../core/store/item-metadata-cache.js";
76
- export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadata, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
76
+ export { buildItemNotFoundError, createMutationGuardSdk, deleteItem, listAllItemMetadata, listAllItemMetadataLight, locateItem, mutateItem, mutateItemWithHistoryContext, readLocatedItem, } from "../core/store/item-store.js";
77
77
  export { isTerminalPlanMode, shouldCompletePlanOnClose, } from "../core/item/plan-lifecycle.js";
78
78
  export { getHistoryPath, getItemPath, getSettingsPath, resolveImplicitPmRoot, resolvePmRoot, } from "../core/store/paths.js";
79
79
  export { persistSelectedItemFormat, readSettings, readSettingsWithMetadata, writeSettings, } from "../core/store/settings.js";
@@ -81,4 +81,4 @@ export { maybeRunFirstUseTelemetryPrompt } from "../core/telemetry/consent.js";
81
81
  export { deriveTelemetryCommandResolution, } from "../core/telemetry/observability.js";
82
82
  export { emitTelemetryErrorEvent, finishTelemetryCommand, startTelemetryCommand, } from "../core/telemetry/runtime.js";
83
83
  //# sourceMappingURL=runtime-primitives.js.map
84
- //# debugId=a678b9f8-ba36-5127-877f-96bb4acc38c5
84
+ //# debugId=1bcfba24-e761-571c-96e6-36bbc12d2814
@@ -23,6 +23,7 @@ import { type AggregateOptions, type AggregateResult } from "./query/aggregate.j
23
23
  import { type UpgradeCommandOptions, type UpgradeResult } from "./governance/upgrade.js";
24
24
  import { type CreateResult } from "./lifecycle/create.js";
25
25
  import { type UpdateResult } from "./lifecycle/update.js";
26
+ import type { ReopenCommandOptions, ReopenResult } from "./lifecycle/reopen.js";
26
27
  import { type PlanCommandOptions, type PlanCommandResult, type PlanSubcommand } from "./lifecycle/plan.js";
27
28
  import { type ContextOptions, type ContextResult } from "./query/context.js";
28
29
  import { type NextOptions, type NextResult } from "./query/next.js";
@@ -93,6 +94,7 @@ export { runFocus, type FocusOptions, type FocusResult, } from "./lifecycle/focu
93
94
  export { runRestore, type RestoreCommandOptions, type RestoreResult, } from "./lifecycle/restore.js";
94
95
  export { DEFAULT_TERMINAL_TRANSITION_POLICY, applyTerminalOrderingPolicy, requireTerminalReason, resolveTerminalReason, type CloseOperationOptions, type CloseOperationResult, type TerminalOrderingMutation, type TerminalReasonInput, type TerminalReasonResolution, type TerminalReasonSource, type TerminalTransitionPolicy, } from "./lifecycle-policy.js";
95
96
  export { runUpdate, type UpdateCommandOptions } from "./lifecycle/update.js";
97
+ export { runReopen, type PreviousTerminalEvidence, type RecurrenceReceipt, type ReopenCommandOptions, type ReopenResult } from "./lifecycle/reopen.js";
96
98
  export { NEXT_OUTPUT_VALUES, runNext, type NextActionableItem, type NextBlockerRef, type NextOptions, type NextOutputFormat, type NextRecommendation, type NextResult, } from "./query/next.js";
97
99
  export { runSearch, type SearchCompactResult, type SearchHit, type SearchHitHighlight, type SearchMatchMode, type SearchOptions, type SearchResult, type SearchResultItem, type SearchVerboseResult, } from "./query/search.js";
98
100
  export { runStats, type StatsCommandOptions, type StatsResult, } from "./stats.js";
@@ -293,6 +295,8 @@ export declare class PmClient {
293
295
  create(options?: PmCreateActionOptions): Promise<CreateResult>;
294
296
  /** Update an item using the same mutation path as `pm update`. Options are contract-typed (pm-x29o): unknown keys and non-scalar values fail `tsc`; runtime-schema custom fields go through the repeatable `field` option, and {@link PmClient.run} stays the wide escape hatch. */
295
297
  update(id: string, options?: PmUpdateActionOptions): Promise<UpdateResult>;
298
+ /** Reopen terminal work as a recurrence through the canonical update path. */
299
+ reopen(id: string, reason: string, options?: ReopenCommandOptions): Promise<ReopenResult>;
296
300
  /** Close an item using the same mutation path as `pm close`. Options are contract-typed (pm-x29o); the close reason is the positional parameter, so the option bag omits `reason`/`text`. */
297
301
  close(id: string, reason: string, options?: PmClientCloseActionOptions): Promise<CloseResult>;
298
302
  /** Claim an item using the same mutation path as `pm claim`. */
@@ -469,6 +473,8 @@ export declare function historyCompactBulk(options: HistoryCompactBulkCommandOpt
469
473
  export declare function create(options?: PmCreateActionOptions, clientOptions?: PmClientOptions): Promise<CreateResult>;
470
474
  /** Update an item without constructing a reusable client. */
471
475
  export declare function update(id: string, options?: PmUpdateActionOptions, clientOptions?: PmClientOptions): Promise<UpdateResult>;
476
+ /** Reopen terminal work as a recurrence without constructing a reusable client. */
477
+ export declare function reopen(id: string, reason: string, options?: ReopenCommandOptions, clientOptions?: PmClientOptions): Promise<ReopenResult>;
472
478
  /** Close an item without constructing a reusable client. */
473
479
  export declare function close(id: string, reason: string, options?: PmClientCloseActionOptions, clientOptions?: PmClientOptions): Promise<CloseResult>;
474
480
  /** Claim an item without constructing a reusable client. */
@@ -4,7 +4,7 @@
4
4
  * Defines public SDK APIs and package-author helpers for Runtime.
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]="95764dd9-1b0d-5732-9f10-b13b334ce27d")}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]="c770afea-3eb6-5476-ba07-8ec1c5d9c699")}catch(e){}}();
8
8
  export { PM_GITIGNORE_END, PM_GITIGNORE_START, ensurePmGitignore, getPmGitignoreBlock, } from "./workspace.js";
9
9
  export { SEARCH_EXTENSION_FLAG_DEFINITIONS } from "./extension-contracts.js";
10
10
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -70,6 +70,7 @@ import { acknowledgeUnknownAuthorHistoryEventsFromTransport, } from "./author-at
70
70
  import { PROFILE_SUBCOMMANDS, runProfileApply, runProfileLint, runProfileList, runProfileShow, } from "./profile.js";
71
71
  import { runHistoryRedact, } from "./history-redact.js";
72
72
  import { runMcpHistoryCompactAction, runMcpHistoryRepairAction, } from "./history-mcp.js";
73
+ import { runMcpCloseAction, runMcpReopenAction } from "./lifecycle/mcp-actions.js";
73
74
  import { actionGlobalOptions as globalOptions, closeManyOptionsFromFlat, extensionOptionsFromArgs, graphOptionsFromFlat, mutationListOptions, normalizeActionName, normalizeCommandPath, normalizeMcpOptionsArrays, normalizeMcpUpdateOptions, optionsWithAuthor, parseRuntimeInteger as parseMcpInteger, readRuntimeScalarString as readScalarString, readRuntimeScalarStringAllowBlank as readScalarStringAllowBlank, readRuntimeString as readString, readRuntimeStringArray as readStringArray, resolveRuntimeLimit, updateManyOptionsFromFlat, withAddNoteOption, withFilesDiscoveryOptions, withMutationCompaction, } from "./runtime-input.js";
74
75
  import { runDeps } from "./dependencies.js";
75
76
  import { runDocs } from "./docs.js";
@@ -119,6 +120,7 @@ export { runFocus, } from "./lifecycle/focus.js";
119
120
  export { runRestore, } from "./lifecycle/restore.js";
120
121
  export { DEFAULT_TERMINAL_TRANSITION_POLICY, applyTerminalOrderingPolicy, requireTerminalReason, resolveTerminalReason, } from "./lifecycle-policy.js";
121
122
  export { runUpdate } from "./lifecycle/update.js";
123
+ export { runReopen } from "./lifecycle/reopen.js";
122
124
  export { NEXT_OUTPUT_VALUES, runNext, } from "./query/next.js";
123
125
  export { runSearch, } from "./query/search.js";
124
126
  export { runStats, } from "./stats.js";
@@ -536,6 +538,15 @@ export class PmClient {
536
538
  ...splitFullClientMutationOptions(options),
537
539
  });
538
540
  }
541
+ /** Reopen terminal work as a recurrence through the canonical update path. */
542
+ reopen(id, reason, options = {}) {
543
+ return this.runTyped("item-reopen", {
544
+ id,
545
+ reason,
546
+ fullChangedFields: true,
547
+ options,
548
+ });
549
+ }
539
550
  /** Close an item using the same mutation path as `pm close`. Options are contract-typed (pm-x29o); the close reason is the positional parameter, so the option bag omits `reason`/`text`. */
540
551
  close(id, reason, options = {}) {
541
552
  return this.runTyped("close", {
@@ -908,6 +919,10 @@ export function create(options = {}, clientOptions = {}) {
908
919
  export function update(id, options = {}, clientOptions = {}) {
909
920
  return new PmClient(clientOptions).update(id, options);
910
921
  }
922
+ /** Reopen terminal work as a recurrence without constructing a reusable client. */
923
+ export function reopen(id, reason, options = {}, clientOptions = {}) {
924
+ return new PmClient(clientOptions).reopen(id, reason, options);
925
+ }
911
926
  /** Close an item without constructing a reusable client. */
912
927
  export function close(id, reason, options = {}, clientOptions = {}) {
913
928
  return new PmClient(clientOptions).close(id, reason, options);
@@ -1392,18 +1407,6 @@ async function runMcpUpdateAction(ctx) {
1392
1407
  idOnly,
1393
1408
  });
1394
1409
  }
1395
- async function runMcpCloseAction(ctx) {
1396
- const { changedFields, idOnly, runnerOptions } = withMutationCompaction(ctx.args, ctx.options);
1397
- const closeReason = readString(ctx.args, "reason") ??
1398
- readString(ctx.args, "text") ??
1399
- readString(runnerOptions, "reason") ??
1400
- readString(runnerOptions, "text");
1401
- return projectMutationResult(await runClose(requireMcpItemId(ctx, runnerOptions), closeReason, runnerOptions, ctx.global), {
1402
- changedFields,
1403
- compactEnvelope: changedFields === "compact" && !idOnly,
1404
- idOnly,
1405
- });
1406
- }
1407
1410
  function runMcpCommentsAction(ctx) {
1408
1411
  const commentOptions = normalizeAnnotationTransportOptions(ctx.options);
1409
1412
  const isListing = commentOptions.add === undefined &&
@@ -1808,6 +1811,7 @@ const SDK_ACTION_HANDLERS = {
1808
1811
  copy: runMcpCopyAction,
1809
1812
  focus: (ctx) => runFocus(ctx.id, { clear: ctx.options.clear === true || ctx.args.clear === true }, ctx.global),
1810
1813
  update: runMcpUpdateAction,
1814
+ "item-reopen": runMcpReopenAction,
1811
1815
  restore: runMcpRestoreAction,
1812
1816
  claim: (ctx) => ctx.options.next === true || ctx.args.next === true
1813
1817
  ? runClaimNext(ctx.force, ctx.global, { ...ctx.options, ...ctx.args }, { ...ctx.options, ...ctx.args })
@@ -1940,4 +1944,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
1940
1944
  }
1941
1945
  }
1942
1946
  //# sourceMappingURL=runtime.js.map
1943
- //# debugId=95764dd9-1b0d-5732-9f10-b13b334ce27d
1947
+ //# debugId=c770afea-3eb6-5476-ba07-8ec1c5d9c699
@@ -115,6 +115,19 @@ export interface SimilarityAdvisory {
115
115
  bypassed: boolean;
116
116
  /** Shared similarity query result. */
117
117
  result: SimilarItemsResult;
118
+ /** Executable next action selected from the strongest matching item's lifecycle state. */
119
+ recovery: SimilarityRecovery;
120
+ }
121
+ /** Executable duplicate-intake recovery selected from the strongest match. */
122
+ export interface SimilarityRecovery {
123
+ /** Whether to continue existing active work or reopen terminal work as a recurrence. */
124
+ action: "reuse" | "reopen";
125
+ /** Strongest matching canonical item. */
126
+ item_id: string;
127
+ /** Shell-form recovery command. */
128
+ command: string;
129
+ /** Tokenized recovery command for direct execution. */
130
+ args: string[];
118
131
  }
119
132
  /** Render compact warning tokens shared by create and copy results. */
120
133
  export declare function similarityAdvisoryWarnings(advisory: SimilarityAdvisory | undefined): string[];