opencode-matrixx 2.2.0 → 2.3.0

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 (134) hide show
  1. package/README.md +21 -25
  2. package/dist/agents/bdd-contract.d.ts +7 -0
  3. package/dist/agents/builtin-agents/architect-agent.d.ts +1 -0
  4. package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
  5. package/dist/agents/builtin-agents/{hephaestus-agent.d.ts → keymaker-agent.d.ts} +2 -0
  6. package/dist/agents/builtin-agents/model-resolution.d.ts +1 -0
  7. package/dist/agents/builtin-agents/morpheus-agent.d.ts +2 -0
  8. package/dist/agents/builtin-agents.d.ts +1 -1
  9. package/dist/agents/dynamic-agent-prompt-builder.d.ts +2 -1
  10. package/dist/agents/env-context.d.ts +1 -1
  11. package/dist/agents/mouse/agent.d.ts +5 -2
  12. package/dist/agents/mouse/deepseek.d.ts +16 -0
  13. package/dist/agents/mouse/index.d.ts +3 -0
  14. package/dist/agents/mouse/mimo.d.ts +15 -0
  15. package/dist/agents/mouse/qwen.d.ts +16 -0
  16. package/dist/agents/mouse/shared.d.ts +7 -0
  17. package/dist/agents/types.d.ts +4 -1
  18. package/dist/config/index.d.ts +1 -2
  19. package/dist/config/presets.d.ts +4 -0
  20. package/dist/config/resolve-tiers.d.ts +32 -0
  21. package/dist/config/schema/agent-names.d.ts +6 -0
  22. package/dist/config/schema/agent-overrides.d.ts +133 -0
  23. package/dist/config/schema/categories.d.ts +16 -0
  24. package/dist/config/schema/commands.d.ts +6 -0
  25. package/dist/config/schema/dcp.d.ts +16 -0
  26. package/dist/config/schema/hooks.d.ts +2 -0
  27. package/dist/config/schema/matrixx-config.d.ts +153 -18
  28. package/dist/config/schema.d.ts +3 -1
  29. package/dist/create-hooks.d.ts +2 -0
  30. package/dist/features/bdd/schema.d.ts +434 -0
  31. package/dist/features/bdd/types.d.ts +2 -0
  32. package/dist/features/builtin-commands/templates/bdd-backend.d.ts +1 -0
  33. package/dist/features/builtin-commands/templates/bdd-contract.d.ts +1 -0
  34. package/dist/features/builtin-commands/templates/bdd-frontend.d.ts +1 -0
  35. package/dist/features/builtin-commands/templates/bdd-pipeline.d.ts +1 -0
  36. package/dist/features/builtin-commands/templates/bdd-tests.d.ts +1 -0
  37. package/dist/features/builtin-commands/templates/dcp-profile.d.ts +1 -0
  38. package/dist/features/builtin-commands/types.d.ts +2 -2
  39. package/dist/features/builtin-skills/lazy-skill-helper.d.ts +17 -0
  40. package/dist/features/builtin-skills/skills/bdd-backend.d.ts +3 -0
  41. package/dist/features/builtin-skills/skills/bdd-contract.d.ts +3 -0
  42. package/dist/features/builtin-skills/skills/bdd-frontend.d.ts +3 -0
  43. package/dist/features/builtin-skills/skills/bdd-tests.d.ts +3 -0
  44. package/dist/features/builtin-skills/skills/docker-master.d.ts +2 -0
  45. package/dist/features/builtin-skills/skills/index.d.ts +5 -0
  46. package/dist/features/{claude-code-command-loader → command-loader}/loader.d.ts +0 -2
  47. package/dist/features/mission-state/constants.d.ts +10 -0
  48. package/dist/features/mission-state/index.d.ts +2 -0
  49. package/dist/features/mission-state/plan-storage.d.ts +48 -0
  50. package/dist/features/mission-state/rehydrate.d.ts +21 -0
  51. package/dist/features/mission-state/types.d.ts +46 -0
  52. package/dist/features/opencode-skill-loader/loader.d.ts +1 -3
  53. package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +1 -1
  54. package/dist/features/opencode-skill-loader/types.d.ts +1 -1
  55. package/dist/features/skill-mcp-manager/connection-type.d.ts +2 -3
  56. package/dist/features/skill-mcp-manager/connection.d.ts +3 -4
  57. package/dist/features/skill-mcp-manager/manager.d.ts +2 -3
  58. package/dist/features/skill-mcp-manager/oauth-handler.d.ts +3 -3
  59. package/dist/features/skill-mcp-manager/types.d.ts +16 -4
  60. package/dist/hooks/env-context-injector/index.d.ts +23 -0
  61. package/dist/hooks/index.d.ts +2 -0
  62. package/dist/hooks/plan-persister/hook.d.ts +20 -0
  63. package/dist/hooks/plan-persister/index.d.ts +2 -0
  64. package/dist/index.js +44907 -28359
  65. package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -1
  66. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
  67. package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -1
  68. package/dist/plugin-config.d.ts +1 -1
  69. package/dist/plugin-handlers/agent-config-handler.d.ts +2 -0
  70. package/dist/plugin-handlers/plugin-components-loader.d.ts +1 -1
  71. package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +1 -0
  72. package/dist/shared/index.d.ts +1 -1
  73. package/dist/shared/merge-categories.d.ts +4 -0
  74. package/dist/shared/model-resolution-types.d.ts +3 -0
  75. package/dist/shared/model-tiers.d.ts +31 -0
  76. package/dist/shared/tier-resolver.d.ts +26 -0
  77. package/dist/tools/bdd-create-contract/constants.d.ts +1 -0
  78. package/dist/tools/bdd-create-contract/index.d.ts +3 -0
  79. package/dist/tools/bdd-create-contract/tools.d.ts +3 -0
  80. package/dist/tools/bdd-create-contract/types.d.ts +12 -0
  81. package/dist/tools/bdd-parse-gherkin/constants.d.ts +1 -0
  82. package/dist/tools/bdd-parse-gherkin/index.d.ts +3 -0
  83. package/dist/tools/bdd-parse-gherkin/tools.d.ts +5 -0
  84. package/dist/tools/bdd-parse-gherkin/types.d.ts +9 -0
  85. package/dist/tools/bdd-pipeline/analysis-report-sections.d.ts +10 -0
  86. package/dist/tools/bdd-pipeline/analysis-report.d.ts +9 -0
  87. package/dist/tools/bdd-pipeline/constants.d.ts +4 -0
  88. package/dist/tools/bdd-pipeline/feature-resolver.d.ts +5 -0
  89. package/dist/tools/bdd-pipeline/index.d.ts +3 -0
  90. package/dist/tools/bdd-pipeline/pipeline-runner.d.ts +6 -0
  91. package/dist/tools/bdd-pipeline/subagent-runner.d.ts +14 -0
  92. package/dist/tools/bdd-pipeline/tools.d.ts +5 -0
  93. package/dist/tools/bdd-pipeline/types.d.ts +74 -0
  94. package/dist/tools/bdd-validate-contract/index.d.ts +1 -0
  95. package/dist/tools/bdd-validate-contract/tools.d.ts +21 -0
  96. package/dist/tools/delegate-task/categories.d.ts +7 -0
  97. package/dist/tools/delegate-task/category-resolver.d.ts +6 -0
  98. package/dist/tools/delegate-task/complexity-constants.d.ts +24 -0
  99. package/dist/tools/delegate-task/complexity-scorer.d.ts +31 -0
  100. package/dist/tools/delegate-task/complexity-types.d.ts +10 -0
  101. package/dist/tools/delegate-task/executor-types.d.ts +1 -0
  102. package/dist/tools/delegate-task/index.d.ts +3 -0
  103. package/dist/tools/delegate-task/types.d.ts +8 -0
  104. package/dist/tools/index.d.ts +4 -0
  105. package/dist/tools/task/todo-sync.d.ts +1 -1
  106. package/package.json +19 -4
  107. package/dist/agents/builtin-agents/environment-context.d.ts +0 -2
  108. package/dist/config/profiles.d.ts +0 -4
  109. package/dist/config/schema/claude-code.d.ts +0 -10
  110. package/dist/features/claude-code-mcp-loader/index.d.ts +0 -10
  111. package/dist/features/claude-code-mcp-loader/loader.d.ts +0 -3
  112. package/dist/features/claude-code-mcp-loader/transformer.d.ts +0 -2
  113. package/dist/features/claude-code-mcp-loader/types.d.ts +0 -39
  114. package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +0 -3
  115. package/dist/features/claude-code-plugin-loader/command-loader.d.ts +0 -3
  116. package/dist/features/claude-code-plugin-loader/discovery.d.ts +0 -2
  117. package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +0 -2
  118. package/dist/features/claude-code-plugin-loader/index.d.ts +0 -10
  119. package/dist/features/claude-code-plugin-loader/loader.d.ts +0 -20
  120. package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +0 -3
  121. package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +0 -1
  122. package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +0 -3
  123. package/dist/features/claude-code-plugin-loader/types.d.ts +0 -187
  124. package/dist/shared/claude-config-dir.d.ts +0 -1
  125. /package/dist/features/{claude-code-agent-loader → agent-loader}/index.d.ts +0 -0
  126. /package/dist/features/{claude-code-agent-loader → agent-loader}/loader.d.ts +0 -0
  127. /package/dist/features/{claude-code-agent-loader → agent-loader}/types.d.ts +0 -0
  128. /package/dist/features/{claude-code-command-loader → command-loader}/index.d.ts +0 -0
  129. /package/dist/features/{claude-code-command-loader → command-loader}/types.d.ts +0 -0
  130. /package/dist/features/{claude-code-session-state → session-state}/index.d.ts +0 -0
  131. /package/dist/features/{claude-code-session-state → session-state}/state.d.ts +0 -0
  132. /package/dist/features/{claude-code-mcp-loader → skill-mcp-manager}/env-expander.d.ts +0 -0
  133. /package/dist/features/{claude-tasks → task-storage}/storage.d.ts +0 -0
  134. /package/dist/features/{claude-tasks → task-storage}/types.d.ts +0 -0
@@ -0,0 +1,434 @@
1
+ import { z } from "zod";
2
+ export declare const StepKeywordSchema: z.ZodEnum<{
3
+ Given: "Given";
4
+ When: "When";
5
+ Then: "Then";
6
+ And: "And";
7
+ But: "But";
8
+ }>;
9
+ export declare const StepSchema: z.ZodObject<{
10
+ keyword: z.ZodEnum<{
11
+ Given: "Given";
12
+ When: "When";
13
+ Then: "Then";
14
+ And: "And";
15
+ But: "But";
16
+ }>;
17
+ text: z.ZodString;
18
+ dataTable: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
19
+ docString: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export declare const ExampleRowSchema: z.ZodRecord<z.ZodString, z.ZodString>;
22
+ export declare const ScenarioSchema: z.ZodObject<{
23
+ name: z.ZodString;
24
+ tags: z.ZodArray<z.ZodString>;
25
+ steps: z.ZodArray<z.ZodObject<{
26
+ keyword: z.ZodEnum<{
27
+ Given: "Given";
28
+ When: "When";
29
+ Then: "Then";
30
+ And: "And";
31
+ But: "But";
32
+ }>;
33
+ text: z.ZodString;
34
+ dataTable: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
35
+ docString: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>>;
37
+ examples: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
38
+ }, z.core.$strip>;
39
+ export declare const BackgroundSchema: z.ZodObject<{
40
+ steps: z.ZodArray<z.ZodObject<{
41
+ keyword: z.ZodEnum<{
42
+ Given: "Given";
43
+ When: "When";
44
+ Then: "Then";
45
+ And: "And";
46
+ But: "But";
47
+ }>;
48
+ text: z.ZodString;
49
+ dataTable: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
50
+ docString: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>>;
52
+ }, z.core.$strip>;
53
+ export declare const RuleSchema: z.ZodObject<{
54
+ name: z.ZodString;
55
+ description: z.ZodOptional<z.ZodString>;
56
+ scenarios: z.ZodArray<z.ZodObject<{
57
+ name: z.ZodString;
58
+ tags: z.ZodArray<z.ZodString>;
59
+ steps: z.ZodArray<z.ZodObject<{
60
+ keyword: z.ZodEnum<{
61
+ Given: "Given";
62
+ When: "When";
63
+ Then: "Then";
64
+ And: "And";
65
+ But: "But";
66
+ }>;
67
+ text: z.ZodString;
68
+ dataTable: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
69
+ docString: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>>;
71
+ examples: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
72
+ }, z.core.$strip>>;
73
+ }, z.core.$strip>;
74
+ export declare const KebabCaseSchema: z.ZodString;
75
+ export declare const CamelCaseSchema: z.ZodString;
76
+ export declare const DottedKebabSchema: z.ZodString;
77
+ export declare const UrlPathSchema: z.ZodString;
78
+ export declare const HttpMethodSchema: z.ZodEnum<{
79
+ HEAD: "HEAD";
80
+ DELETE: "DELETE";
81
+ GET: "GET";
82
+ OPTIONS: "OPTIONS";
83
+ PATCH: "PATCH";
84
+ POST: "POST";
85
+ PUT: "PUT";
86
+ }>;
87
+ export declare const ResponseFormatSchema: z.ZodEnum<{
88
+ binary: "binary";
89
+ json: "json";
90
+ text: "text";
91
+ html: "html";
92
+ xml: "xml";
93
+ }>;
94
+ export declare const VarTypeSchema: z.ZodEnum<{
95
+ string: "string";
96
+ number: "number";
97
+ boolean: "boolean";
98
+ object: "object";
99
+ null: "null";
100
+ array: "array";
101
+ }>;
102
+ export declare const ApiEndpointSchema: z.ZodObject<{
103
+ method: z.ZodEnum<{
104
+ HEAD: "HEAD";
105
+ DELETE: "DELETE";
106
+ GET: "GET";
107
+ OPTIONS: "OPTIONS";
108
+ PATCH: "PATCH";
109
+ POST: "POST";
110
+ PUT: "PUT";
111
+ }>;
112
+ path: z.ZodString;
113
+ request: z.ZodOptional<z.ZodString>;
114
+ response: z.ZodOptional<z.ZodString>;
115
+ description: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$strict>;
117
+ export declare const ApiResponseSchema: z.ZodObject<{
118
+ status: z.ZodNumber;
119
+ format: z.ZodEnum<{
120
+ binary: "binary";
121
+ json: "json";
122
+ text: "text";
123
+ html: "html";
124
+ xml: "xml";
125
+ }>;
126
+ description: z.ZodOptional<z.ZodString>;
127
+ }, z.core.$strict>;
128
+ export declare const UiRouteSchema: z.ZodObject<{
129
+ name: z.ZodString;
130
+ path: z.ZodString;
131
+ }, z.core.$strict>;
132
+ export declare const UiTestIdSchema: z.ZodObject<{
133
+ name: z.ZodString;
134
+ value: z.ZodString;
135
+ }, z.core.$strict>;
136
+ export declare const UiStringSchema: z.ZodObject<{
137
+ key: z.ZodString;
138
+ value: z.ZodString;
139
+ }, z.core.$strict>;
140
+ export declare const StateVariableSchema: z.ZodObject<{
141
+ name: z.ZodString;
142
+ type: z.ZodEnum<{
143
+ string: "string";
144
+ number: "number";
145
+ boolean: "boolean";
146
+ object: "object";
147
+ null: "null";
148
+ array: "array";
149
+ }>;
150
+ default: z.ZodOptional<z.ZodUnknown>;
151
+ }, z.core.$strict>;
152
+ export declare const StateTransitionSchema: z.ZodObject<{
153
+ from: z.ZodString;
154
+ to: z.ZodString;
155
+ trigger: z.ZodString;
156
+ }, z.core.$strict>;
157
+ export declare const ApiAnnotationsSchema: z.ZodObject<{
158
+ endpoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
159
+ method: z.ZodEnum<{
160
+ HEAD: "HEAD";
161
+ DELETE: "DELETE";
162
+ GET: "GET";
163
+ OPTIONS: "OPTIONS";
164
+ PATCH: "PATCH";
165
+ POST: "POST";
166
+ PUT: "PUT";
167
+ }>;
168
+ path: z.ZodString;
169
+ request: z.ZodOptional<z.ZodString>;
170
+ response: z.ZodOptional<z.ZodString>;
171
+ description: z.ZodOptional<z.ZodString>;
172
+ }, z.core.$strict>>>;
173
+ responses: z.ZodOptional<z.ZodArray<z.ZodObject<{
174
+ status: z.ZodNumber;
175
+ format: z.ZodEnum<{
176
+ binary: "binary";
177
+ json: "json";
178
+ text: "text";
179
+ html: "html";
180
+ xml: "xml";
181
+ }>;
182
+ description: z.ZodOptional<z.ZodString>;
183
+ }, z.core.$strict>>>;
184
+ }, z.core.$strict>;
185
+ export declare const UiAnnotationsSchema: z.ZodObject<{
186
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
187
+ name: z.ZodString;
188
+ path: z.ZodString;
189
+ }, z.core.$strict>>>;
190
+ testIds: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
+ name: z.ZodString;
192
+ value: z.ZodString;
193
+ }, z.core.$strict>>>;
194
+ strings: z.ZodOptional<z.ZodArray<z.ZodObject<{
195
+ key: z.ZodString;
196
+ value: z.ZodString;
197
+ }, z.core.$strict>>>;
198
+ }, z.core.$strict>;
199
+ export declare const StateAnnotationsSchema: z.ZodObject<{
200
+ variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
201
+ name: z.ZodString;
202
+ type: z.ZodEnum<{
203
+ string: "string";
204
+ number: "number";
205
+ boolean: "boolean";
206
+ object: "object";
207
+ null: "null";
208
+ array: "array";
209
+ }>;
210
+ default: z.ZodOptional<z.ZodUnknown>;
211
+ }, z.core.$strict>>>;
212
+ transitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
213
+ from: z.ZodString;
214
+ to: z.ZodString;
215
+ trigger: z.ZodString;
216
+ }, z.core.$strict>>>;
217
+ }, z.core.$strict>;
218
+ export declare const ContractAnnotationsSchema: z.ZodObject<{
219
+ api: z.ZodOptional<z.ZodObject<{
220
+ endpoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
221
+ method: z.ZodEnum<{
222
+ HEAD: "HEAD";
223
+ DELETE: "DELETE";
224
+ GET: "GET";
225
+ OPTIONS: "OPTIONS";
226
+ PATCH: "PATCH";
227
+ POST: "POST";
228
+ PUT: "PUT";
229
+ }>;
230
+ path: z.ZodString;
231
+ request: z.ZodOptional<z.ZodString>;
232
+ response: z.ZodOptional<z.ZodString>;
233
+ description: z.ZodOptional<z.ZodString>;
234
+ }, z.core.$strict>>>;
235
+ responses: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
+ status: z.ZodNumber;
237
+ format: z.ZodEnum<{
238
+ binary: "binary";
239
+ json: "json";
240
+ text: "text";
241
+ html: "html";
242
+ xml: "xml";
243
+ }>;
244
+ description: z.ZodOptional<z.ZodString>;
245
+ }, z.core.$strict>>>;
246
+ }, z.core.$strict>>;
247
+ ui: z.ZodOptional<z.ZodObject<{
248
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
249
+ name: z.ZodString;
250
+ path: z.ZodString;
251
+ }, z.core.$strict>>>;
252
+ testIds: z.ZodOptional<z.ZodArray<z.ZodObject<{
253
+ name: z.ZodString;
254
+ value: z.ZodString;
255
+ }, z.core.$strict>>>;
256
+ strings: z.ZodOptional<z.ZodArray<z.ZodObject<{
257
+ key: z.ZodString;
258
+ value: z.ZodString;
259
+ }, z.core.$strict>>>;
260
+ }, z.core.$strict>>;
261
+ state: z.ZodOptional<z.ZodObject<{
262
+ variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
263
+ name: z.ZodString;
264
+ type: z.ZodEnum<{
265
+ string: "string";
266
+ number: "number";
267
+ boolean: "boolean";
268
+ object: "object";
269
+ null: "null";
270
+ array: "array";
271
+ }>;
272
+ default: z.ZodOptional<z.ZodUnknown>;
273
+ }, z.core.$strict>>>;
274
+ transitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
275
+ from: z.ZodString;
276
+ to: z.ZodString;
277
+ trigger: z.ZodString;
278
+ }, z.core.$strict>>>;
279
+ }, z.core.$strict>>;
280
+ assumptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
281
+ }, z.core.$strict>;
282
+ export declare const FeatureSchema: z.ZodObject<{
283
+ name: z.ZodString;
284
+ description: z.ZodOptional<z.ZodString>;
285
+ tags: z.ZodArray<z.ZodString>;
286
+ }, z.core.$strip>;
287
+ export declare const ContractSchema: z.ZodObject<{
288
+ schemaVersion: z.ZodLiteral<1>;
289
+ generatedAt: z.ZodString;
290
+ sourceFile: z.ZodString;
291
+ feature: z.ZodObject<{
292
+ name: z.ZodString;
293
+ description: z.ZodOptional<z.ZodString>;
294
+ tags: z.ZodArray<z.ZodString>;
295
+ }, z.core.$strip>;
296
+ scenarios: z.ZodArray<z.ZodObject<{
297
+ name: z.ZodString;
298
+ tags: z.ZodArray<z.ZodString>;
299
+ steps: z.ZodArray<z.ZodObject<{
300
+ keyword: z.ZodEnum<{
301
+ Given: "Given";
302
+ When: "When";
303
+ Then: "Then";
304
+ And: "And";
305
+ But: "But";
306
+ }>;
307
+ text: z.ZodString;
308
+ dataTable: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
309
+ docString: z.ZodOptional<z.ZodString>;
310
+ }, z.core.$strip>>;
311
+ examples: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
312
+ }, z.core.$strip>>;
313
+ background: z.ZodOptional<z.ZodObject<{
314
+ steps: z.ZodArray<z.ZodObject<{
315
+ keyword: z.ZodEnum<{
316
+ Given: "Given";
317
+ When: "When";
318
+ Then: "Then";
319
+ And: "And";
320
+ But: "But";
321
+ }>;
322
+ text: z.ZodString;
323
+ dataTable: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
324
+ docString: z.ZodOptional<z.ZodString>;
325
+ }, z.core.$strip>>;
326
+ }, z.core.$strip>>;
327
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
328
+ name: z.ZodString;
329
+ description: z.ZodOptional<z.ZodString>;
330
+ scenarios: z.ZodArray<z.ZodObject<{
331
+ name: z.ZodString;
332
+ tags: z.ZodArray<z.ZodString>;
333
+ steps: z.ZodArray<z.ZodObject<{
334
+ keyword: z.ZodEnum<{
335
+ Given: "Given";
336
+ When: "When";
337
+ Then: "Then";
338
+ And: "And";
339
+ But: "But";
340
+ }>;
341
+ text: z.ZodString;
342
+ dataTable: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
343
+ docString: z.ZodOptional<z.ZodString>;
344
+ }, z.core.$strip>>;
345
+ examples: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
346
+ }, z.core.$strip>>;
347
+ }, z.core.$strip>>>;
348
+ annotations: z.ZodObject<{
349
+ api: z.ZodOptional<z.ZodObject<{
350
+ endpoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
351
+ method: z.ZodEnum<{
352
+ HEAD: "HEAD";
353
+ DELETE: "DELETE";
354
+ GET: "GET";
355
+ OPTIONS: "OPTIONS";
356
+ PATCH: "PATCH";
357
+ POST: "POST";
358
+ PUT: "PUT";
359
+ }>;
360
+ path: z.ZodString;
361
+ request: z.ZodOptional<z.ZodString>;
362
+ response: z.ZodOptional<z.ZodString>;
363
+ description: z.ZodOptional<z.ZodString>;
364
+ }, z.core.$strict>>>;
365
+ responses: z.ZodOptional<z.ZodArray<z.ZodObject<{
366
+ status: z.ZodNumber;
367
+ format: z.ZodEnum<{
368
+ binary: "binary";
369
+ json: "json";
370
+ text: "text";
371
+ html: "html";
372
+ xml: "xml";
373
+ }>;
374
+ description: z.ZodOptional<z.ZodString>;
375
+ }, z.core.$strict>>>;
376
+ }, z.core.$strict>>;
377
+ ui: z.ZodOptional<z.ZodObject<{
378
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
379
+ name: z.ZodString;
380
+ path: z.ZodString;
381
+ }, z.core.$strict>>>;
382
+ testIds: z.ZodOptional<z.ZodArray<z.ZodObject<{
383
+ name: z.ZodString;
384
+ value: z.ZodString;
385
+ }, z.core.$strict>>>;
386
+ strings: z.ZodOptional<z.ZodArray<z.ZodObject<{
387
+ key: z.ZodString;
388
+ value: z.ZodString;
389
+ }, z.core.$strict>>>;
390
+ }, z.core.$strict>>;
391
+ state: z.ZodOptional<z.ZodObject<{
392
+ variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
393
+ name: z.ZodString;
394
+ type: z.ZodEnum<{
395
+ string: "string";
396
+ number: "number";
397
+ boolean: "boolean";
398
+ object: "object";
399
+ null: "null";
400
+ array: "array";
401
+ }>;
402
+ default: z.ZodOptional<z.ZodUnknown>;
403
+ }, z.core.$strict>>>;
404
+ transitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
405
+ from: z.ZodString;
406
+ to: z.ZodString;
407
+ trigger: z.ZodString;
408
+ }, z.core.$strict>>>;
409
+ }, z.core.$strict>>;
410
+ assumptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
411
+ }, z.core.$strict>;
412
+ }, z.core.$strip>;
413
+ export type Step = z.infer<typeof StepSchema>;
414
+ export type StepKeyword = z.infer<typeof StepKeywordSchema>;
415
+ export type ExampleRow = z.infer<typeof ExampleRowSchema>;
416
+ export type Scenario = z.infer<typeof ScenarioSchema>;
417
+ export type Background = z.infer<typeof BackgroundSchema>;
418
+ export type Rule = z.infer<typeof RuleSchema>;
419
+ export type HttpMethod = z.infer<typeof HttpMethodSchema>;
420
+ export type ResponseFormat = z.infer<typeof ResponseFormatSchema>;
421
+ export type VarType = z.infer<typeof VarTypeSchema>;
422
+ export type ApiEndpoint = z.infer<typeof ApiEndpointSchema>;
423
+ export type ApiResponse = z.infer<typeof ApiResponseSchema>;
424
+ export type UiRoute = z.infer<typeof UiRouteSchema>;
425
+ export type UiTestId = z.infer<typeof UiTestIdSchema>;
426
+ export type UiString = z.infer<typeof UiStringSchema>;
427
+ export type StateVariable = z.infer<typeof StateVariableSchema>;
428
+ export type StateTransition = z.infer<typeof StateTransitionSchema>;
429
+ export type ApiAnnotations = z.infer<typeof ApiAnnotationsSchema>;
430
+ export type UiAnnotations = z.infer<typeof UiAnnotationsSchema>;
431
+ export type StateAnnotations = z.infer<typeof StateAnnotationsSchema>;
432
+ export type ContractAnnotations = z.infer<typeof ContractAnnotationsSchema>;
433
+ export type Feature = z.infer<typeof FeatureSchema>;
434
+ export type Contract = z.infer<typeof ContractSchema>;
@@ -0,0 +1,2 @@
1
+ export type { ApiAnnotations, ApiEndpoint, ApiResponse, Background, Contract, ContractAnnotations, ExampleRow, Feature, HttpMethod, ResponseFormat, Rule, Scenario, StateAnnotations, StateTransition, StateVariable, Step, StepKeyword, UiAnnotations, UiRoute, UiString, UiTestId, VarType, } from "./schema";
2
+ export { ApiAnnotationsSchema, ApiEndpointSchema, ApiResponseSchema, CamelCaseSchema, ContractAnnotationsSchema, ContractSchema, DottedKebabSchema, FeatureSchema, HttpMethodSchema, KebabCaseSchema, ResponseFormatSchema, ScenarioSchema, StateAnnotationsSchema, StateTransitionSchema, StateVariableSchema, StepSchema, UiAnnotationsSchema, UiRouteSchema, UiStringSchema, UiTestIdSchema, UrlPathSchema, VarTypeSchema, } from "./schema";
@@ -0,0 +1 @@
1
+ export declare const BDD_BACKEND_TEMPLATE = "# /bdd-backend\n\nGenerate typed API services from one or more BDD Contract JSON files.\n\n## Usage\n\nSingle file:\n```\n/bdd-backend <contract.json> --out <out-dir>\n```\n\nBatch (directory or glob):\n```\n/bdd-backend <dir> --out <out-dir>\n/bdd-backend \"<dir>/**/*.contract.json\" --out <out-dir>\n```\n\n## Workflow\n\nSingle file:\n1. Read the Contract JSON\n2. Extract @api:endpoint and @api:response annotations\n3. Generate typed service files with Zod request/response schemas\n4. One service function per endpoint\n5. Report generated file paths\n\nBatch input (directory or glob):\n1. Expand the input into a list of .contract.json files\n2. For each contract, run the single-file workflow above\n3. Use background subagents (`task(run_in_background=true)`) to run each in parallel (up to 5 concurrent)\n4. Wait for all to finish, then collect results and report a summary\n\n## Output\n\nSingle file: TypeScript service files (.ts) with Zod validation schemas for each API endpoint.\n\nBatch: per-feature service subdirectory tree under `<out-dir>/<feature>/backend/`.\n\n## Git Actions (HARD RULE)\nNEVER run `git commit`, `git add`, `git push`, `git rebase`, `git reset`, `git tag`, or any other git command in this command context. The pipeline runner is responsible for version control. You may only create/edit the generated files in the target output directory.\n";
@@ -0,0 +1 @@
1
+ export declare const BDD_CONTRACT_TEMPLATE = "# /bdd-contract\n\nGenerate BDD Contract JSON from one or more Gherkin .feature files. The .feature file must be 100% pure Gherkin (no '# @annotation' comments). The bdd-contract agent infers all annotations (api/ui/state/assumptions) via LLM reasoning from feature content.\n\n## Usage\n\nSingle file:\n```\n/bdd-contract <feature-path> [--force]\n```\n\nBatch (directory or glob):\n```\n/bdd-contract <dir> [--force]\n/bdd-contract \"<dir>/**/*.feature\" [--force]\n```\n\n## Workflow\n\nSingle file:\n1. Parse the .feature file using bdd_parse_gherkin tool (deterministic AST)\n2. Create initial Contract JSON using bdd_create_contract tool (deterministic, empty annotations)\n3. ENRICH the Contract: the bdd-contract agent infers annotations (api/ui/state/assumptions) via LLM reasoning from feature content and edits the Contract JSON file in place\n4. **VALIDATE**: call bdd_validate_contract on the file -- if it returns errors, fix the contract and re-validate. The contract must conform to the strict ContractSchema (all annotation field names must match the required naming conventions: kebab-case for routes/testIds, camelCase for state variables, dotted kebab-case for string keys).\n5. Report the Contract file path, key features identified, and annotations inferred\n\nBatch input (directory or glob):\n1. Expand the input into a list of .feature files\n2. For each .feature file, run the single-file workflow above\n3. Report a summary of all generated contracts (count, paths, any failures)\n\n## Output\n\nSingle file: a `<file>.contract.json` alongside the source .feature file, conforming to ContractSchema v1 with schemaVersion: 1, scenarios, and LLM-inferred annotations.\n\nBatch: one contract file per source .feature, written next to each source file.\n\n## Git Actions (HARD RULE)\nNEVER run `git commit`, `git add`, `git push`, `git rebase`, `git reset`, `git tag`, or any other git command in this command context. The pipeline runner is responsible for version control. You may only create/edit the generated contract JSON.\n";
@@ -0,0 +1 @@
1
+ export declare const BDD_FRONTEND_TEMPLATE = "# /bdd-frontend\n\nGenerate React components and a dev preview server from one or more BDD Contract JSON files.\n\n## Usage\n\nSingle file:\n```\n/bdd-frontend <contract.json>\n```\n\nBatch (directory or glob):\n```\n/bdd-frontend <dir> --out <out-dir>\n/bdd-frontend \"<dir>/**/*.contract.json\" --out <out-dir>\n```\n\n## Workflow\n\nSingle file:\n1. Read the Contract JSON\n2. Extract @ui:* annotations (routes, testIds, strings)\n3. Generate React components for each route/feature\n4. Implement form fields from state variables\n5. Apply test IDs and accessibility attributes\n6. Generate a preview-server.ts for visual review\n\nBatch input (directory or glob):\n1. Expand the input into a list of .contract.json files\n2. For each contract, run the single-file workflow above\n3. Use background subagents (`task(run_in_background=true)`) to run each in parallel (up to 5 concurrent)\n4. Wait for all to finish, then collect results and report a summary\n\n## Output\n\nSingle file: React component files (.tsx) with TypeScript props, design tokens, data-testid attributes, and a preview-server.ts for visual review.\n\nBatch: per-feature component subdirectory tree under `<out-dir>/<feature>/components/`, with one preview-server.ts per feature.\n\n## Git Actions (HARD RULE)\nNEVER run `git commit`, `git add`, `git push`, `git rebase`, `git reset`, `git tag`, or any other git command in this command context. The pipeline runner is responsible for version control. You may only create/edit the generated files in the target output directory.\n";
@@ -0,0 +1 @@
1
+ export declare const BDD_PIPELINE_TEMPLATE = "# /bdd-pipeline\n\nFull BDD pipeline: parse one or more .feature files, generate a Contract, run\nthe 3 parallel subagents (tests, frontend, backend), and write a per-feature\nANALYSIS.md. The pipeline is implemented as a tool \u2014 same input produces the\nsame task shape every run.\n\n## Usage\n\n```\n/bdd-pipeline <feature-path|dir|glob> --out <out-dir> [--force]\n```\n\nExamples:\n- Single file: `/bdd-pipeline features/auth/login.feature --out ./generated`\n- Directory: `/bdd-pipeline features/auth --out ./generated`\n- Glob: `/bdd-pipeline \"features/**/*.feature\" --out ./generated`\n\n## What to do\n\n1. Call the `bdd_pipeline_run` tool with the resolved inputs:\n\n ```json\n {\n \"featurePaths\": [\"<absolute path(s) or glob(s)>\"],\n \"outDir\": \"<absolute output dir>\",\n \"force\": false\n }\n ```\n\n The tool returns `{ success, count, passed, failed, results[] }`. Each\n `result` contains `status`, per-stage `tests_passed`/`tests_failed`,\n `filesCreated`, `missingOutputs`, and `error`.\n\n2. Report the aggregated result. PASS means every feature has `status: \"PASS\"`\n (all 3 subagent stages completed + the file-existence gate passed). FAIL\n otherwise \u2014 list the failing features, failing stages, and missing outputs.\n\n3. Do NOT spawn subagents, parse .feature files, generate components, or write\n ANALYSIS.md yourself \u2014 the tool does all of that.\n\n4. Do NOT run any git commands (commit, add, push, rebase, etc.).\n";
@@ -0,0 +1 @@
1
+ export declare const BDD_TESTS_TEMPLATE = "# /bdd-tests\n\nGenerate Cucumber step definitions and page objects from one or more BDD Contract JSON files.\n\n## Usage\n\nSingle file:\n```\n/bdd-tests <contract.json> --out <out-dir>\n```\n\nBatch (directory or glob):\n```\n/bdd-tests <dir> --out <out-dir>\n/bdd-tests \"<dir>/**/*.contract.json\" --out <out-dir>\n```\n\n## Workflow\n\nSingle file:\n1. Read the Contract JSON file\n2. Extract feature scenarios and their steps\n3. Generate Cucumber step definition files (Given/When/Then/And/But)\n4. Generate page object classes for UI interactions\n5. Generate `cucumber.cjs` (CommonJS, NOT `cucumber.js`) + a per-feature `Dockerfile` + `run-tests.sh` so the tests are runnable in CI and locally\n6. Verify with `npx cucumber-js` via bash (use the generated `run-tests.sh` if it exists, else invoke cucumber directly)\n\nBatch input (directory or glob):\n1. Expand the input into a list of .contract.json files\n2. For each contract, run the single-file workflow above (including the per-feature Dockerfile + run-tests.sh generation)\n3. Use background subagents (`task(run_in_background=true)`) to run each in parallel (up to 5 concurrent)\n4. Wait for all to finish and collect results\n5. AFTER all per-feature runs finish, generate TWO parent-shared files at the input directory root:\n - `<input-dir>/Dockerfile` -- same base image as the per-feature one, CMD points to the parent run-tests.sh\n - `<input-dir>/run-tests.sh` -- iterates every feature subdir that has a run-tests.sh and invokes it in sequence (with BDD_FEATURE filter support)\n6. Report a summary that lists the per-feature outputs AND the parent batch runner\n\n## Output\n\nSingle file: `<out-dir>/<feature>/` containing `cucumber.cjs`, `Dockerfile`, `run-tests.sh`, plus `tests/` (step definitions, page objects, world, hooks).\n\nBatch: per-feature subdirectory tree under `<input-dir>/<feature>/` with the same layout for each feature, PLUS parent-shared `<input-dir>/Dockerfile` and `<input-dir>/run-tests.sh` for running every feature in one go.\n\n## Git Actions (HARD RULE)\nNEVER run `git commit`, `git add`, `git push`, `git rebase`, `git reset`, `git tag`, or any other git command in this command context. The pipeline runner is responsible for version control. You may only create/edit the generated files in the target output directory.\n";
@@ -0,0 +1 @@
1
+ export declare const DCP_PROFILE_TEMPLATE = "You are switching the active DCP (Dynamic Context Pruning) profile tier.\n\nThis command is provided by the Matrixx plugin to call a user-managed shell script that swaps the active DCP configuration. The script lives in the user's home directory and is not part of the Matrixx codebase.\n\n## Step 1: Verify DCP is installed\n\nCheck whether the DCP plugin is installed at the standard OpenCode plugin location:\n\n```bash\nif [ ! -d \"$HOME/.config/opencode/node_modules/@tarquinen/opencode-dcp\" ]; then\n echo \"DCP is not installed at the standard OpenCode plugin location.\" >&2\n echo \"Install it with: npm install --prefix ~/.config/opencode @tarquinen/opencode-dcp\" >&2\n exit 1\nfi\n```\n\nIf the directory does not exist, stop immediately and report the error to the user. Do not proceed.\n\n## Step 2: Resolve the switch script path\n\nThe switch script location is configurable via the `dcp.switch_script` key in the user's `matrixx.jsonc` (read from `~/.config/opencode/matrixx.jsonc` or the project-level file). If that key is absent, use the default:\n\n```\n~/.myopencode/dcp/switch-profile.sh\n```\n\nIf the resolved script does not exist or is not executable, stop and report the path to the user.\n\n## Step 3: Determine the target profile\n\nParse the arguments passed to this command. The user invoked `/dcp-profile <arguments>` where `<arguments>` is the first positional argument.\n\n- If the argument is a known profile name (one of: economy, balanced, performance, ultimate), use it directly.\n- If the argument is empty or missing, read `dcp.default_profile` from the user's config; if absent, default to `balanced`.\n- If the argument is not a recognized profile name, list the available profiles and stop. Do NOT guess or pass invalid names to the script.\n\n## Step 4: Execute the switch script\n\nRun the script via the bash tool. Capture both stdout and stderr. If the script exits with a non-zero status, show the captured stderr output to the user verbatim and stop. Do not swallow errors.\n\n```bash\n\"<resolved-switch-script>\" \"<profile-name>\"\n```\n\n## Step 5: Confirm and instruct\n\nAfter a successful switch:\n\n1. Report the script's stdout to the user.\n2. Tell the user that the new DCP configuration will take effect after they restart their OpenCode session (the active session has already loaded the previous config into memory).\n3. Do not attempt to reload DCP in-place; a session restart is required.\n\n## Important constraints\n\n- This command is a thin wrapper. All real logic lives in the user's switch script. Never bypass the script by writing to `dcp.jsonc` directly.\n- Do not install, upgrade, or modify the DCP plugin from this command. If the user needs to install or upgrade DCP, instruct them to run `opencode plugin @tarquinen/opencode-dcp@<version>` (or use `npm install --prefix ~/.config/opencode` for cached installs).\n- Do not edit any DCP config files (`dcp-base.jsonc`, `dcp-<profile>.jsonc`, `dcp-generated-*.jsonc`) as part of switching.";
@@ -1,3 +1,3 @@
1
- import type { CommandDefinition } from "../claude-code-command-loader";
2
- export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode" | "profile" | "end-ultrawork" | "research" | "assembly" | "ultrawork";
1
+ import type { CommandDefinition } from "../command-loader";
2
+ export type BuiltinCommandName = "init-deep" | "matrix-loop" | "cancel-loop" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "pickup" | "remove-deadcode" | "profile" | "end-ultrawork" | "research" | "assembly" | "ultrawork" | "bdd-backend" | "bdd-contract" | "bdd-frontend" | "bdd-pipeline" | "bdd-tests" | "dcp-profile";
3
3
  export type BuiltinCommands = Record<string, CommandDefinition>;
@@ -0,0 +1,17 @@
1
+ import type { BuiltinSkill } from "./types";
2
+ /**
3
+ * Wraps a skill factory into a BuiltinSkill with a lazy `template` getter.
4
+ *
5
+ * The factory is NOT called at construction time — only when `.template` is
6
+ * first accessed. Subsequent accesses return a cached value (self-destructing
7
+ * getter pattern replaces itself with a data property after first access).
8
+ * `description` is hydrated on every template access so the cache being
9
+ * populated by an earlier test does not leave subsequent instances empty.
10
+ *
11
+ * @param name - Skill name (used as cache key)
12
+ * @param skillFactory - Factory returning a full BuiltinSkill
13
+ * @returns BuiltinSkill with deferred template resolution
14
+ */
15
+ export declare function createLazyTemplateSkill(name: string, skillFactory: () => BuiltinSkill): BuiltinSkill;
16
+ /** Clears the internal skill cache (for testing). */
17
+ export declare function clearLazyTemplateCache(): void;
@@ -0,0 +1,3 @@
1
+ import type { BuiltinSkill } from "../types";
2
+ export declare const BDD_BACKEND_SKILL_NAME = "bdd-backend";
3
+ export declare const bddBackendSkill: BuiltinSkill;
@@ -0,0 +1,3 @@
1
+ import type { BuiltinSkill } from "../types";
2
+ export declare const BDD_CONTRACT_SKILL_NAME = "bdd-contract";
3
+ export declare const bddContractSkill: BuiltinSkill;
@@ -0,0 +1,3 @@
1
+ import type { BuiltinSkill } from "../types";
2
+ export declare const BDD_FRONTEND_SKILL_NAME = "bdd-frontend";
3
+ export declare const bddFrontendSkill: BuiltinSkill;
@@ -0,0 +1,3 @@
1
+ import type { BuiltinSkill } from "../types";
2
+ export declare const BDD_TESTS_SKILL_NAME = "bdd-tests";
3
+ export declare const bddTestsSkill: BuiltinSkill;
@@ -0,0 +1,2 @@
1
+ import type { BuiltinSkill } from "../types";
2
+ export declare const dockerMasterSkill: BuiltinSkill;
@@ -1,4 +1,9 @@
1
+ export { bddBackendSkill } from "./bdd-backend";
2
+ export { bddContractSkill } from "./bdd-contract";
3
+ export { bddFrontendSkill } from "./bdd-frontend";
4
+ export { bddTestsSkill } from "./bdd-tests";
1
5
  export { devBrowserSkill } from "./dev-browser";
6
+ export { dockerMasterSkill } from "./docker-master";
2
7
  export { documentReaderSkill } from "./document-reader";
3
8
  export { dslCodegenSkill } from "./dsl-codegen";
4
9
  export { dslCompositionSkill } from "./dsl-composition";
@@ -1,5 +1,3 @@
1
1
  import type { CommandDefinition } from "./types";
2
- export declare function loadUserCommands(): Promise<Record<string, CommandDefinition>>;
3
- export declare function loadProjectCommands(directory?: string): Promise<Record<string, CommandDefinition>>;
4
2
  export declare function loadOpencodeGlobalCommands(): Promise<Record<string, CommandDefinition>>;
5
3
  export declare function loadOpencodeProjectCommands(directory?: string): Promise<Record<string, CommandDefinition>>;
@@ -5,3 +5,13 @@ export declare const MISSION_DIR = ".matrixx";
5
5
  export declare const MISSION_FILE = "mission.json";
6
6
  /** Oracle planner plan directory pattern */
7
7
  export declare const ORACLE_PLANS_DIR = ".matrixx/plans";
8
+ /**
9
+ * Plan Persistence Constants
10
+ */
11
+ /** Relative path from project root to plans directory */
12
+ export declare const PLANS_DIR = ".matrixx/plans";
13
+ /** HTML comment marker for machine metadata at the end of a plan file */
14
+ export declare const META_TAG_PREFIX = "<!-- plan-persister:";
15
+ export declare const META_TAG_SUFFIX = "-->";
16
+ /** Safety cap: max bytes for a single plan file read */
17
+ export declare const MAX_PLAN_FILE_BYTES = 102400;
@@ -1,3 +1,5 @@
1
1
  export * from "./constants";
2
+ export * from "./plan-storage";
3
+ export * from "./rehydrate";
2
4
  export * from "./storage";
3
5
  export * from "./types";
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Plan Persistence Storage
3
+ *
4
+ * Atomic file operations for plan files.
5
+ * Reuses the write-temp-then-rename pattern from handoff/storage.ts.
6
+ */
7
+ import type { PlanMeta } from "./types";
8
+ /**
9
+ * Ensure the .matrixx/plans directory exists under the project root.
10
+ */
11
+ export declare function ensurePlanDir(directory: string): boolean;
12
+ /**
13
+ * Read a plan file's content.
14
+ * Returns null if the file does not exist, is too large, or cannot be read.
15
+ */
16
+ export declare function readPlanFile(planPath: string): string | null;
17
+ /**
18
+ * Atomic write: write to a .tmp.{pid} file, then rename over the target.
19
+ * Prevents partial/corrupt files on crash mid-write.
20
+ */
21
+ export declare function atomicWrite(filePath: string, content: string): boolean;
22
+ /**
23
+ * Write content to a plan file using atomic write.
24
+ * Ensures the plan directory exists first.
25
+ */
26
+ export declare function writePlanFile(directory: string, planPath: string, content: string): boolean;
27
+ /**
28
+ * Sync markdown checkbox status to match todos.
29
+ *
30
+ * For each `- [ ]` or `- [x]` line, finds the matching todo by content
31
+ * and marks it completed if the todo status is completed/cancelled.
32
+ * Lines without a matching todo keep their current state.
33
+ */
34
+ export declare function syncCheckboxes(content: string, todos: Array<{
35
+ content: string;
36
+ status: string;
37
+ }>): string;
38
+ /**
39
+ * Append or replace the <!-- plan-persister: ... --> metadata comment.
40
+ *
41
+ * If a comment already exists at the end of the file, it is replaced in-place.
42
+ * Otherwise, the tag is appended after the last line.
43
+ */
44
+ export declare function upsertMetadataComment(content: string, meta: PlanMeta): string;
45
+ /**
46
+ * Extract PlanMeta from an HTML comment, or null if absent/malformed.
47
+ */
48
+ export declare function parseMetadataComment(content: string): PlanMeta | null;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Plan Persistence Rehydration
3
+ *
4
+ * Builds rehydration context from mission state + plan file for injection
5
+ * after compaction or session start.
6
+ */
7
+ import type { RehydrationContext } from "./types";
8
+ /**
9
+ * Build a rehydration context from mission state + plan file.
10
+ *
11
+ * Returns null when:
12
+ * - No mission file exists
13
+ * - Mission has no active_plan
14
+ * - Plan file is missing
15
+ * - Plan is 100% complete (no point rehydrating a finished plan)
16
+ */
17
+ export declare function buildRehydrationContext(directory: string): RehydrationContext | null;
18
+ /**
19
+ * Find active plan path from mission state.
20
+ */
21
+ export declare function findActivePlan(directory: string): string | null;