@vibesdotdev/applets 0.0.0-stage → 1.0.0-rc.2

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 (421) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +43 -2
  3. package/dist/applet-gate.d.ts +47 -0
  4. package/dist/applet-gate.d.ts.map +1 -0
  5. package/dist/applet-gate.js +167 -0
  6. package/dist/applet-gate.js.map +1 -0
  7. package/dist/applet-root-surface.d.ts +135 -0
  8. package/dist/applet-root-surface.d.ts.map +1 -0
  9. package/dist/applet-root-surface.js +222 -0
  10. package/dist/applet-root-surface.js.map +1 -0
  11. package/dist/applet-value-bound.d.ts +24 -0
  12. package/dist/applet-value-bound.d.ts.map +1 -0
  13. package/dist/applet-value-bound.js +46 -0
  14. package/dist/applet-value-bound.js.map +1 -0
  15. package/dist/applets.cloud.plugin.d.ts +4 -0
  16. package/dist/applets.cloud.plugin.d.ts.map +1 -0
  17. package/dist/applets.cloud.plugin.js +11 -0
  18. package/dist/applets.cloud.plugin.js.map +1 -0
  19. package/dist/applets.consumer.plugin.d.ts +4 -0
  20. package/dist/applets.consumer.plugin.d.ts.map +1 -0
  21. package/dist/applets.consumer.plugin.js +11 -0
  22. package/dist/applets.consumer.plugin.js.map +1 -0
  23. package/dist/applets.plugin.d.ts +3 -0
  24. package/dist/applets.plugin.d.ts.map +1 -0
  25. package/dist/applets.plugin.js +30 -0
  26. package/dist/applets.plugin.js.map +1 -0
  27. package/dist/authorization.d.ts +87 -0
  28. package/dist/authorization.d.ts.map +1 -0
  29. package/dist/authorization.js +189 -0
  30. package/dist/authorization.js.map +1 -0
  31. package/dist/browser-runtime.d.ts +34 -0
  32. package/dist/browser-runtime.d.ts.map +1 -0
  33. package/dist/browser-runtime.js +5 -0
  34. package/dist/browser-runtime.js.map +1 -0
  35. package/dist/build-definition.d.ts +34 -0
  36. package/dist/build-definition.d.ts.map +1 -0
  37. package/dist/build-definition.js +44 -0
  38. package/dist/build-definition.js.map +1 -0
  39. package/dist/capabilities/capability.kind.d.ts +44 -0
  40. package/dist/capabilities/capability.kind.d.ts.map +1 -0
  41. package/dist/capabilities/capability.kind.js +17 -0
  42. package/dist/capabilities/capability.kind.js.map +1 -0
  43. package/dist/capabilities/runtime-dispatch.d.ts +9 -0
  44. package/dist/capabilities/runtime-dispatch.d.ts.map +1 -0
  45. package/dist/capabilities/runtime-dispatch.js +62 -0
  46. package/dist/capabilities/runtime-dispatch.js.map +1 -0
  47. package/dist/cli/applet-group.descriptor.d.ts +11 -0
  48. package/dist/cli/applet-group.descriptor.d.ts.map +1 -0
  49. package/dist/cli/applet-group.descriptor.js +19 -0
  50. package/dist/cli/applet-group.descriptor.js.map +1 -0
  51. package/dist/cli/applet-local-store.storage.descriptor.d.ts +66 -0
  52. package/dist/cli/applet-local-store.storage.descriptor.d.ts.map +1 -0
  53. package/dist/cli/applet-local-store.storage.descriptor.js +39 -0
  54. package/dist/cli/applet-local-store.storage.descriptor.js.map +1 -0
  55. package/dist/cli/applet-serve.process.descriptor.d.ts +37 -0
  56. package/dist/cli/applet-serve.process.descriptor.d.ts.map +1 -0
  57. package/dist/cli/applet-serve.process.descriptor.js +41 -0
  58. package/dist/cli/applet-serve.process.descriptor.js.map +1 -0
  59. package/dist/cli/commands/build.command.descriptor.d.ts +40 -0
  60. package/dist/cli/commands/build.command.descriptor.d.ts.map +1 -0
  61. package/dist/cli/commands/build.command.descriptor.js +52 -0
  62. package/dist/cli/commands/build.command.descriptor.js.map +1 -0
  63. package/dist/cli/commands/build.command.impl.d.ts +8 -0
  64. package/dist/cli/commands/build.command.impl.d.ts.map +1 -0
  65. package/dist/cli/commands/build.command.impl.js +116 -0
  66. package/dist/cli/commands/build.command.impl.js.map +1 -0
  67. package/dist/cli/commands/init.command.descriptor.d.ts +29 -0
  68. package/dist/cli/commands/init.command.descriptor.d.ts.map +1 -0
  69. package/dist/cli/commands/init.command.descriptor.js +23 -0
  70. package/dist/cli/commands/init.command.descriptor.js.map +1 -0
  71. package/dist/cli/commands/init.command.impl.d.ts +7 -0
  72. package/dist/cli/commands/init.command.impl.d.ts.map +1 -0
  73. package/dist/cli/commands/init.command.impl.js +64 -0
  74. package/dist/cli/commands/init.command.impl.js.map +1 -0
  75. package/dist/cli/commands/list.command.descriptor.d.ts +26 -0
  76. package/dist/cli/commands/list.command.descriptor.d.ts.map +1 -0
  77. package/dist/cli/commands/list.command.descriptor.js +22 -0
  78. package/dist/cli/commands/list.command.descriptor.js.map +1 -0
  79. package/dist/cli/commands/list.command.impl.d.ts +13 -0
  80. package/dist/cli/commands/list.command.impl.d.ts.map +1 -0
  81. package/dist/cli/commands/list.command.impl.js +47 -0
  82. package/dist/cli/commands/list.command.impl.js.map +1 -0
  83. package/dist/cli/commands/serve-stylesheet.d.ts +11 -0
  84. package/dist/cli/commands/serve-stylesheet.d.ts.map +1 -0
  85. package/dist/cli/commands/serve-stylesheet.js +50 -0
  86. package/dist/cli/commands/serve-stylesheet.js.map +1 -0
  87. package/dist/cli/commands/serve-surface.d.ts +36 -0
  88. package/dist/cli/commands/serve-surface.d.ts.map +1 -0
  89. package/dist/cli/commands/serve-surface.js +410 -0
  90. package/dist/cli/commands/serve-surface.js.map +1 -0
  91. package/dist/cli/commands/serve.command.descriptor.d.ts +42 -0
  92. package/dist/cli/commands/serve.command.descriptor.d.ts.map +1 -0
  93. package/dist/cli/commands/serve.command.descriptor.js +46 -0
  94. package/dist/cli/commands/serve.command.descriptor.js.map +1 -0
  95. package/dist/cli/commands/serve.command.impl.d.ts +110 -0
  96. package/dist/cli/commands/serve.command.impl.d.ts.map +1 -0
  97. package/dist/cli/commands/serve.command.impl.js +1105 -0
  98. package/dist/cli/commands/serve.command.impl.js.map +1 -0
  99. package/dist/cli/commands/serve.schemas.d.ts +127 -0
  100. package/dist/cli/commands/serve.schemas.d.ts.map +1 -0
  101. package/dist/cli/commands/serve.schemas.js +85 -0
  102. package/dist/cli/commands/serve.schemas.js.map +1 -0
  103. package/dist/cli/commands/served-applet-browser.d.ts +12 -0
  104. package/dist/cli/commands/served-applet-browser.d.ts.map +1 -0
  105. package/dist/cli/commands/served-applet-browser.js +48 -0
  106. package/dist/cli/commands/served-applet-browser.js.map +1 -0
  107. package/dist/cli/commands/served-applet-connection.d.ts +15 -0
  108. package/dist/cli/commands/served-applet-connection.d.ts.map +1 -0
  109. package/dist/cli/commands/served-applet-connection.js +25 -0
  110. package/dist/cli/commands/served-applet-connection.js.map +1 -0
  111. package/dist/cli/commands/served-applet-rpc.d.ts +16 -0
  112. package/dist/cli/commands/served-applet-rpc.d.ts.map +1 -0
  113. package/dist/cli/commands/served-applet-rpc.js +108 -0
  114. package/dist/cli/commands/served-applet-rpc.js.map +1 -0
  115. package/dist/cli/commands/served-applet-surface.d.ts +14 -0
  116. package/dist/cli/commands/served-applet-surface.d.ts.map +1 -0
  117. package/dist/cli/commands/served-applet-surface.js +99 -0
  118. package/dist/cli/commands/served-applet-surface.js.map +1 -0
  119. package/dist/cli/commands/templates.command.descriptor.d.ts +22 -0
  120. package/dist/cli/commands/templates.command.descriptor.d.ts.map +1 -0
  121. package/dist/cli/commands/templates.command.descriptor.js +21 -0
  122. package/dist/cli/commands/templates.command.descriptor.js.map +1 -0
  123. package/dist/cli/commands/templates.command.impl.d.ts +35 -0
  124. package/dist/cli/commands/templates.command.impl.d.ts.map +1 -0
  125. package/dist/cli/commands/templates.command.impl.js +59 -0
  126. package/dist/cli/commands/templates.command.impl.js.map +1 -0
  127. package/dist/cli/index.d.ts +7 -0
  128. package/dist/cli/index.d.ts.map +1 -0
  129. package/dist/cli/index.js +7 -0
  130. package/dist/cli/index.js.map +1 -0
  131. package/dist/cli/local-serve.authz-policy.descriptor.d.ts +22 -0
  132. package/dist/cli/local-serve.authz-policy.descriptor.d.ts.map +1 -0
  133. package/dist/cli/local-serve.authz-policy.descriptor.js +13 -0
  134. package/dist/cli/local-serve.authz-policy.descriptor.js.map +1 -0
  135. package/dist/cli/plugin.d.ts +19 -0
  136. package/dist/cli/plugin.d.ts.map +1 -0
  137. package/dist/cli/plugin.js +57 -0
  138. package/dist/cli/plugin.js.map +1 -0
  139. package/dist/cli/project-files.d.ts +48 -0
  140. package/dist/cli/project-files.d.ts.map +1 -0
  141. package/dist/cli/project-files.js +130 -0
  142. package/dist/cli/project-files.js.map +1 -0
  143. package/dist/client/contract.d.ts +113 -0
  144. package/dist/client/contract.d.ts.map +1 -0
  145. package/dist/client/contract.js +17 -0
  146. package/dist/client/contract.js.map +1 -0
  147. package/dist/client/index.d.ts +3 -0
  148. package/dist/client/index.d.ts.map +1 -0
  149. package/dist/client/index.js +3 -0
  150. package/dist/client/index.js.map +1 -0
  151. package/dist/client/repository.context.d.ts +113 -0
  152. package/dist/client/repository.context.d.ts.map +1 -0
  153. package/dist/client/repository.context.js +8 -0
  154. package/dist/client/repository.context.js.map +1 -0
  155. package/dist/client/runtime-client.d.ts +22 -0
  156. package/dist/client/runtime-client.d.ts.map +1 -0
  157. package/dist/client/runtime-client.js +200 -0
  158. package/dist/client/runtime-client.js.map +1 -0
  159. package/dist/companion-path.d.ts +25 -0
  160. package/dist/companion-path.d.ts.map +1 -0
  161. package/dist/companion-path.js +90 -0
  162. package/dist/companion-path.js.map +1 -0
  163. package/dist/component-ref.d.ts +12 -0
  164. package/dist/component-ref.d.ts.map +1 -0
  165. package/dist/component-ref.js +45 -0
  166. package/dist/component-ref.js.map +1 -0
  167. package/dist/composition-plan.d.ts +92 -0
  168. package/dist/composition-plan.d.ts.map +1 -0
  169. package/dist/composition-plan.js +44 -0
  170. package/dist/composition-plan.js.map +1 -0
  171. package/dist/composition.d.ts +97 -0
  172. package/dist/composition.d.ts.map +1 -0
  173. package/dist/composition.js +99 -0
  174. package/dist/composition.js.map +1 -0
  175. package/dist/config/applets.config.descriptor.d.ts +55 -0
  176. package/dist/config/applets.config.descriptor.d.ts.map +1 -0
  177. package/dist/config/applets.config.descriptor.js +37 -0
  178. package/dist/config/applets.config.descriptor.js.map +1 -0
  179. package/dist/config/load.d.ts +4 -0
  180. package/dist/config/load.d.ts.map +1 -0
  181. package/dist/config/load.js +12 -0
  182. package/dist/config/load.js.map +1 -0
  183. package/dist/content-path.d.ts +62 -0
  184. package/dist/content-path.d.ts.map +1 -0
  185. package/dist/content-path.js +121 -0
  186. package/dist/content-path.js.map +1 -0
  187. package/dist/contribution-registry.d.ts +270 -0
  188. package/dist/contribution-registry.d.ts.map +1 -0
  189. package/dist/contribution-registry.js +488 -0
  190. package/dist/contribution-registry.js.map +1 -0
  191. package/dist/docs/applets.docs.descriptor.d.ts +4 -0
  192. package/dist/docs/applets.docs.descriptor.d.ts.map +1 -0
  193. package/dist/docs/applets.docs.descriptor.js +74 -0
  194. package/dist/docs/applets.docs.descriptor.js.map +1 -0
  195. package/dist/host/local-host.contract.d.ts +7 -0
  196. package/dist/host/local-host.contract.d.ts.map +1 -0
  197. package/dist/host/local-host.contract.js +2 -0
  198. package/dist/host/local-host.contract.js.map +1 -0
  199. package/dist/host/local-host.impl.d.ts +9 -0
  200. package/dist/host/local-host.impl.d.ts.map +1 -0
  201. package/dist/host/local-host.impl.js +41 -0
  202. package/dist/host/local-host.impl.js.map +1 -0
  203. package/dist/host/local-host.plugin.d.ts +3 -0
  204. package/dist/host/local-host.plugin.d.ts.map +1 -0
  205. package/dist/host/local-host.plugin.js +16 -0
  206. package/dist/host/local-host.plugin.js.map +1 -0
  207. package/dist/index.d.ts +28 -0
  208. package/dist/index.d.ts.map +1 -0
  209. package/dist/index.js +27 -0
  210. package/dist/index.js.map +1 -0
  211. package/dist/local-project.d.ts +106 -0
  212. package/dist/local-project.d.ts.map +1 -0
  213. package/dist/local-project.js +277 -0
  214. package/dist/local-project.js.map +1 -0
  215. package/dist/manifest-hash.d.ts +12 -0
  216. package/dist/manifest-hash.d.ts.map +1 -0
  217. package/dist/manifest-hash.js +76 -0
  218. package/dist/manifest-hash.js.map +1 -0
  219. package/dist/presentation.d.ts +43 -0
  220. package/dist/presentation.d.ts.map +1 -0
  221. package/dist/presentation.js +36 -0
  222. package/dist/presentation.js.map +1 -0
  223. package/dist/retention.d.ts +34 -0
  224. package/dist/retention.d.ts.map +1 -0
  225. package/dist/retention.js +51 -0
  226. package/dist/retention.js.map +1 -0
  227. package/dist/schemas/applet-messages.d.ts +97 -0
  228. package/dist/schemas/applet-messages.d.ts.map +1 -0
  229. package/dist/schemas/applet-messages.js +51 -0
  230. package/dist/schemas/applet-messages.js.map +1 -0
  231. package/dist/schemas/capabilities.d.ts +37 -0
  232. package/dist/schemas/capabilities.d.ts.map +1 -0
  233. package/dist/schemas/capabilities.js +28 -0
  234. package/dist/schemas/capabilities.js.map +1 -0
  235. package/dist/schemas/component-release-ref.d.ts +13 -0
  236. package/dist/schemas/component-release-ref.d.ts.map +1 -0
  237. package/dist/schemas/component-release-ref.js +21 -0
  238. package/dist/schemas/component-release-ref.js.map +1 -0
  239. package/dist/schemas/contributes.d.ts +306 -0
  240. package/dist/schemas/contributes.d.ts.map +1 -0
  241. package/dist/schemas/contributes.js +184 -0
  242. package/dist/schemas/contributes.js.map +1 -0
  243. package/dist/schemas/definition.d.ts +301 -0
  244. package/dist/schemas/definition.d.ts.map +1 -0
  245. package/dist/schemas/definition.js +457 -0
  246. package/dist/schemas/definition.js.map +1 -0
  247. package/dist/schemas/dispatch.d.ts +52 -0
  248. package/dist/schemas/dispatch.d.ts.map +1 -0
  249. package/dist/schemas/dispatch.js +32 -0
  250. package/dist/schemas/dispatch.js.map +1 -0
  251. package/dist/schemas/grants.d.ts +56 -0
  252. package/dist/schemas/grants.d.ts.map +1 -0
  253. package/dist/schemas/grants.js +64 -0
  254. package/dist/schemas/grants.js.map +1 -0
  255. package/dist/schemas/index.d.ts +16 -0
  256. package/dist/schemas/index.d.ts.map +1 -0
  257. package/dist/schemas/index.js +16 -0
  258. package/dist/schemas/index.js.map +1 -0
  259. package/dist/schemas/instance.d.ts +230 -0
  260. package/dist/schemas/instance.d.ts.map +1 -0
  261. package/dist/schemas/instance.js +44 -0
  262. package/dist/schemas/instance.js.map +1 -0
  263. package/dist/schemas/lineage.d.ts +60 -0
  264. package/dist/schemas/lineage.d.ts.map +1 -0
  265. package/dist/schemas/lineage.js +52 -0
  266. package/dist/schemas/lineage.js.map +1 -0
  267. package/dist/schemas/observation.d.ts +70 -0
  268. package/dist/schemas/observation.d.ts.map +1 -0
  269. package/dist/schemas/observation.js +49 -0
  270. package/dist/schemas/observation.js.map +1 -0
  271. package/dist/schemas/patterns.d.ts +24 -0
  272. package/dist/schemas/patterns.d.ts.map +1 -0
  273. package/dist/schemas/patterns.js +24 -0
  274. package/dist/schemas/patterns.js.map +1 -0
  275. package/dist/schemas/publishing.d.ts +27 -0
  276. package/dist/schemas/publishing.d.ts.map +1 -0
  277. package/dist/schemas/publishing.js +20 -0
  278. package/dist/schemas/publishing.js.map +1 -0
  279. package/dist/schemas/run.d.ts +35 -0
  280. package/dist/schemas/run.d.ts.map +1 -0
  281. package/dist/schemas/run.js +26 -0
  282. package/dist/schemas/run.js.map +1 -0
  283. package/dist/schemas/share-link.d.ts +61 -0
  284. package/dist/schemas/share-link.d.ts.map +1 -0
  285. package/dist/schemas/share-link.js +68 -0
  286. package/dist/schemas/share-link.js.map +1 -0
  287. package/dist/schemas/state-events.d.ts +66 -0
  288. package/dist/schemas/state-events.d.ts.map +1 -0
  289. package/dist/schemas/state-events.js +66 -0
  290. package/dist/schemas/state-events.js.map +1 -0
  291. package/dist/schemas/subscription.d.ts +47 -0
  292. package/dist/schemas/subscription.d.ts.map +1 -0
  293. package/dist/schemas/subscription.js +46 -0
  294. package/dist/schemas/subscription.js.map +1 -0
  295. package/dist/schemas/template-revision.d.ts +53 -0
  296. package/dist/schemas/template-revision.d.ts.map +1 -0
  297. package/dist/schemas/template-revision.js +30 -0
  298. package/dist/schemas/template-revision.js.map +1 -0
  299. package/dist/selection.d.ts +22 -0
  300. package/dist/selection.d.ts.map +1 -0
  301. package/dist/selection.js +21 -0
  302. package/dist/selection.js.map +1 -0
  303. package/dist/storage/index.d.ts +27 -0
  304. package/dist/storage/index.d.ts.map +1 -0
  305. package/dist/storage/index.js +27 -0
  306. package/dist/storage/index.js.map +1 -0
  307. package/dist/storage/records.d.ts +28 -0
  308. package/dist/storage/records.d.ts.map +1 -0
  309. package/dist/storage/records.js +272 -0
  310. package/dist/storage/records.js.map +1 -0
  311. package/dist/svelte/applets-svelte.plugin.d.ts +38 -0
  312. package/dist/svelte/applets-svelte.plugin.d.ts.map +1 -0
  313. package/dist/svelte/applets-svelte.plugin.js +25 -0
  314. package/dist/svelte/components/AppletCanvas.svelte +488 -0
  315. package/dist/svelte/components/AppletCanvas.svelte.d.ts +53 -0
  316. package/dist/svelte/components/AppletCanvas.svelte.d.ts.map +1 -0
  317. package/dist/svelte/components/AppletCatalog.svelte +42 -0
  318. package/dist/svelte/components/AppletCatalog.svelte.d.ts +8 -0
  319. package/dist/svelte/components/AppletCatalog.svelte.d.ts.map +1 -0
  320. package/dist/svelte/components/AppletComposition.svelte +128 -0
  321. package/dist/svelte/components/AppletComposition.svelte.d.ts +30 -0
  322. package/dist/svelte/components/AppletComposition.svelte.d.ts.map +1 -0
  323. package/dist/svelte/components/AppletConsent.svelte +143 -0
  324. package/dist/svelte/components/AppletConsent.svelte.d.ts +12 -0
  325. package/dist/svelte/components/AppletConsent.svelte.d.ts.map +1 -0
  326. package/dist/svelte/components/LocalAppletView.svelte +102 -0
  327. package/dist/svelte/components/LocalAppletView.svelte.d.ts +13 -0
  328. package/dist/svelte/components/LocalAppletView.svelte.d.ts.map +1 -0
  329. package/dist/svelte/components/RunnableTracker.svelte +51 -0
  330. package/dist/svelte/components/RunnableTracker.svelte.d.ts +18 -0
  331. package/dist/svelte/components/RunnableTracker.svelte.d.ts.map +1 -0
  332. package/dist/svelte/index.d.ts +11 -0
  333. package/dist/svelte/index.d.ts.map +1 -0
  334. package/dist/svelte/index.js +10 -0
  335. package/dist/svelte/lib/canvas-lifecycle.d.ts +68 -0
  336. package/dist/svelte/lib/canvas-lifecycle.d.ts.map +1 -0
  337. package/dist/svelte/lib/canvas-lifecycle.js +99 -0
  338. package/dist/svelte/lib/capability-review.d.ts +64 -0
  339. package/dist/svelte/lib/capability-review.d.ts.map +1 -0
  340. package/dist/svelte/lib/capability-review.js +77 -0
  341. package/dist/svelte/lib/message-protocol.d.ts +184 -0
  342. package/dist/svelte/lib/message-protocol.d.ts.map +1 -0
  343. package/dist/svelte/lib/message-protocol.js +251 -0
  344. package/dist/svelte/runnable-source.d.ts +5 -0
  345. package/dist/svelte/runnable-source.d.ts.map +1 -0
  346. package/dist/svelte/runnable-source.js +92 -0
  347. package/dist/svelte/serve-index.svelte +39 -0
  348. package/dist/svelte/serve-index.svelte.d.ts +10 -0
  349. package/dist/svelte/serve-index.svelte.d.ts.map +1 -0
  350. package/dist/svelte/state.svelte.d.ts +26 -0
  351. package/dist/svelte/state.svelte.d.ts.map +1 -0
  352. package/dist/svelte/state.svelte.js +74 -0
  353. package/dist/svelte/styles.css +4 -0
  354. package/dist/svelte/tool-widgets/AppletToolCard.svelte +148 -0
  355. package/dist/svelte/tool-widgets/AppletToolCard.svelte.d.ts +5 -0
  356. package/dist/svelte/tool-widgets/AppletToolCard.svelte.d.ts.map +1 -0
  357. package/dist/svelte/tool-widgets/applet-tool-card.d.ts +41 -0
  358. package/dist/svelte/tool-widgets/applet-tool-card.d.ts.map +1 -0
  359. package/dist/svelte/tool-widgets/applet-tool-card.js +167 -0
  360. package/dist/svelte/tool-widgets/index.d.ts +3 -0
  361. package/dist/svelte/tool-widgets/index.d.ts.map +1 -0
  362. package/dist/svelte/tool-widgets/index.js +2 -0
  363. package/dist/templates/index.d.ts +2 -0
  364. package/dist/templates/index.d.ts.map +1 -0
  365. package/dist/templates/index.js +2 -0
  366. package/dist/templates/index.js.map +1 -0
  367. package/dist/templates/template.kind.d.ts +39 -0
  368. package/dist/templates/template.kind.d.ts.map +1 -0
  369. package/dist/templates/template.kind.js +29 -0
  370. package/dist/templates/template.kind.js.map +1 -0
  371. package/dist/tools/applet.descriptor.d.ts +196 -0
  372. package/dist/tools/applet.descriptor.d.ts.map +1 -0
  373. package/dist/tools/applet.descriptor.js +81 -0
  374. package/dist/tools/applet.descriptor.js.map +1 -0
  375. package/dist/tools/applet.impl.d.ts +32 -0
  376. package/dist/tools/applet.impl.d.ts.map +1 -0
  377. package/dist/tools/applet.impl.js +485 -0
  378. package/dist/tools/applet.impl.js.map +1 -0
  379. package/dist/tools/applet.schemas.d.ts +198 -0
  380. package/dist/tools/applet.schemas.d.ts.map +1 -0
  381. package/dist/tools/applet.schemas.js +136 -0
  382. package/dist/tools/applet.schemas.js.map +1 -0
  383. package/dist/tools/index.d.ts +3 -0
  384. package/dist/tools/index.d.ts.map +1 -0
  385. package/dist/tools/index.js +3 -0
  386. package/dist/tools/index.js.map +1 -0
  387. package/dist/upgrade.d.ts +45 -0
  388. package/dist/upgrade.d.ts.map +1 -0
  389. package/dist/upgrade.js +179 -0
  390. package/dist/upgrade.js.map +1 -0
  391. package/dist/vite.d.ts +26 -0
  392. package/dist/vite.d.ts.map +1 -0
  393. package/dist/vite.js +28 -0
  394. package/dist/vite.js.map +1 -0
  395. package/package.json +264 -4
  396. package/templates/applet-tour/Applet.svelte +95 -0
  397. package/templates/applet-tour/applet.descriptor.ts +15 -0
  398. package/templates/assembly-field/Applet.svelte +242 -0
  399. package/templates/assembly-field/applet.descriptor.ts +7 -0
  400. package/templates/assembly-field/applet.storage.json +47 -0
  401. package/templates/assembly-field/schemas/settings.ts +14 -0
  402. package/templates/assembly-field/settings.ts +32 -0
  403. package/templates/benchmark-comparison/Applet.svelte +17 -0
  404. package/templates/benchmark-comparison/applet.descriptor.ts +7 -0
  405. package/templates/file-diff-viewer/Applet.svelte +91 -0
  406. package/templates/file-diff-viewer/applet.descriptor.ts +14 -0
  407. package/templates/file-diff-viewer/diff.ts +63 -0
  408. package/templates/file-viewer/Applet.svelte +80 -0
  409. package/templates/file-viewer/applet.descriptor.ts +14 -0
  410. package/templates/fleet-runs/Applet.svelte +14 -0
  411. package/templates/fleet-runs/applet.descriptor.ts +7 -0
  412. package/templates/graph-runbook-tracker/Applet.svelte +13 -0
  413. package/templates/graph-runbook-tracker/applet.descriptor.ts +7 -0
  414. package/templates/runbook-tracker/Applet.svelte +12 -0
  415. package/templates/runbook-tracker/applet.descriptor.ts +7 -0
  416. package/templates/runnable-tracker/Applet.svelte +16 -0
  417. package/templates/runnable-tracker/applet.descriptor.ts +10 -0
  418. package/templates/storage-viewer/Applet.svelte +90 -0
  419. package/templates/storage-viewer/applet.descriptor.ts +15 -0
  420. package/templates/workspace-graph-runbook-tracker/Applet.svelte +13 -0
  421. package/templates/workspace-graph-runbook-tracker/applet.descriptor.ts +7 -0
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The applet's half of the root surface `vibes applet serve` mounts.
3
+ *
4
+ * Browser code: the serve host's page imports this module and mounts the applet
5
+ * with `{ vibes: createServedAppletSurface(...) }`, the delivery contract in
6
+ * `browser-runtime.ts`. Every method is one POST to the serve host, which
7
+ * answers through the real `createAppletRootSurface` (see `serve-surface.ts`);
8
+ * nothing is decided here, so nothing here is a control.
9
+ *
10
+ * It imports only the wire schemas and types, so the page loads it without a
11
+ * runtime. The page hands in its own `fetch`; this module reaches no global.
12
+ */
13
+ import * as z from 'zod/v4';
14
+ import { JsonValueSchema as jsonValueSchema } from '@vibesdotdev/kernel/schemas/json';
15
+ import { appletRuntimeQueryViewSchema } from "../../applet-root-surface.js";
16
+ import { servedAssetUrlSchema, servedStoragePageSchema, servedSurfaceResponseSchema } from "./serve.schemas.js";
17
+ /**
18
+ * A refusal, as applet code sees it: an `Error` whose `cause` is the host's
19
+ * typed `CapabilityError` envelope (`code`, `reason`, `message`, `retryable`).
20
+ * The class itself lives in the runtime, which this page does not load.
21
+ */
22
+ function refused(failure) {
23
+ return new Error(failure.message, { cause: failure });
24
+ }
25
+ /** A function argument: a callback this JSON surface cannot carry back. */
26
+ const callbackSchema = z.custom((value) => value instanceof Function);
27
+ /** A value must be JSON to cross the wire; the host decides everything else about it. */
28
+ function wireValue(parsed) {
29
+ if (parsed.success)
30
+ return parsed.data;
31
+ throw refused({
32
+ code: 'INVALID_INPUT',
33
+ reason: 'applet-value-not-json',
34
+ message: 'Value refused: it is not JSON, so it cannot reach the applet host.',
35
+ retryable: false
36
+ });
37
+ }
38
+ export function createServedAppletSurface(input) {
39
+ const url = `/applet/${encodeURIComponent(input.projectId)}/surface`;
40
+ async function invoke(call) {
41
+ const response = await input.fetch(url, {
42
+ method: 'POST',
43
+ headers: { 'content-type': 'application/json' },
44
+ body: JSON.stringify(call)
45
+ });
46
+ const answer = servedSurfaceResponseSchema.parse(await response.json());
47
+ if (!answer.ok)
48
+ throw refused(answer.error);
49
+ return answer.result;
50
+ }
51
+ // Every method is `async`, so a refusal is always a rejection, never a throw
52
+ // at the call site — the same rule the root surface keeps.
53
+ return {
54
+ storageGet: async (descriptorId, key) => invoke({ method: 'storageGet', descriptorId, key }),
55
+ storageList: async (descriptorId, query) => {
56
+ const call = { method: 'storageList', descriptorId };
57
+ if (query !== undefined)
58
+ call.query = query;
59
+ return servedStoragePageSchema.parse(await invoke(call));
60
+ },
61
+ storagePut: async (descriptorId, key, value) => {
62
+ await invoke({ method: 'storagePut', descriptorId, key, value: wireValue(jsonValueSchema.safeParse(value)) });
63
+ },
64
+ storageDelete: async (descriptorId, key) => {
65
+ await invoke({ method: 'storageDelete', descriptorId, key });
66
+ },
67
+ assetUrl: async (assetId) => servedAssetUrlSchema.parse(await invoke({ method: 'assetUrl', assetId })),
68
+ capabilityInvoke: async (capability, value) => {
69
+ const call = { method: 'capabilityInvoke', capability };
70
+ if (value !== undefined)
71
+ call.input = wireValue(jsonValueSchema.safeParse(value));
72
+ return invoke(call);
73
+ },
74
+ runtimeQuery: async (kind) => appletRuntimeQueryViewSchema.parse(await invoke({ method: 'runtimeQuery', kind })),
75
+ runtimeCall: async (kind, id, method, ...args) => {
76
+ // JSON POST has no reverse leg: a callback cannot reach this applet again, so it is refused,
77
+ // never dropped. (Callbacks reach local applets over runtime-rpc HTTP once it carries them.)
78
+ if (args.some((arg) => callbackSchema.safeParse(arg).success)) {
79
+ throw refused({
80
+ code: 'UNAVAILABLE',
81
+ reason: 'applet-runtime-callback-unsupported',
82
+ message: 'This local serve surface carries no callbacks yet: pass JSON arguments, or run the applet in a canvas host.',
83
+ retryable: false
84
+ });
85
+ }
86
+ const call = { method: 'runtimeCall', kind, id, targetMethod: method };
87
+ if (args.length > 0)
88
+ call.args = args.map((arg) => wireValue(jsonValueSchema.safeParse(arg)));
89
+ return invoke(call);
90
+ },
91
+ runtimeToolCall: async (toolId, input) => {
92
+ const call = { method: 'runtimeToolCall', toolId };
93
+ if (input !== undefined)
94
+ call.input = wireValue(jsonValueSchema.safeParse(input));
95
+ return invoke(call);
96
+ }
97
+ };
98
+ }
99
+ //# sourceMappingURL=served-applet-surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"served-applet-surface.js","sourceRoot":"","sources":["../../../src/cli/commands/served-applet-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,IAAI,eAAe,EAAkB,MAAM,kCAAkC,CAAC;AACtG,OAAO,EACN,4BAA4B,EAG5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAG3B,MAAM,oBAAoB,CAAC;AAQ5B;;;;GAIG;AACH,SAAS,OAAO,CAAC,OAAsC;IACtD,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AACvD,CAAC;AAED,2EAA2E;AAC3E,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAwB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,YAAY,QAAQ,CAAC,CAAC;AAE7F,yFAAyF;AACzF,SAAS,SAAS,CAAC,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FAA6F;YAC7F,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC/D,MAAM,OAAO,CAAC;oBACb,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,qCAAqC;oBAC7C,OAAO,EAAE,6GAA6G;oBACtH,SAAS,EAAE,KAAK;iBAChB,CAAC,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,GAAwB,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;YAC5F,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC9F,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QACD,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;YACxC,MAAM,IAAI,GAAwB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;YACxE,IAAI,KAAK,KAAK,SAAS;gBAAE,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YAClF,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * `vibes applet templates` — the first-party applet templates shipped in-package.
3
+ */
4
+ export declare const appletTemplatesCommandDescriptor: {
5
+ readonly kind: "cli/command";
6
+ readonly id: "applet.templates";
7
+ readonly name: "templates";
8
+ readonly description: "List the first-party Applet templates shipped with @vibesdotdev/applets. Combine with `vibes applet init` to scaffold a local project from one.";
9
+ readonly group: "applet";
10
+ readonly arguments: [];
11
+ readonly options: [];
12
+ readonly surfaces: ["cli"];
13
+ readonly hardware: readonly ["consumer", "cloud"];
14
+ readonly enabled: true;
15
+ readonly examples: [{
16
+ readonly command: "vibes applet templates";
17
+ readonly description: "List shipped templates";
18
+ readonly expectExit: 0;
19
+ }];
20
+ };
21
+ export default appletTemplatesCommandDescriptor;
22
+ //# sourceMappingURL=templates.command.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.command.descriptor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/templates.command.descriptor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;CAe3C,CAAC;AAEH,eAAe,gCAAgC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `vibes applet templates` — the first-party applet templates shipped in-package.
3
+ */
4
+ import { createRuntimeAsset } from '@vibesdotdev/kernel';
5
+ export const appletTemplatesCommandDescriptor = createRuntimeAsset({
6
+ kind: 'cli/command',
7
+ id: 'applet.templates',
8
+ name: 'templates',
9
+ description: 'List the first-party Applet templates shipped with @vibesdotdev/applets. Combine with `vibes applet init` to scaffold a local project from one.',
10
+ group: 'applet',
11
+ arguments: [],
12
+ options: [],
13
+ surfaces: ['cli'],
14
+ hardware: ['consumer', 'cloud'],
15
+ enabled: true,
16
+ examples: [
17
+ { command: 'vibes applet templates', description: 'List shipped templates', expectExit: 0 }
18
+ ]
19
+ });
20
+ export default appletTemplatesCommandDescriptor;
21
+ //# sourceMappingURL=templates.command.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.command.descriptor.js","sourceRoot":"","sources":["../../../src/cli/commands/templates.command.descriptor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,CAAC,MAAM,gCAAgC,GAAG,kBAAkB,CAAC;IAClE,IAAI,EAAE,aAAa;IACnB,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,WAAW;IACjB,WAAW,EACV,iJAAiJ;IAClJ,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE;QACT,EAAE,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,wBAAwB,EAAE,UAAU,EAAE,CAAC,EAAE;KAC3F;CACD,CAAC,CAAC;AAEH,eAAe,gCAAgC,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `vibes applet templates` implementation.
3
+ */
4
+ import type { CommandContext } from '@vibesdotdev/cli';
5
+ import type { VibesRuntime } from '@vibesdotdev/kernel';
6
+ import * as z from 'zod/v4';
7
+ import { type RuntimePath } from '@vibesdotdev/paths';
8
+ import type { FileSystemAdapterInterface } from '@vibesdotdev/filesystem/interfaces/adapter';
9
+ /**
10
+ * The two runtime kinds template IO resolves: the filesystem for bytes and the
11
+ * runtime path service for splitting. The shipped template set lives beside the
12
+ * package, not in the workspace, so this cannot use the workspace root.
13
+ */
14
+ export interface AppletTemplateHost {
15
+ readonly files: FileSystemAdapterInterface;
16
+ readonly paths: RuntimePath;
17
+ }
18
+ /** Resolve the two kinds once per command. */
19
+ export declare function resolveAppletTemplateHost(runtime: VibesRuntime): Promise<AppletTemplateHost>;
20
+ /** Resolve the shipped templates dir across src and dist layouts. */
21
+ export declare function resolveTemplatesDir(host: AppletTemplateHost): Promise<string>;
22
+ /** Template ids = directory names under applets/templates. */
23
+ export declare function listTemplateIds(host: AppletTemplateHost): Promise<string[]>;
24
+ /**
25
+ * This command takes no positional arguments and no options; the empty schemas
26
+ * keep the surface contract schema-derived instead of an open dictionary.
27
+ */
28
+ declare const TemplatesArgsSchema: z.ZodObject<{}, z.core.$strip>;
29
+ declare const TemplatesOptionsSchema: z.ZodObject<{}, z.core.$strip>;
30
+ export declare function execute(_args: z.input<typeof TemplatesArgsSchema>, _options: z.input<typeof TemplatesOptionsSchema>, context: CommandContext): Promise<void>;
31
+ declare const _default: {
32
+ execute: typeof execute;
33
+ };
34
+ export default _default;
35
+ //# sourceMappingURL=templates.command.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.command.impl.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/templates.command.impl.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAE7F;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,KAAK,EAAE,0BAA0B,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC5B;AAED,8CAA8C;AAC9C,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAElG;AAED,qEAAqE;AACrE,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBnF;AAED,8DAA8D;AAC9D,wBAAsB,eAAe,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAOjF;AAUD;;;GAGG;AACH,QAAA,MAAM,mBAAmB,gCAAe,CAAC;AACzC,QAAA,MAAM,sBAAsB,gCAAe,CAAC;AAE5C,wBAAsB,OAAO,CAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,EAC1C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,EAChD,OAAO,EAAE,cAAc,GACrB,OAAO,CAAC,IAAI,CAAC,CAEf;;;;AAED,wBAA2B"}
@@ -0,0 +1,59 @@
1
+ import { writeStdoutLine } from '@vibesdotdev/cli/output';
2
+ import { CapabilityError } from '@vibesdotdev/kernel';
3
+ import * as z from 'zod/v4';
4
+ import { getRuntimePath } from '@vibesdotdev/paths';
5
+ import { resolveFileSystemAdapter } from '@vibesdotdev/filesystem/client/resolve-adapter';
6
+ /** Resolve the two kinds once per command. */
7
+ export async function resolveAppletTemplateHost(runtime) {
8
+ return { files: await resolveFileSystemAdapter(runtime), paths: await getRuntimePath(runtime) };
9
+ }
10
+ /** Resolve the shipped templates dir across src and dist layouts. */
11
+ export async function resolveTemplatesDir(host) {
12
+ const here = host.paths.dirname(host.paths.fileURLToPath(import.meta.url));
13
+ // The package root (`<pkg>/templates`) is the shipped set. `src/templates`
14
+ // also exists (the template *kind* schema, no projects) and used to shadow
15
+ // it, so a candidate only counts when it holds at least one project.
16
+ for (const candidate of [host.paths.join(here, '../../../templates'), host.paths.join(here, '../../templates')]) {
17
+ if (!(await host.files.exists(candidate)))
18
+ continue;
19
+ if ((await host.files.stat(candidate)).kind !== 'directory')
20
+ continue;
21
+ for (const entry of await host.files.list(candidate)) {
22
+ if (entry.kind !== 'directory')
23
+ continue;
24
+ if (await host.files.exists(host.paths.join(candidate, entry.name, 'applet.descriptor.ts'))) {
25
+ return candidate;
26
+ }
27
+ }
28
+ }
29
+ throw new CapabilityError('Shipped applet templates directory not found (expected applets/templates).', 'UNAVAILABLE', { reason: 'applet-templates-unavailable', retryable: false });
30
+ }
31
+ /** Template ids = directory names under applets/templates. */
32
+ export async function listTemplateIds(host) {
33
+ const dir = await resolveTemplatesDir(host);
34
+ const ids = [];
35
+ for (const entry of await host.files.list(dir)) {
36
+ if (entry.kind === 'directory')
37
+ ids.push(entry.name);
38
+ }
39
+ return ids;
40
+ }
41
+ async function run(runtime) {
42
+ const host = await resolveAppletTemplateHost(runtime);
43
+ const ids = await listTemplateIds(host);
44
+ await writeStdoutLine(runtime, 'First-party applet templates:\n');
45
+ for (const id of ids)
46
+ await writeStdoutLine(runtime, ` ${id}`);
47
+ await writeStdoutLine(runtime, '\nScaffold one with: vibes applet init <new-id> --from <template>');
48
+ }
49
+ /**
50
+ * This command takes no positional arguments and no options; the empty schemas
51
+ * keep the surface contract schema-derived instead of an open dictionary.
52
+ */
53
+ const TemplatesArgsSchema = z.object({});
54
+ const TemplatesOptionsSchema = z.object({});
55
+ export async function execute(_args, _options, context) {
56
+ await run(context.runtime);
57
+ }
58
+ export default { execute };
59
+ //# sourceMappingURL=templates.command.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.command.impl.js","sourceRoot":"","sources":["../../../src/cli/commands/templates.command.impl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAa1F,8CAA8C;AAC9C,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,OAAqB;IACpE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;AACjG,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAwB;IACjE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAA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AChD,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW;YAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,KAAK,UAAU,GAAG,CAAC,OAAqB;IACvC,MAAM,IAAI,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACtD,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,eAAe,CAAC,OAAO,EAAE,iCAAiC,CAAC,CAAC;IAClE,KAAK,MAAM,EAAE,IAAI,GAAG;QAAE,MAAM,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAChE,MAAM,eAAe,CAAC,OAAO,EAAE,mEAAmE,CAAC,CAAC;AACrG,CAAC;AAED;;;GAGG;AACH,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACzC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,OAAO,CAC5B,KAA0C,EAC1C,QAAgD,EAChD,OAAuB;IAEvB,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED,eAAe,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * CLI surface for Applets. The plugin is the entrypoint; these exports exist so
3
+ * a test or another surface can reach the filesystem walk without shelling out.
4
+ */
5
+ export { appletsCliPlugin } from './plugin.ts';
6
+ export { appletProjectsDir, listAppletProjectIds, readAppletProjectEntries, digestContents } from './project-files.ts';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACN,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * CLI surface for Applets. The plugin is the entrypoint; these exports exist so
3
+ * a test or another surface can reach the filesystem walk without shelling out.
4
+ */
5
+ export { appletsCliPlugin } from "./plugin.js";
6
+ export { appletProjectsDir, listAppletProjectIds, readAppletProjectEntries, digestContents } from "./project-files.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACN,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /** Local authoring exposes the same manifest-bound adapter over JSON and runtime RPC. */
2
+ declare const _default: {
3
+ id: string;
4
+ kind: "authz/policy";
5
+ name: string;
6
+ precedence: number;
7
+ rules: {
8
+ principalClass: "agent" | "owner" | "*" | "peer";
9
+ kind: string;
10
+ method: string;
11
+ origin: "local" | "*" | "remote";
12
+ effect: "allow" | "deny";
13
+ reason: string;
14
+ verifiedSources?: string[] | undefined;
15
+ }[];
16
+ description?: string | undefined;
17
+ enabled?: boolean | undefined;
18
+ tags?: string[] | undefined;
19
+ hardware?: ("consumer" | "cloud")[] | undefined;
20
+ };
21
+ export default _default;
22
+ //# sourceMappingURL=local-serve.authz-policy.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-serve.authz-policy.descriptor.d.ts","sourceRoot":"","sources":["../../src/cli/local-serve.authz-policy.descriptor.ts"],"names":[],"mappings":"AAGA,yFAAyF;;;;;;;;;;;;;;;;;;;;AACzF,wBAQG"}
@@ -0,0 +1,13 @@
1
+ import { AuthzPolicyDescriptorSchema } from '@vibesdotdev/kernel/authz';
2
+ import { APPLET_ROOT_SURFACE_METHODS } from "../applet-root-surface.js";
3
+ /** Local authoring exposes the same manifest-bound adapter over JSON and runtime RPC. */
4
+ export default AuthzPolicyDescriptorSchema.parse({
5
+ id: 'applets.local-serve-root', kind: 'authz/policy', name: 'Local applet authoring surface',
6
+ description: 'Admit the local serve adapter. Runtime targets retain their own invoke authorization.',
7
+ enabled: true, precedence: 0,
8
+ rules: [...APPLET_ROOT_SURFACE_METHODS, 'call'].map(method => ({
9
+ principalClass: 'peer', kind: 'applets/root', method, origin: 'remote', effect: 'allow',
10
+ reason: 'The local authoring host exposes its manifest-bound applet adapter.'
11
+ }))
12
+ });
13
+ //# sourceMappingURL=local-serve.authz-policy.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-serve.authz-policy.descriptor.js","sourceRoot":"","sources":["../../src/cli/local-serve.authz-policy.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,yFAAyF;AACzF,eAAe,2BAA2B,CAAC,KAAK,CAAC;IAChD,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,gCAAgC;IAC5F,WAAW,EAAE,uFAAuF;IACpG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,KAAK,EAAE,CAAC,GAAG,2BAA2B,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC9D,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO;QACvF,MAAM,EAAE,qEAAqE;KAC7E,CAAC,CAAC;CACH,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @vibesdotdev/applets/cli plugin
3
+ *
4
+ * Canonical `./cli` isolated subpath of @vibesdotdev/applets. Registers the
5
+ * `vibes applet` group and its commands against the `cli/group` and `cli/command`
6
+ * kinds owned by `@vibesdotdev/cli`.
7
+ *
8
+ * It composes no feature plugin, and that is deliberate rather than an omission:
9
+ * these commands read `.vibes/applets` from disk and resolve no runtime client.
10
+ * Local authoring that needed a session would not be local.
11
+ *
12
+ * It does register the `applets.local-store` storage manifest, where `serve`
13
+ * keeps the stores a local applet declares. A descriptor waits for its kind, so
14
+ * a host without Storage still registers this plugin; `serve` then refuses store
15
+ * calls `applet-local-store-unavailable` instead of losing data.
16
+ */
17
+ export declare const appletsCliPlugin: import("@vibesdotdev/kernel").RuntimePlugin;
18
+ export default appletsCliPlugin;
19
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/cli/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAiBH,eAAO,MAAM,gBAAgB,6CA0B3B,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @vibesdotdev/applets/cli plugin
3
+ *
4
+ * Canonical `./cli` isolated subpath of @vibesdotdev/applets. Registers the
5
+ * `vibes applet` group and its commands against the `cli/group` and `cli/command`
6
+ * kinds owned by `@vibesdotdev/cli`.
7
+ *
8
+ * It composes no feature plugin, and that is deliberate rather than an omission:
9
+ * these commands read `.vibes/applets` from disk and resolve no runtime client.
10
+ * Local authoring that needed a session would not be local.
11
+ *
12
+ * It does register the `applets.local-store` storage manifest, where `serve`
13
+ * keeps the stores a local applet declares. A descriptor waits for its kind, so
14
+ * a host without Storage still registers this plugin; `serve` then refuses store
15
+ * calls `applet-local-store-unavailable` instead of losing data.
16
+ */
17
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel';
18
+ import appletGroup from "./applet-group.descriptor.js";
19
+ import appletListCommandDescriptor from "./commands/list.command.descriptor.js";
20
+ import appletBuildCommandDescriptor from "./commands/build.command.descriptor.js";
21
+ import appletServeCommandDescriptor from "./commands/serve.command.descriptor.js";
22
+ import appletTemplatesCommandDescriptor from "./commands/templates.command.descriptor.js";
23
+ import appletInitCommandDescriptor from "./commands/init.command.descriptor.js";
24
+ import appletServeProcessDescriptor from "./applet-serve.process.descriptor.js";
25
+ import appletsConfigDescriptor from "../config/applets.config.descriptor.js";
26
+ import appletLocalStoreStorageDescriptor from "./applet-local-store.storage.descriptor.js";
27
+ import localServeAuthzPolicy from "./local-serve.authz-policy.descriptor.js";
28
+ const CLI_COMMAND = { kind: 'cli/command' };
29
+ export const appletsCliPlugin = createRuntimePlugin({
30
+ id: 'applets-cli',
31
+ name: 'Applets CLI',
32
+ description: '`vibes applet list` + `build` + `serve` + `templates` + `init` — local Applet authoring, viewport, and first-party templates',
33
+ dependencies: ['cli'],
34
+ descriptors: [
35
+ appletGroup,
36
+ appletListCommandDescriptor,
37
+ appletBuildCommandDescriptor,
38
+ appletServeCommandDescriptor,
39
+ appletTemplatesCommandDescriptor,
40
+ appletInitCommandDescriptor,
41
+ // `vibes applet serve` as a PM-managed process (rc02-rc03 §2.5 authorship).
42
+ appletServeProcessDescriptor,
43
+ appletsConfigDescriptor,
44
+ // Where `vibes applet serve` keeps each local applet's declared stores.
45
+ appletLocalStoreStorageDescriptor,
46
+ localServeAuthzPolicy
47
+ ],
48
+ loaders: [
49
+ loader('applet.list', CLI_COMMAND, () => import("./commands/list.command.impl.js")),
50
+ loader('applet.build', CLI_COMMAND, () => import("./commands/build.command.impl.js")),
51
+ loader('applet.serve', CLI_COMMAND, () => import("./commands/serve.command.impl.js")),
52
+ loader('applet.templates', CLI_COMMAND, () => import("./commands/templates.command.impl.js")),
53
+ loader('applet.init', CLI_COMMAND, () => import("./commands/init.command.impl.js"))
54
+ ]
55
+ });
56
+ export default appletsCliPlugin;
57
+ //# sourceMappingURL=plugin.js.map
@@ -0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cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC;QACrF,MAAM,CAAC,kBAAkB,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,sCAAsC,CAAC,CAAC;QAC7F,MAAM,CAAC,aAAa,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,iCAAiC,CAAC,CAAC;KACnF;CACD,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { type VibesRuntime } from '@vibesdotdev/kernel';
2
+ import { type RuntimePath } from '@vibesdotdev/paths';
3
+ import type { FileSystemAdapterInterface } from '@vibesdotdev/filesystem/interfaces/adapter';
4
+ /** The runtime kinds project IO resolves: the filesystem for bytes, the path service for joins. */
5
+ export interface AppletProjectHost {
6
+ /** The workspace-rooted view, for reads that belong to the project being served. */
7
+ readonly files: FileSystemAdapterInterface;
8
+ /**
9
+ * The host's own filesystem, with the workspace binding declined. A package
10
+ * root is host-owned: `node_modules/<name>` walks up from an applet and
11
+ * routinely lands outside the workspace, which the bound view refuses. Reads
12
+ * that must reach a package's own files use this one; reads of project
13
+ * content use `files`.
14
+ */
15
+ readonly hostFiles: FileSystemAdapterInterface;
16
+ readonly paths: RuntimePath;
17
+ }
18
+ /** Resolve the kinds once per command. */
19
+ export declare function resolveAppletProjectHost(runtime: VibesRuntime): Promise<AppletProjectHost>;
20
+ /** One file's contents as the local project reader expects them: text, or base64 for binary media. */
21
+ export interface AppletProjectEntry {
22
+ path: string;
23
+ contents: string;
24
+ encoding?: 'utf8' | 'base64';
25
+ }
26
+ /** Resolve the workspace selected by the CLI host, never the executable host's cwd. */
27
+ export declare function resolveAppletWorkspaceRoot(runtime: Pick<VibesRuntime, 'context'>): Promise<string>;
28
+ /** Where projects live, relative to the workspace root. */
29
+ export declare function appletProjectsDir(workspaceRoot: string, host: AppletProjectHost): string;
30
+ /** Project ids present on disk, or an empty list when the directory is absent. */
31
+ export declare function listAppletProjectIds(workspaceRoot: string, host: AppletProjectHost): Promise<string[]>;
32
+ /** Count files without reading them. `list` reports what is THERE, cheaply. */
33
+ export declare function countAppletProjectFiles(workspaceRoot: string, id: string, host: AppletProjectHost): Promise<{
34
+ total: number;
35
+ unsupported: number;
36
+ }>;
37
+ /**
38
+ * Every file in one project, as paths relative to the project directory.
39
+ *
40
+ * Paths are normalised to forward slashes because the manifest is a wire format
41
+ * and a Windows author must not publish a different inventory than a mac one.
42
+ * Binary media arrives base64 with an `encoding` marker: bytes cannot survive a
43
+ * UTF-8 round trip, and the manifest digest is over the real bytes.
44
+ */
45
+ export declare function readAppletProjectEntries(workspaceRoot: string, id: string, host: AppletProjectHost): Promise<AppletProjectEntry[]>;
46
+ /** SHA-256 over the file's BYTES, in the manifest's own spelling. */
47
+ export declare function digestContents(bytes: Uint8Array): Promise<string>;
48
+ //# sourceMappingURL=project-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-files.d.ts","sourceRoot":"","sources":["../../src/cli/project-files.ts"],"names":[],"mappings":"AAUA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAE7F,mGAAmG;AACnG,MAAM,WAAW,iBAAiB;IACjC,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,0BAA0B,CAAC;IAC3C;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC5B;AAED,0CAA0C;AAC1C,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAMhG;AAED,sGAAsG;AACtG,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC7B;AAaD,uFAAuF;AACvF,wBAAsB,0BAA0B,CAC/C,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GACpC,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,2DAA2D;AAC3D,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAExF;AAED,kFAAkF;AAClF,wBAAsB,oBAAoB,CACzC,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,iBAAiB,GACrB,OAAO,CAAC,MAAM,EAAE,CAAC,CAWnB;AAED,+EAA+E;AAC/E,wBAAsB,uBAAuB,CAC5C,aAAa,EAAE,MAAM,EACrB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,iBAAiB,GACrB,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBjD;AAED;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC7C,aAAa,EAAE,MAAM,EACrB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,iBAAiB,GACrB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAgC/B;AAED,qEAAqE;AACrE,wBAAsB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAUvE"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Reading `.vibes/applets` through the runtime's own kinds.
3
+ *
4
+ * `readAppletLocalProject` takes injected entries on purpose — it decides the
5
+ * RULES, not where bytes come from. This is the one place that reads a real
6
+ * filesystem, and it resolves that filesystem (`filesystem/adapter`) plus the
7
+ * host's path mechanics (`paths/runtime-path`) from the handed runtime, so the
8
+ * package carries no `node:fs`/`node:path` of its own.
9
+ */
10
+ import { APPLET_PROJECT_ROOT, isBinaryMediaType, mediaTypeFor } from '@vibesdotdev/applets';
11
+ import { CapabilityError } from '@vibesdotdev/kernel';
12
+ import { getRuntimePath } from '@vibesdotdev/paths';
13
+ import { resolveFileSystemAdapter } from '@vibesdotdev/filesystem/client/resolve-adapter';
14
+ /** Resolve the kinds once per command. */
15
+ export async function resolveAppletProjectHost(runtime) {
16
+ return {
17
+ files: await resolveFileSystemAdapter(runtime),
18
+ hostFiles: await resolveFileSystemAdapter(runtime, { binding: false }),
19
+ paths: await getRuntimePath(runtime)
20
+ };
21
+ }
22
+ function bytesToBase64(bytes) {
23
+ let binary = '';
24
+ for (const byte of bytes)
25
+ binary += String.fromCharCode(byte);
26
+ return btoa(binary);
27
+ }
28
+ /** A read without an encoding is bytes; a host that answered text is encoded once. */
29
+ function asBytes(contents) {
30
+ return contents instanceof Uint8Array ? contents : new TextEncoder().encode(contents);
31
+ }
32
+ /** Resolve the workspace selected by the CLI host, never the executable host's cwd. */
33
+ export async function resolveAppletWorkspaceRoot(runtime) {
34
+ return runtime.context('runtime/workspace-path');
35
+ }
36
+ /** Where projects live, relative to the workspace root. */
37
+ export function appletProjectsDir(workspaceRoot, host) {
38
+ return host.paths.join(workspaceRoot, APPLET_PROJECT_ROOT);
39
+ }
40
+ /** Project ids present on disk, or an empty list when the directory is absent. */
41
+ export async function listAppletProjectIds(workspaceRoot, host) {
42
+ const dir = appletProjectsDir(workspaceRoot, host);
43
+ // An absent directory is not an error: a workspace with no applets is a
44
+ // workspace, and `list` should say "none" rather than fail.
45
+ if (!(await host.files.exists(dir)))
46
+ return [];
47
+ const entries = await host.files.list(dir);
48
+ const ids = [];
49
+ for (const entry of entries) {
50
+ if (entry.kind === 'directory')
51
+ ids.push(entry.name);
52
+ }
53
+ return ids.sort((left, right) => (left < right ? -1 : left > right ? 1 : 0));
54
+ }
55
+ /** Count files without reading them. `list` reports what is THERE, cheaply. */
56
+ export async function countAppletProjectFiles(workspaceRoot, id, host) {
57
+ const root = host.paths.join(appletProjectsDir(workspaceRoot, host), id);
58
+ let total = 0;
59
+ let unsupported = 0;
60
+ const walk = async (dir) => {
61
+ for (const entry of await host.files.list(dir)) {
62
+ const full = host.paths.join(dir, entry.name);
63
+ if (entry.kind === 'directory') {
64
+ await walk(full);
65
+ continue;
66
+ }
67
+ if (entry.kind !== 'file')
68
+ continue;
69
+ total += 1;
70
+ if (!mediaTypeFor(entry.name))
71
+ unsupported += 1;
72
+ }
73
+ };
74
+ await walk(root);
75
+ return { total, unsupported };
76
+ }
77
+ /**
78
+ * Every file in one project, as paths relative to the project directory.
79
+ *
80
+ * Paths are normalised to forward slashes because the manifest is a wire format
81
+ * and a Windows author must not publish a different inventory than a mac one.
82
+ * Binary media arrives base64 with an `encoding` marker: bytes cannot survive a
83
+ * UTF-8 round trip, and the manifest digest is over the real bytes.
84
+ */
85
+ export async function readAppletProjectEntries(workspaceRoot, id, host) {
86
+ const root = host.paths.join(appletProjectsDir(workspaceRoot, host), id);
87
+ // An absent project is a NOT_FOUND the caller can act on, not an errno to decode.
88
+ if (!(await host.files.exists(root))) {
89
+ throw new CapabilityError(`No Applet project "${id}".`, 'NOT_FOUND', {
90
+ reason: 'applet-project-not-found',
91
+ details: { project: id }
92
+ });
93
+ }
94
+ const found = [];
95
+ const walk = async (dir) => {
96
+ for (const entry of await host.files.list(dir)) {
97
+ const full = host.paths.join(dir, entry.name);
98
+ if (entry.kind === 'directory') {
99
+ await walk(full);
100
+ continue;
101
+ }
102
+ if (entry.kind !== 'file')
103
+ continue;
104
+ const bytes = asBytes(await host.files.readFile(full));
105
+ const path = host.paths.relative(root, full).replaceAll('\\', '/');
106
+ const mediaType = mediaTypeFor(path);
107
+ if (mediaType !== undefined && isBinaryMediaType(mediaType)) {
108
+ found.push({ path, contents: bytesToBase64(bytes), encoding: 'base64' });
109
+ }
110
+ else {
111
+ found.push({ path, contents: new TextDecoder().decode(bytes) });
112
+ }
113
+ }
114
+ };
115
+ await walk(root);
116
+ return found;
117
+ }
118
+ /** SHA-256 over the file's BYTES, in the manifest's own spelling. */
119
+ export async function digestContents(bytes) {
120
+ // `subtle.digest` takes an ArrayBuffer-backed view; copy into one so a view
121
+ // over any buffer kind (a decoded base64 companion included) is accepted.
122
+ const copy = new Uint8Array(bytes.length);
123
+ copy.set(bytes);
124
+ const hash = await crypto.subtle.digest('SHA-256', copy);
125
+ const hex = Array.from(new Uint8Array(hash))
126
+ .map((byte) => byte.toString(16).padStart(2, '0'))
127
+ .join('');
128
+ return `sha256:${hex}`;
129
+ }
130
+ //# sourceMappingURL=project-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/cli/project-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAkB1F,0CAA0C;AAC1C,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,OAAqB;IACnE,OAAO;QACN,KAAK,EAAE,MAAM,wBAAwB,CAAC,OAAO,CAAC;QAC9C,SAAS,EAAE,MAAM,wBAAwB,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACtE,KAAK,EAAE,MAAM,cAAc,CAAC,OAAO,CAAC;KACpC,CAAC;AACH,CAAC;AASD,SAAS,aAAa,CAAC,KAAiB;IACvC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC;AAED,sFAAsF;AACtF,SAAS,OAAO,CAAC,QAA6B;IAC7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