@geminixiang/mikan 1.0.0-beta.44 → 1.0.0-beta.46

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 (422) hide show
  1. package/CHANGELOG.md +32 -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 +3 -1
  7. package/dist/adapters/discord/bot.d.ts.map +1 -1
  8. package/dist/adapters/discord/bot.js +143 -141
  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.map +1 -1
  18. package/dist/adapters/github/bot.js +1 -4
  19. package/dist/adapters/github/bot.js.map +1 -1
  20. package/dist/adapters/github/context.d.ts +2 -9
  21. package/dist/adapters/github/context.d.ts.map +1 -1
  22. package/dist/adapters/github/context.js.map +1 -1
  23. package/dist/adapters/github/github-ops.d.ts +4 -17
  24. package/dist/adapters/github/github-ops.d.ts.map +1 -1
  25. package/dist/adapters/github/github-ops.js +17 -86
  26. package/dist/adapters/github/github-ops.js.map +1 -1
  27. package/dist/adapters/github/tool-pack.d.ts.map +1 -1
  28. package/dist/adapters/github/tool-pack.js +0 -1
  29. package/dist/adapters/github/tool-pack.js.map +1 -1
  30. package/dist/adapters/github/tools/checks.d.ts +0 -1
  31. package/dist/adapters/github/tools/checks.d.ts.map +1 -1
  32. package/dist/adapters/github/tools/checks.js +3 -22
  33. package/dist/adapters/github/tools/checks.js.map +1 -1
  34. package/dist/adapters/github/types.d.ts +0 -33
  35. package/dist/adapters/github/types.d.ts.map +1 -1
  36. package/dist/adapters/github/types.js.map +1 -1
  37. package/dist/adapters/progressive-renderer.d.ts.map +1 -1
  38. package/dist/adapters/progressive-renderer.js +311 -318
  39. package/dist/adapters/progressive-renderer.js.map +1 -1
  40. package/dist/adapters/slack/blocks.d.ts.map +1 -1
  41. package/dist/adapters/slack/blocks.js +1 -4
  42. package/dist/adapters/slack/blocks.js.map +1 -1
  43. package/dist/adapters/slack/bot.d.ts +12 -0
  44. package/dist/adapters/slack/bot.d.ts.map +1 -1
  45. package/dist/adapters/slack/bot.js +158 -178
  46. package/dist/adapters/slack/bot.js.map +1 -1
  47. package/dist/adapters/slack/context.d.ts +2 -8
  48. package/dist/adapters/slack/context.d.ts.map +1 -1
  49. package/dist/adapters/slack/context.js +1 -1
  50. package/dist/adapters/slack/context.js.map +1 -1
  51. package/dist/adapters/slack/response-lifecycle.d.ts.map +1 -1
  52. package/dist/adapters/slack/response-lifecycle.js +135 -123
  53. package/dist/adapters/slack/response-lifecycle.js.map +1 -1
  54. package/dist/adapters/slack/stream-limits.d.ts +1 -1
  55. package/dist/adapters/slack/stream-limits.js +1 -1
  56. package/dist/adapters/slack/stream-limits.js.map +1 -1
  57. package/dist/adapters/slack/types.d.ts +4 -0
  58. package/dist/adapters/slack/types.d.ts.map +1 -1
  59. package/dist/adapters/slack/types.js.map +1 -1
  60. package/dist/adapters/telegram/context.d.ts +2 -8
  61. package/dist/adapters/telegram/context.d.ts.map +1 -1
  62. package/dist/adapters/telegram/context.js +1 -2
  63. package/dist/adapters/telegram/context.js.map +1 -1
  64. package/dist/adapters/types.d.ts +11 -5
  65. package/dist/adapters/types.d.ts.map +1 -1
  66. package/dist/adapters/types.js.map +1 -1
  67. package/dist/agent/catalog.d.ts +6 -18
  68. package/dist/agent/catalog.d.ts.map +1 -1
  69. package/dist/agent/catalog.js +19 -155
  70. package/dist/agent/catalog.js.map +1 -1
  71. package/dist/agent/execution.d.ts +0 -7
  72. package/dist/agent/execution.d.ts.map +1 -1
  73. package/dist/agent/execution.js +23 -21
  74. package/dist/agent/execution.js.map +1 -1
  75. package/dist/agent/presenter.d.ts +7 -9
  76. package/dist/agent/presenter.d.ts.map +1 -1
  77. package/dist/agent/presenter.js +355 -357
  78. package/dist/agent/presenter.js.map +1 -1
  79. package/dist/agent/prompt.d.ts +5 -12
  80. package/dist/agent/prompt.d.ts.map +1 -1
  81. package/dist/agent/prompt.js +56 -81
  82. package/dist/agent/prompt.js.map +1 -1
  83. package/dist/agent/runner.d.ts +0 -7
  84. package/dist/agent/runner.d.ts.map +1 -1
  85. package/dist/agent/runner.js +255 -308
  86. package/dist/agent/runner.js.map +1 -1
  87. package/dist/agent/types.d.ts +21 -17
  88. package/dist/agent/types.d.ts.map +1 -1
  89. package/dist/agent/types.js +0 -1
  90. package/dist/agent/types.js.map +1 -1
  91. package/dist/cli/boot.d.ts.map +1 -1
  92. package/dist/cli/boot.js +7 -10
  93. package/dist/cli/boot.js.map +1 -1
  94. package/dist/cli/onboard.d.ts +10 -0
  95. package/dist/cli/onboard.d.ts.map +1 -0
  96. package/dist/cli/onboard.js +237 -0
  97. package/dist/cli/onboard.js.map +1 -0
  98. package/dist/cli/types.d.ts +8 -3
  99. package/dist/cli/types.d.ts.map +1 -1
  100. package/dist/cli/types.js.map +1 -1
  101. package/dist/commands/auto-reply.d.ts.map +1 -1
  102. package/dist/commands/auto-reply.js +5 -12
  103. package/dist/commands/auto-reply.js.map +1 -1
  104. package/dist/commands/manifest.d.ts.map +1 -1
  105. package/dist/commands/manifest.js +9 -16
  106. package/dist/commands/manifest.js.map +1 -1
  107. package/dist/commands/new.d.ts.map +1 -1
  108. package/dist/commands/new.js +15 -10
  109. package/dist/commands/new.js.map +1 -1
  110. package/dist/commands/registry.d.ts.map +1 -1
  111. package/dist/commands/registry.js +0 -2
  112. package/dist/commands/registry.js.map +1 -1
  113. package/dist/commands/sandbox.d.ts.map +1 -1
  114. package/dist/commands/sandbox.js +89 -70
  115. package/dist/commands/sandbox.js.map +1 -1
  116. package/dist/commands/session-view.js +9 -2
  117. package/dist/commands/session-view.js.map +1 -1
  118. package/dist/commands/types.d.ts +4 -3
  119. package/dist/commands/types.d.ts.map +1 -1
  120. package/dist/commands/types.js.map +1 -1
  121. package/dist/config.d.ts +13 -17
  122. package/dist/config.d.ts.map +1 -1
  123. package/dist/config.js +39 -37
  124. package/dist/config.js.map +1 -1
  125. package/dist/dream/index.d.ts +20 -0
  126. package/dist/dream/index.d.ts.map +1 -0
  127. package/dist/dream/index.js +253 -0
  128. package/dist/dream/index.js.map +1 -0
  129. package/dist/dream/types.d.ts +30 -0
  130. package/dist/dream/types.d.ts.map +1 -0
  131. package/dist/dream/types.js.map +1 -0
  132. package/dist/env-manifest.d.ts.map +1 -1
  133. package/dist/env-manifest.js +2 -34
  134. package/dist/env-manifest.js.map +1 -1
  135. package/dist/execution-resolver.d.ts +9 -2
  136. package/dist/execution-resolver.d.ts.map +1 -1
  137. package/dist/execution-resolver.js +26 -27
  138. package/dist/execution-resolver.js.map +1 -1
  139. package/dist/harness/event-format.d.ts +1 -2
  140. package/dist/harness/event-format.d.ts.map +1 -1
  141. package/dist/harness/event-format.js +9 -15
  142. package/dist/harness/event-format.js.map +1 -1
  143. package/dist/harness/index.d.ts +1 -7
  144. package/dist/harness/index.d.ts.map +1 -1
  145. package/dist/harness/index.js +0 -4
  146. package/dist/harness/index.js.map +1 -1
  147. package/dist/harness/models.d.ts.map +1 -1
  148. package/dist/harness/models.js +15 -35
  149. package/dist/harness/models.js.map +1 -1
  150. package/dist/harness/runner.d.ts +7 -16
  151. package/dist/harness/runner.d.ts.map +1 -1
  152. package/dist/harness/runner.js +13 -131
  153. package/dist/harness/runner.js.map +1 -1
  154. package/dist/harness/session-store.d.ts +1 -1
  155. package/dist/harness/session-store.d.ts.map +1 -1
  156. package/dist/harness/session-store.js +1 -1
  157. package/dist/harness/session-store.js.map +1 -1
  158. package/dist/harness/subagent-runner.d.ts +2 -2
  159. package/dist/harness/subagent-runner.d.ts.map +1 -1
  160. package/dist/harness/subagent-runner.js +157 -162
  161. package/dist/harness/subagent-runner.js.map +1 -1
  162. package/dist/harness/types.d.ts +1 -13
  163. package/dist/harness/types.d.ts.map +1 -1
  164. package/dist/harness/types.js.map +1 -1
  165. package/dist/index.d.ts +3 -9
  166. package/dist/index.d.ts.map +1 -1
  167. package/dist/index.js +1 -5
  168. package/dist/index.js.map +1 -1
  169. package/dist/main.js +31 -212
  170. package/dist/main.js.map +1 -1
  171. package/dist/mcp/catalog.d.ts +5 -0
  172. package/dist/mcp/catalog.d.ts.map +1 -0
  173. package/dist/mcp/catalog.js +135 -0
  174. package/dist/mcp/catalog.js.map +1 -0
  175. package/dist/mcp/loader.d.ts.map +1 -1
  176. package/dist/mcp/loader.js +3 -6
  177. package/dist/mcp/loader.js.map +1 -1
  178. package/dist/mcp/types.d.ts +22 -0
  179. package/dist/mcp/types.d.ts.map +1 -1
  180. package/dist/mcp/types.js.map +1 -1
  181. package/dist/office/index.d.ts +136 -8
  182. package/dist/office/index.d.ts.map +1 -1
  183. package/dist/office/index.js +1050 -9
  184. package/dist/office/index.js.map +1 -1
  185. package/dist/office/types.d.ts +19 -1
  186. package/dist/office/types.d.ts.map +1 -1
  187. package/dist/office/types.js.map +1 -1
  188. package/dist/packages/index.d.ts +168 -5
  189. package/dist/packages/index.d.ts.map +1 -1
  190. package/dist/packages/index.js +749 -5
  191. package/dist/packages/index.js.map +1 -1
  192. package/dist/packages/types.d.ts +1 -5
  193. package/dist/packages/types.d.ts.map +1 -1
  194. package/dist/packages/types.js.map +1 -1
  195. package/dist/provisioner.d.ts +2 -9
  196. package/dist/provisioner.d.ts.map +1 -1
  197. package/dist/provisioner.js +3 -12
  198. package/dist/provisioner.js.map +1 -1
  199. package/dist/runtime/conversation-runtime.d.ts.map +1 -1
  200. package/dist/runtime/conversation-runtime.js +117 -380
  201. package/dist/runtime/conversation-runtime.js.map +1 -1
  202. package/dist/runtime/session-lifecycle.d.ts +32 -18
  203. package/dist/runtime/session-lifecycle.d.ts.map +1 -1
  204. package/dist/runtime/session-lifecycle.js +159 -46
  205. package/dist/runtime/session-lifecycle.js.map +1 -1
  206. package/dist/runtime/types.d.ts +4 -26
  207. package/dist/runtime/types.d.ts.map +1 -1
  208. package/dist/runtime/types.js.map +1 -1
  209. package/dist/sandbox/cloudflare.d.ts.map +1 -1
  210. package/dist/sandbox/cloudflare.js +2 -3
  211. package/dist/sandbox/cloudflare.js.map +1 -1
  212. package/dist/sandbox/container.d.ts +0 -1
  213. package/dist/sandbox/container.d.ts.map +1 -1
  214. package/dist/sandbox/container.js +2 -3
  215. package/dist/sandbox/container.js.map +1 -1
  216. package/dist/sandbox/host.d.ts.map +1 -1
  217. package/dist/sandbox/host.js +4 -2
  218. package/dist/sandbox/host.js.map +1 -1
  219. package/dist/sandbox/identity.d.ts +10 -19
  220. package/dist/sandbox/identity.d.ts.map +1 -1
  221. package/dist/sandbox/identity.js +8 -8
  222. package/dist/sandbox/identity.js.map +1 -1
  223. package/dist/sandbox/index.d.ts +7 -10
  224. package/dist/sandbox/index.d.ts.map +1 -1
  225. package/dist/sandbox/index.js +45 -16
  226. package/dist/sandbox/index.js.map +1 -1
  227. package/dist/sandbox/types.d.ts +13 -45
  228. package/dist/sandbox/types.d.ts.map +1 -1
  229. package/dist/sandbox/types.js.map +1 -1
  230. package/dist/sandbox/utils.d.ts +5 -0
  231. package/dist/sandbox/utils.d.ts.map +1 -1
  232. package/dist/sandbox/utils.js +10 -0
  233. package/dist/sandbox/utils.js.map +1 -1
  234. package/dist/sessions/chat-history-sync.d.ts +1 -3
  235. package/dist/sessions/chat-history-sync.d.ts.map +1 -1
  236. package/dist/sessions/chat-history-sync.js +58 -11
  237. package/dist/sessions/chat-history-sync.js.map +1 -1
  238. package/dist/sessions/migrate-v3.d.ts +2 -5
  239. package/dist/sessions/migrate-v3.d.ts.map +1 -1
  240. package/dist/sessions/migrate-v3.js +34 -4
  241. package/dist/sessions/migrate-v3.js.map +1 -1
  242. package/dist/sessions/store.d.ts +5 -6
  243. package/dist/sessions/store.d.ts.map +1 -1
  244. package/dist/sessions/store.js +62 -2
  245. package/dist/sessions/store.js.map +1 -1
  246. package/dist/sessions/types.d.ts +9 -0
  247. package/dist/sessions/types.d.ts.map +1 -1
  248. package/dist/sessions/types.js.map +1 -1
  249. package/dist/tools/bash.d.ts.map +1 -1
  250. package/dist/tools/bash.js +2 -10
  251. package/dist/tools/bash.js.map +1 -1
  252. package/dist/tools/read.js +2 -2
  253. package/dist/tools/read.js.map +1 -1
  254. package/dist/tools/sandbox.d.ts.map +1 -1
  255. package/dist/tools/sandbox.js +2 -3
  256. package/dist/tools/sandbox.js.map +1 -1
  257. package/dist/tools/subagent.d.ts +1 -1
  258. package/dist/tools/subagent.js.map +1 -1
  259. package/dist/types.d.ts +38 -127
  260. package/dist/types.d.ts.map +1 -1
  261. package/dist/types.js.map +1 -1
  262. package/dist/vault/index.d.ts +9 -2
  263. package/dist/vault/index.d.ts.map +1 -1
  264. package/dist/vault/index.js +29 -5
  265. package/dist/vault/index.js.map +1 -1
  266. package/dist/web/admin/portal.d.ts +12 -1
  267. package/dist/web/admin/portal.d.ts.map +1 -1
  268. package/dist/web/admin/portal.js +437 -422
  269. package/dist/web/admin/portal.js.map +1 -1
  270. package/dist/web/admin/types.d.ts +2 -2
  271. package/dist/web/admin/types.d.ts.map +1 -1
  272. package/dist/web/admin/types.js.map +1 -1
  273. package/dist/web/login/portal.d.ts +7 -1
  274. package/dist/web/login/portal.d.ts.map +1 -1
  275. package/dist/web/login/portal.js +143 -78
  276. package/dist/web/login/portal.js.map +1 -1
  277. package/dist/web/portal-shell.d.ts +1 -0
  278. package/dist/web/portal-shell.d.ts.map +1 -1
  279. package/dist/web/portal-shell.js +12 -1
  280. package/dist/web/portal-shell.js.map +1 -1
  281. package/dist/web/server.d.ts +3 -3
  282. package/dist/web/server.d.ts.map +1 -1
  283. package/dist/web/server.js.map +1 -1
  284. package/dist/web/session-view/portal.d.ts +8 -1
  285. package/dist/web/session-view/portal.d.ts.map +1 -1
  286. package/dist/web/session-view/portal.js +609 -132
  287. package/dist/web/session-view/portal.js.map +1 -1
  288. package/dist/web/session-view/types.d.ts +8 -0
  289. package/dist/web/session-view/types.d.ts.map +1 -1
  290. package/dist/web/session-view/types.js.map +1 -1
  291. package/dist/workspace-projection/index.d.ts +14 -2
  292. package/dist/workspace-projection/index.d.ts.map +1 -1
  293. package/dist/workspace-projection/index.js +102 -14
  294. package/dist/workspace-projection/index.js.map +1 -1
  295. package/dist/workspace-projection/types.d.ts +14 -1
  296. package/dist/workspace-projection/types.d.ts.map +1 -1
  297. package/dist/workspace-projection/types.js.map +1 -1
  298. package/package.json +3 -5
  299. package/dist/adapters/github/cloudbuild.d.ts +0 -19
  300. package/dist/adapters/github/cloudbuild.d.ts.map +0 -1
  301. package/dist/adapters/github/cloudbuild.js +0 -71
  302. package/dist/adapters/github/cloudbuild.js.map +0 -1
  303. package/dist/adapters/github/gcp-auth.d.ts +0 -28
  304. package/dist/adapters/github/gcp-auth.d.ts.map +0 -1
  305. package/dist/adapters/github/gcp-auth.js +0 -196
  306. package/dist/adapters/github/gcp-auth.js.map +0 -1
  307. package/dist/agent/index.d.ts +0 -9
  308. package/dist/agent/index.d.ts.map +0 -1
  309. package/dist/agent/index.js +0 -8
  310. package/dist/agent/index.js.map +0 -1
  311. package/dist/cli/ext-dev.d.ts +0 -2
  312. package/dist/cli/ext-dev.d.ts.map +0 -1
  313. package/dist/cli/ext-dev.js +0 -188
  314. package/dist/cli/ext-dev.js.map +0 -1
  315. package/dist/cli/ext.d.ts +0 -2
  316. package/dist/cli/ext.d.ts.map +0 -1
  317. package/dist/cli/ext.js +0 -324
  318. package/dist/cli/ext.js.map +0 -1
  319. package/dist/commands/extensions.d.ts +0 -26
  320. package/dist/commands/extensions.d.ts.map +0 -1
  321. package/dist/commands/extensions.js +0 -103
  322. package/dist/commands/extensions.js.map +0 -1
  323. package/dist/extension-schedules.d.ts +0 -31
  324. package/dist/extension-schedules.d.ts.map +0 -1
  325. package/dist/extension-schedules.js +0 -229
  326. package/dist/extension-schedules.js.map +0 -1
  327. package/dist/harness/auth.d.ts +0 -17
  328. package/dist/harness/auth.d.ts.map +0 -1
  329. package/dist/harness/auth.js +0 -92
  330. package/dist/harness/auth.js.map +0 -1
  331. package/dist/harness/extensions/loader.d.ts +0 -40
  332. package/dist/harness/extensions/loader.d.ts.map +0 -1
  333. package/dist/harness/extensions/loader.js +0 -723
  334. package/dist/harness/extensions/loader.js.map +0 -1
  335. package/dist/harness/extensions/registry.d.ts +0 -155
  336. package/dist/harness/extensions/registry.d.ts.map +0 -1
  337. package/dist/harness/extensions/registry.js +0 -420
  338. package/dist/harness/extensions/registry.js.map +0 -1
  339. package/dist/harness/extensions/types.d.ts +0 -665
  340. package/dist/harness/extensions/types.d.ts.map +0 -1
  341. package/dist/harness/extensions/types.js.map +0 -1
  342. package/dist/office/address.d.ts +0 -31
  343. package/dist/office/address.d.ts.map +0 -1
  344. package/dist/office/address.js +0 -113
  345. package/dist/office/address.js.map +0 -1
  346. package/dist/office/layout.d.ts +0 -27
  347. package/dist/office/layout.d.ts.map +0 -1
  348. package/dist/office/layout.js +0 -97
  349. package/dist/office/layout.js.map +0 -1
  350. package/dist/office/migration.d.ts +0 -44
  351. package/dist/office/migration.d.ts.map +0 -1
  352. package/dist/office/migration.js +0 -255
  353. package/dist/office/migration.js.map +0 -1
  354. package/dist/office/registry.d.ts +0 -75
  355. package/dist/office/registry.d.ts.map +0 -1
  356. package/dist/office/registry.js +0 -646
  357. package/dist/office/registry.js.map +0 -1
  358. package/dist/packages/admin.d.ts +0 -17
  359. package/dist/packages/admin.d.ts.map +0 -1
  360. package/dist/packages/admin.js +0 -98
  361. package/dist/packages/admin.js.map +0 -1
  362. package/dist/packages/inspect.d.ts +0 -11
  363. package/dist/packages/inspect.d.ts.map +0 -1
  364. package/dist/packages/inspect.js +0 -98
  365. package/dist/packages/inspect.js.map +0 -1
  366. package/dist/packages/materialize.d.ts +0 -40
  367. package/dist/packages/materialize.d.ts.map +0 -1
  368. package/dist/packages/materialize.js +0 -297
  369. package/dist/packages/materialize.js.map +0 -1
  370. package/dist/packages/resolve.d.ts +0 -25
  371. package/dist/packages/resolve.d.ts.map +0 -1
  372. package/dist/packages/resolve.js +0 -208
  373. package/dist/packages/resolve.js.map +0 -1
  374. package/dist/packages/source.d.ts +0 -39
  375. package/dist/packages/source.d.ts.map +0 -1
  376. package/dist/packages/source.js +0 -189
  377. package/dist/packages/source.js.map +0 -1
  378. package/dist/sandbox/errors.d.ts +0 -6
  379. package/dist/sandbox/errors.d.ts.map +0 -1
  380. package/dist/sandbox/errors.js +0 -11
  381. package/dist/sandbox/errors.js.map +0 -1
  382. package/dist/sandbox/firecracker.d.ts +0 -18
  383. package/dist/sandbox/firecracker.d.ts.map +0 -1
  384. package/dist/sandbox/firecracker.js +0 -223
  385. package/dist/sandbox/firecracker.js.map +0 -1
  386. package/dist/sandbox/gondolin.d.ts +0 -57
  387. package/dist/sandbox/gondolin.d.ts.map +0 -1
  388. package/dist/sandbox/gondolin.js +0 -764
  389. package/dist/sandbox/gondolin.js.map +0 -1
  390. package/dist/sandbox/image.d.ts +0 -3
  391. package/dist/sandbox/image.d.ts.map +0 -1
  392. package/dist/sandbox/image.js +0 -29
  393. package/dist/sandbox/image.js.map +0 -1
  394. package/dist/sessions/conversation-log.d.ts +0 -9
  395. package/dist/sessions/conversation-log.d.ts.map +0 -1
  396. package/dist/sessions/conversation-log.js +0 -50
  397. package/dist/sessions/conversation-log.js.map +0 -1
  398. package/dist/sessions/rotation.d.ts +0 -2
  399. package/dist/sessions/rotation.d.ts.map +0 -1
  400. package/dist/sessions/rotation.js +0 -41
  401. package/dist/sessions/rotation.js.map +0 -1
  402. package/dist/vault/disabled.d.ts +0 -9
  403. package/dist/vault/disabled.d.ts.map +0 -1
  404. package/dist/vault/disabled.js +0 -25
  405. package/dist/vault/disabled.js.map +0 -1
  406. package/dist/web/admin/store.d.ts +0 -13
  407. package/dist/web/admin/store.d.ts.map +0 -1
  408. package/dist/web/admin/store.js +0 -14
  409. package/dist/web/admin/store.js.map +0 -1
  410. package/dist/web/login/store.d.ts +0 -8
  411. package/dist/web/login/store.d.ts.map +0 -1
  412. package/dist/web/login/store.js +0 -15
  413. package/dist/web/login/store.js.map +0 -1
  414. package/dist/web/session-view/service.d.ts +0 -6
  415. package/dist/web/session-view/service.d.ts.map +0 -1
  416. package/dist/web/session-view/service.js +0 -517
  417. package/dist/web/session-view/service.js.map +0 -1
  418. package/dist/web/session-view/store.d.ts +0 -8
  419. package/dist/web/session-view/store.d.ts.map +0 -1
  420. package/dist/web/session-view/store.js +0 -15
  421. package/dist/web/session-view/store.js.map +0 -1
  422. /package/dist/{harness/extensions → dream}/types.js +0 -0
@@ -1,8 +1,48 @@
1
- import { dirname } from "node:path";
2
- import { lstatSync, mkdirSync, writeFileSync } from "node:fs";
3
- import { ensureDirExists } from "../utils/file-guards.js";
1
+ import { dirname, join } from "node:path";
2
+ import { lstatSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
+ import { atomicWritePrivateFile, ensureDirExists } from "../utils/file-guards.js";
4
4
  import { resolveConversationSettings } from "../config.js";
5
5
  import * as log from "../log.js";
6
+ const CHANNEL_KIND_FILE = "channel-kind";
7
+ const CHANNEL_KINDS = [
8
+ "public_channel",
9
+ "private_channel",
10
+ "im",
11
+ "external",
12
+ ];
13
+ /**
14
+ * Record the platform's own channel kind for this conversation, as observed
15
+ * by the adapter at message intake. Stored under the host-only office state
16
+ * dir (never the sandbox-mounted workspace), so sandboxed code cannot
17
+ * promote its own conversation into the shared pool. Written only on change;
18
+ * the value is a snapshot as of the last message, which is exactly the
19
+ * freshness the projection needs — a conversation that never speaks again
20
+ * never needs a fresher value.
21
+ */
22
+ export function recordPlatformChannelKind(office, kind) {
23
+ if (readPlatformChannelKind(office) === kind)
24
+ return;
25
+ ensureDirExists(office.stateDir);
26
+ atomicWritePrivateFile(join(office.stateDir, CHANNEL_KIND_FILE), kind + "\n");
27
+ }
28
+ /** The recorded platform channel kind, or undefined when never observed. */
29
+ export function readPlatformChannelKind(office) {
30
+ const path = join(office.stateDir, CHANNEL_KIND_FILE);
31
+ let raw;
32
+ try {
33
+ raw = readFileSync(path, "utf-8");
34
+ }
35
+ catch (err) {
36
+ if (err.code === "ENOENT")
37
+ return undefined;
38
+ log.logWarning("Could not read platform channel kind; falling back to isolated workspace", `${path}: ${err instanceof Error ? err.message : String(err)}`);
39
+ return undefined;
40
+ }
41
+ const value = raw.trim();
42
+ return CHANNEL_KINDS.includes(value)
43
+ ? value
44
+ : undefined;
45
+ }
6
46
  /**
7
47
  * The single policy seam for a managed office. It both materializes the
8
48
  * host-side roots and authorizes the prompt sources that describe them.
@@ -19,11 +59,26 @@ export function resolveWorkspaceProjection(office) {
19
59
  ensureDirectoryRoot(workspace.skillsDir, "Workspace skills");
20
60
  ensureDirectoryRoot(workspace.eventsDir, "Workspace events");
21
61
  }
62
+ // Private visibility only changes anything for shared-support: the shared
63
+ // MEMORY.md is the one file that leaks information between offices when
64
+ // writable, so a private office reads it but cannot write it (modeled on
65
+ // Claude Tag's private-channel memory). "full" mounts the whole workspace
66
+ // as one read-write bind with no separate memory file to gate, and
67
+ // "conversation" never sees workspace memory at all.
68
+ //
69
+ // The `readOnly` mount flag below is a kernel-enforced boundary only for
70
+ // backends with managed Workspace projection. Runner and actor execution
71
+ // resolution reject every other backend before the agent can start.
72
+ const globalMemoryReadOnly = shared && effective.visibility === "private";
22
73
  const mounts = effective.layout === "full"
23
74
  ? [{ source: workspace.root, target: "/workspace" }]
24
75
  : effective.layout === "shared-support"
25
76
  ? [
26
- { source: workspace.memoryPath, target: "/workspace/MEMORY.md" },
77
+ {
78
+ source: workspace.memoryPath,
79
+ target: "/workspace/MEMORY.md",
80
+ ...(globalMemoryReadOnly ? { readOnly: true } : {}),
81
+ },
27
82
  { source: workspace.skillsDir, target: "/workspace/skills" },
28
83
  { source: workspace.eventsDir, target: "/workspace/events" },
29
84
  { source: office.dir, target: `/workspace/${office.key}` },
@@ -37,7 +92,11 @@ export function resolveWorkspaceProjection(office) {
37
92
  conversationMemoryPath: office.memoryPath,
38
93
  conversationSkillsDir: office.skillsDir,
39
94
  ...(effective.layout === "shared-support" || effective.layout === "full"
40
- ? { globalMemoryPath: workspace.memoryPath, globalSkillsDir: workspace.skillsDir }
95
+ ? {
96
+ globalMemoryPath: workspace.memoryPath,
97
+ globalSkillsDir: workspace.skillsDir,
98
+ ...(globalMemoryReadOnly ? { globalMemoryReadOnly: true } : {}),
99
+ }
41
100
  : {}),
42
101
  },
43
102
  };
@@ -46,9 +105,12 @@ function resolveEffectiveWorkspace(office) {
46
105
  try {
47
106
  const settings = resolveConversationSettings(office).sandbox;
48
107
  if (settings?.workspace) {
49
- return normalizeWorkspace(settings.workspace.doorPolicy, settings.workspace.layout);
108
+ return normalizeWorkspace(settings.workspace.doorPolicy, settings.workspace.layout, settings.workspace.visibility);
109
+ }
110
+ if (settings?.image?.workspaceMount) {
111
+ return legacyWorkspace(settings.image.workspaceMount);
50
112
  }
51
- return legacyWorkspace(settings?.image?.workspaceMount);
113
+ return platformDerivedWorkspace(office);
52
114
  }
53
115
  catch (err) {
54
116
  // Settings are host-authoritative. A malformed file must not fall back to
@@ -57,18 +119,44 @@ function resolveEffectiveWorkspace(office) {
57
119
  throw new Error("Cannot resolve workspace projection: settings are malformed", { cause: err });
58
120
  }
59
121
  }
60
- function normalizeWorkspace(doorPolicy, layout) {
122
+ /**
123
+ * No explicit workspace setting anywhere: follow the platform's own channel
124
+ * vocabulary (modeled on Claude Tag). A public channel's knowledge is shared
125
+ * workspace-wide read-write; a private channel reads the shared pool but
126
+ * writes only its own conversation memory; DMs, externally shared channels,
127
+ * and conversations whose kind was never observed stay fully isolated —
128
+ * platform-public is a necessary condition for sharing, never assumed.
129
+ * An admin's explicit setting (conversation or global) always wins over this.
130
+ */
131
+ function platformDerivedWorkspace(office) {
132
+ switch (readPlatformChannelKind(office)) {
133
+ case "public_channel":
134
+ return { doorPolicy: "trusted", layout: "shared-support", visibility: "public" };
135
+ case "private_channel":
136
+ return { doorPolicy: "trusted", layout: "shared-support", visibility: "private" };
137
+ default:
138
+ return { doorPolicy: "isolated", layout: "conversation", visibility: "public" };
139
+ }
140
+ }
141
+ function normalizeWorkspace(doorPolicy, layout, visibility) {
61
142
  const policy = doorPolicy ?? "isolated";
62
- if (policy === "isolated")
63
- return { doorPolicy: policy, layout: "conversation" };
64
- return { doorPolicy: policy, layout: layout === "full" ? "full" : "shared-support" };
143
+ if (policy === "isolated") {
144
+ return { doorPolicy: policy, layout: "conversation", visibility: "public" };
145
+ }
146
+ return {
147
+ doorPolicy: policy,
148
+ layout: layout === "full" ? "full" : "shared-support",
149
+ // Missing visibility defaults to "public": every office that predates this
150
+ // setting keeps today's read-write shared MEMORY.md behavior unchanged.
151
+ visibility: visibility ?? "public",
152
+ };
65
153
  }
66
154
  function legacyWorkspace(mode) {
67
155
  return mode === "full"
68
- ? { doorPolicy: "trusted", layout: "full" }
156
+ ? { doorPolicy: "trusted", layout: "full", visibility: "public" }
69
157
  : mode === "private"
70
- ? { doorPolicy: "trusted", layout: "shared-support" }
71
- : { doorPolicy: "isolated", layout: "conversation" };
158
+ ? { doorPolicy: "trusted", layout: "shared-support", visibility: "public" }
159
+ : { doorPolicy: "isolated", layout: "conversation", visibility: "public" };
72
160
  }
73
161
  function ensureDirectoryRoot(path, label) {
74
162
  if (!exists(path)) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workspace-projection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,OAA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IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,yBAAyB,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,wCAAwC,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,KAAa;IAClD,IAAI,KAAK,CAAC;IACV,IAAI,CAAC;QACH,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,yBAAyB,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,6CAA6C,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QACnE,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC","sourcesContent":["import { dirname } from \"node:path\";\nimport { lstatSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { ensureDirExists } from \"../utils/file-guards.js\";\nimport { resolveConversationSettings } from \"../config.js\";\nimport type { Office } from \"../office/index.js\";\nimport * as log from \"../log.js\";\nimport type { ImageWorkspaceMountMode, WorkspaceDoorPolicy, WorkspaceLayout } from \"../types.js\";\nimport type { WorkspaceProjection } from \"./types.js\";\n\nexport type { WorkspaceProjection } from \"./types.js\";\n\n/**\n * The single policy seam for a managed office. It both materializes the\n * host-side roots and authorizes the prompt sources that describe them.\n * Legacy image settings are deliberately translated here, never at callers.\n */\nexport function resolveWorkspaceProjection(office: Office): WorkspaceProjection {\n const { workspace } = office;\n const effective = resolveEffectiveWorkspace(office);\n\n assertDirectory(workspace.root, \"Host workspace root\");\n office.ensure();\n const shared = effective.layout === \"shared-support\";\n if (shared) {\n ensureRegularFile(workspace.memoryPath, \"Workspace memory\");\n ensureDirectoryRoot(workspace.skillsDir, \"Workspace skills\");\n ensureDirectoryRoot(workspace.eventsDir, \"Workspace events\");\n }\n\n const mounts =\n effective.layout === \"full\"\n ? [{ source: workspace.root, target: \"/workspace\" }]\n : effective.layout === \"shared-support\"\n ? [\n { source: workspace.memoryPath, target: \"/workspace/MEMORY.md\" },\n { source: workspace.skillsDir, target: \"/workspace/skills\" },\n { source: workspace.eventsDir, target: \"/workspace/events\" },\n { source: office.dir, target: `/workspace/${office.key}` },\n ]\n : [{ source: office.dir, target: `/workspace/${office.key}` }];\n\n return {\n ...effective,\n mounts,\n promptSources: {\n conversationDir: office.dir,\n conversationMemoryPath: office.memoryPath,\n conversationSkillsDir: office.skillsDir,\n ...(effective.layout === \"shared-support\" || effective.layout === \"full\"\n ? { globalMemoryPath: workspace.memoryPath, globalSkillsDir: workspace.skillsDir }\n : {}),\n },\n };\n}\n\nfunction resolveEffectiveWorkspace(\n office: Office,\n): Pick<WorkspaceProjection, \"doorPolicy\" | \"layout\"> {\n try {\n const settings = resolveConversationSettings(office).sandbox;\n if (settings?.workspace) {\n return normalizeWorkspace(settings.workspace.doorPolicy, settings.workspace.layout);\n }\n return legacyWorkspace(settings?.image?.workspaceMount);\n } catch (err) {\n // Settings are host-authoritative. A malformed file must not fall back to\n // an unvalidated value from a mounted legacy location.\n log.logWarning(\n \"Refusing to resolve workspace projection from malformed settings\",\n err instanceof Error ? err.message : String(err),\n );\n throw new Error(\"Cannot resolve workspace projection: settings are malformed\", { cause: err });\n }\n}\n\nfunction normalizeWorkspace(\n doorPolicy: WorkspaceDoorPolicy | undefined,\n layout: WorkspaceLayout | undefined,\n): Pick<WorkspaceProjection, \"doorPolicy\" | \"layout\"> {\n const policy = doorPolicy ?? \"isolated\";\n if (policy === \"isolated\") return { doorPolicy: policy, layout: \"conversation\" };\n return { doorPolicy: policy, layout: layout === \"full\" ? \"full\" : \"shared-support\" };\n}\n\nfunction legacyWorkspace(\n mode: ImageWorkspaceMountMode | undefined,\n): Pick<WorkspaceProjection, \"doorPolicy\" | \"layout\"> {\n return mode === \"full\"\n ? { doorPolicy: \"trusted\", layout: \"full\" }\n : mode === \"private\"\n ? { doorPolicy: \"trusted\", layout: \"shared-support\" }\n : { doorPolicy: \"isolated\", layout: \"conversation\" };\n}\n\nfunction ensureDirectoryRoot(path: string, label: string): void {\n if (!exists(path)) {\n mkdirSync(path, { recursive: true, mode: 0o700 });\n return;\n }\n assertDirectory(path, label);\n}\n\nfunction ensureRegularFile(path: string, label: string): void {\n if (!exists(path)) {\n ensureDirExists(dirname(path));\n writeFileSync(path, \"\", { mode: 0o600, flag: \"wx\" });\n return;\n }\n let stats;\n try {\n stats = lstatSync(path);\n } catch (err) {\n throw new Error(`${label} cannot be inspected: ${path}`, { cause: err });\n }\n if (stats.isSymbolicLink() || !stats.isFile()) {\n throw new Error(`${label} must be a regular non-symlink file: ${path}`);\n }\n}\n\nfunction assertDirectory(path: string, label: string): void {\n let stats;\n try {\n stats = lstatSync(path);\n } catch (err) {\n throw new Error(`${label} cannot be inspected: ${path}`, { cause: err });\n }\n if (stats.isSymbolicLink() || !stats.isDirectory()) {\n throw new Error(`${label} must be a regular non-symlink directory: ${path}`);\n }\n}\n\nfunction exists(path: string): boolean {\n try {\n lstatSync(path);\n return true;\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return false;\n throw err;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workspace-projection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AAWjC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AACzC,MAAM,aAAa,GAAmC;IACpD,gBAAgB;IAChB,iBAAiB;IACjB,IAAI;IACJ,UAAU;CACX,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAc,EAAE,IAAyB;IACjF,IAAI,uBAAuB,CAAC,MAAM,CAAC,KAAK,IAAI;QAAE,OAAO;IACrD,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;AAChF,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACtD,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAC;QAC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Y;IAC1B,IAAI,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QACnE,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC","sourcesContent":["import { dirname, join } from \"node:path\";\nimport { lstatSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { atomicWritePrivateFile, ensureDirExists } from \"../utils/file-guards.js\";\nimport { resolveConversationSettings } from \"../config.js\";\nimport type { Office } from \"../office/index.js\";\nimport * as log from \"../log.js\";\nimport type {\n ImageWorkspaceMountMode,\n WorkspaceDoorPolicy,\n WorkspaceLayout,\n WorkspaceVisibility,\n} from \"../types.js\";\nimport type { PlatformChannelKind, WorkspaceProjection } from \"./types.js\";\n\nexport type { PlatformChannelKind, WorkspaceProjection } from \"./types.js\";\n\nconst CHANNEL_KIND_FILE = \"channel-kind\";\nconst CHANNEL_KINDS: readonly PlatformChannelKind[] = [\n \"public_channel\",\n \"private_channel\",\n \"im\",\n \"external\",\n];\n\n/**\n * Record the platform's own channel kind for this conversation, as observed\n * by the adapter at message intake. Stored under the host-only office state\n * dir (never the sandbox-mounted workspace), so sandboxed code cannot\n * promote its own conversation into the shared pool. Written only on change;\n * the value is a snapshot as of the last message, which is exactly the\n * freshness the projection needs — a conversation that never speaks again\n * never needs a fresher value.\n */\nexport function recordPlatformChannelKind(office: Office, kind: PlatformChannelKind): void {\n if (readPlatformChannelKind(office) === kind) return;\n ensureDirExists(office.stateDir);\n atomicWritePrivateFile(join(office.stateDir, CHANNEL_KIND_FILE), kind + \"\\n\");\n}\n\n/** The recorded platform channel kind, or undefined when never observed. */\nexport function readPlatformChannelKind(office: Office): PlatformChannelKind | undefined {\n const path = join(office.stateDir, CHANNEL_KIND_FILE);\n let raw: string;\n try {\n raw = readFileSync(path, \"utf-8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return undefined;\n log.logWarning(\n \"Could not read platform channel kind; falling back to isolated workspace\",\n `${path}: ${err instanceof Error ? err.message : String(err)}`,\n );\n return undefined;\n }\n const value = raw.trim();\n return (CHANNEL_KINDS as readonly string[]).includes(value)\n ? (value as PlatformChannelKind)\n : undefined;\n}\n\n/**\n * The single policy seam for a managed office. It both materializes the\n * host-side roots and authorizes the prompt sources that describe them.\n * Legacy image settings are deliberately translated here, never at callers.\n */\nexport function resolveWorkspaceProjection(office: Office): WorkspaceProjection {\n const { workspace } = office;\n const effective = resolveEffectiveWorkspace(office);\n\n assertDirectory(workspace.root, \"Host workspace root\");\n office.ensure();\n const shared = effective.layout === \"shared-support\";\n if (shared) {\n ensureRegularFile(workspace.memoryPath, \"Workspace memory\");\n ensureDirectoryRoot(workspace.skillsDir, \"Workspace skills\");\n ensureDirectoryRoot(workspace.eventsDir, \"Workspace events\");\n }\n\n // Private visibility only changes anything for shared-support: the shared\n // MEMORY.md is the one file that leaks information between offices when\n // writable, so a private office reads it but cannot write it (modeled on\n // Claude Tag's private-channel memory). \"full\" mounts the whole workspace\n // as one read-write bind with no separate memory file to gate, and\n // \"conversation\" never sees workspace memory at all.\n //\n // The `readOnly` mount flag below is a kernel-enforced boundary only for\n // backends with managed Workspace projection. Runner and actor execution\n // resolution reject every other backend before the agent can start.\n const globalMemoryReadOnly = shared && effective.visibility === \"private\";\n const mounts =\n effective.layout === \"full\"\n ? [{ source: workspace.root, target: \"/workspace\" }]\n : effective.layout === \"shared-support\"\n ? [\n {\n source: workspace.memoryPath,\n target: \"/workspace/MEMORY.md\",\n ...(globalMemoryReadOnly ? { readOnly: true as const } : {}),\n },\n { source: workspace.skillsDir, target: \"/workspace/skills\" },\n { source: workspace.eventsDir, target: \"/workspace/events\" },\n { source: office.dir, target: `/workspace/${office.key}` },\n ]\n : [{ source: office.dir, target: `/workspace/${office.key}` }];\n\n return {\n ...effective,\n mounts,\n promptSources: {\n conversationDir: office.dir,\n conversationMemoryPath: office.memoryPath,\n conversationSkillsDir: office.skillsDir,\n ...(effective.layout === \"shared-support\" || effective.layout === \"full\"\n ? {\n globalMemoryPath: workspace.memoryPath,\n globalSkillsDir: workspace.skillsDir,\n ...(globalMemoryReadOnly ? { globalMemoryReadOnly: true } : {}),\n }\n : {}),\n },\n };\n}\n\nfunction resolveEffectiveWorkspace(\n office: Office,\n): Pick<WorkspaceProjection, \"doorPolicy\" | \"layout\" | \"visibility\"> {\n try {\n const settings = resolveConversationSettings(office).sandbox;\n if (settings?.workspace) {\n return normalizeWorkspace(\n settings.workspace.doorPolicy,\n settings.workspace.layout,\n settings.workspace.visibility,\n );\n }\n if (settings?.image?.workspaceMount) {\n return legacyWorkspace(settings.image.workspaceMount);\n }\n return platformDerivedWorkspace(office);\n } catch (err) {\n // Settings are host-authoritative. A malformed file must not fall back to\n // an unvalidated value from a mounted legacy location.\n log.logWarning(\n \"Refusing to resolve workspace projection from malformed settings\",\n err instanceof Error ? err.message : String(err),\n );\n throw new Error(\"Cannot resolve workspace projection: settings are malformed\", { cause: err });\n }\n}\n\n/**\n * No explicit workspace setting anywhere: follow the platform's own channel\n * vocabulary (modeled on Claude Tag). A public channel's knowledge is shared\n * workspace-wide read-write; a private channel reads the shared pool but\n * writes only its own conversation memory; DMs, externally shared channels,\n * and conversations whose kind was never observed stay fully isolated —\n * platform-public is a necessary condition for sharing, never assumed.\n * An admin's explicit setting (conversation or global) always wins over this.\n */\nfunction platformDerivedWorkspace(\n office: Office,\n): Pick<WorkspaceProjection, \"doorPolicy\" | \"layout\" | \"visibility\"> {\n switch (readPlatformChannelKind(office)) {\n case \"public_channel\":\n return { doorPolicy: \"trusted\", layout: \"shared-support\", visibility: \"public\" };\n case \"private_channel\":\n return { doorPolicy: \"trusted\", layout: \"shared-support\", visibility: \"private\" };\n default:\n return { doorPolicy: \"isolated\", layout: \"conversation\", visibility: \"public\" };\n }\n}\n\nfunction normalizeWorkspace(\n doorPolicy: WorkspaceDoorPolicy | undefined,\n layout: WorkspaceLayout | undefined,\n visibility: WorkspaceVisibility | undefined,\n): Pick<WorkspaceProjection, \"doorPolicy\" | \"layout\" | \"visibility\"> {\n const policy = doorPolicy ?? \"isolated\";\n if (policy === \"isolated\") {\n return { doorPolicy: policy, layout: \"conversation\", visibility: \"public\" };\n }\n return {\n doorPolicy: policy,\n layout: layout === \"full\" ? \"full\" : \"shared-support\",\n // Missing visibility defaults to \"public\": every office that predates this\n // setting keeps today's read-write shared MEMORY.md behavior unchanged.\n visibility: visibility ?? \"public\",\n };\n}\n\nfunction legacyWorkspace(\n mode: ImageWorkspaceMountMode | undefined,\n): Pick<WorkspaceProjection, \"doorPolicy\" | \"layout\" | \"visibility\"> {\n return mode === \"full\"\n ? { doorPolicy: \"trusted\", layout: \"full\", visibility: \"public\" }\n : mode === \"private\"\n ? { doorPolicy: \"trusted\", layout: \"shared-support\", visibility: \"public\" }\n : { doorPolicy: \"isolated\", layout: \"conversation\", visibility: \"public\" };\n}\n\nfunction ensureDirectoryRoot(path: string, label: string): void {\n if (!exists(path)) {\n mkdirSync(path, { recursive: true, mode: 0o700 });\n return;\n }\n assertDirectory(path, label);\n}\n\nfunction ensureRegularFile(path: string, label: string): void {\n if (!exists(path)) {\n ensureDirExists(dirname(path));\n writeFileSync(path, \"\", { mode: 0o600, flag: \"wx\" });\n return;\n }\n let stats;\n try {\n stats = lstatSync(path);\n } catch (err) {\n throw new Error(`${label} cannot be inspected: ${path}`, { cause: err });\n }\n if (stats.isSymbolicLink() || !stats.isFile()) {\n throw new Error(`${label} must be a regular non-symlink file: ${path}`);\n }\n}\n\nfunction assertDirectory(path: string, label: string): void {\n let stats;\n try {\n stats = lstatSync(path);\n } catch (err) {\n throw new Error(`${label} cannot be inspected: ${path}`, { cause: err });\n }\n if (stats.isSymbolicLink() || !stats.isDirectory()) {\n throw new Error(`${label} must be a regular non-symlink directory: ${path}`);\n }\n}\n\nfunction exists(path: string): boolean {\n try {\n lstatSync(path);\n return true;\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return false;\n throw err;\n }\n}\n"]}
@@ -1,14 +1,27 @@
1
- import type { ContainerMount, WorkspaceDoorPolicy, WorkspaceLayout } from "../types.js";
1
+ import type { ContainerMount, WorkspaceDoorPolicy, WorkspaceLayout, WorkspaceVisibility } from "../types.js";
2
+ /**
3
+ * The conversation's platform-native channel kind, using the platform's own
4
+ * vocabulary (Slack conversation types), not a mikan-invented one. Recorded
5
+ * at message intake and used to derive the workspace projection when no
6
+ * explicit workspace setting exists: public channels share workspace memory
7
+ * read-write, private channels read it without writing back, DMs and
8
+ * externally shared channels stay isolated.
9
+ */
10
+ export type PlatformChannelKind = "public_channel" | "private_channel" | "im" | "external";
2
11
  interface WorkspacePromptSources {
3
12
  conversationDir: string;
4
13
  conversationMemoryPath: string;
5
14
  conversationSkillsDir: string;
6
15
  globalMemoryPath?: string;
7
16
  globalSkillsDir?: string;
17
+ /** True when globalMemoryPath is mounted read-only (shared-support + private visibility). */
18
+ globalMemoryReadOnly?: boolean;
8
19
  }
9
20
  export interface WorkspaceProjection {
10
21
  doorPolicy: WorkspaceDoorPolicy;
11
22
  layout: WorkspaceLayout;
23
+ /** Only meaningful for shared-support layout; "public" is the default and preserves prior read-write behavior. */
24
+ visibility: WorkspaceVisibility;
12
25
  mounts: ContainerMount[];
13
26
  promptSources: WorkspacePromptSources;
14
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workspace-projection/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAExF,UAAU,sBAAsB;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,aAAa,EAAE,sBAAsB,CAAC;CACvC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workspace-projection/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,IAAI,GAAG,UAAU,CAAC;AAE3F,UAAU,sBAAsB;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6FAA6F;IAC7F,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,eAAe,CAAC;IACxB,kHAAkH;IAClH,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,aAAa,EAAE,sBAAsB,CAAC;CACvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/workspace-projection/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContainerMount, WorkspaceDoorPolicy, WorkspaceLayout } from \"../types.js\";\n\ninterface WorkspacePromptSources {\n conversationDir: string;\n conversationMemoryPath: string;\n conversationSkillsDir: string;\n globalMemoryPath?: string;\n globalSkillsDir?: string;\n}\n\nexport interface WorkspaceProjection {\n doorPolicy: WorkspaceDoorPolicy;\n layout: WorkspaceLayout;\n mounts: ContainerMount[];\n promptSources: WorkspacePromptSources;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/workspace-projection/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ContainerMount,\n WorkspaceDoorPolicy,\n WorkspaceLayout,\n WorkspaceVisibility,\n} from \"../types.js\";\n\n/**\n * The conversation's platform-native channel kind, using the platform's own\n * vocabulary (Slack conversation types), not a mikan-invented one. Recorded\n * at message intake and used to derive the workspace projection when no\n * explicit workspace setting exists: public channels share workspace memory\n * read-write, private channels read it without writing back, DMs and\n * externally shared channels stay isolated.\n */\nexport type PlatformChannelKind = \"public_channel\" | \"private_channel\" | \"im\" | \"external\";\n\ninterface WorkspacePromptSources {\n conversationDir: string;\n conversationMemoryPath: string;\n conversationSkillsDir: string;\n globalMemoryPath?: string;\n globalSkillsDir?: string;\n /** True when globalMemoryPath is mounted read-only (shared-support + private visibility). */\n globalMemoryReadOnly?: boolean;\n}\n\nexport interface WorkspaceProjection {\n doorPolicy: WorkspaceDoorPolicy;\n layout: WorkspaceLayout;\n /** Only meaningful for shared-support layout; \"public\" is the default and preserves prior read-write behavior. */\n visibility: WorkspaceVisibility;\n mounts: ContainerMount[];\n promptSources: WorkspacePromptSources;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geminixiang/mikan",
3
- "version": "1.0.0-beta.44",
3
+ "version": "1.0.0-beta.46",
4
4
  "description": "Multi-platform AI coding agent for Slack, Telegram, Discord, and GitHub",
5
5
  "keywords": [
6
6
  "agent",
@@ -59,13 +59,11 @@
59
59
  "test:e2e": "vitest --run --config .config/vitest.e2e.config.ts",
60
60
  "test:e2e:slack": "vitest --run --config .config/vitest.e2e.config.ts e2e/slack",
61
61
  "test:e2e:slack:coverage": "vitest --run --coverage --coverage.reportsDirectory=.workspace/coverage --config .config/vitest.e2e.config.ts e2e/slack",
62
- "gondolin:image:build": "sh scripts/build-gondolin-image.sh",
63
62
  "docs:dev": "astro dev --config .config/astro.config.mjs",
64
63
  "docs:build": "astro build --config .config/astro.config.mjs",
65
64
  "docs:preview": "astro preview --config .config/astro.config.mjs"
66
65
  },
67
66
  "dependencies": {
68
- "@earendil-works/gondolin": "0.12.0",
69
67
  "@earendil-works/pi-agent-core": "^0.84.3",
70
68
  "@earendil-works/pi-ai": "^0.84.3",
71
69
  "@modelcontextprotocol/sdk": "^1.30.0",
@@ -78,7 +76,6 @@
78
76
  "diff": "^9.0.0",
79
77
  "discord.js": "^14.26.4",
80
78
  "grammy": "^1.44.0",
81
- "jiti": "^2.7.0",
82
79
  "markdown-it": "^14.2.0",
83
80
  "undici": "^8.5.0"
84
81
  },
@@ -99,7 +96,8 @@
99
96
  "remark-gfm": "^4.0.1",
100
97
  "shx": "^0.4.0",
101
98
  "typescript": "^6.0.3",
102
- "vitest": "^4.1.9"
99
+ "vitest": "^4.1.9",
100
+ "zod": "^4.0.0"
103
101
  },
104
102
  "overrides": {
105
103
  "@discordjs/rest": {
@@ -1,19 +0,0 @@
1
- export type { CloudBuildLogOptions } from "./types.js";
2
- import type { CloudBuildLogOptions } from "./types.js";
3
- /** Check runs reported by this app slug are Cloud Build builds. */
4
- export declare const CLOUD_BUILD_APP_SLUG = "google-cloud-build";
5
- export declare function isCloudBuildId(value: string): boolean;
6
- /** GCP project (id or number) from a Cloud Build details_url, or null. */
7
- export declare function projectFromDetailsUrl(detailsUrl: string | null | undefined): string | null;
8
- export declare class CloudBuildLogUnavailableError extends Error {
9
- readonly consoleUrl?: string | undefined;
10
- constructor(message: string, consoleUrl?: string | undefined);
11
- }
12
- /**
13
- * Fetch one build's log text: builds.get → the `log-<id>.txt` object in the
14
- * build's logs bucket. Throws CloudBuildLogUnavailableError (with the console
15
- * url when known) whenever the log cannot be read — access denied, build not
16
- * found, or CLOUD_LOGGING_ONLY builds that write no GCS object.
17
- */
18
- export declare function fetchCloudBuildLog(options: CloudBuildLogOptions): Promise<string>;
19
- //# sourceMappingURL=cloudbuild.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cloudbuild.d.ts","sourceRoot":"","sources":["../../../src/adapters/github/cloudbuild.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAevD,mEAAmE;AACnE,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAIzD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAQ1F;AAQD,qBAAa,6BAA8B,SAAQ,KAAK;aAGpC,UAAU,CAAC,EAAE,MAAM;IAFrC,YACE,OAAO,EAAE,MAAM,EACC,UAAU,CAAC,EAAE,MAAM,YAAA,EAIpC;CACF;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAyCvF"}
@@ -1,71 +0,0 @@
1
- /**
2
- * Host-side Cloud Build log retrieval for `github_checks`. Cloud Build's
3
- * GitHub App reports check runs whose `external_id` is the build UUID and
4
- * whose `details_url` carries the GCP project; with ADC on the host (e.g. a
5
- * WIF external_account file) the build's log object can be read from GCS.
6
- *
7
- * Required IAM for the ADC principal: roles/cloudbuild.builds.viewer on the
8
- * project and roles/storage.objectViewer on the logs bucket.
9
- */
10
- const CLOUDBUILD_API = "https://cloudbuild.googleapis.com/v1";
11
- const GCS_API = "https://storage.googleapis.com/storage/v1";
12
- /** Check runs reported by this app slug are Cloud Build builds. */
13
- export const CLOUD_BUILD_APP_SLUG = "google-cloud-build";
14
- const BUILD_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
15
- export function isCloudBuildId(value) {
16
- return BUILD_ID_PATTERN.test(value);
17
- }
18
- /** GCP project (id or number) from a Cloud Build details_url, or null. */
19
- export function projectFromDetailsUrl(detailsUrl) {
20
- if (!detailsUrl)
21
- return null;
22
- try {
23
- const project = new URL(detailsUrl).searchParams.get("project");
24
- return project || null;
25
- }
26
- catch {
27
- return null;
28
- }
29
- }
30
- export class CloudBuildLogUnavailableError extends Error {
31
- constructor(message, consoleUrl) {
32
- super(message);
33
- this.consoleUrl = consoleUrl;
34
- this.name = "CloudBuildLogUnavailableError";
35
- }
36
- }
37
- /**
38
- * Fetch one build's log text: builds.get → the `log-<id>.txt` object in the
39
- * build's logs bucket. Throws CloudBuildLogUnavailableError (with the console
40
- * url when known) whenever the log cannot be read — access denied, build not
41
- * found, or CLOUD_LOGGING_ONLY builds that write no GCS object.
42
- */
43
- export async function fetchCloudBuildLog(options) {
44
- const fetchImpl = options.fetchImpl ?? fetch;
45
- const token = await options.tokenProvider.getAccessToken();
46
- const authHeaders = { Authorization: `Bearer ${token}` };
47
- const buildResponse = await fetchImpl(`${CLOUDBUILD_API}/projects/${encodeURIComponent(options.project)}/builds/${encodeURIComponent(options.buildId)}`, { headers: authHeaders });
48
- if (!buildResponse.ok) {
49
- throw new CloudBuildLogUnavailableError(`Cloud Build builds.get failed with ${buildResponse.status} — check that the ADC ` +
50
- `principal has roles/cloudbuild.builds.viewer on project ${options.project}.`);
51
- }
52
- const build = (await buildResponse.json());
53
- if (!build.logsBucket) {
54
- throw new CloudBuildLogUnavailableError("This build stores logs in Cloud Logging only (no GCS log object); read them in the console.", build.logUrl);
55
- }
56
- // logsBucket may be spelled gs://bucket or gs://bucket/some/prefix.
57
- const bucketPath = build.logsBucket.replace(/^gs:\/\//, "");
58
- const [bucket, ...prefixParts] = bucketPath.split("/");
59
- const prefix = prefixParts.length > 0 ? `${prefixParts.join("/")}/` : "";
60
- const objectName = encodeURIComponent(`${prefix}log-${options.buildId}.txt`);
61
- const logResponse = await fetchImpl(`${GCS_API}/b/${bucket}/o/${objectName}?alt=media`, {
62
- headers: authHeaders,
63
- });
64
- if (!logResponse.ok) {
65
- throw new CloudBuildLogUnavailableError(`Cloud Build log object gs://${bucket}/${prefix}log-${options.buildId}.txt returned ` +
66
- `${logResponse.status} — the ADC principal may lack roles/storage.objectViewer on the ` +
67
- `logs bucket, or the build writes logs elsewhere.`, build.logUrl);
68
- }
69
- return logResponse.text();
70
- }
71
- //# sourceMappingURL=cloudbuild.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cloudbuild.js","sourceRoot":"","sources":["../../../src/adapters/github/cloudbuild.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,MAAM,cAAc,GAAG,sCAAsC,CAAC;AAC9D,MAAM,OAAO,GAAG,2CAA2C,CAAC;AAE5D,mEAAmE;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD,MAAM,gBAAgB,GAAG,iEAAiE,CAAC;AAE3F,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,qBAAqB,CAAC,UAAqC;IACzE,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAC7B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAChE,OAAO,OAAO,IAAI,IAAI,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAQD,MAAM,OAAO,6BAA8B,SAAQ,KAAK;IACtD,YACE,OAAe,EACC,UAAmB;QAEnC,KAAK,CAAC,OAAO,CAAC,CAAC;0BAFC,UAAU;QAG1B,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAC9C,CAAC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U,GAAG,kBAAkB,CAAC,GAAG,MAAM,OAAO,OAAO,CAAC,OAAO,MAAM,CAAC,CAAC;IAE7E,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,GAAG,OAAO,MAAM,MAAM,MAAM,UAAU,YAAY,EAAE;QACtF,OAAO,EAAE,WAAW;KACrB,CAAC,CAAC;IACH,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC;QACpB,MAAM,IAAI,6BAA6B,CACrC,+BAA+B,MAAM,IAAI,MAAM,OAAO,OAAO,CAAC,OAAO,gBAAgB;YACnF,GAAG,WAAW,CAAC,MAAM,kEAAkE;YACvF,kDAAkD,EACpD,KAAK,CAAC,MAAM,CACb,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["export type { CloudBuildLogOptions } from \"./types.js\";\nimport type { CloudBuildLogOptions } from \"./types.js\";\n\n/**\n * Host-side Cloud Build log retrieval for `github_checks`. Cloud Build's\n * GitHub App reports check runs whose `external_id` is the build UUID and\n * whose `details_url` carries the GCP project; with ADC on the host (e.g. a\n * WIF external_account file) the build's log object can be read from GCS.\n *\n * Required IAM for the ADC principal: roles/cloudbuild.builds.viewer on the\n * project and roles/storage.objectViewer on the logs bucket.\n */\n\nconst CLOUDBUILD_API = \"https://cloudbuild.googleapis.com/v1\";\nconst GCS_API = \"https://storage.googleapis.com/storage/v1\";\n\n/** Check runs reported by this app slug are Cloud Build builds. */\nexport const CLOUD_BUILD_APP_SLUG = \"google-cloud-build\";\n\nconst BUILD_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\nexport function isCloudBuildId(value: string): boolean {\n return BUILD_ID_PATTERN.test(value);\n}\n\n/** GCP project (id or number) from a Cloud Build details_url, or null. */\nexport function projectFromDetailsUrl(detailsUrl: string | null | undefined): string | null {\n if (!detailsUrl) return null;\n try {\n const project = new URL(detailsUrl).searchParams.get(\"project\");\n return project || null;\n } catch {\n return null;\n }\n}\n\ninterface CloudBuildBuild {\n status?: string;\n logsBucket?: string;\n logUrl?: string;\n}\n\nexport class CloudBuildLogUnavailableError extends Error {\n constructor(\n message: string,\n public readonly consoleUrl?: string,\n ) {\n super(message);\n this.name = \"CloudBuildLogUnavailableError\";\n }\n}\n\n/**\n * Fetch one build's log text: builds.get → the `log-<id>.txt` object in the\n * build's logs bucket. Throws CloudBuildLogUnavailableError (with the console\n * url when known) whenever the log cannot be read — access denied, build not\n * found, or CLOUD_LOGGING_ONLY builds that write no GCS object.\n */\nexport async function fetchCloudBuildLog(options: CloudBuildLogOptions): Promise<string> {\n const fetchImpl = options.fetchImpl ?? fetch;\n const token = await options.tokenProvider.getAccessToken();\n const authHeaders = { Authorization: `Bearer ${token}` };\n\n const buildResponse = await fetchImpl(\n `${CLOUDBUILD_API}/projects/${encodeURIComponent(options.project)}/builds/${encodeURIComponent(options.buildId)}`,\n { headers: authHeaders },\n );\n if (!buildResponse.ok) {\n throw new CloudBuildLogUnavailableError(\n `Cloud Build builds.get failed with ${buildResponse.status} — check that the ADC ` +\n `principal has roles/cloudbuild.builds.viewer on project ${options.project}.`,\n );\n }\n const build = (await buildResponse.json()) as CloudBuildBuild;\n\n if (!build.logsBucket) {\n throw new CloudBuildLogUnavailableError(\n \"This build stores logs in Cloud Logging only (no GCS log object); read them in the console.\",\n build.logUrl,\n );\n }\n // logsBucket may be spelled gs://bucket or gs://bucket/some/prefix.\n const bucketPath = build.logsBucket.replace(/^gs:\\/\\//, \"\");\n const [bucket, ...prefixParts] = bucketPath.split(\"/\");\n const prefix = prefixParts.length > 0 ? `${prefixParts.join(\"/\")}/` : \"\";\n const objectName = encodeURIComponent(`${prefix}log-${options.buildId}.txt`);\n\n const logResponse = await fetchImpl(`${GCS_API}/b/${bucket}/o/${objectName}?alt=media`, {\n headers: authHeaders,\n });\n if (!logResponse.ok) {\n throw new CloudBuildLogUnavailableError(\n `Cloud Build log object gs://${bucket}/${prefix}log-${options.buildId}.txt returned ` +\n `${logResponse.status} — the ADC principal may lack roles/storage.objectViewer on the ` +\n `logs bucket, or the build writes logs elsewhere.`,\n build.logUrl,\n );\n }\n return logResponse.text();\n}\n"]}
@@ -1,28 +0,0 @@
1
- export type { GcpTokenProviderOptions } from "./types.js";
2
- import type { GcpTokenProviderOptions } from "./types.js";
3
- export declare class GcpAuthError extends Error {
4
- constructor(message: string, options?: {
5
- cause?: unknown;
6
- });
7
- }
8
- export declare class GcpTokenProvider {
9
- private readonly credentialsPath;
10
- private readonly fetchImpl;
11
- private credentials;
12
- private cached;
13
- private inFlight;
14
- constructor(options: GcpTokenProviderOptions);
15
- /** A valid cloud-platform access token, cached until near expiry. */
16
- getAccessToken(): Promise<string>;
17
- private loadCredentials;
18
- private mintToken;
19
- private postForm;
20
- /** WIF: read the subject token, exchange at STS, optionally impersonate. */
21
- private mintExternalAccount;
22
- private readSubjectToken;
23
- /** Service-account key: self-signed RS256 JWT → assertion grant. */
24
- private mintServiceAccount;
25
- /** gcloud user ADC: refresh-token grant. */
26
- private mintAuthorizedUser;
27
- }
28
- //# sourceMappingURL=gcp-auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gcp-auth.d.ts","sourceRoot":"","sources":["../../../src/adapters/github/gcp-auth.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AA2D1D,qBAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAGzD;CACF;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,MAAM,CAAqD;IACnE,OAAO,CAAC,QAAQ,CAAgC;IAEhD,YAAY,OAAO,EAAE,uBAAuB,EAG3C;IAED,qEAAqE;IAC/D,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAStC;IAED,OAAO,CAAC,eAAe;YAqBT,SAAS;YAqBT,QAAQ;IAiBtB,4EAA4E;YAC9D,mBAAmB;YA4CnB,gBAAgB;IA+B9B,oEAAoE;YACtD,kBAAkB;IAiChC,4CAA4C;YAC9B,kBAAkB;CAkBjC"}