magi-ai 0.1.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 (300) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja.md +377 -0
  3. package/README.md +377 -0
  4. package/dist/bin/magi-benchmark.d.ts +14 -0
  5. package/dist/bin/magi-benchmark.js +93 -0
  6. package/dist/bin/magi-mcp.d.ts +8 -0
  7. package/dist/bin/magi-mcp.js +28 -0
  8. package/dist/bin/magi.d.ts +2 -0
  9. package/dist/bin/magi.js +634 -0
  10. package/dist/src/adapters/base.d.ts +34 -0
  11. package/dist/src/adapters/base.js +149 -0
  12. package/dist/src/adapters/claude.d.ts +29 -0
  13. package/dist/src/adapters/claude.js +65 -0
  14. package/dist/src/adapters/codex.d.ts +21 -0
  15. package/dist/src/adapters/codex.js +41 -0
  16. package/dist/src/adapters/gemini.d.ts +18 -0
  17. package/dist/src/adapters/gemini.js +31 -0
  18. package/dist/src/adapters/registry.d.ts +19 -0
  19. package/dist/src/adapters/registry.js +59 -0
  20. package/dist/src/audit/hash-chain.d.ts +21 -0
  21. package/dist/src/audit/hash-chain.js +70 -0
  22. package/dist/src/audit/types.d.ts +25 -0
  23. package/dist/src/audit/types.js +1 -0
  24. package/dist/src/audit/writer.d.ts +18 -0
  25. package/dist/src/audit/writer.js +100 -0
  26. package/dist/src/benchmark/golden-tasks.d.ts +9 -0
  27. package/dist/src/benchmark/golden-tasks.js +476 -0
  28. package/dist/src/benchmark/reporter.d.ts +5 -0
  29. package/dist/src/benchmark/reporter.js +107 -0
  30. package/dist/src/benchmark/runner.d.ts +30 -0
  31. package/dist/src/benchmark/runner.js +224 -0
  32. package/dist/src/benchmark/scorer.d.ts +12 -0
  33. package/dist/src/benchmark/scorer.js +124 -0
  34. package/dist/src/benchmark/types.d.ts +54 -0
  35. package/dist/src/benchmark/types.js +1 -0
  36. package/dist/src/cache/deliberation-cache.d.ts +49 -0
  37. package/dist/src/cache/deliberation-cache.js +127 -0
  38. package/dist/src/cli/commands/config-cmd.d.ts +11 -0
  39. package/dist/src/cli/commands/config-cmd.js +190 -0
  40. package/dist/src/cli/commands/demo.d.ts +12 -0
  41. package/dist/src/cli/commands/demo.js +66 -0
  42. package/dist/src/cli/commands/setup.d.ts +7 -0
  43. package/dist/src/cli/commands/setup.js +182 -0
  44. package/dist/src/cli/i18n.d.ts +89 -0
  45. package/dist/src/cli/i18n.js +176 -0
  46. package/dist/src/cli/interactive-select.d.ts +27 -0
  47. package/dist/src/cli/interactive-select.js +130 -0
  48. package/dist/src/cli/tui-setup.d.ts +24 -0
  49. package/dist/src/cli/tui-setup.js +42 -0
  50. package/dist/src/config/cli-detector.d.ts +37 -0
  51. package/dist/src/config/cli-detector.js +99 -0
  52. package/dist/src/config/user-config.d.ts +81 -0
  53. package/dist/src/config/user-config.js +134 -0
  54. package/dist/src/context/auto-collector.d.ts +43 -0
  55. package/dist/src/context/auto-collector.js +337 -0
  56. package/dist/src/context/manager.d.ts +35 -0
  57. package/dist/src/context/manager.js +162 -0
  58. package/dist/src/context/serializer.d.ts +20 -0
  59. package/dist/src/context/serializer.js +52 -0
  60. package/dist/src/demo/recorded-deliberation.d.ts +13 -0
  61. package/dist/src/demo/recorded-deliberation.js +277 -0
  62. package/dist/src/engine/angel-detector.d.ts +83 -0
  63. package/dist/src/engine/angel-detector.js +334 -0
  64. package/dist/src/engine/at-field.d.ts +40 -0
  65. package/dist/src/engine/at-field.js +195 -0
  66. package/dist/src/engine/berserk-orchestrator.d.ts +66 -0
  67. package/dist/src/engine/berserk-orchestrator.js +378 -0
  68. package/dist/src/engine/change-metrics.d.ts +56 -0
  69. package/dist/src/engine/change-metrics.js +214 -0
  70. package/dist/src/engine/consensus.d.ts +20 -0
  71. package/dist/src/engine/consensus.js +146 -0
  72. package/dist/src/engine/dead-sea-scrolls.d.ts +132 -0
  73. package/dist/src/engine/dead-sea-scrolls.js +610 -0
  74. package/dist/src/engine/drift-detector.d.ts +39 -0
  75. package/dist/src/engine/drift-detector.js +225 -0
  76. package/dist/src/engine/dummy-plug.d.ts +44 -0
  77. package/dist/src/engine/dummy-plug.js +190 -0
  78. package/dist/src/engine/engram-manager.d.ts +55 -0
  79. package/dist/src/engine/engram-manager.js +306 -0
  80. package/dist/src/engine/events.d.ts +130 -0
  81. package/dist/src/engine/events.js +44 -0
  82. package/dist/src/engine/gospel.d.ts +30 -0
  83. package/dist/src/engine/gospel.js +129 -0
  84. package/dist/src/engine/hallucination-detector.d.ts +33 -0
  85. package/dist/src/engine/hallucination-detector.js +215 -0
  86. package/dist/src/engine/human-resolver.d.ts +19 -0
  87. package/dist/src/engine/human-resolver.js +89 -0
  88. package/dist/src/engine/instrumentality.d.ts +64 -0
  89. package/dist/src/engine/instrumentality.js +297 -0
  90. package/dist/src/engine/iruel-battle.d.ts +79 -0
  91. package/dist/src/engine/iruel-battle.js +319 -0
  92. package/dist/src/engine/kernel/deliberation-kernel.d.ts +12 -0
  93. package/dist/src/engine/kernel/deliberation-kernel.js +303 -0
  94. package/dist/src/engine/kernel/index.d.ts +8 -0
  95. package/dist/src/engine/kernel/index.js +7 -0
  96. package/dist/src/engine/kernel/phase-runner.d.ts +10 -0
  97. package/dist/src/engine/kernel/phase-runner.js +155 -0
  98. package/dist/src/engine/kernel/post-processor.d.ts +17 -0
  99. package/dist/src/engine/kernel/post-processor.js +131 -0
  100. package/dist/src/engine/kernel/types.d.ts +107 -0
  101. package/dist/src/engine/kernel/types.js +1 -0
  102. package/dist/src/engine/kernel/unit-executor.d.ts +6 -0
  103. package/dist/src/engine/kernel/unit-executor.js +132 -0
  104. package/dist/src/engine/lcl-manager.d.ts +44 -0
  105. package/dist/src/engine/lcl-manager.js +143 -0
  106. package/dist/src/engine/middleware/cache.d.ts +7 -0
  107. package/dist/src/engine/middleware/cache.js +29 -0
  108. package/dist/src/engine/middleware/chain.d.ts +18 -0
  109. package/dist/src/engine/middleware/chain.js +45 -0
  110. package/dist/src/engine/middleware/firewall.d.ts +8 -0
  111. package/dist/src/engine/middleware/firewall.js +24 -0
  112. package/dist/src/engine/middleware/index.d.ts +4 -0
  113. package/dist/src/engine/middleware/index.js +3 -0
  114. package/dist/src/engine/middleware/types.d.ts +43 -0
  115. package/dist/src/engine/middleware/types.js +1 -0
  116. package/dist/src/engine/nebuchadnezzar-key.d.ts +61 -0
  117. package/dist/src/engine/nebuchadnezzar-key.js +203 -0
  118. package/dist/src/engine/neon-genesis.d.ts +52 -0
  119. package/dist/src/engine/neon-genesis.js +203 -0
  120. package/dist/src/engine/objective-judge.d.ts +53 -0
  121. package/dist/src/engine/objective-judge.js +214 -0
  122. package/dist/src/engine/offline-mode.d.ts +18 -0
  123. package/dist/src/engine/offline-mode.js +46 -0
  124. package/dist/src/engine/orchestrator.d.ts +79 -0
  125. package/dist/src/engine/orchestrator.js +58 -0
  126. package/dist/src/engine/secret-cipher.d.ts +26 -0
  127. package/dist/src/engine/secret-cipher.js +114 -0
  128. package/dist/src/engine/seele-council.d.ts +90 -0
  129. package/dist/src/engine/seele-council.js +482 -0
  130. package/dist/src/engine/self-destruct.d.ts +61 -0
  131. package/dist/src/engine/self-destruct.js +231 -0
  132. package/dist/src/engine/self-evolution.d.ts +64 -0
  133. package/dist/src/engine/self-evolution.js +368 -0
  134. package/dist/src/engine/sync-rate.d.ts +45 -0
  135. package/dist/src/engine/sync-rate.js +151 -0
  136. package/dist/src/engine/type666-firewall.d.ts +76 -0
  137. package/dist/src/engine/type666-firewall.js +343 -0
  138. package/dist/src/engine/umbilical-cable.d.ts +41 -0
  139. package/dist/src/engine/umbilical-cable.js +192 -0
  140. package/dist/src/index.d.ts +106 -0
  141. package/dist/src/index.js +426 -0
  142. package/dist/src/mcp/server.d.ts +38 -0
  143. package/dist/src/mcp/server.js +196 -0
  144. package/dist/src/metrics/token-tracker.d.ts +38 -0
  145. package/dist/src/metrics/token-tracker.js +112 -0
  146. package/dist/src/parsers/json-extractor.d.ts +9 -0
  147. package/dist/src/parsers/json-extractor.js +239 -0
  148. package/dist/src/parsers/opinion-schema.d.ts +81 -0
  149. package/dist/src/parsers/opinion-schema.js +147 -0
  150. package/dist/src/parsers/unstructured-parser.d.ts +20 -0
  151. package/dist/src/parsers/unstructured-parser.js +122 -0
  152. package/dist/src/pipelines/architecture.d.ts +10 -0
  153. package/dist/src/pipelines/architecture.js +9 -0
  154. package/dist/src/pipelines/bug-analysis.d.ts +9 -0
  155. package/dist/src/pipelines/bug-analysis.js +8 -0
  156. package/dist/src/pipelines/code-review.d.ts +10 -0
  157. package/dist/src/pipelines/code-review.js +30 -0
  158. package/dist/src/pipelines/custom.d.ts +14 -0
  159. package/dist/src/pipelines/custom.js +29 -0
  160. package/dist/src/pipelines/registry.d.ts +9 -0
  161. package/dist/src/pipelines/registry.js +20 -0
  162. package/dist/src/prompts/personas.d.ts +6 -0
  163. package/dist/src/prompts/personas.js +44 -0
  164. package/dist/src/prompts/schemas.d.ts +4 -0
  165. package/dist/src/prompts/schemas.js +24 -0
  166. package/dist/src/prompts/templates.d.ts +6 -0
  167. package/dist/src/prompts/templates.js +91 -0
  168. package/dist/src/repl/accessibility.d.ts +23 -0
  169. package/dist/src/repl/accessibility.js +46 -0
  170. package/dist/src/repl/banner.d.ts +4 -0
  171. package/dist/src/repl/banner.js +28 -0
  172. package/dist/src/repl/boot-animation.d.ts +13 -0
  173. package/dist/src/repl/boot-animation.js +143 -0
  174. package/dist/src/repl/completer.d.ts +21 -0
  175. package/dist/src/repl/completer.js +168 -0
  176. package/dist/src/repl/context.d.ts +24 -0
  177. package/dist/src/repl/context.js +42 -0
  178. package/dist/src/repl/display-utils.d.ts +13 -0
  179. package/dist/src/repl/display-utils.js +65 -0
  180. package/dist/src/repl/event-listener.d.ts +18 -0
  181. package/dist/src/repl/event-listener.js +112 -0
  182. package/dist/src/repl/export-formatter.d.ts +8 -0
  183. package/dist/src/repl/export-formatter.js +73 -0
  184. package/dist/src/repl/ghost-text.d.ts +31 -0
  185. package/dist/src/repl/ghost-text.js +119 -0
  186. package/dist/src/repl/handoff-animation.d.ts +15 -0
  187. package/dist/src/repl/handoff-animation.js +65 -0
  188. package/dist/src/repl/history.d.ts +16 -0
  189. package/dist/src/repl/history.js +130 -0
  190. package/dist/src/repl/job-registry.d.ts +26 -0
  191. package/dist/src/repl/job-registry.js +80 -0
  192. package/dist/src/repl/magi-repl.d.ts +72 -0
  193. package/dist/src/repl/magi-repl.js +1008 -0
  194. package/dist/src/repl/multiline-input.d.ts +45 -0
  195. package/dist/src/repl/multiline-input.js +78 -0
  196. package/dist/src/repl/prompt-builder.d.ts +19 -0
  197. package/dist/src/repl/prompt-builder.js +36 -0
  198. package/dist/src/repl/repl-state.d.ts +5 -0
  199. package/dist/src/repl/repl-state.js +19 -0
  200. package/dist/src/repl/result-display.d.ts +8 -0
  201. package/dist/src/repl/result-display.js +195 -0
  202. package/dist/src/repl/session-stats.d.ts +26 -0
  203. package/dist/src/repl/session-stats.js +119 -0
  204. package/dist/src/repl/slash-commands.d.ts +60 -0
  205. package/dist/src/repl/slash-commands.js +725 -0
  206. package/dist/src/repl/terminal-sanitize.d.ts +14 -0
  207. package/dist/src/repl/terminal-sanitize.js +19 -0
  208. package/dist/src/reporters/console.d.ts +7 -0
  209. package/dist/src/reporters/console.js +78 -0
  210. package/dist/src/reporters/json.d.ts +2 -0
  211. package/dist/src/reporters/json.js +3 -0
  212. package/dist/src/reporters/markdown.d.ts +2 -0
  213. package/dist/src/reporters/markdown.js +65 -0
  214. package/dist/src/reporters/streaming.d.ts +20 -0
  215. package/dist/src/reporters/streaming.js +178 -0
  216. package/dist/src/tui/activity-log.d.ts +23 -0
  217. package/dist/src/tui/activity-log.js +67 -0
  218. package/dist/src/tui/animations.d.ts +39 -0
  219. package/dist/src/tui/animations.js +167 -0
  220. package/dist/src/tui/ansi.d.ts +28 -0
  221. package/dist/src/tui/ansi.js +51 -0
  222. package/dist/src/tui/boot-sequence.d.ts +11 -0
  223. package/dist/src/tui/boot-sequence.js +98 -0
  224. package/dist/src/tui/colors.d.ts +101 -0
  225. package/dist/src/tui/colors.js +71 -0
  226. package/dist/src/tui/header.d.ts +24 -0
  227. package/dist/src/tui/header.js +122 -0
  228. package/dist/src/tui/index.d.ts +3 -0
  229. package/dist/src/tui/index.js +3 -0
  230. package/dist/src/tui/keypress.d.ts +25 -0
  231. package/dist/src/tui/keypress.js +95 -0
  232. package/dist/src/tui/layout.d.ts +74 -0
  233. package/dist/src/tui/layout.js +171 -0
  234. package/dist/src/tui/magi-tui.d.ts +101 -0
  235. package/dist/src/tui/magi-tui.js +754 -0
  236. package/dist/src/tui/panel.d.ts +45 -0
  237. package/dist/src/tui/panel.js +292 -0
  238. package/dist/src/tui/screen-buffer.d.ts +54 -0
  239. package/dist/src/tui/screen-buffer.js +262 -0
  240. package/dist/src/tui/status-bar.d.ts +25 -0
  241. package/dist/src/tui/status-bar.js +124 -0
  242. package/dist/src/tui/terminal-detect.d.ts +26 -0
  243. package/dist/src/tui/terminal-detect.js +44 -0
  244. package/dist/src/tui/tui-helpers.d.ts +12 -0
  245. package/dist/src/tui/tui-helpers.js +37 -0
  246. package/dist/src/types/adapter.d.ts +75 -0
  247. package/dist/src/types/adapter.js +36 -0
  248. package/dist/src/types/config.d.ts +108 -0
  249. package/dist/src/types/config.js +85 -0
  250. package/dist/src/types/consensus.d.ts +55 -0
  251. package/dist/src/types/consensus.js +17 -0
  252. package/dist/src/types/core.d.ts +178 -0
  253. package/dist/src/types/core.js +85 -0
  254. package/dist/src/types/magi-api.d.ts +62 -0
  255. package/dist/src/types/magi-api.js +7 -0
  256. package/dist/src/types/phase-h.d.ts +142 -0
  257. package/dist/src/types/phase-h.js +7 -0
  258. package/dist/src/types/phase-i.d.ts +186 -0
  259. package/dist/src/types/phase-i.js +6 -0
  260. package/dist/src/types/phase-k.d.ts +259 -0
  261. package/dist/src/types/phase-k.js +6 -0
  262. package/dist/src/types/phase-l.d.ts +199 -0
  263. package/dist/src/types/phase-l.js +6 -0
  264. package/dist/src/types/pipeline.d.ts +37 -0
  265. package/dist/src/types/pipeline.js +2 -0
  266. package/dist/src/utils/abstain-factory.d.ts +2 -0
  267. package/dist/src/utils/abstain-factory.js +18 -0
  268. package/dist/src/utils/errors.d.ts +34 -0
  269. package/dist/src/utils/errors.js +59 -0
  270. package/dist/src/utils/file-validator.d.ts +50 -0
  271. package/dist/src/utils/file-validator.js +124 -0
  272. package/dist/src/utils/fire-and-forget.d.ts +5 -0
  273. package/dist/src/utils/fire-and-forget.js +10 -0
  274. package/dist/src/utils/flag-validator.d.ts +21 -0
  275. package/dist/src/utils/flag-validator.js +79 -0
  276. package/dist/src/utils/freeze.d.ts +8 -0
  277. package/dist/src/utils/freeze.js +16 -0
  278. package/dist/src/utils/language-detector.d.ts +16 -0
  279. package/dist/src/utils/language-detector.js +159 -0
  280. package/dist/src/utils/latency-tracker.d.ts +45 -0
  281. package/dist/src/utils/latency-tracker.js +100 -0
  282. package/dist/src/utils/logger.d.ts +33 -0
  283. package/dist/src/utils/logger.js +112 -0
  284. package/dist/src/utils/process.d.ts +40 -0
  285. package/dist/src/utils/process.js +253 -0
  286. package/dist/src/utils/retry.d.ts +12 -0
  287. package/dist/src/utils/retry.js +30 -0
  288. package/dist/src/utils/safe-fs.d.ts +38 -0
  289. package/dist/src/utils/safe-fs.js +56 -0
  290. package/dist/src/utils/safe-json-parse.d.ts +15 -0
  291. package/dist/src/utils/safe-json-parse.js +49 -0
  292. package/dist/src/utils/sanitize.d.ts +14 -0
  293. package/dist/src/utils/sanitize.js +186 -0
  294. package/dist/src/utils/semaphore.d.ts +22 -0
  295. package/dist/src/utils/semaphore.js +57 -0
  296. package/dist/src/utils/shutdown.d.ts +6 -0
  297. package/dist/src/utils/shutdown.js +51 -0
  298. package/dist/src/utils/tty.d.ts +5 -0
  299. package/dist/src/utils/tty.js +7 -0
  300. package/package.json +82 -0
@@ -0,0 +1,122 @@
1
+ const VOTE_PATTERNS = [
2
+ // --- Negation + approve → REJECT (core bug fix) ---
3
+ { id: 'N1', regex: /\b(?:don'?t|do\s+not|cannot|can'?t|won'?t|will\s+not|would\s+not|wouldn'?t|never)\s+approve\b/i, weight: 3.0, target: 'REJECT' },
4
+ { id: 'N2', regex: /\bnot\s+approved?\b/i, weight: 3.0, target: 'REJECT' },
5
+ { id: 'N3', regex: /\bdisapprov(?:e[ds]?|al|ing)\b/i, weight: 2.5, target: 'REJECT' },
6
+ { id: 'N4', regex: /\bunapproved?\b/i, weight: 2.0, target: 'REJECT' },
7
+ // --- Negation + reject → APPROVE ---
8
+ { id: 'N5', regex: /\b(?:don'?t|do\s+not|cannot|can'?t|won'?t|will\s+not|would\s+not|wouldn'?t|never)\s+reject\b/i, weight: 3.0, target: 'APPROVE' },
9
+ { id: 'N6', regex: /\bnot\s+rejected?\b/i, weight: 2.5, target: 'APPROVE' },
10
+ // --- Instruction echo guard ---
11
+ { id: 'G1', regex: /\b(?:APPROVE|REJECT|ABSTAIN)\s*(?:\/|\sor\s)\s*(?:APPROVE|REJECT|ABSTAIN)\b/i, weight: 0.0, target: null },
12
+ // --- Explicit vote (highest priority) ---
13
+ { id: 'E1', regex: /\bmy\s+vote\s*(?:is\s*:?\s*|:\s*)approve\b/i, weight: 4.0, target: 'APPROVE' },
14
+ { id: 'E2', regex: /\bmy\s+vote\s*(?:is\s*:?\s*|:\s*)reject\b/i, weight: 4.0, target: 'REJECT' },
15
+ { id: 'E3', regex: /\bmy\s+vote\s*(?:is\s*:?\s*|:\s*)abstain\b/i, weight: 4.0, target: 'ABSTAIN' },
16
+ { id: 'E4', regex: /\bvote\s*:\s*approve\b/i, weight: 3.5, target: 'APPROVE' },
17
+ { id: 'E5', regex: /\bvote\s*:\s*reject\b/i, weight: 3.5, target: 'REJECT' },
18
+ { id: 'E6', regex: /\bvote\s*:\s*abstain\b/i, weight: 3.5, target: 'ABSTAIN' },
19
+ // --- Emphasis ---
20
+ { id: 'S1', regex: /\bstrongly\s+approve\b/i, weight: 3.0, target: 'APPROVE' },
21
+ { id: 'S2', regex: /\bstrongly\s+reject\b/i, weight: 3.0, target: 'REJECT' },
22
+ // --- Standard keywords ---
23
+ { id: 'K1', regex: /\bapprove[ds]?\b/i, weight: 1.5, target: 'APPROVE' },
24
+ { id: 'K2', regex: /\breject(?:ed|s|ing)?\b/i, weight: 1.5, target: 'REJECT' },
25
+ { id: 'K3', regex: /\babstain(?:ed|s|ing)?\b/i, weight: 2.0, target: 'ABSTAIN' },
26
+ // --- Informal expressions ---
27
+ { id: 'I1', regex: /\bLGTM\b/, weight: 2.0, target: 'APPROVE' },
28
+ { id: 'I2', regex: /\bship\s+it\b/i, weight: 1.5, target: 'APPROVE' },
29
+ { id: 'I3', regex: /\bneeds?\s+(?:major\s+)?(?:changes?|rework|revision)\b/i, weight: 1.5, target: 'REJECT' },
30
+ { id: 'I4', regex: /\bdo\s+not\s+(?:merge|ship|deploy)\b/i, weight: 2.0, target: 'REJECT' },
31
+ { id: 'I5', regex: /\bneed\s+more\s+(?:info|information|context|discussion)\b/i, weight: 1.5, target: 'ABSTAIN' },
32
+ ];
33
+ const CONFIDENCE_PATTERNS = [
34
+ { id: 'C1', regex: /\bconfidence\s*[:=]\s*(0(?:\.\d+)?|1(?:\.0+)?)\b/i, extract: (m) => parseFloat(m[1]) },
35
+ { id: 'C2', regex: /\b(\d{1,3})%\s*confident\b/i, extract: (m) => parseInt(m[1], 10) / 100 },
36
+ { id: 'C3', regex: /\bconfidence\s*[:=]?\s*(\d{1,3})%/i, extract: (m) => parseInt(m[1], 10) / 100 },
37
+ { id: 'C4', regex: /\b(?:very|highly|extremely)\s+confident\b/i, extract: () => 0.9 },
38
+ { id: 'C5', regex: /\b(?:fairly|reasonably|quite)\s+confident\b/i, extract: () => 0.7 },
39
+ { id: 'C6', regex: /\b(?:somewhat|moderately)\s+confident\b/i, extract: () => 0.5 },
40
+ { id: 'C7', regex: /\bnot\s+(?:very\s+)?confident\b/i, extract: () => 0.25 },
41
+ ];
42
+ // ============================================================
43
+ // Scoring engine
44
+ // ============================================================
45
+ export function scoreText(raw) {
46
+ let approveScore = 0;
47
+ let rejectScore = 0;
48
+ let abstainScore = 0;
49
+ const matchedPatterns = [];
50
+ // Evaluate all 22 patterns (each counts once)
51
+ for (const pattern of VOTE_PATTERNS) {
52
+ if (pattern.regex.test(raw)) {
53
+ matchedPatterns.push(pattern.id);
54
+ if (pattern.target === 'APPROVE')
55
+ approveScore += pattern.weight;
56
+ else if (pattern.target === 'REJECT')
57
+ rejectScore += pattern.weight;
58
+ else if (pattern.target === 'ABSTAIN')
59
+ abstainScore += pattern.weight;
60
+ // target === null (G1): record only, no score
61
+ }
62
+ }
63
+ // Determine vote
64
+ const maxScore = Math.max(approveScore, rejectScore, abstainScore);
65
+ let vote;
66
+ if (maxScore === 0) {
67
+ vote = 'ABSTAIN';
68
+ }
69
+ else {
70
+ const atMax = [
71
+ approveScore === maxScore,
72
+ rejectScore === maxScore,
73
+ abstainScore === maxScore,
74
+ ].filter(Boolean).length;
75
+ if (atMax > 1) {
76
+ vote = 'ABSTAIN'; // tie → safe side
77
+ }
78
+ else if (approveScore === maxScore) {
79
+ vote = 'APPROVE';
80
+ }
81
+ else if (rejectScore === maxScore) {
82
+ vote = 'REJECT';
83
+ }
84
+ else {
85
+ vote = 'ABSTAIN';
86
+ }
87
+ }
88
+ // Extract confidence from text
89
+ let extractedConfidence = null;
90
+ for (const cp of CONFIDENCE_PATTERNS) {
91
+ const match = raw.match(cp.regex);
92
+ if (match) {
93
+ extractedConfidence = Math.max(0, Math.min(1, cp.extract(match)));
94
+ break; // first match wins
95
+ }
96
+ }
97
+ // Determine final confidence
98
+ let confidence;
99
+ if (extractedConfidence !== null) {
100
+ confidence = extractedConfidence;
101
+ }
102
+ else if (maxScore === 0) {
103
+ confidence = 0.1;
104
+ }
105
+ else {
106
+ const scores = [approveScore, rejectScore, abstainScore].sort((a, b) => b - a);
107
+ const scoreDiff = scores[0] - scores[1];
108
+ const scoreRatio = scoreDiff / (scores[0] + 0.001);
109
+ confidence = Math.min(0.7, 0.2 + scoreRatio * 0.5);
110
+ }
111
+ return {
112
+ vote,
113
+ confidence,
114
+ _debug: {
115
+ approveScore,
116
+ rejectScore,
117
+ abstainScore,
118
+ extractedConfidence,
119
+ matchedPatterns,
120
+ },
121
+ };
122
+ }
@@ -0,0 +1,10 @@
1
+ import { CustomPipeline } from './custom.js';
2
+ import type { TaskType } from '../types/core.js';
3
+ /**
4
+ * Architecture Decision pipeline.
5
+ * Inherits from CustomPipeline with adjusted defaults.
6
+ */
7
+ export declare class ArchitecturePipeline extends CustomPipeline {
8
+ readonly taskType: TaskType;
9
+ readonly name = "Architecture Decision";
10
+ }
@@ -0,0 +1,9 @@
1
+ import { CustomPipeline } from './custom.js';
2
+ /**
3
+ * Architecture Decision pipeline.
4
+ * Inherits from CustomPipeline with adjusted defaults.
5
+ */
6
+ export class ArchitecturePipeline extends CustomPipeline {
7
+ taskType = 'architecture-decision';
8
+ name = 'Architecture Decision';
9
+ }
@@ -0,0 +1,9 @@
1
+ import { CustomPipeline } from './custom.js';
2
+ import type { TaskType } from '../types/core.js';
3
+ /**
4
+ * Bug Analysis pipeline.
5
+ */
6
+ export declare class BugAnalysisPipeline extends CustomPipeline {
7
+ readonly taskType: TaskType;
8
+ readonly name = "Bug Analysis";
9
+ }
@@ -0,0 +1,8 @@
1
+ import { CustomPipeline } from './custom.js';
2
+ /**
3
+ * Bug Analysis pipeline.
4
+ */
5
+ export class BugAnalysisPipeline extends CustomPipeline {
6
+ taskType = 'bug-analysis';
7
+ name = 'Bug Analysis';
8
+ }
@@ -0,0 +1,10 @@
1
+ import type { IPipeline, PipelineConfig } from '../types/pipeline.js';
2
+ import type { MagiTask, MagiOpinion, DeliberationPhase, MagiUnit } from '../types/core.js';
3
+ export declare class CodeReviewPipeline implements IPipeline {
4
+ readonly taskType: "code-review";
5
+ readonly name = "Code Review";
6
+ readonly defaultConfig: PipelineConfig;
7
+ buildSystemPrompt(_task: MagiTask, _unit: MagiUnit, _phase: DeliberationPhase): string;
8
+ buildUserPrompt(_task: MagiTask, _phase: DeliberationPhase, _previousOpinions?: MagiOpinion[]): string;
9
+ parseOpinion(raw: string, structured: Record<string, unknown> | null, unit: MagiUnit, _phase: DeliberationPhase): Omit<MagiOpinion, 'rawOutput' | 'meta'>;
10
+ }
@@ -0,0 +1,30 @@
1
+ import { parseOpinionFromResponse } from '../parsers/opinion-schema.js';
2
+ export class CodeReviewPipeline {
3
+ taskType = 'code-review';
4
+ name = 'Code Review';
5
+ defaultConfig = {
6
+ phases: ['initial-opinion', 'cross-examination', 'final-vote'],
7
+ maxRounds: 3,
8
+ parallelInitialOpinions: true,
9
+ earlyConsensusExit: true,
10
+ earlyExitThresholds: { unanimous: 0.6, majority: 0.8 },
11
+ consensus: {
12
+ minConfidenceThreshold: 0.3,
13
+ useWeightedVoting: false,
14
+ deadlockStrategy: 'melchior-tiebreak',
15
+ quorum: 2,
16
+ },
17
+ phaseTimeoutMs: 300_000,
18
+ adapterTimeoutMs: 120_000,
19
+ deliberationTimeoutMs: 1_800_000,
20
+ };
21
+ buildSystemPrompt(_task, _unit, _phase) {
22
+ return '';
23
+ }
24
+ buildUserPrompt(_task, _phase, _previousOpinions) {
25
+ return '';
26
+ }
27
+ parseOpinion(raw, structured, unit, _phase) {
28
+ return parseOpinionFromResponse(raw, structured, unit);
29
+ }
30
+ }
@@ -0,0 +1,14 @@
1
+ import type { IPipeline, PipelineConfig } from '../types/pipeline.js';
2
+ import type { MagiOpinion, DeliberationPhase, MagiUnit, TaskType } from '../types/core.js';
3
+ /**
4
+ * Generic pipeline for custom deliberation tasks.
5
+ * Works for any task type that doesn't have a specialized pipeline.
6
+ */
7
+ export declare class CustomPipeline implements IPipeline {
8
+ readonly taskType: TaskType;
9
+ readonly name: string;
10
+ readonly defaultConfig: PipelineConfig;
11
+ buildSystemPrompt(): string;
12
+ buildUserPrompt(): string;
13
+ parseOpinion(raw: string, structured: Record<string, unknown> | null, unit: MagiUnit, _phase: DeliberationPhase): Omit<MagiOpinion, 'rawOutput' | 'meta'>;
14
+ }
@@ -0,0 +1,29 @@
1
+ import { parseOpinionFromResponse } from '../parsers/opinion-schema.js';
2
+ /**
3
+ * Generic pipeline for custom deliberation tasks.
4
+ * Works for any task type that doesn't have a specialized pipeline.
5
+ */
6
+ export class CustomPipeline {
7
+ taskType = 'custom';
8
+ name = 'Custom Deliberation';
9
+ defaultConfig = {
10
+ phases: ['initial-opinion', 'cross-examination', 'final-vote'],
11
+ maxRounds: 3,
12
+ parallelInitialOpinions: true,
13
+ earlyConsensusExit: true,
14
+ consensus: {
15
+ minConfidenceThreshold: 0.3,
16
+ useWeightedVoting: false,
17
+ deadlockStrategy: 'melchior-tiebreak',
18
+ quorum: 2,
19
+ },
20
+ phaseTimeoutMs: 300_000,
21
+ adapterTimeoutMs: 120_000,
22
+ deliberationTimeoutMs: 1_800_000,
23
+ };
24
+ buildSystemPrompt() { return ''; }
25
+ buildUserPrompt() { return ''; }
26
+ parseOpinion(raw, structured, unit, _phase) {
27
+ return parseOpinionFromResponse(raw, structured, unit);
28
+ }
29
+ }
@@ -0,0 +1,9 @@
1
+ import type { IPipeline } from '../types/pipeline.js';
2
+ import type { TaskType } from '../types/core.js';
3
+ export declare class PipelineRegistry {
4
+ private pipelines;
5
+ register(pipeline: IPipeline): void;
6
+ get(taskType: TaskType): IPipeline;
7
+ has(taskType: TaskType): boolean;
8
+ listTypes(): TaskType[];
9
+ }
@@ -0,0 +1,20 @@
1
+ import { PipelineNotFoundError } from '../utils/errors.js';
2
+ export class PipelineRegistry {
3
+ pipelines = new Map();
4
+ register(pipeline) {
5
+ this.pipelines.set(pipeline.taskType, pipeline);
6
+ }
7
+ get(taskType) {
8
+ const pipeline = this.pipelines.get(taskType);
9
+ if (!pipeline) {
10
+ throw new PipelineNotFoundError(taskType);
11
+ }
12
+ return pipeline;
13
+ }
14
+ has(taskType) {
15
+ return this.pipelines.has(taskType);
16
+ }
17
+ listTypes() {
18
+ return Array.from(this.pipelines.keys());
19
+ }
20
+ }
@@ -0,0 +1,6 @@
1
+ import type { MagiUnit, DeliberationPhase, MagiUnitDefinition } from '../types/core.js';
2
+ /**
3
+ * Build the system prompt (persona) for a MAGI unit.
4
+ * Supports both built-in units and custom N-body units.
5
+ */
6
+ export declare function buildPersonaPrompt(unit: MagiUnit, phase: DeliberationPhase, definition?: MagiUnitDefinition): string;
@@ -0,0 +1,44 @@
1
+ import { MAGI_PERSONAS, BUILTIN_UNITS } from '../types/core.js';
2
+ function isBuiltinUnit(unit) {
3
+ return unit in BUILTIN_UNITS;
4
+ }
5
+ /**
6
+ * Build the system prompt (persona) for a MAGI unit.
7
+ * Supports both built-in units and custom N-body units.
8
+ */
9
+ export function buildPersonaPrompt(unit, phase, definition) {
10
+ let name;
11
+ let role;
12
+ let focus;
13
+ if (definition) {
14
+ name = definition.displayName;
15
+ role = definition.role;
16
+ focus = definition.focus;
17
+ }
18
+ else if (isBuiltinUnit(unit)) {
19
+ const persona = MAGI_PERSONAS[unit];
20
+ name = persona.name;
21
+ role = persona.role;
22
+ focus = persona.focus;
23
+ }
24
+ else {
25
+ // Generic persona for custom units
26
+ name = unit;
27
+ role = 'Analyst';
28
+ focus = 'Comprehensive analysis from your unique perspective';
29
+ }
30
+ const unitCount = 'multiple';
31
+ const base = `You are ${name}, one of ${unitCount} MAGI supercomputers deliberating on this matter.
32
+ Your role: ${role}
33
+ Your focus: ${focus}
34
+
35
+ You are part of the MAGI System, inspired by the supercomputers from Neon Genesis Evangelion.
36
+ Multiple independent AI systems analyze each problem from different angles
37
+ and reach consensus through deliberation.`;
38
+ const phaseInstructions = {
39
+ 'initial-opinion': `\n\nThis is the INITIAL OPINION phase. Form your own independent opinion without knowledge of what the other MAGI units think. Be thorough and decisive.`,
40
+ 'cross-examination': `\n\nThis is the CROSS-EXAMINATION phase. You have seen the other MAGI units' opinions. Review their reasoning critically. Identify points of agreement and disagreement. Challenge weak arguments. Acknowledge strong points you may have missed. You may update your vote if persuaded.`,
41
+ 'final-vote': `\n\nThis is the FINAL VOTE phase. You have seen all previous discussion. Cast your definitive vote with full awareness of all perspectives. Be decisive. This is your final position.`,
42
+ };
43
+ return base + phaseInstructions[phase];
44
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * JSON output instruction appended to prompts for CLIs that don't support --json-schema.
3
+ */
4
+ export declare const JSON_OUTPUT_INSTRUCTION = "\n\nYou MUST respond with ONLY a valid JSON object in the following exact format.\nNo markdown code blocks. No explanation before or after. Just pure JSON:\n\n{\n \"vote\": \"APPROVE\",\n \"confidence\": 0.72,\n \"reasoning\": \"Your detailed reasoning here\",\n \"keyPoints\": [\"Key point 1\", \"Key point 2\"],\n \"suggestions\": [\"Optional suggestion 1\"]\n}\n\nNote: \"confidence\" should reflect your genuine certainty (0.45 = uncertain, 0.72 = moderate, 0.91 = highly confident). Do not default to any single value.\n\nRules:\n- \"vote\" must be exactly one of: \"APPROVE\", \"REJECT\", \"ABSTAIN\"\n- \"confidence\" must be a number between 0.0 and 1.0\n- \"reasoning\" must be a detailed string explaining your vote\n- \"keyPoints\" must be an array of strings\n- \"suggestions\" is optional, array of strings";
@@ -0,0 +1,24 @@
1
+ /**
2
+ * JSON output instruction appended to prompts for CLIs that don't support --json-schema.
3
+ */
4
+ export const JSON_OUTPUT_INSTRUCTION = `
5
+
6
+ You MUST respond with ONLY a valid JSON object in the following exact format.
7
+ No markdown code blocks. No explanation before or after. Just pure JSON:
8
+
9
+ {
10
+ "vote": "APPROVE",
11
+ "confidence": 0.72,
12
+ "reasoning": "Your detailed reasoning here",
13
+ "keyPoints": ["Key point 1", "Key point 2"],
14
+ "suggestions": ["Optional suggestion 1"]
15
+ }
16
+
17
+ Note: "confidence" should reflect your genuine certainty (0.45 = uncertain, 0.72 = moderate, 0.91 = highly confident). Do not default to any single value.
18
+
19
+ Rules:
20
+ - "vote" must be exactly one of: "APPROVE", "REJECT", "ABSTAIN"
21
+ - "confidence" must be a number between 0.0 and 1.0
22
+ - "reasoning" must be a detailed string explaining your vote
23
+ - "keyPoints" must be an array of strings
24
+ - "suggestions" is optional, array of strings`;
@@ -0,0 +1,6 @@
1
+ import type { MagiTask, MagiOpinion, DeliberationPhase, MagiUnit } from '../types/core.js';
2
+ import type { DeliberationRound } from '../types/core.js';
3
+ /**
4
+ * Build the user prompt for a specific deliberation phase.
5
+ */
6
+ export declare function buildUserPrompt(task: MagiTask, _unit: MagiUnit, phase: DeliberationPhase, previousRounds: DeliberationRound[], otherOpinions?: MagiOpinion[], objectiveSummary?: string): string;
@@ -0,0 +1,91 @@
1
+ import { serializeOpinionCompact, serializeRoundsCompact } from '../context/serializer.js';
2
+ import { quoteForEmbedding } from '../utils/sanitize.js';
3
+ /**
4
+ * Build the user prompt for a specific deliberation phase.
5
+ */
6
+ export function buildUserPrompt(task, _unit, phase, previousRounds, otherOpinions, objectiveSummary) {
7
+ const artifactsSection = buildArtifactsSection(task);
8
+ switch (phase) {
9
+ case 'initial-opinion':
10
+ return buildInitialOpinionPrompt(task, artifactsSection);
11
+ case 'cross-examination':
12
+ return buildCrossExaminationPrompt(task, artifactsSection, otherOpinions ?? [], objectiveSummary);
13
+ case 'final-vote':
14
+ return buildFinalVotePrompt(task, previousRounds, objectiveSummary);
15
+ }
16
+ }
17
+ function buildInitialOpinionPrompt(task, artifacts) {
18
+ return `## Task: ${task.title}
19
+ Type: ${task.type}
20
+
21
+ ## Description
22
+ ${task.description}
23
+ ${artifacts}
24
+ ${task.context ? `\n## Additional Context\n${task.context}` : ''}
25
+
26
+ ## Instructions
27
+ Analyze this ${task.type} independently. Form your own opinion.
28
+ Provide your vote (APPROVE/REJECT/ABSTAIN), confidence level, detailed reasoning, and key points.`;
29
+ }
30
+ function buildCrossExaminationPrompt(task, artifacts, otherOpinions, objectiveSummary) {
31
+ const othersText = otherOpinions
32
+ .map((o) => {
33
+ const serialized = serializeOpinionCompact(o);
34
+ return quoteForEmbedding(serialized, `${o.unit} Opinion`);
35
+ })
36
+ .join('\n\n');
37
+ const objectiveSection = objectiveSummary
38
+ ? `\n## Objective Analysis Results\n${objectiveSummary}\n`
39
+ : '';
40
+ return `## Task: ${task.title}
41
+ Type: ${task.type}
42
+
43
+ ## Description
44
+ ${task.description}
45
+ ${artifacts}
46
+
47
+ ## Other MAGI Units' Opinions
48
+
49
+ ${othersText}
50
+ ${objectiveSection}
51
+ ## Instructions
52
+ Review the other units' opinions critically. Your role is to stress-test their reasoning.
53
+
54
+ REQUIRED:
55
+ 1. For EACH other unit's opinion, identify at least ONE specific weakness, unstated assumption, or missing consideration
56
+ 2. Evaluate whether their key points are supported by evidence or merely asserted
57
+ 3. If you agree with their conclusion, provide your OWN independent reasoning — do not simply defer
58
+ 4. If any unit voted differently from you, engage directly with their strongest argument
59
+
60
+ You MAY update your vote and confidence if genuinely persuaded, but explain what specifically changed your mind.
61
+ Do NOT rubber-stamp or agree without substantive independent analysis.
62
+
63
+ Provide your updated vote, confidence, reasoning, and key points.`;
64
+ }
65
+ function buildFinalVotePrompt(task, previousRounds, objectiveSummary) {
66
+ const history = serializeRoundsCompact(previousRounds);
67
+ const objectiveSection = objectiveSummary
68
+ ? `\n## Objective Analysis Results\n${objectiveSummary}\n`
69
+ : '';
70
+ return `## Task: ${task.title}
71
+ Type: ${task.type}
72
+
73
+ ## Full Deliberation History
74
+ ${history}
75
+ ${objectiveSection}
76
+ ## Instructions
77
+ This is the FINAL VOTE. You have seen all perspectives and arguments.
78
+ Cast your definitive vote with full awareness of the deliberation.
79
+ Be decisive. This is your final position.`;
80
+ }
81
+ function buildArtifactsSection(task) {
82
+ if (!task.artifacts || task.artifacts.length === 0)
83
+ return '';
84
+ const sections = task.artifacts.map((a) => {
85
+ const label = a.label ?? a.path ?? 'Artifact';
86
+ const lang = a.language ?? '';
87
+ const content = a.content ?? '(content not provided)';
88
+ return `### ${label}\n\`\`\`${lang}\n${content}\n\`\`\``;
89
+ });
90
+ return `\n## Artifacts\n${sections.join('\n\n')}`;
91
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Accessibility utilities for MAGI REPL.
3
+ *
4
+ * Provides centralized helpers for:
5
+ * - NO_COLOR compliance (no-color.org)
6
+ * - Animation skip detection (CI, non-TTY, REDUCE_MOTION)
7
+ * - Unicode vote/decision symbols with text fallbacks
8
+ */
9
+ import type { Vote } from '../types/core.js';
10
+ import type { ConsensusDecision } from '../types/consensus.js';
11
+ /**
12
+ * Whether animations should be skipped.
13
+ * True when: non-TTY, CI, MAGI_NO_ANIMATION=1, or REDUCE_MOTION=1.
14
+ */
15
+ export declare function shouldSkipAnimation(): boolean;
16
+ /**
17
+ * Returns a symbol for a vote: ✓ APPROVE, ✗ REJECT, ― ABSTAIN.
18
+ */
19
+ export declare function voteSymbol(vote: Vote | string): string;
20
+ /**
21
+ * Returns a symbol for a consensus decision.
22
+ */
23
+ export declare function decisionSymbol(decision: ConsensusDecision | string): string;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Accessibility utilities for MAGI REPL.
3
+ *
4
+ * Provides centralized helpers for:
5
+ * - NO_COLOR compliance (no-color.org)
6
+ * - Animation skip detection (CI, non-TTY, REDUCE_MOTION)
7
+ * - Unicode vote/decision symbols with text fallbacks
8
+ */
9
+ /**
10
+ * Whether animations should be skipped.
11
+ * True when: non-TTY, CI, MAGI_NO_ANIMATION=1, or REDUCE_MOTION=1.
12
+ */
13
+ export function shouldSkipAnimation() {
14
+ if (!process.stdout.isTTY)
15
+ return true;
16
+ if (process.env.CI === 'true')
17
+ return true;
18
+ if (process.env.MAGI_NO_ANIMATION === '1')
19
+ return true;
20
+ if (process.env.REDUCE_MOTION === '1')
21
+ return true;
22
+ return false;
23
+ }
24
+ /**
25
+ * Returns a symbol for a vote: ✓ APPROVE, ✗ REJECT, ― ABSTAIN.
26
+ */
27
+ export function voteSymbol(vote) {
28
+ switch (vote) {
29
+ case 'APPROVE': return '✓';
30
+ case 'REJECT': return '✗';
31
+ case 'ABSTAIN': return '―';
32
+ default: return '?';
33
+ }
34
+ }
35
+ /**
36
+ * Returns a symbol for a consensus decision.
37
+ */
38
+ export function decisionSymbol(decision) {
39
+ if (decision.endsWith('_APPROVE'))
40
+ return '✓';
41
+ if (decision.endsWith('_REJECT'))
42
+ return '✗';
43
+ if (decision === 'DEADLOCK' || decision === 'INSUFFICIENT')
44
+ return '⚠';
45
+ return '?';
46
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * NERV-themed welcome banner for MAGI REPL.
3
+ */
4
+ export declare function printBanner(): void;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * NERV-themed welcome banner for MAGI REPL.
3
+ */
4
+ import chalk from 'chalk';
5
+ import { EVA_PALETTE } from '../tui/colors.js';
6
+ import { centerVisible, frameLines, getResponsiveBoxWidth, truncateVisible, wrapDisplayText } from './display-utils.js';
7
+ const { frame, textPrimary, abstain } = EVA_PALETTE;
8
+ const FRAME = chalk.rgb(frame.r, frame.g, frame.b);
9
+ const TEXT = chalk.rgb(textPrimary.r, textPrimary.g, textPrimary.b);
10
+ const DIM = chalk.rgb(abstain.r, abstain.g, abstain.b);
11
+ export function printBanner() {
12
+ const width = getResponsiveBoxWidth(44, 24);
13
+ const innerWidth = Math.max(1, width - 4);
14
+ const title = width >= 32 ? 'M A G I S Y S T E M' : 'MAGI SYSTEM';
15
+ const subtitle = width >= 32 ? 'Interactive Session Mode' : 'REPL READY';
16
+ const unitStatus = truncateVisible('MELCHIOR-1 / BALTHASAR-2 / CASPER-3 ONLINE', innerWidth);
17
+ const helpLines = wrapDisplayText('Type a question to deliberate. /help for commands.', innerWidth);
18
+ console.log('');
19
+ for (const line of frameLines([centerVisible(title, innerWidth), centerVisible(subtitle, innerWidth)], { width, borderColor: (text) => FRAME.bold(text) })) {
20
+ console.log(line);
21
+ }
22
+ console.log('');
23
+ console.log(TEXT(` ${unitStatus}`));
24
+ for (const line of helpLines) {
25
+ console.log(DIM(` ${line}`));
26
+ }
27
+ console.log('');
28
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * NERV-style boot animation for MAGI REPL.
3
+ *
4
+ * Displays a typewriter-style boot sequence (0.8-1.2s total).
5
+ * Skips on: non-TTY, CI, MAGI_NO_ANIMATION=1, or any keypress.
6
+ * Does NOT use alt screen — output stays in normal scrollback.
7
+ */
8
+ export interface BootAnimationOptions {
9
+ write: (s: string) => void;
10
+ skipCondition?: boolean;
11
+ delayFn?: (ms: number) => Promise<void>;
12
+ }
13
+ export declare function runReplBoot(options: BootAnimationOptions): Promise<void>;