@dxos/plugin-script 0.8.4-main.c1de068 → 0.8.4-main.fd6878d

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 (119) hide show
  1. package/dist/lib/browser/{DeploymentDialog-M4QIHTDR.mjs → DeploymentDialog-C3XH2Z56.mjs} +3 -3
  2. package/dist/lib/browser/{ScriptContainer-Z6SIGRRC.mjs → ScriptContainer-FUBR4OZE.mjs} +8 -7
  3. package/dist/lib/browser/ScriptContainer-FUBR4OZE.mjs.map +7 -0
  4. package/dist/lib/browser/{app-graph-builder-HLQ7K3BT.mjs → app-graph-builder-IABOSTBK.mjs} +2 -2
  5. package/dist/lib/{node-esm/app-graph-builder-7EYIHWH4.mjs.map → browser/app-graph-builder-IABOSTBK.mjs.map} +3 -3
  6. package/dist/lib/browser/{chunk-R4R7VOFY.mjs → chunk-G4A2MGAL.mjs} +7 -7
  7. package/dist/lib/browser/chunk-G4A2MGAL.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-3U6DTUH3.mjs → chunk-MWZDJNCQ.mjs} +5 -5
  9. package/dist/lib/browser/{chunk-3U6DTUH3.mjs.map → chunk-MWZDJNCQ.mjs.map} +3 -3
  10. package/dist/lib/browser/{chunk-P4HQKUCP.mjs → chunk-OAVS36Q3.mjs} +3 -3
  11. package/dist/lib/browser/chunk-OAVS36Q3.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-FIM2MVNJ.mjs → chunk-OULPWKXN.mjs} +6 -6
  13. package/dist/lib/browser/{chunk-FIM2MVNJ.mjs.map → chunk-OULPWKXN.mjs.map} +3 -3
  14. package/dist/lib/browser/{chunk-FMDXKOP7.mjs → chunk-SUOLJH55.mjs} +1 -1
  15. package/dist/lib/browser/{chunk-FMDXKOP7.mjs.map → chunk-SUOLJH55.mjs.map} +2 -2
  16. package/dist/lib/browser/{compiler-CXCUA4UQ.mjs → compiler-RIWQVBPX.mjs} +4 -1
  17. package/dist/lib/browser/compiler-RIWQVBPX.mjs.map +7 -0
  18. package/dist/lib/browser/index.mjs +13 -19
  19. package/dist/lib/browser/index.mjs.map +3 -3
  20. package/dist/lib/browser/{intent-resolver-7B77IG3N.mjs → intent-resolver-SAL2TM7U.mjs} +8 -10
  21. package/dist/lib/browser/intent-resolver-SAL2TM7U.mjs.map +7 -0
  22. package/dist/lib/browser/meta.json +1 -1
  23. package/dist/lib/browser/{react-surface-FYYXZA7C.mjs → react-surface-E3SXU6ON.mjs} +9 -9
  24. package/dist/lib/browser/react-surface-E3SXU6ON.mjs.map +7 -0
  25. package/dist/lib/browser/templates/index.mjs +1 -1
  26. package/dist/lib/node-esm/{DeploymentDialog-3KPRWFE7.mjs → DeploymentDialog-O2XZVRLU.mjs} +3 -3
  27. package/dist/lib/node-esm/{ScriptContainer-KPU75HHI.mjs → ScriptContainer-VJ75TM24.mjs} +8 -7
  28. package/dist/lib/node-esm/ScriptContainer-VJ75TM24.mjs.map +7 -0
  29. package/dist/lib/node-esm/{app-graph-builder-7EYIHWH4.mjs → app-graph-builder-CQTTAYHP.mjs} +2 -2
  30. package/dist/lib/{browser/app-graph-builder-HLQ7K3BT.mjs.map → node-esm/app-graph-builder-CQTTAYHP.mjs.map} +3 -3
  31. package/dist/lib/node-esm/{chunk-F5GFJ3PY.mjs → chunk-3BBEM2U7.mjs} +7 -7
  32. package/dist/lib/node-esm/chunk-3BBEM2U7.mjs.map +7 -0
  33. package/dist/lib/node-esm/{chunk-7NMI4CEU.mjs → chunk-6WMFL3JL.mjs} +6 -6
  34. package/dist/lib/node-esm/{chunk-7NMI4CEU.mjs.map → chunk-6WMFL3JL.mjs.map} +3 -3
  35. package/dist/lib/node-esm/{chunk-RT43MACC.mjs → chunk-7L4JDSXJ.mjs} +5 -5
  36. package/dist/lib/node-esm/{chunk-RT43MACC.mjs.map → chunk-7L4JDSXJ.mjs.map} +3 -3
  37. package/dist/lib/node-esm/{chunk-QKK3NDHW.mjs → chunk-IO6T72KY.mjs} +3 -3
  38. package/dist/lib/node-esm/chunk-IO6T72KY.mjs.map +7 -0
  39. package/dist/lib/node-esm/{chunk-XJPK3IYI.mjs → chunk-PACUN7RS.mjs} +1 -1
  40. package/dist/lib/node-esm/{chunk-XJPK3IYI.mjs.map → chunk-PACUN7RS.mjs.map} +2 -2
  41. package/dist/lib/node-esm/{compiler-EPFKQXPE.mjs → compiler-S52P5P3F.mjs} +4 -1
  42. package/dist/lib/node-esm/compiler-S52P5P3F.mjs.map +7 -0
  43. package/dist/lib/node-esm/index.mjs +13 -19
  44. package/dist/lib/node-esm/index.mjs.map +3 -3
  45. package/dist/lib/node-esm/{intent-resolver-FRZGS4TB.mjs → intent-resolver-GO53JOPL.mjs} +8 -10
  46. package/dist/lib/node-esm/intent-resolver-GO53JOPL.mjs.map +7 -0
  47. package/dist/lib/node-esm/meta.json +1 -1
  48. package/dist/lib/node-esm/{react-surface-V32NWHKN.mjs → react-surface-W3NRCS5O.mjs} +9 -9
  49. package/dist/lib/node-esm/react-surface-W3NRCS5O.mjs.map +7 -0
  50. package/dist/lib/node-esm/templates/index.mjs +1 -1
  51. package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
  52. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/artifact-definition.d.ts +1 -1
  54. package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
  56. package/dist/types/src/capabilities/index.d.ts +0 -1
  57. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  59. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  60. package/dist/types/src/compiler/compiler.d.ts.map +1 -1
  61. package/dist/types/src/components/DeploymentDialog/index.d.ts +1 -1
  62. package/dist/types/src/components/DeploymentDialog/index.d.ts.map +1 -1
  63. package/dist/types/src/components/ScriptContainer.d.ts +1 -1
  64. package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
  65. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  66. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
  67. package/dist/types/src/components/TestPanel/TestContainer.d.ts.map +1 -1
  68. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
  69. package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
  70. package/dist/types/src/hooks/deploy.d.ts +2 -2
  71. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  72. package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
  73. package/dist/types/src/templates/data-generator.d.ts.map +1 -1
  74. package/dist/types/tsconfig.tsbuildinfo +1 -1
  75. package/package.json +56 -53
  76. package/src/ScriptPlugin.tsx +2 -14
  77. package/src/capabilities/app-graph-builder.ts +2 -2
  78. package/src/capabilities/artifact-definition.ts +7 -11
  79. package/src/capabilities/compiler.ts +2 -1
  80. package/src/capabilities/index.ts +0 -1
  81. package/src/capabilities/intent-resolver.ts +2 -5
  82. package/src/capabilities/react-surface.tsx +3 -2
  83. package/src/compiler/compiler.ts +1 -1
  84. package/src/components/DeploymentDialog/DeploymentDialog.tsx +4 -4
  85. package/src/components/DeploymentDialog/index.ts +1 -1
  86. package/src/components/ScriptContainer.tsx +3 -2
  87. package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +2 -1
  88. package/src/components/ScriptToolbar/ScriptToolbar.tsx +2 -2
  89. package/src/components/Settings/ScriptObjectSettings.tsx +2 -2
  90. package/src/components/TestPanel/TestContainer.tsx +2 -1
  91. package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +2 -1
  92. package/src/components/TypescriptEditor/TypescriptEditor.tsx +3 -2
  93. package/src/hooks/deploy.ts +1 -1
  94. package/src/hooks/template.ts +1 -1
  95. package/src/hooks/useCreateAndDeployScriptTemplates.ts +1 -0
  96. package/src/templates/chess.ts +1 -1
  97. package/src/templates/data-generator.ts +7 -3
  98. package/src/templates/discord.ts +2 -2
  99. package/src/templates/forex-effect.ts +1 -1
  100. package/src/templates/forex.ts +1 -1
  101. package/src/templates/gmail.ts +3 -3
  102. package/dist/lib/browser/ScriptContainer-Z6SIGRRC.mjs.map +0 -7
  103. package/dist/lib/browser/artifact-definition-24Q3IHOU.mjs +0 -249
  104. package/dist/lib/browser/artifact-definition-24Q3IHOU.mjs.map +0 -7
  105. package/dist/lib/browser/chunk-P4HQKUCP.mjs.map +0 -7
  106. package/dist/lib/browser/chunk-R4R7VOFY.mjs.map +0 -7
  107. package/dist/lib/browser/compiler-CXCUA4UQ.mjs.map +0 -7
  108. package/dist/lib/browser/intent-resolver-7B77IG3N.mjs.map +0 -7
  109. package/dist/lib/browser/react-surface-FYYXZA7C.mjs.map +0 -7
  110. package/dist/lib/node-esm/ScriptContainer-KPU75HHI.mjs.map +0 -7
  111. package/dist/lib/node-esm/artifact-definition-WAJFALUI.mjs +0 -250
  112. package/dist/lib/node-esm/artifact-definition-WAJFALUI.mjs.map +0 -7
  113. package/dist/lib/node-esm/chunk-F5GFJ3PY.mjs.map +0 -7
  114. package/dist/lib/node-esm/chunk-QKK3NDHW.mjs.map +0 -7
  115. package/dist/lib/node-esm/compiler-EPFKQXPE.mjs.map +0 -7
  116. package/dist/lib/node-esm/intent-resolver-FRZGS4TB.mjs.map +0 -7
  117. package/dist/lib/node-esm/react-surface-V32NWHKN.mjs.map +0 -7
  118. /package/dist/lib/browser/{DeploymentDialog-M4QIHTDR.mjs.map → DeploymentDialog-C3XH2Z56.mjs.map} +0 -0
  119. /package/dist/lib/node-esm/{DeploymentDialog-3KPRWFE7.mjs.map → DeploymentDialog-O2XZVRLU.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-script",
3
- "version": "0.8.4-main.c1de068",
3
+ "version": "0.8.4-main.fd6878d",
4
4
  "description": "Braneframe notebook plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,16 +10,19 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
+ "source": "./src/index.ts",
13
14
  "types": "./dist/types/src/index.d.ts",
14
15
  "browser": "./dist/lib/browser/index.mjs",
15
16
  "node": "./dist/lib/node-esm/index.mjs"
16
17
  },
17
18
  "./types": {
19
+ "source": "./src/types/index.ts",
18
20
  "types": "./dist/types/src/types/index.d.ts",
19
21
  "browser": "./dist/lib/browser/types/index.mjs",
20
22
  "node": "./dist/lib/node-esm/types/index.mjs"
21
23
  },
22
24
  "./templates": {
25
+ "source": "./src/templates/index.ts",
23
26
  "types": "./dist/types/src/templates/index.d.ts",
24
27
  "browser": "./dist/lib/browser/templates/index.mjs",
25
28
  "node": "./dist/lib/node-esm/templates/index.mjs"
@@ -60,64 +63,64 @@
60
63
  "date-fns": "^3.3.1",
61
64
  "esbuild-wasm": "^0.16.14",
62
65
  "prettier": "^3.6.2",
63
- "react-syntax-highlighter": "^15.5.0",
64
- "typescript": "^5.8.3",
65
- "@dxos/ai": "0.8.4-main.c1de068",
66
- "@dxos/app-framework": "0.8.4-main.c1de068",
67
- "@dxos/assistant": "0.8.4-main.c1de068",
68
- "@dxos/async": "0.8.4-main.c1de068",
69
- "@dxos/client": "0.8.4-main.c1de068",
70
- "@dxos/blueprints": "0.8.4-main.c1de068",
71
- "@dxos/compute": "0.8.4-main.c1de068",
72
- "@dxos/debug": "0.8.4-main.c1de068",
73
- "@dxos/client-protocol": "0.8.4-main.c1de068",
74
- "@dxos/devtools": "0.8.4-main.c1de068",
75
- "@dxos/echo": "0.8.4-main.c1de068",
76
- "@dxos/echo-protocol": "0.8.4-main.c1de068",
77
- "@dxos/echo-schema": "0.8.4-main.c1de068",
78
- "@dxos/functions": "0.8.4-main.c1de068",
79
- "@dxos/invariant": "0.8.4-main.c1de068",
80
- "@dxos/keys": "0.8.4-main.c1de068",
81
- "@dxos/live-object": "0.8.4-main.c1de068",
82
- "@dxos/plugin-client": "0.8.4-main.c1de068",
83
- "@dxos/log": "0.8.4-main.c1de068",
84
- "@dxos/local-storage": "0.8.4-main.c1de068",
85
- "@dxos/plugin-deck": "0.8.4-main.c1de068",
86
- "@dxos/plugin-explorer": "0.8.4-main.c1de068",
87
- "@dxos/plugin-graph": "0.8.4-main.c1de068",
88
- "@dxos/plugin-markdown": "0.8.4-main.c1de068",
89
- "@dxos/plugin-space": "0.8.4-main.c1de068",
90
- "@dxos/plugin-stack": "0.8.4-main.c1de068",
91
- "@dxos/plugin-theme": "0.8.4-main.c1de068",
92
- "@dxos/plugin-token-manager": "0.8.4-main.c1de068",
93
- "@dxos/protocols": "0.8.4-main.c1de068",
94
- "@dxos/react-edge-client": "0.8.4-main.c1de068",
95
- "@dxos/react-client": "0.8.4-main.c1de068",
96
- "@dxos/react-ui-attention": "0.8.4-main.c1de068",
97
- "@dxos/react-ui-editor": "0.8.4-main.c1de068",
98
- "@dxos/react-ui-list": "0.8.4-main.c1de068",
99
- "@dxos/react-ui-form": "0.8.4-main.c1de068",
100
- "@dxos/react-ui-menu": "0.8.4-main.c1de068",
101
- "@dxos/react-ui-stack": "0.8.4-main.c1de068",
102
- "@dxos/react-ui-syntax-highlighter": "0.8.4-main.c1de068",
103
- "@dxos/util": "0.8.4-main.c1de068",
104
- "@dxos/rpc": "0.8.4-main.c1de068",
105
- "@dxos/rpc-tunnel": "0.8.4-main.c1de068",
106
- "@dxos/schema": "0.8.4-main.c1de068"
66
+ "react-syntax-highlighter": "^15.6.1",
67
+ "typescript": "^5.9.2",
68
+ "@dxos/ai": "0.8.4-main.fd6878d",
69
+ "@dxos/app-framework": "0.8.4-main.fd6878d",
70
+ "@dxos/assistant": "0.8.4-main.fd6878d",
71
+ "@dxos/async": "0.8.4-main.fd6878d",
72
+ "@dxos/blueprints": "0.8.4-main.fd6878d",
73
+ "@dxos/client": "0.8.4-main.fd6878d",
74
+ "@dxos/client-protocol": "0.8.4-main.fd6878d",
75
+ "@dxos/compute": "0.8.4-main.fd6878d",
76
+ "@dxos/debug": "0.8.4-main.fd6878d",
77
+ "@dxos/devtools": "0.8.4-main.fd6878d",
78
+ "@dxos/echo-protocol": "0.8.4-main.fd6878d",
79
+ "@dxos/echo": "0.8.4-main.fd6878d",
80
+ "@dxos/echo-schema": "0.8.4-main.fd6878d",
81
+ "@dxos/functions": "0.8.4-main.fd6878d",
82
+ "@dxos/invariant": "0.8.4-main.fd6878d",
83
+ "@dxos/keys": "0.8.4-main.fd6878d",
84
+ "@dxos/live-object": "0.8.4-main.fd6878d",
85
+ "@dxos/local-storage": "0.8.4-main.fd6878d",
86
+ "@dxos/log": "0.8.4-main.fd6878d",
87
+ "@dxos/plugin-deck": "0.8.4-main.fd6878d",
88
+ "@dxos/plugin-explorer": "0.8.4-main.fd6878d",
89
+ "@dxos/plugin-graph": "0.8.4-main.fd6878d",
90
+ "@dxos/plugin-client": "0.8.4-main.fd6878d",
91
+ "@dxos/plugin-space": "0.8.4-main.fd6878d",
92
+ "@dxos/plugin-markdown": "0.8.4-main.fd6878d",
93
+ "@dxos/plugin-stack": "0.8.4-main.fd6878d",
94
+ "@dxos/plugin-token-manager": "0.8.4-main.fd6878d",
95
+ "@dxos/protocols": "0.8.4-main.fd6878d",
96
+ "@dxos/plugin-theme": "0.8.4-main.fd6878d",
97
+ "@dxos/react-client": "0.8.4-main.fd6878d",
98
+ "@dxos/react-edge-client": "0.8.4-main.fd6878d",
99
+ "@dxos/react-ui-attention": "0.8.4-main.fd6878d",
100
+ "@dxos/react-ui-editor": "0.8.4-main.fd6878d",
101
+ "@dxos/react-ui-form": "0.8.4-main.fd6878d",
102
+ "@dxos/react-ui-list": "0.8.4-main.fd6878d",
103
+ "@dxos/react-ui-menu": "0.8.4-main.fd6878d",
104
+ "@dxos/react-ui-stack": "0.8.4-main.fd6878d",
105
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-main.fd6878d",
106
+ "@dxos/rpc": "0.8.4-main.fd6878d",
107
+ "@dxos/schema": "0.8.4-main.fd6878d",
108
+ "@dxos/util": "0.8.4-main.fd6878d",
109
+ "@dxos/rpc-tunnel": "0.8.4-main.fd6878d"
107
110
  },
108
111
  "devDependencies": {
109
112
  "@effect-rx/rx-react": "0.38.0",
110
- "@effect/platform": "0.89.0",
113
+ "@effect/platform": "0.90.2",
111
114
  "@types/react": "~18.2.0",
112
115
  "@types/react-dom": "~18.2.0",
113
- "effect": "3.17.0",
116
+ "effect": "3.17.7",
114
117
  "react": "~18.2.0",
115
118
  "react-dom": "~18.2.0",
116
119
  "vite": "5.4.7",
117
- "@dxos/random": "0.8.4-main.c1de068",
118
- "@dxos/react-ui-theme": "0.8.4-main.c1de068",
119
- "@dxos/react-ui": "0.8.4-main.c1de068",
120
- "@dxos/storybook-utils": "0.8.4-main.c1de068"
120
+ "@dxos/react-ui": "0.8.4-main.fd6878d",
121
+ "@dxos/random": "0.8.4-main.fd6878d",
122
+ "@dxos/react-ui-theme": "0.8.4-main.fd6878d",
123
+ "@dxos/storybook-utils": "0.8.4-main.fd6878d"
121
124
  },
122
125
  "peerDependencies": {
123
126
  "@effect-rx/rx-react": "^0.34.1",
@@ -125,8 +128,8 @@
125
128
  "effect": "^3.13.3",
126
129
  "react": "~18.2.0",
127
130
  "react-dom": "~18.2.0",
128
- "@dxos/react-ui": "0.8.4-main.c1de068",
129
- "@dxos/react-ui-theme": "0.8.4-main.c1de068"
131
+ "@dxos/react-ui": "0.8.4-main.fd6878d",
132
+ "@dxos/react-ui-theme": "0.8.4-main.fd6878d"
130
133
  },
131
134
  "publishConfig": {
132
135
  "access": "public"
@@ -4,21 +4,14 @@
4
4
 
5
5
  import { Schema } from 'effect';
6
6
 
7
- import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
7
+ import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
8
8
  import { Ref } from '@dxos/echo';
9
9
  import { ScriptType } from '@dxos/functions';
10
10
  import { ClientEvents } from '@dxos/plugin-client';
11
11
  import { SpaceCapabilities } from '@dxos/plugin-space';
12
12
  import { defineObjectForm } from '@dxos/plugin-space/types';
13
13
 
14
- import {
15
- AppGraphBuilder,
16
- ArtifactDefinition,
17
- Compiler,
18
- IntentResolver,
19
- ReactSurface,
20
- ScriptSettings,
21
- } from './capabilities';
14
+ import { AppGraphBuilder, Compiler, IntentResolver, ReactSurface, ScriptSettings } from './capabilities';
22
15
  import { ScriptEvents } from './events';
23
16
  import { meta } from './meta';
24
17
  import { translations } from './translations';
@@ -84,9 +77,4 @@ export const ScriptPlugin = () =>
84
77
  activatesOn: Events.SetupIntentResolver,
85
78
  activate: IntentResolver,
86
79
  }),
87
- defineModule({
88
- id: `${meta.id}/module/artifact-definition`,
89
- activatesOn: Events.SetupArtifactDefinition,
90
- activate: ArtifactDefinition,
91
- }),
92
80
  ]);
@@ -5,10 +5,10 @@
5
5
  import { Rx } from '@effect-rx/rx-react';
6
6
  import { Option, pipe } from 'effect';
7
7
 
8
- import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
8
+ import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
9
9
  import { Obj } from '@dxos/echo';
10
10
  import { ScriptType } from '@dxos/functions';
11
- import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
11
+ import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
12
12
  import { createExtension } from '@dxos/plugin-graph';
13
13
 
14
14
  import { meta } from '../meta';
@@ -2,11 +2,14 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ // ISSUE(burdon): defineArtifact
6
+ // @ts-nocheck
7
+
5
8
  import { Schema } from 'effect';
6
9
 
7
- import { createTool, ToolResult } from '@dxos/ai';
8
- import { Capabilities, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
9
- import { createArtifactElement, ArtifactId } from '@dxos/assistant';
10
+ import { ToolResult, createTool } from '@dxos/ai';
11
+ import { Capabilities, type PromiseIntentDispatcher, contributes, createIntent } from '@dxos/app-framework';
12
+ import { ArtifactId, createArtifactElement } from '@dxos/assistant';
10
13
  import { defineArtifact } from '@dxos/blueprints';
11
14
  import { Filter, Obj, Ref } from '@dxos/echo';
12
15
  import { ScriptType } from '@dxos/functions';
@@ -156,14 +159,7 @@ export default () => {
156
159
  execute: async ({ name, code }, { extensions }) => {
157
160
  invariant(extensions?.space, 'No space');
158
161
  invariant(extensions?.dispatch, 'No intent dispatcher');
159
- const script = Obj.make(ScriptType, {
160
- name,
161
- source: Ref.make(
162
- Obj.make(DataType.Text, {
163
- content: code,
164
- }),
165
- ),
166
- });
162
+ const script = Obj.make(ScriptType, { name, source: Ref.make(DataType.makeText(code)) });
167
163
  extensions.space.db.add(script);
168
164
  await extensions.space.db.flush();
169
165
 
@@ -8,9 +8,10 @@ import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
8
8
  import { contributes } from '@dxos/app-framework';
9
9
  import { initializeBundler } from '@dxos/functions/bundler';
10
10
 
11
- import { ScriptCapabilities } from './capabilities';
12
11
  import { Compiler } from '../compiler';
13
12
 
13
+ import { ScriptCapabilities } from './capabilities';
14
+
14
15
  export default async () => {
15
16
  const compiler = new Compiler();
16
17
 
@@ -5,7 +5,6 @@
5
5
  import { lazy } from '@dxos/app-framework';
6
6
 
7
7
  export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
8
- export const ArtifactDefinition = lazy(() => import('./artifact-definition'));
9
8
  export const Compiler = lazy(() => import('./compiler'));
10
9
  export const IntentResolver = lazy(() => import('./intent-resolver'));
11
10
  export const ReactSurface = lazy(() => import('./react-surface'));
@@ -5,7 +5,7 @@
5
5
  import { Octokit } from '@octokit/core';
6
6
  import { Predicate } from 'effect';
7
7
 
8
- import { contributes, Capabilities, createResolver, createIntent, LayoutAction } from '@dxos/app-framework';
8
+ import { Capabilities, LayoutAction, contributes, createIntent, createResolver } from '@dxos/app-framework';
9
9
  import { Obj, Ref } from '@dxos/echo';
10
10
  import { ScriptType } from '@dxos/functions';
11
11
  import { TokenManagerAction } from '@dxos/plugin-token-manager/types';
@@ -47,10 +47,7 @@ export default () =>
47
47
 
48
48
  return {
49
49
  data: {
50
- object: Obj.make(ScriptType, {
51
- name,
52
- source: Ref.make(Obj.make(DataType.Text, { content })),
53
- }),
50
+ object: Obj.make(ScriptType, { name, source: Ref.make(DataType.makeText(content)) }),
54
51
  },
55
52
  };
56
53
  },
@@ -13,19 +13,20 @@ import { getSpace } from '@dxos/react-client/echo';
13
13
  import { StackItem } from '@dxos/react-ui-stack';
14
14
  import { type DataType } from '@dxos/schema';
15
15
 
16
- import { ScriptCapabilities } from './capabilities';
17
16
  import {
18
17
  DEPLOYMENT_DIALOG,
19
18
  DeploymentDialog,
20
19
  ScriptContainer,
21
- ScriptPluginSettings,
22
20
  ScriptObjectSettings,
21
+ ScriptPluginSettings,
23
22
  ScriptProperties,
24
23
  TestContainer,
25
24
  } from '../components';
26
25
  import { meta } from '../meta';
27
26
  import { type ScriptSettingsProps } from '../types';
28
27
 
28
+ import { ScriptCapabilities } from './capabilities';
29
+
29
30
  export default () =>
30
31
  contributes(Capabilities.ReactSurface, [
31
32
  createSurface({
@@ -3,10 +3,10 @@
3
3
  //
4
4
 
5
5
  import {
6
+ type VirtualTypeScriptEnvironment,
6
7
  createDefaultMapFromCDN,
7
8
  createSystem,
8
9
  createVirtualTypeScriptEnvironment,
9
- type VirtualTypeScriptEnvironment,
10
10
  } from '@typescript/vfs';
11
11
  import ts from 'typescript';
12
12
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React, { useEffect, useMemo } from 'react';
6
6
 
7
- import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
7
+ import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
8
8
  import { getSpace } from '@dxos/react-client/echo';
9
9
  import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
10
10
  import { type DataType } from '@dxos/schema';
@@ -16,9 +16,9 @@ import { type Template } from '../../templates';
16
16
  export const DEPLOYMENT_DIALOG = `${SCRIPT_PLUGIN}/deployment/dialog`;
17
17
 
18
18
  // TODO(ZaymonFC):
19
- // - Show activity and feedback to the user.
20
- // - Only take an array of templateIds and get the name from the data.
21
- // - Pending / onError states.
19
+ // - Show activity and feedback to the user.
20
+ // - Only take an array of templateIds and get the name from the data.
21
+ // - Pending / onError states.
22
22
 
23
23
  type DeploymentDialogProps = {
24
24
  accessToken: DataType.AccessToken;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { DeploymentDialog, DEPLOYMENT_DIALOG } from './DeploymentDialog';
5
+ import { DEPLOYMENT_DIALOG, DeploymentDialog } from './DeploymentDialog';
6
6
 
7
7
  export { DEPLOYMENT_DIALOG };
8
8
 
@@ -10,11 +10,12 @@ import { useIdentity } from '@dxos/react-client/halo';
10
10
  import { createDataExtensions, listener, stackItemContentEditorClassNames } from '@dxos/react-ui-editor';
11
11
  import { StackItem } from '@dxos/react-ui-stack';
12
12
 
13
- import { ScriptToolbar } from './ScriptToolbar';
14
- import { TypescriptEditor, type TypescriptEditorProps } from './TypescriptEditor';
15
13
  import { useDeployState, useToolbarState } from '../hooks';
16
14
  import { type ScriptSettingsProps } from '../types';
17
15
 
16
+ import { ScriptToolbar } from './ScriptToolbar';
17
+ import { TypescriptEditor, type TypescriptEditorProps } from './TypescriptEditor';
18
+
18
19
  export type ScriptEditorProps = {
19
20
  role: string;
20
21
  script: ScriptType;
@@ -8,9 +8,10 @@ import { type Meta } from '@storybook/react-vite';
8
8
 
9
9
  import { withLayout, withTheme } from '@dxos/storybook-utils';
10
10
 
11
- import { ScriptToolbar } from './ScriptToolbar';
12
11
  import { templates } from '../../templates';
13
12
 
13
+ import { ScriptToolbar } from './ScriptToolbar';
14
+
14
15
  export const Default = {
15
16
  args: {
16
17
  binding: 'example',
@@ -7,8 +7,8 @@ import React, { useMemo } from 'react';
7
7
 
8
8
  import { type ScriptType } from '@dxos/functions';
9
9
  import { fullyQualifiedId } from '@dxos/react-client/echo';
10
- import { ElevationProvider, useTranslation, type ThemedClassName } from '@dxos/react-ui';
11
- import { createGapSeparator, MenuProvider, rxFromSignal, ToolbarMenu, useMenuActions } from '@dxos/react-ui-menu';
10
+ import { ElevationProvider, type ThemedClassName, useTranslation } from '@dxos/react-ui';
11
+ import { MenuProvider, ToolbarMenu, createGapSeparator, rxFromSignal, useMenuActions } from '@dxos/react-ui-menu';
12
12
 
13
13
  import {
14
14
  type CreateDeployOptions,
@@ -5,11 +5,11 @@
5
5
  import { Octokit } from '@octokit/core';
6
6
  import React, { type ChangeEvent, useCallback, useEffect, useState } from 'react';
7
7
 
8
- import { createIntent, SettingsAction, useIntentDispatcher } from '@dxos/app-framework';
8
+ import { SettingsAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
9
9
  import { FunctionType, type ScriptType, getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';
10
10
  import { log } from '@dxos/log';
11
11
  import { useClient } from '@dxos/react-client';
12
- import { Filter, getMeta, getSpace, Ref, useQuery } from '@dxos/react-client/echo';
12
+ import { Filter, Ref, getMeta, getSpace, useQuery } from '@dxos/react-client/echo';
13
13
  import { Button, Clipboard, Input, useControlledState, useTranslation } from '@dxos/react-ui';
14
14
  import { DataType } from '@dxos/schema';
15
15
 
@@ -7,9 +7,10 @@ import React from 'react';
7
7
  import { type ScriptType } from '@dxos/functions';
8
8
  import { StackItem } from '@dxos/react-ui-stack';
9
9
 
10
- import { TestPanel } from './TestPanel';
11
10
  import { useDeployState, useToolbarState } from '../../hooks';
12
11
 
12
+ import { TestPanel } from './TestPanel';
13
+
13
14
  export type TestContainerProps = {
14
15
  role: string;
15
16
  script: ScriptType;
@@ -11,9 +11,10 @@ import { createDocAccessor, createObject } from '@dxos/react-client/echo';
11
11
  import { createDataExtensions } from '@dxos/react-ui-editor';
12
12
  import { withTheme } from '@dxos/storybook-utils';
13
13
 
14
- import { TypescriptEditor } from './TypescriptEditor';
15
14
  import { templates } from '../../templates';
16
15
 
16
+ import { TypescriptEditor } from './TypescriptEditor';
17
+
17
18
  // TODO(burdon): Features:
18
19
  // - language support for S
19
20
  // - hierarchical editor (DND)
@@ -11,10 +11,10 @@ import { keymap } from '@codemirror/view';
11
11
  import { tags } from '@lezer/highlight';
12
12
  import { type VirtualTypeScriptEnvironment } from '@typescript/vfs';
13
13
  import { continueKeymap } from '@valtown/codemirror-continue';
14
- import { tsSync, tsFacet, tsLinter, tsAutocomplete, tsHover, type HoverInfo } from '@valtown/codemirror-ts';
14
+ import { type HoverInfo, tsAutocomplete, tsFacet, tsHover, tsLinter, tsSync } from '@valtown/codemirror-ts';
15
15
  import React from 'react';
16
16
 
17
- import { type ThemedClassName, type ThemeMode, useThemeContext } from '@dxos/react-ui';
17
+ import { type ThemeMode, type ThemedClassName, useThemeContext } from '@dxos/react-ui';
18
18
  import {
19
19
  type EditorInputMode,
20
20
  InputModeExtensions,
@@ -64,6 +64,7 @@ export const TypescriptEditor = ({
64
64
  lineWrapping: false,
65
65
  monospace: true,
66
66
  scrollPastEnd: true,
67
+ search: true,
67
68
  }),
68
69
  createThemeExtensions({ themeMode, syntaxHighlighting: true }),
69
70
  InputModeExtensions[inputMode],
@@ -7,7 +7,7 @@ import { useEffect, useMemo } from 'react';
7
7
  import { FunctionType, type ScriptType, getUserFunctionUrlInMetadata } from '@dxos/functions';
8
8
  import { log } from '@dxos/log';
9
9
  import { type Client, useClient } from '@dxos/react-client';
10
- import { getMeta, getSpace, Query, Ref, type Space, useQuery } from '@dxos/react-client/echo';
10
+ import { Query, Ref, type Space, getMeta, getSpace, useQuery } from '@dxos/react-client/echo';
11
11
  import { type TFunction } from '@dxos/react-ui';
12
12
  import { createMenuAction } from '@dxos/react-ui-menu';
13
13
  import { errorMessageColors } from '@dxos/react-ui-theme';
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { Obj } from '@dxos/echo';
6
6
  import { FUNCTIONS_PRESET_META_KEY, type ScriptType } from '@dxos/functions';
7
- import { createMenuItemGroup, createMenuAction } from '@dxos/react-ui-menu';
7
+ import { createMenuAction, createMenuItemGroup } from '@dxos/react-ui-menu';
8
8
 
9
9
  import { SCRIPT_PLUGIN } from '../meta';
10
10
  import { templates } from '../templates';
@@ -55,5 +55,6 @@ export const useCreateAndDeployScriptTemplates = (space: Space | undefined, scri
55
55
  setStatus(hasErrors ? 'error' : 'success');
56
56
  }, [space, dispatch, client, scriptTemplates]);
57
57
 
58
+ // TODO(burdon): Return onCreateAndDeployScripts.
58
59
  return { handleCreateAndDeployScripts, status, error };
59
60
  };
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { defineFunction, S } from 'dxos:functions';
6
+ import { S, defineFunction } from 'dxos:functions';
7
7
  // @ts-ignore
8
8
  import { Chess } from 'https://esm.sh/chess.js@0.13.1?bundle=false';
9
9
 
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { defineFunction, S, create, Expando } from 'dxos:functions';
6
+ import { Expando, S, create, defineFunction } from 'dxos:functions';
7
7
  // @ts-ignore
8
8
  import { randText } from 'https://esm.sh/@ngneat/falso@7.1.1?bundle=false';
9
9
 
@@ -12,11 +12,15 @@ export default defineFunction({
12
12
  documentAmount: S.optional(S.Number),
13
13
  textSize: S.optional(S.Number),
14
14
  mutationAmount: S.optional(S.Number),
15
+ waitAfterCreation: S.optional(S.Number),
15
16
  }),
16
17
 
17
18
  outputSchema: S.Struct({}),
18
19
 
19
- handler: async ({ data: { documentAmount = 1, textSize = 10, mutationAmount = 0 }, context: { space } }: any) => {
20
+ handler: async ({
21
+ data: { documentAmount = 1, textSize = 10, mutationAmount = 0, waitAfterCreation = 10_000 },
22
+ context: { space },
23
+ }: any) => {
20
24
  await space.db.graph.schemaRegistry.addSchema([Expando]);
21
25
  const result: Record<string, any> = {};
22
26
  const objects: Expando[] = [];
@@ -42,7 +46,7 @@ export default defineFunction({
42
46
 
43
47
  // Flush and wait for data to propagate.
44
48
  await space.db.flush();
45
- await new Promise((resolve) => setTimeout(resolve, 10_000));
49
+ await new Promise((resolve) => setTimeout(resolve, waitAfterCreation));
46
50
  return { createdObjects: objects.length };
47
51
  },
48
52
  });
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { create, defineFunction, DXN, EchoObject, Filter, ObjectId, S } from 'dxos:functions';
6
+ import { DXN, EchoObject, Filter, ObjectId, S, create, defineFunction } from 'dxos:functions';
7
7
  // @ts-ignore
8
8
  import { FetchHttpClient } from 'https://esm.sh/@effect/platform@0.77.2?deps=effect@3.14.21&bundle=false';
9
9
  import {
@@ -13,7 +13,7 @@ import {
13
13
  // @ts-ignore
14
14
  } from 'https://esm.sh/dfx@0.113.0?deps=effect@3.14.21&bundle=false';
15
15
  // @ts-ignore
16
- import { Effect, Config, Redacted, Ref } from 'https://esm.sh/effect@3.14.21?bundle=false';
16
+ import { Config, Effect, Redacted, Ref } from 'https://esm.sh/effect@3.14.21?bundle=false';
17
17
 
18
18
  const MessageSchema = S.Struct({
19
19
  id: ObjectId,
@@ -5,9 +5,9 @@
5
5
  // @ts-ignore
6
6
  import { S, defineFunction } from 'dxos:functions';
7
7
  import {
8
+ FetchHttpClient,
8
9
  HttpClient,
9
10
  HttpClientRequest,
10
- FetchHttpClient,
11
11
  // @ts-ignore
12
12
  } from 'https://esm.sh/@effect/platform@0.77.2?deps=effect@3.14.21&bundle=false';
13
13
  // @ts-ignore
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { defineFunction, S } from 'dxos:functions';
6
+ import { S, defineFunction } from 'dxos:functions';
7
7
 
8
8
  export default defineFunction({
9
9
  description: 'Returns the exchange rate between two currencies.',
@@ -3,18 +3,18 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { create, defineFunction, EchoObject, Filter, ObjectId, S } from 'dxos:functions';
6
+ import { EchoObject, Filter, ObjectId, S, create, defineFunction } from 'dxos:functions';
7
7
  // @ts-ignore
8
8
  import {
9
+ FetchHttpClient,
9
10
  HttpClient,
10
11
  HttpClientRequest,
11
- FetchHttpClient,
12
12
  // @ts-ignore
13
13
  } from 'https://esm.sh/@effect/platform@0.77.2?deps=effect@3.14.21&bundle=false';
14
14
  // @ts-ignore
15
15
  import { format, subDays } from 'https://esm.sh/date-fns@3.3.1?bundle=false';
16
16
  // @ts-ignore
17
- import { pipe, Chunk, Effect, Ref, Schedule, Stream } from 'https://esm.sh/effect@3.14.21?bundle=false';
17
+ import { Chunk, Effect, Ref, Schedule, Stream, pipe } from 'https://esm.sh/effect@3.14.21?bundle=false';
18
18
 
19
19
  export default defineFunction({
20
20
  inputSchema: S.Struct({