@geminixiang/mikan 1.0.0-beta.45 → 1.0.0-beta.47

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 (440) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +12 -19
  3. package/dist/adapter.d.ts +1 -1
  4. package/dist/adapter.d.ts.map +1 -1
  5. package/dist/adapter.js.map +1 -1
  6. package/dist/adapters/discord/bot.d.ts +6 -1
  7. package/dist/adapters/discord/bot.d.ts.map +1 -1
  8. package/dist/adapters/discord/bot.js +168 -144
  9. package/dist/adapters/discord/bot.js.map +1 -1
  10. package/dist/adapters/discord/context.d.ts +2 -8
  11. package/dist/adapters/discord/context.d.ts.map +1 -1
  12. package/dist/adapters/discord/context.js +1 -1
  13. package/dist/adapters/discord/context.js.map +1 -1
  14. package/dist/adapters/discord/format.d.ts.map +1 -1
  15. package/dist/adapters/discord/format.js +2 -4
  16. package/dist/adapters/discord/format.js.map +1 -1
  17. package/dist/adapters/github/bot.d.ts +6 -1
  18. package/dist/adapters/github/bot.d.ts.map +1 -1
  19. package/dist/adapters/github/bot.js +57 -25
  20. package/dist/adapters/github/bot.js.map +1 -1
  21. package/dist/adapters/github/context.d.ts +2 -9
  22. package/dist/adapters/github/context.d.ts.map +1 -1
  23. package/dist/adapters/github/context.js.map +1 -1
  24. package/dist/adapters/github/github-ops.d.ts +4 -17
  25. package/dist/adapters/github/github-ops.d.ts.map +1 -1
  26. package/dist/adapters/github/github-ops.js +17 -86
  27. package/dist/adapters/github/github-ops.js.map +1 -1
  28. package/dist/adapters/github/tool-pack.d.ts.map +1 -1
  29. package/dist/adapters/github/tool-pack.js +0 -1
  30. package/dist/adapters/github/tool-pack.js.map +1 -1
  31. package/dist/adapters/github/tools/checks.d.ts +0 -1
  32. package/dist/adapters/github/tools/checks.d.ts.map +1 -1
  33. package/dist/adapters/github/tools/checks.js +3 -22
  34. package/dist/adapters/github/tools/checks.js.map +1 -1
  35. package/dist/adapters/github/types.d.ts +0 -33
  36. package/dist/adapters/github/types.d.ts.map +1 -1
  37. package/dist/adapters/github/types.js.map +1 -1
  38. package/dist/adapters/progressive-renderer.d.ts.map +1 -1
  39. package/dist/adapters/progressive-renderer.js +311 -318
  40. package/dist/adapters/progressive-renderer.js.map +1 -1
  41. package/dist/adapters/shared.d.ts +12 -1
  42. package/dist/adapters/shared.d.ts.map +1 -1
  43. package/dist/adapters/shared.js +44 -1
  44. package/dist/adapters/shared.js.map +1 -1
  45. package/dist/adapters/slack/blocks.d.ts.map +1 -1
  46. package/dist/adapters/slack/blocks.js +1 -4
  47. package/dist/adapters/slack/blocks.js.map +1 -1
  48. package/dist/adapters/slack/bot.d.ts +15 -0
  49. package/dist/adapters/slack/bot.d.ts.map +1 -1
  50. package/dist/adapters/slack/bot.js +233 -206
  51. package/dist/adapters/slack/bot.js.map +1 -1
  52. package/dist/adapters/slack/context.d.ts +2 -8
  53. package/dist/adapters/slack/context.d.ts.map +1 -1
  54. package/dist/adapters/slack/context.js +1 -1
  55. package/dist/adapters/slack/context.js.map +1 -1
  56. package/dist/adapters/slack/response-lifecycle.d.ts.map +1 -1
  57. package/dist/adapters/slack/response-lifecycle.js +135 -123
  58. package/dist/adapters/slack/response-lifecycle.js.map +1 -1
  59. package/dist/adapters/slack/stream-limits.d.ts +1 -1
  60. package/dist/adapters/slack/stream-limits.js +1 -1
  61. package/dist/adapters/slack/stream-limits.js.map +1 -1
  62. package/dist/adapters/slack/types.d.ts +4 -0
  63. package/dist/adapters/slack/types.d.ts.map +1 -1
  64. package/dist/adapters/slack/types.js.map +1 -1
  65. package/dist/adapters/telegram/bot.d.ts +3 -0
  66. package/dist/adapters/telegram/bot.d.ts.map +1 -1
  67. package/dist/adapters/telegram/bot.js +23 -7
  68. package/dist/adapters/telegram/bot.js.map +1 -1
  69. package/dist/adapters/telegram/context.d.ts +2 -8
  70. package/dist/adapters/telegram/context.d.ts.map +1 -1
  71. package/dist/adapters/telegram/context.js +1 -2
  72. package/dist/adapters/telegram/context.js.map +1 -1
  73. package/dist/adapters/types.d.ts +11 -5
  74. package/dist/adapters/types.d.ts.map +1 -1
  75. package/dist/adapters/types.js.map +1 -1
  76. package/dist/agent/catalog.d.ts +6 -18
  77. package/dist/agent/catalog.d.ts.map +1 -1
  78. package/dist/agent/catalog.js +24 -156
  79. package/dist/agent/catalog.js.map +1 -1
  80. package/dist/agent/execution.d.ts +0 -7
  81. package/dist/agent/execution.d.ts.map +1 -1
  82. package/dist/agent/execution.js +23 -21
  83. package/dist/agent/execution.js.map +1 -1
  84. package/dist/agent/presenter.d.ts +7 -9
  85. package/dist/agent/presenter.d.ts.map +1 -1
  86. package/dist/agent/presenter.js +355 -357
  87. package/dist/agent/presenter.js.map +1 -1
  88. package/dist/agent/prompt.d.ts +5 -12
  89. package/dist/agent/prompt.d.ts.map +1 -1
  90. package/dist/agent/prompt.js +56 -81
  91. package/dist/agent/prompt.js.map +1 -1
  92. package/dist/agent/runner.d.ts +0 -7
  93. package/dist/agent/runner.d.ts.map +1 -1
  94. package/dist/agent/runner.js +335 -318
  95. package/dist/agent/runner.js.map +1 -1
  96. package/dist/agent/types.d.ts +21 -17
  97. package/dist/agent/types.d.ts.map +1 -1
  98. package/dist/agent/types.js +0 -1
  99. package/dist/agent/types.js.map +1 -1
  100. package/dist/cli/boot.d.ts.map +1 -1
  101. package/dist/cli/boot.js +7 -10
  102. package/dist/cli/boot.js.map +1 -1
  103. package/dist/cli/onboard.d.ts +10 -0
  104. package/dist/cli/onboard.d.ts.map +1 -0
  105. package/dist/cli/onboard.js +237 -0
  106. package/dist/cli/onboard.js.map +1 -0
  107. package/dist/cli/types.d.ts +8 -3
  108. package/dist/cli/types.d.ts.map +1 -1
  109. package/dist/cli/types.js.map +1 -1
  110. package/dist/commands/auto-reply.d.ts.map +1 -1
  111. package/dist/commands/auto-reply.js +5 -12
  112. package/dist/commands/auto-reply.js.map +1 -1
  113. package/dist/commands/manifest.d.ts.map +1 -1
  114. package/dist/commands/manifest.js +9 -16
  115. package/dist/commands/manifest.js.map +1 -1
  116. package/dist/commands/new.d.ts.map +1 -1
  117. package/dist/commands/new.js +15 -10
  118. package/dist/commands/new.js.map +1 -1
  119. package/dist/commands/registry.d.ts.map +1 -1
  120. package/dist/commands/registry.js +0 -2
  121. package/dist/commands/registry.js.map +1 -1
  122. package/dist/commands/sandbox.d.ts.map +1 -1
  123. package/dist/commands/sandbox.js +89 -70
  124. package/dist/commands/sandbox.js.map +1 -1
  125. package/dist/commands/session-view.js +9 -2
  126. package/dist/commands/session-view.js.map +1 -1
  127. package/dist/commands/types.d.ts +4 -3
  128. package/dist/commands/types.d.ts.map +1 -1
  129. package/dist/commands/types.js.map +1 -1
  130. package/dist/config.d.ts +13 -17
  131. package/dist/config.d.ts.map +1 -1
  132. package/dist/config.js +39 -37
  133. package/dist/config.js.map +1 -1
  134. package/dist/dream/index.d.ts +20 -0
  135. package/dist/dream/index.d.ts.map +1 -0
  136. package/dist/dream/index.js +253 -0
  137. package/dist/dream/index.js.map +1 -0
  138. package/dist/dream/types.d.ts +30 -0
  139. package/dist/dream/types.d.ts.map +1 -0
  140. package/dist/dream/types.js.map +1 -0
  141. package/dist/env-manifest.d.ts.map +1 -1
  142. package/dist/env-manifest.js +12 -27
  143. package/dist/env-manifest.js.map +1 -1
  144. package/dist/execution-resolver.d.ts +9 -2
  145. package/dist/execution-resolver.d.ts.map +1 -1
  146. package/dist/execution-resolver.js +26 -27
  147. package/dist/execution-resolver.js.map +1 -1
  148. package/dist/harness/event-format.d.ts +1 -2
  149. package/dist/harness/event-format.d.ts.map +1 -1
  150. package/dist/harness/event-format.js +9 -15
  151. package/dist/harness/event-format.js.map +1 -1
  152. package/dist/harness/index.d.ts +1 -7
  153. package/dist/harness/index.d.ts.map +1 -1
  154. package/dist/harness/index.js +0 -4
  155. package/dist/harness/index.js.map +1 -1
  156. package/dist/harness/models.d.ts.map +1 -1
  157. package/dist/harness/models.js +15 -35
  158. package/dist/harness/models.js.map +1 -1
  159. package/dist/harness/runner.d.ts +7 -16
  160. package/dist/harness/runner.d.ts.map +1 -1
  161. package/dist/harness/runner.js +13 -131
  162. package/dist/harness/runner.js.map +1 -1
  163. package/dist/harness/session-store.d.ts +1 -1
  164. package/dist/harness/session-store.d.ts.map +1 -1
  165. package/dist/harness/session-store.js +1 -1
  166. package/dist/harness/session-store.js.map +1 -1
  167. package/dist/harness/subagent-runner.d.ts +2 -2
  168. package/dist/harness/subagent-runner.d.ts.map +1 -1
  169. package/dist/harness/subagent-runner.js +157 -162
  170. package/dist/harness/subagent-runner.js.map +1 -1
  171. package/dist/harness/types.d.ts +1 -13
  172. package/dist/harness/types.d.ts.map +1 -1
  173. package/dist/harness/types.js.map +1 -1
  174. package/dist/index.d.ts +3 -9
  175. package/dist/index.d.ts.map +1 -1
  176. package/dist/index.js +1 -5
  177. package/dist/index.js.map +1 -1
  178. package/dist/main.js +103 -222
  179. package/dist/main.js.map +1 -1
  180. package/dist/mcp/catalog.d.ts +5 -0
  181. package/dist/mcp/catalog.d.ts.map +1 -0
  182. package/dist/mcp/catalog.js +156 -0
  183. package/dist/mcp/catalog.js.map +1 -0
  184. package/dist/mcp/loader.d.ts +3 -2
  185. package/dist/mcp/loader.d.ts.map +1 -1
  186. package/dist/mcp/loader.js +54 -23
  187. package/dist/mcp/loader.js.map +1 -1
  188. package/dist/mcp/open-connector.d.ts +14 -0
  189. package/dist/mcp/open-connector.d.ts.map +1 -0
  190. package/dist/mcp/open-connector.js +203 -0
  191. package/dist/mcp/open-connector.js.map +1 -0
  192. package/dist/mcp/types.d.ts +28 -0
  193. package/dist/mcp/types.d.ts.map +1 -1
  194. package/dist/mcp/types.js.map +1 -1
  195. package/dist/office/index.d.ts +136 -8
  196. package/dist/office/index.d.ts.map +1 -1
  197. package/dist/office/index.js +1050 -9
  198. package/dist/office/index.js.map +1 -1
  199. package/dist/office/types.d.ts +19 -1
  200. package/dist/office/types.d.ts.map +1 -1
  201. package/dist/office/types.js.map +1 -1
  202. package/dist/packages/index.d.ts +168 -5
  203. package/dist/packages/index.d.ts.map +1 -1
  204. package/dist/packages/index.js +720 -5
  205. package/dist/packages/index.js.map +1 -1
  206. package/dist/packages/types.d.ts +1 -5
  207. package/dist/packages/types.d.ts.map +1 -1
  208. package/dist/packages/types.js.map +1 -1
  209. package/dist/process-lifecycle.d.ts +19 -0
  210. package/dist/process-lifecycle.d.ts.map +1 -0
  211. package/dist/process-lifecycle.js +60 -0
  212. package/dist/process-lifecycle.js.map +1 -0
  213. package/dist/provisioner.d.ts +2 -9
  214. package/dist/provisioner.d.ts.map +1 -1
  215. package/dist/provisioner.js +3 -12
  216. package/dist/provisioner.js.map +1 -1
  217. package/dist/runtime/conversation-runtime.d.ts.map +1 -1
  218. package/dist/runtime/conversation-runtime.js +124 -380
  219. package/dist/runtime/conversation-runtime.js.map +1 -1
  220. package/dist/runtime/session-lifecycle.d.ts +34 -18
  221. package/dist/runtime/session-lifecycle.d.ts.map +1 -1
  222. package/dist/runtime/session-lifecycle.js +179 -46
  223. package/dist/runtime/session-lifecycle.js.map +1 -1
  224. package/dist/runtime/types.d.ts +8 -26
  225. package/dist/runtime/types.d.ts.map +1 -1
  226. package/dist/runtime/types.js.map +1 -1
  227. package/dist/sandbox/cloudflare.d.ts.map +1 -1
  228. package/dist/sandbox/cloudflare.js +2 -3
  229. package/dist/sandbox/cloudflare.js.map +1 -1
  230. package/dist/sandbox/container.d.ts +0 -1
  231. package/dist/sandbox/container.d.ts.map +1 -1
  232. package/dist/sandbox/container.js +2 -3
  233. package/dist/sandbox/container.js.map +1 -1
  234. package/dist/sandbox/host.d.ts.map +1 -1
  235. package/dist/sandbox/host.js +4 -2
  236. package/dist/sandbox/host.js.map +1 -1
  237. package/dist/sandbox/identity.d.ts +10 -19
  238. package/dist/sandbox/identity.d.ts.map +1 -1
  239. package/dist/sandbox/identity.js +8 -8
  240. package/dist/sandbox/identity.js.map +1 -1
  241. package/dist/sandbox/index.d.ts +7 -10
  242. package/dist/sandbox/index.d.ts.map +1 -1
  243. package/dist/sandbox/index.js +45 -16
  244. package/dist/sandbox/index.js.map +1 -1
  245. package/dist/sandbox/types.d.ts +13 -45
  246. package/dist/sandbox/types.d.ts.map +1 -1
  247. package/dist/sandbox/types.js.map +1 -1
  248. package/dist/sandbox/utils.d.ts +5 -0
  249. package/dist/sandbox/utils.d.ts.map +1 -1
  250. package/dist/sandbox/utils.js +10 -0
  251. package/dist/sandbox/utils.js.map +1 -1
  252. package/dist/sessions/chat-history-sync.d.ts +1 -3
  253. package/dist/sessions/chat-history-sync.d.ts.map +1 -1
  254. package/dist/sessions/chat-history-sync.js +58 -11
  255. package/dist/sessions/chat-history-sync.js.map +1 -1
  256. package/dist/sessions/migrate-v3.d.ts +2 -5
  257. package/dist/sessions/migrate-v3.d.ts.map +1 -1
  258. package/dist/sessions/migrate-v3.js +17 -1
  259. package/dist/sessions/migrate-v3.js.map +1 -1
  260. package/dist/sessions/store.d.ts +5 -6
  261. package/dist/sessions/store.d.ts.map +1 -1
  262. package/dist/sessions/store.js +62 -2
  263. package/dist/sessions/store.js.map +1 -1
  264. package/dist/sessions/types.d.ts +9 -0
  265. package/dist/sessions/types.d.ts.map +1 -1
  266. package/dist/sessions/types.js.map +1 -1
  267. package/dist/tools/bash.d.ts.map +1 -1
  268. package/dist/tools/bash.js +2 -10
  269. package/dist/tools/bash.js.map +1 -1
  270. package/dist/tools/read.js +2 -2
  271. package/dist/tools/read.js.map +1 -1
  272. package/dist/tools/sandbox.d.ts.map +1 -1
  273. package/dist/tools/sandbox.js +2 -3
  274. package/dist/tools/sandbox.js.map +1 -1
  275. package/dist/tools/subagent.d.ts +1 -1
  276. package/dist/tools/subagent.js.map +1 -1
  277. package/dist/types.d.ts +54 -130
  278. package/dist/types.d.ts.map +1 -1
  279. package/dist/types.js.map +1 -1
  280. package/dist/vault/index.d.ts +9 -2
  281. package/dist/vault/index.d.ts.map +1 -1
  282. package/dist/vault/index.js +29 -5
  283. package/dist/vault/index.js.map +1 -1
  284. package/dist/web/admin/portal.d.ts +12 -1
  285. package/dist/web/admin/portal.d.ts.map +1 -1
  286. package/dist/web/admin/portal.js +437 -422
  287. package/dist/web/admin/portal.js.map +1 -1
  288. package/dist/web/admin/types.d.ts +2 -2
  289. package/dist/web/admin/types.d.ts.map +1 -1
  290. package/dist/web/admin/types.js.map +1 -1
  291. package/dist/web/login/portal.d.ts +7 -1
  292. package/dist/web/login/portal.d.ts.map +1 -1
  293. package/dist/web/login/portal.js +143 -78
  294. package/dist/web/login/portal.js.map +1 -1
  295. package/dist/web/portal-shell.d.ts +1 -0
  296. package/dist/web/portal-shell.d.ts.map +1 -1
  297. package/dist/web/portal-shell.js +12 -1
  298. package/dist/web/portal-shell.js.map +1 -1
  299. package/dist/web/server.d.ts +3 -3
  300. package/dist/web/server.d.ts.map +1 -1
  301. package/dist/web/server.js.map +1 -1
  302. package/dist/web/session-view/portal.d.ts +8 -1
  303. package/dist/web/session-view/portal.d.ts.map +1 -1
  304. package/dist/web/session-view/portal.js +609 -132
  305. package/dist/web/session-view/portal.js.map +1 -1
  306. package/dist/web/session-view/types.d.ts +8 -0
  307. package/dist/web/session-view/types.d.ts.map +1 -1
  308. package/dist/web/session-view/types.js.map +1 -1
  309. package/dist/workspace-projection/index.d.ts +14 -2
  310. package/dist/workspace-projection/index.d.ts.map +1 -1
  311. package/dist/workspace-projection/index.js +102 -14
  312. package/dist/workspace-projection/index.js.map +1 -1
  313. package/dist/workspace-projection/types.d.ts +14 -1
  314. package/dist/workspace-projection/types.d.ts.map +1 -1
  315. package/dist/workspace-projection/types.js.map +1 -1
  316. package/package.json +3 -5
  317. package/dist/adapters/github/cloudbuild.d.ts +0 -19
  318. package/dist/adapters/github/cloudbuild.d.ts.map +0 -1
  319. package/dist/adapters/github/cloudbuild.js +0 -71
  320. package/dist/adapters/github/cloudbuild.js.map +0 -1
  321. package/dist/adapters/github/gcp-auth.d.ts +0 -28
  322. package/dist/adapters/github/gcp-auth.d.ts.map +0 -1
  323. package/dist/adapters/github/gcp-auth.js +0 -196
  324. package/dist/adapters/github/gcp-auth.js.map +0 -1
  325. package/dist/agent/index.d.ts +0 -9
  326. package/dist/agent/index.d.ts.map +0 -1
  327. package/dist/agent/index.js +0 -8
  328. package/dist/agent/index.js.map +0 -1
  329. package/dist/cli/ext-dev.d.ts +0 -2
  330. package/dist/cli/ext-dev.d.ts.map +0 -1
  331. package/dist/cli/ext-dev.js +0 -188
  332. package/dist/cli/ext-dev.js.map +0 -1
  333. package/dist/cli/ext.d.ts +0 -2
  334. package/dist/cli/ext.d.ts.map +0 -1
  335. package/dist/cli/ext.js +0 -324
  336. package/dist/cli/ext.js.map +0 -1
  337. package/dist/commands/extensions.d.ts +0 -26
  338. package/dist/commands/extensions.d.ts.map +0 -1
  339. package/dist/commands/extensions.js +0 -103
  340. package/dist/commands/extensions.js.map +0 -1
  341. package/dist/extension-schedules.d.ts +0 -31
  342. package/dist/extension-schedules.d.ts.map +0 -1
  343. package/dist/extension-schedules.js +0 -229
  344. package/dist/extension-schedules.js.map +0 -1
  345. package/dist/harness/auth.d.ts +0 -17
  346. package/dist/harness/auth.d.ts.map +0 -1
  347. package/dist/harness/auth.js +0 -92
  348. package/dist/harness/auth.js.map +0 -1
  349. package/dist/harness/extensions/loader.d.ts +0 -40
  350. package/dist/harness/extensions/loader.d.ts.map +0 -1
  351. package/dist/harness/extensions/loader.js +0 -723
  352. package/dist/harness/extensions/loader.js.map +0 -1
  353. package/dist/harness/extensions/registry.d.ts +0 -155
  354. package/dist/harness/extensions/registry.d.ts.map +0 -1
  355. package/dist/harness/extensions/registry.js +0 -420
  356. package/dist/harness/extensions/registry.js.map +0 -1
  357. package/dist/harness/extensions/types.d.ts +0 -665
  358. package/dist/harness/extensions/types.d.ts.map +0 -1
  359. package/dist/harness/extensions/types.js.map +0 -1
  360. package/dist/office/address.d.ts +0 -31
  361. package/dist/office/address.d.ts.map +0 -1
  362. package/dist/office/address.js +0 -113
  363. package/dist/office/address.js.map +0 -1
  364. package/dist/office/layout.d.ts +0 -27
  365. package/dist/office/layout.d.ts.map +0 -1
  366. package/dist/office/layout.js +0 -97
  367. package/dist/office/layout.js.map +0 -1
  368. package/dist/office/migration.d.ts +0 -44
  369. package/dist/office/migration.d.ts.map +0 -1
  370. package/dist/office/migration.js +0 -255
  371. package/dist/office/migration.js.map +0 -1
  372. package/dist/office/registry.d.ts +0 -75
  373. package/dist/office/registry.d.ts.map +0 -1
  374. package/dist/office/registry.js +0 -646
  375. package/dist/office/registry.js.map +0 -1
  376. package/dist/packages/admin.d.ts +0 -17
  377. package/dist/packages/admin.d.ts.map +0 -1
  378. package/dist/packages/admin.js +0 -98
  379. package/dist/packages/admin.js.map +0 -1
  380. package/dist/packages/inspect.d.ts +0 -11
  381. package/dist/packages/inspect.d.ts.map +0 -1
  382. package/dist/packages/inspect.js +0 -98
  383. package/dist/packages/inspect.js.map +0 -1
  384. package/dist/packages/materialize.d.ts +0 -40
  385. package/dist/packages/materialize.d.ts.map +0 -1
  386. package/dist/packages/materialize.js +0 -297
  387. package/dist/packages/materialize.js.map +0 -1
  388. package/dist/packages/resolve.d.ts +0 -25
  389. package/dist/packages/resolve.d.ts.map +0 -1
  390. package/dist/packages/resolve.js +0 -208
  391. package/dist/packages/resolve.js.map +0 -1
  392. package/dist/packages/source.d.ts +0 -39
  393. package/dist/packages/source.d.ts.map +0 -1
  394. package/dist/packages/source.js +0 -189
  395. package/dist/packages/source.js.map +0 -1
  396. package/dist/sandbox/errors.d.ts +0 -6
  397. package/dist/sandbox/errors.d.ts.map +0 -1
  398. package/dist/sandbox/errors.js +0 -11
  399. package/dist/sandbox/errors.js.map +0 -1
  400. package/dist/sandbox/firecracker.d.ts +0 -18
  401. package/dist/sandbox/firecracker.d.ts.map +0 -1
  402. package/dist/sandbox/firecracker.js +0 -223
  403. package/dist/sandbox/firecracker.js.map +0 -1
  404. package/dist/sandbox/gondolin.d.ts +0 -57
  405. package/dist/sandbox/gondolin.d.ts.map +0 -1
  406. package/dist/sandbox/gondolin.js +0 -764
  407. package/dist/sandbox/gondolin.js.map +0 -1
  408. package/dist/sandbox/image.d.ts +0 -3
  409. package/dist/sandbox/image.d.ts.map +0 -1
  410. package/dist/sandbox/image.js +0 -29
  411. package/dist/sandbox/image.js.map +0 -1
  412. package/dist/sessions/conversation-log.d.ts +0 -9
  413. package/dist/sessions/conversation-log.d.ts.map +0 -1
  414. package/dist/sessions/conversation-log.js +0 -50
  415. package/dist/sessions/conversation-log.js.map +0 -1
  416. package/dist/sessions/rotation.d.ts +0 -2
  417. package/dist/sessions/rotation.d.ts.map +0 -1
  418. package/dist/sessions/rotation.js +0 -41
  419. package/dist/sessions/rotation.js.map +0 -1
  420. package/dist/vault/disabled.d.ts +0 -9
  421. package/dist/vault/disabled.d.ts.map +0 -1
  422. package/dist/vault/disabled.js +0 -25
  423. package/dist/vault/disabled.js.map +0 -1
  424. package/dist/web/admin/store.d.ts +0 -13
  425. package/dist/web/admin/store.d.ts.map +0 -1
  426. package/dist/web/admin/store.js +0 -14
  427. package/dist/web/admin/store.js.map +0 -1
  428. package/dist/web/login/store.d.ts +0 -8
  429. package/dist/web/login/store.d.ts.map +0 -1
  430. package/dist/web/login/store.js +0 -15
  431. package/dist/web/login/store.js.map +0 -1
  432. package/dist/web/session-view/service.d.ts +0 -6
  433. package/dist/web/session-view/service.d.ts.map +0 -1
  434. package/dist/web/session-view/service.js +0 -517
  435. package/dist/web/session-view/service.js.map +0 -1
  436. package/dist/web/session-view/store.d.ts +0 -8
  437. package/dist/web/session-view/store.d.ts.map +0 -1
  438. package/dist/web/session-view/store.js +0 -15
  439. package/dist/web/session-view/store.js.map +0 -1
  440. /package/dist/{harness/extensions → dream}/types.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { formatSource, gitRepoPath, parseSource, sourceIdentity } from \"./source.js\";\nexport { gitCloneDir, materializeSource, packageScopeDir } from \"./materialize.js\";\nexport {\n conversationPackageSkillMounts,\n packageSkillRuntimeDir,\n resolveConversationPackages,\n} from \"./resolve.js\";\nexport { inspectConversationPackages } from \"./inspect.js\";\nexport { addPackage, refreshPackage, removePackage } from \"./admin.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/packages/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAkB9E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EA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QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ;QAC3C,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,EAAE,CAAC;AACtD,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc;IACxC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,CAAC;QACH,OAAO,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,MAAM,EAAE,CAAC;IACzB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa,CACpB,KAAmB,EACnB,QAAkB,EAClB,OAA4B;IAE5B,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvB,mBAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnD,OAAO;IACT,CAAC;IACD,MAAM,MAAM,GAAG,yBAAyB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE;QACxE,QAAQ;KACT,CAAC,CAAC;IACH,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;AAC/F,CAAC","sourcesContent":["/**\n * The packages module in one file: the package source grammar, git/local\n * materialization, inspection, conversation-scope resolution with skill\n * mounts, and the admin add/refresh/remove operations. Exported types live\n * in `types.ts`.\n */\nimport { dirname, isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport type {\n MaterializeMode,\n MaterializeOptions,\n MaterializedPackage,\n PackageAdminContext,\n PackageError,\n PackageIdentity,\n PackageInventory,\n PackageScope,\n PackageSkillDir,\n PackageSourceString,\n PackageStatus,\n PackageWriteResult,\n ParsedSource,\n ResolvePackagesOptions,\n ResolvedPackages,\n} from \"./types.js\";\nimport { execFileSync } from \"node:child_process\";\nimport { createHash } from \"node:crypto\";\nimport {\n cpSync,\n existsSync,\n lstatSync,\n realpathSync,\n rmSync,\n statSync,\n writeFileSync,\n} from \"node:fs\";\nimport { ensureDirExists, readTextFileIfExists } from \"../utils/file-guards.js\";\nimport * as log from \"../log.js\";\nimport { officeStateDir } from \"../office/index.js\";\nimport type { OfficeAddress } from \"../types.js\";\nimport { loadSkillsFromDir } from \"../harness/index.js\";\nimport { loadGlobalSettings, resolveConversationSettings } from \"../config.js\";\nimport { applyConversationSettings, applyGlobalSettings } from \"../settings-mutation.js\";\n\n// ── Package source grammar ────────────────────────────────────────────────────\n\n/**\n * The package source grammar: one place that turns a human-written source\n * string into a {@link ParsedSource}, and one place that decides when two\n * sources are the same package ({@link sourceIdentity}).\n *\n * Only git and local-path sources are implemented. The tagged union and the\n * identity function are the seams a future `npm:` source slots into: adding it\n * means a new arm here and a new materializer, with nothing downstream —\n * resolution, scope precedence, the portal — needing to know.\n *\n * Grammar:\n *\n * <locator>[@<ref>][#<subpath>]\n *\n * locator: https://… http://… ssh://… git://… file://…\n * git@host:owner/repo\n * git:<any of the above, or host/owner/repo shorthand>\n * github:owner/repo\n * /abs/path ./rel/path (local, used by reference)\n *\n * `@<ref>` is recognized only when what follows the last `@` contains no `/`\n * and no `:` — otherwise the `@` belongs to the URL's authority\n * (`git@github.com:…`). A consequence: refs containing a slash\n * (`release/1.0`) cannot be written in the string form; pin to a tag or a\n * commit sha instead. The admin portal takes the URL and the ref as separate\n * inputs and assembles a canonical string, so this only constrains\n * hand-edited settings.\n */\n\nconst PROTOCOL_PREFIXES = [\"https://\", \"http://\", \"ssh://\", \"git://\", \"file://\"];\nconst SCP_LIKE = /^[^@/\\s]+@[^:/\\s]+:/;\n\n/**\n * Parse a source string. Throws with a user-facing message rather than\n * returning undefined: every caller (portal, settings load, CLI) needs to tell\n * the human what was wrong with what they typed.\n */\nexport function parseSource(source: string): ParsedSource {\n const trimmed = source.trim();\n if (!trimmed) throw new Error(\"Package source is empty\");\n\n const { rest: withoutSubpath, subpath } = splitSubpath(trimmed);\n const { rest: locator, ref } = splitRef(withoutSubpath);\n\n if (locator.startsWith(\"github:\")) {\n const repo = stripGitSuffix(locator.slice(\"github:\".length).replace(/^\\/+/, \"\"));\n if (!repo.includes(\"/\")) {\n throw new Error(`github: source must be owner/repo, got ${JSON.stringify(locator)}`);\n }\n return gitSource(`https://github.com/${repo}.git`, ref, subpath);\n }\n\n if (locator.startsWith(\"git:\")) {\n const inner = locator.slice(\"git:\".length);\n if (isProtocolUrl(inner) || SCP_LIKE.test(inner)) return gitSource(inner, ref, subpath);\n // Shorthand: host/owner/repo — only meaningful with the git: prefix,\n // since bare host/owner/repo is ambiguous with a relative path.\n if (!inner.includes(\"/\")) {\n throw new Error(`git: source must include a path, got ${JSON.stringify(locator)}`);\n }\n return gitSource(`https://${stripGitSuffix(inner)}.git`, ref, subpath);\n }\n\n if (isProtocolUrl(locator) || SCP_LIKE.test(locator)) return gitSource(locator, ref, subpath);\n\n if (isAbsolute(locator) || locator.startsWith(\"./\") || locator.startsWith(\"../\")) {\n if (ref) throw new Error(\"A local path source cannot carry an @ref\");\n if (subpath) throw new Error(\"A local path source cannot carry a #subpath\");\n return { type: \"local\", path: resolve(locator) };\n }\n\n throw new Error(\n `Unrecognized package source ${JSON.stringify(source)}. ` +\n \"Use a git URL, github:owner/repo, git:host/owner/repo, or an absolute/relative path.\",\n );\n}\n\nfunction gitSource(\n url: string,\n ref: string | undefined,\n subpath: string | undefined,\n): ParsedSource {\n return { type: \"git\", url, ...(ref ? { ref } : {}), ...(subpath ? { subpath } : {}) };\n}\n\nfunction isProtocolUrl(value: string): boolean {\n return PROTOCOL_PREFIXES.some((prefix) => value.startsWith(prefix));\n}\n\nfunction stripGitSuffix(value: string): string {\n return value.replace(/\\.git$/, \"\").replace(/\\/+$/, \"\");\n}\n\nfunction splitSubpath(source: string): { rest: string; subpath?: string } {\n const hash = source.indexOf(\"#\");\n if (hash === -1) return { rest: source };\n const subpath = source.slice(hash + 1).trim();\n if (!subpath) return { rest: source.slice(0, hash) };\n assertSafeRelativePath(subpath, \"#subpath\");\n return { rest: source.slice(0, hash), subpath };\n}\n\n/**\n * Split a trailing `@ref`. The `@` in `git@github.com:owner/repo` is part of\n * the authority, not a ref, so a candidate only counts when its suffix looks\n * like a bare ref (no `/`, no `:`).\n */\nfunction splitRef(source: string): { rest: string; ref?: string } {\n const at = source.lastIndexOf(\"@\");\n if (at <= 0) return { rest: source };\n const candidate = source.slice(at + 1);\n if (!candidate || candidate.includes(\"/\") || candidate.includes(\":\")) return { rest: source };\n return { rest: source.slice(0, at), ref: candidate };\n}\n\n/** Reject traversal and absolute escapes in the parts that become paths. */\nfunction assertSafeRelativePath(value: string, label: string): void {\n if (isAbsolute(value) || value.split(/[\\\\/]/).some((segment) => segment === \"..\")) {\n throw new Error(`${label} must be a relative path without '..': ${JSON.stringify(value)}`);\n }\n}\n\n/**\n * Identity of the package a source refers to — the key for deduplication and\n * for letting a conversation's copy shadow the global one.\n *\n * Deliberate choices:\n * - The ref is excluded: the same repo pinned to two refs in two scopes is one\n * package installed twice, and the narrower scope wins.\n * - The subpath is included: two skill packages living at different paths in one\n * monorepo are two packages.\n * - Transport is excluded: `git@github.com:o/r`, `https://github.com/o/r.git`\n * and `ssh://git@github.com/o/r` all identify the same package, so mixing\n * SSH and HTTPS spellings across scopes still dedups.\n */\nexport function sourceIdentity(parsed: ParsedSource): PackageIdentity {\n if (parsed.type === \"local\") return `local:${parsed.path}`;\n const repo = gitRepoPath(parsed.url);\n return parsed.subpath ? `git:${repo}#${parsed.subpath}` : `git:${repo}`;\n}\n\n/**\n * Transport-independent `<host>/<path>` of a git URL, lowercased host, no\n * `.git` suffix, no credentials. It is the base of the on-disk clone layout,\n * so it must stay free of anything that is not a safe path segment.\n */\nexport function gitRepoPath(url: string): string {\n let remainder = url;\n for (const prefix of PROTOCOL_PREFIXES) {\n if (remainder.startsWith(prefix)) {\n remainder = remainder.slice(prefix.length);\n break;\n }\n }\n // Drop any credentials in the authority (`user:pass@host`, `git@host`).\n const scpMatch = /^([^@/\\s]+@)?([^:/\\s]+)[:/](.+)$/.exec(remainder);\n if (!scpMatch) return sanitizeRepoPath(stripGitSuffix(remainder));\n const host = (scpMatch[2] ?? \"\").toLowerCase();\n const path = stripGitSuffix((scpMatch[3] ?? \"\").replace(/^\\/+/, \"\"));\n return sanitizeRepoPath(`${host}/${path}`);\n}\n\n/**\n * `file://` URLs used in tests and local mirrors have no host, so the repo path\n * is an absolute filesystem path. Keep every segment filesystem-safe and drop\n * traversal, since this string becomes a directory under the state dir.\n */\nfunction sanitizeRepoPath(value: string): string {\n const segments = value\n .split(/[\\\\/]/)\n .map((segment) => segment.replace(/[^A-Za-z0-9._-]+/g, \"-\").replace(/^\\.+$/, \"\"))\n .filter((segment) => segment.length > 0);\n if (segments.length === 0) throw new Error(`Cannot derive a package path from ${value}`);\n return segments.join(\"/\");\n}\n\n/**\n * Canonical string form, used when writing settings so the stored value is\n * stable regardless of how the human spelled it.\n */\nexport function formatSource(parsed: ParsedSource): string {\n if (parsed.type === \"local\") return parsed.path;\n const ref = parsed.ref ? `@${parsed.ref}` : \"\";\n const subpath = parsed.subpath ? `#${parsed.subpath}` : \"\";\n return `${parsed.url}${ref}${subpath}`;\n}\n\n// ── Materialization (git clone / local reference) ─────────────────────────────\n\n/**\n * Turning a parsed source into a directory on the host.\n *\n * Materialization is an explicit, reported step — it happens when a human adds\n * or updates a package, not lazily while a conversation is waiting for a\n * reply. Failures (bad URL, missing ref, no such subpath) therefore surface in\n * front of the person who typed the source instead of as a silently absent\n * feature in a chat.\n *\n * Everything lands under the host-only state dir, never the workspace: this\n * code is imported into the mikan process, so a mounted location would let\n * sandboxed code write what the host executes.\n */\n\nexport type { MaterializeOptions } from \"./types.js\";\n\n/** Git operations get a bounded wall clock so a hung remote cannot wedge a save. */\nconst GIT_TIMEOUT_MS = 120_000;\nconst MATERIALIZED_REF_FILE = \"mikan-ref\";\n\n/**\n * How far materialization may go to produce the package's files.\n *\n * - `offline`: use what is already on disk; never touch the network. This is\n * what a conversation load uses, so no chat reply can ever wait on a remote.\n * - `fetch`: clone a package that is not on disk yet, reuse an existing clone\n * when it already has the requested ref, or switch it to a new ref. What the\n * portal uses when a source is added.\n * - `refresh`: additionally re-fetch an existing clone, resetting and cleaning\n * it first. What the portal's Update action uses.\n *\n * One mode rather than two booleans: \"re-fetch an existing clone but refuse to\n * create a missing one\" is not a state any caller wants, and expressing it\n * should not be possible.\n */\n/**\n * Root of a scope's host-only assets: `<stateDir>/global` or\n * `<stateDir>/conversations/<id>`. The two are isomorphic by design — both\n * hold conversation-scoped settings and package checkouts.\n */\nexport function packageScopeDir(\n scope: PackageScope,\n address: OfficeAddress | undefined,\n stateDir: string,\n): string {\n if (scope === \"global\") return join(stateDir, \"global\");\n if (!address) throw new Error(\"A conversation-scoped package needs an office address\");\n return officeStateDir(stateDir, address);\n}\n\n/**\n * Where a git checkout lives.\n *\n * The unpinned checkout keeps the original path for compatibility. Explicit\n * refs get a sibling keyed by the ref, so two refs can never reset each\n * other's working tree; subpaths of one ref therefore still share a checkout.\n */\nexport function gitCloneDir(url: string, scopeDir: string, ref?: string): string {\n const repoPath = gitRepoPath(url).split(\"/\");\n const repoName = repoPath[repoPath.length - 1] ?? \"repo\";\n const parent = repoPath.slice(0, -1);\n const checkoutName =\n ref === undefined || ref === \"HEAD\"\n ? repoName\n : `${repoName}.mikan-${createHash(\"sha256\").update(ref).digest(\"hex\")}`;\n return join(scopeDir, \"git\", ...parent, checkoutName);\n}\n\n/**\n * Materialize one source and return where its files ended up. Throws with a\n * message meant to be shown to a human — callers render it next to the input\n * that produced it.\n */\nexport function materializeSource(\n source: PackageSourceString,\n options: MaterializeOptions,\n): MaterializedPackage {\n const parsed = parseSource(source);\n const scopeDir = packageScopeDir(options.scope, options.address, options.stateDir);\n const dir =\n parsed.type === \"local\"\n ? materializeLocal(parsed)\n : materializeGit(parsed, scopeDir, options.mode ?? \"fetch\");\n\n return {\n source,\n parsed,\n identity: sourceIdentity(parsed),\n dir,\n scope: options.scope,\n };\n}\n\nfunction materializeLocal(parsed: Extract<ParsedSource, { type: \"local\" }>): string {\n if (!existsSync(parsed.path)) {\n throw new Error(`Path does not exist on the mikan host: ${parsed.path}`);\n }\n if (!statSync(parsed.path).isDirectory()) {\n throw new Error(`Package path must be a directory: ${parsed.path}`);\n }\n return parsed.path;\n}\n\nfunction materializeGit(\n parsed: Extract<ParsedSource, { type: \"git\" }>,\n scopeDir: string,\n mode: MaterializeMode,\n): string {\n const requestedRef = parsed.ref ?? \"HEAD\";\n const cloneDir = gitCloneDir(parsed.url, scopeDir, requestedRef);\n migrateLegacyCheckout(parsed.url, scopeDir, cloneDir, requestedRef);\n const alreadyCloned = existsSync(join(cloneDir, \".git\"));\n const markerPath = join(cloneDir, \".git\", MATERIALIZED_REF_FILE);\n const recordedRef = alreadyCloned ? readTextFileIfExists(markerPath)?.trim() : undefined;\n const canReuse =\n alreadyCloned &&\n mode !== \"refresh\" &&\n (recordedRef === requestedRef ||\n (mode === \"offline\" &&\n recordedRef === undefined &&\n markerlessCheckoutMatchesRef(cloneDir, requestedRef)));\n\n if (canReuse) {\n return resolveSubpath(cloneDir, parsed);\n }\n if (mode === \"offline\") {\n throw new Error(`Not fetched on this host yet: ${describeRef(parsed)}`);\n }\n\n // An incomplete checkout must not retain a marker from an earlier attempt:\n // otherwise a retry could mistake an interrupted fetch or checkout for success.\n if (alreadyCloned) rmSync(markerPath, { force: true });\n\n if (!alreadyCloned) {\n // A leftover directory without .git means a previous attempt died partway.\n if (existsSync(cloneDir)) rmSync(cloneDir, { recursive: true, force: true });\n ensureDirExists(cloneDir);\n git(cloneDir, [\"init\", \"-q\"]);\n git(cloneDir, [\"remote\", \"add\", \"origin\", parsed.url]);\n } else {\n // Reconcile: drop anything a previous checkout left behind so the new ref\n // lands on a clean tree.\n git(cloneDir, [\"remote\", \"set-url\", \"origin\", parsed.url]);\n git(cloneDir, [\"reset\", \"--hard\", \"-q\"]);\n git(cloneDir, [\"clean\", \"-qfd\"]);\n }\n\n // One fetch shape for every kind of ref — tag, branch, or commit sha — and\n // `HEAD` for \"whatever the remote's default branch is now\".\n try {\n git(cloneDir, [\"fetch\", \"--depth\", \"1\", \"origin\", requestedRef]);\n } catch (err) {\n if (!alreadyCloned) rmSync(cloneDir, { recursive: true, force: true });\n throw new Error(`Could not fetch ${describeRef(parsed)}: ${gitErrorText(err)}`, { cause: err });\n }\n git(cloneDir, [\"checkout\", \"-q\", \"--detach\", \"FETCH_HEAD\"]);\n\n const dir = resolveSubpath(cloneDir, parsed);\n // This is the completion marker, not merely a fetched-ref marker. Write it\n // only after checkout and subpath validation have both succeeded.\n writeFileSync(markerPath, `${requestedRef}\\n`);\n return dir;\n}\n\n/**\n * Before keyed checkout paths existed, every ref used the legacy repo path.\n * Copy a matching complete checkout on first use of its keyed path so offline\n * loads keep working. Markerless legacy checkouts are accepted only when git\n * can prove the requested ref is the checked-out commit; a different or\n * unprovable pinned ref is rebuilt by fetch/refresh instead.\n */\nfunction migrateLegacyCheckout(\n url: string,\n scopeDir: string,\n cloneDir: string,\n requestedRef: string,\n): void {\n const legacyDir = gitCloneDir(url, scopeDir);\n if (cloneDir === legacyDir || existsSync(cloneDir)) return;\n const legacyMarker = join(legacyDir, \".git\", MATERIALIZED_REF_FILE);\n if (!existsSync(join(legacyDir, \".git\"))) return;\n const recordedRef = readTextFileIfExists(legacyMarker)?.trim();\n if (recordedRef !== requestedRef) {\n if (recordedRef !== undefined || !markerlessCheckoutMatchesRef(legacyDir, requestedRef)) {\n return;\n }\n }\n\n ensureDirExists(dirname(cloneDir));\n cpSync(legacyDir, cloneDir, { recursive: true });\n}\n\n/**\n * Legacy checkouts have no completion marker. Accept them offline only when\n * the checkout is clean and the local git metadata identifies the requested\n * commit/ref; never infer a pinned ref from HEAD alone.\n */\nfunction markerlessCheckoutMatchesRef(cloneDir: string, requestedRef: string): boolean {\n let head: string;\n try {\n head = git(cloneDir, [\"rev-parse\", \"--verify\", \"HEAD\"]).trim();\n if (!head || git(cloneDir, [\"status\", \"--porcelain\", \"--untracked-files=no\"]).trim()) {\n return false;\n }\n } catch {\n return false;\n }\n\n if (requestedRef === \"HEAD\") return true;\n\n try {\n if (git(cloneDir, [\"rev-parse\", \"--verify\", `${requestedRef}^{commit}`]).trim() === head) {\n return true;\n }\n } catch {\n // A shallow legacy fetch may retain only FETCH_HEAD, not a local ref.\n }\n\n try {\n if (git(cloneDir, [\"symbolic-ref\", \"--quiet\", \"--short\", \"HEAD\"]).trim() === requestedRef) {\n return true;\n }\n } catch {\n // Detached checkouts do not have a symbolic branch.\n }\n\n const fetchHead = readTextFileIfExists(join(cloneDir, \".git\", \"FETCH_HEAD\"));\n if (!fetchHead) return false;\n return fetchHead.split(\"\\n\").some((line) => {\n const match = /^(\\w+)\\s+.*(?:branch|tag) '([^']+)'/.exec(line);\n return match?.[1] === head && match[2] === requestedRef;\n });\n}\n\nfunction resolveSubpath(cloneDir: string, parsed: Extract<ParsedSource, { type: \"git\" }>): string {\n if (!parsed.subpath) return cloneDir;\n const dir = join(cloneDir, parsed.subpath);\n if (!existsSync(dir)) {\n throw new Error(`Subpath not found in repository: ${parsed.subpath}`);\n }\n // A symlink inside the repository must not select files outside the clone:\n // the returned directory is mounted into the runtime, so follow\n // links before deciding the subpath stayed inside.\n const relation = relative(realpathSync(cloneDir), realpathSync(dir));\n if (isAbsolute(relation) || relation === \"..\" || relation.startsWith(`..${sep}`)) {\n throw new Error(`Subpath escapes repository: ${parsed.subpath}`);\n }\n return dir;\n}\n\nfunction git(cwd: string, args: string[]): string {\n return execFileSync(\"git\", args, {\n cwd,\n timeout: GIT_TIMEOUT_MS,\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n env: {\n ...process.env,\n // Never block a portal save on an interactive credential prompt.\n GIT_TERMINAL_PROMPT: \"0\",\n GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND ?? \"ssh -o BatchMode=yes -o ConnectTimeout=10\",\n },\n });\n}\n\nfunction describeRef(parsed: Extract<ParsedSource, { type: \"git\" }>): string {\n return parsed.ref ? `${parsed.url} at ${parsed.ref}` : parsed.url;\n}\n\n/** Prefer git's stderr over the generic \"Command failed\" wrapper. */\nfunction gitErrorText(err: unknown): string {\n if (err && typeof err === \"object\" && \"stderr\" in err) {\n const stderr = (err as { stderr?: unknown }).stderr;\n const text = typeof stderr === \"string\" ? stderr.trim() : \"\";\n if (text) return text.split(\"\\n\").slice(-3).join(\" \");\n }\n return err instanceof Error ? err.message : String(err);\n}\n\n// ── Inspection ────────────────────────────────────────────────────────────────\n\n/**\n * The administrator's view of a conversation's packages: what each scope\n * declares, whether it is actually on disk, and what it contributes.\n *\n * Resolution answers \"what loads\"; inspection answers \"why is this not\n * loading\", which is the question someone staring at the portal has. A source\n * that failed to fetch, or one shadowed by the conversation's own copy, is\n * absent from the resolved set — reporting only the survivors would leave the\n * admin with a silently short list and nothing to act on.\n */\n\nexport type { PackageInventory } from \"./types.js\";\n\n/**\n * Inventory both scopes for one conversation. Never throws and never fetches:\n * the portal renders this on page load, so it reports the current on-disk\n * truth rather than going to the network behind the admin's back.\n */\nexport async function inspectConversationPackages(\n options: ResolvePackagesOptions,\n): Promise<PackageInventory> {\n const conversationIdentities = new Set(\n declaredSources(\"conversation\", options).map(safeIdentityOrEmpty).filter(Boolean),\n );\n\n return {\n global: await Promise.all(\n declaredSources(\"global\", options).map((source) =>\n describe(source, \"global\", options, conversationIdentities),\n ),\n ),\n conversation: await Promise.all(\n declaredSources(\"conversation\", options).map((source) =>\n describe(source, \"conversation\", options, new Set()),\n ),\n ),\n };\n}\n\n/** Sources one scope declares, or an empty list when its settings are unreadable. */\nfunction declaredSources(scope: PackageScope, options: ResolvePackagesOptions): string[] {\n try {\n const settings =\n scope === \"global\" ? loadGlobalSettings() : resolveConversationSettings(options.office);\n return settings.packages ?? [];\n } catch {\n return [];\n }\n}\n\nfunction safeIdentityOrEmpty(source: string): string {\n try {\n return sourceIdentity(parseSource(source));\n } catch {\n return \"\";\n }\n}\n\nasync function describe(\n source: string,\n scope: PackageScope,\n options: ResolvePackagesOptions,\n shadowedBy: Set<string>,\n): Promise<PackageStatus> {\n const base: PackageStatus = { source, scope, ready: false, skills: [] };\n\n let identity: string;\n try {\n identity = sourceIdentity(parseSource(source));\n } catch (err) {\n return { ...base, error: messageOf(err) };\n }\n\n let dir: string;\n try {\n dir = materializeSource(source, {\n scope,\n address: options.office.address,\n stateDir: options.office.workspace.stateDir,\n mode: \"offline\",\n }).dir;\n } catch (err) {\n return { ...base, error: messageOf(err) };\n }\n\n return {\n ...base,\n ready: true,\n dir,\n ...(shadowedBy.has(identity) ? { shadowed: true } : {}),\n skills: contributedSkills(dir),\n };\n}\n\nfunction contributedSkills(dir: string): string[] {\n const skillsDir = join(dir, \"skills\");\n return loadSkillsFromDir({ dir: skillsDir, source: \"package\", rejectSymlinks: true }).skills.map(\n (skill) => skill.name,\n );\n}\n\n// ── Resolution & skill mounts ─────────────────────────────────────────────────\n\n/**\n * What a conversation actually loads: the two scopes' declared packages\n * combined, collisions resolved, and each surviving package turned into the\n * skill directories the runner consumes.\n *\n * Two rules do all the work here:\n *\n * - **Additive scopes.** `global` packages load for every conversation; a\n * conversation's packages load on top. Neither list replaces the other.\n * - **Narrower scope wins.** When both scopes declare the same package\n * ({@link sourceIdentity}, which ignores the ref), only the conversation's\n * copy loads. That is what makes \"pin this one channel to v2 while everyone\n * else stays on v1\" work, and it is why the same package installed twice\n * cannot activate twice.\n *\n * Resolution never throws. A conversation with one malformed or unfetchable\n * source still loads every other package, and the failure is reported through\n * {@link ResolvedPackages.errors} for the portal and the logs. The alternative\n * — one bad string in settings taking a conversation offline — is a far worse\n * failure mode than a missing feature.\n */\n\nexport type { ResolvePackagesOptions, ResolvedPackages } from \"./types.js\";\n\n/** Conventional resource directory inside a package, mirroring pi's layout. */\nconst SKILLS_SUBDIR = \"skills\";\n/** Slug length cap; long identities keep a digest tail instead of colliding. */\nconst SLUG_MAX_LENGTH = 96;\n\n/**\n * Where package resources appear inside the sandbox.\n *\n * Deliberately OUTSIDE `/workspace`. In `full` workspace-mount mode\n * `/workspace` is the entire working directory, so a `/workspace/packages`\n * mount would shadow a real `packages/` directory in the user's tree — mikan's\n * own repository has one. Living outside also keeps\n * `translateMountedRuntimePathToHost` correct by construction: it maps only\n * the `/workspace` prefix and returns everything else untouched, so a package\n * path can never be mistranslated into a host path that does not exist.\n *\n * Skills are referenced by absolute path in the system prompt, so the location\n * costs nothing in usability.\n */\nconst PACKAGE_RUNTIME_ROOT = \"/mikan/packages\";\n\n/** Runtime path a package's skills directory is mounted at. */\nexport function packageSkillRuntimeDir(slug: string): string {\n return `${PACKAGE_RUNTIME_ROOT}/${slug}/${SKILLS_SUBDIR}`;\n}\n\n/**\n * Read-only mounts exposing every resolved package's skills to the sandbox.\n *\n * Read-only rather than read-write because the host owns these files: the\n * directory is a git checkout that an update replaces wholesale, so an agent\n * edit would be silently discarded on the next refresh. Making the filesystem\n * refuse the write turns a confusing data-loss bug into an obvious error.\n *\n * This pure step consumes an already resolved package set and never reaches the network.\n */\nexport function conversationPackageSkillMounts(\n packages: ResolvedPackages,\n): Array<{ source: string; target: string; readOnly: true }> {\n return packages.skillDirs.flatMap(({ slug, dir }) =>\n isNonSymlinkDirectory(dir)\n ? [{ source: dir, target: packageSkillRuntimeDir(slug), readOnly: true as const }]\n : [],\n );\n}\n\n/**\n * Resolve the package set for one conversation. Reads both scopes' settings,\n * dedups, and reports the directories to load from.\n */\nexport function resolveConversationPackages(options: ResolvePackagesOptions): ResolvedPackages {\n const declarations = [...readScope(\"global\", options), ...readScope(\"conversation\", options)];\n\n const errors: PackageError[] = [];\n const byIdentity = new Map<string, MaterializedPackage>();\n\n for (const declaration of declarations) {\n let identity: string;\n try {\n identity = sourceIdentity(parseSource(declaration.source));\n } catch (err) {\n errors.push({ source: declaration.source, message: messageOf(err) });\n continue;\n }\n // Later scopes overwrite earlier ones: global is read first, so a\n // conversation declaring the same package shadows it.\n const existing = byIdentity.get(identity);\n if (existing && existing.scope !== declaration.scope) {\n log.logInfo(`Package ${identity} declared in both scopes; using the conversation's copy`);\n }\n const materialized = materialize(declaration, options, errors);\n if (materialized) byIdentity.set(identity, materialized);\n else byIdentity.delete(identity);\n }\n\n const packages = [...byIdentity.values()].toSorted(scopeOrder);\n return {\n packages,\n skillDirs: packages.flatMap(packageSkillDir),\n errors,\n };\n}\n\ninterface Declaration {\n source: string;\n scope: PackageScope;\n}\n\nfunction readScope(scope: PackageScope, options: ResolvePackagesOptions): Declaration[] {\n try {\n const sources =\n scope === \"global\"\n ? loadGlobalSettings().packages\n : resolveConversationSettings(options.office).packages;\n return (sources ?? []).map((source) => ({ source, scope }));\n } catch (err) {\n // Unreadable settings must not take the conversation down; the other\n // scope, and the convention directories, still load.\n log.logWarning(`Could not read ${scope} package list`, messageOf(err));\n return [];\n }\n}\n\nfunction materialize(\n declaration: Declaration,\n options: ResolvePackagesOptions,\n errors: PackageError[],\n): MaterializedPackage | undefined {\n try {\n return materializeSource(declaration.source, {\n scope: declaration.scope,\n address: options.office.address,\n stateDir: options.office.workspace.stateDir,\n mode: options.fetchMissing ? \"fetch\" : \"offline\",\n });\n } catch (err) {\n errors.push({ source: declaration.source, message: messageOf(err) });\n return undefined;\n }\n}\n\nfunction packageSkillDir(pkg: MaterializedPackage): PackageSkillDir[] {\n const dir = join(pkg.dir, SKILLS_SUBDIR);\n return isNonSymlinkDirectory(dir) ? [{ slug: packageSlug(pkg), dir }] : [];\n}\n\nfunction isNonSymlinkDirectory(path: string): boolean {\n if (!existsSync(path)) return false;\n try {\n const stats = lstatSync(path);\n return !stats.isSymbolicLink() && stats.isDirectory();\n } catch (err) {\n log.logWarning(`Could not inspect package skills directory ${path}`, messageOf(err));\n return false;\n }\n}\n\n/**\n * Filesystem-safe, collision-resistant name for a package, used as the mount\n * path segment for its skills. Derived from the identity rather than the\n * source string so the same package spelled two ways gets one name.\n */\nfunction packageSlug(pkg: MaterializedPackage): string {\n const readable = pkg.identity\n .replace(/^(git|local):/, \"\")\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n if (readable.length <= SLUG_MAX_LENGTH) return readable;\n // Truncation alone would let two long identities sharing a prefix (deeply\n // nested self-hosted groups, file:// paths) land on the same slug — and\n // therefore the same mount target, where one package's skills would quietly\n // replace the other's. The digest makes the tail collision-resistant.\n const digest = createHash(\"sha256\").update(pkg.identity).digest(\"hex\").slice(0, 8);\n return `${readable.slice(0, SLUG_MAX_LENGTH - digest.length - 1)}-${digest}`;\n}\n\n/** Global packages load before conversation ones. */\nfunction scopeRank(scope: PackageScope): number {\n return scope === \"global\" ? 0 : 1;\n}\n\nfunction scopeOrder(a: MaterializedPackage, b: MaterializedPackage): number {\n return scopeRank(a.scope) - scopeRank(b.scope);\n}\n\nfunction messageOf(err: unknown): string {\n return err instanceof Error ? err.message : String(err);\n}\n\n// ── Admin operations ──────────────────────────────────────────────────────────\n\n/**\n * The write operations behind the admin portal's package panels.\n *\n * The ordering here is the whole point: **materialize first, persist second.**\n * A source is fetched and validated while the person who typed it is still\n * looking at the form, so a typo, a private repo, a bad `#subpath`, or a repo\n * with no skills in it fails in front of them. Persisting first and\n * fetching at load time would turn every one of those into \"the bot just\n * doesn't have the skill\", discovered later and usually by someone else.\n */\n\nexport type { PackageAdminContext, PackageWriteResult } from \"./types.js\";\n\n/**\n * Add a source to a scope, or move an existing one to a new ref. Fetches and\n * validates before writing, and is idempotent: adding a source already present\n * re-materializes it and leaves the list unchanged.\n */\nexport function addPackage(\n scope: PackageScope,\n rawSource: string,\n context: PackageAdminContext,\n): PackageWriteResult {\n const source = formatSource(parseSource(rawSource));\n const materialized = materializeSource(source, {\n scope,\n address: context.office.address,\n stateDir: context.office.workspace.stateDir,\n mode: \"fetch\",\n });\n\n const existing = declaredSources(scope, context);\n // Replace any entry for the same package so re-adding with a new ref moves\n // the pin instead of leaving two conflicting lines in settings.\n const identity = sameIdentityFilter(source);\n writePackages(scope, [...existing.filter((entry) => !identity(entry)), source], context);\n return { source, dir: materialized.dir };\n}\n\n/**\n * Drop a source from a scope's list. The materialized clone is left on disk —\n * removal is a declaration change, and keeping the checkout makes re-adding\n * instant and lets an admin undo a mistake without a network round trip.\n */\nexport function removePackage(\n scope: PackageScope,\n rawSource: string,\n context: PackageAdminContext,\n): boolean {\n const existing = declaredSources(scope, context);\n const remaining = existing.filter((entry) => entry !== rawSource);\n if (remaining.length === existing.length) return false;\n writePackages(scope, remaining, context);\n return true;\n}\n\n/** Re-fetch a package that is already declared, moving it to its ref's current tip. */\nexport function refreshPackage(\n scope: PackageScope,\n rawSource: string,\n context: PackageAdminContext,\n): PackageWriteResult {\n if (!declaredSources(scope, context).includes(rawSource)) {\n throw new Error(`Not declared in the ${scope} scope: ${rawSource}`);\n }\n const materialized = materializeSource(rawSource, {\n scope,\n address: context.office.address,\n stateDir: context.office.workspace.stateDir,\n mode: \"refresh\",\n });\n return { source: rawSource, dir: materialized.dir };\n}\n\nfunction sameIdentityFilter(source: string): (entry: string) => boolean {\n const target = safeIdentity(source);\n return (entry) => safeIdentity(entry) === target;\n}\n\n/**\n * Identity of a declared entry, falling back to the raw string when it does\n * not parse. A malformed entry must still be matchable so an admin can replace\n * or remove the exact line they typed.\n */\nfunction safeIdentity(source: string): string {\n try {\n return sourceIdentity(parseSource(source));\n } catch {\n return `raw:${source}`;\n }\n}\n\n/**\n * Writes go through the settings-mutation seam rather than touching config\n * directly, so package edits obey the same runner-cache policy as every other\n * portal write. Packages are not a cached-runner key, so this writes and\n * leaves live conversations alone until their next harness instance.\n */\nfunction writePackages(\n scope: PackageScope,\n packages: string[],\n context: PackageAdminContext,\n): void {\n if (scope === \"global\") {\n applyGlobalSettings(context.runtime, { packages });\n return;\n }\n const result = applyConversationSettings(context.runtime, context.office, {\n packages,\n });\n if (!result.ok) throw new Error(\"Conversation is busy; try again when the current run ends\");\n}\n"]}
@@ -22,8 +22,7 @@ interface GitSource {
22
22
  }
23
23
  /**
24
24
  * A directory on the mikan host, used by reference — never copied. Editing the
25
- * directory is picked up by the next harness instance, which is what makes
26
- * host-side development of an extension bearable.
25
+ * directory is picked up by the next runner materialization.
27
26
  */
28
27
  interface LocalSource {
29
28
  type: "local";
@@ -58,8 +57,6 @@ export interface PackageError {
58
57
  }
59
58
  export interface ResolvedPackages {
60
59
  packages: MaterializedPackage[];
61
- extensionDirs: string[];
62
- extensionRoots: string[];
63
60
  skillDirs: PackageSkillDir[];
64
61
  errors: PackageError[];
65
62
  }
@@ -86,7 +83,6 @@ export interface PackageStatus {
86
83
  error?: string;
87
84
  dir?: string;
88
85
  shadowed?: boolean;
89
- extensions: string[];
90
86
  skills: string[];
91
87
  }
92
88
  export interface PackageInventory {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/packages/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/F,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEzC,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,cAAc,CAAC;AAErD;;;;GAIG;AACH,UAAU,SAAS;IACjB,IAAI,EAAE,KAAK,CAAC;IACZ,4DAA4D;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,UAAU,WAAW;IAC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E,CAAC;IACxB,YAAY,EAAE,aAAa,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IACjE,OAAO,CAAC,EAAE,kBAAkB,GAAG,wBAAwB,CAAC;CACzD;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/packages/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A package source as written by a human: the string stored in `packages[]`\n * in global or conversation settings, and the string typed into the admin\n * portal. Parsing it is {@link parseSource}'s job.\n */\nimport type { Office } from \"../office/types.js\";\nimport type { GlobalRunnerCacheControl, OfficeAddress, RunnerCacheControl } from \"../types.js\";\n\nexport type PackageSourceString = string;\n\n/** Scope a package belongs to. `global` spans every conversation. */\nexport type PackageScope = \"global\" | \"conversation\";\n\n/**\n * A git source. `ref` is a tag, branch, or commit — absent means \"whatever the\n * remote's default branch points at now\", which only moves on an explicit\n * update. `subpath` addresses a package inside a larger repository.\n */\ninterface GitSource {\n type: \"git\";\n /** Clone URL handed to `git`, after shorthand expansion. */\n url: string;\n ref?: string;\n subpath?: string;\n}\n\n/**\n * A directory on the mikan host, used by reference — never copied. Editing the\n * directory is picked up by the next harness instance, which is what makes\n * host-side development of an extension bearable.\n */\ninterface LocalSource {\n type: \"local\";\n path: string;\n}\n\nexport type ParsedSource = GitSource | LocalSource;\n\n/**\n * Stable identity of a package, independent of version and of the scope it is\n * installed in. Two sources with the same identity are the same package, so\n * the conversation scope's copy can shadow the global one.\n *\n * Deliberately excludes the ref: `…/repo@v1` in global and `…/repo@v2` in a\n * conversation are one package pinned two ways, and the conversation wins.\n */\nexport type PackageIdentity = string;\n\n/** Where a materialized package's files live, plus how it got there. */\nexport interface MaterializedPackage {\n source: PackageSourceString;\n parsed: ParsedSource;\n identity: PackageIdentity;\n /**\n * Directory holding the package's files. For git this is inside the state\n * dir (a clone, plus `subpath`); for local it is the referenced path itself.\n */\n dir: string;\n scope: PackageScope;\n}\n\n/** A source that failed to materialize, reported back to whoever asked. */\nexport interface PackageError {\n source: PackageSourceString;\n message: string;\n}\n\nexport interface ResolvedPackages {\n packages: MaterializedPackage[];\n extensionDirs: string[];\n extensionRoots: string[];\n skillDirs: PackageSkillDir[];\n errors: PackageError[];\n}\n\nexport interface PackageSkillDir {\n slug: string;\n dir: string;\n}\n\nexport interface ResolvePackagesOptions {\n /** Office whose packages resolve; identity and state-dir keys derive from it. */\n office: Office;\n fetchMissing?: boolean;\n}\n\nexport type MaterializeMode = \"offline\" | \"fetch\" | \"refresh\";\n\nexport interface MaterializeOptions {\n scope: PackageScope;\n address?: OfficeAddress;\n stateDir: string;\n mode?: MaterializeMode;\n}\n\nexport interface PackageStatus {\n source: string;\n scope: PackageScope;\n ready: boolean;\n error?: string;\n dir?: string;\n shadowed?: boolean;\n extensions: string[];\n skills: string[];\n}\n\nexport interface PackageInventory {\n global: PackageStatus[];\n conversation: PackageStatus[];\n}\n\nexport interface PackageAdminContext extends ResolvePackagesOptions {\n runtime?: RunnerCacheControl & GlobalRunnerCacheControl;\n}\n\nexport interface PackageWriteResult {\n source: string;\n dir: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/packages/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A package source as written by a human: the string stored in `packages[]`\n * in global or conversation settings, and the string typed into the admin\n * portal. Parsing it is {@link parseSource}'s job.\n */\nimport type { Office } from \"../office/types.js\";\nimport type { GlobalRunnerCacheControl, OfficeAddress, RunnerCacheControl } from \"../types.js\";\n\nexport type PackageSourceString = string;\n\n/** Scope a package belongs to. `global` spans every conversation. */\nexport type PackageScope = \"global\" | \"conversation\";\n\n/**\n * A git source. `ref` is a tag, branch, or commit — absent means \"whatever the\n * remote's default branch points at now\", which only moves on an explicit\n * update. `subpath` addresses a package inside a larger repository.\n */\ninterface GitSource {\n type: \"git\";\n /** Clone URL handed to `git`, after shorthand expansion. */\n url: string;\n ref?: string;\n subpath?: string;\n}\n\n/**\n * A directory on the mikan host, used by reference — never copied. Editing the\n * directory is picked up by the next runner materialization.\n */\ninterface LocalSource {\n type: \"local\";\n path: string;\n}\n\nexport type ParsedSource = GitSource | LocalSource;\n\n/**\n * Stable identity of a package, independent of version and of the scope it is\n * installed in. Two sources with the same identity are the same package, so\n * the conversation scope's copy can shadow the global one.\n *\n * Deliberately excludes the ref: `…/repo@v1` in global and `…/repo@v2` in a\n * conversation are one package pinned two ways, and the conversation wins.\n */\nexport type PackageIdentity = string;\n\n/** Where a materialized package's files live, plus how it got there. */\nexport interface MaterializedPackage {\n source: PackageSourceString;\n parsed: ParsedSource;\n identity: PackageIdentity;\n /**\n * Directory holding the package's files. For git this is inside the state\n * dir (a clone, plus `subpath`); for local it is the referenced path itself.\n */\n dir: string;\n scope: PackageScope;\n}\n\n/** A source that failed to materialize, reported back to whoever asked. */\nexport interface PackageError {\n source: PackageSourceString;\n message: string;\n}\n\nexport interface ResolvedPackages {\n packages: MaterializedPackage[];\n skillDirs: PackageSkillDir[];\n errors: PackageError[];\n}\n\nexport interface PackageSkillDir {\n slug: string;\n dir: string;\n}\n\nexport interface ResolvePackagesOptions {\n /** Office whose packages resolve; identity and state-dir keys derive from it. */\n office: Office;\n fetchMissing?: boolean;\n}\n\nexport type MaterializeMode = \"offline\" | \"fetch\" | \"refresh\";\n\nexport interface MaterializeOptions {\n scope: PackageScope;\n address?: OfficeAddress;\n stateDir: string;\n mode?: MaterializeMode;\n}\n\nexport interface PackageStatus {\n source: string;\n scope: PackageScope;\n ready: boolean;\n error?: string;\n dir?: string;\n shadowed?: boolean;\n skills: string[];\n}\n\nexport interface PackageInventory {\n global: PackageStatus[];\n conversation: PackageStatus[];\n}\n\nexport interface PackageAdminContext extends ResolvePackagesOptions {\n runtime?: RunnerCacheControl & GlobalRunnerCacheControl;\n}\n\nexport interface PackageWriteResult {\n source: string;\n dir: string;\n}\n"]}
@@ -0,0 +1,19 @@
1
+ interface ProcessShutdownOptions {
2
+ stop: () => Promise<void>;
3
+ flush: () => Promise<boolean>;
4
+ captureError: (error: Error) => void;
5
+ warn: (message: string, details?: string) => void;
6
+ exit: (code: number) => void;
7
+ }
8
+ /** Run every shutdown phase in order without letting one failure skip the rest. */
9
+ export declare function runShutdownSteps(steps: readonly {
10
+ name: string;
11
+ run: () => Promise<void>;
12
+ }[]): Promise<void>;
13
+ /**
14
+ * Owns process-signal shutdown policy: one graceful attempt, then a forced
15
+ * non-zero exit when another signal says the operator no longer wants to wait.
16
+ */
17
+ export declare function createProcessShutdownHandler(options: ProcessShutdownOptions): (signal: NodeJS.Signals) => Promise<void>;
18
+ export {};
19
+ //# sourceMappingURL=process-lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-lifecycle.d.ts","sourceRoot":"","sources":["../src/process-lifecycle.ts"],"names":[],"mappings":"AAAA,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACrC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAMD,mFAAmF;AACnF,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,EAAE,GAC3D,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,sBAAsB,GAC9B,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAqC3C"}
@@ -0,0 +1,60 @@
1
+ function asError(error) {
2
+ return error instanceof Error ? error : new Error(String(error));
3
+ }
4
+ /** Run every shutdown phase in order without letting one failure skip the rest. */
5
+ export async function runShutdownSteps(steps) {
6
+ const failures = [];
7
+ for (const step of steps) {
8
+ try {
9
+ await step.run();
10
+ }
11
+ catch (error) {
12
+ const failure = asError(error);
13
+ failures.push(new Error(`${step.name}: ${failure.message}`, { cause: failure }));
14
+ }
15
+ }
16
+ if (failures.length > 0)
17
+ throw new AggregateError(failures, "Graceful shutdown failed");
18
+ }
19
+ /**
20
+ * Owns process-signal shutdown policy: one graceful attempt, then a forced
21
+ * non-zero exit when another signal says the operator no longer wants to wait.
22
+ */
23
+ export function createProcessShutdownHandler(options) {
24
+ let shutdown;
25
+ let forced = false;
26
+ return function handleSignal(signal) {
27
+ if (shutdown) {
28
+ forced = true;
29
+ options.warn(`Received ${signal} during shutdown; forcing exit`);
30
+ options.exit(1);
31
+ return Promise.resolve();
32
+ }
33
+ shutdown = (async () => {
34
+ let exitCode = 0;
35
+ try {
36
+ await options.stop();
37
+ }
38
+ catch (error) {
39
+ const failure = asError(error);
40
+ exitCode = 1;
41
+ options.warn("Graceful shutdown failed", failure.message);
42
+ options.captureError(failure);
43
+ }
44
+ try {
45
+ if (!(await options.flush())) {
46
+ exitCode = 1;
47
+ options.warn("Sentry flush timed out during shutdown");
48
+ }
49
+ }
50
+ catch (error) {
51
+ exitCode = 1;
52
+ options.warn("Sentry flush failed during shutdown", asError(error).message);
53
+ }
54
+ if (!forced)
55
+ options.exit(exitCode);
56
+ })();
57
+ return shutdown;
58
+ };
59
+ }
60
+ //# sourceMappingURL=process-lifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-lifecycle.js","sourceRoot":"","sources":["../src/process-lifecycle.ts"],"names":[],"mappings":"AAQA,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,KAAK,YAAY,KAA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AAC;YACvB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC/B,QAAQ,GAAG,CAAC,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC1D,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAChC,CAAC;YAED,IAAI,CAAC;gBACH,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;oBAC7B,QAAQ,GAAG,CAAC,CAAC;oBACb,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;gBACzD,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,QAAQ,GAAG,CAAC,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,qCAAqC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;YAC9E,CAAC;YAED,IAAI,CAAC,MAAM;gBAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["interface ProcessShutdownOptions {\n stop: () => Promise<void>;\n flush: () => Promise<boolean>;\n captureError: (error: Error) => void;\n warn: (message: string, details?: string) => void;\n exit: (code: number) => void;\n}\n\nfunction asError(error: unknown): Error {\n return error instanceof Error ? error : new Error(String(error));\n}\n\n/** Run every shutdown phase in order without letting one failure skip the rest. */\nexport async function runShutdownSteps(\n steps: readonly { name: string; run: () => Promise<void> }[],\n): Promise<void> {\n const failures: Error[] = [];\n for (const step of steps) {\n try {\n await step.run();\n } catch (error) {\n const failure = asError(error);\n failures.push(new Error(`${step.name}: ${failure.message}`, { cause: failure }));\n }\n }\n if (failures.length > 0) throw new AggregateError(failures, \"Graceful shutdown failed\");\n}\n\n/**\n * Owns process-signal shutdown policy: one graceful attempt, then a forced\n * non-zero exit when another signal says the operator no longer wants to wait.\n */\nexport function createProcessShutdownHandler(\n options: ProcessShutdownOptions,\n): (signal: NodeJS.Signals) => Promise<void> {\n let shutdown: Promise<void> | undefined;\n let forced = false;\n\n return function handleSignal(signal: NodeJS.Signals): Promise<void> {\n if (shutdown) {\n forced = true;\n options.warn(`Received ${signal} during shutdown; forcing exit`);\n options.exit(1);\n return Promise.resolve();\n }\n\n shutdown = (async () => {\n let exitCode = 0;\n try {\n await options.stop();\n } catch (error) {\n const failure = asError(error);\n exitCode = 1;\n options.warn(\"Graceful shutdown failed\", failure.message);\n options.captureError(failure);\n }\n\n try {\n if (!(await options.flush())) {\n exitCode = 1;\n options.warn(\"Sentry flush timed out during shutdown\");\n }\n } catch (error) {\n exitCode = 1;\n options.warn(\"Sentry flush failed during shutdown\", asError(error).message);\n }\n\n if (!forced) options.exit(exitCode);\n })();\n return shutdown;\n };\n}\n"]}
@@ -1,12 +1,5 @@
1
- export type { ContainerMount, DockerContainerManagerOptions, ProvisionOptions, ResourceLimits, SandboxLimitStatus, } from "./types.js";
2
- import type { DockerContainerManagerOptions, ProvisionOptions, ResourceLimits, SandboxLimitStatus } from "./types.js";
3
- /**
4
- * Rewrites one docker bind spec (`src:dst[:ro]`) from the legacy raw-id
5
- * layout to the office-key layout. Returns the spec unchanged when nothing in
6
- * it needs translation; a container whose binds are all unchanged is already
7
- * on the current layout.
8
- */
9
- export type ContainerBindTranslator = (bindSpec: string) => string;
1
+ export type { ContainerBindTranslator, ContainerMount, DockerContainerManagerOptions, ProvisionOptions, ResourceLimits, SandboxLimitStatus, } from "./types.js";
2
+ import type { ContainerBindTranslator, DockerContainerManagerOptions, ProvisionOptions, ResourceLimits, SandboxLimitStatus } from "./types.js";
10
3
  export declare class DockerContainerManager {
11
4
  private readonly image;
12
5
  private state;
@@ -1 +1 @@
1
- {"version":3,"file":"provisioner.d.ts","sourceRoot":"","sources":["../src/provis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AS/B,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,SAAS;YAQH,sBAAsB;IAgBpC,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,sBAAsB;YAoBhB,iBAAiB;YAqBjB,mBAAmB;YAWnB,aAAa;YAwBb,aAAa;YAeb,yBAAyB;YAsBzB,0BAA0B;IAoBxC,OAAO,CAAC,cAAc;YAOR,uBAAuB;IAwBrC,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,6BAA6B;IAOrC,6EAA6E;YAC/D,oBAAoB;YAiBpB,qBAAqB;CAOpC"}
@@ -4,7 +4,6 @@ import { createHash } from "node:crypto";
4
4
  import { readFileSync, statSync } from "node:fs";
5
5
  import { promisify } from "node:util";
6
6
  import * as log from "./log.js";
7
- import { readEnv } from "./env-manifest.js";
8
7
  import { reportUserFacingError } from "./observability/sentry.js";
9
8
  const execFileAsync = promisify(execFile);
10
9
  function isDockerNotFoundError(err) {
@@ -81,14 +80,7 @@ export class DockerContainerManager {
81
80
  if (status !== "missing" &&
82
81
  (await this.hasRuntimeDrift(containerKey, containerName, mounts))) {
83
82
  log.logInfo(`Container ${containerName} configuration changed; recreating container`);
84
- if (readEnv("SKIP_CONTAINER_PRESERVATION") === "1") {
85
- await this.execFileImpl("docker", ["rm", "-f", containerName]);
86
- await this.removeMigrateSnapshot(containerName);
87
- await this.runContainer(containerKey, containerName, mounts, options);
88
- }
89
- else {
90
- await this.recreateContainerPreservingContents(containerKey, containerName, mounts);
91
- }
83
+ await this.recreateContainerPreservingContents(containerKey, containerName, mounts);
92
84
  log.logInfo(`Container ${containerName} recreated`);
93
85
  }
94
86
  else if (status === "running") {
@@ -804,12 +796,11 @@ export class DockerContainerManager {
804
796
  `{{.State.Running}}\t{{.State.StartedAt}}\t{{index .Config.Labels "${DockerContainerManager.VAULT_ID_LABEL_KEY}"}}\t{{index .Config.Labels "${DockerContainerManager.CONVERSATION_ID_LABEL_KEY}"}}`,
805
797
  containerName,
806
798
  ]);
807
- const [runningRaw, startedAtRaw, vaultIdRaw, conversationIdRaw] = stdout.trim().split("\t");
799
+ const [runningRaw, startedAtRaw, , conversationIdRaw] = stdout.trim().split("\t");
808
800
  const running = runningRaw === "true";
809
801
  const startedAtMs = this.parseDockerTimestamp(startedAtRaw);
810
- const vaultId = this.normalizeDockerValue(vaultIdRaw);
811
802
  const conversationId = this.normalizeDockerValue(conversationIdRaw);
812
- return { running, startedAtMs, vaultId, conversationId };
803
+ return { running, startedAtMs, conversationId };
813
804
  }
814
805
  catch (err) {
815
806
  log.logWarning(`Failed to inspect container ${containerName} during reconcile`, err instanceof Error ? err.message : String(err));