@dxos/plugin-script 0.8.4-staging.60fe92afc8 → 0.9.1-main.c7dcc2e112
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.
- package/dist/lib/neutral/{DeploymentDialog-M3AFYQHC.mjs → DeploymentDialog-7OIIL7LB.mjs} +10 -10
- package/dist/lib/neutral/DeploymentDialog-7OIIL7LB.mjs.map +7 -0
- package/dist/lib/neutral/{NotebookArticle-NV4AHOOS.mjs → NotebookArticle-E35G2Y2I.mjs} +2 -2
- package/dist/lib/neutral/NotebookArticle-E35G2Y2I.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.mjs +2 -2
- package/dist/lib/neutral/ScriptPlugin.mjs.map +4 -4
- package/dist/lib/neutral/{ScriptPluginSettings-T4JMUSHN.mjs → ScriptPluginSettings-5AURDJTI.mjs} +3 -3
- package/dist/lib/neutral/ScriptPluginSettings-5AURDJTI.mjs.map +7 -0
- package/dist/lib/neutral/{ScriptProperties-RLXNAN3N.mjs → ScriptProperties-ADTWXG6O.mjs} +9 -10
- package/dist/lib/neutral/ScriptProperties-ADTWXG6O.mjs.map +7 -0
- package/dist/lib/neutral/{app-graph-builder-7AWFCEQF.mjs → app-graph-builder-POP3CX6G.mjs} +3 -3
- package/dist/lib/neutral/{app-graph-builder-7AWFCEQF.mjs.map → app-graph-builder-POP3CX6G.mjs.map} +3 -3
- package/dist/lib/neutral/blueprints/index.mjs +1 -1
- package/dist/lib/neutral/capabilities/index.mjs +4 -4
- package/dist/lib/neutral/capabilities/index.mjs.map +2 -2
- package/dist/lib/neutral/capabilities/node.mjs +2 -2
- package/dist/lib/neutral/capabilities/node.mjs.map +2 -2
- package/dist/lib/neutral/{chunk-BKXYHCJ6.mjs → chunk-JAJ64B3E.mjs} +2 -2
- package/dist/lib/neutral/chunk-NVV5UYY4.mjs +50 -0
- package/dist/lib/neutral/chunk-NVV5UYY4.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-XFM63AKT.mjs → chunk-O6A5PTB3.mjs} +2 -2
- package/dist/lib/neutral/{chunk-PHKPB5JN.mjs → chunk-QV6NCUGM.mjs} +12 -12
- package/dist/lib/neutral/chunk-QV6NCUGM.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-HABDH5SS.mjs → chunk-ZPFRRBZW.mjs} +6 -6
- package/dist/lib/neutral/{chunk-HABDH5SS.mjs.map → chunk-ZPFRRBZW.mjs.map} +3 -3
- package/dist/lib/neutral/components/index.mjs +13 -11
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/containers/index.mjs +3 -3
- package/dist/lib/neutral/{create-AAA53WDL.mjs → create-6LC57CCC.mjs} +1 -1
- package/dist/lib/neutral/{create-script-P46JOEHH.mjs → create-script-YW437XYZ.mjs} +3 -3
- package/dist/lib/neutral/hooks/index.mjs +5 -5
- package/dist/lib/neutral/hooks/index.mjs.map +3 -3
- package/dist/lib/neutral/index.mjs +4 -4
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/{operation-handler-YMUADD7Y.mjs → operation-handler-6IZ7L4L2.mjs} +2 -2
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/{react-surface-ACNZ35FV.mjs → react-surface-2TZDZQYA.mjs} +4 -4
- package/dist/lib/neutral/react-surface-2TZDZQYA.mjs.map +7 -0
- package/dist/lib/neutral/{settings-VJBW4OMK.mjs → settings-FD7HXEY6.mjs} +3 -3
- package/dist/lib/neutral/{settings-VJBW4OMK.mjs.map → settings-FD7HXEY6.mjs.map} +3 -3
- package/dist/lib/neutral/templates/index.mjs +1 -1
- package/dist/lib/neutral/translations.mjs +1 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/lib/neutral/types/index.mjs +2 -2
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -17
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +4 -15
- package/dist/types/src/capabilities/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +10 -2
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +5 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +5 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +28 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/ScriptCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/ScriptEvents.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +26 -0
- package/package.json +58 -57
- package/src/ScriptPlugin.test.ts +1 -1
- package/src/ScriptPlugin.tsx +1 -1
- package/src/capabilities/app-graph-builder.ts +2 -2
- package/src/capabilities/index.ts +1 -7
- package/src/capabilities/node.ts +1 -7
- package/src/capabilities/react-surface.tsx +2 -2
- package/src/capabilities/settings.ts +2 -2
- package/src/components/NotebookStack/NotebookCell.tsx +2 -2
- package/src/components/NotebookStack/NotebookMenu.tsx +1 -1
- package/src/components/NotebookStack/NotebookStack.tsx +1 -1
- package/src/components/ScriptPluginSettings/ScriptPluginSettings.tsx +2 -2
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +3 -2
- package/src/components/TestPanel/TestPanel.tsx +1 -1
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +2 -1
- package/src/constants.ts +1 -1
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +15 -9
- package/src/containers/NotebookArticle/NotebookArticle.stories.tsx +2 -1
- package/src/containers/NotebookArticle/NotebookArticle.tsx +1 -1
- package/src/containers/ScriptProperties/BlueprintEditor.tsx +1 -1
- package/src/containers/ScriptProperties/FunctionBinding.tsx +1 -1
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +1 -1
- package/src/containers/ScriptProperties/ScriptProperties.tsx +12 -5
- package/src/hooks/deploy.ts +3 -3
- package/src/hooks/format.ts +1 -1
- package/src/meta.ts +3 -19
- package/src/templates/commentary.ts +4 -3
- package/src/translations.ts +1 -1
- package/src/types/ScriptCapabilities.ts +4 -2
- package/src/types/ScriptEvents.ts +1 -1
- package/src/types/ScriptOperation.ts +1 -1
- package/dist/lib/neutral/DeploymentDialog-M3AFYQHC.mjs.map +0 -7
- package/dist/lib/neutral/NotebookArticle-NV4AHOOS.mjs.map +0 -7
- package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs.map +0 -7
- package/dist/lib/neutral/ScriptProperties-RLXNAN3N.mjs.map +0 -7
- package/dist/lib/neutral/chunk-PHKPB5JN.mjs.map +0 -7
- package/dist/lib/neutral/chunk-UA3BWOCZ.mjs +0 -38
- package/dist/lib/neutral/chunk-UA3BWOCZ.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-ACNZ35FV.mjs.map +0 -7
- /package/dist/lib/neutral/{chunk-BKXYHCJ6.mjs.map → chunk-JAJ64B3E.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-XFM63AKT.mjs.map → chunk-O6A5PTB3.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-AAA53WDL.mjs.map → create-6LC57CCC.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-script-P46JOEHH.mjs.map → create-script-YW437XYZ.mjs.map} +0 -0
- /package/dist/lib/neutral/{operation-handler-YMUADD7Y.mjs.map → operation-handler-6IZ7L4L2.mjs.map} +0 -0
package/dx.config.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Config2 } from '@dxos/app-framework/config';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
export default Config2.make({
|
|
9
|
+
plugin: {
|
|
10
|
+
key: 'org.dxos.plugin.script',
|
|
11
|
+
name: 'Scripts',
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
description: trim`
|
|
14
|
+
Write, deploy, and run custom TypeScript functions as ECHO objects directly inside your Composer spaces.
|
|
15
|
+
Scripts execute on the Cloudflare Workers-based EDGE runtime and have access to the full DXOS SDK,
|
|
16
|
+
Effect-TS, and a curated set of third-party libraries including HTTP, JSON, CSV, and date utilities.
|
|
17
|
+
An AI Script assistant wires CRUD, deploy, invoke, and invocation-inspection operations as tools
|
|
18
|
+
so an agent can scaffold, iterate, and test functions entirely within a chat session.
|
|
19
|
+
`,
|
|
20
|
+
icon: { key: 'ph--code--regular', hue: 'sky' },
|
|
21
|
+
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',
|
|
22
|
+
spec: 'PLUGIN.mdl',
|
|
23
|
+
tags: ['labs'],
|
|
24
|
+
screenshots: [{ dark: 'https://dxos.network/plugin-details-scripts-dark.png' }],
|
|
25
|
+
},
|
|
26
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-script",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1-main.c7dcc2e112",
|
|
4
4
|
"description": "Braneframe notebook plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"types": "dist/types/src/index.d.ts",
|
|
117
117
|
"files": [
|
|
118
118
|
"dist",
|
|
119
|
+
"dx.config.ts",
|
|
119
120
|
"src",
|
|
120
121
|
"PLUGIN.mdl"
|
|
121
122
|
],
|
|
@@ -124,7 +125,7 @@
|
|
|
124
125
|
"@codemirror/autocomplete": "^6.20.2",
|
|
125
126
|
"@codemirror/lang-javascript": "^6.2.5",
|
|
126
127
|
"@codemirror/language": "^6.12.3",
|
|
127
|
-
"@codemirror/lint": "6.9.
|
|
128
|
+
"@codemirror/lint": "6.9.7",
|
|
128
129
|
"@codemirror/state": "^6.6.0",
|
|
129
130
|
"@codemirror/view": "^6.43.0",
|
|
130
131
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -140,51 +141,51 @@
|
|
|
140
141
|
"esbuild-wasm": "^0.28.0",
|
|
141
142
|
"prettier": "^3.6.2",
|
|
142
143
|
"typescript": "^6.0.3",
|
|
143
|
-
"@dxos/
|
|
144
|
-
"@dxos/
|
|
145
|
-
"@dxos/app-
|
|
146
|
-
"@dxos/assistant
|
|
147
|
-
"@dxos/
|
|
148
|
-
"@dxos/
|
|
149
|
-
"@dxos/
|
|
150
|
-
"@dxos/
|
|
151
|
-
"@dxos/
|
|
152
|
-
"@dxos/
|
|
153
|
-
"@dxos/
|
|
154
|
-
"@dxos/
|
|
155
|
-
"@dxos/echo-
|
|
156
|
-
"@dxos/
|
|
157
|
-
"@dxos/
|
|
158
|
-
"@dxos/functions-
|
|
159
|
-
"@dxos/functions-
|
|
160
|
-
"@dxos/keys": "0.
|
|
161
|
-
"@dxos/log": "0.
|
|
162
|
-
"@dxos/invariant": "0.
|
|
163
|
-
"@dxos/
|
|
164
|
-
"@dxos/
|
|
165
|
-
"@dxos/plugin-
|
|
166
|
-
"@dxos/plugin-
|
|
167
|
-
"@dxos/plugin-
|
|
168
|
-
"@dxos/plugin-
|
|
169
|
-
"@dxos/plugin-
|
|
170
|
-
"@dxos/plugin-
|
|
171
|
-
"@dxos/
|
|
172
|
-
"@dxos/
|
|
173
|
-
"@dxos/react-client": "0.
|
|
174
|
-
"@dxos/react-ui-components": "0.
|
|
175
|
-
"@dxos/react-ui-editor": "0.
|
|
176
|
-
"@dxos/react-ui-form": "0.
|
|
177
|
-
"@dxos/react-ui-
|
|
178
|
-
"@dxos/react-ui-
|
|
179
|
-
"@dxos/
|
|
180
|
-
"@dxos/
|
|
181
|
-
"@dxos/
|
|
182
|
-
"@dxos/
|
|
183
|
-
"@dxos/
|
|
184
|
-
"@dxos/
|
|
185
|
-
"@dxos/
|
|
186
|
-
"@dxos/ui-editor": "0.
|
|
187
|
-
"@dxos/util": "0.
|
|
144
|
+
"@dxos/ai": "0.9.1-main.c7dcc2e112",
|
|
145
|
+
"@dxos/app-framework": "0.9.1-main.c7dcc2e112",
|
|
146
|
+
"@dxos/app-toolkit": "0.9.1-main.c7dcc2e112",
|
|
147
|
+
"@dxos/assistant": "0.9.1-main.c7dcc2e112",
|
|
148
|
+
"@dxos/assistant-toolkit": "0.9.1-main.c7dcc2e112",
|
|
149
|
+
"@dxos/client-protocol": "0.9.1-main.c7dcc2e112",
|
|
150
|
+
"@dxos/compute": "0.9.1-main.c7dcc2e112",
|
|
151
|
+
"@dxos/client": "0.9.1-main.c7dcc2e112",
|
|
152
|
+
"@dxos/context": "0.9.1-main.c7dcc2e112",
|
|
153
|
+
"@dxos/config": "0.9.1-main.c7dcc2e112",
|
|
154
|
+
"@dxos/echo": "0.9.1-main.c7dcc2e112",
|
|
155
|
+
"@dxos/devtools": "0.9.1-main.c7dcc2e112",
|
|
156
|
+
"@dxos/echo-client": "0.9.1-main.c7dcc2e112",
|
|
157
|
+
"@dxos/effect": "0.9.1-main.c7dcc2e112",
|
|
158
|
+
"@dxos/functions": "0.9.1-main.c7dcc2e112",
|
|
159
|
+
"@dxos/functions-runtime": "0.9.1-main.c7dcc2e112",
|
|
160
|
+
"@dxos/functions-simulator-cloudflare": "0.9.1-main.c7dcc2e112",
|
|
161
|
+
"@dxos/keys": "0.9.1-main.c7dcc2e112",
|
|
162
|
+
"@dxos/log": "0.9.1-main.c7dcc2e112",
|
|
163
|
+
"@dxos/invariant": "0.9.1-main.c7dcc2e112",
|
|
164
|
+
"@dxos/echo-query": "0.9.1-main.c7dcc2e112",
|
|
165
|
+
"@dxos/plugin-assistant": "0.9.1-main.c7dcc2e112",
|
|
166
|
+
"@dxos/plugin-client": "0.9.1-main.c7dcc2e112",
|
|
167
|
+
"@dxos/plugin-game": "0.9.1-main.c7dcc2e112",
|
|
168
|
+
"@dxos/plugin-explorer": "0.9.1-main.c7dcc2e112",
|
|
169
|
+
"@dxos/plugin-markdown": "0.9.1-main.c7dcc2e112",
|
|
170
|
+
"@dxos/plugin-space": "0.9.1-main.c7dcc2e112",
|
|
171
|
+
"@dxos/plugin-graph": "0.9.1-main.c7dcc2e112",
|
|
172
|
+
"@dxos/protocols": "0.9.1-main.c7dcc2e112",
|
|
173
|
+
"@dxos/react-ui-attention": "0.9.1-main.c7dcc2e112",
|
|
174
|
+
"@dxos/react-client": "0.9.1-main.c7dcc2e112",
|
|
175
|
+
"@dxos/react-ui-components": "0.9.1-main.c7dcc2e112",
|
|
176
|
+
"@dxos/react-ui-editor": "0.9.1-main.c7dcc2e112",
|
|
177
|
+
"@dxos/react-ui-form": "0.9.1-main.c7dcc2e112",
|
|
178
|
+
"@dxos/react-ui-menu": "0.9.1-main.c7dcc2e112",
|
|
179
|
+
"@dxos/react-ui-stack": "0.9.1-main.c7dcc2e112",
|
|
180
|
+
"@dxos/react-ui-syntax-highlighter": "0.9.1-main.c7dcc2e112",
|
|
181
|
+
"@dxos/rpc": "0.9.1-main.c7dcc2e112",
|
|
182
|
+
"@dxos/rpc-tunnel": "0.9.1-main.c7dcc2e112",
|
|
183
|
+
"@dxos/schema": "0.9.1-main.c7dcc2e112",
|
|
184
|
+
"@dxos/plugin-automation": "0.9.1-main.c7dcc2e112",
|
|
185
|
+
"@dxos/ui": "0.9.1-main.c7dcc2e112",
|
|
186
|
+
"@dxos/types": "0.9.1-main.c7dcc2e112",
|
|
187
|
+
"@dxos/ui-editor": "0.9.1-main.c7dcc2e112",
|
|
188
|
+
"@dxos/util": "0.9.1-main.c7dcc2e112"
|
|
188
189
|
},
|
|
189
190
|
"devDependencies": {
|
|
190
191
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -198,14 +199,14 @@
|
|
|
198
199
|
"react": "~19.2.3",
|
|
199
200
|
"react-dom": "~19.2.3",
|
|
200
201
|
"vite": "^8.0.16",
|
|
201
|
-
"@dxos/plugin-
|
|
202
|
-
"@dxos/
|
|
203
|
-
"@dxos/plugin-
|
|
204
|
-
"@dxos/
|
|
205
|
-
"@dxos/
|
|
206
|
-
"@dxos/
|
|
207
|
-
"@dxos/random": "0.
|
|
208
|
-
"@dxos/ui-theme": "0.
|
|
202
|
+
"@dxos/plugin-automation": "0.9.1-main.c7dcc2e112",
|
|
203
|
+
"@dxos/config": "0.9.1-main.c7dcc2e112",
|
|
204
|
+
"@dxos/plugin-chess": "0.9.1-main.c7dcc2e112",
|
|
205
|
+
"@dxos/plugin-testing": "0.9.1-main.c7dcc2e112",
|
|
206
|
+
"@dxos/react-ui": "0.9.1-main.c7dcc2e112",
|
|
207
|
+
"@dxos/storybook-utils": "0.9.1-main.c7dcc2e112",
|
|
208
|
+
"@dxos/random": "0.9.1-main.c7dcc2e112",
|
|
209
|
+
"@dxos/ui-theme": "0.9.1-main.c7dcc2e112"
|
|
209
210
|
},
|
|
210
211
|
"peerDependencies": {
|
|
211
212
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -213,8 +214,8 @@
|
|
|
213
214
|
"effect": "3.21.3",
|
|
214
215
|
"react": "~19.2.3",
|
|
215
216
|
"react-dom": "~19.2.3",
|
|
216
|
-
"@dxos/react-ui": "0.
|
|
217
|
-
"@dxos/ui-theme": "0.
|
|
217
|
+
"@dxos/react-ui": "0.9.1-main.c7dcc2e112",
|
|
218
|
+
"@dxos/ui-theme": "0.9.1-main.c7dcc2e112"
|
|
218
219
|
},
|
|
219
220
|
"publishConfig": {
|
|
220
221
|
"access": "public"
|
package/src/ScriptPlugin.test.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { ScriptPlugin } from '#plugin';
|
|
|
12
12
|
|
|
13
13
|
import { meta } from './meta';
|
|
14
14
|
|
|
15
|
-
const moduleId = (name: string) => `${meta.
|
|
15
|
+
const moduleId = (name: string) => `${meta.profile.key}.module.${name}`;
|
|
16
16
|
|
|
17
17
|
describe('ScriptPlugin', () => {
|
|
18
18
|
test('modules activate on the expected events', async ({ expect }) => {
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -39,7 +39,7 @@ export const ScriptPlugin = Plugin.define(meta).pipe(
|
|
|
39
39
|
activate: Compiler,
|
|
40
40
|
}),
|
|
41
41
|
AppPlugin.addPluginAssetModule({
|
|
42
|
-
asset: { pluginId: meta.
|
|
42
|
+
asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
|
|
43
43
|
}),
|
|
44
44
|
Plugin.make,
|
|
45
45
|
);
|
|
@@ -21,7 +21,7 @@ export default Capability.makeModule(
|
|
|
21
21
|
Effect.succeed([
|
|
22
22
|
AppNode.makeCompanion({
|
|
23
23
|
id: 'execute',
|
|
24
|
-
label: ['script-test.label', { ns: meta.
|
|
24
|
+
label: ['script-test.label', { ns: meta.profile.key }],
|
|
25
25
|
icon: 'ph--terminal--regular',
|
|
26
26
|
data: 'execute',
|
|
27
27
|
}),
|
|
@@ -34,7 +34,7 @@ export default Capability.makeModule(
|
|
|
34
34
|
Effect.succeed([
|
|
35
35
|
AppNode.makeCompanion({
|
|
36
36
|
id: 'logs',
|
|
37
|
-
label: ['script-logs.label', { ns: meta.
|
|
37
|
+
label: ['script-logs.label', { ns: meta.profile.key }],
|
|
38
38
|
icon: 'ph--clock-countdown--regular',
|
|
39
39
|
data: 'logs',
|
|
40
40
|
}),
|
|
@@ -3,16 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
|
-
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
7
6
|
import type { OperationHandlerSet } from '@dxos/compute';
|
|
8
7
|
|
|
9
8
|
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
10
|
-
|
|
11
|
-
// wrapper needs an explicit annotation to keep the inferred type portable (TS2883).
|
|
12
|
-
export const BlueprintDefinition: Capability.LazyCapability<
|
|
13
|
-
void,
|
|
14
|
-
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
15
|
-
> = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
9
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
16
10
|
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
17
11
|
export const Compiler = Capability.lazy('Compiler', () => import('./compiler'));
|
|
18
12
|
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
package/src/capabilities/node.ts
CHANGED
|
@@ -3,16 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capability } from '@dxos/app-framework';
|
|
6
|
-
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
7
6
|
import type { OperationHandlerSet } from '@dxos/compute';
|
|
8
7
|
|
|
9
8
|
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
10
|
-
|
|
11
|
-
// wrapper needs an explicit annotation to keep the inferred type portable (TS2883).
|
|
12
|
-
export const BlueprintDefinition: Capability.LazyCapability<
|
|
13
|
-
void,
|
|
14
|
-
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
15
|
-
> = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
9
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
16
10
|
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
17
11
|
export const Compiler = Capability.lazy('Compiler', () => import('./compiler'));
|
|
18
12
|
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
@@ -29,7 +29,7 @@ export default Capability.makeModule(() =>
|
|
|
29
29
|
Capability.contributes(Capabilities.ReactSurface, [
|
|
30
30
|
Surface.create({
|
|
31
31
|
id: 'pluginSettings',
|
|
32
|
-
filter: AppSurface.settings(AppSurface.Article, meta.
|
|
32
|
+
filter: AppSurface.settings(AppSurface.Article, meta.profile.key),
|
|
33
33
|
component: ({ data: { subject } }) => {
|
|
34
34
|
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
35
35
|
const client = useClient();
|
|
@@ -84,7 +84,7 @@ export default Capability.makeModule(() =>
|
|
|
84
84
|
},
|
|
85
85
|
}),
|
|
86
86
|
Surface.create({
|
|
87
|
-
id: '
|
|
87
|
+
id: 'objectProperties',
|
|
88
88
|
filter: AppSurface.object(AppSurface.ObjectProperties, Script.Script),
|
|
89
89
|
component: ({ data, role }) => <ScriptProperties role={role} subject={data.subject} />,
|
|
90
90
|
}),
|
|
@@ -14,7 +14,7 @@ import { ScriptCapabilities, Settings } from '#types';
|
|
|
14
14
|
export default Capability.makeModule(() =>
|
|
15
15
|
Effect.sync(() => {
|
|
16
16
|
const settingsAtom = createKvsStore({
|
|
17
|
-
key: meta.
|
|
17
|
+
key: meta.profile.key,
|
|
18
18
|
schema: Settings.Settings,
|
|
19
19
|
defaultValue: () => ({
|
|
20
20
|
editorInputMode: 'vscode' as const,
|
|
@@ -24,7 +24,7 @@ export default Capability.makeModule(() =>
|
|
|
24
24
|
return [
|
|
25
25
|
Capability.contributes(ScriptCapabilities.Settings, settingsAtom),
|
|
26
26
|
Capability.contributes(AppCapabilities.Settings, {
|
|
27
|
-
prefix: meta.
|
|
27
|
+
prefix: meta.profile.key,
|
|
28
28
|
schema: Settings.Settings,
|
|
29
29
|
atom: settingsAtom,
|
|
30
30
|
}),
|
|
@@ -44,7 +44,7 @@ export type NotebookCellProps = {
|
|
|
44
44
|
|
|
45
45
|
// TODO(burdon): Show evaluation errors.
|
|
46
46
|
export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }: NotebookCellProps) => {
|
|
47
|
-
const { t } = useTranslation(meta.
|
|
47
|
+
const { t } = useTranslation(meta.profile.key);
|
|
48
48
|
|
|
49
49
|
const extensions = useMemo(() => {
|
|
50
50
|
return cell.source?.target
|
|
@@ -203,7 +203,7 @@ const NotebookTextEditor = ({
|
|
|
203
203
|
readOnly,
|
|
204
204
|
...props
|
|
205
205
|
}: EditorViewProps & Pick<BasicExtensionsOptions, 'readOnly'>) => {
|
|
206
|
-
const { t } = useTranslation(meta.
|
|
206
|
+
const { t } = useTranslation(meta.profile.key);
|
|
207
207
|
const { themeMode } = useThemeContext();
|
|
208
208
|
const extensions = useMemo(() => {
|
|
209
209
|
return [
|
|
@@ -17,7 +17,7 @@ export type NotebookMenuProps = {
|
|
|
17
17
|
|
|
18
18
|
// TODO(burdon): Better way to organize menu?
|
|
19
19
|
export const NotebookMenu = ({ cell, onCellInsert, onCellDelete }: NotebookMenuProps) => {
|
|
20
|
-
const { t } = useTranslation(meta.
|
|
20
|
+
const { t } = useTranslation(meta.profile.key);
|
|
21
21
|
return (
|
|
22
22
|
<DropdownMenu.Portal>
|
|
23
23
|
<DropdownMenu.Content>
|
|
@@ -19,11 +19,11 @@ export type ScriptPluginSettingsProps = AppSurface.SettingsArticleProps<
|
|
|
19
19
|
>;
|
|
20
20
|
|
|
21
21
|
export const ScriptPluginSettings = ({ settings, onSettingsChange, onAuthenticate }: ScriptPluginSettingsProps) => {
|
|
22
|
-
const { t } = useTranslation(meta.
|
|
22
|
+
const { t } = useTranslation(meta.profile.key);
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<SettingsForm.Viewport>
|
|
26
|
-
<SettingsForm.Section title={t('settings.title', { ns: meta.
|
|
26
|
+
<SettingsForm.Section title={t('settings.title', { ns: meta.profile.key })}>
|
|
27
27
|
{/* TODO(wittjosiah): Hide outside of dev environments. */}
|
|
28
28
|
<SettingsForm.Item title={t('authenticate-action.label')} description={t('authenticate-action.description')}>
|
|
29
29
|
<Button disabled={!onSettingsChange} onClick={onAuthenticate}>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { Atom } from '@effect-atom/atom-react';
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
|
|
8
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
9
|
import { type Script } from '@dxos/compute';
|
|
9
10
|
import { ElevationProvider, useTranslation } from '@dxos/react-ui';
|
|
10
11
|
import { composable, composableProps } from '@dxos/react-ui';
|
|
@@ -27,7 +28,7 @@ export type ScriptToolbarProps = Pick<MenuRootProps, 'attendableId'> & {
|
|
|
27
28
|
|
|
28
29
|
export const ScriptToolbar = composable<HTMLDivElement, ScriptToolbarProps>(
|
|
29
30
|
({ script, attendableId, role, state, ...props }, forwardedRef) => {
|
|
30
|
-
const { t } = useTranslation(meta.
|
|
31
|
+
const { t } = useTranslation(meta.profile.key);
|
|
31
32
|
const options = useDeployDeps({ script });
|
|
32
33
|
const menuCreator = useMemo(
|
|
33
34
|
() => createToolbarActions({ state, script, t, ...options }),
|
|
@@ -36,7 +37,7 @@ export const ScriptToolbar = composable<HTMLDivElement, ScriptToolbarProps>(
|
|
|
36
37
|
const menuActions = useMenuActions(menuCreator);
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
|
-
<ElevationProvider elevation={role ===
|
|
40
|
+
<ElevationProvider elevation={role === AppSurface.Section.role ? 'positioned' : 'base'}>
|
|
40
41
|
<Menu.Root {...menuActions} attendableId={attendableId}>
|
|
41
42
|
<Menu.Toolbar {...composableProps(props)} ref={forwardedRef} />
|
|
42
43
|
</Menu.Root>
|
|
@@ -31,7 +31,7 @@ export type TestPanelProps = ThemedClassName<{
|
|
|
31
31
|
// TODO(burdon): Need persistent history (currently lost when switching tabs).
|
|
32
32
|
export const TestPanel = composable<HTMLDivElement, TestPanelProps>(
|
|
33
33
|
({ classNames, onInvoke, ...props }, forwardedRef) => {
|
|
34
|
-
const { t } = useTranslation(meta.
|
|
34
|
+
const { t } = useTranslation(meta.profile.key);
|
|
35
35
|
|
|
36
36
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
37
37
|
const [input, setInput] = useState('');
|
|
@@ -15,6 +15,7 @@ import { continueKeymap } from '@valtown/codemirror-continue';
|
|
|
15
15
|
import { type HoverInfo, tsAutocomplete, tsFacet, tsHover, tsLinter, tsSync } from '@valtown/codemirror-ts';
|
|
16
16
|
import React from 'react';
|
|
17
17
|
|
|
18
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
18
19
|
import { type ThemeMode, type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
19
20
|
import { composable, composableProps } from '@dxos/react-ui';
|
|
20
21
|
import { type UseTextEditorProps, useTextEditor } from '@dxos/react-ui-editor';
|
|
@@ -71,7 +72,7 @@ export const TypescriptEditor = composable<HTMLDivElement, TypescriptEditorProps
|
|
|
71
72
|
indentWithTab: true,
|
|
72
73
|
lineNumbers: true,
|
|
73
74
|
lineWrapping: false,
|
|
74
|
-
scrollPastEnd: role !==
|
|
75
|
+
scrollPastEnd: role !== AppSurface.Section.role,
|
|
75
76
|
search: true,
|
|
76
77
|
...options,
|
|
77
78
|
}),
|
package/src/constants.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type DeploymentDialogProps = {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export const DeploymentDialog = ({ accessToken, scriptTemplates }: DeploymentDialogProps) => {
|
|
29
|
-
const { t } = useTranslation(meta.
|
|
29
|
+
const { t } = useTranslation(meta.profile.key);
|
|
30
30
|
const space = useMemo(() => getSpace(accessToken), [accessToken]);
|
|
31
31
|
|
|
32
32
|
// TODO(ZaymonFC): Thinking further. All of this should get moved to intents to run async in the background.
|
|
@@ -38,24 +38,30 @@ export const DeploymentDialog = ({ accessToken, scriptTemplates }: DeploymentDia
|
|
|
38
38
|
if (status === 'success') {
|
|
39
39
|
// TODO(ZaymonFC): We can probably re-use this toast for normal script deployment.
|
|
40
40
|
void invokePromise(LayoutOperation.AddToast, {
|
|
41
|
-
id: `${meta.
|
|
41
|
+
id: `${meta.profile.key}.deployment-success`,
|
|
42
42
|
icon: 'ph--check--regular',
|
|
43
43
|
duration: Infinity,
|
|
44
|
-
title: ['script-deployment-toast.label', { ns: meta.
|
|
45
|
-
description: ['script-deployment-toast.description', { ns: meta.
|
|
46
|
-
closeLabel: ['script-deployment-toast-close.label', { ns: meta.
|
|
44
|
+
title: ['script-deployment-toast.label', { ns: meta.profile.key, count: scriptTemplates.length }],
|
|
45
|
+
description: ['script-deployment-toast.description', { ns: meta.profile.key, count: scriptTemplates.length }],
|
|
46
|
+
closeLabel: ['script-deployment-toast-close.label', { ns: meta.profile.key, count: scriptTemplates.length }],
|
|
47
47
|
});
|
|
48
48
|
void invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
49
49
|
}
|
|
50
50
|
if (status === 'error') {
|
|
51
51
|
void invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
52
52
|
void invokePromise(LayoutOperation.AddToast, {
|
|
53
|
-
id: `${meta.
|
|
53
|
+
id: `${meta.profile.key}.deployment-error`,
|
|
54
54
|
icon: 'ph--warning--regular',
|
|
55
55
|
duration: Infinity,
|
|
56
|
-
title: ['script-deployment-error-toast.label', { ns: meta.
|
|
57
|
-
description: [
|
|
58
|
-
|
|
56
|
+
title: ['script-deployment-error-toast.label', { ns: meta.profile.key, count: scriptTemplates.length }],
|
|
57
|
+
description: [
|
|
58
|
+
'script-deployment-error-toast.description',
|
|
59
|
+
{ ns: meta.profile.key, count: scriptTemplates.length },
|
|
60
|
+
],
|
|
61
|
+
closeLabel: [
|
|
62
|
+
'script-deployment-error-toast-close.label',
|
|
63
|
+
{ ns: meta.profile.key, count: scriptTemplates.length },
|
|
64
|
+
],
|
|
59
65
|
});
|
|
60
66
|
}
|
|
61
67
|
}, [status, invokePromise]);
|
|
@@ -8,6 +8,7 @@ import React from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { SERVICES_CONFIG } from '@dxos/ai/testing';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
12
|
import { AgentPrompt } from '@dxos/assistant-toolkit';
|
|
12
13
|
import { Operation } from '@dxos/compute';
|
|
13
14
|
import { Filter } from '@dxos/echo';
|
|
@@ -79,7 +80,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
79
80
|
|
|
80
81
|
export const Default: Story = {
|
|
81
82
|
args: {
|
|
82
|
-
role:
|
|
83
|
+
role: AppSurface.Article.role,
|
|
83
84
|
subject: undefined as any,
|
|
84
85
|
},
|
|
85
86
|
};
|
|
@@ -41,7 +41,7 @@ const INCLUDE_BLUEPRINTS = [
|
|
|
41
41
|
export type NotebookArticleProps = AppSurface.ObjectArticleProps<Notebook.Notebook, Pick<TypescriptEditorProps, 'env'>>;
|
|
42
42
|
|
|
43
43
|
export const NotebookArticle = ({ role, subject: notebook, attendableId, env }: NotebookArticleProps) => {
|
|
44
|
-
const { t } = useTranslation(meta.
|
|
44
|
+
const { t } = useTranslation(meta.profile.key);
|
|
45
45
|
const registry = useContext(RegistryContext);
|
|
46
46
|
const db = Obj.getDatabase(notebook);
|
|
47
47
|
const { hasAttention } = useAttention(attendableId);
|
|
@@ -19,7 +19,7 @@ import { meta } from '#meta';
|
|
|
19
19
|
export type BlueprintEditorProps = { object: Script.Script };
|
|
20
20
|
|
|
21
21
|
export const BlueprintEditor = ({ object }: BlueprintEditorProps) => {
|
|
22
|
-
const { t } = useTranslation(meta.
|
|
22
|
+
const { t } = useTranslation(meta.profile.key);
|
|
23
23
|
const db = Obj.getDatabase(object);
|
|
24
24
|
const [fn] = useQuery(db, Filter.type(Operation.PersistentOperation, { source: Ref.make(object) }));
|
|
25
25
|
const blueprints = useQuery(db, Filter.type(Blueprint.Blueprint));
|
|
@@ -19,7 +19,7 @@ import { meta } from '#meta';
|
|
|
19
19
|
export type FunctionBindingProps = { object: Script.Script };
|
|
20
20
|
|
|
21
21
|
export const FunctionBinding = ({ object }: FunctionBindingProps) => {
|
|
22
|
-
const { t } = useTranslation(meta.
|
|
22
|
+
const { t } = useTranslation(meta.profile.key);
|
|
23
23
|
const client = useClient();
|
|
24
24
|
const db = Obj.getDatabase(object);
|
|
25
25
|
|
|
@@ -22,7 +22,7 @@ export type FunctionPublishingProps = { object: Script.Script };
|
|
|
22
22
|
|
|
23
23
|
// TODO(burdon): Move to separate tab?
|
|
24
24
|
export const FunctionPublishing = ({ object }: FunctionPublishingProps) => {
|
|
25
|
-
const { t } = useTranslation(meta.
|
|
25
|
+
const { t } = useTranslation(meta.profile.key);
|
|
26
26
|
const { invokePromise } = useOperationInvoker();
|
|
27
27
|
const db = Obj.getDatabase(object);
|
|
28
28
|
|
|
@@ -6,6 +6,7 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { type Script } from '@dxos/compute';
|
|
9
|
+
import { Form } from '@dxos/react-ui-form';
|
|
9
10
|
|
|
10
11
|
import { BlueprintEditor } from './BlueprintEditor';
|
|
11
12
|
import { FunctionBinding } from './FunctionBinding';
|
|
@@ -15,10 +16,16 @@ export type ScriptPropertiesProps = AppSurface.ObjectPropertiesProps<Script.Scri
|
|
|
15
16
|
|
|
16
17
|
export const ScriptProperties = ({ subject: object }: ScriptPropertiesProps) => {
|
|
17
18
|
return (
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
<>
|
|
20
|
+
<Form.Section>
|
|
21
|
+
<FunctionBinding object={object} />
|
|
22
|
+
</Form.Section>
|
|
23
|
+
<Form.Section>
|
|
24
|
+
<BlueprintEditor object={object} />
|
|
25
|
+
</Form.Section>
|
|
26
|
+
<Form.Section>
|
|
27
|
+
<FunctionPublishing object={object} />
|
|
28
|
+
</Form.Section>
|
|
29
|
+
</>
|
|
23
30
|
);
|
|
24
31
|
};
|
package/src/hooks/deploy.ts
CHANGED
|
@@ -44,7 +44,7 @@ export const createDeploy = ({ state, script, space, fn, client, existingFunctio
|
|
|
44
44
|
|
|
45
45
|
// TODO(wittjosiah): Should this be an action?
|
|
46
46
|
const errorItem = createMenuAction('error', () => {}, {
|
|
47
|
-
label: value.error ?? ['no-error.label', { ns: meta.
|
|
47
|
+
label: value.error ?? ['no-error.label', { ns: meta.profile.key }],
|
|
48
48
|
icon: 'ph--warning-circle--regular',
|
|
49
49
|
hidden: !value.error,
|
|
50
50
|
classNames: value.error && messageValence('error'),
|
|
@@ -71,7 +71,7 @@ export const createDeploy = ({ state, script, space, fn, client, existingFunctio
|
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
type: 'deploy',
|
|
74
|
-
label: [value.deploying ? 'publishing.label' : 'deploy.label', { ns: meta.
|
|
74
|
+
label: [value.deploying ? 'publishing.label' : 'deploy.label', { ns: meta.profile.key }],
|
|
75
75
|
icon: value.deploying ? 'ph--spinner-gap--regular' : 'ph--cloud-arrow-up--regular',
|
|
76
76
|
disabled: value.deploying,
|
|
77
77
|
classNames: value.deploying ? '[&_svg]:animate-spin' : '',
|
|
@@ -87,7 +87,7 @@ export const createDeploy = ({ state, script, space, fn, client, existingFunctio
|
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
type: 'copy',
|
|
90
|
-
label: ['copy-link.label', { ns: meta.
|
|
90
|
+
label: ['copy-link.label', { ns: meta.profile.key }],
|
|
91
91
|
icon: 'ph--link--regular',
|
|
92
92
|
disabled: !value.functionUrl,
|
|
93
93
|
},
|
package/src/hooks/format.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -4,26 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { DXN } from '@dxos/keys';
|
|
7
|
-
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
author: 'DXOS',
|
|
13
|
-
spec: 'PLUGIN.mdl',
|
|
14
|
-
description: trim`
|
|
15
|
-
Write, deploy, and run custom TypeScript functions as ECHO objects directly inside your Composer spaces.
|
|
16
|
-
Scripts execute on the Cloudflare Workers-based EDGE runtime and have access to the full DXOS SDK,
|
|
17
|
-
Effect-TS, and a curated set of third-party libraries including HTTP, JSON, CSV, and date utilities.
|
|
18
|
-
An AI Script assistant wires CRUD, deploy, invoke, and invocation-inspection operations as tools
|
|
19
|
-
so an agent can scaffold, iterate, and test functions entirely within a chat session.
|
|
20
|
-
`,
|
|
21
|
-
icon: 'ph--code--regular',
|
|
22
|
-
iconHue: 'sky',
|
|
23
|
-
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',
|
|
24
|
-
tags: ['labs'],
|
|
25
|
-
screenshots: ['https://dxos.network/plugin-details-scripts-dark.png'],
|
|
26
|
-
});
|
|
8
|
+
import config from '../dx.config';
|
|
9
|
+
|
|
10
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
|
27
11
|
|
|
28
12
|
// TODO(ZaymonFC): Configure by scopes?
|
|
29
13
|
export const defaultScriptsForIntegration: Record<string, string[]> = {
|