@aigne/aos 0.2.0-beta

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 (533) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE.md +26 -0
  3. package/dist/agent-dsl.cjs +116 -0
  4. package/dist/agent-dsl.d.cts +31 -0
  5. package/dist/agent-dsl.d.cts.map +1 -0
  6. package/dist/agent-dsl.d.mts +31 -0
  7. package/dist/agent-dsl.d.mts.map +1 -0
  8. package/dist/agent-dsl.mjs +115 -0
  9. package/dist/agent-dsl.mjs.map +1 -0
  10. package/dist/arc-compat.cjs +125 -0
  11. package/dist/arc-compat.d.cts +17 -0
  12. package/dist/arc-compat.d.cts.map +1 -0
  13. package/dist/arc-compat.d.mts +17 -0
  14. package/dist/arc-compat.d.mts.map +1 -0
  15. package/dist/arc-compat.mjs +123 -0
  16. package/dist/arc-compat.mjs.map +1 -0
  17. package/dist/auto-surface/compiler.cjs +36 -0
  18. package/dist/auto-surface/compiler.d.cts +7 -0
  19. package/dist/auto-surface/compiler.d.cts.map +1 -0
  20. package/dist/auto-surface/compiler.d.mts +7 -0
  21. package/dist/auto-surface/compiler.d.mts.map +1 -0
  22. package/dist/auto-surface/compiler.mjs +37 -0
  23. package/dist/auto-surface/compiler.mjs.map +1 -0
  24. package/dist/auto-surface/definition-dsl.cjs +333 -0
  25. package/dist/auto-surface/definition-dsl.d.cts +41 -0
  26. package/dist/auto-surface/definition-dsl.d.cts.map +1 -0
  27. package/dist/auto-surface/definition-dsl.d.mts +41 -0
  28. package/dist/auto-surface/definition-dsl.d.mts.map +1 -0
  29. package/dist/auto-surface/definition-dsl.mjs +332 -0
  30. package/dist/auto-surface/definition-dsl.mjs.map +1 -0
  31. package/dist/auto-surface/fragments.cjs +177 -0
  32. package/dist/auto-surface/fragments.d.cts +23 -0
  33. package/dist/auto-surface/fragments.d.cts.map +1 -0
  34. package/dist/auto-surface/fragments.d.mts +23 -0
  35. package/dist/auto-surface/fragments.d.mts.map +1 -0
  36. package/dist/auto-surface/fragments.mjs +175 -0
  37. package/dist/auto-surface/fragments.mjs.map +1 -0
  38. package/dist/auto-surface/index.d.mts +9 -0
  39. package/dist/auto-surface/layering.cjs +43 -0
  40. package/dist/auto-surface/layering.d.cts +7 -0
  41. package/dist/auto-surface/layering.d.cts.map +1 -0
  42. package/dist/auto-surface/layering.d.mts +7 -0
  43. package/dist/auto-surface/layering.d.mts.map +1 -0
  44. package/dist/auto-surface/layering.mjs +43 -0
  45. package/dist/auto-surface/layering.mjs.map +1 -0
  46. package/dist/auto-surface/projection.cjs +11 -0
  47. package/dist/auto-surface/projection.d.cts +11 -0
  48. package/dist/auto-surface/projection.d.cts.map +1 -0
  49. package/dist/auto-surface/projection.d.mts +11 -0
  50. package/dist/auto-surface/projection.d.mts.map +1 -0
  51. package/dist/auto-surface/projection.mjs +12 -0
  52. package/dist/auto-surface/projection.mjs.map +1 -0
  53. package/dist/auto-surface/projectors/settings-shell.cjs +114 -0
  54. package/dist/auto-surface/projectors/settings-shell.d.cts +10 -0
  55. package/dist/auto-surface/projectors/settings-shell.d.cts.map +1 -0
  56. package/dist/auto-surface/projectors/settings-shell.d.mts +10 -0
  57. package/dist/auto-surface/projectors/settings-shell.d.mts.map +1 -0
  58. package/dist/auto-surface/projectors/settings-shell.mjs +114 -0
  59. package/dist/auto-surface/projectors/settings-shell.mjs.map +1 -0
  60. package/dist/auto-surface/scenario.cjs +38 -0
  61. package/dist/auto-surface/scenario.d.cts +31 -0
  62. package/dist/auto-surface/scenario.d.cts.map +1 -0
  63. package/dist/auto-surface/scenario.d.mts +31 -0
  64. package/dist/auto-surface/scenario.d.mts.map +1 -0
  65. package/dist/auto-surface/scenario.mjs +37 -0
  66. package/dist/auto-surface/scenario.mjs.map +1 -0
  67. package/dist/auto-surface/types.cjs +9 -0
  68. package/dist/auto-surface/types.d.cts +153 -0
  69. package/dist/auto-surface/types.d.cts.map +1 -0
  70. package/dist/auto-surface/types.d.mts +153 -0
  71. package/dist/auto-surface/types.d.mts.map +1 -0
  72. package/dist/auto-surface/types.mjs +9 -0
  73. package/dist/auto-surface/types.mjs.map +1 -0
  74. package/dist/auto-surface/value-dsl.cjs +80 -0
  75. package/dist/auto-surface/value-dsl.d.cts +24 -0
  76. package/dist/auto-surface/value-dsl.d.cts.map +1 -0
  77. package/dist/auto-surface/value-dsl.d.mts +24 -0
  78. package/dist/auto-surface/value-dsl.d.mts.map +1 -0
  79. package/dist/auto-surface/value-dsl.mjs +79 -0
  80. package/dist/auto-surface/value-dsl.mjs.map +1 -0
  81. package/dist/blocklet/activation.cjs +94 -0
  82. package/dist/blocklet/activation.d.cts +30 -0
  83. package/dist/blocklet/activation.d.cts.map +1 -0
  84. package/dist/blocklet/activation.d.mts +30 -0
  85. package/dist/blocklet/activation.d.mts.map +1 -0
  86. package/dist/blocklet/activation.mjs +94 -0
  87. package/dist/blocklet/activation.mjs.map +1 -0
  88. package/dist/blocklet/did-space-registry.cjs +282 -0
  89. package/dist/blocklet/did-space-registry.d.cts +82 -0
  90. package/dist/blocklet/did-space-registry.d.cts.map +1 -0
  91. package/dist/blocklet/did-space-registry.d.mts +82 -0
  92. package/dist/blocklet/did-space-registry.d.mts.map +1 -0
  93. package/dist/blocklet/did-space-registry.mjs +281 -0
  94. package/dist/blocklet/did-space-registry.mjs.map +1 -0
  95. package/dist/blocklet/handlers.cjs +66 -0
  96. package/dist/blocklet/handlers.d.cts +16 -0
  97. package/dist/blocklet/handlers.d.cts.map +1 -0
  98. package/dist/blocklet/handlers.d.mts +16 -0
  99. package/dist/blocklet/handlers.d.mts.map +1 -0
  100. package/dist/blocklet/handlers.mjs +65 -0
  101. package/dist/blocklet/handlers.mjs.map +1 -0
  102. package/dist/blocklet/index.d.mts +7 -0
  103. package/dist/blocklet/manifest.d.cts +2 -0
  104. package/dist/blocklet/manifest.d.mts +2 -0
  105. package/dist/blocklet/manifest.mjs +3 -0
  106. package/dist/blocklet/registry.cjs +447 -0
  107. package/dist/blocklet/registry.d.cts +197 -0
  108. package/dist/blocklet/registry.d.cts.map +1 -0
  109. package/dist/blocklet/registry.d.mts +197 -0
  110. package/dist/blocklet/registry.d.mts.map +1 -0
  111. package/dist/blocklet/registry.mjs +441 -0
  112. package/dist/blocklet/registry.mjs.map +1 -0
  113. package/dist/blocklet/static-render.cjs +183 -0
  114. package/dist/blocklet/static-render.d.cts +55 -0
  115. package/dist/blocklet/static-render.d.cts.map +1 -0
  116. package/dist/blocklet/static-render.d.mts +55 -0
  117. package/dist/blocklet/static-render.d.mts.map +1 -0
  118. package/dist/blocklet/static-render.mjs +181 -0
  119. package/dist/blocklet/static-render.mjs.map +1 -0
  120. package/dist/blocklet/types.d.cts +70 -0
  121. package/dist/blocklet/types.d.cts.map +1 -0
  122. package/dist/blocklet/types.d.mts +70 -0
  123. package/dist/blocklet/types.d.mts.map +1 -0
  124. package/dist/devices/chain.cjs +127 -0
  125. package/dist/devices/chain.d.cts +48 -0
  126. package/dist/devices/chain.d.cts.map +1 -0
  127. package/dist/devices/chain.d.mts +48 -0
  128. package/dist/devices/chain.d.mts.map +1 -0
  129. package/dist/devices/chain.mjs +125 -0
  130. package/dist/devices/chain.mjs.map +1 -0
  131. package/dist/dsl-shared.cjs +290 -0
  132. package/dist/dsl-shared.d.cts +54 -0
  133. package/dist/dsl-shared.d.cts.map +1 -0
  134. package/dist/dsl-shared.d.mts +54 -0
  135. package/dist/dsl-shared.d.mts.map +1 -0
  136. package/dist/dsl-shared.mjs +287 -0
  137. package/dist/dsl-shared.mjs.map +1 -0
  138. package/dist/http/afs-mcp.cjs +85 -0
  139. package/dist/http/afs-mcp.d.cts +14 -0
  140. package/dist/http/afs-mcp.d.cts.map +1 -0
  141. package/dist/http/afs-mcp.d.mts +14 -0
  142. package/dist/http/afs-mcp.d.mts.map +1 -0
  143. package/dist/http/afs-mcp.mjs +86 -0
  144. package/dist/http/afs-mcp.mjs.map +1 -0
  145. package/dist/http/afs-raw.cjs +264 -0
  146. package/dist/http/afs-raw.d.cts +31 -0
  147. package/dist/http/afs-raw.d.cts.map +1 -0
  148. package/dist/http/afs-raw.d.mts +31 -0
  149. package/dist/http/afs-raw.d.mts.map +1 -0
  150. package/dist/http/afs-raw.mjs +264 -0
  151. package/dist/http/afs-raw.mjs.map +1 -0
  152. package/dist/http/afs-rest.cjs +30 -0
  153. package/dist/http/afs-rest.d.cts +21 -0
  154. package/dist/http/afs-rest.d.cts.map +1 -0
  155. package/dist/http/afs-rest.d.mts +21 -0
  156. package/dist/http/afs-rest.d.mts.map +1 -0
  157. package/dist/http/afs-rest.mjs +31 -0
  158. package/dist/http/afs-rest.mjs.map +1 -0
  159. package/dist/http/afs-rpc-wire.cjs +271 -0
  160. package/dist/http/afs-rpc-wire.d.cts +195 -0
  161. package/dist/http/afs-rpc-wire.d.cts.map +1 -0
  162. package/dist/http/afs-rpc-wire.d.mts +195 -0
  163. package/dist/http/afs-rpc-wire.d.mts.map +1 -0
  164. package/dist/http/afs-rpc-wire.mjs +262 -0
  165. package/dist/http/afs-rpc-wire.mjs.map +1 -0
  166. package/dist/http/afs-rpc.cjs +729 -0
  167. package/dist/http/afs-rpc.d.cts +103 -0
  168. package/dist/http/afs-rpc.d.cts.map +1 -0
  169. package/dist/http/afs-rpc.d.mts +103 -0
  170. package/dist/http/afs-rpc.d.mts.map +1 -0
  171. package/dist/http/afs-rpc.mjs +729 -0
  172. package/dist/http/afs-rpc.mjs.map +1 -0
  173. package/dist/http/afs-upload.cjs +116 -0
  174. package/dist/http/afs-upload.d.cts +40 -0
  175. package/dist/http/afs-upload.d.cts.map +1 -0
  176. package/dist/http/afs-upload.d.mts +40 -0
  177. package/dist/http/afs-upload.d.mts.map +1 -0
  178. package/dist/http/afs-upload.mjs +116 -0
  179. package/dist/http/afs-upload.mjs.map +1 -0
  180. package/dist/http/aup-client.cjs +60 -0
  181. package/dist/http/aup-client.d.cts +22 -0
  182. package/dist/http/aup-client.d.cts.map +1 -0
  183. package/dist/http/aup-client.d.mts +22 -0
  184. package/dist/http/aup-client.d.mts.map +1 -0
  185. package/dist/http/aup-client.mjs +59 -0
  186. package/dist/http/aup-client.mjs.map +1 -0
  187. package/dist/http/aup-event.cjs +100 -0
  188. package/dist/http/aup-event.d.cts +38 -0
  189. package/dist/http/aup-event.d.cts.map +1 -0
  190. package/dist/http/aup-event.d.mts +38 -0
  191. package/dist/http/aup-event.d.mts.map +1 -0
  192. package/dist/http/aup-event.mjs +101 -0
  193. package/dist/http/aup-event.mjs.map +1 -0
  194. package/dist/http/auth-context.cjs +66 -0
  195. package/dist/http/auth-context.d.cts +64 -0
  196. package/dist/http/auth-context.d.cts.map +1 -0
  197. package/dist/http/auth-context.d.mts +64 -0
  198. package/dist/http/auth-context.d.mts.map +1 -0
  199. package/dist/http/auth-context.mjs +66 -0
  200. package/dist/http/auth-context.mjs.map +1 -0
  201. package/dist/http/csrf.cjs +50 -0
  202. package/dist/http/csrf.d.cts +8 -0
  203. package/dist/http/csrf.d.cts.map +1 -0
  204. package/dist/http/csrf.d.mts +8 -0
  205. package/dist/http/csrf.d.mts.map +1 -0
  206. package/dist/http/csrf.mjs +49 -0
  207. package/dist/http/csrf.mjs.map +1 -0
  208. package/dist/http/handlers.cjs +106 -0
  209. package/dist/http/handlers.d.cts +39 -0
  210. package/dist/http/handlers.d.cts.map +1 -0
  211. package/dist/http/handlers.d.mts +39 -0
  212. package/dist/http/handlers.d.mts.map +1 -0
  213. package/dist/http/handlers.mjs +104 -0
  214. package/dist/http/handlers.mjs.map +1 -0
  215. package/dist/http/index.d.mts +1 -0
  216. package/dist/http/ingest-facade.cjs +315 -0
  217. package/dist/http/ingest-facade.mjs +314 -0
  218. package/dist/http/ingest-facade.mjs.map +1 -0
  219. package/dist/http/raw-url.cjs +136 -0
  220. package/dist/http/raw-url.d.cts +54 -0
  221. package/dist/http/raw-url.d.cts.map +1 -0
  222. package/dist/http/raw-url.d.mts +54 -0
  223. package/dist/http/raw-url.d.mts.map +1 -0
  224. package/dist/http/raw-url.mjs +136 -0
  225. package/dist/http/raw-url.mjs.map +1 -0
  226. package/dist/http/request-context.cjs +178 -0
  227. package/dist/http/request-context.d.cts +76 -0
  228. package/dist/http/request-context.d.cts.map +1 -0
  229. package/dist/http/request-context.d.mts +76 -0
  230. package/dist/http/request-context.d.mts.map +1 -0
  231. package/dist/http/request-context.mjs +179 -0
  232. package/dist/http/request-context.mjs.map +1 -0
  233. package/dist/index.cjs +197 -0
  234. package/dist/index.d.cts +63 -0
  235. package/dist/index.d.mts +68 -0
  236. package/dist/index.mjs +61 -0
  237. package/dist/mcp/index.cjs +9 -0
  238. package/dist/mcp/index.d.cts +5 -0
  239. package/dist/mcp/index.d.mts +5 -0
  240. package/dist/mcp/index.mjs +6 -0
  241. package/dist/mcp/prompts.cjs +17 -0
  242. package/dist/mcp/prompts.d.cts +8 -0
  243. package/dist/mcp/prompts.d.cts.map +1 -0
  244. package/dist/mcp/prompts.d.mts +8 -0
  245. package/dist/mcp/prompts.d.mts.map +1 -0
  246. package/dist/mcp/prompts.mjs +17 -0
  247. package/dist/mcp/prompts.mjs.map +1 -0
  248. package/dist/mcp/resources.cjs +22 -0
  249. package/dist/mcp/resources.d.cts +8 -0
  250. package/dist/mcp/resources.d.cts.map +1 -0
  251. package/dist/mcp/resources.d.mts +8 -0
  252. package/dist/mcp/resources.d.mts.map +1 -0
  253. package/dist/mcp/resources.mjs +22 -0
  254. package/dist/mcp/resources.mjs.map +1 -0
  255. package/dist/mcp/server.cjs +51 -0
  256. package/dist/mcp/server.d.cts +20 -0
  257. package/dist/mcp/server.d.cts.map +1 -0
  258. package/dist/mcp/server.d.mts +20 -0
  259. package/dist/mcp/server.d.mts.map +1 -0
  260. package/dist/mcp/server.mjs +52 -0
  261. package/dist/mcp/server.mjs.map +1 -0
  262. package/dist/mcp/tools.cjs +218 -0
  263. package/dist/mcp/tools.d.cts +8 -0
  264. package/dist/mcp/tools.d.cts.map +1 -0
  265. package/dist/mcp/tools.d.mts +8 -0
  266. package/dist/mcp/tools.d.mts.map +1 -0
  267. package/dist/mcp/tools.mjs +219 -0
  268. package/dist/mcp/tools.mjs.map +1 -0
  269. package/dist/mcp/utils.cjs +75 -0
  270. package/dist/mcp/utils.mjs +69 -0
  271. package/dist/mcp/utils.mjs.map +1 -0
  272. package/dist/mount/index.cjs +4 -0
  273. package/dist/mount/index.d.cts +3 -0
  274. package/dist/mount/index.d.mts +3 -0
  275. package/dist/mount/index.mjs +3 -0
  276. package/dist/mount/materializer.cjs +167 -0
  277. package/dist/mount/materializer.d.cts +97 -0
  278. package/dist/mount/materializer.d.cts.map +1 -0
  279. package/dist/mount/materializer.d.mts +97 -0
  280. package/dist/mount/materializer.d.mts.map +1 -0
  281. package/dist/mount/materializer.mjs +167 -0
  282. package/dist/mount/materializer.mjs.map +1 -0
  283. package/dist/mount/types.d.cts +90 -0
  284. package/dist/mount/types.d.cts.map +1 -0
  285. package/dist/mount/types.d.mts +90 -0
  286. package/dist/mount/types.d.mts.map +1 -0
  287. package/dist/mount-config.cjs +61 -0
  288. package/dist/mount-config.d.cts +19 -0
  289. package/dist/mount-config.d.cts.map +1 -0
  290. package/dist/mount-config.d.mts +19 -0
  291. package/dist/mount-config.d.mts.map +1 -0
  292. package/dist/mount-config.mjs +61 -0
  293. package/dist/mount-config.mjs.map +1 -0
  294. package/dist/projectors/aup-projector.cjs +190 -0
  295. package/dist/projectors/aup-projector.d.cts +59 -0
  296. package/dist/projectors/aup-projector.d.cts.map +1 -0
  297. package/dist/projectors/aup-projector.d.mts +59 -0
  298. package/dist/projectors/aup-projector.d.mts.map +1 -0
  299. package/dist/projectors/aup-projector.mjs +188 -0
  300. package/dist/projectors/aup-projector.mjs.map +1 -0
  301. package/dist/projectors/index.cjs +6 -0
  302. package/dist/projectors/index.d.cts +2 -0
  303. package/dist/projectors/index.d.mts +2 -0
  304. package/dist/projectors/index.mjs +3 -0
  305. package/dist/scaffold/afs.cjs +195 -0
  306. package/dist/scaffold/afs.d.cts +16 -0
  307. package/dist/scaffold/afs.d.cts.map +1 -0
  308. package/dist/scaffold/afs.d.mts +16 -0
  309. package/dist/scaffold/afs.d.mts.map +1 -0
  310. package/dist/scaffold/afs.mjs +195 -0
  311. package/dist/scaffold/afs.mjs.map +1 -0
  312. package/dist/scaffold/composition.cjs +92 -0
  313. package/dist/scaffold/composition.d.cts +10 -0
  314. package/dist/scaffold/composition.d.cts.map +1 -0
  315. package/dist/scaffold/composition.d.mts +10 -0
  316. package/dist/scaffold/composition.d.mts.map +1 -0
  317. package/dist/scaffold/composition.mjs +92 -0
  318. package/dist/scaffold/composition.mjs.map +1 -0
  319. package/dist/scaffold/dsl-error.cjs +21 -0
  320. package/dist/scaffold/dsl-error.d.cts +11 -0
  321. package/dist/scaffold/dsl-error.d.cts.map +1 -0
  322. package/dist/scaffold/dsl-error.d.mts +11 -0
  323. package/dist/scaffold/dsl-error.d.mts.map +1 -0
  324. package/dist/scaffold/dsl-error.mjs +20 -0
  325. package/dist/scaffold/dsl-error.mjs.map +1 -0
  326. package/dist/scaffold/index.d.mts +12 -0
  327. package/dist/scaffold/manifest-dsl.cjs +188 -0
  328. package/dist/scaffold/manifest-dsl.d.cts +8 -0
  329. package/dist/scaffold/manifest-dsl.d.cts.map +1 -0
  330. package/dist/scaffold/manifest-dsl.d.mts +8 -0
  331. package/dist/scaffold/manifest-dsl.d.mts.map +1 -0
  332. package/dist/scaffold/manifest-dsl.mjs +188 -0
  333. package/dist/scaffold/manifest-dsl.mjs.map +1 -0
  334. package/dist/scaffold/module-dsl.cjs +284 -0
  335. package/dist/scaffold/module-dsl.d.cts +8 -0
  336. package/dist/scaffold/module-dsl.d.cts.map +1 -0
  337. package/dist/scaffold/module-dsl.d.mts +8 -0
  338. package/dist/scaffold/module-dsl.d.mts.map +1 -0
  339. package/dist/scaffold/module-dsl.mjs +284 -0
  340. package/dist/scaffold/module-dsl.mjs.map +1 -0
  341. package/dist/scaffold/resolver.cjs +156 -0
  342. package/dist/scaffold/resolver.d.cts +7 -0
  343. package/dist/scaffold/resolver.d.cts.map +1 -0
  344. package/dist/scaffold/resolver.d.mts +7 -0
  345. package/dist/scaffold/resolver.d.mts.map +1 -0
  346. package/dist/scaffold/resolver.mjs +156 -0
  347. package/dist/scaffold/resolver.mjs.map +1 -0
  348. package/dist/scaffold/runtime.cjs +24 -0
  349. package/dist/scaffold/runtime.d.cts +19 -0
  350. package/dist/scaffold/runtime.d.cts.map +1 -0
  351. package/dist/scaffold/runtime.d.mts +19 -0
  352. package/dist/scaffold/runtime.d.mts.map +1 -0
  353. package/dist/scaffold/runtime.mjs +25 -0
  354. package/dist/scaffold/runtime.mjs.map +1 -0
  355. package/dist/scaffold/shell-dsl.cjs +279 -0
  356. package/dist/scaffold/shell-dsl.d.cts +8 -0
  357. package/dist/scaffold/shell-dsl.d.cts.map +1 -0
  358. package/dist/scaffold/shell-dsl.d.mts +8 -0
  359. package/dist/scaffold/shell-dsl.d.mts.map +1 -0
  360. package/dist/scaffold/shell-dsl.mjs +279 -0
  361. package/dist/scaffold/shell-dsl.mjs.map +1 -0
  362. package/dist/scaffold/surface-dsl.cjs +182 -0
  363. package/dist/scaffold/surface-dsl.d.cts +8 -0
  364. package/dist/scaffold/surface-dsl.d.cts.map +1 -0
  365. package/dist/scaffold/surface-dsl.d.mts +8 -0
  366. package/dist/scaffold/surface-dsl.d.mts.map +1 -0
  367. package/dist/scaffold/surface-dsl.mjs +182 -0
  368. package/dist/scaffold/surface-dsl.mjs.map +1 -0
  369. package/dist/scaffold/surfaces.cjs +84 -0
  370. package/dist/scaffold/surfaces.d.cts +23 -0
  371. package/dist/scaffold/surfaces.d.cts.map +1 -0
  372. package/dist/scaffold/surfaces.d.mts +24 -0
  373. package/dist/scaffold/surfaces.d.mts.map +1 -0
  374. package/dist/scaffold/surfaces.mjs +84 -0
  375. package/dist/scaffold/surfaces.mjs.map +1 -0
  376. package/dist/scaffold/types.d.cts +264 -0
  377. package/dist/scaffold/types.d.cts.map +1 -0
  378. package/dist/scaffold/types.d.mts +265 -0
  379. package/dist/scaffold/types.d.mts.map +1 -0
  380. package/dist/scaffold/workspace-dsl.cjs +339 -0
  381. package/dist/scaffold/workspace-dsl.d.cts +49 -0
  382. package/dist/scaffold/workspace-dsl.d.cts.map +1 -0
  383. package/dist/scaffold/workspace-dsl.d.mts +49 -0
  384. package/dist/scaffold/workspace-dsl.d.mts.map +1 -0
  385. package/dist/scaffold/workspace-dsl.mjs +337 -0
  386. package/dist/scaffold/workspace-dsl.mjs.map +1 -0
  387. package/dist/scope/index.d.mts +3 -0
  388. package/dist/scope/read-blocklet-scope.cjs +29 -0
  389. package/dist/scope/read-blocklet-scope.d.cts +8 -0
  390. package/dist/scope/read-blocklet-scope.d.cts.map +1 -0
  391. package/dist/scope/read-blocklet-scope.d.mts +8 -0
  392. package/dist/scope/read-blocklet-scope.d.mts.map +1 -0
  393. package/dist/scope/read-blocklet-scope.mjs +30 -0
  394. package/dist/scope/read-blocklet-scope.mjs.map +1 -0
  395. package/dist/scope/resolve-scoped-afs.cjs +87 -0
  396. package/dist/scope/resolve-scoped-afs.d.cts +7 -0
  397. package/dist/scope/resolve-scoped-afs.d.cts.map +1 -0
  398. package/dist/scope/resolve-scoped-afs.d.mts +7 -0
  399. package/dist/scope/resolve-scoped-afs.d.mts.map +1 -0
  400. package/dist/scope/resolve-scoped-afs.mjs +88 -0
  401. package/dist/scope/resolve-scoped-afs.mjs.map +1 -0
  402. package/dist/scope/types.d.cts +25 -0
  403. package/dist/scope/types.d.cts.map +1 -0
  404. package/dist/scope/types.d.mts +25 -0
  405. package/dist/scope/types.d.mts.map +1 -0
  406. package/dist/session/backends.cjs +90 -0
  407. package/dist/session/backends.d.cts +35 -0
  408. package/dist/session/backends.d.cts.map +1 -0
  409. package/dist/session/backends.d.mts +35 -0
  410. package/dist/session/backends.d.mts.map +1 -0
  411. package/dist/session/backends.mjs +89 -0
  412. package/dist/session/backends.mjs.map +1 -0
  413. package/dist/session/replication-resolver.cjs +323 -0
  414. package/dist/session/replication-resolver.d.cts +71 -0
  415. package/dist/session/replication-resolver.d.cts.map +1 -0
  416. package/dist/session/replication-resolver.d.mts +71 -0
  417. package/dist/session/replication-resolver.d.mts.map +1 -0
  418. package/dist/session/replication-resolver.mjs +323 -0
  419. package/dist/session/replication-resolver.mjs.map +1 -0
  420. package/dist/session/role-level.cjs +36 -0
  421. package/dist/session/role-level.d.cts +24 -0
  422. package/dist/session/role-level.d.cts.map +1 -0
  423. package/dist/session/role-level.d.mts +24 -0
  424. package/dist/session/role-level.d.mts.map +1 -0
  425. package/dist/session/role-level.mjs +35 -0
  426. package/dist/session/role-level.mjs.map +1 -0
  427. package/dist/session/session-dir-providers.cjs +254 -0
  428. package/dist/session/session-dir-providers.d.cts +32 -0
  429. package/dist/session/session-dir-providers.d.cts.map +1 -0
  430. package/dist/session/session-dir-providers.d.mts +32 -0
  431. package/dist/session/session-dir-providers.d.mts.map +1 -0
  432. package/dist/session/session-dir-providers.mjs +252 -0
  433. package/dist/session/session-dir-providers.mjs.map +1 -0
  434. package/dist/session/session-id.cjs +20 -0
  435. package/dist/session/session-id.d.cts +15 -0
  436. package/dist/session/session-id.d.cts.map +1 -0
  437. package/dist/session/session-id.d.mts +15 -0
  438. package/dist/session/session-id.d.mts.map +1 -0
  439. package/dist/session/session-id.mjs +20 -0
  440. package/dist/session/session-id.mjs.map +1 -0
  441. package/dist/session/session-user-afs.cjs +899 -0
  442. package/dist/session/session-user-afs.d.cts +296 -0
  443. package/dist/session/session-user-afs.d.cts.map +1 -0
  444. package/dist/session/session-user-afs.d.mts +296 -0
  445. package/dist/session/session-user-afs.d.mts.map +1 -0
  446. package/dist/session/session-user-afs.mjs +896 -0
  447. package/dist/session/session-user-afs.mjs.map +1 -0
  448. package/dist/session/settings-cascade.cjs +69 -0
  449. package/dist/session/settings-cascade.d.cts +81 -0
  450. package/dist/session/settings-cascade.d.cts.map +1 -0
  451. package/dist/session/settings-cascade.d.mts +81 -0
  452. package/dist/session/settings-cascade.d.mts.map +1 -0
  453. package/dist/session/settings-cascade.mjs +69 -0
  454. package/dist/session/settings-cascade.mjs.map +1 -0
  455. package/dist/session/settings-resolver.cjs +770 -0
  456. package/dist/session/settings-resolver.d.cts +177 -0
  457. package/dist/session/settings-resolver.d.cts.map +1 -0
  458. package/dist/session/settings-resolver.d.mts +177 -0
  459. package/dist/session/settings-resolver.d.mts.map +1 -0
  460. package/dist/session/settings-resolver.mjs +771 -0
  461. package/dist/session/settings-resolver.mjs.map +1 -0
  462. package/dist/session/settings-schema-store.cjs +0 -0
  463. package/dist/session/settings-schema-store.d.cts +72 -0
  464. package/dist/session/settings-schema-store.d.cts.map +1 -0
  465. package/dist/session/settings-schema-store.d.mts +72 -0
  466. package/dist/session/settings-schema-store.d.mts.map +1 -0
  467. package/dist/session/settings-schema-store.mjs +0 -0
  468. package/dist/session/settings-schema-store.mjs.map +1 -0
  469. package/dist/system-mounts/index.cjs +14 -0
  470. package/dist/system-mounts/index.d.cts +6 -0
  471. package/dist/system-mounts/index.d.mts +6 -0
  472. package/dist/system-mounts/index.mjs +6 -0
  473. package/dist/system-mounts/install.cjs +101 -0
  474. package/dist/system-mounts/install.d.cts +36 -0
  475. package/dist/system-mounts/install.d.cts.map +1 -0
  476. package/dist/system-mounts/install.d.mts +37 -0
  477. package/dist/system-mounts/install.d.mts.map +1 -0
  478. package/dist/system-mounts/install.mjs +102 -0
  479. package/dist/system-mounts/install.mjs.map +1 -0
  480. package/dist/system-mounts/installers.cjs +247 -0
  481. package/dist/system-mounts/installers.d.cts +13 -0
  482. package/dist/system-mounts/installers.d.cts.map +1 -0
  483. package/dist/system-mounts/installers.d.mts +14 -0
  484. package/dist/system-mounts/installers.d.mts.map +1 -0
  485. package/dist/system-mounts/installers.mjs +244 -0
  486. package/dist/system-mounts/installers.mjs.map +1 -0
  487. package/dist/system-mounts/lists.cjs +122 -0
  488. package/dist/system-mounts/lists.d.cts +34 -0
  489. package/dist/system-mounts/lists.d.cts.map +1 -0
  490. package/dist/system-mounts/lists.d.mts +34 -0
  491. package/dist/system-mounts/lists.d.mts.map +1 -0
  492. package/dist/system-mounts/lists.mjs +122 -0
  493. package/dist/system-mounts/lists.mjs.map +1 -0
  494. package/dist/system-mounts/types.d.cts +124 -0
  495. package/dist/system-mounts/types.d.cts.map +1 -0
  496. package/dist/system-mounts/types.d.mts +125 -0
  497. package/dist/system-mounts/types.d.mts.map +1 -0
  498. package/dist/system-mounts/validate.cjs +56 -0
  499. package/dist/system-mounts/validate.d.cts +34 -0
  500. package/dist/system-mounts/validate.d.cts.map +1 -0
  501. package/dist/system-mounts/validate.d.mts +34 -0
  502. package/dist/system-mounts/validate.d.mts.map +1 -0
  503. package/dist/system-mounts/validate.mjs +56 -0
  504. package/dist/system-mounts/validate.mjs.map +1 -0
  505. package/dist/terminal-llm.cjs +90 -0
  506. package/dist/terminal-llm.d.cts +50 -0
  507. package/dist/terminal-llm.d.cts.map +1 -0
  508. package/dist/terminal-llm.d.mts +50 -0
  509. package/dist/terminal-llm.d.mts.map +1 -0
  510. package/dist/terminal-llm.mjs +90 -0
  511. package/dist/terminal-llm.mjs.map +1 -0
  512. package/dist/terminal-repl.cjs +371 -0
  513. package/dist/terminal-repl.d.cts +69 -0
  514. package/dist/terminal-repl.d.cts.map +1 -0
  515. package/dist/terminal-repl.d.mts +69 -0
  516. package/dist/terminal-repl.d.mts.map +1 -0
  517. package/dist/terminal-repl.mjs +370 -0
  518. package/dist/terminal-repl.mjs.map +1 -0
  519. package/dist/transport/idle-timer.cjs +136 -0
  520. package/dist/transport/idle-timer.d.cts +92 -0
  521. package/dist/transport/idle-timer.d.cts.map +1 -0
  522. package/dist/transport/idle-timer.d.mts +92 -0
  523. package/dist/transport/idle-timer.d.mts.map +1 -0
  524. package/dist/transport/idle-timer.mjs +132 -0
  525. package/dist/transport/idle-timer.mjs.map +1 -0
  526. package/dist/web-component-dsl.cjs +153 -0
  527. package/dist/web-component-dsl.d.cts +27 -0
  528. package/dist/web-component-dsl.d.cts.map +1 -0
  529. package/dist/web-component-dsl.d.mts +27 -0
  530. package/dist/web-component-dsl.d.mts.map +1 -0
  531. package/dist/web-component-dsl.mjs +152 -0
  532. package/dist/web-component-dsl.mjs.map +1 -0
  533. package/package.json +81 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installers.mjs","names":[],"sources":["../../src/system-mounts/installers.ts"],"sourcesContent":["/**\n * Runtime-neutral `install` escape-hatch implementations for the composite\n * entries in {@link SYSTEM_MOUNTS} (design.md §4.1). These orchestrate\n * multi-step mounts that a single `path`+`providerKey` can't express:\n *\n * - {@link aiInstall} — `/dev/ai` device + legacy/compat projections\n * - {@link chainInstall} — `/dev/chain/<network>` per builtin/config network + AUP\n * - {@link deviceInstall} — `/dev/ui`, `/dev/web` projections (conditional on source)\n * - {@link observabilityInstall} — `/dev/observability` (+ optional host-inbox)\n * - {@link messagingInstall} — `/proc/messaging/agents` + `/proc/messaging/tools`\n *\n * Crucial invariant: NONE of these import a runtime-specific module. All\n * provider *construction* is delegated to the `registry` factories the\n * runtime supplies (Node builds disk-backed providers + loads AUP from the\n * package dir; CF builds bundled providers + loads AUP over HTTP). Projection\n * uses `ProjectionProvider` from `@aigne/afs` (runtime-neutral) and AUP\n * companion resources flow through the factory's `resources` field + the\n * materializer's `aupResourceProjector`. So these hatches bundle cleanly into\n * the Cloudflare Worker even when CF's registry omits the keys (the hatch\n * skips that sub-mount).\n */\n\nimport { type AFS, type AFSRoot, ProjectionProvider } from \"@aigne/afs\";\nimport { time } from \"@aigne/afs-timing\";\nimport { joinURL } from \"ufo\";\nimport {\n BUILTIN_CHAIN_NETWORKS,\n type ChainNetworkConfig,\n chainNetworkToMountEntry,\n validateChainNetworks,\n} from \"../devices/chain.js\";\nimport { materializeProviderMount, type ProviderFactory, redactError } from \"../mount/index.js\";\nimport { aupResourceProjector } from \"../projectors/index.js\";\nimport type { InstallOutcome, SystemMountContext } from \"./types.js\";\n\nconst PROJECTION_OVERLAY = { allowOverlay: true } as const;\n\nfunction getMounts(afs: AFSRoot): { path: string }[] {\n const fn = (afs as unknown as AFS).getMounts;\n return typeof fn === \"function\" ? fn.call(afs) : [];\n}\n\nfunction hasMount(afs: AFSRoot, path: string): boolean {\n return getMounts(afs).some((m) => m.path === path);\n}\n\n/** Mount a `ProjectionProvider` alias `target → source`, idempotent + tolerant. */\nasync function mountProjection(\n afs: AFSRoot,\n target: string,\n source: string,\n name: string,\n out: InstallOutcome,\n): Promise<void> {\n if (hasMount(afs, target)) return;\n try {\n await (afs as unknown as AFS).mount(\n new ProjectionProvider({ name, globalAFS: afs as unknown as AFS, sourcePath: source }),\n target,\n PROJECTION_OVERLAY,\n );\n out.mounted.push(target);\n } catch (err) {\n out.warnings.push(`${target}: projection failed — ${redactError(err)}`);\n }\n}\n\n// ── AI ──────────────────────────────────────────────────────────────────────\n// Port of runtimes/node/src/config/system-ai-mounts.ts, with the device\n// constructed via registry[\"ai-device\"] instead of a direct `new AFSAIDevice`.\n\nconst AI_DEVICE = \"/dev/ai\";\nconst AI_HUBS_AIGNEHUB = \"/dev/ai/hubs/aignehub\";\nconst AI_LOCAL_EMBEDDING = \"/dev/ai/local/embedding\";\nconst LEGACY_AIGNEHUB = \"/modules/aignehub\";\nconst LEGACY_EMBEDDING = \"/modules/embedding\";\nconst COMPAT_HUB = \"/dev/ai/hub\";\nconst COMPAT_DEFAULTS = \"/dev/ai/defaults\";\nconst COMPAT_EMBEDDING = \"/dev/ai/embedding\";\n\nexport async function aiInstall(\n afs: AFSRoot,\n _ctx: SystemMountContext,\n registry: Record<string, ProviderFactory>,\n): Promise<InstallOutcome> {\n const out: InstallOutcome = { mounted: [], warnings: [] };\n\n // Step 1: legacy AIGNE Hub → canonical /dev/ai/hubs/aignehub.\n if (!hasMount(afs, AI_HUBS_AIGNEHUB)) {\n const legacy = hasMount(afs, LEGACY_AIGNEHUB)\n ? LEGACY_AIGNEHUB\n : hasMount(afs, COMPAT_HUB)\n ? COMPAT_HUB\n : null;\n if (legacy) await mountProjection(afs, AI_HUBS_AIGNEHUB, legacy, \"dev-ai-hubs-aignehub\", out);\n }\n\n // Step 2: legacy embedding → canonical /dev/ai/local/embedding.\n if (!hasMount(afs, AI_LOCAL_EMBEDDING) && hasMount(afs, LEGACY_EMBEDDING)) {\n await mountProjection(afs, AI_LOCAL_EMBEDDING, LEGACY_EMBEDDING, \"dev-ai-local-embedding\", out);\n }\n\n // Step 3: backward-compat aliases.\n if (hasMount(afs, AI_HUBS_AIGNEHUB)) {\n await mountProjection(afs, COMPAT_HUB, AI_HUBS_AIGNEHUB, \"dev-ai-hub-compat\", out);\n await mountProjection(\n afs,\n COMPAT_DEFAULTS,\n joinURL(AI_HUBS_AIGNEHUB, \"defaults\"),\n \"dev-ai-defaults-compat\",\n out,\n );\n }\n if (hasMount(afs, AI_LOCAL_EMBEDDING)) {\n await mountProjection(\n afs,\n COMPAT_EMBEDDING,\n AI_LOCAL_EMBEDDING,\n \"dev-ai-embedding-compat\",\n out,\n );\n }\n\n // Step 4: device parent at /dev/ai (after hub/local children), via registry.\n // A runtime that doesn't register `ai-device` simply skips this mount — that\n // is intentional subset behaviour (matches the driver's default-path\n // skip-silently), NOT a warning-worthy failure.\n if (!hasMount(afs, AI_DEVICE)) {\n const factory = registry[\"ai-device\"];\n if (factory) {\n try {\n const options: Record<string, unknown> = { globalAFS: afs };\n if (hasMount(afs, \"/user\")) options.userSpaceRoot = \"/user\";\n const { provider } = await factory.create({\n uri: `ai-device://system${AI_DEVICE}`,\n type: \"ai-device\",\n options,\n });\n await (afs as unknown as AFS).mount(provider, AI_DEVICE, PROJECTION_OVERLAY);\n out.mounted.push(AI_DEVICE);\n } catch (err) {\n out.warnings.push(`${AI_DEVICE}: mount failed — ${redactError(err)}`);\n }\n }\n }\n\n return out;\n}\n\n// ── chain ─────────────────────────────────────────────────────────────────\n// Port of runtimes/node/src/config/system-chain-mounts.ts through the\n// materializer. `validateChainNetworks` THROWS on bad config — that throw\n// propagates out of the driver, keeping chain config errors fatal (the Node\n// daemon refuses to start rather than half-applying), matching legacy.\n\nexport async function chainInstall(\n afs: AFSRoot,\n ctx: SystemMountContext,\n registry: Record<string, ProviderFactory>,\n): Promise<InstallOutcome> {\n const out: InstallOutcome = { mounted: [], warnings: [] };\n\n const configs = ctx.chainConfigs as readonly ChainNetworkConfig[] | undefined;\n const source = configs && configs.length > 0 ? configs : BUILTIN_CHAIN_NETWORKS;\n const cfgs: ChainNetworkConfig[] = [...source];\n\n // Fatal on bad config (throws) — do NOT catch.\n validateChainNetworks(cfgs);\n\n // No `ocap` factory → this runtime can't build chain mounts; skip silently\n // (intentional subset, not a failure). validateChainNetworks above still runs\n // so bad config stays fatal regardless of whether the factory is present.\n const factory = registry[\"ocap\"];\n if (!factory) return out;\n\n for (const cfg of cfgs) {\n const path = chainNetworkToMountEntry(cfg).path;\n if (hasMount(afs, path)) continue;\n try {\n // Per-network span (`mnt.dev.chain.main` / `.beta`) so the two builtin\n // networks are individually attributable in cold-start Server-Timing.\n await time(`mnt.dev.chain.${cfg.network}`, () =>\n materializeProviderMount({\n afs: afs as unknown as AFS,\n mountPath: path,\n definition: {\n uri: `ocap://system${path}`,\n type: \"ocap\",\n options: {\n endpoint: cfg.endpoint,\n description: `Chain network ${cfg.network} via ${safeEndpointLabel(cfg.endpoint)}`,\n },\n },\n factory,\n projectors: [aupResourceProjector],\n scope: \"host\",\n mountOptions: PROJECTION_OVERLAY,\n // Host scope: the chain mount is useful without AUP supplements, so a\n // recipe-projection failure must not unmount the data tree.\n projectionFailure: \"warn\",\n }),\n );\n out.mounted.push(path);\n } catch (err) {\n out.warnings.push(`${path}: mount failed — ${redactError(err)}`);\n }\n }\n\n return out;\n}\n\nfunction safeEndpointLabel(endpoint: string): string {\n try {\n const url = new URL(endpoint);\n return `${url.protocol}//${url.host}`;\n } catch {\n return \"<endpoint>\";\n }\n}\n\n// ── device (ui/web) ─────────────────────────────────────────────────────────\n// Port of runtimes/node/src/config/system-device-mounts.ts. Pure projections,\n// conditional on the source mounts existing.\n\nexport async function deviceInstall(afs: AFSRoot): Promise<InstallOutcome> {\n const out: InstallOutcome = { mounted: [], warnings: [] };\n const pairs: Array<[string, string, string]> = [\n [\"/dev/ui\", \"/ui\", \"dev-ui\"],\n [\"/dev/web\", \"/web\", \"dev-web\"],\n ];\n for (const [target, source, name] of pairs) {\n if (hasMount(afs, target)) continue;\n if (!hasMount(afs, source)) continue;\n await mountProjection(afs, target, source, name, out);\n }\n return out;\n}\n\n// ── observability ─────────────────────────────────────────────────────────\n// Port of runtimes/node/src/config/system-observability-mounts.ts. The\n// host-inbox (a node-only AFSFS) is built via registry[\"observability-host-inbox\"];\n// CF omits that key → no host-inbox, viewer still mounts. All failures degrade\n// to warnings (observability is supplementary — never abort startup).\n\nconst OBS_PATH = \"/dev/observability\";\nconst OBS_HOST_INBOX = \"/dev/observability/.host-inbox\";\n\nexport async function observabilityInstall(\n afs: AFSRoot,\n _ctx: SystemMountContext,\n registry: Record<string, ProviderFactory>,\n): Promise<InstallOutcome> {\n const out: InstallOutcome = { mounted: [], warnings: [] };\n\n if (hasMount(afs, OBS_PATH)) {\n out.warnings.push(`${OBS_PATH}: already mounted — skipped`);\n return out;\n }\n\n // Host-inbox: hidden FS where CLI/system runs land jsonl traces. Node-only.\n let hostInboxMounted = false;\n const hostInboxFactory = registry[\"observability-host-inbox\"];\n if (hostInboxFactory) {\n try {\n const { provider } = await hostInboxFactory.create({\n uri: `fs://system${OBS_HOST_INBOX}`,\n type: \"fs\",\n });\n await (afs as unknown as AFS).mount(provider, OBS_HOST_INBOX, { hidden: true });\n hostInboxMounted = true;\n out.mounted.push(OBS_HOST_INBOX);\n } catch (err) {\n out.warnings.push(`${OBS_HOST_INBOX}: mount failed — ${redactError(err)}`);\n }\n }\n\n // No `observability` factory → this runtime doesn't ship the viewer (e.g. CF\n // today; it's a P5 item). Skip silently — intentional subset, not a failure.\n // Logging a warning here on every createAfsFromEnv was pure noise.\n const factory = registry[\"observability\"];\n if (!factory) return out;\n try {\n await materializeProviderMount({\n afs: afs as unknown as AFS,\n mountPath: OBS_PATH,\n definition: {\n uri: `observability://system${OBS_PATH}`,\n type: \"observability\",\n options: {\n upstream: afs,\n description: \"AI agent observability — jsonl event log viewer\",\n ...(hostInboxMounted ? { hostInboxPath: OBS_HOST_INBOX } : {}),\n },\n },\n factory,\n projectors: [aupResourceProjector],\n scope: \"host\",\n mountOptions: PROJECTION_OVERLAY,\n projectionFailure: \"warn\",\n });\n out.mounted.push(OBS_PATH);\n } catch (err) {\n out.warnings.push(`${OBS_PATH}: mount failed — ${redactError(err)}`);\n }\n\n return out;\n}\n\n// ── messaging ─────────────────────────────────────────────────────────────\n// Two subtrees mirroring daemon.ts:3954/3966. Both providers are node-only\n// (FS inbox + the messaging builtin), so the Node daemon mounts them directly\n// in its own context (it owns `userDataRoot`); this hatch is the shared\n// contract + the path CF would take once it registers messaging keys. When the\n// registry lacks the keys (afs-loader, CF today) it no-ops.\n\nconst MSG_AGENTS = \"/proc/messaging/agents\";\nconst MSG_TOOLS = \"/proc/messaging/tools\";\n\nexport async function messagingInstall(\n afs: AFSRoot,\n _ctx: SystemMountContext,\n registry: Record<string, ProviderFactory>,\n): Promise<InstallOutcome> {\n const out: InstallOutcome = { mounted: [], warnings: [] };\n\n const agentsFactory = registry[\"messaging-agents\"];\n if (agentsFactory && !hasMount(afs, MSG_AGENTS)) {\n try {\n const { provider } = await agentsFactory.create({\n uri: `fs://system${MSG_AGENTS}`,\n type: \"fs\",\n });\n await (afs as unknown as AFS).mount(provider, MSG_AGENTS, PROJECTION_OVERLAY);\n out.mounted.push(MSG_AGENTS);\n } catch (err) {\n out.warnings.push(`${MSG_AGENTS}: mount failed — ${redactError(err)}`);\n }\n }\n\n const toolsFactory = registry[\"messaging-tools\"];\n if (toolsFactory && !hasMount(afs, MSG_TOOLS)) {\n try {\n const { provider } = await toolsFactory.create({\n uri: `messaging-tools://system${MSG_TOOLS}`,\n type: \"messaging-tools\",\n });\n await (afs as unknown as AFS).mount(provider, MSG_TOOLS, PROJECTION_OVERLAY);\n out.mounted.push(MSG_TOOLS);\n } catch (err) {\n out.warnings.push(`${MSG_TOOLS}: mount failed — ${redactError(err)}`);\n }\n }\n\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,qBAAqB,EAAE,cAAc,MAAM;AAEjD,SAAS,UAAU,KAAkC;CACnD,MAAM,KAAM,IAAuB;AACnC,QAAO,OAAO,OAAO,aAAa,GAAG,KAAK,IAAI,GAAG,EAAE;;AAGrD,SAAS,SAAS,KAAc,MAAuB;AACrD,QAAO,UAAU,IAAI,CAAC,MAAM,MAAM,EAAE,SAAS,KAAK;;;AAIpD,eAAe,gBACb,KACA,QACA,QACA,MACA,KACe;AACf,KAAI,SAAS,KAAK,OAAO,CAAE;AAC3B,KAAI;AACF,QAAO,IAAuB,MAC5B,IAAI,mBAAmB;GAAE;GAAM,WAAW;GAAuB,YAAY;GAAQ,CAAC,EACtF,QACA,mBACD;AACD,MAAI,QAAQ,KAAK,OAAO;UACjB,KAAK;AACZ,MAAI,SAAS,KAAK,GAAG,OAAO,wBAAwB,YAAY,IAAI,GAAG;;;AAQ3E,MAAM,YAAY;AAClB,MAAM,mBAAmB;AACzB,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AACzB,MAAM,aAAa;AACnB,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AAEzB,eAAsB,UACpB,KACA,MACA,UACyB;CACzB,MAAM,MAAsB;EAAE,SAAS,EAAE;EAAE,UAAU,EAAE;EAAE;AAGzD,KAAI,CAAC,SAAS,KAAK,iBAAiB,EAAE;EACpC,MAAM,SAAS,SAAS,KAAK,gBAAgB,GACzC,kBACA,SAAS,KAAK,WAAW,GACvB,aACA;AACN,MAAI,OAAQ,OAAM,gBAAgB,KAAK,kBAAkB,QAAQ,wBAAwB,IAAI;;AAI/F,KAAI,CAAC,SAAS,KAAK,mBAAmB,IAAI,SAAS,KAAK,iBAAiB,CACvE,OAAM,gBAAgB,KAAK,oBAAoB,kBAAkB,0BAA0B,IAAI;AAIjG,KAAI,SAAS,KAAK,iBAAiB,EAAE;AACnC,QAAM,gBAAgB,KAAK,YAAY,kBAAkB,qBAAqB,IAAI;AAClF,QAAM,gBACJ,KACA,iBACA,QAAQ,kBAAkB,WAAW,EACrC,0BACA,IACD;;AAEH,KAAI,SAAS,KAAK,mBAAmB,CACnC,OAAM,gBACJ,KACA,kBACA,oBACA,2BACA,IACD;AAOH,KAAI,CAAC,SAAS,KAAK,UAAU,EAAE;EAC7B,MAAM,UAAU,SAAS;AACzB,MAAI,QACF,KAAI;GACF,MAAM,UAAmC,EAAE,WAAW,KAAK;AAC3D,OAAI,SAAS,KAAK,QAAQ,CAAE,SAAQ,gBAAgB;GACpD,MAAM,EAAE,aAAa,MAAM,QAAQ,OAAO;IACxC,KAAK,qBAAqB;IAC1B,MAAM;IACN;IACD,CAAC;AACF,SAAO,IAAuB,MAAM,UAAU,WAAW,mBAAmB;AAC5E,OAAI,QAAQ,KAAK,UAAU;WACpB,KAAK;AACZ,OAAI,SAAS,KAAK,GAAG,UAAU,mBAAmB,YAAY,IAAI,GAAG;;;AAK3E,QAAO;;AAST,eAAsB,aACpB,KACA,KACA,UACyB;CACzB,MAAM,MAAsB;EAAE,SAAS,EAAE;EAAE,UAAU,EAAE;EAAE;CAEzD,MAAM,UAAU,IAAI;CAEpB,MAAM,OAA6B,CAAC,GADrB,WAAW,QAAQ,SAAS,IAAI,UAAU,uBACX;AAG9C,uBAAsB,KAAK;CAK3B,MAAM,UAAU,SAAS;AACzB,KAAI,CAAC,QAAS,QAAO;AAErB,MAAK,MAAM,OAAO,MAAM;EACtB,MAAM,OAAO,yBAAyB,IAAI,CAAC;AAC3C,MAAI,SAAS,KAAK,KAAK,CAAE;AACzB,MAAI;AAGF,SAAM,KAAK,iBAAiB,IAAI,iBAC9B,yBAAyB;IAClB;IACL,WAAW;IACX,YAAY;KACV,KAAK,gBAAgB;KACrB,MAAM;KACN,SAAS;MACP,UAAU,IAAI;MACd,aAAa,iBAAiB,IAAI,QAAQ,OAAO,kBAAkB,IAAI,SAAS;MACjF;KACF;IACD;IACA,YAAY,CAAC,qBAAqB;IAClC,OAAO;IACP,cAAc;IAGd,mBAAmB;IACpB,CAAC,CACH;AACD,OAAI,QAAQ,KAAK,KAAK;WACf,KAAK;AACZ,OAAI,SAAS,KAAK,GAAG,KAAK,mBAAmB,YAAY,IAAI,GAAG;;;AAIpE,QAAO;;AAGT,SAAS,kBAAkB,UAA0B;AACnD,KAAI;EACF,MAAM,MAAM,IAAI,IAAI,SAAS;AAC7B,SAAO,GAAG,IAAI,SAAS,IAAI,IAAI;SACzB;AACN,SAAO;;;AAQX,eAAsB,cAAc,KAAuC;CACzE,MAAM,MAAsB;EAAE,SAAS,EAAE;EAAE,UAAU,EAAE;EAAE;AAKzD,MAAK,MAAM,CAAC,QAAQ,QAAQ,SAJmB,CAC7C;EAAC;EAAW;EAAO;EAAS,EAC5B;EAAC;EAAY;EAAQ;EAAU,CAChC,EAC2C;AAC1C,MAAI,SAAS,KAAK,OAAO,CAAE;AAC3B,MAAI,CAAC,SAAS,KAAK,OAAO,CAAE;AAC5B,QAAM,gBAAgB,KAAK,QAAQ,QAAQ,MAAM,IAAI;;AAEvD,QAAO;;AAST,MAAM,WAAW;AACjB,MAAM,iBAAiB;AAEvB,eAAsB,qBACpB,KACA,MACA,UACyB;CACzB,MAAM,MAAsB;EAAE,SAAS,EAAE;EAAE,UAAU,EAAE;EAAE;AAEzD,KAAI,SAAS,KAAK,SAAS,EAAE;AAC3B,MAAI,SAAS,KAAK,GAAG,SAAS,6BAA6B;AAC3D,SAAO;;CAIT,IAAI,mBAAmB;CACvB,MAAM,mBAAmB,SAAS;AAClC,KAAI,iBACF,KAAI;EACF,MAAM,EAAE,aAAa,MAAM,iBAAiB,OAAO;GACjD,KAAK,cAAc;GACnB,MAAM;GACP,CAAC;AACF,QAAO,IAAuB,MAAM,UAAU,gBAAgB,EAAE,QAAQ,MAAM,CAAC;AAC/E,qBAAmB;AACnB,MAAI,QAAQ,KAAK,eAAe;UACzB,KAAK;AACZ,MAAI,SAAS,KAAK,GAAG,eAAe,mBAAmB,YAAY,IAAI,GAAG;;CAO9E,MAAM,UAAU,SAAS;AACzB,KAAI,CAAC,QAAS,QAAO;AACrB,KAAI;AACF,QAAM,yBAAyB;GACxB;GACL,WAAW;GACX,YAAY;IACV,KAAK,yBAAyB;IAC9B,MAAM;IACN,SAAS;KACP,UAAU;KACV,aAAa;KACb,GAAI,mBAAmB,EAAE,eAAe,gBAAgB,GAAG,EAAE;KAC9D;IACF;GACD;GACA,YAAY,CAAC,qBAAqB;GAClC,OAAO;GACP,cAAc;GACd,mBAAmB;GACpB,CAAC;AACF,MAAI,QAAQ,KAAK,SAAS;UACnB,KAAK;AACZ,MAAI,SAAS,KAAK,GAAG,SAAS,mBAAmB,YAAY,IAAI,GAAG;;AAGtE,QAAO;;AAUT,MAAM,aAAa;AACnB,MAAM,YAAY;AAElB,eAAsB,iBACpB,KACA,MACA,UACyB;CACzB,MAAM,MAAsB;EAAE,SAAS,EAAE;EAAE,UAAU,EAAE;EAAE;CAEzD,MAAM,gBAAgB,SAAS;AAC/B,KAAI,iBAAiB,CAAC,SAAS,KAAK,WAAW,CAC7C,KAAI;EACF,MAAM,EAAE,aAAa,MAAM,cAAc,OAAO;GAC9C,KAAK,cAAc;GACnB,MAAM;GACP,CAAC;AACF,QAAO,IAAuB,MAAM,UAAU,YAAY,mBAAmB;AAC7E,MAAI,QAAQ,KAAK,WAAW;UACrB,KAAK;AACZ,MAAI,SAAS,KAAK,GAAG,WAAW,mBAAmB,YAAY,IAAI,GAAG;;CAI1E,MAAM,eAAe,SAAS;AAC9B,KAAI,gBAAgB,CAAC,SAAS,KAAK,UAAU,CAC3C,KAAI;EACF,MAAM,EAAE,aAAa,MAAM,aAAa,OAAO;GAC7C,KAAK,2BAA2B;GAChC,MAAM;GACP,CAAC;AACF,QAAO,IAAuB,MAAM,UAAU,WAAW,mBAAmB;AAC5E,MAAI,QAAQ,KAAK,UAAU;UACpB,KAAK;AACZ,MAAI,SAAS,KAAK,GAAG,UAAU,mBAAmB,YAAY,IAAI,GAAG;;AAIzE,QAAO"}
@@ -0,0 +1,122 @@
1
+ const require_installers = require('./installers.cjs');
2
+
3
+ //#region src/system-mounts/lists.ts
4
+ /**
5
+ * The two single-source-of-truth lists this design produces (design.md §4):
6
+ *
7
+ * - {@link SYSTEM_MOUNTS} — axis A, host-install descriptors.
8
+ * - {@link SMALL_WORLD_PROJECTION} — axis B, which host system mounts each
9
+ * blocklet's small-world session AFS may project.
10
+ *
11
+ * Both are frozen so a downstream consumer that mutates one (push/splice/
12
+ * index-assign) can't corrupt the other runtime's view — the lists are
13
+ * shared module singletons.
14
+ *
15
+ * Phase 0 ships `SMALL_WORLD_PROJECTION` fully populated (pure string data,
16
+ * no logic) and `SYSTEM_MOUNTS` as a frozen empty array. Phase 1 replaces
17
+ * the `SYSTEM_MOUNTS` body with the full descriptor list once the `install`
18
+ * escape-hatch logic exists.
19
+ */
20
+ /**
21
+ * Axis A — the host-install single source of truth. Each runtime materializes
22
+ * the entries whose `providerKey` its registry can build (or whose `install`
23
+ * hatch's dependencies it can satisfy); the rest are skipped silently.
24
+ *
25
+ * Order bands (design.md §4): ash(10) → agent(20) → index(30) → ai(40) →
26
+ * ai-agent(41) → chain(50) → device(60) → observability(70) → messaging(80).
27
+ * `/ash` precedes `/dev/agent` (agent's lazy `runAsh` dep); AI device parent
28
+ * is installed after its hub/local children inside the hatch; the `/dev/ai/agent`
29
+ * exec adapter overlays the `/dev/ai` device (so it is ordered right after it).
30
+ *
31
+ * `/modules/memory` is intentionally absent — it is NOT a host-install (§2.1).
32
+ *
33
+ * Frozen so a downstream consumer can't corrupt the shared list.
34
+ */
35
+ const SYSTEM_MOUNTS = Object.freeze([
36
+ {
37
+ path: "/ash",
38
+ providerKey: "ash",
39
+ order: 10,
40
+ mountOptions: { allowOverlay: true }
41
+ },
42
+ {
43
+ path: "/dev/agent",
44
+ providerKey: "agent",
45
+ order: 20,
46
+ dependsOn: ["/ash"],
47
+ mountOptions: { allowOverlay: true }
48
+ },
49
+ {
50
+ path: "/modules/index",
51
+ providerKey: "index",
52
+ order: 30,
53
+ mountOptions: { allowOverlay: true }
54
+ },
55
+ {
56
+ path: "/modules/embedding",
57
+ providerKey: "embedding",
58
+ order: 35,
59
+ mountOptions: { allowOverlay: true }
60
+ },
61
+ {
62
+ path: "/dev/ai",
63
+ order: 40,
64
+ install: require_installers.aiInstall
65
+ },
66
+ {
67
+ path: "/dev/ai/agent",
68
+ providerKey: "ai-agent",
69
+ order: 41,
70
+ dependsOn: ["/dev/ai", "/dev/agent"],
71
+ mountOptions: { allowOverlay: true }
72
+ },
73
+ {
74
+ path: "/dev/chain",
75
+ order: 50,
76
+ install: require_installers.chainInstall,
77
+ dependsOn: ["/dev/ai"]
78
+ },
79
+ {
80
+ path: "/dev/ui",
81
+ order: 60,
82
+ install: require_installers.deviceInstall
83
+ },
84
+ {
85
+ path: "/dev/observability",
86
+ order: 70,
87
+ install: require_installers.observabilityInstall
88
+ },
89
+ {
90
+ path: "/proc/messaging",
91
+ order: 80,
92
+ install: require_installers.messagingInstall
93
+ }
94
+ ]);
95
+ /**
96
+ * Axis B — the small-world projection allow-list (design.md §2.1 / §4).
97
+ * Mirrors the Node daemon's `systemMounts` array (daemon.ts:3812). Each
98
+ * runtime projects only the entries it actually has on its host AFS; missing
99
+ * ones are skipped without error (CF, today, only has `/dev/ai` + `/dev/chain`).
100
+ *
101
+ * `/modules/memory` is **legacy-only**: it is NOT a host-install (see §2.1 —
102
+ * it's the `MEMORY_SCRATCH_ROOT` constant wired by `setAgentMemoryRoot`, not
103
+ * an `afs.mount`), but it stays in the projection so older blocklets can keep
104
+ * reading legacy scratch until a dedicated cleanup.
105
+ */
106
+ const SMALL_WORLD_PROJECTION = Object.freeze([
107
+ "/ash",
108
+ "/dev/ai",
109
+ "/dev/agent",
110
+ "/dev/ui",
111
+ "/dev/web",
112
+ "/dev/chain",
113
+ "/dev/observability",
114
+ "/modules/index",
115
+ "/modules/embedding",
116
+ "/proc/messaging",
117
+ "/modules/memory"
118
+ ]);
119
+
120
+ //#endregion
121
+ exports.SMALL_WORLD_PROJECTION = SMALL_WORLD_PROJECTION;
122
+ exports.SYSTEM_MOUNTS = SYSTEM_MOUNTS;
@@ -0,0 +1,34 @@
1
+ import { SmallWorldProjection, SystemMountDescriptor } from "./types.cjs";
2
+
3
+ //#region src/system-mounts/lists.d.ts
4
+ /**
5
+ * Axis A — the host-install single source of truth. Each runtime materializes
6
+ * the entries whose `providerKey` its registry can build (or whose `install`
7
+ * hatch's dependencies it can satisfy); the rest are skipped silently.
8
+ *
9
+ * Order bands (design.md §4): ash(10) → agent(20) → index(30) → ai(40) →
10
+ * ai-agent(41) → chain(50) → device(60) → observability(70) → messaging(80).
11
+ * `/ash` precedes `/dev/agent` (agent's lazy `runAsh` dep); AI device parent
12
+ * is installed after its hub/local children inside the hatch; the `/dev/ai/agent`
13
+ * exec adapter overlays the `/dev/ai` device (so it is ordered right after it).
14
+ *
15
+ * `/modules/memory` is intentionally absent — it is NOT a host-install (§2.1).
16
+ *
17
+ * Frozen so a downstream consumer can't corrupt the shared list.
18
+ */
19
+ declare const SYSTEM_MOUNTS: readonly SystemMountDescriptor[];
20
+ /**
21
+ * Axis B — the small-world projection allow-list (design.md §2.1 / §4).
22
+ * Mirrors the Node daemon's `systemMounts` array (daemon.ts:3812). Each
23
+ * runtime projects only the entries it actually has on its host AFS; missing
24
+ * ones are skipped without error (CF, today, only has `/dev/ai` + `/dev/chain`).
25
+ *
26
+ * `/modules/memory` is **legacy-only**: it is NOT a host-install (see §2.1 —
27
+ * it's the `MEMORY_SCRATCH_ROOT` constant wired by `setAgentMemoryRoot`, not
28
+ * an `afs.mount`), but it stays in the projection so older blocklets can keep
29
+ * reading legacy scratch until a dedicated cleanup.
30
+ */
31
+ declare const SMALL_WORLD_PROJECTION: SmallWorldProjection;
32
+ //#endregion
33
+ export { SMALL_WORLD_PROJECTION, SYSTEM_MOUNTS };
34
+ //# sourceMappingURL=lists.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lists.d.cts","names":[],"sources":["../../src/system-mounts/lists.ts"],"mappings":";;;;;;;;;;;;;;;;;;cAyCa,aAAA,WAAwB,qBAAA;;;;;;;;;;;;cA0DxB,sBAAA,EAAwB,oBAAA"}
@@ -0,0 +1,34 @@
1
+ import { SmallWorldProjection, SystemMountDescriptor } from "./types.mjs";
2
+
3
+ //#region src/system-mounts/lists.d.ts
4
+ /**
5
+ * Axis A — the host-install single source of truth. Each runtime materializes
6
+ * the entries whose `providerKey` its registry can build (or whose `install`
7
+ * hatch's dependencies it can satisfy); the rest are skipped silently.
8
+ *
9
+ * Order bands (design.md §4): ash(10) → agent(20) → index(30) → ai(40) →
10
+ * ai-agent(41) → chain(50) → device(60) → observability(70) → messaging(80).
11
+ * `/ash` precedes `/dev/agent` (agent's lazy `runAsh` dep); AI device parent
12
+ * is installed after its hub/local children inside the hatch; the `/dev/ai/agent`
13
+ * exec adapter overlays the `/dev/ai` device (so it is ordered right after it).
14
+ *
15
+ * `/modules/memory` is intentionally absent — it is NOT a host-install (§2.1).
16
+ *
17
+ * Frozen so a downstream consumer can't corrupt the shared list.
18
+ */
19
+ declare const SYSTEM_MOUNTS: readonly SystemMountDescriptor[];
20
+ /**
21
+ * Axis B — the small-world projection allow-list (design.md §2.1 / §4).
22
+ * Mirrors the Node daemon's `systemMounts` array (daemon.ts:3812). Each
23
+ * runtime projects only the entries it actually has on its host AFS; missing
24
+ * ones are skipped without error (CF, today, only has `/dev/ai` + `/dev/chain`).
25
+ *
26
+ * `/modules/memory` is **legacy-only**: it is NOT a host-install (see §2.1 —
27
+ * it's the `MEMORY_SCRATCH_ROOT` constant wired by `setAgentMemoryRoot`, not
28
+ * an `afs.mount`), but it stays in the projection so older blocklets can keep
29
+ * reading legacy scratch until a dedicated cleanup.
30
+ */
31
+ declare const SMALL_WORLD_PROJECTION: SmallWorldProjection;
32
+ //#endregion
33
+ export { SMALL_WORLD_PROJECTION, SYSTEM_MOUNTS };
34
+ //# sourceMappingURL=lists.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lists.d.mts","names":[],"sources":["../../src/system-mounts/lists.ts"],"mappings":";;;;;;;;;;;;;;;;;;cAyCa,aAAA,WAAwB,qBAAA;;;;;;;;;;;;cA0DxB,sBAAA,EAAwB,oBAAA"}
@@ -0,0 +1,122 @@
1
+ import { aiInstall, chainInstall, deviceInstall, messagingInstall, observabilityInstall } from "./installers.mjs";
2
+
3
+ //#region src/system-mounts/lists.ts
4
+ /**
5
+ * The two single-source-of-truth lists this design produces (design.md §4):
6
+ *
7
+ * - {@link SYSTEM_MOUNTS} — axis A, host-install descriptors.
8
+ * - {@link SMALL_WORLD_PROJECTION} — axis B, which host system mounts each
9
+ * blocklet's small-world session AFS may project.
10
+ *
11
+ * Both are frozen so a downstream consumer that mutates one (push/splice/
12
+ * index-assign) can't corrupt the other runtime's view — the lists are
13
+ * shared module singletons.
14
+ *
15
+ * Phase 0 ships `SMALL_WORLD_PROJECTION` fully populated (pure string data,
16
+ * no logic) and `SYSTEM_MOUNTS` as a frozen empty array. Phase 1 replaces
17
+ * the `SYSTEM_MOUNTS` body with the full descriptor list once the `install`
18
+ * escape-hatch logic exists.
19
+ */
20
+ /**
21
+ * Axis A — the host-install single source of truth. Each runtime materializes
22
+ * the entries whose `providerKey` its registry can build (or whose `install`
23
+ * hatch's dependencies it can satisfy); the rest are skipped silently.
24
+ *
25
+ * Order bands (design.md §4): ash(10) → agent(20) → index(30) → ai(40) →
26
+ * ai-agent(41) → chain(50) → device(60) → observability(70) → messaging(80).
27
+ * `/ash` precedes `/dev/agent` (agent's lazy `runAsh` dep); AI device parent
28
+ * is installed after its hub/local children inside the hatch; the `/dev/ai/agent`
29
+ * exec adapter overlays the `/dev/ai` device (so it is ordered right after it).
30
+ *
31
+ * `/modules/memory` is intentionally absent — it is NOT a host-install (§2.1).
32
+ *
33
+ * Frozen so a downstream consumer can't corrupt the shared list.
34
+ */
35
+ const SYSTEM_MOUNTS = Object.freeze([
36
+ {
37
+ path: "/ash",
38
+ providerKey: "ash",
39
+ order: 10,
40
+ mountOptions: { allowOverlay: true }
41
+ },
42
+ {
43
+ path: "/dev/agent",
44
+ providerKey: "agent",
45
+ order: 20,
46
+ dependsOn: ["/ash"],
47
+ mountOptions: { allowOverlay: true }
48
+ },
49
+ {
50
+ path: "/modules/index",
51
+ providerKey: "index",
52
+ order: 30,
53
+ mountOptions: { allowOverlay: true }
54
+ },
55
+ {
56
+ path: "/modules/embedding",
57
+ providerKey: "embedding",
58
+ order: 35,
59
+ mountOptions: { allowOverlay: true }
60
+ },
61
+ {
62
+ path: "/dev/ai",
63
+ order: 40,
64
+ install: aiInstall
65
+ },
66
+ {
67
+ path: "/dev/ai/agent",
68
+ providerKey: "ai-agent",
69
+ order: 41,
70
+ dependsOn: ["/dev/ai", "/dev/agent"],
71
+ mountOptions: { allowOverlay: true }
72
+ },
73
+ {
74
+ path: "/dev/chain",
75
+ order: 50,
76
+ install: chainInstall,
77
+ dependsOn: ["/dev/ai"]
78
+ },
79
+ {
80
+ path: "/dev/ui",
81
+ order: 60,
82
+ install: deviceInstall
83
+ },
84
+ {
85
+ path: "/dev/observability",
86
+ order: 70,
87
+ install: observabilityInstall
88
+ },
89
+ {
90
+ path: "/proc/messaging",
91
+ order: 80,
92
+ install: messagingInstall
93
+ }
94
+ ]);
95
+ /**
96
+ * Axis B — the small-world projection allow-list (design.md §2.1 / §4).
97
+ * Mirrors the Node daemon's `systemMounts` array (daemon.ts:3812). Each
98
+ * runtime projects only the entries it actually has on its host AFS; missing
99
+ * ones are skipped without error (CF, today, only has `/dev/ai` + `/dev/chain`).
100
+ *
101
+ * `/modules/memory` is **legacy-only**: it is NOT a host-install (see §2.1 —
102
+ * it's the `MEMORY_SCRATCH_ROOT` constant wired by `setAgentMemoryRoot`, not
103
+ * an `afs.mount`), but it stays in the projection so older blocklets can keep
104
+ * reading legacy scratch until a dedicated cleanup.
105
+ */
106
+ const SMALL_WORLD_PROJECTION = Object.freeze([
107
+ "/ash",
108
+ "/dev/ai",
109
+ "/dev/agent",
110
+ "/dev/ui",
111
+ "/dev/web",
112
+ "/dev/chain",
113
+ "/dev/observability",
114
+ "/modules/index",
115
+ "/modules/embedding",
116
+ "/proc/messaging",
117
+ "/modules/memory"
118
+ ]);
119
+
120
+ //#endregion
121
+ export { SMALL_WORLD_PROJECTION, SYSTEM_MOUNTS };
122
+ //# sourceMappingURL=lists.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lists.mjs","names":[],"sources":["../../src/system-mounts/lists.ts"],"sourcesContent":["/**\n * The two single-source-of-truth lists this design produces (design.md §4):\n *\n * - {@link SYSTEM_MOUNTS} — axis A, host-install descriptors.\n * - {@link SMALL_WORLD_PROJECTION} — axis B, which host system mounts each\n * blocklet's small-world session AFS may project.\n *\n * Both are frozen so a downstream consumer that mutates one (push/splice/\n * index-assign) can't corrupt the other runtime's view — the lists are\n * shared module singletons.\n *\n * Phase 0 ships `SMALL_WORLD_PROJECTION` fully populated (pure string data,\n * no logic) and `SYSTEM_MOUNTS` as a frozen empty array. Phase 1 replaces\n * the `SYSTEM_MOUNTS` body with the full descriptor list once the `install`\n * escape-hatch logic exists.\n */\n\nimport {\n aiInstall,\n chainInstall,\n deviceInstall,\n messagingInstall,\n observabilityInstall,\n} from \"./installers.js\";\nimport type { SmallWorldProjection, SystemMountDescriptor } from \"./types.js\";\n\n/**\n * Axis A — the host-install single source of truth. Each runtime materializes\n * the entries whose `providerKey` its registry can build (or whose `install`\n * hatch's dependencies it can satisfy); the rest are skipped silently.\n *\n * Order bands (design.md §4): ash(10) → agent(20) → index(30) → ai(40) →\n * ai-agent(41) → chain(50) → device(60) → observability(70) → messaging(80).\n * `/ash` precedes `/dev/agent` (agent's lazy `runAsh` dep); AI device parent\n * is installed after its hub/local children inside the hatch; the `/dev/ai/agent`\n * exec adapter overlays the `/dev/ai` device (so it is ordered right after it).\n *\n * `/modules/memory` is intentionally absent — it is NOT a host-install (§2.1).\n *\n * Frozen so a downstream consumer can't corrupt the shared list.\n */\nexport const SYSTEM_MOUNTS: readonly SystemMountDescriptor[] = Object.freeze([\n { path: \"/ash\", providerKey: \"ash\", order: 10, mountOptions: { allowOverlay: true } },\n {\n path: \"/dev/agent\",\n providerKey: \"agent\",\n order: 20,\n dependsOn: [\"/ash\"],\n mountOptions: { allowOverlay: true },\n },\n { path: \"/modules/index\", providerKey: \"index\", order: 30, mountOptions: { allowOverlay: true } },\n // Local embedding provider — order 35 so it is mounted BEFORE the `/dev/ai`\n // hatch (40), which projects `/modules/embedding` → `/dev/ai/local/embedding`.\n // A runtime whose registry has no `embedding` factory (CF uses workers-ai)\n // skips this silently, and the projection then no-ops.\n {\n path: \"/modules/embedding\",\n providerKey: \"embedding\",\n order: 35,\n mountOptions: { allowOverlay: true },\n },\n // Composite: device parent + legacy/compat projections (design §4.1).\n { path: \"/dev/ai\", order: 40, install: aiInstall },\n // Agent-run exec adapter (@aigne/afs-ai-agent): exposes `.actions/run` +\n // `.actions/run-code` that agent-handler.ts dispatches for the generic chat\n // surface. It overlays the readonly `/dev/ai` device, so it MUST be ordered\n // after it (41 > 40) and mounted with `allowOverlay`. Without this mount the\n // handler's `/dev/ai/agent/.actions/run` exec falls through to the readonly\n // `/dev/ai` device → \"Cannot exec on a readonly provider\" (issue #1390). A\n // runtime whose registry lacks the `ai-agent` key skips it silently.\n {\n path: \"/dev/ai/agent\",\n providerKey: \"ai-agent\",\n order: 41,\n dependsOn: [\"/dev/ai\", \"/dev/agent\"],\n mountOptions: { allowOverlay: true },\n },\n // Composite: per-network OCAP mounts + AUP; chain config errors stay fatal.\n { path: \"/dev/chain\", order: 50, install: chainInstall, dependsOn: [\"/dev/ai\"] },\n // Composite: /dev/ui + /dev/web projections, conditional on /ui + /web.\n { path: \"/dev/ui\", order: 60, install: deviceInstall },\n // Composite: viewer (+ optional node-only host-inbox).\n { path: \"/dev/observability\", order: 70, install: observabilityInstall },\n // Composite: /proc/messaging/agents + /proc/messaging/tools (node-only; the\n // Node daemon mounts these in its own context — this is the shared contract).\n { path: \"/proc/messaging\", order: 80, install: messagingInstall },\n]);\n\n/**\n * Axis B — the small-world projection allow-list (design.md §2.1 / §4).\n * Mirrors the Node daemon's `systemMounts` array (daemon.ts:3812). Each\n * runtime projects only the entries it actually has on its host AFS; missing\n * ones are skipped without error (CF, today, only has `/dev/ai` + `/dev/chain`).\n *\n * `/modules/memory` is **legacy-only**: it is NOT a host-install (see §2.1 —\n * it's the `MEMORY_SCRATCH_ROOT` constant wired by `setAgentMemoryRoot`, not\n * an `afs.mount`), but it stays in the projection so older blocklets can keep\n * reading legacy scratch until a dedicated cleanup.\n */\nexport const SMALL_WORLD_PROJECTION: SmallWorldProjection = Object.freeze([\n \"/ash\",\n \"/dev/ai\",\n \"/dev/agent\",\n \"/dev/ui\",\n \"/dev/web\",\n \"/dev/chain\",\n \"/dev/observability\",\n \"/modules/index\",\n \"/modules/embedding\",\n \"/proc/messaging\",\n \"/modules/memory\",\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,gBAAkD,OAAO,OAAO;CAC3E;EAAE,MAAM;EAAQ,aAAa;EAAO,OAAO;EAAI,cAAc,EAAE,cAAc,MAAM;EAAE;CACrF;EACE,MAAM;EACN,aAAa;EACb,OAAO;EACP,WAAW,CAAC,OAAO;EACnB,cAAc,EAAE,cAAc,MAAM;EACrC;CACD;EAAE,MAAM;EAAkB,aAAa;EAAS,OAAO;EAAI,cAAc,EAAE,cAAc,MAAM;EAAE;CAKjG;EACE,MAAM;EACN,aAAa;EACb,OAAO;EACP,cAAc,EAAE,cAAc,MAAM;EACrC;CAED;EAAE,MAAM;EAAW,OAAO;EAAI,SAAS;EAAW;CAQlD;EACE,MAAM;EACN,aAAa;EACb,OAAO;EACP,WAAW,CAAC,WAAW,aAAa;EACpC,cAAc,EAAE,cAAc,MAAM;EACrC;CAED;EAAE,MAAM;EAAc,OAAO;EAAI,SAAS;EAAc,WAAW,CAAC,UAAU;EAAE;CAEhF;EAAE,MAAM;EAAW,OAAO;EAAI,SAAS;EAAe;CAEtD;EAAE,MAAM;EAAsB,OAAO;EAAI,SAAS;EAAsB;CAGxE;EAAE,MAAM;EAAmB,OAAO;EAAI,SAAS;EAAkB;CAClE,CAAC;;;;;;;;;;;;AAaF,MAAa,yBAA+C,OAAO,OAAO;CACxE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
@@ -0,0 +1,124 @@
1
+ import { ProviderFactory } from "../mount/types.cjs";
2
+ import { AFSRoot, MountOptions } from "@aigne/afs";
3
+
4
+ //#region src/system-mounts/types.d.ts
5
+ /**
6
+ * Runtime-supplied context threaded into descriptor callbacks (`options`,
7
+ * `conditional`, `install`). Lets a descriptor resolve provider options that
8
+ * depend on the live AFS (e.g. detect a `/user` mount) or runtime-specific
9
+ * roots without baking runtime assumptions into the shared list.
10
+ *
11
+ * The shape is intentionally open (`[key: string]: unknown`) — runtimes add
12
+ * their own fields (Node passes `configMountPaths`, a future CF context may
13
+ * pass D1 bindings) and descriptor callbacks read only what they need.
14
+ */
15
+ interface SystemMountContext {
16
+ /**
17
+ * The global/host AFS the mounts are being installed onto. Same instance
18
+ * passed to {@link installSystemMounts}'s first argument; re-exposed here
19
+ * so `options`/`conditional`/`install` callbacks can inspect existing
20
+ * mounts (e.g. `conditional: (ctx) => hasMount(ctx.afs, "/ui")`).
21
+ */
22
+ afs: AFSRoot;
23
+ /**
24
+ * Config-declared mount paths already applied to `afs` before system
25
+ * mounts run. Node's `setupSystemAIMounts` uses this to detect legacy
26
+ * `/modules/aignehub` hub mounts; CF may pass `[]`.
27
+ */
28
+ configMountPaths?: string[];
29
+ /** Runtime-specific extensions (D1 bindings, user-space roots, …). */
30
+ [key: string]: unknown;
31
+ }
32
+ /**
33
+ * The result of installing one descriptor (or the whole list). `mounted`
34
+ * lists every path actually mounted (including supplement/companion mounts
35
+ * an `install` hatch adds); `warnings` collects non-fatal failures so the
36
+ * caller can log them without aborting siblings.
37
+ */
38
+ interface InstallOutcome {
39
+ /** Paths newly mounted by this descriptor. */
40
+ mounted: string[];
41
+ /** Non-fatal failures (e.g. provider package missing). */
42
+ warnings: string[];
43
+ }
44
+ /**
45
+ * A single system-mount declaration. The common case is
46
+ * `{ path, providerKey, order }` — the driver looks `providerKey` up in the
47
+ * per-runtime registry and materializes it. Multi-step mounts (AI compat
48
+ * projections, chain builtins + AUP, observability host-inbox, messaging's
49
+ * two subtrees) use the {@link SystemMountDescriptor.install} escape hatch.
50
+ *
51
+ * @see design.md §4 / §4.1
52
+ */
53
+ interface SystemMountDescriptor {
54
+ /** Absolute host-install path, e.g. `"/dev/agent"`. Must start with `/`. */
55
+ path: string;
56
+ /**
57
+ * Registry key the driver looks up to construct the provider, e.g.
58
+ * `"agent"`, `"ocap"`. Ignored when {@link install} is supplied.
59
+ * Optional only when `install` is present (a composite installer owns its
60
+ * own construction).
61
+ */
62
+ providerKey?: string;
63
+ /**
64
+ * Provider options. Either a literal object or a function of the
65
+ * {@link SystemMountContext} (for options that depend on the live AFS,
66
+ * e.g. wiring `userSpaceRoot: "/user"` only when `/user` is mounted).
67
+ */
68
+ options?: Record<string, unknown> | ((ctx: SystemMountContext) => Record<string, unknown>);
69
+ /**
70
+ * Install order. Lower runs first. Encodes the ordering constraints from
71
+ * the Node setup group — `/ash` before `/dev/agent`, AI hub children
72
+ * before the `/dev/ai` device parent, etc. See design.md §4 for the
73
+ * canonical order band assignments.
74
+ */
75
+ order: number;
76
+ /**
77
+ * Declarative dependency paths this mount needs in place first. Advisory
78
+ * metadata for documentation/diagnostics; the driver enforces actual
79
+ * ordering via {@link order}.
80
+ */
81
+ dependsOn?: string[];
82
+ /**
83
+ * Predicate gating whether this descriptor installs at all. Returning
84
+ * `false` skips the mount (not an error). Example: `/dev/ui` only when its
85
+ * source `/ui` mount exists.
86
+ */
87
+ conditional?: (ctx: SystemMountContext) => boolean;
88
+ /** Forwarded to `afs.mount()` for the data provider (allowOverlay/hidden). */
89
+ mountOptions?: MountOptions;
90
+ /**
91
+ * Strategy when AUP/companion-resource projection fails. `"warn"` keeps the
92
+ * data mount and logs (host-scope default); `"rollback"` unmounts. Mirrors
93
+ * the materializer's `projectionFailure`.
94
+ */
95
+ projectionFailure?: "warn" | "rollback";
96
+ /**
97
+ * Escape hatch for composite mounts that a single
98
+ * `path`+`providerKey`+`options` can't express (multi-mount subtrees,
99
+ * legacy-alias projections, validate-then-mount, …). When present the
100
+ * driver calls this INSTEAD of the default materialize path and ignores
101
+ * {@link providerKey}. The installer receives the host AFS, the context,
102
+ * and the runtime registry (so it can reuse registered factories), and
103
+ * returns what it mounted + any warnings.
104
+ *
105
+ * The escape hatch does not break "divergence = data": `install` is still
106
+ * one entry in the shared list. A runtime whose registry lacks the keys
107
+ * the installer needs simply has the installer skip those sub-mounts.
108
+ *
109
+ * @see design.md §4.1
110
+ */
111
+ install?: (afs: AFSRoot, ctx: SystemMountContext, registry: Record<string, ProviderFactory>) => Promise<InstallOutcome>;
112
+ }
113
+ /**
114
+ * Axis B: the set of host system-mount path prefixes each blocklet's
115
+ * small-world session AFS should project from the global AFS. A readonly
116
+ * string list — pure data, no executable callbacks, no injection surface.
117
+ *
118
+ * Each runtime projects only the entries that actually exist on its host
119
+ * AFS (missing ones are skipped, not errored). See design.md §2.1 / §4.
120
+ */
121
+ type SmallWorldProjection = readonly string[];
122
+ //#endregion
123
+ export { InstallOutcome, SmallWorldProjection, SystemMountContext, SystemMountDescriptor };
124
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/system-mounts/types.ts"],"mappings":";;;;;;;;;;;;;;UAkCiB,kBAAA;EAgHH;;;;;;EAzGZ,GAAA,EAAK,OAAA;EAoDiC;;;;;EA7CtC,gBAAA;EAmEe;EAAA,CAhEd,GAAA;AAAA;;;;;;;UASc,cAAA;EAqFY;EAnF3B,OAAA;EAoFK;EAlFL,QAAA;AAAA;;AA6FF;;;;;;;;UAjFiB,qBAAA;;EAEf,IAAA;;;;;;;EAQA,WAAA;;;;;;EAOA,OAAA,GAAU,MAAA,sBAA4B,GAAA,EAAK,kBAAA,KAAuB,MAAA;;;;;;;EAQlE,KAAA;;;;;;EAOA,SAAA;;;;;;EAOA,WAAA,IAAe,GAAA,EAAK,kBAAA;;EAGpB,YAAA,GAAe,YAAA;;;;;;EAOf,iBAAA;;;;;;;;;;;;;;;;EAiBA,OAAA,IACE,GAAA,EAAK,OAAA,EACL,GAAA,EAAK,kBAAA,EACL,QAAA,EAAU,MAAA,SAAe,eAAA,MACtB,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;KAWH,oBAAA"}
@@ -0,0 +1,125 @@
1
+ import { ProviderFactory } from "../mount/types.mjs";
2
+ import "../mount/index.mjs";
3
+ import { AFSRoot, MountOptions } from "@aigne/afs";
4
+
5
+ //#region src/system-mounts/types.d.ts
6
+ /**
7
+ * Runtime-supplied context threaded into descriptor callbacks (`options`,
8
+ * `conditional`, `install`). Lets a descriptor resolve provider options that
9
+ * depend on the live AFS (e.g. detect a `/user` mount) or runtime-specific
10
+ * roots without baking runtime assumptions into the shared list.
11
+ *
12
+ * The shape is intentionally open (`[key: string]: unknown`) — runtimes add
13
+ * their own fields (Node passes `configMountPaths`, a future CF context may
14
+ * pass D1 bindings) and descriptor callbacks read only what they need.
15
+ */
16
+ interface SystemMountContext {
17
+ /**
18
+ * The global/host AFS the mounts are being installed onto. Same instance
19
+ * passed to {@link installSystemMounts}'s first argument; re-exposed here
20
+ * so `options`/`conditional`/`install` callbacks can inspect existing
21
+ * mounts (e.g. `conditional: (ctx) => hasMount(ctx.afs, "/ui")`).
22
+ */
23
+ afs: AFSRoot;
24
+ /**
25
+ * Config-declared mount paths already applied to `afs` before system
26
+ * mounts run. Node's `setupSystemAIMounts` uses this to detect legacy
27
+ * `/modules/aignehub` hub mounts; CF may pass `[]`.
28
+ */
29
+ configMountPaths?: string[];
30
+ /** Runtime-specific extensions (D1 bindings, user-space roots, …). */
31
+ [key: string]: unknown;
32
+ }
33
+ /**
34
+ * The result of installing one descriptor (or the whole list). `mounted`
35
+ * lists every path actually mounted (including supplement/companion mounts
36
+ * an `install` hatch adds); `warnings` collects non-fatal failures so the
37
+ * caller can log them without aborting siblings.
38
+ */
39
+ interface InstallOutcome {
40
+ /** Paths newly mounted by this descriptor. */
41
+ mounted: string[];
42
+ /** Non-fatal failures (e.g. provider package missing). */
43
+ warnings: string[];
44
+ }
45
+ /**
46
+ * A single system-mount declaration. The common case is
47
+ * `{ path, providerKey, order }` — the driver looks `providerKey` up in the
48
+ * per-runtime registry and materializes it. Multi-step mounts (AI compat
49
+ * projections, chain builtins + AUP, observability host-inbox, messaging's
50
+ * two subtrees) use the {@link SystemMountDescriptor.install} escape hatch.
51
+ *
52
+ * @see design.md §4 / §4.1
53
+ */
54
+ interface SystemMountDescriptor {
55
+ /** Absolute host-install path, e.g. `"/dev/agent"`. Must start with `/`. */
56
+ path: string;
57
+ /**
58
+ * Registry key the driver looks up to construct the provider, e.g.
59
+ * `"agent"`, `"ocap"`. Ignored when {@link install} is supplied.
60
+ * Optional only when `install` is present (a composite installer owns its
61
+ * own construction).
62
+ */
63
+ providerKey?: string;
64
+ /**
65
+ * Provider options. Either a literal object or a function of the
66
+ * {@link SystemMountContext} (for options that depend on the live AFS,
67
+ * e.g. wiring `userSpaceRoot: "/user"` only when `/user` is mounted).
68
+ */
69
+ options?: Record<string, unknown> | ((ctx: SystemMountContext) => Record<string, unknown>);
70
+ /**
71
+ * Install order. Lower runs first. Encodes the ordering constraints from
72
+ * the Node setup group — `/ash` before `/dev/agent`, AI hub children
73
+ * before the `/dev/ai` device parent, etc. See design.md §4 for the
74
+ * canonical order band assignments.
75
+ */
76
+ order: number;
77
+ /**
78
+ * Declarative dependency paths this mount needs in place first. Advisory
79
+ * metadata for documentation/diagnostics; the driver enforces actual
80
+ * ordering via {@link order}.
81
+ */
82
+ dependsOn?: string[];
83
+ /**
84
+ * Predicate gating whether this descriptor installs at all. Returning
85
+ * `false` skips the mount (not an error). Example: `/dev/ui` only when its
86
+ * source `/ui` mount exists.
87
+ */
88
+ conditional?: (ctx: SystemMountContext) => boolean;
89
+ /** Forwarded to `afs.mount()` for the data provider (allowOverlay/hidden). */
90
+ mountOptions?: MountOptions;
91
+ /**
92
+ * Strategy when AUP/companion-resource projection fails. `"warn"` keeps the
93
+ * data mount and logs (host-scope default); `"rollback"` unmounts. Mirrors
94
+ * the materializer's `projectionFailure`.
95
+ */
96
+ projectionFailure?: "warn" | "rollback";
97
+ /**
98
+ * Escape hatch for composite mounts that a single
99
+ * `path`+`providerKey`+`options` can't express (multi-mount subtrees,
100
+ * legacy-alias projections, validate-then-mount, …). When present the
101
+ * driver calls this INSTEAD of the default materialize path and ignores
102
+ * {@link providerKey}. The installer receives the host AFS, the context,
103
+ * and the runtime registry (so it can reuse registered factories), and
104
+ * returns what it mounted + any warnings.
105
+ *
106
+ * The escape hatch does not break "divergence = data": `install` is still
107
+ * one entry in the shared list. A runtime whose registry lacks the keys
108
+ * the installer needs simply has the installer skip those sub-mounts.
109
+ *
110
+ * @see design.md §4.1
111
+ */
112
+ install?: (afs: AFSRoot, ctx: SystemMountContext, registry: Record<string, ProviderFactory>) => Promise<InstallOutcome>;
113
+ }
114
+ /**
115
+ * Axis B: the set of host system-mount path prefixes each blocklet's
116
+ * small-world session AFS should project from the global AFS. A readonly
117
+ * string list — pure data, no executable callbacks, no injection surface.
118
+ *
119
+ * Each runtime projects only the entries that actually exist on its host
120
+ * AFS (missing ones are skipped, not errored). See design.md §2.1 / §4.
121
+ */
122
+ type SmallWorldProjection = readonly string[];
123
+ //#endregion
124
+ export { InstallOutcome, SmallWorldProjection, SystemMountContext, SystemMountDescriptor };
125
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/system-mounts/types.ts"],"mappings":";;;;;;;;;;;;;;;UAkCiB,kBAAA;EAgHV;;;;;;EAzGL,GAAA,EAAK,OAAA;EAoDsC;;;;;EA7C3C,gBAAA;EAmEoB;EAAA,CAhEnB,GAAA;AAAA;;;;;;;UASc,cAAA;EAqFH;EAnFZ,OAAA;EAmFE;EAjFF,QAAA;AAAA;;;AA6FF;;;;;;;UAjFiB,qBAAA;;EAEf,IAAA;;;;;;;EAQA,WAAA;;;;;;EAOA,OAAA,GAAU,MAAA,sBAA4B,GAAA,EAAK,kBAAA,KAAuB,MAAA;;;;;;;EAQlE,KAAA;;;;;;EAOA,SAAA;;;;;;EAOA,WAAA,IAAe,GAAA,EAAK,kBAAA;;EAGpB,YAAA,GAAe,YAAA;;;;;;EAOf,iBAAA;;;;;;;;;;;;;;;;EAiBA,OAAA,IACE,GAAA,EAAK,OAAA,EACL,GAAA,EAAK,kBAAA,EACL,QAAA,EAAU,MAAA,SAAe,eAAA,MACtB,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;KAWH,oBAAA"}