@dxos/plugin-routine 0.0.0

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 (403) hide show
  1. package/LICENSE +105 -0
  2. package/PLUGIN.mdl +475 -0
  3. package/README.md +15 -0
  4. package/dist/lib/neutral/RoutineArticle-UNTMV4CC.mjs +95 -0
  5. package/dist/lib/neutral/RoutineArticle-UNTMV4CC.mjs.map +7 -0
  6. package/dist/lib/neutral/RoutineCompanion-ZZ6WMY7I.mjs +249 -0
  7. package/dist/lib/neutral/RoutineCompanion-ZZ6WMY7I.mjs.map +7 -0
  8. package/dist/lib/neutral/RoutinePlugin.mjs +10 -0
  9. package/dist/lib/neutral/RoutinePlugin.mjs.map +7 -0
  10. package/dist/lib/neutral/RoutinePlugin.node.mjs +1133 -0
  11. package/dist/lib/neutral/RoutinePlugin.node.mjs.map +7 -0
  12. package/dist/lib/neutral/RoutinePlugin.workerd.mjs +36 -0
  13. package/dist/lib/neutral/RoutinePlugin.workerd.mjs.map +7 -0
  14. package/dist/lib/neutral/RoutineSettings-ZJOM4F3S.mjs +48 -0
  15. package/dist/lib/neutral/RoutineSettings-ZJOM4F3S.mjs.map +7 -0
  16. package/dist/lib/neutral/RoutineTraceCompanion-5U6R7LJE.mjs +236 -0
  17. package/dist/lib/neutral/RoutineTraceCompanion-5U6R7LJE.mjs.map +7 -0
  18. package/dist/lib/neutral/SkillArticle-WWDNKW2Z.mjs +27 -0
  19. package/dist/lib/neutral/SkillArticle-WWDNKW2Z.mjs.map +7 -0
  20. package/dist/lib/neutral/app-graph-builder-FALWLZTI.mjs +90 -0
  21. package/dist/lib/neutral/app-graph-builder-FALWLZTI.mjs.map +7 -0
  22. package/dist/lib/neutral/capabilities/index.mjs +25 -0
  23. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  24. package/dist/lib/neutral/capabilities/node.mjs +19 -0
  25. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  26. package/dist/lib/neutral/chunk-674LDIUJ.mjs +9 -0
  27. package/dist/lib/neutral/chunk-674LDIUJ.mjs.map +7 -0
  28. package/dist/lib/neutral/chunk-CNYAPXUW.mjs +65 -0
  29. package/dist/lib/neutral/chunk-CNYAPXUW.mjs.map +7 -0
  30. package/dist/lib/neutral/chunk-HLO4LYXT.mjs +44 -0
  31. package/dist/lib/neutral/chunk-HLO4LYXT.mjs.map +7 -0
  32. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  33. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  34. package/dist/lib/neutral/chunk-ODQDVFMZ.mjs +8 -0
  35. package/dist/lib/neutral/chunk-ODQDVFMZ.mjs.map +7 -0
  36. package/dist/lib/neutral/chunk-R7J2MU2M.mjs +263 -0
  37. package/dist/lib/neutral/chunk-R7J2MU2M.mjs.map +7 -0
  38. package/dist/lib/neutral/chunk-WLNL77C7.mjs +14 -0
  39. package/dist/lib/neutral/chunk-WLNL77C7.mjs.map +7 -0
  40. package/dist/lib/neutral/components/index.mjs +1921 -0
  41. package/dist/lib/neutral/components/index.mjs.map +7 -0
  42. package/dist/lib/neutral/containers/index.mjs +17 -0
  43. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  44. package/dist/lib/neutral/create-object-V23KVDMJ.mjs +25 -0
  45. package/dist/lib/neutral/create-object-V23KVDMJ.mjs.map +7 -0
  46. package/dist/lib/neutral/create-routine-I67BYJA2.mjs +38 -0
  47. package/dist/lib/neutral/create-routine-I67BYJA2.mjs.map +7 -0
  48. package/dist/lib/neutral/create-trigger-from-template-U3KNS77V.mjs +70 -0
  49. package/dist/lib/neutral/create-trigger-from-template-U3KNS77V.mjs.map +7 -0
  50. package/dist/lib/neutral/hooks/index.mjs +47 -0
  51. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  52. package/dist/lib/neutral/index.mjs +27 -0
  53. package/dist/lib/neutral/index.mjs.map +7 -0
  54. package/dist/lib/neutral/layer-specs-ADQCTTRT.mjs +135 -0
  55. package/dist/lib/neutral/layer-specs-ADQCTTRT.mjs.map +7 -0
  56. package/dist/lib/neutral/meta.json +1 -0
  57. package/dist/lib/neutral/meta.mjs +8 -0
  58. package/dist/lib/neutral/meta.mjs.map +7 -0
  59. package/dist/lib/neutral/navigation-resolver-KQIWUH6F.mjs +18 -0
  60. package/dist/lib/neutral/navigation-resolver-KQIWUH6F.mjs.map +7 -0
  61. package/dist/lib/neutral/operation-handler-QKLJSDCQ.mjs +13 -0
  62. package/dist/lib/neutral/operation-handler-QKLJSDCQ.mjs.map +7 -0
  63. package/dist/lib/neutral/operations/index.mjs +8 -0
  64. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  65. package/dist/lib/neutral/plugin.mjs +16 -0
  66. package/dist/lib/neutral/plugin.mjs.map +7 -0
  67. package/dist/lib/neutral/react-surface-GMO7I7YE.mjs +67 -0
  68. package/dist/lib/neutral/react-surface-GMO7I7YE.mjs.map +7 -0
  69. package/dist/lib/neutral/registry-sync-PHBU6CH2.mjs +86 -0
  70. package/dist/lib/neutral/registry-sync-PHBU6CH2.mjs.map +7 -0
  71. package/dist/lib/neutral/run-routine-HJWXIWLJ.mjs +37 -0
  72. package/dist/lib/neutral/run-routine-HJWXIWLJ.mjs.map +7 -0
  73. package/dist/lib/neutral/templates-IIUCEBAX.mjs +49 -0
  74. package/dist/lib/neutral/templates-IIUCEBAX.mjs.map +7 -0
  75. package/dist/lib/neutral/testing.mjs +8 -0
  76. package/dist/lib/neutral/testing.mjs.map +7 -0
  77. package/dist/lib/neutral/translations.mjs +115 -0
  78. package/dist/lib/neutral/translations.mjs.map +7 -0
  79. package/dist/lib/neutral/trigger-runtime-controller-7FOTH2NP.mjs +77 -0
  80. package/dist/lib/neutral/trigger-runtime-controller-7FOTH2NP.mjs.map +7 -0
  81. package/dist/lib/neutral/types/index.mjs +17 -0
  82. package/dist/lib/neutral/types/index.mjs.map +7 -0
  83. package/dist/types/dx.config.d.ts +28 -0
  84. package/dist/types/dx.config.d.ts.map +1 -0
  85. package/dist/types/src/RoutinePlugin.d.ts +4 -0
  86. package/dist/types/src/RoutinePlugin.d.ts.map +1 -0
  87. package/dist/types/src/RoutinePlugin.node.d.ts +4 -0
  88. package/dist/types/src/RoutinePlugin.node.d.ts.map +1 -0
  89. package/dist/types/src/RoutinePlugin.test.d.ts +2 -0
  90. package/dist/types/src/RoutinePlugin.test.d.ts.map +1 -0
  91. package/dist/types/src/RoutinePlugin.workerd.d.ts +4 -0
  92. package/dist/types/src/RoutinePlugin.workerd.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/app-graph-builder.d.ts +5 -0
  94. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/create-object.d.ts +5 -0
  96. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/create-object.test.d.ts +2 -0
  98. package/dist/types/src/capabilities/create-object.test.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/index.d.ts +12 -0
  100. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/layer-specs.d.ts +5 -0
  102. package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/navigation-resolver.d.ts +5 -0
  104. package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/node.d.ts +9 -0
  106. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  108. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  110. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/registry-sync.d.ts +21 -0
  112. package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/templates.d.ts +5 -0
  114. package/dist/types/src/capabilities/templates.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +5 -0
  116. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts +2 -0
  118. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts.map +1 -0
  119. package/dist/types/src/commands/index.d.ts +2 -0
  120. package/dist/types/src/commands/index.d.ts.map +1 -0
  121. package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
  122. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  123. package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
  124. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  125. package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
  126. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  127. package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
  128. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  129. package/dist/types/src/commands/trigger/index.d.ts +57 -0
  130. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  131. package/dist/types/src/commands/trigger/list.d.ts +7 -0
  132. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  133. package/dist/types/src/commands/trigger/options.d.ts +10 -0
  134. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  135. package/dist/types/src/commands/trigger/remove.d.ts +8 -0
  136. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  137. package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
  138. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  139. package/dist/types/src/commands/trigger/update/queue.d.ts +13 -0
  140. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  141. package/dist/types/src/commands/trigger/update/subscription.d.ts +15 -0
  142. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  143. package/dist/types/src/commands/trigger/update/timer.d.ts +13 -0
  144. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  145. package/dist/types/src/commands/trigger/util.d.ts +46 -0
  146. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  147. package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.d.ts +14 -0
  148. package/dist/types/src/components/CreateRoutinePanel/CreateRoutinePanel.d.ts.map +1 -0
  149. package/dist/types/src/components/CreateRoutinePanel/index.d.ts +2 -0
  150. package/dist/types/src/components/CreateRoutinePanel/index.d.ts.map +1 -0
  151. package/dist/types/src/components/InstructionsEditor/InstructionsEditor.d.ts +16 -0
  152. package/dist/types/src/components/InstructionsEditor/InstructionsEditor.d.ts.map +1 -0
  153. package/dist/types/src/components/InstructionsEditor/InstructionsEditor.stories.d.ts +17 -0
  154. package/dist/types/src/components/InstructionsEditor/InstructionsEditor.stories.d.ts.map +1 -0
  155. package/dist/types/src/components/InstructionsEditor/index.d.ts +2 -0
  156. package/dist/types/src/components/InstructionsEditor/index.d.ts.map +1 -0
  157. package/dist/types/src/components/MasterDetail/MasterDetail.d.ts +51 -0
  158. package/dist/types/src/components/MasterDetail/MasterDetail.d.ts.map +1 -0
  159. package/dist/types/src/components/MasterDetail/MasterDetail.stories.d.ts +16 -0
  160. package/dist/types/src/components/MasterDetail/MasterDetail.stories.d.ts.map +1 -0
  161. package/dist/types/src/components/MasterDetail/index.d.ts +2 -0
  162. package/dist/types/src/components/MasterDetail/index.d.ts.map +1 -0
  163. package/dist/types/src/components/RoutineForm/RoutineForm.d.ts +25 -0
  164. package/dist/types/src/components/RoutineForm/RoutineForm.d.ts.map +1 -0
  165. package/dist/types/src/components/RoutineForm/index.d.ts +2 -0
  166. package/dist/types/src/components/RoutineForm/index.d.ts.map +1 -0
  167. package/dist/types/src/components/Schedule/Schedule.d.ts +80 -0
  168. package/dist/types/src/components/Schedule/Schedule.d.ts.map +1 -0
  169. package/dist/types/src/components/Schedule/Schedule.stories.d.ts +23 -0
  170. package/dist/types/src/components/Schedule/Schedule.stories.d.ts.map +1 -0
  171. package/dist/types/src/components/Schedule/cron.d.ts +44 -0
  172. package/dist/types/src/components/Schedule/cron.d.ts.map +1 -0
  173. package/dist/types/src/components/Schedule/cron.test.d.ts +2 -0
  174. package/dist/types/src/components/Schedule/cron.test.d.ts.map +1 -0
  175. package/dist/types/src/components/Schedule/index.d.ts +4 -0
  176. package/dist/types/src/components/Schedule/index.d.ts.map +1 -0
  177. package/dist/types/src/components/Schedule/types.d.ts +66 -0
  178. package/dist/types/src/components/Schedule/types.d.ts.map +1 -0
  179. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +13 -0
  180. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -0
  181. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +19 -0
  182. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -0
  183. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +21 -0
  184. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -0
  185. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +16 -0
  186. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -0
  187. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
  188. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
  189. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
  190. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
  191. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
  192. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
  193. package/dist/types/src/components/TemplateEditor/index.d.ts +2 -0
  194. package/dist/types/src/components/TemplateEditor/index.d.ts.map +1 -0
  195. package/dist/types/src/components/TemplateEditor/types.d.ts +18 -0
  196. package/dist/types/src/components/TemplateEditor/types.d.ts.map +1 -0
  197. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +24 -0
  198. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -0
  199. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +25 -0
  200. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -0
  201. package/dist/types/src/components/TriggerEditor/TriggerKindSelector.d.ts +15 -0
  202. package/dist/types/src/components/TriggerEditor/TriggerKindSelector.d.ts.map +1 -0
  203. package/dist/types/src/components/TriggerEditor/TriggerKindSelector.stories.d.ts +15 -0
  204. package/dist/types/src/components/TriggerEditor/TriggerKindSelector.stories.d.ts.map +1 -0
  205. package/dist/types/src/components/TriggerEditor/index.d.ts +2 -0
  206. package/dist/types/src/components/TriggerEditor/index.d.ts.map +1 -0
  207. package/dist/types/src/components/index.d.ts +8 -0
  208. package/dist/types/src/components/index.d.ts.map +1 -0
  209. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +14 -0
  210. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
  211. package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +20 -0
  212. package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -0
  213. package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
  214. package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
  215. package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.d.ts +17 -0
  216. package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.d.ts.map +1 -0
  217. package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.stories.d.ts +15 -0
  218. package/dist/types/src/containers/RoutineCompanion/RoutineCompanion.stories.d.ts.map +1 -0
  219. package/dist/types/src/containers/RoutineCompanion/index.d.ts +3 -0
  220. package/dist/types/src/containers/RoutineCompanion/index.d.ts.map +1 -0
  221. package/dist/types/src/containers/RoutineSettings/RoutineSettings.d.ts +10 -0
  222. package/dist/types/src/containers/RoutineSettings/RoutineSettings.d.ts.map +1 -0
  223. package/dist/types/src/containers/RoutineSettings/index.d.ts +2 -0
  224. package/dist/types/src/containers/RoutineSettings/index.d.ts.map +1 -0
  225. package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.d.ts +9 -0
  226. package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.d.ts.map +1 -0
  227. package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.d.ts +15 -0
  228. package/dist/types/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.d.ts.map +1 -0
  229. package/dist/types/src/containers/RoutineTraceCompanion/index.d.ts +2 -0
  230. package/dist/types/src/containers/RoutineTraceCompanion/index.d.ts.map +1 -0
  231. package/dist/types/src/containers/RoutineTraceCompanion/runs.d.ts +34 -0
  232. package/dist/types/src/containers/RoutineTraceCompanion/runs.d.ts.map +1 -0
  233. package/dist/types/src/containers/RoutineTraceCompanion/runs.test.d.ts +2 -0
  234. package/dist/types/src/containers/RoutineTraceCompanion/runs.test.d.ts.map +1 -0
  235. package/dist/types/src/containers/RoutineTraceCompanion/useRoutineRuns.d.ts +11 -0
  236. package/dist/types/src/containers/RoutineTraceCompanion/useRoutineRuns.d.ts.map +1 -0
  237. package/dist/types/src/containers/SkillArticle/SkillArticle.d.ts +6 -0
  238. package/dist/types/src/containers/SkillArticle/SkillArticle.d.ts.map +1 -0
  239. package/dist/types/src/containers/SkillArticle/index.d.ts +2 -0
  240. package/dist/types/src/containers/SkillArticle/index.d.ts.map +1 -0
  241. package/dist/types/src/containers/index.d.ts +7 -0
  242. package/dist/types/src/containers/index.d.ts.map +1 -0
  243. package/dist/types/src/hooks/index.d.ts +2 -0
  244. package/dist/types/src/hooks/index.d.ts.map +1 -0
  245. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +12 -0
  246. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
  247. package/dist/types/src/index.d.ts +4 -0
  248. package/dist/types/src/index.d.ts.map +1 -0
  249. package/dist/types/src/meta.d.ts +33 -0
  250. package/dist/types/src/meta.d.ts.map +1 -0
  251. package/dist/types/src/operations/create-routine.d.ts +5 -0
  252. package/dist/types/src/operations/create-routine.d.ts.map +1 -0
  253. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  254. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  255. package/dist/types/src/operations/index.d.ts +3 -0
  256. package/dist/types/src/operations/index.d.ts.map +1 -0
  257. package/dist/types/src/operations/run-routine.d.ts +5 -0
  258. package/dist/types/src/operations/run-routine.d.ts.map +1 -0
  259. package/dist/types/src/paths.d.ts +5 -0
  260. package/dist/types/src/paths.d.ts.map +1 -0
  261. package/dist/types/src/plugin.d.ts +4 -0
  262. package/dist/types/src/plugin.d.ts.map +1 -0
  263. package/dist/types/src/templates/index.d.ts +11 -0
  264. package/dist/types/src/templates/index.d.ts.map +1 -0
  265. package/dist/types/src/testing/index.d.ts +2 -0
  266. package/dist/types/src/testing/index.d.ts.map +1 -0
  267. package/dist/types/src/testing/test-functions.d.ts +328 -0
  268. package/dist/types/src/testing/test-functions.d.ts.map +1 -0
  269. package/dist/types/src/testing.d.ts +2 -0
  270. package/dist/types/src/testing.d.ts.map +1 -0
  271. package/dist/types/src/translations.d.ts +3 -0
  272. package/dist/types/src/translations.d.ts.map +1 -0
  273. package/dist/types/src/types/Routine.d.ts +55 -0
  274. package/dist/types/src/types/Routine.d.ts.map +1 -0
  275. package/dist/types/src/types/Routine.test.d.ts +2 -0
  276. package/dist/types/src/types/Routine.test.d.ts.map +1 -0
  277. package/dist/types/src/types/RoutineCapabilities.d.ts +44 -0
  278. package/dist/types/src/types/RoutineCapabilities.d.ts.map +1 -0
  279. package/dist/types/src/types/RoutineOperation.d.ts +45 -0
  280. package/dist/types/src/types/RoutineOperation.d.ts.map +1 -0
  281. package/dist/types/src/types/index.d.ts +5 -0
  282. package/dist/types/src/types/index.d.ts.map +1 -0
  283. package/dist/types/src/types/schema.d.ts +33 -0
  284. package/dist/types/src/types/schema.d.ts.map +1 -0
  285. package/dist/types/src/util/index.d.ts +3 -0
  286. package/dist/types/src/util/index.d.ts.map +1 -0
  287. package/dist/types/src/util/routines-for-object.d.ts +22 -0
  288. package/dist/types/src/util/routines-for-object.d.ts.map +1 -0
  289. package/dist/types/src/util/routines-for-object.test.d.ts +2 -0
  290. package/dist/types/src/util/routines-for-object.test.d.ts.map +1 -0
  291. package/dist/types/src/util/run-instructions.d.ts +5 -0
  292. package/dist/types/src/util/run-instructions.d.ts.map +1 -0
  293. package/dist/types/src/util/run-instructions.test.d.ts +2 -0
  294. package/dist/types/src/util/run-instructions.test.d.ts.map +1 -0
  295. package/dist/types/tsconfig.tsbuildinfo +1 -0
  296. package/dx.config.ts +33 -0
  297. package/package.json +196 -0
  298. package/src/RoutinePlugin.node.ts +48 -0
  299. package/src/RoutinePlugin.test.ts +27 -0
  300. package/src/RoutinePlugin.tsx +58 -0
  301. package/src/RoutinePlugin.workerd.ts +24 -0
  302. package/src/capabilities/app-graph-builder.ts +80 -0
  303. package/src/capabilities/create-object.test.ts +18 -0
  304. package/src/capabilities/create-object.ts +26 -0
  305. package/src/capabilities/index.ts +22 -0
  306. package/src/capabilities/layer-specs.ts +190 -0
  307. package/src/capabilities/navigation-resolver.ts +21 -0
  308. package/src/capabilities/node.ts +19 -0
  309. package/src/capabilities/operation-handler.ts +16 -0
  310. package/src/capabilities/react-surface.tsx +66 -0
  311. package/src/capabilities/registry-sync.ts +114 -0
  312. package/src/capabilities/templates.ts +17 -0
  313. package/src/capabilities/trigger-runtime-controller.test.ts +107 -0
  314. package/src/capabilities/trigger-runtime-controller.ts +126 -0
  315. package/src/commands/index.ts +5 -0
  316. package/src/commands/trigger/create/index.ts +14 -0
  317. package/src/commands/trigger/create/queue.ts +87 -0
  318. package/src/commands/trigger/create/subscription.ts +126 -0
  319. package/src/commands/trigger/create/timer.ts +90 -0
  320. package/src/commands/trigger/index.ts +16 -0
  321. package/src/commands/trigger/list.ts +69 -0
  322. package/src/commands/trigger/options.ts +47 -0
  323. package/src/commands/trigger/remove.ts +45 -0
  324. package/src/commands/trigger/update/index.ts +14 -0
  325. package/src/commands/trigger/update/queue.ts +191 -0
  326. package/src/commands/trigger/update/subscription.ts +278 -0
  327. package/src/commands/trigger/update/timer.ts +194 -0
  328. package/src/commands/trigger/util.ts +412 -0
  329. package/src/components/CreateRoutinePanel/CreateRoutinePanel.tsx +68 -0
  330. package/src/components/CreateRoutinePanel/index.ts +5 -0
  331. package/src/components/InstructionsEditor/InstructionsEditor.stories.tsx +69 -0
  332. package/src/components/InstructionsEditor/InstructionsEditor.tsx +107 -0
  333. package/src/components/InstructionsEditor/index.ts +5 -0
  334. package/src/components/MasterDetail/MasterDetail.stories.tsx +100 -0
  335. package/src/components/MasterDetail/MasterDetail.tsx +175 -0
  336. package/src/components/MasterDetail/index.ts +5 -0
  337. package/src/components/RoutineForm/RoutineForm.tsx +293 -0
  338. package/src/components/RoutineForm/index.ts +5 -0
  339. package/src/components/Schedule/Schedule.stories.tsx +73 -0
  340. package/src/components/Schedule/Schedule.tsx +527 -0
  341. package/src/components/Schedule/cron.test.ts +230 -0
  342. package/src/components/Schedule/cron.ts +337 -0
  343. package/src/components/Schedule/index.ts +8 -0
  344. package/src/components/Schedule/types.ts +124 -0
  345. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +93 -0
  346. package/src/components/TemplateEditor/TemplateEditor.tsx +77 -0
  347. package/src/components/TemplateEditor/TemplateForm.stories.tsx +76 -0
  348. package/src/components/TemplateEditor/TemplateForm.tsx +204 -0
  349. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
  350. package/src/components/TemplateEditor/extensions/index.ts +6 -0
  351. package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
  352. package/src/components/TemplateEditor/index.ts +5 -0
  353. package/src/components/TemplateEditor/types.tsx +28 -0
  354. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +122 -0
  355. package/src/components/TriggerEditor/TriggerEditor.tsx +365 -0
  356. package/src/components/TriggerEditor/TriggerKindSelector.stories.tsx +42 -0
  357. package/src/components/TriggerEditor/TriggerKindSelector.tsx +87 -0
  358. package/src/components/TriggerEditor/index.ts +5 -0
  359. package/src/components/index.ts +11 -0
  360. package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +146 -0
  361. package/src/containers/RoutineArticle/RoutineArticle.tsx +109 -0
  362. package/src/containers/RoutineArticle/index.ts +5 -0
  363. package/src/containers/RoutineCompanion/RoutineCompanion.stories.tsx +82 -0
  364. package/src/containers/RoutineCompanion/RoutineCompanion.tsx +342 -0
  365. package/src/containers/RoutineCompanion/index.ts +6 -0
  366. package/src/containers/RoutineSettings/RoutineSettings.tsx +65 -0
  367. package/src/containers/RoutineSettings/index.ts +5 -0
  368. package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.stories.tsx +133 -0
  369. package/src/containers/RoutineTraceCompanion/RoutineTraceCompanion.tsx +125 -0
  370. package/src/containers/RoutineTraceCompanion/index.ts +5 -0
  371. package/src/containers/RoutineTraceCompanion/runs.test.ts +140 -0
  372. package/src/containers/RoutineTraceCompanion/runs.ts +135 -0
  373. package/src/containers/RoutineTraceCompanion/useRoutineRuns.ts +50 -0
  374. package/src/containers/SkillArticle/SkillArticle.tsx +29 -0
  375. package/src/containers/SkillArticle/index.ts +5 -0
  376. package/src/containers/index.ts +11 -0
  377. package/src/hooks/index.ts +6 -0
  378. package/src/hooks/useTriggerRuntimeControls.ts +70 -0
  379. package/src/index.ts +7 -0
  380. package/src/meta.ts +9 -0
  381. package/src/operations/create-routine.ts +39 -0
  382. package/src/operations/create-trigger-from-template.ts +68 -0
  383. package/src/operations/index.ts +11 -0
  384. package/src/operations/run-routine.ts +45 -0
  385. package/src/paths.ts +18 -0
  386. package/src/plugin.ts +11 -0
  387. package/src/templates/index.ts +48 -0
  388. package/src/testing/index.ts +5 -0
  389. package/src/testing/test-functions.ts +76 -0
  390. package/src/testing.ts +7 -0
  391. package/src/translations.ts +125 -0
  392. package/src/types/Routine.test.ts +51 -0
  393. package/src/types/Routine.ts +144 -0
  394. package/src/types/RoutineCapabilities.ts +51 -0
  395. package/src/types/RoutineOperation.ts +104 -0
  396. package/src/types/index.ts +9 -0
  397. package/src/types/schema.ts +31 -0
  398. package/src/util/index.ts +6 -0
  399. package/src/util/routines-for-object.test.ts +109 -0
  400. package/src/util/routines-for-object.ts +89 -0
  401. package/src/util/run-instructions.test.ts +23 -0
  402. package/src/util/run-instructions.ts +12 -0
  403. package/src/vite-env.d.ts +10 -0
@@ -0,0 +1,86 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/capabilities/registry-sync.ts
4
+ import * as Effect from "effect/Effect";
5
+ import { Capabilities, Capability } from "@dxos/app-framework";
6
+ import { AppCapabilities } from "@dxos/app-toolkit";
7
+ import { Operation } from "@dxos/compute";
8
+ import { log } from "@dxos/log";
9
+ import { ClientCapabilities } from "@dxos/plugin-client";
10
+ var __dxlog_file = "/Users/jdw/Code/dxos/packages/plugins/plugin-routine/src/capabilities/registry-sync.ts";
11
+ var registry_sync_default = Capability.makeModule(Effect.fnUntraced(function* () {
12
+ const client = yield* Capability.get(ClientCapabilities.Client);
13
+ const atomRegistry = yield* Capability.get(Capabilities.AtomRegistry);
14
+ const capabilityManager = yield* Capability.Service;
15
+ const skillDefinitionsAtom = capabilityManager.atom(AppCapabilities.SkillDefinition);
16
+ const prevSkillKeys = /* @__PURE__ */ new Set();
17
+ atomRegistry.subscribe(skillDefinitionsAtom, (definitions) => {
18
+ const fresh = [];
19
+ for (const def of definitions) {
20
+ if (!prevSkillKeys.has(def.key)) {
21
+ prevSkillKeys.add(def.key);
22
+ fresh.push(def.make());
23
+ }
24
+ }
25
+ if (fresh.length > 0) {
26
+ client.graph.registry.add(fresh);
27
+ }
28
+ }, {
29
+ immediate: true
30
+ });
31
+ const operationHandlersAtom = capabilityManager.atom(Capabilities.OperationHandler);
32
+ const prevOperationKeys = /* @__PURE__ */ new Set();
33
+ atomRegistry.subscribe(operationHandlersAtom, async (handlerSets) => {
34
+ try {
35
+ const handlers = (await Promise.all(handlerSets.map((set) => set.getHandlers()))).flat();
36
+ const seenKeys = /* @__PURE__ */ new Set();
37
+ const batch = [];
38
+ for (const handler of handlers) {
39
+ const key = handler.meta.key;
40
+ if (!key) {
41
+ log.warn("skipping operation handler without key", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 61, S: this });
42
+ continue;
43
+ }
44
+ if (seenKeys.has(key)) {
45
+ log("skipping duplicate operation", {
46
+ key
47
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 65, S: this });
48
+ continue;
49
+ }
50
+ seenKeys.add(key);
51
+ if (prevOperationKeys.has(key)) {
52
+ continue;
53
+ }
54
+ if (handler.meta.skipRegistry) {
55
+ prevOperationKeys.add(key);
56
+ continue;
57
+ }
58
+ try {
59
+ batch.push(Operation.serialize(handler));
60
+ } catch {
61
+ log.verbose("skipping operation with unserializable schema", {
62
+ key
63
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 81, S: this });
64
+ prevOperationKeys.add(key);
65
+ }
66
+ }
67
+ if (batch.length > 0) {
68
+ client.graph.registry.add(batch);
69
+ for (const operation of batch) {
70
+ const operationKey = Operation.getKey(operation);
71
+ if (operationKey) {
72
+ prevOperationKeys.add(operationKey);
73
+ }
74
+ }
75
+ }
76
+ } catch (error) {
77
+ log.catch(error, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 97, S: this });
78
+ }
79
+ }, {
80
+ immediate: true
81
+ });
82
+ }));
83
+ export {
84
+ registry_sync_default as default
85
+ };
86
+ //# sourceMappingURL=registry-sync-PHBU6CH2.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/registry-sync.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Operation, Skill } from '@dxos/compute';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\n/**\n * Syncs plugin capability contributions into `client.graph.registry`.\n *\n * Watches two capability atoms and imperatively adds entities to the\n * hypergraph registry when they change:\n * - {@link AppCapabilities.SkillDefinition} → instantiates each skill via `def.make()`.\n * - {@link Capabilities.OperationHandler} → serializes each handler via `Operation.serialize`.\n *\n * Skill DB copies (stored in a space when a skill is \"enabled\") are treated as\n * user forks and are not overwritten. The registry is always used as the source of truth\n * for skill instructions at request time — see `formatSystemPrompt` in `@dxos/assistant`.\n *\n * Note: the plugin framework does not yet expose a teardown hook for capability\n * modules (see the TODO in process-manager-capability.ts), so the subscriptions\n * are not explicitly cancelled. They are effectively scoped to the client's lifetime.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const atomRegistry = yield* Capability.get(Capabilities.AtomRegistry);\n const capabilityManager = yield* Capability.Service;\n\n //\n // Skill registration.\n //\n\n const skillDefinitionsAtom = capabilityManager.atom(AppCapabilities.SkillDefinition);\n const prevSkillKeys = new Set<string>();\n\n atomRegistry.subscribe(\n skillDefinitionsAtom,\n (definitions) => {\n const fresh: Skill.Skill[] = [];\n for (const def of definitions) {\n if (!prevSkillKeys.has(def.key)) {\n prevSkillKeys.add(def.key);\n fresh.push(def.make());\n }\n }\n if (fresh.length > 0) {\n client.graph.registry.add(fresh);\n }\n },\n { immediate: true },\n );\n\n //\n // Operation registration.\n //\n\n const operationHandlersAtom = capabilityManager.atom(Capabilities.OperationHandler);\n const prevOperationKeys = new Set<string>();\n\n atomRegistry.subscribe(\n operationHandlersAtom,\n async (handlerSets) => {\n try {\n const handlers = (await Promise.all(handlerSets.map((set) => set.getHandlers()))).flat();\n const seenKeys = new Set<string>();\n const batch: Operation.PersistentOperation[] = [];\n for (const handler of handlers) {\n const key = handler.meta.key;\n if (!key) {\n log.warn('skipping operation handler without key');\n continue;\n }\n if (seenKeys.has(key)) {\n log('skipping duplicate operation', { key });\n continue;\n }\n seenKeys.add(key);\n if (prevOperationKeys.has(key)) {\n continue;\n }\n if (handler.meta.skipRegistry) {\n prevOperationKeys.add(key);\n continue;\n }\n try {\n batch.push(Operation.serialize(handler));\n } catch {\n log.verbose('skipping operation with unserializable schema', { key });\n prevOperationKeys.add(key);\n }\n }\n if (batch.length > 0) {\n client.graph.registry.add(batch);\n for (const operation of batch) {\n const operationKey = Operation.getKey(operation);\n if (operationKey) {\n prevOperationKeys.add(operationKey);\n }\n }\n }\n } catch (error) {\n log.catch(error);\n }\n },\n { immediate: true },\n );\n }),\n);\n"],
5
+ "mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,iBAAwB;AACjC,SAASC,WAAW;AACpB,SAASC,0BAA0B;AAEnC,IAAA,eAAA;AAmBI,IAAMC,wBAAAA,WAAe,WAAsBN,kBAAAA,aAAaO;AACxD,QAAMC,SAAAA,OAAAA,WAA2BP,IAAAA,mBAAkB,MAAA;AAEnD,QAAE,eAAA,OAAA,WAAA,IAAA,aAAA,YAAA;AACF,QAAA,oBAAsB,OAAA,WAAA;AAMtBK,QAAAA,uBACEG,kBACCC,KAAAA,gBAAAA,eAAAA;QACC,gBAA+B,oBAAA,IAAA;eAC1B,UAAaA,sBAAa,CAAA,gBAAA;UAC7B,QAAKC,CAAAA;eACHA,OAAAA,aAAsBC;UACtBC,CAAAA,cAAeC,IAAI,IAAA,GAAA,GAAA;AACrB,sBAAA,IAAA,IAAA,GAAA;AACF,cAAA,KAAA,IAAA,KAAA,CAAA;MACID;;AAEJ,QAAA,MAAA,SAAA,GAAA;AAEF,aAAA,MAAA,SAAA,IAAA,KAAA;IAAEE;EAAgB,GAAA;IAGlB,WAAA;EACF,CAAA;AAMAT,QAAAA,wBACEU,kBACA,KAAOC,aAAAA,gBAAAA;QACL,oBAAI,oBAAA,IAAA;eACF,UAAMC,uBAA8BD,OAAAA,gBAAyBE;QAC7D;AACA,YAAMC,YAA2C,MAAA,QAAA,IAAA,YAAA,IAAA,CAAA,QAAA,IAAA,YAAA,CAAA,CAAA,GAAA,KAAA;AACjD,YAAK,WAAMC,oBAAAA,IAAWH;YACpB,QAAMN,CAAAA;iBACDA,WAAK,UAAA;cACRR,MAAQ,QAAC,KAAA;YACT,CAAA,KAAA;AACF,cAAA,KAAA,0CAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;AACIkB;;qBACoCV,IAAAA,GAAAA,GAAAA;AAAI,cAAA,gCAAA;YAC1C;UACF,GAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;AACAU;QACA;iBACE,IAAA,GAAA;AACF,YAAA,kBAAA,IAAA,GAAA,GAAA;AACID;;YAEF,QAAA,KAAA,cAAA;AACF,4BAAA,IAAA,GAAA;AACI;;AAEJ,YAAE;AACAjB,gBAAImB,KAAO,UAAC,UAAA,OAAA,CAAA;gBAAmDX;AAAI,cAAA,QAAA,iDAAA;YACnEY;UACF,GAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;AACF,4BAAA,IAAA,GAAA;QACIJ;;UAEF,MAAK,SAAMK,GAAAA;eACT,MAAMC,SAAAA,IAAevB,KAAAA;mBACjBuB,aAAc,OAAA;gBAChBF,eAAAA,UAAsBE,OAAAA,SAAAA;AACxB,cAAA,cAAA;AACF,8BAAA,IAAA,YAAA;UACF;QACA;MACAtB;IACF,SAAA,OAAA;AAEF,UAAA,MAAA,OAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;IAAEW;EAAgB,GAAA;IAGtB,WAAA;;;",
6
+ "names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "Operation", "log", "ClientCapabilities", "atomRegistry", "AtomRegistry", "capabilityManager", "skillDefinitionsAtom", "definitions", "prevSkillKeys", "key", "fresh", "make", "immediate", "operationHandlersAtom", "handlerSets", "handlers", "set", "batch", "handler", "seenKeys", "verbose", "prevOperationKeys", "operation", "operationKey"]
7
+ }
@@ -0,0 +1,37 @@
1
+ import {
2
+ RoutineOperation_exports
3
+ } from "./chunk-R7J2MU2M.mjs";
4
+ import "./chunk-674LDIUJ.mjs";
5
+ import "./chunk-J5LGTIGS.mjs";
6
+
7
+ // src/operations/run-routine.ts
8
+ import * as Effect from "effect/Effect";
9
+ import { RunInstructions } from "@dxos/assistant-toolkit";
10
+ import { Operation } from "@dxos/compute";
11
+ import { Database, Obj } from "@dxos/echo";
12
+ import { invariant } from "@dxos/invariant";
13
+ var __dxlog_file = "/Users/jdw/Code/dxos/packages/plugins/plugin-routine/src/operations/run-routine.ts";
14
+ var handler = RoutineOperation_exports.RunRoutine.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ routine }) {
15
+ const routineObj = yield* Database.load(routine);
16
+ const db = Obj.getDatabase(routineObj);
17
+ invariant(db, "Routine is not attached to a database.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 16, S: this, A: ["db", "'Routine is not attached to a database.'"] });
18
+ const spec = routineObj.spec;
19
+ if (spec?.kind === "instructions") {
20
+ yield* Operation.schedule(RunInstructions, {
21
+ instructions: spec.instructions,
22
+ input: {}
23
+ }, {
24
+ spaceId: db.spaceId
25
+ });
26
+ return;
27
+ }
28
+ invariant(spec?.kind === "runnable", "Routine has no action to run.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 30, S: this, A: ["spec?.kind === 'runnable'", "'Routine has no action to run.'"] });
29
+ const operation = yield* Database.load(spec.runnable);
30
+ invariant(Obj.instanceOf(Operation.PersistentOperation, operation), "Routine has no action to run.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 32, S: this, A: ["Obj.instanceOf(Operation.PersistentOperation, operation)", "'Routine has no action to run.'"] });
31
+ yield* Operation.invoke(Operation.deserialize(operation));
32
+ })));
33
+ var run_routine_default = handler;
34
+ export {
35
+ run_routine_default as default
36
+ };
37
+ //# sourceMappingURL=run-routine-HJWXIWLJ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/run-routine.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { RunInstructions } from '@dxos/assistant-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Database, Obj } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\n\nimport { RoutineOperation } from '../types';\n\n// A routine's action is its `runnable`: either an Operation (invoked directly) or the routine's owned\n// Instructions object (run as a background process — the same path triggers use — without creating a new\n// Chat session object).\nconst handler: Operation.WithHandler<typeof RoutineOperation.RunRoutine> = RoutineOperation.RunRoutine.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ routine }) {\n const routineObj = yield* Database.load(routine);\n const db = Obj.getDatabase(routineObj);\n invariant(db, 'Routine is not attached to a database.');\n\n // The action kind is explicit in `spec`; dispatch by kind rather than dereferencing to classify.\n const spec = routineObj.spec;\n if (spec?.kind === 'instructions') {\n // The instructions carry their own context objects and skills; RunInstructions binds them when it\n // executes. No Chat session object is created — the run appears in the process monitor only.\n yield* Operation.schedule(\n RunInstructions,\n { instructions: spec.instructions, input: {} },\n { spaceId: db.spaceId },\n );\n return;\n }\n\n invariant(spec?.kind === 'runnable', 'Routine has no action to run.');\n const operation = yield* Database.load(spec.runnable);\n invariant(Obj.instanceOf(Operation.PersistentOperation, operation), 'Routine has no action to run.');\n yield* Operation.invoke(Operation.deserialize(operation));\n }),\n ),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,WAAW;AAC9B,SAASC,iBAAiB;AAI1B,IAAA,eAAA;IAOM,UAAWC,yBAAgBC,WAAAA,KAAAA,UAAAA,YAAAA,kBAAAA,WAAAA,EAAAA,QAAAA,GAAAA;AAC3BC,QAAAA,aAAc,OAAA,SAAA,KAAA,OAAA;AAEd,QAAA,KAAA,IAAA,YAAA,UAAA;AACA,YAAMC,IAAOF,0CAAe,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,0CAAA,EAAA,CAAA;QAE1B,OAAA,WAAA;MACA,MAAA,SAAA,gBAAA;WAGqCG,UAAQ,SAAA,iBAAA;MAC3C,cAAA,KAAA;MAAEC,OAAAA,CAAAA;IAAoB,GAAA;MAExB,SAAA,GAAA;IACF,CAAA;AAEAH;EACA;AACAA,YAAUF,MAAIM,SAAWC,YAAUC,iCAAiC,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,6BAAA,iCAAA,EAAA,CAAA;AACpE,QAAA,YAAiBC,OAAOF,SAAUG,KAAAA,KAAAA,QAAYC;AAChD,YAAA,IAAA,WAAA,UAAA,qBAAA,SAAA,GAAA,iCAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,4DAAA,iCAAA,EAAA,CAAA;AAIJ,SAAA,UAAeC,OAAQ,UAAA,YAAA,SAAA,CAAA;;;",
6
+ "names": ["Effect", "RunInstructions", "Operation", "Database", "Obj", "invariant", "Obj", "routineObj", "invariant", "spec", "input", "spaceId", "instanceOf", "Operation", "PersistentOperation", "invoke", "deserialize", "operation", "handler"]
7
+ }
@@ -0,0 +1,49 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/capabilities/templates.ts
4
+ import * as Effect2 from "effect/Effect";
5
+ import { Capability } from "@dxos/app-framework";
6
+ import { RoutineCapabilities } from "#types";
7
+
8
+ // src/templates/index.ts
9
+ import * as Effect from "effect/Effect";
10
+ import * as Option from "effect/Option";
11
+ import { AppAnnotation } from "@dxos/app-toolkit";
12
+ import { Instructions, Skill, Trigger } from "@dxos/compute";
13
+ import { Obj, Ref, Type } from "@dxos/echo";
14
+ import { Routine } from "#types";
15
+ var blank = {
16
+ id: "org.dxos.routine.blank",
17
+ label: "Blank",
18
+ icon: "ph--lightning--regular",
19
+ scaffold: ({ name, subject }) => Effect.succeed(Routine.make({
20
+ name,
21
+ instructions: Instructions.make({
22
+ skills: subject ? skillRefsForObject(subject) : [],
23
+ objects: subject ? [
24
+ Ref.make(subject)
25
+ ] : void 0
26
+ }),
27
+ trigger: Trigger.make({})
28
+ }))
29
+ };
30
+ var defaultTemplates = [
31
+ blank
32
+ ];
33
+ var skillRefsForObject = (object) => {
34
+ const type = Obj.getType(object);
35
+ if (!type) {
36
+ return [];
37
+ }
38
+ const keys = Option.getOrElse(() => [])(AppAnnotation.SkillsAnnotation.get(Type.getSchema(type)));
39
+ return keys.map((key) => Ref.fromURI(Skill.registryURI(key)));
40
+ };
41
+
42
+ // src/capabilities/templates.ts
43
+ var templates_default = Capability.makeModule(Effect2.fnUntraced(function* () {
44
+ return defaultTemplates.map((template) => Capability.contributes(RoutineCapabilities.Template, template));
45
+ }));
46
+ export {
47
+ templates_default as default
48
+ };
49
+ //# sourceMappingURL=templates-IIUCEBAX.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/templates.ts", "../../../src/templates/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { RoutineCapabilities } from '#types';\n\nimport { defaultTemplates } from '../templates';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return defaultTemplates.map((template) => Capability.contributes(RoutineCapabilities.Template, template));\n }),\n);\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { AppAnnotation } from '@dxos/app-toolkit';\nimport { Instructions, Skill, Trigger } from '@dxos/compute';\nimport { Obj, Ref, Type } from '@dxos/echo';\n\nimport { Routine, type RoutineCapabilities } from '#types';\n\n/**\n * Blank template: an instructions-action routine draft with an empty trigger; the action kind, schedule, and\n * body are configured in the form. In an object companion the instructions are seeded with the subject (in\n * `objects`) and its type's skills so the draft starts associated with the subject; the global create dialog\n * (no subject) starts with bare instructions.\n */\nexport const blank: RoutineCapabilities.Template = {\n id: 'org.dxos.routine.blank',\n label: 'Blank',\n icon: 'ph--lightning--regular',\n scaffold: ({ name, subject }) =>\n Effect.succeed(\n Routine.make({\n name,\n instructions: Instructions.make({\n skills: subject ? skillRefsForObject(subject) : [],\n objects: subject ? [Ref.make(subject)] : undefined,\n }),\n trigger: Trigger.make({}),\n }),\n ),\n};\n\n/** Templates contributed by plugin-routine itself. */\nexport const defaultTemplates: RoutineCapabilities.Template[] = [blank];\n\n/** Registry skill refs declared by the object type's {@link AppAnnotation.SkillsAnnotation}. */\nconst skillRefsForObject = (object: Obj.Unknown): Ref.Ref<Skill.Skill>[] => {\n const type = Obj.getType(object);\n if (!type) {\n return [];\n }\n const keys = Option.getOrElse(() => [] as string[])(AppAnnotation.SkillsAnnotation.get(Type.getSchema(type)));\n return keys.map((key) => Ref.fromURI(Skill.registryURI(key)));\n};\n"],
5
+ "mappings": ";;;AAIA,YAAYA,aAAY;AAExB,SAASC,kBAAkB;AAE3B,SAASC,2BAA2B;;;ACJpC,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,qBAAqB;AAC9B,SAASC,cAAcC,OAAOC,eAAe;AAC7C,SAASC,KAAKC,KAAKC,YAAY;AAE/B,SAASC,eAAyC;AAQ3C,IAAMC,QAAsC;EACjDC,IAAI;EACJC,OAAO;EACPC,MAAM;EACNC,UAAU,CAAC,EAAEC,MAAMC,QAAO,MACjBC,eACLR,QAAQS,KAAK;IACXH;IACAI,cAAchB,aAAae,KAAK;MAC9BE,QAAQJ,UAAUK,mBAAmBL,OAAAA,IAAW,CAAA;MAChDM,SAASN,UAAU;QAACT,IAAIW,KAAKF,OAAAA;UAAYO;IAC3C,CAAA;IACAC,SAASnB,QAAQa,KAAK,CAAC,CAAA;EACzB,CAAA,CAAA;AAEN;AAGO,IAAMO,mBAAmD;EAACf;;AAGjE,IAAMW,qBAAqB,CAACK,WAAAA;AAC1B,QAAMC,OAAOrB,IAAIsB,QAAQF,MAAAA;AACzB,MAAI,CAACC,MAAM;AACT,WAAO,CAAA;EACT;AACA,QAAME,OAAcC,iBAAU,MAAM,CAAA,CAAE,EAAc5B,cAAc6B,iBAAiBC,IAAIxB,KAAKyB,UAAUN,IAAAA,CAAAA,CAAAA;AACtG,SAAOE,KAAKK,IAAI,CAACC,QAAQ5B,IAAI6B,QAAQhC,MAAMiC,YAAYF,GAAAA,CAAAA,CAAAA;AACzD;;;ADnCA,IAAA,oBAAeG,WAAWC,WACjBC,mBAAW,aAAA;AAChB,SAAOC,iBAAiBC,IAAI,CAACC,aAAaL,WAAWM,YAAYC,oBAAoBC,UAAUH,QAAAA,CAAAA;AACjG,CAAA,CAAA;",
6
+ "names": ["Effect", "Capability", "RoutineCapabilities", "Effect", "Option", "AppAnnotation", "Instructions", "Skill", "Trigger", "Obj", "Ref", "Type", "Routine", "blank", "id", "label", "icon", "scaffold", "name", "subject", "succeed", "make", "instructions", "skills", "skillRefsForObject", "objects", "undefined", "trigger", "defaultTemplates", "object", "type", "getType", "keys", "getOrElse", "SkillsAnnotation", "get", "getSchema", "map", "key", "fromURI", "registryURI", "Capability", "makeModule", "fnUntraced", "defaultTemplates", "map", "template", "contributes", "RoutineCapabilities", "Template"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import {
2
+ RoutinePlugin
3
+ } from "./chunk-CNYAPXUW.mjs";
4
+ import "./chunk-J5LGTIGS.mjs";
5
+ export {
6
+ RoutinePlugin
7
+ };
8
+ //# sourceMappingURL=testing.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,115 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/translations.ts
4
+ import { Type } from "@dxos/echo";
5
+ import { translations as componentsTranslations } from "@dxos/react-ui-components/translations";
6
+ import { translations as formTranslations } from "@dxos/react-ui-form/translations";
7
+ import { meta } from "#meta";
8
+ import { Routine } from "#types";
9
+ var translations = [
10
+ ...componentsTranslations,
11
+ ...formTranslations,
12
+ {
13
+ "en-US": {
14
+ [Type.getTypename(Routine.Routine)]: {
15
+ "typename.label": "Routine",
16
+ "typename.label_zero": "Routines",
17
+ "typename.label_one": "Routine",
18
+ "typename.label_other": "Routines",
19
+ "object-name.placeholder": "New routine",
20
+ "add-object.label": "Add routine",
21
+ "rename-object.label": "Rename routine",
22
+ "delete-object.label": "Delete routine"
23
+ },
24
+ [meta.profile.key]: {
25
+ "plugin.name": "Routine",
26
+ "automation-panel.label": "Routines",
27
+ "create-panel.template.placeholder": "Search templates...",
28
+ "schedule.kind.once.label": "Once",
29
+ "schedule.kind.hourly.label": "Hourly",
30
+ "schedule.kind.daily.label": "Daily",
31
+ "schedule.kind.weekly.label": "Weekly",
32
+ "schedule.kind.monthly.label": "Monthly",
33
+ "schedule.kind.custom.label": "Custom",
34
+ "schedule.at.label": "At",
35
+ "schedule.on.label": "On",
36
+ "schedule.minute.label": "At minute",
37
+ "schedule.day.label": "Day of month",
38
+ "schedule.cron.label": "Cron",
39
+ "schedule.close.label": "Close",
40
+ "schedule.note.message": "Runs are staggered by a few minutes to spread server load.",
41
+ "command.placeholder": "Enter slash command...",
42
+ "template.placeholder": "Enter template...",
43
+ "run-prompt.label": "Run prompt",
44
+ "routine-running.label": "Running\u2026",
45
+ "run.label": "Run",
46
+ "run-error.message": "Failed to run routine.",
47
+ "automation-name.label": "Name",
48
+ "general.title": "General",
49
+ "general.description": "Name and description.",
50
+ "actions.title": "Actions",
51
+ "actions.description": "What this routine runs.",
52
+ "action.placeholder": "Select an operation or instructions",
53
+ "action-input.label": "Input",
54
+ "action-kind.operation.label": "Operation",
55
+ "action-kind.instructions.label": "Instructions",
56
+ "triggers.title": "Triggers",
57
+ "triggers.description": "When this routine runs.",
58
+ "trigger-kind.placeholder": "Select trigger type",
59
+ "trigger-kind.timer.label": "Schedule",
60
+ "trigger-kind.timer.description": "Run on a recurring schedule or once at a future time.",
61
+ "trigger-kind.subscription.label": "Query",
62
+ "trigger-kind.subscription.description": "Run when objects matching a query change.",
63
+ "trigger-kind.webhook.label": "Webhook",
64
+ "trigger-kind.webhook.description": "Trigger from a POST request.",
65
+ "trigger-kind.feed.label": "Feed",
66
+ "trigger-kind.feed.description": "Run when a new item arrives in a feed.",
67
+ "trigger-kind.email.label": "Email",
68
+ "trigger-kind.email.description": "Run when an email is received.",
69
+ "trigger-kind.clear.label": "Clear",
70
+ "trigger-kind.query-stub.message": "Query editing is not yet available.",
71
+ "trigger-kind.email-note.message": "Runs whenever a new email is received.",
72
+ "method.label": "Method",
73
+ "port.label": "Port",
74
+ "cron.placeholder": "0 0 * * *",
75
+ "feed.placeholder": "Select a feed",
76
+ "enabled.label": "Enabled",
77
+ "enabled.description": "Turn this routine on or off.",
78
+ "add-trigger.label": "Add trigger",
79
+ "add-trigger-first.message": "Add a trigger to enable.",
80
+ "remove-trigger.label": "Remove",
81
+ "select-action-first.message": "Select an action first.",
82
+ "automation-companion.label": "Routine",
83
+ "routine-runs.label": "Runs",
84
+ "history.empty.message": "No runs yet.",
85
+ "history.status.success.label": "Success",
86
+ "history.status.failure.label": "Failed",
87
+ "history.status.pending.label": "Running",
88
+ "no-routines.message": "No routines for this object.",
89
+ "routine-not-associated.message": "Not yet associated with this object.",
90
+ "routine-detached.message": "No longer associated with this object.",
91
+ "add-routine.label": "Add routine",
92
+ "routine-actions.label": "Routine actions",
93
+ "disabled.label": "Disabled",
94
+ "delete.label": "Delete",
95
+ "save.label": "Save",
96
+ "cancel.label": "Cancel",
97
+ "testing.title": "Testing",
98
+ "force-run.label": "Force run",
99
+ "reset-cursor.label": "Reset feed cursor",
100
+ "reset-cursor-confirm.label": "Confirm reset feed cursor",
101
+ "routine-verbose.label": "Manage routines",
102
+ "routine.description": "Manage where routines in this space run.",
103
+ "runtime.label": "Runtime location",
104
+ "runtime.description": "Determines where routines in this space run.",
105
+ "runtime.disabled.label": "Disabled",
106
+ "runtime.local.label": "Local",
107
+ "runtime.edge.label": "EDGE (experimental)"
108
+ }
109
+ }
110
+ }
111
+ ];
112
+ export {
113
+ translations
114
+ };
115
+ //# sourceMappingURL=translations.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/translations.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\nimport { type Resource } from '@dxos/react-ui';\nimport { translations as componentsTranslations } from '@dxos/react-ui-components/translations';\nimport { translations as formTranslations } from '@dxos/react-ui-form/translations';\n\nimport { meta } from '#meta';\nimport { Routine } from '#types';\n\nexport const translations: Resource[] = [\n ...componentsTranslations,\n ...formTranslations,\n {\n 'en-US': {\n [Type.getTypename(Routine.Routine)]: {\n 'typename.label': 'Routine',\n 'typename.label_zero': 'Routines',\n 'typename.label_one': 'Routine',\n 'typename.label_other': 'Routines',\n 'object-name.placeholder': 'New routine',\n 'add-object.label': 'Add routine',\n 'rename-object.label': 'Rename routine',\n 'delete-object.label': 'Delete routine',\n },\n [meta.profile.key]: {\n 'plugin.name': 'Routine',\n 'automation-panel.label': 'Routines',\n 'create-panel.template.placeholder': 'Search templates...',\n\n 'schedule.kind.once.label': 'Once',\n 'schedule.kind.hourly.label': 'Hourly',\n 'schedule.kind.daily.label': 'Daily',\n 'schedule.kind.weekly.label': 'Weekly',\n 'schedule.kind.monthly.label': 'Monthly',\n 'schedule.kind.custom.label': 'Custom',\n 'schedule.at.label': 'At',\n 'schedule.on.label': 'On',\n 'schedule.minute.label': 'At minute',\n 'schedule.day.label': 'Day of month',\n 'schedule.cron.label': 'Cron',\n 'schedule.close.label': 'Close',\n 'schedule.note.message': 'Runs are staggered by a few minutes to spread server load.',\n\n 'command.placeholder': 'Enter slash command...',\n 'template.placeholder': 'Enter template...',\n 'run-prompt.label': 'Run prompt',\n 'routine-running.label': 'Running…',\n 'run.label': 'Run',\n 'run-error.message': 'Failed to run routine.',\n\n 'automation-name.label': 'Name',\n 'general.title': 'General',\n 'general.description': 'Name and description.',\n\n 'actions.title': 'Actions',\n 'actions.description': 'What this routine runs.',\n 'action.placeholder': 'Select an operation or instructions',\n 'action-input.label': 'Input',\n 'action-kind.operation.label': 'Operation',\n 'action-kind.instructions.label': 'Instructions',\n\n 'triggers.title': 'Triggers',\n 'triggers.description': 'When this routine runs.',\n 'trigger-kind.placeholder': 'Select trigger type',\n 'trigger-kind.timer.label': 'Schedule',\n 'trigger-kind.timer.description': 'Run on a recurring schedule or once at a future time.',\n 'trigger-kind.subscription.label': 'Query',\n 'trigger-kind.subscription.description': 'Run when objects matching a query change.',\n 'trigger-kind.webhook.label': 'Webhook',\n 'trigger-kind.webhook.description': 'Trigger from a POST request.',\n 'trigger-kind.feed.label': 'Feed',\n 'trigger-kind.feed.description': 'Run when a new item arrives in a feed.',\n 'trigger-kind.email.label': 'Email',\n 'trigger-kind.email.description': 'Run when an email is received.',\n 'trigger-kind.clear.label': 'Clear',\n 'trigger-kind.query-stub.message': 'Query editing is not yet available.',\n 'trigger-kind.email-note.message': 'Runs whenever a new email is received.',\n\n 'method.label': 'Method',\n 'port.label': 'Port',\n 'cron.placeholder': '0 0 * * *',\n 'feed.placeholder': 'Select a feed',\n 'enabled.label': 'Enabled',\n 'enabled.description': 'Turn this routine on or off.',\n 'add-trigger.label': 'Add trigger',\n 'add-trigger-first.message': 'Add a trigger to enable.',\n 'remove-trigger.label': 'Remove',\n 'select-action-first.message': 'Select an action first.',\n 'automation-companion.label': 'Routine',\n 'routine-runs.label': 'Runs',\n\n 'history.empty.message': 'No runs yet.',\n 'history.status.success.label': 'Success',\n 'history.status.failure.label': 'Failed',\n 'history.status.pending.label': 'Running',\n 'no-routines.message': 'No routines for this object.',\n 'routine-not-associated.message': 'Not yet associated with this object.',\n 'routine-detached.message': 'No longer associated with this object.',\n 'add-routine.label': 'Add routine',\n 'routine-actions.label': 'Routine actions',\n 'disabled.label': 'Disabled',\n 'delete.label': 'Delete',\n 'save.label': 'Save',\n 'cancel.label': 'Cancel',\n\n 'testing.title': 'Testing',\n 'force-run.label': 'Force run',\n 'reset-cursor.label': 'Reset feed cursor',\n 'reset-cursor-confirm.label': 'Confirm reset feed cursor',\n\n 'routine-verbose.label': 'Manage routines',\n 'routine.description': 'Manage where routines in this space run.',\n\n 'runtime.label': 'Runtime location',\n 'runtime.description': 'Determines where routines in this space run.',\n 'runtime.disabled.label': 'Disabled',\n 'runtime.local.label': 'Local',\n 'runtime.edge.label': 'EDGE (experimental)',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;AAIA,SAASA,YAAY;AAErB,SAASC,gBAAgBC,8BAA8B;AACvD,SAASD,gBAAgBE,wBAAwB;AAEjD,SAASC,YAAY;AACrB,SAASC,eAAe;AAEjB,IAAMJ,eAA2B;KACnCC;KACAC;EACH;IACE,SAAS;MACP,CAACH,KAAKM,YAAYD,QAAQA,OAAO,CAAA,GAAI;QACnC,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,oBAAoB;QACpB,uBAAuB;QACvB,uBAAuB;MACzB;MACA,CAACD,KAAKG,QAAQC,GAAG,GAAG;QAClB,eAAe;QACf,0BAA0B;QAC1B,qCAAqC;QAErC,4BAA4B;QAC5B,8BAA8B;QAC9B,6BAA6B;QAC7B,8BAA8B;QAC9B,+BAA+B;QAC/B,8BAA8B;QAC9B,qBAAqB;QACrB,qBAAqB;QACrB,yBAAyB;QACzB,sBAAsB;QACtB,uBAAuB;QACvB,wBAAwB;QACxB,yBAAyB;QAEzB,uBAAuB;QACvB,wBAAwB;QACxB,oBAAoB;QACpB,yBAAyB;QACzB,aAAa;QACb,qBAAqB;QAErB,yBAAyB;QACzB,iBAAiB;QACjB,uBAAuB;QAEvB,iBAAiB;QACjB,uBAAuB;QACvB,sBAAsB;QACtB,sBAAsB;QACtB,+BAA+B;QAC/B,kCAAkC;QAElC,kBAAkB;QAClB,wBAAwB;QACxB,4BAA4B;QAC5B,4BAA4B;QAC5B,kCAAkC;QAClC,mCAAmC;QACnC,yCAAyC;QACzC,8BAA8B;QAC9B,oCAAoC;QACpC,2BAA2B;QAC3B,iCAAiC;QACjC,4BAA4B;QAC5B,kCAAkC;QAClC,4BAA4B;QAC5B,mCAAmC;QACnC,mCAAmC;QAEnC,gBAAgB;QAChB,cAAc;QACd,oBAAoB;QACpB,oBAAoB;QACpB,iBAAiB;QACjB,uBAAuB;QACvB,qBAAqB;QACrB,6BAA6B;QAC7B,wBAAwB;QACxB,+BAA+B;QAC/B,8BAA8B;QAC9B,sBAAsB;QAEtB,yBAAyB;QACzB,gCAAgC;QAChC,gCAAgC;QAChC,gCAAgC;QAChC,uBAAuB;QACvB,kCAAkC;QAClC,4BAA4B;QAC5B,qBAAqB;QACrB,yBAAyB;QACzB,kBAAkB;QAClB,gBAAgB;QAChB,cAAc;QACd,gBAAgB;QAEhB,iBAAiB;QACjB,mBAAmB;QACnB,sBAAsB;QACtB,8BAA8B;QAE9B,yBAAyB;QACzB,uBAAuB;QAEvB,iBAAiB;QACjB,uBAAuB;QACvB,0BAA0B;QAC1B,uBAAuB;QACvB,sBAAsB;MACxB;IACF;EACF;;",
6
+ "names": ["Type", "translations", "componentsTranslations", "formTranslations", "meta", "Routine", "getTypename", "profile", "key"]
7
+ }
@@ -0,0 +1,77 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/capabilities/trigger-runtime-controller.ts
4
+ import * as Effect from "effect/Effect";
5
+ import * as Fiber from "effect/Fiber";
6
+ import { Capabilities, Capability } from "@dxos/app-framework";
7
+ import { ServiceResolver } from "@dxos/compute";
8
+ import { Obj } from "@dxos/echo";
9
+ import { TriggerDispatcher } from "@dxos/functions-runtime";
10
+ import { log } from "@dxos/log";
11
+ import { ClientCapabilities } from "@dxos/plugin-client";
12
+ var __dxlog_file = "/Users/jdw/Code/dxos/packages/plugins/plugin-routine/src/capabilities/trigger-runtime-controller.ts";
13
+ var LOCAL_ENVIRONMENT = "local";
14
+ var trigger_runtime_controller_default = Capability.makeModule(Effect.fnUntraced(function* () {
15
+ const client = yield* Capability.get(ClientCapabilities.Client);
16
+ const runtime = yield* Capability.get(Capabilities.ProcessManagerRuntime);
17
+ const trackers = /* @__PURE__ */ new Map();
18
+ const transition = (spaceId, environment) => runtime.runFork(Effect.gen(function* () {
19
+ const dispatcher = yield* TriggerDispatcher;
20
+ yield* environment === LOCAL_ENVIRONMENT ? dispatcher.start() : dispatcher.stop();
21
+ }).pipe(Effect.provide(ServiceResolver.provide({
22
+ space: spaceId
23
+ }, TriggerDispatcher)), Effect.tapErrorCause((cause) => Effect.sync(() => log.warn("trigger dispatcher transition failed", {
24
+ spaceId,
25
+ environment,
26
+ cause
27
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 41, S: this })))));
28
+ const apply = (tracker, spaceId, environment) => {
29
+ if (tracker.lastEnvironment === environment) {
30
+ return;
31
+ }
32
+ tracker.lastEnvironment = environment;
33
+ if (tracker.inFlight) {
34
+ runtime.runFork(Fiber.interrupt(tracker.inFlight));
35
+ }
36
+ tracker.inFlight = transition(spaceId, environment);
37
+ };
38
+ const install = (space) => {
39
+ if (trackers.has(space.id)) {
40
+ return;
41
+ }
42
+ const tracker = {
43
+ unsubscribe: () => {
44
+ }
45
+ };
46
+ trackers.set(space.id, tracker);
47
+ void space.waitUntilReady().then(() => {
48
+ if (trackers.get(space.id) !== tracker) {
49
+ return;
50
+ }
51
+ const readEnvironment = () => space.properties.computeEnvironment ?? LOCAL_ENVIRONMENT;
52
+ tracker.unsubscribe = Obj.subscribe(space.properties, () => apply(tracker, space.id, readEnvironment()));
53
+ apply(tracker, space.id, readEnvironment());
54
+ }).catch((err) => log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 76, S: this }));
55
+ };
56
+ const installAll = (spaces) => {
57
+ for (const space of spaces) {
58
+ install(space);
59
+ }
60
+ };
61
+ const spacesSubscription = client.spaces.subscribe(installAll);
62
+ installAll(client.spaces.get());
63
+ return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => {
64
+ spacesSubscription.unsubscribe();
65
+ for (const tracker of trackers.values()) {
66
+ tracker.unsubscribe();
67
+ if (tracker.inFlight) {
68
+ runtime.runFork(Fiber.interrupt(tracker.inFlight));
69
+ }
70
+ }
71
+ trackers.clear();
72
+ }));
73
+ }));
74
+ export {
75
+ trigger_runtime_controller_default as default
76
+ };
77
+ //# sourceMappingURL=trigger-runtime-controller-7FOTH2NP.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/trigger-runtime-controller.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Fiber from 'effect/Fiber';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { type ComputeEnvironment } from '@dxos/client-protocol';\nimport { ServiceResolver } from '@dxos/compute';\nimport { Obj } from '@dxos/echo';\nimport { TriggerDispatcher } from '@dxos/functions-runtime';\nimport { type SpaceId } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { type Space } from '@dxos/react-client/echo';\n\n//\n// Capability Module\n//\n// Watches `space.properties.computeEnvironment` for every space and toggles\n// the per-space {@link TriggerDispatcher} accordingly:\n//\n// - `local` → `dispatcher.start()`\n// - `edge` / `disabled` → `dispatcher.stop()`\n//\n// Replaces the in-line watcher that used to live inside the removed\n// `compute-runtime.ts` per-space layer. The dispatcher itself is now\n// contributed unconditionally via `TriggerDispatcherSpec` in `layer-specs.ts`,\n// so this capability is only responsible for driving its lifecycle.\n//\n\n/** Trigger execution location the dispatcher should run locally. */\nconst LOCAL_ENVIRONMENT: ComputeEnvironment = 'local';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const runtime = yield* Capability.get(Capabilities.ProcessManagerRuntime);\n\n /** Per-space property-subscription unsubscribe, last-seen environment, and in-flight transition fiber. */\n type Tracker = {\n unsubscribe: () => void;\n lastEnvironment?: ComputeEnvironment;\n inFlight?: Fiber.RuntimeFiber<unknown, unknown>;\n };\n const trackers = new Map<SpaceId, Tracker>();\n\n /**\n * Resolve the per-space `TriggerDispatcher` from the process-manager\n * runtime and invoke `start()` / `stop()` according to the requested\n * environment. Returns a fiber so the caller can cancel a pending\n * transition when a new one supersedes it.\n */\n const transition = (spaceId: SpaceId, environment: ComputeEnvironment) =>\n runtime.runFork(\n Effect.gen(function* () {\n const dispatcher = yield* TriggerDispatcher;\n yield* environment === LOCAL_ENVIRONMENT ? dispatcher.start() : dispatcher.stop();\n }).pipe(\n Effect.provide(ServiceResolver.provide({ space: spaceId }, TriggerDispatcher)),\n Effect.tapErrorCause((cause) =>\n Effect.sync(() => log.warn('trigger dispatcher transition failed', { spaceId, environment, cause })),\n ),\n ),\n );\n\n const apply = (tracker: Tracker, spaceId: SpaceId, environment: ComputeEnvironment): void => {\n if (tracker.lastEnvironment === environment) {\n return;\n }\n tracker.lastEnvironment = environment;\n if (tracker.inFlight) {\n runtime.runFork(Fiber.interrupt(tracker.inFlight));\n }\n tracker.inFlight = transition(spaceId, environment);\n };\n\n const install = (space: Space): void => {\n if (trackers.has(space.id)) {\n return;\n }\n // Reserve the slot synchronously so concurrent `client.spaces.subscribe`\n // notifications (e.g. spaces array churn while we await readiness) don't\n // wire a second subscriber for the same space.\n const tracker: Tracker = { unsubscribe: () => {} };\n trackers.set(space.id, tracker);\n\n void space\n .waitUntilReady()\n .then(() => {\n // The capability could have been torn down between `set` and the\n // promise resolving; bail out without subscribing in that case.\n if (trackers.get(space.id) !== tracker) {\n return;\n }\n const readEnvironment = (): ComputeEnvironment => space.properties.computeEnvironment ?? LOCAL_ENVIRONMENT;\n tracker.unsubscribe = Obj.subscribe(space.properties, () => apply(tracker, space.id, readEnvironment()));\n apply(tracker, space.id, readEnvironment());\n })\n .catch((err) => log.catch(err));\n };\n\n const installAll = (spaces: readonly Space[]): void => {\n for (const space of spaces) {\n install(space);\n }\n };\n\n const spacesSubscription = client.spaces.subscribe(installAll);\n installAll(client.spaces.get());\n\n return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => {\n spacesSubscription.unsubscribe();\n for (const tracker of trackers.values()) {\n tracker.unsubscribe();\n if (tracker.inFlight) {\n runtime.runFork(Fiber.interrupt(tracker.inFlight));\n }\n }\n trackers.clear();\n }),\n );\n }),\n);\n"],
5
+ "mappings": ";;;AAIA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AAEvB,SAASC,cAAcC,kBAAkB;AAEzC,SAASC,uBAAuB;AAChC,SAASC,WAAW;AACpB,SAASC,yBAAyB;AAElC,SAASC,WAAW;AACpB,SAASC,0BAA0B;AAGnC,IAAE,eAAA;AAoBgE,IAAA,oBAAA;IAC9D,qCAAMC,WAAU,WAAsBP,kBAAaQ,aAAAA;AAQnD,QAAMC,SAAAA,OAAeC,WAAAA,IAAAA,mBAAAA,MAAAA;AAErB,QAAA,UAAA,OAAA,WAAA,IAAA,aAAA,qBAAA;;QAUM,aAAOC,CAAAA,SAAgBC,gBAAAA,QAAoBC,QAAgB,WAAKA,aAAWC;AAC1EC,UACDjB,aAAeI,OAAAA;AAA0Bc,WAAOC,gBAAAA,oBAAAA,WAAAA,MAAAA,IAAAA,WAAAA,KAAAA;EAAQ,CAAA,EAAGb,KAAAA,eAAAA,gBACpDc,QAAeC;;sBAC0DR,CAAAA,GAAAA,qBAAAA,CAAAA,UAAAA,YAAAA,MAAAA,IAAAA,KAAAA,wCAAAA;IAAaQ;IAAM;IAK1FC;EACTA,GAAAA,EAAAA,YAAQC,YAAoBV,GAAAA,cAAa,GAAA,IAAA,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;gBAC3C,CAAA,SAAA,SAAA,gBAAA;AACF,QAAA,QAAA,oBAAA,aAAA;AACAS;IACA;YACEb,kBAAsBe;AACxB,QAAA,QAAA,UAAA;AACAF,cAAQG,QAAWC,gBAAWP,QAASN,QAAAA,CAAAA;IACzC;AAEA,YAAMc,WAAWT,WAAAA,SAAAA,WAAAA;;kBAEb,CAAA,UAAA;AACF,QAAA,SAAA,IAAA,MAAA,EAAA,GAAA;AACA;IACA;AAEiD,UAAA,UAAA;MACjDP,aAAaO,MAAQ;MAAA;IAErB;aAGI,IAAA,MAAA,IAAA,OAAA;SACA,MAAA,eAAA,EAAA,KAAA,MAAA;AAGA,UAAA,SAAA,IAAA,MAAA,EAAA,MAAA,SAAA;AACA;MACAI;AACAM,YAAMN,kBAAiB,MAAEO,MAAAA,WAAAA,sBAAAA;AAE1BC,cAAOC,cAAkBA,IAAAA,UAAAA,MAAAA,YAAAA,MAAAA,MAAAA,SAAAA,MAAAA,IAAAA,gBAAAA,CAAAA,CAAAA;AAC9B,YAAA,SAAA,MAAA,IAAA,gBAAA,CAAA;IAEA,CAAA,EAAMC,MAAAA,CAAAA,QAAcC,IAAAA,MAAAA,KAAAA,QAAAA,EAAAA,YAAAA,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,KAAAA,CAAAA,CAAAA;;qBAERf,CAAAA,WAAAA;AACV,eAAA,SAAA,QAAA;AACF,cAAA,KAAA;IAEA;EACAc;AAEA,QAAA,qBAAkBE,OAAYhC,OAAAA,UAAmB,UAC/CF;aACEmC,OAAAA,OAAAA,IAAmBC,CAAAA;oBACd,YAAiBzB,aAAS0B,MAAU,MAAA,MAAA,YAAA,MAAA;uBAC/BD,YAAW;eACfd,WAAQG,SAAU,OAAA,GAAA;cACpBhB,YAAgBR;AAClB,UAAA,QAAA,UAAA;AACF,gBAAA,QAAA,gBAAA,QAAA,QAAA,CAAA;MACAU;IACF;AAGJ,aAAA,MAAA;;;",
6
+ "names": ["Effect", "Fiber", "Capabilities", "Capability", "ServiceResolver", "Obj", "TriggerDispatcher", "log", "ClientCapabilities", "runtime", "ProcessManagerRuntime", "trackers", "Map", "environment", "LOCAL_ENVIRONMENT", "dispatcher", "stop", "pipe", "space", "spaceId", "tapErrorCause", "cause", "tracker", "lastEnvironment", "interrupt", "inFlight", "transition", "install", "apply", "readEnvironment", "catch", "err", "installAll", "spaces", "contributes", "spacesSubscription", "unsubscribe", "values"]
7
+ }
@@ -0,0 +1,17 @@
1
+ import {
2
+ AutomationAction,
3
+ RoutineCapabilities_exports,
4
+ RoutineOperation_exports,
5
+ Routine_exports,
6
+ TriggerTemplate
7
+ } from "../chunk-R7J2MU2M.mjs";
8
+ import "../chunk-674LDIUJ.mjs";
9
+ import "../chunk-J5LGTIGS.mjs";
10
+ export {
11
+ AutomationAction,
12
+ Routine_exports as Routine,
13
+ RoutineCapabilities_exports as RoutineCapabilities,
14
+ RoutineOperation_exports as RoutineOperation,
15
+ TriggerTemplate
16
+ };
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ declare const _default: {
2
+ readonly plugin: {
3
+ readonly key: string;
4
+ readonly name: string;
5
+ readonly description?: string | undefined;
6
+ readonly author?: string | undefined;
7
+ readonly homePage?: string | undefined;
8
+ readonly source?: string | undefined;
9
+ readonly screenshots?: readonly {
10
+ readonly light?: string | undefined;
11
+ readonly dark?: string | undefined;
12
+ }[] | undefined;
13
+ readonly tags?: readonly string[] | undefined;
14
+ readonly icon?: {
15
+ readonly key: string;
16
+ readonly hue?: string | undefined;
17
+ } | undefined;
18
+ readonly spec?: string | undefined;
19
+ readonly dependsOn?: readonly string[] | undefined;
20
+ };
21
+ readonly publish?: {
22
+ readonly buildCommand?: string | undefined;
23
+ readonly outputDirectory?: string | undefined;
24
+ readonly assetBaseUrl?: string | undefined;
25
+ } | undefined;
26
+ };
27
+ export default _default;
28
+ //# sourceMappingURL=dx.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dx.config.d.ts","sourceRoot":"","sources":["../../dx.config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { Plugin } from '@dxos/app-framework';
2
+ export declare const RoutinePlugin: Plugin.PluginFactory<void>;
3
+ export default RoutinePlugin;
4
+ //# sourceMappingURL=RoutinePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoutinePlugin.d.ts","sourceRoot":"","sources":["../../../src/RoutinePlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqC,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAuBhF,eAAO,MAAM,aAAa,4BA4BzB,CAAC;eAEa,aAAa"}
@@ -0,0 +1,4 @@
1
+ import { Plugin } from '@dxos/app-framework';
2
+ export declare const RoutinePlugin: Plugin.PluginFactory<void>;
3
+ export default RoutinePlugin;
4
+ //# sourceMappingURL=RoutinePlugin.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoutinePlugin.node.d.ts","sourceRoot":"","sources":["../../../src/RoutinePlugin.node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqC,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAkBhF,eAAO,MAAM,aAAa,4BAuBzB,CAAC;eAEa,aAAa"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RoutinePlugin.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoutinePlugin.test.d.ts","sourceRoot":"","sources":["../../../src/RoutinePlugin.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { Plugin } from '@dxos/app-framework';
2
+ export declare const RoutinePlugin: Plugin.PluginFactory<void>;
3
+ export default RoutinePlugin;
4
+ //# sourceMappingURL=RoutinePlugin.workerd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoutinePlugin.workerd.d.ts","sourceRoot":"","sources":["../../../src/RoutinePlugin.workerd.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ7C,eAAO,MAAM,aAAa,4BASzB,CAAC;eAEa,aAAa"}
@@ -0,0 +1,5 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capability } from '@dxos/app-framework';
3
+ declare const _default: (props: void) => Effect.Effect<Capability.Any, never, never>;
4
+ export default _default;
5
+ //# sourceMappingURL=app-graph-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/app-graph-builder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capability } from '@dxos/app-framework';
3
+ declare const _default: (props: void) => Effect.Effect<Capability.Any, never, never>;
4
+ export default _default;
5
+ //# sourceMappingURL=create-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-object.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/create-object.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=create-object.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-object.test.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/create-object.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { Capability } from '@dxos/app-framework';
2
+ import { OperationHandlerSet } from '@dxos/compute';
3
+ export declare const AppGraphBuilder: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
4
+ export declare const NavigationResolver: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
5
+ export declare const CreateObject: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
6
+ export declare const LayerSpecs: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
7
+ export declare const OperationHandler: Capability.LazyCapability<OperationHandlerSet.OperationHandlerSet, Capability.ModuleReturn, Error>;
8
+ export declare const ReactSurface: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
9
+ export declare const RegistrySync: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
10
+ export declare const Templates: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
11
+ export declare const TriggerRuntimeController: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
12
+ //# sourceMappingURL=index.d.ts.map