@ai-devkit/agent-manager 0.43.0 → 0.44.1

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 (447) hide show
  1. package/dist/harnesses/pi/PiAdapter.d.ts.map +1 -1
  2. package/dist/harnesses/pi/PiAdapter.js +9 -4
  3. package/dist/harnesses/pi/PiAdapter.js.map +1 -1
  4. package/package.json +8 -3
  5. package/.swcrc +0 -27
  6. package/dist/__tests__/AgentManager.test.js +0 -1727
  7. package/dist/__tests__/AgentManager.test.js.map +0 -1
  8. package/dist/__tests__/adapters/IncrementalSessionRefresh.test.js +0 -486
  9. package/dist/__tests__/adapters/IncrementalSessionRefresh.test.js.map +0 -1
  10. package/dist/__tests__/adapters/adapterProcessImports.test.js +0 -52
  11. package/dist/__tests__/adapters/adapterProcessImports.test.js.map +0 -1
  12. package/dist/__tests__/adapters/adapterSnapshotCandidates.test.js +0 -247
  13. package/dist/__tests__/adapters/adapterSnapshotCandidates.test.js.map +0 -1
  14. package/dist/__tests__/capacity/anthropic.test.js +0 -115
  15. package/dist/__tests__/capacity/anthropic.test.js.map +0 -1
  16. package/dist/__tests__/capacity/boundaries.test.js +0 -45
  17. package/dist/__tests__/capacity/boundaries.test.js.map +0 -1
  18. package/dist/__tests__/capacity/claude.test.js +0 -485
  19. package/dist/__tests__/capacity/claude.test.js.map +0 -1
  20. package/dist/__tests__/capacity/codex.test.js +0 -339
  21. package/dist/__tests__/capacity/codex.test.js.map +0 -1
  22. package/dist/__tests__/capacity/devin.test.js +0 -239
  23. package/dist/__tests__/capacity/devin.test.js.map +0 -1
  24. package/dist/__tests__/capacity/index.test.js +0 -53
  25. package/dist/__tests__/capacity/index.test.js.map +0 -1
  26. package/dist/__tests__/capacity/openai.test.js +0 -687
  27. package/dist/__tests__/capacity/openai.test.js.map +0 -1
  28. package/dist/__tests__/capacity/wham.test.js +0 -159
  29. package/dist/__tests__/capacity/wham.test.js.map +0 -1
  30. package/dist/__tests__/capacity/zai.test.js +0 -212
  31. package/dist/__tests__/capacity/zai.test.js.map +0 -1
  32. package/dist/__tests__/fixtures.test.js +0 -218
  33. package/dist/__tests__/fixtures.test.js.map +0 -1
  34. package/dist/__tests__/harnesses/BoundedSummarySkip.test.js +0 -568
  35. package/dist/__tests__/harnesses/BoundedSummarySkip.test.js.map +0 -1
  36. package/dist/__tests__/harnesses/SessionSummaryEquivalence.test.js +0 -1089
  37. package/dist/__tests__/harnesses/SessionSummaryEquivalence.test.js.map +0 -1
  38. package/dist/__tests__/harnesses/antigravity/AntigravityCliAdapter.subprocess.test.js +0 -143
  39. package/dist/__tests__/harnesses/antigravity/AntigravityCliAdapter.subprocess.test.js.map +0 -1
  40. package/dist/__tests__/harnesses/antigravity/AntigravityCliAdapter.test.js +0 -462
  41. package/dist/__tests__/harnesses/antigravity/AntigravityCliAdapter.test.js.map +0 -1
  42. package/dist/__tests__/harnesses/builtinAdapters.test.js +0 -33
  43. package/dist/__tests__/harnesses/builtinAdapters.test.js.map +0 -1
  44. package/dist/__tests__/harnesses/claude/ClaudeAgentMapper.test.js +0 -79
  45. package/dist/__tests__/harnesses/claude/ClaudeAgentMapper.test.js.map +0 -1
  46. package/dist/__tests__/harnesses/claude/ClaudeCodeAdapter.test.js +0 -1881
  47. package/dist/__tests__/harnesses/claude/ClaudeCodeAdapter.test.js.map +0 -1
  48. package/dist/__tests__/harnesses/claude/ClaudeSessionLocator.test.js +0 -425
  49. package/dist/__tests__/harnesses/claude/ClaudeSessionLocator.test.js.map +0 -1
  50. package/dist/__tests__/harnesses/claude/ClaudeSessionParser.test.js +0 -314
  51. package/dist/__tests__/harnesses/claude/ClaudeSessionParser.test.js.map +0 -1
  52. package/dist/__tests__/harnesses/claude/durable/ClaudeCliProbe.test.js +0 -49
  53. package/dist/__tests__/harnesses/claude/durable/ClaudeCliProbe.test.js.map +0 -1
  54. package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.js +0 -76
  55. package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.js.map +0 -1
  56. package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgentService.test.js +0 -173
  57. package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgentService.test.js.map +0 -1
  58. package/dist/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.js +0 -181
  59. package/dist/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.js.map +0 -1
  60. package/dist/__tests__/harnesses/codex/CodexAdapter.test.js +0 -685
  61. package/dist/__tests__/harnesses/codex/CodexAdapter.test.js.map +0 -1
  62. package/dist/__tests__/harnesses/codex/CodexSessionLocator.test.js +0 -463
  63. package/dist/__tests__/harnesses/codex/CodexSessionLocator.test.js.map +0 -1
  64. package/dist/__tests__/harnesses/codex/CodexSessionMapping.test.js +0 -86
  65. package/dist/__tests__/harnesses/codex/CodexSessionMapping.test.js.map +0 -1
  66. package/dist/__tests__/harnesses/codex/CodexSessionParser.test.js +0 -254
  67. package/dist/__tests__/harnesses/codex/CodexSessionParser.test.js.map +0 -1
  68. package/dist/__tests__/harnesses/codex/durable/CodexCliProbe.test.js +0 -121
  69. package/dist/__tests__/harnesses/codex/durable/CodexCliProbe.test.js.map +0 -1
  70. package/dist/__tests__/harnesses/codex/durable/CodexDurableAgentRepository.test.js +0 -84
  71. package/dist/__tests__/harnesses/codex/durable/CodexDurableAgentRepository.test.js.map +0 -1
  72. package/dist/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.js +0 -128
  73. package/dist/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.js.map +0 -1
  74. package/dist/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.js +0 -246
  75. package/dist/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.js.map +0 -1
  76. package/dist/__tests__/harnesses/codex/durable/CodexPrintRunner.test.js +0 -384
  77. package/dist/__tests__/harnesses/codex/durable/CodexPrintRunner.test.js.map +0 -1
  78. package/dist/__tests__/harnesses/copilot/CopilotAdapter.test.js +0 -659
  79. package/dist/__tests__/harnesses/copilot/CopilotAdapter.test.js.map +0 -1
  80. package/dist/__tests__/harnesses/copilot/CopilotRefreshIO.test.js +0 -290
  81. package/dist/__tests__/harnesses/copilot/CopilotRefreshIO.test.js.map +0 -1
  82. package/dist/__tests__/harnesses/devin/DevinAdapter.test.js +0 -597
  83. package/dist/__tests__/harnesses/devin/DevinAdapter.test.js.map +0 -1
  84. package/dist/__tests__/harnesses/devin/DevinAgentMapper.test.js +0 -99
  85. package/dist/__tests__/harnesses/devin/DevinAgentMapper.test.js.map +0 -1
  86. package/dist/__tests__/harnesses/devin/DevinSessionLocator.test.js +0 -192
  87. package/dist/__tests__/harnesses/devin/DevinSessionLocator.test.js.map +0 -1
  88. package/dist/__tests__/harnesses/devin/DevinSessionParser.test.js +0 -407
  89. package/dist/__tests__/harnesses/devin/DevinSessionParser.test.js.map +0 -1
  90. package/dist/__tests__/harnesses/devin/fixtures.js +0 -95
  91. package/dist/__tests__/harnesses/devin/fixtures.js.map +0 -1
  92. package/dist/__tests__/harnesses/gemini/GeminiCliAdapter.test.js +0 -1454
  93. package/dist/__tests__/harnesses/gemini/GeminiCliAdapter.test.js.map +0 -1
  94. package/dist/__tests__/harnesses/gemini/GeminiSessionJsonl.test.js +0 -491
  95. package/dist/__tests__/harnesses/gemini/GeminiSessionJsonl.test.js.map +0 -1
  96. package/dist/__tests__/harnesses/gemini/GeminiSessionLocator.test.js +0 -399
  97. package/dist/__tests__/harnesses/gemini/GeminiSessionLocator.test.js.map +0 -1
  98. package/dist/__tests__/harnesses/grok/GrokAgentMapper.test.js +0 -56
  99. package/dist/__tests__/harnesses/grok/GrokAgentMapper.test.js.map +0 -1
  100. package/dist/__tests__/harnesses/grok/GrokCliAdapter.test.js +0 -421
  101. package/dist/__tests__/harnesses/grok/GrokCliAdapter.test.js.map +0 -1
  102. package/dist/__tests__/harnesses/grok/GrokIncrementalRefresh.test.js +0 -167
  103. package/dist/__tests__/harnesses/grok/GrokIncrementalRefresh.test.js.map +0 -1
  104. package/dist/__tests__/harnesses/grok/GrokSessionLocator.test.js +0 -133
  105. package/dist/__tests__/harnesses/grok/GrokSessionLocator.test.js.map +0 -1
  106. package/dist/__tests__/harnesses/grok/GrokSessionParser.test.js +0 -301
  107. package/dist/__tests__/harnesses/grok/GrokSessionParser.test.js.map +0 -1
  108. package/dist/__tests__/harnesses/kiro/KiroAdapter.test.js +0 -662
  109. package/dist/__tests__/harnesses/kiro/KiroAdapter.test.js.map +0 -1
  110. package/dist/__tests__/harnesses/muse/MuseAdapter.test.js +0 -247
  111. package/dist/__tests__/harnesses/muse/MuseAdapter.test.js.map +0 -1
  112. package/dist/__tests__/harnesses/muse/MuseAgentMapper.test.js +0 -81
  113. package/dist/__tests__/harnesses/muse/MuseAgentMapper.test.js.map +0 -1
  114. package/dist/__tests__/harnesses/muse/MuseSessionLocator.test.js +0 -185
  115. package/dist/__tests__/harnesses/muse/MuseSessionLocator.test.js.map +0 -1
  116. package/dist/__tests__/harnesses/muse/MuseSessionParser.test.js +0 -328
  117. package/dist/__tests__/harnesses/muse/MuseSessionParser.test.js.map +0 -1
  118. package/dist/__tests__/harnesses/opencode/OpenCodeAdapter.test.js +0 -213
  119. package/dist/__tests__/harnesses/opencode/OpenCodeAdapter.test.js.map +0 -1
  120. package/dist/__tests__/harnesses/opencode/OpenCodeAgentMapper.test.js +0 -108
  121. package/dist/__tests__/harnesses/opencode/OpenCodeAgentMapper.test.js.map +0 -1
  122. package/dist/__tests__/harnesses/opencode/OpenCodeSessionLocator.test.js +0 -94
  123. package/dist/__tests__/harnesses/opencode/OpenCodeSessionLocator.test.js.map +0 -1
  124. package/dist/__tests__/harnesses/opencode/OpenCodeSessionParser.test.js +0 -147
  125. package/dist/__tests__/harnesses/opencode/OpenCodeSessionParser.test.js.map +0 -1
  126. package/dist/__tests__/harnesses/pi/PiAdapter.test.js +0 -367
  127. package/dist/__tests__/harnesses/pi/PiAdapter.test.js.map +0 -1
  128. package/dist/__tests__/harnesses/pi/PiDiscoveryIO.test.js +0 -382
  129. package/dist/__tests__/harnesses/pi/PiDiscoveryIO.test.js.map +0 -1
  130. package/dist/__tests__/harnesses/pi/PiSessionParser.test.js +0 -416
  131. package/dist/__tests__/harnesses/pi/PiSessionParser.test.js.map +0 -1
  132. package/dist/__tests__/harnesses/pi/PiSessionTracker.test.js +0 -108
  133. package/dist/__tests__/harnesses/pi/PiSessionTracker.test.js.map +0 -1
  134. package/dist/__tests__/harnesses/pi/durable/PiCliProbe.test.js +0 -70
  135. package/dist/__tests__/harnesses/pi/durable/PiCliProbe.test.js.map +0 -1
  136. package/dist/__tests__/harnesses/pi/durable/PiDurableAgentRepository.test.js +0 -43
  137. package/dist/__tests__/harnesses/pi/durable/PiDurableAgentRepository.test.js.map +0 -1
  138. package/dist/__tests__/harnesses/pi/durable/PiPrintAgentService.test.js +0 -192
  139. package/dist/__tests__/harnesses/pi/durable/PiPrintAgentService.test.js.map +0 -1
  140. package/dist/__tests__/harnesses/pi/durable/PiPrintProtocol.test.js +0 -119
  141. package/dist/__tests__/harnesses/pi/durable/PiPrintProtocol.test.js.map +0 -1
  142. package/dist/__tests__/harnesses/pi/durable/PiPrintRunner.test.js +0 -382
  143. package/dist/__tests__/harnesses/pi/durable/PiPrintRunner.test.js.map +0 -1
  144. package/dist/__tests__/harnesses/pi/durable/PiStreamParser.test.js +0 -34
  145. package/dist/__tests__/harnesses/pi/durable/PiStreamParser.test.js.map +0 -1
  146. package/dist/__tests__/harnesses/readiness/AgentReadiness.test.js +0 -446
  147. package/dist/__tests__/harnesses/readiness/AgentReadiness.test.js.map +0 -1
  148. package/dist/__tests__/harnesses/runtimeProfiles.test.js +0 -101
  149. package/dist/__tests__/harnesses/runtimeProfiles.test.js.map +0 -1
  150. package/dist/__tests__/print/DurableAgent.test.js +0 -15
  151. package/dist/__tests__/print/DurableAgent.test.js.map +0 -1
  152. package/dist/__tests__/print/DurableAgentRepository.sqlite.test.js +0 -186
  153. package/dist/__tests__/print/DurableAgentRepository.sqlite.test.js.map +0 -1
  154. package/dist/__tests__/print/DurableAgentRepository.test.js +0 -249
  155. package/dist/__tests__/print/DurableAgentRepository.test.js.map +0 -1
  156. package/dist/__tests__/readiness-fixtures.test.js +0 -54
  157. package/dist/__tests__/readiness-fixtures.test.js.map +0 -1
  158. package/dist/__tests__/runtime/AgentRuntime.test.js +0 -13
  159. package/dist/__tests__/runtime/AgentRuntime.test.js.map +0 -1
  160. package/dist/__tests__/runtime/HerdrAgentDiscovery.test.js +0 -164
  161. package/dist/__tests__/runtime/HerdrAgentDiscovery.test.js.map +0 -1
  162. package/dist/__tests__/runtime/HerdrAgentRuntime.test.js +0 -488
  163. package/dist/__tests__/runtime/HerdrAgentRuntime.test.js.map +0 -1
  164. package/dist/__tests__/runtime/ManagedAgentRuntime.test.js +0 -637
  165. package/dist/__tests__/runtime/ManagedAgentRuntime.test.js.map +0 -1
  166. package/dist/__tests__/terminal/GhosttyBackend.test.js +0 -334
  167. package/dist/__tests__/terminal/GhosttyBackend.test.js.map +0 -1
  168. package/dist/__tests__/terminal/TerminalFocusManager.test.js +0 -253
  169. package/dist/__tests__/terminal/TerminalFocusManager.test.js.map +0 -1
  170. package/dist/__tests__/terminal/TmuxManager.test.js +0 -168
  171. package/dist/__tests__/terminal/TmuxManager.test.js.map +0 -1
  172. package/dist/__tests__/terminal/TtyWriter.test.js +0 -386
  173. package/dist/__tests__/terminal/TtyWriter.test.js.map +0 -1
  174. package/dist/__tests__/utils/AgentRegistry.test.js +0 -636
  175. package/dist/__tests__/utils/AgentRegistry.test.js.map +0 -1
  176. package/dist/__tests__/utils/IncrementalJsonlSummary.test.js +0 -650
  177. package/dist/__tests__/utils/IncrementalJsonlSummary.test.js.map +0 -1
  178. package/dist/__tests__/utils/agent-requests.test.js +0 -90
  179. package/dist/__tests__/utils/agent-requests.test.js.map +0 -1
  180. package/dist/__tests__/utils/conversationTail.bench.test.js +0 -258
  181. package/dist/__tests__/utils/conversationTail.bench.test.js.map +0 -1
  182. package/dist/__tests__/utils/conversationTailParity.test.js +0 -588
  183. package/dist/__tests__/utils/conversationTailParity.test.js.map +0 -1
  184. package/dist/__tests__/utils/jsonlTail.test.js +0 -360
  185. package/dist/__tests__/utils/jsonlTail.test.js.map +0 -1
  186. package/dist/__tests__/utils/matching.test.js +0 -324
  187. package/dist/__tests__/utils/matching.test.js.map +0 -1
  188. package/dist/__tests__/utils/matchingConstants.test.js +0 -35
  189. package/dist/__tests__/utils/matchingConstants.test.js.map +0 -1
  190. package/dist/__tests__/utils/process.test.js +0 -818
  191. package/dist/__tests__/utils/process.test.js.map +0 -1
  192. package/dist/__tests__/utils/session.test.js +0 -175
  193. package/dist/__tests__/utils/session.test.js.map +0 -1
  194. package/project.json +0 -29
  195. package/scripts/benchmark-cold-start.mjs +0 -350
  196. package/src/AgentManager.ts +0 -559
  197. package/src/__tests__/AgentManager.test.ts +0 -1578
  198. package/src/__tests__/adapters/IncrementalSessionRefresh.test.ts +0 -437
  199. package/src/__tests__/adapters/adapterProcessImports.test.ts +0 -58
  200. package/src/__tests__/adapters/adapterSnapshotCandidates.test.ts +0 -243
  201. package/src/__tests__/capacity/anthropic.test.ts +0 -105
  202. package/src/__tests__/capacity/boundaries.test.ts +0 -36
  203. package/src/__tests__/capacity/claude.test.ts +0 -462
  204. package/src/__tests__/capacity/codex.test.ts +0 -311
  205. package/src/__tests__/capacity/devin.test.ts +0 -210
  206. package/src/__tests__/capacity/fixtures/claude-credentials.json +0 -7
  207. package/src/__tests__/capacity/fixtures/claude-usage-malformed.json +0 -1
  208. package/src/__tests__/capacity/fixtures/claude-usage-partial.json +0 -15
  209. package/src/__tests__/capacity/fixtures/claude-usage.json +0 -63
  210. package/src/__tests__/capacity/fixtures/devin-config.json +0 -6
  211. package/src/__tests__/capacity/fixtures/devin-credentials.toml +0 -4
  212. package/src/__tests__/capacity/fixtures/devin-quota-nonplan.json +0 -5
  213. package/src/__tests__/capacity/fixtures/devin-quota.json +0 -10
  214. package/src/__tests__/capacity/fixtures/openai-auth.json +0 -6
  215. package/src/__tests__/capacity/fixtures/openai-codex-auth.json +0 -9
  216. package/src/__tests__/capacity/fixtures/openai-usage-completions.json +0 -67
  217. package/src/__tests__/capacity/fixtures/openai-usage-responses.json +0 -20
  218. package/src/__tests__/capacity/fixtures/wham-usage.json +0 -45
  219. package/src/__tests__/capacity/fixtures/zai-auth.json +0 -6
  220. package/src/__tests__/capacity/fixtures/zai-quota-invalid.json +0 -7
  221. package/src/__tests__/capacity/fixtures/zai-quota.json +0 -38
  222. package/src/__tests__/capacity/index.test.ts +0 -54
  223. package/src/__tests__/capacity/openai.test.ts +0 -571
  224. package/src/__tests__/capacity/wham.test.ts +0 -122
  225. package/src/__tests__/capacity/zai.test.ts +0 -151
  226. package/src/__tests__/fixtures.test.ts +0 -245
  227. package/src/__tests__/harnesses/BoundedSummarySkip.test.ts +0 -496
  228. package/src/__tests__/harnesses/SessionSummaryEquivalence.test.ts +0 -726
  229. package/src/__tests__/harnesses/antigravity/AntigravityCliAdapter.subprocess.test.ts +0 -133
  230. package/src/__tests__/harnesses/antigravity/AntigravityCliAdapter.test.ts +0 -396
  231. package/src/__tests__/harnesses/builtinAdapters.test.ts +0 -33
  232. package/src/__tests__/harnesses/claude/ClaudeAgentMapper.test.ts +0 -84
  233. package/src/__tests__/harnesses/claude/ClaudeCodeAdapter.test.ts +0 -1793
  234. package/src/__tests__/harnesses/claude/ClaudeSessionLocator.test.ts +0 -423
  235. package/src/__tests__/harnesses/claude/ClaudeSessionParser.test.ts +0 -300
  236. package/src/__tests__/harnesses/claude/durable/ClaudeCliProbe.test.ts +0 -34
  237. package/src/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.ts +0 -61
  238. package/src/__tests__/harnesses/claude/durable/ClaudePrintAgentService.test.ts +0 -129
  239. package/src/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.ts +0 -152
  240. package/src/__tests__/harnesses/codex/CodexAdapter.test.ts +0 -652
  241. package/src/__tests__/harnesses/codex/CodexSessionLocator.test.ts +0 -419
  242. package/src/__tests__/harnesses/codex/CodexSessionMapping.test.ts +0 -63
  243. package/src/__tests__/harnesses/codex/CodexSessionParser.test.ts +0 -192
  244. package/src/__tests__/harnesses/codex/durable/CodexCliProbe.test.ts +0 -80
  245. package/src/__tests__/harnesses/codex/durable/CodexDurableAgentRepository.test.ts +0 -65
  246. package/src/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.ts +0 -104
  247. package/src/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.ts +0 -201
  248. package/src/__tests__/harnesses/codex/durable/CodexPrintRunner.test.ts +0 -299
  249. package/src/__tests__/harnesses/copilot/CopilotAdapter.test.ts +0 -614
  250. package/src/__tests__/harnesses/copilot/CopilotRefreshIO.test.ts +0 -270
  251. package/src/__tests__/harnesses/devin/DevinAdapter.test.ts +0 -290
  252. package/src/__tests__/harnesses/devin/DevinAgentMapper.test.ts +0 -101
  253. package/src/__tests__/harnesses/devin/DevinSessionLocator.test.ts +0 -139
  254. package/src/__tests__/harnesses/devin/DevinSessionParser.test.ts +0 -212
  255. package/src/__tests__/harnesses/devin/fixtures.ts +0 -144
  256. package/src/__tests__/harnesses/gemini/GeminiCliAdapter.test.ts +0 -1336
  257. package/src/__tests__/harnesses/gemini/GeminiSessionJsonl.test.ts +0 -402
  258. package/src/__tests__/harnesses/gemini/GeminiSessionLocator.test.ts +0 -396
  259. package/src/__tests__/harnesses/grok/GrokAgentMapper.test.ts +0 -57
  260. package/src/__tests__/harnesses/grok/GrokCliAdapter.test.ts +0 -376
  261. package/src/__tests__/harnesses/grok/GrokIncrementalRefresh.test.ts +0 -170
  262. package/src/__tests__/harnesses/grok/GrokSessionLocator.test.ts +0 -106
  263. package/src/__tests__/harnesses/grok/GrokSessionParser.test.ts +0 -230
  264. package/src/__tests__/harnesses/kiro/KiroAdapter.test.ts +0 -552
  265. package/src/__tests__/harnesses/muse/MuseAdapter.test.ts +0 -197
  266. package/src/__tests__/harnesses/muse/MuseAgentMapper.test.ts +0 -83
  267. package/src/__tests__/harnesses/muse/MuseSessionLocator.test.ts +0 -177
  268. package/src/__tests__/harnesses/muse/MuseSessionParser.test.ts +0 -279
  269. package/src/__tests__/harnesses/opencode/OpenCodeAdapter.test.ts +0 -215
  270. package/src/__tests__/harnesses/opencode/OpenCodeAgentMapper.test.ts +0 -101
  271. package/src/__tests__/harnesses/opencode/OpenCodeSessionLocator.test.ts +0 -84
  272. package/src/__tests__/harnesses/opencode/OpenCodeSessionParser.test.ts +0 -149
  273. package/src/__tests__/harnesses/pi/PiAdapter.test.ts +0 -325
  274. package/src/__tests__/harnesses/pi/PiDiscoveryIO.test.ts +0 -337
  275. package/src/__tests__/harnesses/pi/PiSessionParser.test.ts +0 -280
  276. package/src/__tests__/harnesses/pi/PiSessionTracker.test.ts +0 -79
  277. package/src/__tests__/harnesses/pi/durable/PiCliProbe.test.ts +0 -50
  278. package/src/__tests__/harnesses/pi/durable/PiDurableAgentRepository.test.ts +0 -33
  279. package/src/__tests__/harnesses/pi/durable/PiPrintAgentService.test.ts +0 -138
  280. package/src/__tests__/harnesses/pi/durable/PiPrintProtocol.test.ts +0 -71
  281. package/src/__tests__/harnesses/pi/durable/PiPrintRunner.test.ts +0 -252
  282. package/src/__tests__/harnesses/pi/durable/PiStreamParser.test.ts +0 -26
  283. package/src/__tests__/harnesses/readiness/AgentReadiness.test.ts +0 -362
  284. package/src/__tests__/harnesses/runtimeProfiles.test.ts +0 -123
  285. package/src/__tests__/print/DurableAgent.test.ts +0 -15
  286. package/src/__tests__/print/DurableAgentRepository.sqlite.test.ts +0 -128
  287. package/src/__tests__/print/DurableAgentRepository.test.ts +0 -184
  288. package/src/__tests__/readiness-fixtures.test.ts +0 -79
  289. package/src/__tests__/runtime/AgentRuntime.test.ts +0 -8
  290. package/src/__tests__/runtime/HerdrAgentDiscovery.test.ts +0 -131
  291. package/src/__tests__/runtime/HerdrAgentRuntime.test.ts +0 -377
  292. package/src/__tests__/runtime/ManagedAgentRuntime.test.ts +0 -590
  293. package/src/__tests__/terminal/GhosttyBackend.test.ts +0 -271
  294. package/src/__tests__/terminal/TerminalFocusManager.test.ts +0 -280
  295. package/src/__tests__/terminal/TmuxManager.test.ts +0 -185
  296. package/src/__tests__/terminal/TtyWriter.test.ts +0 -454
  297. package/src/__tests__/utils/AgentRegistry.test.ts +0 -532
  298. package/src/__tests__/utils/IncrementalJsonlSummary.test.ts +0 -414
  299. package/src/__tests__/utils/agent-requests.test.ts +0 -94
  300. package/src/__tests__/utils/conversationTail.bench.test.ts +0 -193
  301. package/src/__tests__/utils/conversationTailParity.test.ts +0 -365
  302. package/src/__tests__/utils/jsonlTail.test.ts +0 -317
  303. package/src/__tests__/utils/matching.test.ts +0 -234
  304. package/src/__tests__/utils/matchingConstants.test.ts +0 -40
  305. package/src/__tests__/utils/process.test.ts +0 -596
  306. package/src/__tests__/utils/session.test.ts +0 -158
  307. package/src/adapters/AgentAdapter.ts +0 -255
  308. package/src/capacity/index.ts +0 -127
  309. package/src/capacity/providers/anthropic.ts +0 -198
  310. package/src/capacity/providers/devin.ts +0 -121
  311. package/src/capacity/providers/openai-platform.ts +0 -150
  312. package/src/capacity/providers/openai-subscription.ts +0 -184
  313. package/src/capacity/providers/zai.ts +0 -155
  314. package/src/capacity/sources/claude.ts +0 -30
  315. package/src/capacity/sources/codex.ts +0 -251
  316. package/src/capacity/sources/devin.ts +0 -49
  317. package/src/capacity/sources/pi.ts +0 -131
  318. package/src/capacity/types.ts +0 -29
  319. package/src/database/connection.ts +0 -96
  320. package/src/database/index.ts +0 -7
  321. package/src/database/migrations/001_initial.sql +0 -12
  322. package/src/database/migrations/002_pins.sql +0 -1
  323. package/src/database/migrations/003_durable_agents.sql +0 -43
  324. package/src/database/migrations/004_codex_durable_sessions.sql +0 -1
  325. package/src/database/migrations/005_agent_runtime.sql +0 -2
  326. package/src/database/schema.ts +0 -64
  327. package/src/durable/DurableAgent.ts +0 -139
  328. package/src/durable/DurableAgentRepository.ts +0 -485
  329. package/src/durable/process.ts +0 -29
  330. package/src/durable/run.ts +0 -84
  331. package/src/durable/utils.ts +0 -66
  332. package/src/fixtures/bundle.ts +0 -130
  333. package/src/fixtures/capture.ts +0 -364
  334. package/src/harnesses/antigravity/AntigravityAgentMapper.ts +0 -34
  335. package/src/harnesses/antigravity/AntigravityCliAdapter.ts +0 -126
  336. package/src/harnesses/antigravity/AntigravitySessionLocator.ts +0 -75
  337. package/src/harnesses/antigravity/AntigravitySessionParser.ts +0 -252
  338. package/src/harnesses/claude/ClaudeAgentMapper.ts +0 -55
  339. package/src/harnesses/claude/ClaudeCodeAdapter.ts +0 -175
  340. package/src/harnesses/claude/ClaudeSessionLocator.ts +0 -358
  341. package/src/harnesses/claude/ClaudeSessionParser.ts +0 -524
  342. package/src/harnesses/claude/credentials.ts +0 -122
  343. package/src/harnesses/claude/durable/ClaudeCliProbe.ts +0 -57
  344. package/src/harnesses/claude/durable/ClaudePrintAgentService.ts +0 -79
  345. package/src/harnesses/claude/durable/ClaudePrintRunner.ts +0 -102
  346. package/src/harnesses/claude/durable/ClaudeStreamParser.ts +0 -108
  347. package/src/harnesses/claude/readiness.ts +0 -69
  348. package/src/harnesses/codex/CodexAdapter.ts +0 -337
  349. package/src/harnesses/codex/CodexAgentMapper.ts +0 -26
  350. package/src/harnesses/codex/CodexSessionLocator.ts +0 -509
  351. package/src/harnesses/codex/CodexSessionMapping.ts +0 -89
  352. package/src/harnesses/codex/CodexSessionParser.ts +0 -462
  353. package/src/harnesses/codex/credentials.ts +0 -81
  354. package/src/harnesses/codex/durable/CodexCliProbe.ts +0 -68
  355. package/src/harnesses/codex/durable/CodexPrintAgentService.ts +0 -79
  356. package/src/harnesses/codex/durable/CodexPrintRunner.ts +0 -104
  357. package/src/harnesses/codex/durable/CodexStreamParser.ts +0 -117
  358. package/src/harnesses/codex/readiness.ts +0 -72
  359. package/src/harnesses/copilot/CopilotAdapter.ts +0 -161
  360. package/src/harnesses/copilot/CopilotAgentMapper.ts +0 -27
  361. package/src/harnesses/copilot/CopilotSessionLocator.ts +0 -161
  362. package/src/harnesses/copilot/CopilotSessionParser.ts +0 -380
  363. package/src/harnesses/copilot/readiness.ts +0 -33
  364. package/src/harnesses/devin/DevinAdapter.ts +0 -212
  365. package/src/harnesses/devin/DevinAgentMapper.ts +0 -39
  366. package/src/harnesses/devin/DevinSessionLocator.ts +0 -230
  367. package/src/harnesses/devin/DevinSessionParser.ts +0 -227
  368. package/src/harnesses/devin/credentials.ts +0 -88
  369. package/src/harnesses/devin/readiness.ts +0 -36
  370. package/src/harnesses/gemini/GeminiAgentMapper.ts +0 -27
  371. package/src/harnesses/gemini/GeminiCliAdapter.ts +0 -272
  372. package/src/harnesses/gemini/GeminiSessionLocator.ts +0 -394
  373. package/src/harnesses/gemini/GeminiSessionParser.ts +0 -395
  374. package/src/harnesses/gemini/fileSignature.ts +0 -10
  375. package/src/harnesses/grok/GrokAgentMapper.ts +0 -32
  376. package/src/harnesses/grok/GrokCliAdapter.ts +0 -126
  377. package/src/harnesses/grok/GrokSessionLocator.ts +0 -179
  378. package/src/harnesses/grok/GrokSessionParser.ts +0 -251
  379. package/src/harnesses/index.ts +0 -32
  380. package/src/harnesses/kiro/KiroAdapter.ts +0 -143
  381. package/src/harnesses/kiro/KiroAgentMapper.ts +0 -34
  382. package/src/harnesses/kiro/KiroSessionLocator.ts +0 -143
  383. package/src/harnesses/kiro/KiroSessionParser.ts +0 -376
  384. package/src/harnesses/muse/MuseAdapter.ts +0 -157
  385. package/src/harnesses/muse/MuseAgentMapper.ts +0 -33
  386. package/src/harnesses/muse/MuseSessionLocator.ts +0 -286
  387. package/src/harnesses/muse/MuseSessionParser.ts +0 -435
  388. package/src/harnesses/muse/readiness.ts +0 -38
  389. package/src/harnesses/opencode/OpenCodeAdapter.ts +0 -110
  390. package/src/harnesses/opencode/OpenCodeAgentMapper.ts +0 -49
  391. package/src/harnesses/opencode/OpenCodeSessionLocator.ts +0 -151
  392. package/src/harnesses/opencode/OpenCodeSessionParser.ts +0 -146
  393. package/src/harnesses/opencode/readiness.ts +0 -48
  394. package/src/harnesses/pi/PiAdapter.ts +0 -197
  395. package/src/harnesses/pi/PiAgentMapper.ts +0 -27
  396. package/src/harnesses/pi/PiSessionLocator.ts +0 -288
  397. package/src/harnesses/pi/PiSessionParser.ts +0 -488
  398. package/src/harnesses/pi/PiSessionTracker.ts +0 -87
  399. package/src/harnesses/pi/credentials.ts +0 -129
  400. package/src/harnesses/pi/durable/PiCliProbe.ts +0 -56
  401. package/src/harnesses/pi/durable/PiPrintAgentService.ts +0 -77
  402. package/src/harnesses/pi/durable/PiPrintProtocol.ts +0 -41
  403. package/src/harnesses/pi/durable/PiPrintRunner.ts +0 -95
  404. package/src/harnesses/pi/durable/PiStreamParser.ts +0 -94
  405. package/src/harnesses/pi/readiness.ts +0 -104
  406. package/src/harnesses/readiness/AgentReadiness.ts +0 -91
  407. package/src/harnesses/readiness/checks.ts +0 -336
  408. package/src/harnesses/readiness/types.ts +0 -90
  409. package/src/harnesses/runtimeProfiles.ts +0 -105
  410. package/src/harnesses/shared.ts +0 -124
  411. package/src/index.ts +0 -71
  412. package/src/runtime/ManagedAgentRuntime.ts +0 -253
  413. package/src/runtime/RuntimeFactory.ts +0 -13
  414. package/src/runtime/errors.ts +0 -50
  415. package/src/runtime/herdr/HerdrAgentDiscovery.ts +0 -166
  416. package/src/runtime/herdr/HerdrAgentRuntime.ts +0 -216
  417. package/src/runtime/herdr/HerdrCliClient.ts +0 -78
  418. package/src/runtime/herdr/HerdrErrors.ts +0 -9
  419. package/src/runtime/herdr/HerdrResponseParsers.ts +0 -86
  420. package/src/runtime/herdr/HerdrRuntimeRef.ts +0 -41
  421. package/src/runtime/tmux/PidPolling.ts +0 -34
  422. package/src/runtime/tmux/TmuxAgentRuntime.ts +0 -113
  423. package/src/runtime/tmux/TmuxManager.ts +0 -102
  424. package/src/runtime/tmux/TmuxRuntimeRef.ts +0 -9
  425. package/src/runtime/types.ts +0 -56
  426. package/src/terminal/TerminalFocusManager.ts +0 -52
  427. package/src/terminal/TtyWriter.ts +0 -26
  428. package/src/terminal/backends/ghostty.ts +0 -180
  429. package/src/terminal/backends/index.ts +0 -23
  430. package/src/terminal/backends/iterm2.ts +0 -126
  431. package/src/terminal/backends/shared.ts +0 -47
  432. package/src/terminal/backends/terminal-app.ts +0 -122
  433. package/src/terminal/backends/tmux.ts +0 -62
  434. package/src/terminal/backends/wezterm.ts +0 -65
  435. package/src/terminal/types.ts +0 -23
  436. package/src/utils/AgentRegistry.ts +0 -351
  437. package/src/utils/IncrementalJsonlSummary.ts +0 -306
  438. package/src/utils/agent-requests.ts +0 -28
  439. package/src/utils/applescript.ts +0 -10
  440. package/src/utils/jsonlTail.ts +0 -349
  441. package/src/utils/matching.ts +0 -96
  442. package/src/utils/matchingConstants.ts +0 -15
  443. package/src/utils/process.ts +0 -604
  444. package/src/utils/session.ts +0 -144
  445. package/src/utils/sortAgents.ts +0 -54
  446. package/tsconfig.json +0 -11
  447. package/vitest.config.ts +0 -20
@@ -1,218 +0,0 @@
1
- /**
2
- * Fixture replay: materialize each committed bundle into a fake HOME,
3
- * run the adapter's detectAgents with the recorded processes + frozen
4
- * clock, and require byte-identical output to `expected`.
5
- *
6
- * The same bundles are consumed by devkit-harness Rust tests — this file is
7
- * the TS↔TS side of the parity oracle.
8
- */ import { describe, it, expect, afterEach } from "vitest";
9
- import * as fs from "node:fs";
10
- import * as os from "node:os";
11
- import * as path from "node:path";
12
- import Database from "better-sqlite3";
13
- import { createBuiltinAdapters } from "../harnesses/index.js";
14
- import { CodexAdapter } from "../harnesses/codex/CodexAdapter.js";
15
- import { PiAdapter } from "../harnesses/pi/PiAdapter.js";
16
- import { GeminiCliAdapter } from "../harnesses/gemini/GeminiCliAdapter.js";
17
- import { CopilotAdapter } from "../harnesses/copilot/CopilotAdapter.js";
18
- import { AgentRegistry } from "../utils/AgentRegistry.js";
19
- import { expand, expandNow, normalizeAgents, withFrozenClock } from "../fixtures/bundle.js";
20
- import { captureLive, FIXTURES_ROOT } from "../fixtures/capture.js";
21
- const bundlePaths = fs.existsSync(FIXTURES_ROOT) ? fs.readdirSync(FIXTURES_ROOT, {
22
- withFileTypes: true
23
- }).flatMap((d)=>d.isDirectory() ? fs.readdirSync(path.join(FIXTURES_ROOT, d.name)).filter((f)=>f.endsWith(".json")).map((f)=>path.join(FIXTURES_ROOT, d.name, f)) : []) : [];
24
- /** Adapters whose detect path consults AgentRegistry. */ const REGISTRY_AWARE = new Set([
25
- "codex",
26
- "pi",
27
- "gemini_cli",
28
- "copilot"
29
- ]);
30
- function adapterFor(type, registry) {
31
- // Adapters that consult the registry during detection get the seeded
32
- // isolated instance so replay never reads real ~/.ai-devkit state.
33
- if (type === "codex" && registry) return new CodexAdapter(registry);
34
- if (type === "pi" && registry) return new PiAdapter(registry);
35
- if (type === "gemini_cli" && registry) return new GeminiCliAdapter(registry);
36
- if (type === "copilot" && registry) return new CopilotAdapter(registry);
37
- const adapter = createBuiltinAdapters().find((a)=>a.type === type);
38
- if (!adapter) throw new Error(`no builtin adapter for "${type}"`);
39
- return adapter;
40
- }
41
- /** Seed an isolated registry at `<home>/.ai-devkit/agents.json`. */ function seedRegistry(bundle, home, nowIso) {
42
- if (!REGISTRY_AWARE.has(bundle.adapter)) return undefined;
43
- const registry = new AgentRegistry(path.join(home, ".ai-devkit", "agents.json"));
44
- const entries = (bundle.registry ?? []).map((e)=>({
45
- name: "",
46
- type: bundle.adapter,
47
- runtime: "tmux",
48
- runtimeRef: null,
49
- cwd: "",
50
- startedAt: nowIso,
51
- sessionId: "",
52
- sessionFilePath: "",
53
- pinned: false,
54
- ...expand(expandNow(e, nowIso), home)
55
- }));
56
- registry.registerBatch(entries);
57
- return registry;
58
- }
59
- /** Materialize a bundle into a temp HOME; returns cleanup + replay inputs. */ function materialize(bundle) {
60
- const home = fs.mkdtempSync(path.join(os.tmpdir(), "fixture-home-"));
61
- // "$TODAY" resolves to the local `YYYY/MM/DD` day key at write time — Codex
62
- // date-dir discovery derives day keys from process start times in local
63
- // time, so static dirs would drift across replay days/timezones.
64
- const now = new Date();
65
- const todayKey = [
66
- String(now.getFullYear()).padStart(4, "0"),
67
- String(now.getMonth() + 1).padStart(2, "0"),
68
- String(now.getDate()).padStart(2, "0")
69
- ].join("/");
70
- for (const [rel, content] of Object.entries(bundle.home)){
71
- const p = path.join(home, expand(rel.split("$TODAY").join(todayKey), home));
72
- fs.mkdirSync(path.dirname(p), {
73
- recursive: true
74
- });
75
- fs.writeFileSync(p, expand(content.split("$TODAY").join(todayKey), home));
76
- }
77
- // SQLite stores (OpenCode's opencode.db) materialize from ordered SQL
78
- // statements — binary dbs can't travel in the JSON `home` map.
79
- for (const [rel, stmts] of Object.entries(bundle.sqlite ?? {})){
80
- const p = path.join(home, expand(rel.split("$TODAY").join(todayKey), home));
81
- fs.mkdirSync(path.dirname(p), {
82
- recursive: true
83
- });
84
- const db = new Database(p);
85
- try {
86
- for (const stmt of stmts){
87
- db.exec(expand(stmt.split("$TODAY").join(todayKey), home));
88
- }
89
- } finally{
90
- db.close();
91
- }
92
- }
93
- // "$NOW" resolves to the instant home files were written — legacy
94
- // cwd+birthtime matching compares process start times against real file
95
- // creation times, so a static timestamp would drift out of tolerance.
96
- const nowIso = new Date().toISOString();
97
- // Deterministic mtimes for adapters that read them (Grok lastActive /
98
- // latest-session pick) — "$NOW" resolves like the process sentinel.
99
- for (const [rel, mt] of Object.entries(bundle.mtimes ?? {})){
100
- const p = path.join(home, expand(rel.split("$TODAY").join(todayKey), home));
101
- const ms = mt === "$NOW" ? Date.parse(nowIso) : mt;
102
- fs.utimesSync(p, ms / 1000, ms / 1000);
103
- }
104
- // JSON round-tripped Date fields (e.g. ProcessInfo.startTime) come back as
105
- // ISO strings — adapters expect real Date instances.
106
- const processes = expandNow(expand(bundle.processes, home), nowIso).map((p)=>({
107
- ...p,
108
- startTime: p.startTime ? new Date(p.startTime) : undefined
109
- }));
110
- const frozenNow = bundle.frozenNow === "$NOW" ? Date.parse(nowIso) : bundle.frozenNow;
111
- // Pids whose startTime resolves to the materialization instant — Codex
112
- // derives session day-dirs from start times, so only these paths contain
113
- // the replay-day key and normalize to $TODAY.
114
- const nowPids = new Set(bundle.processes.filter((p)=>p.startTime === "$NOW").map((p)=>p.pid));
115
- return {
116
- home,
117
- processes,
118
- frozenNow,
119
- todayKey,
120
- // Only $NOW resolves — $FIXTURE_HOME and $TODAY stay literal to match
121
- // the normalized actual form.
122
- expected: expandNow(bundle.expected, nowIso),
123
- cleanup: ()=>fs.rmSync(home, {
124
- recursive: true,
125
- force: true
126
- }),
127
- nowIso,
128
- nowPids
129
- };
130
- }
131
- describe("fixture replay (TS parity oracle)", ()=>{
132
- const saved = process.env.HOME;
133
- afterEach(()=>{
134
- if (saved === undefined) delete process.env.HOME;
135
- else process.env.HOME = saved;
136
- });
137
- if (bundlePaths.length === 0) {
138
- it.todo("no fixture bundles committed yet — run AI_DEVKIT_FIXTURE_CAPTURE=1");
139
- return;
140
- }
141
- for (const bundlePath of bundlePaths){
142
- it(`replays ${path.relative(FIXTURES_ROOT, bundlePath)}`, async ()=>{
143
- const bundle = JSON.parse(fs.readFileSync(bundlePath, "utf8"));
144
- const { home, processes, frozenNow, expected, cleanup, todayKey, nowIso, nowPids } = materialize(bundle);
145
- // Pin XDG to the fixture's canonical share dir — an ambient
146
- // XDG_DATA_HOME would resolve the real opencode.db into replay.
147
- const savedXdg = process.env.XDG_DATA_HOME;
148
- // Same for ANTIGRAVITY_CLI_HOME — clearing it falls the adapter
149
- // back to the pinned HOME's canonical base dir.
150
- const savedAgy = process.env.ANTIGRAVITY_CLI_HOME;
151
- try {
152
- process.env.HOME = home;
153
- process.env.XDG_DATA_HOME = path.join(home, ".local", "share");
154
- delete process.env.ANTIGRAVITY_CLI_HOME;
155
- const registry = seedRegistry(bundle, home, nowIso);
156
- const agents = await withFrozenClock(frozenNow, ()=>adapterFor(bundle.adapter, registry).detectAgents({
157
- processes
158
- }));
159
- // Day-key dirs normalize back to $TODAY only for agents whose
160
- // process startTime was $NOW — static-start agents keep concrete
161
- // dates so live bundles stay replayable on any day.
162
- const actual = JSON.parse(JSON.stringify(normalizeAgents(agents, home))).map((a)=>nowPids.has(a.pid) ? JSON.parse(JSON.stringify(a).split(todayKey).join("$TODAY")) : a);
163
- expect(actual).toEqual(expected);
164
- } finally{
165
- if (savedXdg === undefined) delete process.env.XDG_DATA_HOME;
166
- else process.env.XDG_DATA_HOME = savedXdg;
167
- if (savedAgy === undefined) delete process.env.ANTIGRAVITY_CLI_HOME;
168
- else process.env.ANTIGRAVITY_CLI_HOME = savedAgy;
169
- cleanup();
170
- }
171
- });
172
- }
173
- });
174
- // Opt-in live capture: AI_DEVKIT_FIXTURE_CAPTURE=1 npx vitest run fixtures
175
- describe.runIf(process.env.AI_DEVKIT_FIXTURE_CAPTURE === "1")("fixture capture (live)", ()=>{
176
- it("captures claude bundle from the live machine", async ()=>{
177
- const out = await captureLive(adapterFor("claude"), "live");
178
- expect(fs.existsSync(out)).toBe(true);
179
- }, 30000);
180
- it("captures codex bundle from the live machine", async ()=>{
181
- const out = await captureLive(adapterFor("codex"), "live");
182
- expect(fs.existsSync(out)).toBe(true);
183
- }, 30000);
184
- it("captures pi bundle from the live machine", async ()=>{
185
- const out = await captureLive(adapterFor("pi"), "live");
186
- expect(fs.existsSync(out)).toBe(true);
187
- }, 30000);
188
- it("captures gemini_cli bundle from the live machine", async ()=>{
189
- const out = await captureLive(adapterFor("gemini_cli"), "live");
190
- expect(fs.existsSync(out)).toBe(true);
191
- }, 30000);
192
- it("captures copilot bundle from the live machine", async ()=>{
193
- const out = await captureLive(adapterFor("copilot"), "live");
194
- expect(fs.existsSync(out)).toBe(true);
195
- }, 30000);
196
- it("captures grok_cli bundle from the live machine", async ()=>{
197
- const out = await captureLive(adapterFor("grok_cli"), "live");
198
- expect(fs.existsSync(out)).toBe(true);
199
- }, 30000);
200
- it("captures opencode bundle from the live machine", async ()=>{
201
- const out = await captureLive(adapterFor("opencode"), "live");
202
- expect(fs.existsSync(out)).toBe(true);
203
- }, 30000);
204
- it("captures devin bundle from the live machine", async ()=>{
205
- const out = await captureLive(adapterFor("devin"), "live");
206
- expect(fs.existsSync(out)).toBe(true);
207
- }, 30000);
208
- it("captures kiro bundle from the live machine", async ()=>{
209
- const out = await captureLive(adapterFor("kiro"), "live");
210
- expect(fs.existsSync(out)).toBe(true);
211
- }, 30000);
212
- it("captures antigravity_cli bundle from the live machine", async ()=>{
213
- const out = await captureLive(adapterFor("antigravity_cli"), "live");
214
- expect(fs.existsSync(out)).toBe(true);
215
- }, 30000);
216
- });
217
-
218
- //# sourceMappingURL=fixtures.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/__tests__/fixtures.test.ts"],"sourcesContent":["/**\n * Fixture replay: materialize each committed bundle into a fake HOME,\n * run the adapter's detectAgents with the recorded processes + frozen\n * clock, and require byte-identical output to `expected`.\n *\n * The same bundles are consumed by devkit-harness Rust tests — this file is\n * the TS↔TS side of the parity oracle.\n */\n\nimport { describe, it, expect, afterEach } from \"vitest\";\nimport * as fs from \"node:fs\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\nimport Database from \"better-sqlite3\";\nimport { createBuiltinAdapters } from \"../harnesses/index.js\";\nimport { CodexAdapter } from \"../harnesses/codex/CodexAdapter.js\";\nimport { PiAdapter } from \"../harnesses/pi/PiAdapter.js\";\nimport { GeminiCliAdapter } from \"../harnesses/gemini/GeminiCliAdapter.js\";\nimport { CopilotAdapter } from \"../harnesses/copilot/CopilotAdapter.js\";\nimport { AgentRegistry, type RegistryEntry } from \"../utils/AgentRegistry.js\";\nimport { expand, expandNow, normalizeAgents, withFrozenClock } from \"../fixtures/bundle.js\";\nimport type { FixtureBundle } from \"../fixtures/bundle.js\";\nimport { captureLive, FIXTURES_ROOT } from \"../fixtures/capture.js\";\n\nconst bundlePaths = fs.existsSync(FIXTURES_ROOT)\n ? fs.readdirSync(FIXTURES_ROOT, { withFileTypes: true }).flatMap((d) =>\n d.isDirectory()\n ? fs\n .readdirSync(path.join(FIXTURES_ROOT, d.name))\n .filter((f) => f.endsWith(\".json\"))\n .map((f) => path.join(FIXTURES_ROOT, d.name, f))\n : [],\n )\n : [];\n\n/** Adapters whose detect path consults AgentRegistry. */\nconst REGISTRY_AWARE = new Set([\"codex\", \"pi\", \"gemini_cli\", \"copilot\"]);\n\nfunction adapterFor(type: string, registry?: AgentRegistry) {\n // Adapters that consult the registry during detection get the seeded\n // isolated instance so replay never reads real ~/.ai-devkit state.\n if (type === \"codex\" && registry) return new CodexAdapter(registry);\n if (type === \"pi\" && registry) return new PiAdapter(registry);\n if (type === \"gemini_cli\" && registry) return new GeminiCliAdapter(registry);\n if (type === \"copilot\" && registry) return new CopilotAdapter(registry);\n const adapter = createBuiltinAdapters().find((a) => a.type === type);\n if (!adapter) throw new Error(`no builtin adapter for \"${type}\"`);\n return adapter;\n}\n\n/** Seed an isolated registry at `<home>/.ai-devkit/agents.json`. */\nfunction seedRegistry(\n bundle: FixtureBundle,\n home: string,\n nowIso: string,\n): AgentRegistry | undefined {\n if (!REGISTRY_AWARE.has(bundle.adapter)) return undefined;\n const registry = new AgentRegistry(path.join(home, \".ai-devkit\", \"agents.json\"));\n const entries = (bundle.registry ?? []).map(\n (e) =>\n ({\n name: \"\",\n type: bundle.adapter,\n runtime: \"tmux\",\n runtimeRef: null,\n cwd: \"\",\n startedAt: nowIso,\n sessionId: \"\",\n sessionFilePath: \"\",\n pinned: false,\n ...expand(expandNow(e as Record<string, unknown>, nowIso), home),\n }) as RegistryEntry,\n );\n registry.registerBatch(entries);\n return registry;\n}\n\n/** Materialize a bundle into a temp HOME; returns cleanup + replay inputs. */\nfunction materialize(bundle: FixtureBundle) {\n const home = fs.mkdtempSync(path.join(os.tmpdir(), \"fixture-home-\"));\n // \"$TODAY\" resolves to the local `YYYY/MM/DD` day key at write time — Codex\n // date-dir discovery derives day keys from process start times in local\n // time, so static dirs would drift across replay days/timezones.\n const now = new Date();\n const todayKey = [\n String(now.getFullYear()).padStart(4, \"0\"),\n String(now.getMonth() + 1).padStart(2, \"0\"),\n String(now.getDate()).padStart(2, \"0\"),\n ].join(\"/\");\n for (const [rel, content] of Object.entries(bundle.home)) {\n const p = path.join(home, expand(rel.split(\"$TODAY\").join(todayKey), home));\n fs.mkdirSync(path.dirname(p), { recursive: true });\n fs.writeFileSync(p, expand(content.split(\"$TODAY\").join(todayKey), home));\n }\n // SQLite stores (OpenCode's opencode.db) materialize from ordered SQL\n // statements — binary dbs can't travel in the JSON `home` map.\n for (const [rel, stmts] of Object.entries(bundle.sqlite ?? {})) {\n const p = path.join(home, expand(rel.split(\"$TODAY\").join(todayKey), home));\n fs.mkdirSync(path.dirname(p), { recursive: true });\n const db = new Database(p);\n try {\n for (const stmt of stmts) {\n db.exec(expand(stmt.split(\"$TODAY\").join(todayKey), home));\n }\n } finally {\n db.close();\n }\n }\n // \"$NOW\" resolves to the instant home files were written — legacy\n // cwd+birthtime matching compares process start times against real file\n // creation times, so a static timestamp would drift out of tolerance.\n const nowIso = new Date().toISOString();\n // Deterministic mtimes for adapters that read them (Grok lastActive /\n // latest-session pick) — \"$NOW\" resolves like the process sentinel.\n for (const [rel, mt] of Object.entries(bundle.mtimes ?? {})) {\n const p = path.join(home, expand(rel.split(\"$TODAY\").join(todayKey), home));\n const ms = mt === \"$NOW\" ? Date.parse(nowIso) : mt;\n fs.utimesSync(p, ms / 1000, ms / 1000);\n }\n // JSON round-tripped Date fields (e.g. ProcessInfo.startTime) come back as\n // ISO strings — adapters expect real Date instances.\n const processes = expandNow(expand(bundle.processes, home), nowIso).map((p) => ({\n ...p,\n startTime: p.startTime ? new Date(p.startTime) : undefined,\n }));\n const frozenNow = bundle.frozenNow === \"$NOW\" ? Date.parse(nowIso) : bundle.frozenNow;\n // Pids whose startTime resolves to the materialization instant — Codex\n // derives session day-dirs from start times, so only these paths contain\n // the replay-day key and normalize to $TODAY.\n const nowPids = new Set(bundle.processes.filter((p) => p.startTime === \"$NOW\").map((p) => p.pid));\n return {\n home,\n processes,\n frozenNow,\n todayKey,\n // Only $NOW resolves — $FIXTURE_HOME and $TODAY stay literal to match\n // the normalized actual form.\n expected: expandNow(bundle.expected, nowIso),\n cleanup: () => fs.rmSync(home, { recursive: true, force: true }),\n nowIso,\n nowPids,\n };\n}\n\ndescribe(\"fixture replay (TS parity oracle)\", () => {\n const saved = process.env.HOME;\n afterEach(() => {\n if (saved === undefined) delete process.env.HOME;\n else process.env.HOME = saved;\n });\n\n if (bundlePaths.length === 0) {\n it.todo(\"no fixture bundles committed yet — run AI_DEVKIT_FIXTURE_CAPTURE=1\");\n return;\n }\n\n for (const bundlePath of bundlePaths) {\n it(`replays ${path.relative(FIXTURES_ROOT, bundlePath)}`, async () => {\n const bundle: FixtureBundle = JSON.parse(fs.readFileSync(bundlePath, \"utf8\"));\n const { home, processes, frozenNow, expected, cleanup, todayKey, nowIso, nowPids } =\n materialize(bundle);\n // Pin XDG to the fixture's canonical share dir — an ambient\n // XDG_DATA_HOME would resolve the real opencode.db into replay.\n const savedXdg = process.env.XDG_DATA_HOME;\n // Same for ANTIGRAVITY_CLI_HOME — clearing it falls the adapter\n // back to the pinned HOME's canonical base dir.\n const savedAgy = process.env.ANTIGRAVITY_CLI_HOME;\n try {\n process.env.HOME = home;\n process.env.XDG_DATA_HOME = path.join(home, \".local\", \"share\");\n delete process.env.ANTIGRAVITY_CLI_HOME;\n const registry = seedRegistry(bundle, home, nowIso);\n const agents = await withFrozenClock(frozenNow, () =>\n adapterFor(bundle.adapter, registry).detectAgents({ processes }),\n );\n // Day-key dirs normalize back to $TODAY only for agents whose\n // process startTime was $NOW — static-start agents keep concrete\n // dates so live bundles stay replayable on any day.\n const actual = JSON.parse(JSON.stringify(normalizeAgents(agents, home))).map((a) =>\n nowPids.has(a.pid) ? JSON.parse(JSON.stringify(a).split(todayKey).join(\"$TODAY\")) : a,\n );\n expect(actual).toEqual(expected);\n } finally {\n if (savedXdg === undefined) delete process.env.XDG_DATA_HOME;\n else process.env.XDG_DATA_HOME = savedXdg;\n if (savedAgy === undefined) delete process.env.ANTIGRAVITY_CLI_HOME;\n else process.env.ANTIGRAVITY_CLI_HOME = savedAgy;\n cleanup();\n }\n });\n }\n});\n\n// Opt-in live capture: AI_DEVKIT_FIXTURE_CAPTURE=1 npx vitest run fixtures\ndescribe.runIf(process.env.AI_DEVKIT_FIXTURE_CAPTURE === \"1\")(\"fixture capture (live)\", () => {\n it(\"captures claude bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"claude\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n\n it(\"captures codex bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"codex\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n\n it(\"captures pi bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"pi\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n\n it(\"captures gemini_cli bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"gemini_cli\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n\n it(\"captures copilot bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"copilot\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n\n it(\"captures grok_cli bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"grok_cli\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n\n it(\"captures opencode bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"opencode\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n\n it(\"captures devin bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"devin\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n\n it(\"captures kiro bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"kiro\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n\n it(\"captures antigravity_cli bundle from the live machine\", async () => {\n const out = await captureLive(adapterFor(\"antigravity_cli\"), \"live\");\n expect(fs.existsSync(out)).toBe(true);\n }, 30000);\n});\n"],"names":["describe","it","expect","afterEach","fs","os","path","Database","createBuiltinAdapters","CodexAdapter","PiAdapter","GeminiCliAdapter","CopilotAdapter","AgentRegistry","expand","expandNow","normalizeAgents","withFrozenClock","captureLive","FIXTURES_ROOT","bundlePaths","existsSync","readdirSync","withFileTypes","flatMap","d","isDirectory","join","name","filter","f","endsWith","map","REGISTRY_AWARE","Set","adapterFor","type","registry","adapter","find","a","Error","seedRegistry","bundle","home","nowIso","has","undefined","entries","e","runtime","runtimeRef","cwd","startedAt","sessionId","sessionFilePath","pinned","registerBatch","materialize","mkdtempSync","tmpdir","now","Date","todayKey","String","getFullYear","padStart","getMonth","getDate","rel","content","Object","p","split","mkdirSync","dirname","recursive","writeFileSync","stmts","sqlite","db","stmt","exec","close","toISOString","mt","mtimes","ms","parse","utimesSync","processes","startTime","frozenNow","nowPids","pid","expected","cleanup","rmSync","force","saved","process","env","HOME","length","todo","bundlePath","relative","JSON","readFileSync","savedXdg","XDG_DATA_HOME","savedAgy","ANTIGRAVITY_CLI_HOME","agents","detectAgents","actual","stringify","toEqual","runIf","AI_DEVKIT_FIXTURE_CAPTURE","out","toBe"],"mappings":"AAAA;;;;;;;CAOC,GAED,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,EAAEC,SAAS,QAAQ,SAAS;AACzD,YAAYC,QAAQ,UAAU;AAC9B,YAAYC,QAAQ,UAAU;AAC9B,YAAYC,UAAU,YAAY;AAClC,OAAOC,cAAc,iBAAiB;AACtC,SAASC,qBAAqB,QAAQ,wBAAwB;AAC9D,SAASC,YAAY,QAAQ,qCAAqC;AAClE,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,gBAAgB,QAAQ,0CAA0C;AAC3E,SAASC,cAAc,QAAQ,yCAAyC;AACxE,SAASC,aAAa,QAA4B,4BAA4B;AAC9E,SAAS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