@dxos/plugin-script 0.7.5-main.e9bb01b → 0.7.5-staging.2ff1350

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 (215) hide show
  1. package/dist/lib/browser/{AutomationPanel-KZVZMZE6.mjs → AutomationPanel-6HFRNRWV.mjs} +3 -3
  2. package/dist/lib/browser/{ScriptContainer-AERJBGYK.mjs → ScriptContainer-GR7X5NSI.mjs} +97 -69
  3. package/dist/lib/browser/ScriptContainer-GR7X5NSI.mjs.map +7 -0
  4. package/dist/lib/browser/artifact-definition-NAWYXFF5.mjs +243 -0
  5. package/dist/lib/browser/artifact-definition-NAWYXFF5.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-Y4CVWFVS.mjs → chunk-5SXOHNAK.mjs} +4 -4
  7. package/dist/lib/browser/chunk-5SXOHNAK.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-ABNZIPST.mjs → chunk-6MOQ4BP3.mjs} +2 -2
  9. package/dist/lib/browser/{chunk-J7CBIZI2.mjs → chunk-7RUMC44X.mjs} +19 -7
  10. package/dist/lib/browser/{chunk-J7CBIZI2.mjs.map → chunk-7RUMC44X.mjs.map} +3 -3
  11. package/dist/lib/browser/{chunk-ESPJMGXJ.mjs → chunk-FVVCAWNP.mjs} +2 -2
  12. package/dist/lib/browser/chunk-FVVCAWNP.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-NFPF4OIU.mjs → chunk-N46LE7FS.mjs} +2 -2
  14. package/dist/lib/browser/chunk-YJAKD6E3.mjs +69 -0
  15. package/dist/lib/browser/chunk-YJAKD6E3.mjs.map +7 -0
  16. package/dist/lib/browser/{compiler-4QD7VFZX.mjs → compiler-YY2XSKHQ.mjs} +4 -6
  17. package/dist/lib/browser/compiler-YY2XSKHQ.mjs.map +7 -0
  18. package/dist/lib/browser/index.mjs +47 -30
  19. package/dist/lib/browser/index.mjs.map +4 -4
  20. package/dist/lib/browser/{intent-resolver-YABC4JRJ.mjs → intent-resolver-I6VDXUDH.mjs} +4 -4
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/{react-surface-FRQIIYKG.mjs → react-surface-FGWXHB7P.mjs} +5 -5
  23. package/dist/lib/browser/{react-surface-FRQIIYKG.mjs.map → react-surface-FGWXHB7P.mjs.map} +2 -2
  24. package/dist/lib/browser/{settings-S4MGGM4D.mjs → settings-SZCDKHWO.mjs} +3 -3
  25. package/dist/lib/browser/types.mjs +2 -2
  26. package/dist/lib/node/{AutomationPanel-6QSV7ZYK.cjs → AutomationPanel-RBQ4DODN.cjs} +8 -8
  27. package/dist/lib/node/{ScriptContainer-DOAQ6KOE.cjs → ScriptContainer-SLARXOSU.cjs} +100 -70
  28. package/dist/lib/node/ScriptContainer-SLARXOSU.cjs.map +7 -0
  29. package/dist/lib/node/artifact-definition-7AANUS3X.cjs +262 -0
  30. package/dist/lib/node/artifact-definition-7AANUS3X.cjs.map +7 -0
  31. package/dist/lib/node/{chunk-HU2JXUXI.cjs → chunk-5UH3F7TA.cjs} +5 -5
  32. package/dist/lib/node/chunk-5UH3F7TA.cjs.map +7 -0
  33. package/dist/lib/node/chunk-7XULMIYT.cjs +77 -0
  34. package/dist/lib/node/chunk-7XULMIYT.cjs.map +7 -0
  35. package/dist/lib/node/{chunk-RZHY5LAR.cjs → chunk-ALY3N6PW.cjs} +6 -6
  36. package/dist/lib/node/{chunk-6M2VRFBC.cjs → chunk-DJGLGRQV.cjs} +6 -6
  37. package/dist/lib/node/{chunk-63C2KSD6.cjs → chunk-JITODKGN.cjs} +23 -11
  38. package/dist/lib/node/{chunk-63C2KSD6.cjs.map → chunk-JITODKGN.cjs.map} +3 -3
  39. package/dist/lib/node/{chunk-CZVVFUVL.cjs → chunk-K3ZZWVXS.cjs} +7 -7
  40. package/dist/lib/node/chunk-K3ZZWVXS.cjs.map +7 -0
  41. package/dist/lib/node/{compiler-Q3EXWKV5.cjs → compiler-UIBLKJKG.cjs} +9 -9
  42. package/dist/lib/node/compiler-UIBLKJKG.cjs.map +7 -0
  43. package/dist/lib/node/index.cjs +62 -46
  44. package/dist/lib/node/index.cjs.map +4 -4
  45. package/dist/lib/node/{intent-resolver-7HI2CDGB.cjs → intent-resolver-MYATX7IR.cjs} +9 -9
  46. package/dist/lib/node/meta.json +1 -1
  47. package/dist/lib/node/{react-surface-IKONODLG.cjs → react-surface-2GH5HQX4.cjs} +18 -18
  48. package/dist/lib/node/{react-surface-IKONODLG.cjs.map → react-surface-2GH5HQX4.cjs.map} +2 -2
  49. package/dist/lib/node/{settings-Q5XIA4LZ.cjs → settings-SZFSMSKM.cjs} +9 -9
  50. package/dist/lib/node/types.cjs +4 -4
  51. package/dist/lib/node/types.cjs.map +1 -1
  52. package/dist/lib/node-esm/{AutomationPanel-EZQSGJLS.mjs → AutomationPanel-WTVVVMRH.mjs} +3 -3
  53. package/dist/lib/node-esm/{ScriptContainer-HE5QPPFZ.mjs → ScriptContainer-MHRJXMC4.mjs} +97 -69
  54. package/dist/lib/node-esm/ScriptContainer-MHRJXMC4.mjs.map +7 -0
  55. package/dist/lib/node-esm/artifact-definition-KBASPVMM.mjs +245 -0
  56. package/dist/lib/node-esm/artifact-definition-KBASPVMM.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-77LRZF2W.mjs → chunk-2AFXX34U.mjs} +4 -4
  58. package/dist/lib/node-esm/chunk-2AFXX34U.mjs.map +7 -0
  59. package/dist/lib/node-esm/chunk-6CHX4CEL.mjs +71 -0
  60. package/dist/lib/node-esm/chunk-6CHX4CEL.mjs.map +7 -0
  61. package/dist/lib/node-esm/{chunk-3YOO5E2D.mjs → chunk-CP5LXTK5.mjs} +2 -2
  62. package/dist/lib/node-esm/{chunk-UWHMEJYW.mjs → chunk-IAELQPSI.mjs} +19 -7
  63. package/dist/lib/node-esm/{chunk-UWHMEJYW.mjs.map → chunk-IAELQPSI.mjs.map} +3 -3
  64. package/dist/lib/node-esm/{chunk-EOBGHKNT.mjs → chunk-P2V2Y5LV.mjs} +2 -2
  65. package/dist/lib/node-esm/chunk-P2V2Y5LV.mjs.map +7 -0
  66. package/dist/lib/node-esm/{chunk-5D2AXTAW.mjs → chunk-UNQFIERE.mjs} +2 -2
  67. package/dist/lib/node-esm/{compiler-KJEIPDZ6.mjs → compiler-XTXFGZJM.mjs} +4 -6
  68. package/dist/lib/node-esm/compiler-XTXFGZJM.mjs.map +7 -0
  69. package/dist/lib/node-esm/index.mjs +47 -30
  70. package/dist/lib/node-esm/index.mjs.map +4 -4
  71. package/dist/lib/node-esm/{intent-resolver-KG7I6JJA.mjs → intent-resolver-PBDTYC4P.mjs} +4 -4
  72. package/dist/lib/node-esm/meta.json +1 -1
  73. package/dist/lib/node-esm/{react-surface-YA7WIRAM.mjs → react-surface-MLE3J3TF.mjs} +5 -5
  74. package/dist/lib/node-esm/{react-surface-YA7WIRAM.mjs.map → react-surface-MLE3J3TF.mjs.map} +2 -2
  75. package/dist/lib/node-esm/{settings-NZXHNIQ3.mjs → settings-GR4O2WHZ.mjs} +3 -3
  76. package/dist/lib/node-esm/types.mjs +2 -2
  77. package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
  78. package/dist/types/src/capabilities/artifact-definition.d.ts +11 -0
  79. package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
  80. package/dist/types/src/capabilities/index.d.ts +1 -0
  81. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  82. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  83. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -2
  84. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  85. package/dist/types/src/components/DebugPanel/DebugPanel.d.ts +1 -2
  86. package/dist/types/src/components/DebugPanel/DebugPanel.d.ts.map +1 -1
  87. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts +3 -4
  88. package/dist/types/src/components/FrameContainer/FrameContainer.d.ts.map +1 -1
  89. package/dist/types/src/components/ScriptContainer.d.ts +2 -3
  90. package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
  91. package/dist/types/src/components/ScriptSettings/ScriptSettings.d.ts +1 -2
  92. package/dist/types/src/components/ScriptSettings/ScriptSettings.d.ts.map +1 -1
  93. package/dist/types/src/components/ScriptSettingsPanel.d.ts +1 -2
  94. package/dist/types/src/components/ScriptSettingsPanel.d.ts.map +1 -1
  95. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +2 -3
  96. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  97. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +1 -2
  98. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  99. package/dist/types/src/components/index.d.ts +2 -2
  100. package/dist/types/src/components/index.d.ts.map +1 -1
  101. package/dist/types/src/events.d.ts +4 -0
  102. package/dist/types/src/events.d.ts.map +1 -0
  103. package/dist/types/src/hooks/deploy.d.ts.map +1 -0
  104. package/dist/types/src/hooks/format.d.ts.map +1 -0
  105. package/dist/types/src/hooks/index.d.ts +7 -0
  106. package/dist/types/src/hooks/index.d.ts.map +1 -0
  107. package/dist/types/src/{components/ScriptToolbar/templateSelect.d.ts → hooks/template.d.ts} +1 -1
  108. package/dist/types/src/hooks/template.d.ts.map +1 -0
  109. package/dist/types/src/{components/ScriptToolbar → hooks}/useToolbarAction.d.ts +1 -1
  110. package/dist/types/src/hooks/useToolbarAction.d.ts.map +1 -0
  111. package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -0
  112. package/dist/types/src/hooks/view.d.ts.map +1 -0
  113. package/dist/types/src/index.d.ts +0 -1
  114. package/dist/types/src/index.d.ts.map +1 -1
  115. package/dist/types/src/meta.d.ts.map +1 -1
  116. package/dist/types/src/templates/chess.d.ts +1 -4
  117. package/dist/types/src/templates/chess.d.ts.map +1 -1
  118. package/dist/types/src/templates/discord.d.ts +3 -0
  119. package/dist/types/src/templates/discord.d.ts.map +1 -0
  120. package/dist/types/src/templates/echo.d.ts.map +1 -1
  121. package/dist/types/src/templates/forex-effect.d.ts +3 -0
  122. package/dist/types/src/templates/forex-effect.d.ts.map +1 -0
  123. package/dist/types/src/templates/forex.d.ts +1 -4
  124. package/dist/types/src/templates/forex.d.ts.map +1 -1
  125. package/dist/types/src/templates/index.d.ts.map +1 -1
  126. package/dist/types/src/translations.d.ts +6 -0
  127. package/dist/types/src/translations.d.ts.map +1 -1
  128. package/package.json +42 -42
  129. package/src/ScriptPlugin.tsx +28 -12
  130. package/src/capabilities/artifact-definition.ts +219 -0
  131. package/src/capabilities/compiler.ts +1 -1
  132. package/src/capabilities/index.ts +1 -0
  133. package/src/capabilities/react-surface.tsx +2 -1
  134. package/src/compiler/compiler.browser.test.ts +1 -1
  135. package/src/components/DebugPanel/DebugPanel.tsx +2 -2
  136. package/src/components/FrameContainer/FrameContainer.tsx +5 -4
  137. package/src/components/ScriptContainer.tsx +10 -5
  138. package/src/components/ScriptSettingsPanel.tsx +16 -2
  139. package/src/components/ScriptToolbar/ScriptToolbar.tsx +8 -6
  140. package/src/components/TypescriptEditor/TypescriptEditor.tsx +2 -2
  141. package/src/events.ts +11 -0
  142. package/src/{components/ScriptToolbar → hooks}/deploy.ts +16 -4
  143. package/src/{components/ScriptToolbar → hooks}/format.ts +1 -1
  144. package/src/hooks/index.ts +11 -0
  145. package/src/{components/ScriptToolbar/templateSelect.ts → hooks/template.ts} +2 -2
  146. package/src/{components/ScriptToolbar → hooks}/useToolbarAction.ts +1 -1
  147. package/src/{components/ScriptToolbar → hooks}/view.ts +1 -1
  148. package/src/index.ts +0 -1
  149. package/src/meta.ts +2 -1
  150. package/src/templates/chess.ts +42 -35
  151. package/src/templates/discord.ts +103 -0
  152. package/src/templates/echo.ts +5 -1
  153. package/src/templates/forex-effect.ts +41 -0
  154. package/src/templates/forex.ts +23 -16
  155. package/src/templates/index.ts +15 -0
  156. package/src/translations.ts +2 -0
  157. package/dist/lib/browser/ScriptContainer-AERJBGYK.mjs.map +0 -7
  158. package/dist/lib/browser/chunk-ESPJMGXJ.mjs.map +0 -7
  159. package/dist/lib/browser/chunk-REL2R7SB.mjs +0 -52
  160. package/dist/lib/browser/chunk-REL2R7SB.mjs.map +0 -7
  161. package/dist/lib/browser/chunk-SDHKTS6H.mjs +0 -237
  162. package/dist/lib/browser/chunk-SDHKTS6H.mjs.map +0 -7
  163. package/dist/lib/browser/chunk-Y4CVWFVS.mjs.map +0 -7
  164. package/dist/lib/browser/compiler-4QD7VFZX.mjs.map +0 -7
  165. package/dist/lib/node/ScriptContainer-DOAQ6KOE.cjs.map +0 -7
  166. package/dist/lib/node/chunk-CZVVFUVL.cjs.map +0 -7
  167. package/dist/lib/node/chunk-HU2JXUXI.cjs.map +0 -7
  168. package/dist/lib/node/chunk-T4TXCRN5.cjs +0 -260
  169. package/dist/lib/node/chunk-T4TXCRN5.cjs.map +0 -7
  170. package/dist/lib/node/chunk-TJ4BTPOS.cjs +0 -64
  171. package/dist/lib/node/chunk-TJ4BTPOS.cjs.map +0 -7
  172. package/dist/lib/node/compiler-Q3EXWKV5.cjs.map +0 -7
  173. package/dist/lib/node-esm/ScriptContainer-HE5QPPFZ.mjs.map +0 -7
  174. package/dist/lib/node-esm/chunk-77LRZF2W.mjs.map +0 -7
  175. package/dist/lib/node-esm/chunk-EOBGHKNT.mjs.map +0 -7
  176. package/dist/lib/node-esm/chunk-G76M6O46.mjs +0 -239
  177. package/dist/lib/node-esm/chunk-G76M6O46.mjs.map +0 -7
  178. package/dist/lib/node-esm/chunk-JJZYWSD7.mjs +0 -54
  179. package/dist/lib/node-esm/chunk-JJZYWSD7.mjs.map +0 -7
  180. package/dist/lib/node-esm/compiler-KJEIPDZ6.mjs.map +0 -7
  181. package/dist/types/src/bundler/bundler.d.ts +0 -39
  182. package/dist/types/src/bundler/bundler.d.ts.map +0 -1
  183. package/dist/types/src/bundler/bundler.test.d.ts +0 -2
  184. package/dist/types/src/bundler/bundler.test.d.ts.map +0 -1
  185. package/dist/types/src/bundler/index.d.ts +0 -2
  186. package/dist/types/src/bundler/index.d.ts.map +0 -1
  187. package/dist/types/src/components/ScriptToolbar/deploy.d.ts.map +0 -1
  188. package/dist/types/src/components/ScriptToolbar/format.d.ts.map +0 -1
  189. package/dist/types/src/components/ScriptToolbar/templateSelect.d.ts.map +0 -1
  190. package/dist/types/src/components/ScriptToolbar/useToolbarAction.d.ts.map +0 -1
  191. package/dist/types/src/components/ScriptToolbar/useToolbarState.d.ts.map +0 -1
  192. package/dist/types/src/components/ScriptToolbar/view.d.ts.map +0 -1
  193. package/src/bundler/bundler.test.ts +0 -55
  194. package/src/bundler/bundler.ts +0 -250
  195. package/src/bundler/index.ts +0 -5
  196. /package/dist/lib/browser/{AutomationPanel-KZVZMZE6.mjs.map → AutomationPanel-6HFRNRWV.mjs.map} +0 -0
  197. /package/dist/lib/browser/{chunk-ABNZIPST.mjs.map → chunk-6MOQ4BP3.mjs.map} +0 -0
  198. /package/dist/lib/browser/{chunk-NFPF4OIU.mjs.map → chunk-N46LE7FS.mjs.map} +0 -0
  199. /package/dist/lib/browser/{intent-resolver-YABC4JRJ.mjs.map → intent-resolver-I6VDXUDH.mjs.map} +0 -0
  200. /package/dist/lib/browser/{settings-S4MGGM4D.mjs.map → settings-SZCDKHWO.mjs.map} +0 -0
  201. /package/dist/lib/node/{AutomationPanel-6QSV7ZYK.cjs.map → AutomationPanel-RBQ4DODN.cjs.map} +0 -0
  202. /package/dist/lib/node/{chunk-RZHY5LAR.cjs.map → chunk-ALY3N6PW.cjs.map} +0 -0
  203. /package/dist/lib/node/{chunk-6M2VRFBC.cjs.map → chunk-DJGLGRQV.cjs.map} +0 -0
  204. /package/dist/lib/node/{intent-resolver-7HI2CDGB.cjs.map → intent-resolver-MYATX7IR.cjs.map} +0 -0
  205. /package/dist/lib/node/{settings-Q5XIA4LZ.cjs.map → settings-SZFSMSKM.cjs.map} +0 -0
  206. /package/dist/lib/node-esm/{AutomationPanel-EZQSGJLS.mjs.map → AutomationPanel-WTVVVMRH.mjs.map} +0 -0
  207. /package/dist/lib/node-esm/{chunk-3YOO5E2D.mjs.map → chunk-CP5LXTK5.mjs.map} +0 -0
  208. /package/dist/lib/node-esm/{chunk-5D2AXTAW.mjs.map → chunk-UNQFIERE.mjs.map} +0 -0
  209. /package/dist/lib/node-esm/{intent-resolver-KG7I6JJA.mjs.map → intent-resolver-PBDTYC4P.mjs.map} +0 -0
  210. /package/dist/lib/node-esm/{settings-NZXHNIQ3.mjs.map → settings-GR4O2WHZ.mjs.map} +0 -0
  211. /package/dist/types/src/{components/ScriptToolbar → hooks}/deploy.d.ts +0 -0
  212. /package/dist/types/src/{components/ScriptToolbar → hooks}/format.d.ts +0 -0
  213. /package/dist/types/src/{components/ScriptToolbar → hooks}/useToolbarState.d.ts +0 -0
  214. /package/dist/types/src/{components/ScriptToolbar → hooks}/view.d.ts +0 -0
  215. /package/src/{components/ScriptToolbar → hooks}/useToolbarState.ts +0 -0
@@ -5,12 +5,14 @@
5
5
  // @ts-ignore
6
6
 
7
7
  import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
8
- import { type Space } from '@dxos/client/echo';
9
8
  import { FunctionType, ScriptType } from '@dxos/functions';
10
9
  import { RefArray } from '@dxos/live-object';
11
10
  import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
11
+ import { SpaceCapabilities } from '@dxos/plugin-space';
12
+ import { defineObjectForm } from '@dxos/plugin-space/types';
12
13
 
13
- import { Compiler, IntentResolver, ReactSurface, ScriptSettings } from './capabilities';
14
+ import { ArtifactDefinition, Compiler, IntentResolver, ReactSurface, ScriptSettings } from './capabilities';
15
+ import { ScriptEvents } from './events';
14
16
  import { meta, SCRIPT_PLUGIN } from './meta';
15
17
  import translations from './translations';
16
18
  import { ScriptAction } from './types';
@@ -24,7 +26,7 @@ export const ScriptPlugin = () =>
24
26
  }),
25
27
  defineModule({
26
28
  id: `${meta.id}/module/compiler`,
27
- activatesOn: Events.Startup,
29
+ activatesOn: ScriptEvents.SetupCompiler,
28
30
  activate: Compiler,
29
31
  }),
30
32
  defineModule({
@@ -39,9 +41,6 @@ export const ScriptPlugin = () =>
39
41
  contributes(Capabilities.Metadata, {
40
42
  id: ScriptType.typename,
41
43
  metadata: {
42
- creationSchema: ScriptAction.CreateScriptSchema,
43
- createObject: (props: ScriptAction.CreateScriptProps, { space }: { space: Space }) =>
44
- createIntent(ScriptAction.Create, { ...props, space }),
45
44
  placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],
46
45
  icon: 'ph--code--regular',
47
46
  // TODO(wittjosiah): Move out of metadata.
@@ -49,22 +48,39 @@ export const ScriptPlugin = () =>
49
48
  },
50
49
  }),
51
50
  }),
51
+ defineModule({
52
+ id: `${meta.id}/module/object-form`,
53
+ activatesOn: ClientEvents.SetupSchema,
54
+ activate: () =>
55
+ contributes(
56
+ SpaceCapabilities.ObjectForm,
57
+ defineObjectForm({
58
+ objectSchema: ScriptType,
59
+ formSchema: ScriptAction.CreateScriptSchema,
60
+ getIntent: (props, options) => createIntent(ScriptAction.Create, { ...props, space: options.space }),
61
+ }),
62
+ ),
63
+ }),
52
64
  defineModule({
53
65
  id: `${meta.id}/module/schema`,
54
66
  activatesOn: ClientEvents.SetupSchema,
55
- activate: () => [
56
- contributes(ClientCapabilities.SystemSchema, [FunctionType]),
57
- contributes(ClientCapabilities.Schema, [ScriptType]),
58
- ],
67
+ activate: () => contributes(ClientCapabilities.Schema, [FunctionType]),
59
68
  }),
60
69
  defineModule({
61
70
  id: `${meta.id}/module/react-surface`,
62
- activatesOn: Events.SetupSurfaces,
71
+ activatesOn: Events.SetupReactSurface,
72
+ // TODO(wittjosiah): Should occur before the script editor is loaded when surfaces activation is more granular.
73
+ activatesBefore: [ScriptEvents.SetupCompiler],
63
74
  activate: ReactSurface,
64
75
  }),
65
76
  defineModule({
66
77
  id: `${meta.id}/module/intent-resolver`,
67
- activatesOn: Events.SetupIntents,
78
+ activatesOn: Events.SetupIntentResolver,
68
79
  activate: IntentResolver,
69
80
  }),
81
+ defineModule({
82
+ id: `${meta.id}/module/artifact-definition`,
83
+ activatesOn: Events.SetupArtifactDefinition,
84
+ activate: ArtifactDefinition,
85
+ }),
70
86
  ]);
@@ -0,0 +1,219 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capabilities, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
6
+ import { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';
7
+ import { createArtifactElement } from '@dxos/assistant';
8
+ import { ObjectId, S } from '@dxos/echo-schema';
9
+ import { ScriptType } from '@dxos/functions';
10
+ import { invariant } from '@dxos/invariant';
11
+ import { SpaceAction } from '@dxos/plugin-space/types';
12
+ import { create, makeRef, type Space } from '@dxos/react-client/echo';
13
+ import { TextType } from '@dxos/schema';
14
+
15
+ // TODO(burdon): Factor out.
16
+ declare global {
17
+ interface ToolContextExtensions {
18
+ space?: Space;
19
+ dispatch?: PromiseIntentDispatcher;
20
+ }
21
+ }
22
+
23
+ export default () => {
24
+ const definition = defineArtifact({
25
+ id: 'plugin-script',
26
+ // TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,
27
+ // we should offload the work of synthesizing the code to a separate model.
28
+ // The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.
29
+ instructions: `
30
+ If the user explicitly requests you to write a script, you can create one.
31
+ If the user requests you to change one of the existing script, you can update it.
32
+ Scripts are short code pieces of executable code that can be used to perform computations, integrate with external systems, and perform automated tasks.
33
+ Each script must follow as strict shape for the definition but the body can contain any valid executable code.
34
+ Scripts are written in JavaScript or TypeScript.
35
+ Each script must define an input schema and output schema.
36
+ Each script must have its own detailed description.
37
+
38
+ Important: You cannot execute scripts. Scripts are only available as tools after the user deploys them. You must only call the available tools.
39
+
40
+ Description:
41
+ The description is a detailed description of the script.
42
+ It is used to describe the script's purpose, input, and output.
43
+ The description is used to generate the script's documentation.
44
+ The description is also goes into the script metadata.
45
+ The description is used by AI to understand the script and its purpose.
46
+ The description must provide cases on when the script should be used.
47
+
48
+ Schema:
49
+ The schema is defined using a schema-DSL library called Effect Schema.
50
+ The input schema describes the arguments that the script accepts.
51
+ The output schema describes the result that the script produces.
52
+ The schema is used to validate the script's input and output.
53
+ The schema is also goes into the script metadata.
54
+ The properties in the schema must have valid descriptions.
55
+ The input and output schemas must both be a struct of fields.
56
+
57
+ Restricts:
58
+ The scripts can only import code from "dxos:functions" module. No other modules are allowed.
59
+ Some web APIs are available - like fetch.
60
+
61
+ Reasoning:
62
+ Before writing a script, synthesize the following information:
63
+ - Description
64
+ - What APIs will be used.
65
+ - Detailed input schema
66
+ - Detailed output schema
67
+
68
+ <apis>
69
+ export function defineFunction(params: {
70
+ description: string,
71
+ inputSchema: S.Schema,
72
+ outputSchema: S.Schema,
73
+ handler: (params: { event: { data: TInput } }) => Promise<TOutput>
74
+ }): FunctionDefinition
75
+ /**
76
+ * Effect Schema
77
+ */
78
+ export const S;
79
+
80
+ // Examples:
81
+
82
+ S.String
83
+ S.Number
84
+ S.Boolean
85
+ S.Struct({
86
+ from: S.String.annotations({ description: 'The source currency' }),
87
+ to: S.String.annotations({ description: 'The target currency' }),
88
+ })
89
+ S.Array(S.String)
90
+ S.Union(S.String, S.Number)
91
+ S.optional(S.String)
92
+ S.String.annotations({ description: 'The source currency' })
93
+ </apis>
94
+
95
+ <handler_function>
96
+ Async function that takes the argument in the form of:
97
+
98
+ type HandlerFunctionParam = {
99
+ event: {
100
+ data: T // The input schema
101
+ },
102
+ }
103
+
104
+ The function must return the result that matches the output schema.
105
+ </handler_function>
106
+
107
+ <example>
108
+ import { defineFunction, S } from 'dxos:functions';
109
+
110
+ export default defineFunction({
111
+ description: 'Returns the exchange rate between two currencies.',
112
+
113
+ inputSchema: S.Struct({
114
+ from: S.String.annotations({ description: 'The source currency' }),
115
+ to: S.String.annotations({ description: 'The target currency' }),
116
+ }),
117
+
118
+ outputSchema: S.Struct({
119
+ rate: S.String.annotations({ description: 'The exchange rate' }),
120
+ }),
121
+
122
+ handler: async ({
123
+ event: {
124
+ data: { from, to },
125
+ },
126
+ }: any) => {
127
+ const res = await fetch(\`https://free.ratesdb.com/v1/rates?from=\${from}&to=\${to}\`);
128
+ const {
129
+ data: { rates },
130
+ } = await res.json();
131
+
132
+ return { rate: rates[to].toString() };
133
+ },
134
+ });
135
+ </example>
136
+ `,
137
+ schema: ScriptType,
138
+ tools: [
139
+ defineTool({
140
+ name: 'script_new',
141
+ description: 'Create a new script. Returns the artifact definition for the script',
142
+ schema: S.Struct({
143
+ name: S.String.annotations({ description: 'The name of the script' }),
144
+ code: S.String.annotations({
145
+ description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
146
+ }),
147
+ }),
148
+ execute: async ({ name, code }, { extensions }) => {
149
+ invariant(extensions?.space, 'No space');
150
+ invariant(extensions?.dispatch, 'No intent dispatcher');
151
+ const script = create(ScriptType, {
152
+ name,
153
+ source: makeRef(
154
+ create(TextType, {
155
+ content: code,
156
+ }),
157
+ ),
158
+ });
159
+ extensions.space.db.add(script);
160
+ await extensions.space.db.flush();
161
+
162
+ const intent = createIntent(SpaceAction.AddObject, { target: extensions.space, object: script });
163
+ const { data, error } = await extensions.dispatch(intent);
164
+ if (!data || error) {
165
+ return ToolResult.Error(error?.message ?? 'Failed to create chess game');
166
+ }
167
+
168
+ return ToolResult.Success(createArtifactElement(script.id));
169
+ },
170
+ }),
171
+ defineTool({
172
+ name: 'script_inspect',
173
+ description: 'Inspect a script. Returns the artifact definition for the script',
174
+ schema: S.Struct({
175
+ id: ObjectId,
176
+ }),
177
+ execute: async ({ id }, { extensions }) => {
178
+ invariant(extensions?.space, 'No space');
179
+
180
+ const script = (await extensions.space.db.query({ id }).first()) as ScriptType;
181
+ const { content } = await script.source.load();
182
+
183
+ return ToolResult.Success({
184
+ name: script.name,
185
+ code: content,
186
+ });
187
+ },
188
+ }),
189
+ defineTool({
190
+ name: 'script_update',
191
+ description: 'Update a script. Returns the artifact definition for the script',
192
+ schema: S.Struct({
193
+ id: ObjectId,
194
+ code: S.String.annotations({
195
+ description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',
196
+ }),
197
+ }),
198
+ execute: async ({ id, code }, { extensions }) => {
199
+ invariant(extensions?.space, 'No space');
200
+
201
+ const script = (await extensions.space.db.query({ id }).first()) as ScriptType;
202
+ const source = await script.source.load();
203
+ if (!source) {
204
+ return ToolResult.Error('Script not found');
205
+ }
206
+
207
+ source.content = code;
208
+ await extensions.space?.db.flush();
209
+
210
+ return ToolResult.Success({
211
+ name: script.name,
212
+ });
213
+ },
214
+ }),
215
+ ],
216
+ });
217
+
218
+ return contributes(Capabilities.ArtifactDefinition, definition);
219
+ };
@@ -6,9 +6,9 @@
6
6
  import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
7
7
 
8
8
  import { contributes } from '@dxos/app-framework';
9
+ import { initializeBundler } from '@dxos/functions/bundler';
9
10
 
10
11
  import { ScriptCapabilities } from './capabilities';
11
- import { initializeBundler } from '../bundler';
12
12
  import { Compiler } from '../compiler';
13
13
 
14
14
  export default async () => {
@@ -8,5 +8,6 @@ export const Compiler = lazy(() => import('./compiler'));
8
8
  export const IntentResolver = lazy(() => import('./intent-resolver'));
9
9
  export const ReactSurface = lazy(() => import('./react-surface'));
10
10
  export const ScriptSettings = lazy(() => import('./settings'));
11
+ export const ArtifactDefinition = lazy(() => import('./artifact-definition'));
11
12
 
12
13
  export * from './capabilities';
@@ -29,7 +29,8 @@ export default () =>
29
29
  filter: (data): data is { subject: ScriptType } => data.subject instanceof ScriptType,
30
30
  component: ({ data, role }) => {
31
31
  const compiler = useCapability(ScriptCapabilities.Compiler);
32
- const settings = useCapability(Capabilities.SettingsStore).getStore<ScriptSettingsProps>(SCRIPT_PLUGIN)!.value;
32
+ // TODO(dmaretskyi): Since settings store is not reactive, this would break on the script plugin being enabled without a page reload.
33
+ const settings = useCapability(Capabilities.SettingsStore).getStore<ScriptSettingsProps>(SCRIPT_PLUGIN)?.value;
33
34
  return <ScriptContainer role={role} script={data.subject} settings={settings} env={compiler.environment} />;
34
35
  },
35
36
  }),
@@ -12,7 +12,7 @@ describe('Compiler', () => {
12
12
  await compiler.initialize();
13
13
  compiler.setFile('/src/x.ts', 'export const x = 100');
14
14
  compiler.setFile('/src/y.ts', 'import { x } from "./x"; export const y = x + 100;');
15
- const result = await compiler.compile('/src/y.ts');
15
+ const result = compiler.compile('/src/y.ts');
16
16
  expect(result).to.exist;
17
17
  });
18
18
  });
@@ -7,7 +7,7 @@ import React, { forwardRef, useEffect, useRef, useState } from 'react';
7
7
  import { log } from '@dxos/log';
8
8
  import { Avatar, Icon, Input, type ThemedClassName, Toolbar, useTranslation } from '@dxos/react-ui';
9
9
  import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
10
- import { mx } from '@dxos/react-ui-theme';
10
+ import { errorText, mx } from '@dxos/react-ui-theme';
11
11
 
12
12
  import { SCRIPT_PLUGIN } from '../../meta';
13
13
 
@@ -232,7 +232,7 @@ const MessageItem = ({ classNames, message }: ThemedClassName<{ message: Message
232
232
  const wrapper = 'p-1 px-2 rounded-lg bg-hoverSurface overflow-auto';
233
233
  return (
234
234
  <div className={mx('flex', type === 'request' ? 'ml-[1rem] justify-end' : 'mr-[1rem]', classNames)}>
235
- {error && <div className={mx(wrapper, 'whitespace-pre text-error')}>{String(error)}</div>}
235
+ {error && <div className={mx(wrapper, 'whitespace-pre', errorText)}>{String(error)}</div>}
236
236
 
237
237
  {text !== undefined && (
238
238
  <div className={mx(wrapper, type === 'request' && 'bg-primary-400 dark:bg-primary-600')}>
@@ -5,17 +5,17 @@
5
5
  import React, { useEffect, useRef } from 'react';
6
6
 
7
7
  import { clientServiceBundle } from '@dxos/client-protocol';
8
+ import { type BundleResult } from '@dxos/functions/bundler';
9
+ import { invariant } from '@dxos/invariant';
8
10
  import { log } from '@dxos/log';
9
11
  import { useClient } from '@dxos/react-client';
10
12
  import { baseSurface, mx } from '@dxos/react-ui-theme';
11
13
  import { createProtoRpcPeer } from '@dxos/rpc';
12
14
  import { createIFramePort } from '@dxos/rpc-tunnel';
13
15
 
14
- import { type BundlerResult } from '../../bundler';
15
-
16
16
  export type FrameContainerProps = {
17
17
  containerUrl: string;
18
- result: BundlerResult;
18
+ result: BundleResult;
19
19
  debug?: boolean;
20
20
  };
21
21
 
@@ -46,6 +46,7 @@ export const FrameContainer = ({ containerUrl, result, debug = true }: FrameCont
46
46
  }, [iframeRef]);
47
47
 
48
48
  // Encodes compiled code via URL.
49
+ invariant(result.sourceHash, 'Source hash is required.');
49
50
  const sourceHash = Buffer.from(result.sourceHash).toString('hex');
50
51
  const src = result.bundle && `${containerUrl}?ts=${sourceHash}#code=${encodeURIComponent(result.bundle)}`;
51
52
 
@@ -58,7 +59,7 @@ export const FrameContainer = ({ containerUrl, result, debug = true }: FrameCont
58
59
  <div
59
60
  className={mx(
60
61
  baseSurface,
61
- 'flex absolute right-2 bottom-2 w-[400px] h-[200px] ring rounded',
62
+ 'flex absolute right-2 bottom-2 w-[30rem] h-[200px] ring rounded',
62
63
  'z-20 overflow-x-hidden overflow-y-auto',
63
64
  )}
64
65
  >
@@ -14,19 +14,24 @@ import { mx } from '@dxos/react-ui-theme';
14
14
 
15
15
  import { DebugPanel } from './DebugPanel';
16
16
  import { ScriptToolbar } from './ScriptToolbar';
17
- import { useDeployState } from './ScriptToolbar/deploy';
18
- import { useToolbarState } from './ScriptToolbar/useToolbarState';
19
17
  import { TypescriptEditor, type TypescriptEditorProps } from './TypescriptEditor';
18
+ import { useDeployState, useToolbarState } from '../hooks';
20
19
  import { type ScriptSettingsProps } from '../types';
21
20
 
22
21
  export type ScriptEditorProps = ThemedClassName<{
23
22
  script: ScriptType;
24
- settings: ScriptSettingsProps;
23
+ settings?: ScriptSettingsProps;
25
24
  role?: string;
26
25
  }> &
27
26
  Pick<TypescriptEditorProps, 'env'>;
28
27
 
29
- export const ScriptContainer = ({ role, classNames, script, settings, env }: ScriptEditorProps) => {
28
+ export const ScriptContainer = ({
29
+ role,
30
+ classNames,
31
+ script,
32
+ settings = { editorInputMode: 'vscode' },
33
+ env,
34
+ }: ScriptEditorProps) => {
30
35
  const identity = useIdentity();
31
36
  const space = getSpace(script);
32
37
 
@@ -49,7 +54,7 @@ export const ScriptContainer = ({ role, classNames, script, settings, env }: Scr
49
54
  [script, script.source.target, space, identity],
50
55
  );
51
56
 
52
- const state = useToolbarState({ view: 'split' });
57
+ const state = useToolbarState({ view: 'editor' });
53
58
  useDeployState({ state, script });
54
59
 
55
60
  return (
@@ -10,7 +10,7 @@ import { FunctionType, type ScriptType, getInvocationUrl, getUserFunctionUrlInMe
10
10
  import { log } from '@dxos/log';
11
11
  import { useClient } from '@dxos/react-client';
12
12
  import { Filter, getMeta, getSpace, useQuery } from '@dxos/react-client/echo';
13
- import { Button, Clipboard, Input, Separator, useControlledValue, useTranslation } from '@dxos/react-ui';
13
+ import { Button, Clipboard, Input, Separator, useControlledState, useTranslation } from '@dxos/react-ui';
14
14
  import { AccessTokenType } from '@dxos/schema';
15
15
 
16
16
  import { SCRIPT_PLUGIN } from '../meta';
@@ -57,7 +57,7 @@ export const ScriptSettingsPanel = ({ script }: ScriptSettingsPanelProps) => {
57
57
  return () => clearTimeout(timeout);
58
58
  }, [githubToken, gistKey]);
59
59
 
60
- const [binding, setBinding] = useControlledValue(fn?.binding ?? '');
60
+ const [binding, setBinding] = useControlledState(fn?.binding ?? '');
61
61
  const handleBindingChange = useCallback(
62
62
  (event: ChangeEvent<HTMLInputElement>) => {
63
63
  setBinding(event.target.value);
@@ -114,6 +114,20 @@ export const ScriptSettingsPanel = ({ script }: ScriptSettingsPanelProps) => {
114
114
 
115
115
  return (
116
116
  <>
117
+ <div role='form' className='flex flex-col w-full p-2 gap-4'>
118
+ <Input.Root>
119
+ <div role='none' className='flex flex-col gap-1'>
120
+ <Input.Label>{t('description label')}</Input.Label>
121
+ <Input.TextInput
122
+ placeholder={t('description placeholder')}
123
+ value={script.description ?? ''}
124
+ onChange={(event) => {
125
+ script.description = event.target.value;
126
+ }}
127
+ />
128
+ </div>
129
+ </Input.Root>
130
+ </div>
117
131
  {fn && functionUrl && (
118
132
  <>
119
133
  <Separator />
@@ -10,12 +10,14 @@ import { ElevationProvider, type ThemedClassName } from '@dxos/react-ui';
10
10
  import { stackItemContentToolbarClassNames } from '@dxos/react-ui-editor';
11
11
  import { createGapSeparator, MenuProvider, ToolbarMenu, useMenuActions } from '@dxos/react-ui-menu';
12
12
 
13
- import { createDeploy } from './deploy';
14
- import { createFormat } from './format';
15
- import { createTemplateSelect } from './templateSelect';
16
- import { useToolbarAction } from './useToolbarAction';
17
- import { type ScriptToolbarState } from './useToolbarState';
18
- import { createView } from './view';
13
+ import {
14
+ type ScriptToolbarState,
15
+ createDeploy,
16
+ createFormat,
17
+ createTemplateSelect,
18
+ createView,
19
+ useToolbarAction,
20
+ } from '../../hooks';
19
21
 
20
22
  export type ScriptToolbarProps = ThemedClassName<{
21
23
  role?: string;
@@ -27,7 +27,7 @@ import {
27
27
  useTextEditor,
28
28
  type UseTextEditorProps,
29
29
  } from '@dxos/react-ui-editor';
30
- import { nonNullable } from '@dxos/util';
30
+ import { isNonNullable } from '@dxos/util';
31
31
 
32
32
  export type TypescriptEditorProps = {
33
33
  id: string;
@@ -94,7 +94,7 @@ export const TypescriptEditor = ({
94
94
  ]
95
95
  : [],
96
96
  ],
97
- ].filter(nonNullable),
97
+ ].filter(isNonNullable),
98
98
  selection,
99
99
  scrollTo,
100
100
  }),
package/src/events.ts ADDED
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { defineEvent } from '@dxos/app-framework';
6
+
7
+ import { SCRIPT_PLUGIN } from './meta';
8
+
9
+ export namespace ScriptEvents {
10
+ export const SetupCompiler = defineEvent(`${SCRIPT_PLUGIN}/event/setup-compiler`);
11
+ }
@@ -6,13 +6,14 @@ import { useCallback, useEffect, useMemo } from 'react';
6
6
 
7
7
  import {
8
8
  FunctionType,
9
+ type ScriptType,
9
10
  getInvocationUrl,
10
11
  getUserFunctionUrlInMetadata,
11
12
  incrementSemverPatch,
12
- type ScriptType,
13
13
  setUserFunctionUrlInMetadata,
14
14
  uploadWorkerFunction,
15
15
  } from '@dxos/functions';
16
+ import { Bundler } from '@dxos/functions/bundler';
16
17
  import { log } from '@dxos/log';
17
18
  import { useClient } from '@dxos/react-client';
18
19
  import { Filter, create, getMeta, getSpace, makeRef, useQuery } from '@dxos/react-client/echo';
@@ -20,8 +21,7 @@ import { useTranslation } from '@dxos/react-ui';
20
21
  import { createMenuAction } from '@dxos/react-ui-menu';
21
22
 
22
23
  import { type ViewState } from './view';
23
- import { Bundler } from '../../bundler';
24
- import { SCRIPT_PLUGIN } from '../../meta';
24
+ import { SCRIPT_PLUGIN } from '../meta';
25
25
 
26
26
  export type DeployActionProperties = { type: 'deploy' } | { type: 'copy' };
27
27
 
@@ -105,7 +105,7 @@ export const useDeployHandler = ({ state, script }: { state: Partial<DeployState
105
105
  const existingFunctionId = existingFunctionUrl?.split('/').at(-1);
106
106
 
107
107
  const bundler = new Bundler({ platform: 'browser', sandboxedModules: [], remoteModules: {} });
108
- const buildResult = await bundler.bundle(script.source.target!.content);
108
+ const buildResult = await bundler.bundle({ source: script.source.target!.content });
109
109
  if (buildResult.error || !buildResult.bundle) {
110
110
  throw buildResult.error;
111
111
  }
@@ -130,12 +130,24 @@ export const useDeployHandler = ({ state, script }: { state: Partial<DeployState
130
130
  fn ?? space.db.add(create(FunctionType, { name: functionId, version, source: makeRef(script) }));
131
131
 
132
132
  script.changed = false;
133
+ if (script.description !== undefined && script.description.trim() !== '') {
134
+ deployedFunction.description = script.description;
135
+ } else if (meta.description) {
136
+ deployedFunction.description = meta.description;
137
+ } else {
138
+ log.verbose('no description in function metadata', { functionId });
139
+ }
133
140
 
134
141
  if (meta.inputSchema) {
135
142
  deployedFunction.inputSchema = meta.inputSchema;
136
143
  } else {
137
144
  log.verbose('no input schema in function metadata', { functionId });
138
145
  }
146
+ if (meta.outputSchema) {
147
+ deployedFunction.outputSchema = meta.outputSchema;
148
+ } else {
149
+ log.verbose('no output schema in function metadata', { functionId });
150
+ }
139
151
 
140
152
  setUserFunctionUrlInMetadata(getMeta(deployedFunction), `/${space.id}/${functionId}`);
141
153
 
@@ -11,7 +11,7 @@ import { type ScriptType } from '@dxos/functions';
11
11
  import { log } from '@dxos/log';
12
12
  import { createMenuAction } from '@dxos/react-ui-menu';
13
13
 
14
- import { SCRIPT_PLUGIN } from '../../meta';
14
+ import { SCRIPT_PLUGIN } from '../meta';
15
15
 
16
16
  export type FormatActionProperties = { type: 'format' };
17
17
 
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './deploy';
6
+ export * from './format';
7
+ export * from './template';
8
+ export * from './view';
9
+
10
+ export * from './useToolbarAction';
11
+ export * from './useToolbarState';
@@ -8,8 +8,8 @@ import { FUNCTIONS_PRESET_META_KEY, type ScriptType } from '@dxos/functions';
8
8
  import { getMeta } from '@dxos/live-object';
9
9
  import { createMenuItemGroup, createMenuAction } from '@dxos/react-ui-menu';
10
10
 
11
- import { SCRIPT_PLUGIN } from '../../meta';
12
- import { templates } from '../../templates';
11
+ import { SCRIPT_PLUGIN } from '../meta';
12
+ import { templates } from '../templates';
13
13
 
14
14
  export type TemplateActionProperties = { type: 'template'; value: string };
15
15
 
@@ -10,7 +10,7 @@ import { type MenuAction, type MenuActionHandler } from '@dxos/react-ui-menu';
10
10
 
11
11
  import { type DeployActionProperties, useDeployHandler, useCopyHandler } from './deploy';
12
12
  import { type FormatActionProperties, useFormatHandler } from './format';
13
- import { type TemplateActionProperties, useTemplateSelectHandler } from './templateSelect';
13
+ import { type TemplateActionProperties, useTemplateSelectHandler } from './template';
14
14
  import { type ScriptToolbarState } from './useToolbarState';
15
15
  import { type ViewActionProperties } from './view';
16
16
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { createMenuAction, createMenuItemGroup } from '@dxos/react-ui-menu';
6
6
 
7
- import { SCRIPT_PLUGIN } from '../../meta';
7
+ import { SCRIPT_PLUGIN } from '../meta';
8
8
 
9
9
  export type ViewType = 'editor' | 'split' | 'debug';
10
10
 
package/src/index.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './bundler';
6
5
  export { ScriptCapabilities } from './capabilities';
7
6
  export * from './components';
8
7
  export * from './meta';
package/src/meta.ts CHANGED
@@ -9,7 +9,8 @@ export const SCRIPT_PLUGIN = 'dxos.org/plugin/script';
9
9
  export const meta = {
10
10
  id: SCRIPT_PLUGIN,
11
11
  name: 'Scripts',
12
- description: `Scripts in Composer allow you to deploy custom functions that run on the edge. These functions can be referenced by your AI agent and called inside of cells in any Sheet. Use scripts to interact with API’s or external data inside of Composer.`,
12
+ description:
13
+ 'Scripts in Composer allow you to deploy custom functions that run on the edge. These functions can be referenced by your AI agent and called inside of cells in any Sheet. Use scripts to interact with API’s or external data inside of Composer.',
13
14
  icon: 'ph--code--regular',
14
15
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-explorer',
15
16
  tags: ['experimental'],