@jstn-sdk/ma 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/.agents/plugins/marketplace.json +0 -0
  2. package/README.md +136 -29
  3. package/bin/ma.js +23 -67
  4. package/docs/README.md +4 -1
  5. package/docs/assets/image/Screenshot(1).png +0 -0
  6. package/docs/assets/image/Screenshot(2).png +0 -0
  7. package/docs/assets/image/Screenshot(3).png +0 -0
  8. package/docs/assets/image/Screenshot(4).png +0 -0
  9. package/docs/assets/image/Screenshot(5).png +0 -0
  10. package/docs/assets/image/Screenshot(6).png +0 -0
  11. package/docs/assets/image/Screenshot(7).png +0 -0
  12. package/docs/assets/image/Screenshot(8).png +0 -0
  13. package/docs/assets/image/Screenshot(9).png +0 -0
  14. package/docs/assets/meta-architect-logo.png +0 -0
  15. package/docs/assets/meta-architect-logo.svg +0 -0
  16. package/docs/getting-started.md +74 -19
  17. package/docs/installed-sdk.md +23 -0
  18. package/docs/mcp-setup.md +30 -1
  19. package/docs/qa/{release-readiness-0.1.11.md → release-readiness-0.1.12.md} +29 -8
  20. package/docs/qa/release-readiness-0.1.5.md +0 -0
  21. package/docs/reference/native-engineering-patterns.md +35 -0
  22. package/docs/reference/native-security-playbooks.md +21 -0
  23. package/docs/reference/native-source-selection.md +21 -0
  24. package/docs/reference/native-style-and-deslop.md +20 -0
  25. package/docs/release-spec.md +21 -10
  26. package/docs/skills-publishing.md +25 -1
  27. package/docs/skills.md +24 -12
  28. package/mcp/local/code-intel.js +113 -0
  29. package/mcp/local/memory.js +46 -0
  30. package/mcp/local/playbooks.js +168 -0
  31. package/mcp/local/state.js +71 -0
  32. package/mcp/local/team-run.js +66 -0
  33. package/mcp/local/trace.js +60 -0
  34. package/mcp/local-capabilities.json +56 -0
  35. package/mcp/native-playbooks.json +117 -0
  36. package/mcp/servers.json +10 -0
  37. package/package.json +4 -1
  38. package/plugins/meta-architect/.app.json +1 -1
  39. package/plugins/meta-architect/.codex-plugin/plugin.json +4 -4
  40. package/plugins/meta-architect/.mcp.json +1 -1
  41. package/plugins/meta-architect/README.md +27 -1
  42. package/plugins/meta-architect/skills/align/SKILL.md +24 -0
  43. package/plugins/meta-architect/skills/align/agents/openai.yaml +4 -0
  44. package/plugins/meta-architect/skills/align/references/shared-language.md +24 -0
  45. package/plugins/meta-architect/skills/arch/SKILL.md +0 -0
  46. package/plugins/meta-architect/skills/arch/agents/openai.yaml +0 -0
  47. package/plugins/meta-architect/skills/build/SKILL.md +0 -0
  48. package/plugins/meta-architect/skills/build/agents/openai.yaml +0 -0
  49. package/plugins/meta-architect/skills/cleanup/SKILL.md +23 -0
  50. package/plugins/meta-architect/skills/cleanup/agents/openai.yaml +4 -0
  51. package/plugins/meta-architect/skills/cleanup/references/style-and-deslop.md +18 -0
  52. package/plugins/meta-architect/skills/diagnose/SKILL.md +24 -0
  53. package/plugins/meta-architect/skills/diagnose/agents/openai.yaml +4 -0
  54. package/plugins/meta-architect/skills/flow/SKILL.md +0 -0
  55. package/plugins/meta-architect/skills/flow/agents/openai.yaml +0 -0
  56. package/plugins/meta-architect/skills/maestro/SKILL.md +36 -3
  57. package/plugins/meta-architect/skills/maestro/agents/openai.yaml +2 -2
  58. package/plugins/meta-architect/skills/{meta-architect → maestro}/references/core-release-rules.md +0 -0
  59. package/plugins/meta-architect/skills/maestro/references/native-ingest-map.md +44 -0
  60. package/plugins/meta-architect/skills/sage/SKILL.md +3 -1
  61. package/plugins/meta-architect/skills/sage/agents/openai.yaml +0 -0
  62. package/plugins/meta-architect/skills/sage/references/source-selection.md +28 -0
  63. package/plugins/meta-architect/skills/tdd/SKILL.md +24 -0
  64. package/plugins/meta-architect/skills/tdd/agents/openai.yaml +4 -0
  65. package/plugins/meta-architect/skills/vet/SKILL.md +3 -1
  66. package/plugins/meta-architect/skills/vet/agents/openai.yaml +0 -0
  67. package/plugins/meta-architect/skills/vet/references/security-playbooks.md +23 -0
  68. package/plugins/meta-architect/skills/vibe/SKILL.md +0 -0
  69. package/plugins/meta-architect/skills/vibe/agents/openai.yaml +0 -0
  70. package/scripts/biome-staged.js +0 -0
  71. package/scripts/build-linux-packages.mjs +328 -0
  72. package/scripts/doctor.js +19 -0
  73. package/scripts/linux-package-lib.mjs +40 -0
  74. package/scripts/linux-package-smoke.mjs +103 -0
  75. package/scripts/plugin-sync.js +0 -0
  76. package/scripts/postinstall.js +0 -0
  77. package/scripts/release-metadata.js +0 -0
  78. package/scripts/release-sync.js +13 -6
  79. package/scripts/release-verify.js +0 -0
  80. package/scripts/setup-npmrc.js +0 -0
  81. package/skills/align/SKILL.md +24 -0
  82. package/skills/align/agents/openai.yaml +4 -0
  83. package/skills/align/references/shared-language.md +24 -0
  84. package/skills/arch/SKILL.md +0 -0
  85. package/skills/arch/agents/openai.yaml +0 -0
  86. package/skills/build/SKILL.md +0 -0
  87. package/skills/build/agents/openai.yaml +0 -0
  88. package/skills/cleanup/SKILL.md +23 -0
  89. package/skills/cleanup/agents/openai.yaml +4 -0
  90. package/skills/cleanup/references/style-and-deslop.md +18 -0
  91. package/skills/diagnose/SKILL.md +24 -0
  92. package/skills/diagnose/agents/openai.yaml +4 -0
  93. package/skills/flow/SKILL.md +0 -0
  94. package/skills/flow/agents/openai.yaml +0 -0
  95. package/skills/index.json +21 -6
  96. package/skills/maestro/SKILL.md +36 -3
  97. package/skills/maestro/agents/openai.yaml +2 -2
  98. package/skills/{meta-architect → maestro}/references/core-release-rules.md +0 -0
  99. package/skills/maestro/references/native-ingest-map.md +44 -0
  100. package/skills/sage/SKILL.md +3 -1
  101. package/skills/sage/agents/openai.yaml +0 -0
  102. package/skills/sage/references/source-selection.md +28 -0
  103. package/skills/tdd/SKILL.md +24 -0
  104. package/skills/tdd/agents/openai.yaml +4 -0
  105. package/skills/vet/SKILL.md +3 -1
  106. package/skills/vet/agents/openai.yaml +0 -0
  107. package/skills/vet/references/security-playbooks.md +23 -0
  108. package/skills/vibe/SKILL.md +0 -0
  109. package/skills/vibe/agents/openai.yaml +0 -0
  110. package/src/bootstrap.js +124 -24
  111. package/src/decision-log.js +12 -9
  112. package/src/launcher.js +0 -0
  113. package/src/mcp-config.js +130 -8
  114. package/src/mcp-live-client.js +1 -1
  115. package/src/paths.js +33 -1
  116. package/src/release-state.js +30 -1
  117. package/src/runtime/build-readiness.js +38 -0
  118. package/src/runtime/continuity-notes.js +79 -0
  119. package/src/runtime/guidance-stack.js +42 -0
  120. package/src/runtime/maestro-manager.js +586 -0
  121. package/src/runtime/orchestrator.js +158 -0
  122. package/src/runtime/runtime-state.js +382 -0
  123. package/src/runtime/signal-hooks.js +52 -0
  124. package/src/runtime/startup-path.js +14 -0
  125. package/src/runtime/workspaces.js +25 -0
  126. package/src/runtime-artifacts.js +190 -30
  127. package/src/skill-installer.js +53 -5
  128. package/src/skills.js +633 -49
  129. package/src/state-sync.js +51 -8
  130. package/plugins/meta-architect/skills/meta-architect/SKILL.md +0 -32
  131. package/plugins/meta-architect/skills/meta-architect/agents/openai.yaml +0 -4
  132. package/skills/meta-architect/SKILL.md +0 -32
  133. package/skills/meta-architect/agents/openai.yaml +0 -4
@@ -2,6 +2,7 @@ import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { ensureDir, writeFileIfMissing } from "./fs-utils.js";
4
4
  import { getRuntimeWritePath } from "./paths.js";
5
+ import { ensureRuntimeSubsystems } from "./runtime/runtime-state.js";
5
6
 
6
7
  const runtimeDirs = ["context", "specs", "plans"];
7
8
 
@@ -23,12 +24,93 @@ function renderProjectContext({ idea = null }) {
23
24
  "",
24
25
  "## Next Recommended Trigger",
25
26
  "",
26
- idea ? "`$arch`" : "`ma idea`",
27
+ idea ? "`$maestro`" : "`ma idea`",
27
28
  "",
28
29
  ].join("\n");
29
30
  }
30
31
 
31
- function renderArchitectureSpec({ idea, blueprint }) {
32
+ function renderRuntimeSummary(summary) {
33
+ if (!summary) {
34
+ return [];
35
+ }
36
+
37
+ return [
38
+ "## Runtime Context",
39
+ "",
40
+ `- guidance sources: ${summary.guidanceSourceCount}`,
41
+ `- guidance include roots: ${summary.guidanceIncludeRoots}`,
42
+ `- continuity sessions: ${summary.continuitySessionCount}`,
43
+ `- continuity notes present: ${summary.continuityHasNotes}`,
44
+ `- compatibility hooks: ${summary.compatibilityHookCount}`,
45
+ `- runtime hook events: ${summary.runtimeHookCount}`,
46
+ `- configured runtime hooks: ${summary.configuredRuntimeHookCount}`,
47
+ `- workers: ${summary.workerCount}`,
48
+ `- tasks: ${summary.taskCount}`,
49
+ `- pending mailbox proposals: ${summary.pendingMailboxCount}`,
50
+ `- workspaces: ${summary.workspaceCount}`,
51
+ `- recorded decisions: ${summary.decisionCount}`,
52
+ `- manager runs: ${summary.managerRunCount}`,
53
+ `- active manager runs: ${summary.activeManagerRunCount}`,
54
+ `- waiting-review manager runs: ${summary.waitingReviewManagerRunCount}`,
55
+ `- build status: ${summary.buildStatus}`,
56
+ `- missing runtime artifacts: ${summary.missingArtifacts.length}`,
57
+ `- invalid runtime artifacts: ${summary.invalidArtifacts.length}`,
58
+ "",
59
+ ];
60
+ }
61
+
62
+ function formatManagerHelper(helper) {
63
+ return `${helper.skill}: ${helper.objective} [${helper.status}]`;
64
+ }
65
+
66
+ function formatManagerGate(gate) {
67
+ return `${gate.skill}: ${gate.objective} [${gate.status}]`;
68
+ }
69
+
70
+ function renderManagerSection(managerRun) {
71
+ if (!managerRun) {
72
+ return [];
73
+ }
74
+
75
+ const lines = [
76
+ "## Manager Run",
77
+ "",
78
+ `- id: ${managerRun.id}`,
79
+ `- state: ${managerRun.state}`,
80
+ `- mode: ${managerRun.mode}`,
81
+ `- next action: ${managerRun.nextAction}`,
82
+ ];
83
+
84
+ if (managerRun.dispatchPlan.helpers.length > 0) {
85
+ lines.push("- helper dispatch:");
86
+ lines.push(
87
+ ...managerRun.dispatchPlan.helpers.map((item) => ` - ${formatManagerHelper(item)}`),
88
+ );
89
+ }
90
+
91
+ if (managerRun.dispatchPlan.gated.length > 0) {
92
+ lines.push("- gated dispatch:");
93
+ lines.push(...managerRun.dispatchPlan.gated.map((item) => ` - ${formatManagerGate(item)}`));
94
+ }
95
+
96
+ if (managerRun.dispatchPlan.team) {
97
+ lines.push("- team dispatch:");
98
+ lines.push(` - title: ${managerRun.dispatchPlan.team.title}`);
99
+ lines.push(` - objective: ${managerRun.dispatchPlan.team.objective}`);
100
+ if (managerRun.dispatchPlan.team.createdTaskIds.length > 0) {
101
+ lines.push(` - created tasks: ${managerRun.dispatchPlan.team.createdTaskIds.join(", ")}`);
102
+ }
103
+ }
104
+
105
+ if (managerRun.pendingReview.proposalPath) {
106
+ lines.push(`- pending review: ${managerRun.pendingReview.proposalPath}`);
107
+ }
108
+
109
+ lines.push("");
110
+ return lines;
111
+ }
112
+
113
+ function renderArchitectureSpec({ idea, blueprint, runtimeSummary }) {
32
114
  return [
33
115
  "# Architecture Spec",
34
116
  "",
@@ -50,6 +132,7 @@ function renderArchitectureSpec({ idea, blueprint }) {
50
132
  "",
51
133
  blueprint.outcome,
52
134
  "",
135
+ ...renderRuntimeSummary(runtimeSummary),
53
136
  "## Next Recommended Trigger",
54
137
  "",
55
138
  "`$sage`",
@@ -57,7 +140,7 @@ function renderArchitectureSpec({ idea, blueprint }) {
57
140
  ].join("\n");
58
141
  }
59
142
 
60
- function renderEvidenceSpec({ idea, sourceEntries, verified, blockers }) {
143
+ function renderEvidenceSpec({ idea, sourceEntries, verified, blockers, runtimeSummary }) {
61
144
  const status = verified ? "VERIFIED" : sourceEntries.length > 0 ? "PARTIAL" : "MISSING";
62
145
  const lines = [
63
146
  "# Evidence Spec",
@@ -100,6 +183,7 @@ function renderEvidenceSpec({ idea, sourceEntries, verified, blockers }) {
100
183
  lines.push(...blockers.map((blocker) => `- ${blocker}`), "");
101
184
  }
102
185
 
186
+ lines.push(...renderRuntimeSummary(runtimeSummary));
103
187
  lines.push("## Next Recommended Trigger", "", verified ? "`$flow`" : "`$sage`", "");
104
188
  return lines.join("\n");
105
189
  }
@@ -110,22 +194,32 @@ function renderLogicSpec(logicMap) {
110
194
  "",
111
195
  `Updated: ${new Date().toISOString()}`,
112
196
  "",
197
+ ...(logicMap.actors
198
+ ? ["## Actors", "", ...logicMap.actors.map((actor) => `- ${actor}`), ""]
199
+ : []),
113
200
  "## States",
114
201
  "",
115
202
  ...logicMap.states.map((state) => `- ${state}`),
116
203
  "",
204
+ ...(logicMap.runtimeSummary ? renderRuntimeSummary(logicMap.runtimeSummary) : []),
117
205
  "## Blockers",
118
206
  "",
119
207
  ...(logicMap.blockers.length === 0 ? ["None."] : logicMap.blockers.map((item) => `- ${item}`)),
120
208
  "",
121
209
  "## Next Recommended Trigger",
122
210
  "",
123
- "`$vet`",
211
+ logicMap.nextTrigger ?? "`$vet`",
124
212
  "",
125
213
  ].join("\n");
126
214
  }
127
215
 
128
- function renderSecuritySpec({ finding, auditCount, cveCount }) {
216
+ function renderSecuritySpec({
217
+ finding,
218
+ auditCount,
219
+ cveCount,
220
+ runtimeSummary,
221
+ nextTrigger = "`$vibe`",
222
+ }) {
129
223
  return [
130
224
  "# Security Spec",
131
225
  "",
@@ -142,14 +236,15 @@ function renderSecuritySpec({ finding, auditCount, cveCount }) {
142
236
  `- audits logged: ${auditCount}`,
143
237
  `- cve entries logged: ${cveCount}`,
144
238
  "",
239
+ ...renderRuntimeSummary(runtimeSummary),
145
240
  "## Next Recommended Trigger",
146
241
  "",
147
- "`$vibe`",
242
+ nextTrigger,
148
243
  "",
149
244
  ].join("\n");
150
245
  }
151
246
 
152
- function renderExperienceSpec({ note, outcomeCount }) {
247
+ function renderExperienceSpec({ note, outcomeCount, runtimeSummary, nextTrigger = "`$build`" }) {
153
248
  return [
154
249
  "# Experience Spec",
155
250
  "",
@@ -164,14 +259,15 @@ function renderExperienceSpec({ note, outcomeCount }) {
164
259
  "",
165
260
  `- outcomes logged: ${outcomeCount}`,
166
261
  "",
262
+ ...renderRuntimeSummary(runtimeSummary),
167
263
  "## Next Recommended Trigger",
168
264
  "",
169
- "`$build`",
265
+ nextTrigger,
170
266
  "",
171
267
  ].join("\n");
172
268
  }
173
269
 
174
- function renderImplementationPlan({ idea, blueprint }) {
270
+ function renderImplementationPlan({ idea, blueprint, runtimeSummary }) {
175
271
  return [
176
272
  "# Implementation Plan",
177
273
  "",
@@ -193,10 +289,17 @@ function renderImplementationPlan({ idea, blueprint }) {
193
289
  "",
194
290
  blueprint.summary,
195
291
  "",
292
+ ...renderRuntimeSummary(runtimeSummary),
196
293
  ].join("\n");
197
294
  }
198
295
 
199
- function renderMaestroPlan({ releaseState, recommendation }) {
296
+ function renderMaestroPlan({
297
+ releaseState,
298
+ recommendation,
299
+ runtimeSummary,
300
+ workflowSequence,
301
+ managerRun = null,
302
+ }) {
200
303
  return [
201
304
  "# Maestro Plan",
202
305
  "",
@@ -220,6 +323,12 @@ function renderMaestroPlan({ releaseState, recommendation }) {
220
323
  "",
221
324
  recommendation.why,
222
325
  "",
326
+ ...renderManagerSection(managerRun),
327
+ "## Workflow Sequence",
328
+ "",
329
+ ...workflowSequence.map((trigger) => `- ${trigger}`),
330
+ "",
331
+ ...renderRuntimeSummary(runtimeSummary),
223
332
  "## Recommended Lane",
224
333
  "",
225
334
  `- primary: ${recommendation.primaryLane}`,
@@ -240,7 +349,13 @@ function renderMaestroPlan({ releaseState, recommendation }) {
240
349
  ].join("\n");
241
350
  }
242
351
 
243
- function renderBuildPlan({ allowed, blockers, nextTriggers, suggestedBranches = [] }) {
352
+ function renderBuildPlan({
353
+ allowed,
354
+ blockers,
355
+ nextTriggers,
356
+ suggestedBranches = [],
357
+ runtimeSummary = null,
358
+ }) {
244
359
  const lines = [
245
360
  "# Build Plan",
246
361
  "",
@@ -260,6 +375,8 @@ function renderBuildPlan({ allowed, blockers, nextTriggers, suggestedBranches =
260
375
  lines.push(...blockers.map((blocker) => `- ${blocker}`), "");
261
376
  }
262
377
 
378
+ lines.push(...renderRuntimeSummary(runtimeSummary));
379
+
263
380
  lines.push("## Next Allowed Triggers", "");
264
381
  lines.push(
265
382
  ...(nextTriggers.length === 0 ? ["- $build"] : nextTriggers.map((item) => `- ${item}`)),
@@ -290,13 +407,10 @@ function renderRunbook() {
290
407
  "",
291
408
  "1. `ma setup`",
292
409
  '2. `ma idea "..."`',
293
- "3. `ma run '$arch'`",
294
- "4. `ma run '$sage'`",
295
- "5. `ma run '$flow'`",
296
- "6. `ma run '$vet'`",
297
- "7. `ma run '$vibe'`",
298
- "8. `ma status`",
299
- "9. `ma run '$build'`",
410
+ "3. `ma run '$maestro'`",
411
+ "4. follow the exact next trigger from `.ma/plans/maestro.md`",
412
+ "5. return to `$maestro` whenever the next lane is unclear",
413
+ "6. `ma status`",
300
414
  "",
301
415
  "## Runtime Artifacts",
302
416
  "",
@@ -330,6 +444,7 @@ export async function seedRuntimeArtifacts() {
330
444
  for (const dir of runtimeDirs) {
331
445
  await ensureDir(getRuntimeWritePath(dir));
332
446
  }
447
+ await ensureRuntimeSubsystems();
333
448
 
334
449
  await writeFileIfMissing(
335
450
  getRuntimeWritePath("context", "project.md"),
@@ -370,15 +485,27 @@ export async function writeProjectContext(idea) {
370
485
  await writeArtifact("context/project.md", renderProjectContext({ idea }));
371
486
  }
372
487
 
373
- export async function writeArchitectureArtifacts({ idea, blueprint }) {
374
- await writeArtifact("specs/architecture.md", renderArchitectureSpec({ idea, blueprint }));
375
- await writeArtifact("plans/implementation.md", renderImplementationPlan({ idea, blueprint }));
488
+ export async function writeArchitectureArtifacts({ idea, blueprint, runtimeSummary = null }) {
489
+ await writeArtifact(
490
+ "specs/architecture.md",
491
+ renderArchitectureSpec({ idea, blueprint, runtimeSummary }),
492
+ );
493
+ await writeArtifact(
494
+ "plans/implementation.md",
495
+ renderImplementationPlan({ idea, blueprint, runtimeSummary }),
496
+ );
376
497
  }
377
498
 
378
- export async function writeEvidenceSpec({ idea, sourceEntries, verified, blockers }) {
499
+ export async function writeEvidenceSpec({
500
+ idea,
501
+ sourceEntries,
502
+ verified,
503
+ blockers,
504
+ runtimeSummary = null,
505
+ }) {
379
506
  await writeArtifact(
380
507
  "specs/evidence.md",
381
- renderEvidenceSpec({ idea, sourceEntries, verified, blockers }),
508
+ renderEvidenceSpec({ idea, sourceEntries, verified, blockers, runtimeSummary }),
382
509
  );
383
510
  }
384
511
 
@@ -386,12 +513,29 @@ export async function writeLogicSpec(logicMap) {
386
513
  await writeArtifact("specs/logic.md", renderLogicSpec(logicMap));
387
514
  }
388
515
 
389
- export async function writeSecuritySpec({ finding, auditCount, cveCount }) {
390
- await writeArtifact("specs/security.md", renderSecuritySpec({ finding, auditCount, cveCount }));
516
+ export async function writeSecuritySpec({
517
+ finding,
518
+ auditCount,
519
+ cveCount,
520
+ runtimeSummary = null,
521
+ nextTrigger = "`$vibe`",
522
+ }) {
523
+ await writeArtifact(
524
+ "specs/security.md",
525
+ renderSecuritySpec({ finding, auditCount, cveCount, runtimeSummary, nextTrigger }),
526
+ );
391
527
  }
392
528
 
393
- export async function writeExperienceSpec({ note, outcomeCount }) {
394
- await writeArtifact("specs/experience.md", renderExperienceSpec({ note, outcomeCount }));
529
+ export async function writeExperienceSpec({
530
+ note,
531
+ outcomeCount,
532
+ runtimeSummary = null,
533
+ nextTrigger = "`$build`",
534
+ }) {
535
+ await writeArtifact(
536
+ "specs/experience.md",
537
+ renderExperienceSpec({ note, outcomeCount, runtimeSummary, nextTrigger }),
538
+ );
395
539
  }
396
540
 
397
541
  export async function writeBuildPlanArtifact({
@@ -399,13 +543,29 @@ export async function writeBuildPlanArtifact({
399
543
  blockers,
400
544
  nextTriggers,
401
545
  suggestedBranches = [],
546
+ runtimeSummary = null,
402
547
  }) {
403
548
  await writeArtifact(
404
549
  "plans/build.md",
405
- renderBuildPlan({ allowed, blockers, nextTriggers, suggestedBranches }),
550
+ renderBuildPlan({ allowed, blockers, nextTriggers, suggestedBranches, runtimeSummary }),
406
551
  );
407
552
  }
408
553
 
409
- export async function writeMaestroPlan({ releaseState, recommendation }) {
410
- await writeArtifact("plans/maestro.md", renderMaestroPlan({ releaseState, recommendation }));
554
+ export async function writeMaestroPlan({
555
+ releaseState,
556
+ recommendation,
557
+ runtimeSummary = null,
558
+ workflowSequence = [],
559
+ managerRun = null,
560
+ }) {
561
+ await writeArtifact(
562
+ "plans/maestro.md",
563
+ renderMaestroPlan({
564
+ releaseState,
565
+ recommendation,
566
+ runtimeSummary,
567
+ workflowSequence,
568
+ managerRun,
569
+ }),
570
+ );
411
571
  }
@@ -1,7 +1,7 @@
1
1
  import fs from "node:fs/promises";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
- import { packageRoot } from "./paths.js";
4
+ import { getBundledDocsPath, packageRoot } from "./paths.js";
5
5
 
6
6
  function resolveCodexHome() {
7
7
  return process.env.CODEX_HOME ?? path.join(os.homedir(), ".codex");
@@ -29,6 +29,15 @@ async function copyDir(src, dest) {
29
29
  }
30
30
  }
31
31
 
32
+ async function pathExists(targetPath) {
33
+ try {
34
+ await fs.access(targetPath);
35
+ return true;
36
+ } catch {
37
+ return false;
38
+ }
39
+ }
40
+
32
41
  export function getSkillInstallRoot() {
33
42
  return resolveSkillInstallRoot();
34
43
  }
@@ -106,11 +115,25 @@ export async function installSupportBundle({ targetRoot = getSupportBundleRoot()
106
115
  },
107
116
  {
108
117
  name: "docs-readme",
109
- src: path.join(packageRoot, "docs", "README.md"),
118
+ src: getBundledDocsPath("README.md"),
110
119
  dest: path.join(targetRoot, "docs", "README.md"),
111
120
  },
112
121
  ];
113
122
 
123
+ const optionalAssets = [
124
+ {
125
+ name: "docs-reference",
126
+ src: getBundledDocsPath("reference"),
127
+ dest: path.join(targetRoot, "docs", "reference"),
128
+ },
129
+ ];
130
+
131
+ for (const asset of optionalAssets) {
132
+ if (await pathExists(asset.src)) {
133
+ assets.push(asset);
134
+ }
135
+ }
136
+
114
137
  await fs.mkdir(targetRoot, { recursive: true });
115
138
  const installed = [];
116
139
  for (const asset of assets) {
@@ -153,6 +176,8 @@ export async function isSupportBundleInstalled({ targetRoot = getSupportBundleRo
153
176
  const requiredFiles = [
154
177
  path.join(targetRoot, "asset-manifest.json"),
155
178
  path.join(targetRoot, "mcp", "servers.json"),
179
+ path.join(targetRoot, "mcp", "native-playbooks.json"),
180
+ path.join(targetRoot, "mcp", "local", "playbooks.js"),
156
181
  path.join(targetRoot, "sprint", "07-release.md"),
157
182
  path.join(targetRoot, "prompts", "onboarding.md"),
158
183
  path.join(targetRoot, "scripts", "skills-install.js"),
@@ -160,14 +185,37 @@ export async function isSupportBundleInstalled({ targetRoot = getSupportBundleRo
160
185
  path.join(targetRoot, "templates", "AGENTS.md"),
161
186
  ];
162
187
 
188
+ const requiredReferenceFiles = [
189
+ path.join(targetRoot, "docs", "reference", "native-engineering-patterns.md"),
190
+ path.join(targetRoot, "docs", "reference", "native-style-and-deslop.md"),
191
+ path.join(targetRoot, "docs", "reference", "native-security-playbooks.md"),
192
+ path.join(targetRoot, "docs", "reference", "native-source-selection.md"),
193
+ ];
194
+
195
+ if (await pathExists(getBundledDocsPath("reference"))) {
196
+ requiredFiles.push(path.join(targetRoot, "docs", "reference"));
197
+ requiredFiles.push(...requiredReferenceFiles);
198
+ }
199
+
163
200
  for (const file of requiredFiles) {
164
- try {
165
- await fs.access(file);
166
- } catch {
201
+ if (!(await pathExists(file))) {
167
202
  return false;
168
203
  }
169
204
  }
170
205
 
206
+ const manifestPath = path.join(targetRoot, "asset-manifest.json");
207
+ const manifest = JSON.parse(await fs.readFile(manifestPath, "utf8"));
208
+ const assetNames = new Set((manifest.assets ?? []).map((asset) => asset.name));
209
+
210
+ for (const requiredAssetName of ["mcp", "docs-readme"]) {
211
+ if (!assetNames.has(requiredAssetName)) {
212
+ return false;
213
+ }
214
+ }
215
+ if ((await pathExists(getBundledDocsPath("reference"))) && !assetNames.has("docs-reference")) {
216
+ return false;
217
+ }
218
+
171
219
  return true;
172
220
  }
173
221