@dxos/plugin-script 0.11.0 → 0.12.0-next-bbabc02363f18d7643ea4160e3a7a7809870fd0d
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/Notebook.mjs +33 -0
- package/dist/lib/Notebook.mjs.map +1 -0
- package/dist/lib/ScriptCapabilities.mjs +14 -0
- package/dist/lib/ScriptCapabilities.mjs.map +1 -0
- package/dist/lib/ScriptEvents.mjs +19 -0
- package/dist/lib/ScriptEvents.mjs.map +1 -0
- package/dist/lib/ScriptOperation.mjs +33 -0
- package/dist/lib/ScriptOperation.mjs.map +1 -0
- package/dist/lib/ScriptPlugin.mjs +5 -12
- package/dist/lib/ScriptPlugin.mjs.map +1 -1
- package/dist/lib/ScriptPlugin.node.mjs +4 -4
- package/dist/lib/ScriptPlugin.node.mjs.map +1 -1
- package/dist/lib/ScriptPlugin.workerd.mjs +4 -4
- package/dist/lib/ScriptPlugin.workerd.mjs.map +1 -1
- package/dist/lib/Settings.mjs +13 -0
- package/dist/lib/Settings.mjs.map +1 -0
- package/dist/lib/capabilities/node.mjs +8 -7
- package/dist/lib/capabilities/node.mjs.map +1 -1
- package/dist/lib/capabilities.mjs +24 -8
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/chunk-DeploymentDialog.mjs +1 -1
- package/dist/lib/chunk-DeploymentDialog.mjs.map +1 -1
- package/dist/lib/chunk-NotebookArticle.mjs +13 -11
- package/dist/lib/chunk-NotebookArticle.mjs.map +1 -1
- package/dist/lib/chunk-ScriptArticle.mjs.map +1 -1
- package/dist/lib/chunk-ScriptProperties.mjs +6 -4
- package/dist/lib/chunk-ScriptProperties.mjs.map +1 -1
- package/dist/lib/chunk-ScriptSettings.mjs +2 -2
- package/dist/lib/chunk-ScriptSettings.mjs.map +1 -1
- package/dist/lib/chunk-TestContainer.mjs.map +1 -1
- package/dist/lib/chunk-app-graph-builder.mjs +5 -4
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
- package/dist/lib/chunk-compiler2.mjs +7 -7
- package/dist/lib/chunk-compiler2.mjs.map +1 -1
- package/dist/lib/chunk-create-object.mjs +15 -12
- package/dist/lib/chunk-create-object.mjs.map +1 -1
- package/dist/lib/chunk-create-script.mjs +3 -2
- package/dist/lib/chunk-create-script.mjs.map +1 -1
- package/dist/lib/chunk-create.mjs +3 -2
- package/dist/lib/chunk-create.mjs.map +1 -1
- package/dist/lib/chunk-delete.mjs +1 -1
- package/dist/lib/chunk-delete.mjs.map +1 -1
- package/dist/lib/chunk-deploy.mjs +3 -3
- package/dist/lib/chunk-deploy.mjs.map +1 -1
- package/dist/lib/chunk-functions.mjs +15 -4
- package/dist/lib/chunk-functions.mjs.map +1 -1
- package/dist/lib/chunk-inspect-invocations.mjs +1 -1
- package/dist/lib/chunk-inspect-invocations.mjs.map +1 -1
- package/dist/lib/chunk-install-function.mjs +2 -2
- package/dist/lib/chunk-install-function.mjs.map +1 -1
- package/dist/lib/chunk-invoke.mjs +2 -2
- package/dist/lib/chunk-invoke.mjs.map +1 -1
- package/dist/lib/chunk-meta.mjs +3 -3
- package/dist/lib/chunk-meta.mjs.map +1 -1
- package/dist/lib/chunk-operation-handler.mjs +4 -3
- package/dist/lib/chunk-operation-handler.mjs.map +1 -1
- package/dist/lib/chunk-query-deployed-functions.mjs +2 -2
- package/dist/lib/chunk-query-deployed-functions.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +9 -7
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/chunk-read.mjs +1 -1
- package/dist/lib/chunk-read.mjs.map +1 -1
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-settings.mjs +7 -6
- package/dist/lib/chunk-settings.mjs.map +1 -1
- package/dist/lib/chunk-skill-definition.mjs +3 -3
- package/dist/lib/chunk-skill-definition.mjs.map +1 -1
- package/dist/lib/chunk-skills.mjs +2 -1
- package/dist/lib/chunk-skills.mjs.map +1 -1
- package/dist/lib/chunk-templates.mjs +6 -6
- package/dist/lib/chunk-update.mjs +1 -1
- package/dist/lib/chunk-update.mjs.map +1 -1
- package/dist/lib/chunk-util.mjs +7 -7
- package/dist/lib/chunk-util.mjs.map +1 -1
- package/dist/lib/components.mjs +3 -2
- package/dist/lib/components.mjs.map +1 -1
- package/dist/lib/hooks.mjs +12 -9
- package/dist/lib/hooks.mjs.map +1 -1
- package/dist/lib/index.mjs +6 -2
- package/dist/lib/operations.mjs +4 -2
- package/dist/lib/operations.mjs.map +1 -1
- package/dist/lib/plugin.mjs +2 -3
- package/dist/lib/plugin.mjs.map +1 -1
- package/dist/lib/testing.mjs +7 -5
- package/dist/lib/testing.mjs.map +1 -1
- package/dist/lib/translations.mjs +3 -3
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/types/src/ScriptPlugin.d.ts +1 -1
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/ScriptPlugin.node.d.ts +1 -1
- package/dist/types/src/ScriptPlugin.node.d.ts.map +1 -1
- package/dist/types/src/ScriptPlugin.workerd.d.ts +1 -1
- package/dist/types/src/ScriptPlugin.workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/ScriptSurfaces.d.ts +3 -3
- package/dist/types/src/capabilities/ScriptSurfaces.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/compiler.d.ts +2 -2
- package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +2 -2
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +8 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +4 -7
- package/dist/types/src/capabilities/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +2 -3
- package/dist/types/src/capabilities/operation-handler.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/capabilities/settings.d.ts +2 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/skill-definition.d.ts +2 -2
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts +2 -2
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts +1 -1
- package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts +1 -1
- package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts +1 -1
- package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts +1 -1
- package/dist/types/src/containers/ScriptProperties/SkillEditor.d.ts +1 -1
- package/dist/types/src/containers/ScriptProperties/SkillEditor.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts +1 -1
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.stories.d.ts +1 -1
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts +1 -1
- package/dist/types/src/containers/TestContainer/TestContainer.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +2 -1
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +1 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +1 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -1
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +6 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts.map +1 -1
- package/dist/types/src/operations/create-script.d.ts +2 -2
- package/dist/types/src/operations/create-script.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +1 -2
- package/dist/types/src/plugin.d.ts.map +1 -1
- package/dist/types/src/skills/functions/create.d.ts +1 -1
- package/dist/types/src/skills/functions/create.d.ts.map +1 -1
- package/dist/types/src/skills/functions/definitions.d.ts +1 -1
- package/dist/types/src/skills/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/functions/delete.d.ts +1 -1
- package/dist/types/src/skills/functions/delete.d.ts.map +1 -1
- package/dist/types/src/skills/functions/deploy.d.ts +1 -1
- package/dist/types/src/skills/functions/deploy.d.ts.map +1 -1
- package/dist/types/src/skills/functions/index.d.ts +1 -1
- package/dist/types/src/skills/functions/index.d.ts.map +1 -1
- package/dist/types/src/skills/functions/inspect-invocations.d.ts +1 -1
- package/dist/types/src/skills/functions/inspect-invocations.d.ts.map +1 -1
- package/dist/types/src/skills/functions/install-function.d.ts +1 -1
- package/dist/types/src/skills/functions/install-function.d.ts.map +1 -1
- package/dist/types/src/skills/functions/invoke.d.ts +1 -1
- package/dist/types/src/skills/functions/invoke.d.ts.map +1 -1
- package/dist/types/src/skills/functions/query-deployed-functions.d.ts +1 -1
- package/dist/types/src/skills/functions/query-deployed-functions.d.ts.map +1 -1
- package/dist/types/src/skills/functions/read.d.ts +1 -1
- package/dist/types/src/skills/functions/read.d.ts.map +1 -1
- package/dist/types/src/skills/functions/update.d.ts +1 -1
- package/dist/types/src/skills/functions/update.d.ts.map +1 -1
- package/dist/types/src/skills/script-skill.d.ts +1 -1
- package/dist/types/src/skills/script-skill.d.ts.map +1 -1
- package/dist/types/src/templates/anthropic.d.ts +1 -1
- package/dist/types/src/templates/anthropic.d.ts.map +1 -1
- package/dist/types/src/templates/chess-bot.d.ts +2 -2
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +2 -2
- package/dist/types/src/templates/commentary.d.ts.map +1 -1
- package/dist/types/src/templates/forex-effect.d.ts +1 -1
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts +1 -1
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/ping.d.ts +1 -1
- package/dist/types/src/templates/ping.d.ts.map +1 -1
- package/dist/types/src/testing/test-notebook.d.ts +1 -1
- package/dist/types/src/testing/test-notebook.d.ts.map +1 -1
- package/dist/types/src/testing/test-script.d.ts +1 -1
- package/dist/types/src/testing/test-script.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +2 -2
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/ScriptCapabilities.d.ts +3 -3
- package/dist/types/src/types/ScriptCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/ScriptEvents.d.ts +7 -1
- package/dist/types/src/types/ScriptEvents.d.ts.map +1 -1
- package/dist/types/src/types/ScriptOperation.d.ts +2 -1
- package/dist/types/src/types/ScriptOperation.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts +2 -1
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +2 -1
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +1 -1
- package/package.json +115 -82
- package/src/ScriptPlugin.node.ts +8 -8
- package/src/ScriptPlugin.test.ts +3 -6
- package/src/ScriptPlugin.tsx +20 -22
- package/src/ScriptPlugin.workerd.ts +5 -5
- package/src/capabilities/ScriptSurfaces.tsx +5 -3
- package/src/capabilities/app-graph-builder.ts +5 -4
- package/src/capabilities/compiler.ts +3 -4
- package/src/capabilities/create-object.ts +34 -31
- package/src/capabilities/index.ts +28 -11
- package/src/capabilities/node.ts +9 -10
- package/src/capabilities/operation-handler.ts +5 -4
- package/src/capabilities/react-surface.ts +5 -4
- package/src/capabilities/settings.ts +7 -5
- package/src/capabilities/skill-definition.ts +3 -3
- package/src/components/NotebookStack/NotebookCell.tsx +1 -1
- package/src/components/NotebookStack/NotebookMenu.tsx +2 -1
- package/src/components/NotebookStack/NotebookStack.tsx +1 -1
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +1 -1
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +4 -2
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +1 -1
- package/src/containers/NotebookArticle/NotebookArticle.stories.tsx +7 -7
- package/src/containers/NotebookArticle/NotebookArticle.tsx +5 -4
- package/src/containers/ScriptArticle/ScriptArticle.stories.tsx +3 -3
- package/src/containers/ScriptArticle/ScriptArticle.tsx +3 -2
- package/src/containers/ScriptProperties/FunctionBinding.tsx +2 -2
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +5 -3
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +3 -3
- package/src/containers/ScriptProperties/ScriptProperties.tsx +1 -1
- package/src/containers/ScriptProperties/SkillEditor.tsx +4 -3
- package/src/containers/ScriptSettings/ScriptSettings.tsx +2 -1
- package/src/containers/TestContainer/TestContainer.tsx +1 -1
- package/src/e2e/ai.test.ts +1 -1
- package/src/hooks/deploy.ts +2 -1
- package/src/hooks/format.ts +1 -1
- package/src/hooks/template.ts +1 -1
- package/src/hooks/useCompiler.ts +2 -3
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +2 -3
- package/src/hooks/useToolbarState.ts +1 -1
- package/src/index.ts +6 -2
- package/src/meta.ts +1 -1
- package/src/notebook/compute-graph.ts +1 -2
- package/src/operations/create-script.ts +3 -2
- package/src/operations/index.ts +7 -2
- package/src/plugin.ts +1 -3
- package/src/skills/functions/create.ts +3 -2
- package/src/skills/functions/definitions.ts +1 -1
- package/src/skills/functions/delete.ts +1 -1
- package/src/skills/functions/deploy.ts +2 -1
- package/src/skills/functions/index.ts +25 -12
- package/src/skills/functions/inspect-invocations.ts +1 -1
- package/src/skills/functions/install-function.ts +1 -1
- package/src/skills/functions/invoke.ts +1 -1
- package/src/skills/functions/query-deployed-functions.ts +1 -1
- package/src/skills/functions/read.ts +2 -1
- package/src/skills/functions/update.ts +2 -1
- package/src/skills/script-skill.ts +2 -1
- package/src/templates/anthropic.ts +1 -1
- package/src/templates/chess-bot.ts +5 -4
- package/src/templates/commentary.ts +8 -6
- package/src/templates/forex-effect.ts +1 -1
- package/src/templates/forex.ts +1 -1
- package/src/templates/ping.ts +1 -1
- package/src/testing/test-notebook.ts +3 -3
- package/src/testing/test-script.ts +2 -1
- package/src/translations.ts +3 -2
- package/src/types/Notebook.ts +2 -2
- package/src/types/ScriptCapabilities.ts +3 -3
- package/src/types/ScriptEvents.ts +8 -1
- package/src/types/ScriptOperation.ts +2 -1
- package/src/util/deploy.ts +2 -1
- package/src/util/functions.ts +2 -1
- package/dist/lib/chunk-types.mjs +0 -90
- package/dist/lib/chunk-types.mjs.map +0 -1
- package/dist/lib/types.mjs +0 -2
- package/dist/types/src/types/index.d.ts +0 -6
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -2
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/types/index.ts +0 -10
- package/src/types/types.ts +0 -5
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import * as Instructions from "@dxos/compute/Instructions";
|
|
4
|
+
import { Annotation, DXN, Obj, Ref, Type } from "@dxos/echo";
|
|
5
|
+
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/Annotation";
|
|
6
|
+
import * as Graph from "@dxos/plugin-explorer/Graph";
|
|
7
|
+
import { Text } from "@dxos/schema";
|
|
8
|
+
//#region src/types/Notebook.ts
|
|
9
|
+
var Notebook_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Cell: () => Cell,
|
|
11
|
+
Notebook: () => Notebook,
|
|
12
|
+
make: () => make
|
|
13
|
+
});
|
|
14
|
+
var Cell = Schema.Struct({
|
|
15
|
+
id: Schema.String,
|
|
16
|
+
type: Schema.String,
|
|
17
|
+
name: Schema.optional(Schema.String),
|
|
18
|
+
source: Schema.optional(Ref.Ref(Text.Text)),
|
|
19
|
+
prompt: Schema.optional(Ref.Ref(Instructions.Instructions)),
|
|
20
|
+
graph: Schema.optional(Ref.Ref(Graph.Graph))
|
|
21
|
+
});
|
|
22
|
+
var Notebook = class extends Type.makeObject(DXN.make("org.dxos.type.notebook", "0.1.0"))(Schema.Struct({
|
|
23
|
+
name: Schema.String.pipe(Schema.optional),
|
|
24
|
+
cells: Cell.pipe(Schema.Array, FormInputAnnotation.set(false))
|
|
25
|
+
}).pipe(LabelAnnotation.set(["name"]), Annotation.IconAnnotation.set({
|
|
26
|
+
icon: "ph--notebook--regular",
|
|
27
|
+
hue: "sky"
|
|
28
|
+
}))) {};
|
|
29
|
+
var make = (props = { cells: [] }) => Obj.make(Notebook, props);
|
|
30
|
+
//#endregion
|
|
31
|
+
export { Cell, Notebook, make, Notebook_exports as t };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=Notebook.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notebook.mjs","names":[],"sources":["../../src/types/Notebook.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Instructions from '@dxos/compute/Instructions';\nimport { Annotation, DXN, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/Annotation';\nimport { LabelAnnotation } from '@dxos/echo/Annotation';\nimport * as Graph from '@dxos/plugin-explorer/Graph';\nimport { Text } from '@dxos/schema';\n\nexport type CellType = 'markdown' | 'script' | 'query' | 'prompt' | 'view';\n\nexport const Cell = Schema.Struct({\n id: Schema.String,\n type: Schema.String,\n name: Schema.optional(Schema.String),\n // TODO(burdon): Union type.\n source: Schema.optional(Ref.Ref(Text.Text)),\n prompt: Schema.optional(Ref.Ref(Instructions.Instructions)),\n graph: Schema.optional(Ref.Ref(Graph.Graph)),\n});\n\nexport type Cell = Schema.Schema.Type<typeof Cell>;\n\nexport class Notebook extends Type.makeObject<Notebook>(DXN.make('org.dxos.type.notebook', '0.1.0'))(\n Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n cells: Cell.pipe(Schema.Array, FormInputAnnotation.set(false)),\n }).pipe(LabelAnnotation.set(['name']), Annotation.IconAnnotation.set({ icon: 'ph--notebook--regular', hue: 'sky' })),\n) {}\n\nexport const make = (props: Obj.MakeProps<typeof Notebook> = { cells: [] }): Notebook => Obj.make(Notebook, props);\n"],"mappings":";;;;;;;;;;;;;AAeA,IAAa,OAAO,OAAO,OAAO;CAChC,IAAI,OAAO;CACX,MAAM,OAAO;CACb,MAAM,OAAO,SAAS,OAAO,MAAM;CAEnC,QAAQ,OAAO,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC;CAC1C,QAAQ,OAAO,SAAS,IAAI,IAAI,aAAa,YAAY,CAAC;CAC1D,OAAO,OAAO,SAAS,IAAI,IAAI,MAAM,KAAK,CAAC;AAC7C,CAAC;AAID,IAAa,WAAb,cAA8B,KAAK,WAAqB,IAAI,KAAK,0BAA0B,OAAO,CAAC,CAAC,CAClG,OAAO,OAAO;CACZ,MAAM,OAAO,OAAO,KAAK,OAAO,QAAQ;CACxC,OAAO,KAAK,KAAK,OAAO,OAAO,oBAAoB,IAAI,KAAK,CAAC;AAC/D,CAAC,CAAC,CAAC,KAAK,gBAAgB,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,eAAe,IAAI;CAAE,MAAM;CAAyB,KAAK;AAAM,CAAC,CAAC,CACrH,CAAC,CAAC,CAAC;AAEH,IAAa,QAAQ,QAAwC,EAAE,OAAO,CAAC,EAAE,MAAgB,IAAI,KAAK,UAAU,KAAK"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
import { meta } from "#meta";
|
|
4
|
+
//#region src/types/ScriptCapabilities.ts
|
|
5
|
+
var ScriptCapabilities_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
Compiler: () => Compiler,
|
|
7
|
+
Settings: () => Settings
|
|
8
|
+
});
|
|
9
|
+
var Settings = Capability.makeSingleton()(`${meta.profile.key}.capability.settings`);
|
|
10
|
+
var Compiler = Capability.makeSingleton()(`${meta.profile.key}.capability.compiler`);
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Compiler, Settings, ScriptCapabilities_exports as t };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=ScriptCapabilities.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScriptCapabilities.mjs","names":[],"sources":["../../src/types/ScriptCapabilities.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom } from '@effect-atom/atom';\n\nimport * as Capability from '@dxos/app-framework/Capability';\n\nimport { meta } from '#meta';\n\nimport { type Compiler as CompilerType } from '../compiler';\n\n// Inline import to avoid `Settings` namespace alias colliding with the\n// `Settings` capability export below.\nexport const Settings = Capability.makeSingleton<Atom.Writable<import('./Settings').Settings>>()(\n `${meta.profile.key}.capability.settings`,\n);\nexport const Compiler = Capability.makeSingleton<CompilerType>()(`${meta.profile.key}.capability.compiler`);\n"],"mappings":";;;;;;;;AAgBA,IAAa,WAAW,WAAW,cAA4D,CAAC,CAC9F,GAAG,KAAK,QAAQ,IAAI,qBACtB;AACA,IAAa,WAAW,WAAW,cAA4B,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,qBAAqB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { meta } from "#meta";
|
|
3
|
+
import * as ActivationEvent from "@dxos/app-framework/ActivationEvent";
|
|
4
|
+
//#region src/types/ScriptEvents.ts
|
|
5
|
+
var ScriptEvents_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
SetupCompiler: () => SetupCompiler,
|
|
7
|
+
Start: () => Start
|
|
8
|
+
});
|
|
9
|
+
var SetupCompiler = ActivationEvent.make(`${meta.profile.key}.event.setupCompiler`);
|
|
10
|
+
/**
|
|
11
|
+
* The feature's start event: the plugin's start-gated modules (and cross-plugin
|
|
12
|
+
* contributions consumed by this feature) activate here. Fired on demand and by the
|
|
13
|
+
* host's idle trickle.
|
|
14
|
+
*/
|
|
15
|
+
var Start = ActivationEvent.pluginStart(meta.profile.key);
|
|
16
|
+
//#endregion
|
|
17
|
+
export { SetupCompiler, Start, ScriptEvents_exports as t };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=ScriptEvents.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScriptEvents.mjs","names":[],"sources":["../../src/types/ScriptEvents.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as ActivationEvent from '@dxos/app-framework/ActivationEvent';\n\nimport { meta } from '#meta';\n\nexport const SetupCompiler = ActivationEvent.make(`${meta.profile.key}.event.setupCompiler`);\n\n/**\n * The feature's start event: the plugin's start-gated modules (and cross-plugin\n * contributions consumed by this feature) activate here. Fired on demand and by the\n * host's idle trickle.\n */\nexport const Start = ActivationEvent.pluginStart(meta.profile.key);\n"],"mappings":";;;;;;;;AAUA,IAAa,gBAAgB,gBAAgB,KAAK,GAAG,KAAK,QAAQ,IAAI,qBAAqB;;;;;;AAO3F,IAAa,QAAQ,gBAAgB,YAAY,KAAK,QAAQ,GAAG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { t as templates } from "./chunk-templates.mjs";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import { DXN, Database, Type } from "@dxos/echo";
|
|
5
|
+
import { meta } from "#meta";
|
|
6
|
+
import * as Operation from "@dxos/compute/Operation";
|
|
7
|
+
import * as Script from "@dxos/compute/Script";
|
|
8
|
+
//#region src/types/ScriptOperation.ts
|
|
9
|
+
var ScriptOperation_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
CreateScript: () => CreateScript,
|
|
11
|
+
NotebookProps: () => NotebookProps,
|
|
12
|
+
ScriptProps: () => ScriptProps
|
|
13
|
+
});
|
|
14
|
+
var makeKey = (name) => DXN.make(`${meta.profile.key}.operation.${name}`);
|
|
15
|
+
var ScriptProps = Schema.Struct({
|
|
16
|
+
name: Schema.optional(Schema.String),
|
|
17
|
+
gistUrl: Schema.optional(Schema.String.annotations({ title: "Import from Gist (url)" })),
|
|
18
|
+
initialTemplateId: Schema.Literal(...templates.map(({ id }) => id)).pipe(Schema.annotations({ title: "Template" }), Schema.optional)
|
|
19
|
+
});
|
|
20
|
+
var NotebookProps = Schema.Struct({ name: Schema.optional(Schema.String) });
|
|
21
|
+
var CreateScript = Operation.make({
|
|
22
|
+
meta: {
|
|
23
|
+
key: makeKey("createScript"),
|
|
24
|
+
name: "Create Script",
|
|
25
|
+
icon: "ph--code--regular"
|
|
26
|
+
},
|
|
27
|
+
input: Schema.extend(ScriptProps, Schema.Struct({ db: Database.Database })),
|
|
28
|
+
output: Schema.Struct({ object: Type.getSchema(Script.Script) })
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { CreateScript, NotebookProps, ScriptProps, ScriptOperation_exports as t };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=ScriptOperation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScriptOperation.mjs","names":[],"sources":["../../src/types/ScriptOperation.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Script from '@dxos/compute/Script';\nimport { Database, DXN, Type } from '@dxos/echo';\n\nimport { meta } from '#meta';\n\nimport { templates } from '../templates';\n\nconst makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);\n\nexport const ScriptProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n gistUrl: Schema.optional(Schema.String.annotations({ title: 'Import from Gist (url)' })),\n initialTemplateId: Schema.Literal(...templates.map(({ id }) => id)).pipe(\n Schema.annotations({ title: 'Template' }),\n Schema.optional,\n ),\n});\n\nexport const NotebookProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n});\n\nexport const CreateScript = Operation.make({\n meta: { key: makeKey('createScript'), name: 'Create Script', icon: 'ph--code--regular' },\n input: Schema.extend(\n ScriptProps,\n Schema.Struct({\n db: Database.Database,\n }),\n ),\n output: Schema.Struct({\n object: Type.getSchema(Script.Script),\n }),\n});\n"],"mappings":";;;;;;;;;;;;;AAgBA,IAAM,WAAW,SAAiB,IAAI,KAAK,GAAG,KAAK,QAAQ,IAAI,aAAa,MAAM;AAElF,IAAa,cAAc,OAAO,OAAO;CACvC,MAAM,OAAO,SAAS,OAAO,MAAM;CACnC,SAAS,OAAO,SAAS,OAAO,OAAO,YAAY,EAAE,OAAO,yBAAyB,CAAC,CAAC;CACvF,mBAAmB,OAAO,QAAQ,GAAG,UAAU,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,KAClE,OAAO,YAAY,EAAE,OAAO,WAAW,CAAC,GACxC,OAAO,QACT;AACF,CAAC;AAED,IAAa,gBAAgB,OAAO,OAAO,EACzC,MAAM,OAAO,SAAS,OAAO,MAAM,EACrC,CAAC;AAED,IAAa,eAAe,UAAU,KAAK;CACzC,MAAM;EAAE,KAAK,QAAQ,cAAc;EAAG,MAAM;EAAiB,MAAM;CAAoB;CACvF,OAAO,OAAO,OACZ,aACA,OAAO,OAAO,EACZ,IAAI,SAAS,SACf,CAAC,CACH;CACA,QAAQ,OAAO,OAAO,EACpB,QAAQ,KAAK,UAAU,OAAO,MAAM,EACtC,CAAC;AACH,CAAC"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
import { Script } from "@dxos/compute";
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
1
|
import { meta } from "#meta";
|
|
4
|
-
import
|
|
2
|
+
import * as Script from "@dxos/compute/Script";
|
|
3
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
4
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
5
5
|
import { AppGraphBuilder, Compiler, CreateObject, OperationHandler, ReactSurface, ScriptSettings, SkillDefinition } from "#capabilities";
|
|
6
6
|
import { translations } from "#translations";
|
|
7
|
-
import { ScriptEvents } from "#types";
|
|
8
7
|
//#endregion
|
|
9
8
|
//#region src/ScriptPlugin.tsx
|
|
10
|
-
var ScriptPlugin = Plugin.define(meta).pipe(
|
|
11
|
-
activatesOn: AppActivationEvents.SetupSettings,
|
|
12
|
-
activate: ScriptSettings
|
|
13
|
-
}), Plugin.addModule({
|
|
14
|
-
activatesOn: ScriptEvents.SetupCompiler,
|
|
15
|
-
activate: Compiler
|
|
16
|
-
}), AppPlugin.addPluginAssetModule({ asset: {
|
|
9
|
+
var ScriptPlugin = Plugin.define(meta).pipe(Plugin.addModule(AppGraphBuilder), Plugin.addModule(SkillDefinition), Plugin.addModule(CreateObject), Plugin.addModule(OperationHandler), Plugin.addModule(AppCapability.schema([Script.Script])), Plugin.addModule(ReactSurface), Plugin.addModule(AppCapability.translations(translations)), Plugin.addModule(ScriptSettings), Plugin.addModule(Compiler), Plugin.addModule(AppCapability.pluginAsset({
|
|
17
10
|
pluginId: meta.profile.key,
|
|
18
11
|
path: "PLUGIN.mdl",
|
|
19
12
|
content: "---\nid: org.dxos.plugin.script\nname: ScriptPlugin\nversion: 0.1.0\n---\n\nA scripting plugin for `DXOS` Composer that lets users write, deploy, and run custom TypeScript functions as\nECHO objects inside their spaces.\nScripts execute on the Cloudflare Workers-based EDGE runtime and can call DXOS SDK packages, Effect-TS,\nand a curated set of third-party libraries.\nAn AI assistant skill wires CRUD, deploy, invoke, and inspection operations as tools so an agent can\nscaffold, iterate, and test scripts entirely within a chat session.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype Script\n desc: |\n Root ECHO object (typename from @dxos/compute Script.Script).\n Represents a single deployable TypeScript function.\n fields:\n name?: string\n source: string # TypeScript source, must follow Operation pattern\n description?: string\n```\n\n```mdl\ntype Notebook\n desc: |\n Root ECHO object for a multi-cell notebook view.\n Each cell is a Script; the Notebook provides a sequential execution surface.\n fields:\n name?: string\n```\n\n```mdl\ntype Settings\n desc: Plugin-scoped settings atom. Persisted across sessions.\n fields:\n editorInputMode?: EditorInputMode # default, vim, or emacs keybindings\n```\n\n```mdl\ntype InvocationSpan\n desc: A single function invocation record from the EDGE trace feed.\n fields:\n id: string\n timestamp: number # epoch ms\n duration: number # ms\n outcome: success | failure | pending\n input: object\n error?: object\n```\n\n```mdl\ntype DeployedFunction\n desc: Metadata about a function already deployed to the EDGE runtime.\n fields:\n key?: string # unique key; pass to InstallFunction\n name: string\n version: string\n description?: string\n updated?: string # ISO timestamp\n```\n\n## Components\n\n```mdl\ncomponent ScriptArticle\n desc: |\n Primary editor surface for a Script object. Rendered for the Article and\n Section roles. Shows a TypeScript CodeMirror editor with syntax highlight,\n lint, and completion. Companion panels (Execute and Logs) are available\n via the app graph for running and inspecting the script.\n props:\n role: string\n subject: Script\n attendableId?: string\n settings?: Settings\n env?: CompilerEnvironment\n layout: |\n ┌──────────────────────────────────────┐\n │ ScriptToolbar (run, deploy, …) │\n ├──────────────────────────────────────┤\n │ TypescriptEditor (CodeMirror) │\n │ │\n │ // script source │\n └──────────────────────────────────────┘\n```\n\n```mdl\ncomponent NotebookArticle\n desc: |\n Multi-cell notebook surface for a Notebook object. Each cell renders a\n ScriptArticle in Section role. Cells can be added, removed, and reordered.\n props:\n role: string\n subject: Notebook\n attendableId?: string\n env?: CompilerEnvironment\n```\n\n```mdl\ncomponent TestContainer\n desc: |\n Execute companion panel. Renders a form driven by the script's Operation\n input schema; submits the form to invoke the script and shows the response.\n props:\n script: Script\n role: string\n```\n\n```mdl\ncomponent DeploymentDialog\n desc: |\n Dialog for deploying or redeploying a Script to the EDGE runtime.\n Shows current deployment status and lets the user trigger a new deployment.\n props:\n script: Script\n```\n\n```mdl\ncomponent ScriptPluginSettings\n desc: Plugin settings panel; exposes editor keybinding mode selector.\n props:\n settings: Settings\n onSettingsChange: (settings: Settings) → void\n onAuthenticate: () → Promise<void>\n```\n\n## Operations\n\nSkill operations (called by the Script assistant via its tool set).\n\n```mdl\nop create\n desc: |\n Creates a new Script ECHO object with the given name and TypeScript source,\n and adds it to the space. Optionally seeds from a built-in template or a\n GitHub Gist URL. Returns a function reference ID.\n input:\n name: string\n source?: string\n templateId?: string\n output: { function: string }\n effects: [echo:write]\n note: Operation key `org.dxos.function.script.create`.\n```\n\n```mdl\nop read\n desc: Reads the name, source code, and description of an existing Script.\n input:\n function: Ref<Script>\n output: { name?: string, source: string, description?: string }\n effects: [echo:read]\n note: Operation key `org.dxos.function.script.read`.\n```\n\n```mdl\nop update\n desc: |\n Applies one or more string edits (find/replace pairs) to a Script's source\n and optionally updates its name and description.\n input:\n function: Ref<Script>\n name?: string\n description?: string\n edits?: { oldString: string, newString: string, replaceAll?: boolean }[]\n output: { function: string }\n effects: [echo:read, echo:write]\n note: Operation key `org.dxos.function.script.update`.\n```\n\n```mdl\nop delete\n desc: Permanently removes a Script and its source from the space.\n input:\n function: Ref<Script>\n output: void\n effects: [echo:read, echo:write]\n note: Operation key `org.dxos.function.script.delete`.\n```\n\n```mdl\nop deploy\n desc: |\n Compiles and deploys a Script to the EDGE (Cloudflare Workers) runtime.\n The source must export a single Operation handler as default.\n Returns the deployed function ID and optional public URL.\n input:\n function: Ref<Script>\n output: { function: string, functionUrl?: string }\n effects: [echo:read, http]\n errors:\n CompileError: TypeScript source fails to compile\n DeploymentFailed: EDGE runtime rejected the deployment\n note: Operation key `org.dxos.function.script.deploy`.\n```\n\n```mdl\nop invoke\n desc: Calls a deployed EDGE function with an optional JSON payload.\n input:\n function: Ref<Script>\n payload?: unknown\n output: { response: unknown }\n effects: [http]\n errors:\n NotDeployed: function has not been deployed\n InvocationError: function threw at runtime\n note: Operation key `org.dxos.function.script.invoke`.\n```\n\n```mdl\nop inspectInvocations\n desc: |\n Queries the EDGE invocation trace feed for a function and returns\n recent invocation spans (id, timestamp, duration, outcome, input, error).\n input:\n function: Ref<Script>\n limit?: number # default 20\n output: { invocations: InvocationSpan[], total: number }\n effects: [echo:read]\n note: Operation key `org.dxos.function.script.inspect-invocations`.\n```\n\n```mdl\nop queryDeployedFunctions\n desc: Lists all functions currently deployed to the EDGE runtime.\n input:\n (none)\n output: { functions: DeployedFunction[] }\n effects: [http]\n note: Operation key `org.dxos.function.script.query-deployed`.\n```\n\n```mdl\nop installFunction\n desc: |\n Installs a globally-deployed EDGE function into the current space by key.\n Creates a Script ECHO object backed by the remote function.\n The returned function ID can be passed directly to op:invoke.\n input:\n key: string\n output: { function: string, name: string, version: string }\n effects: [echo:write, http]\n note: Operation key `org.dxos.function.script.install`.\n```\n\nUI-facing operation (creates Script via the navtree / \"create object\" flow).\n\n```mdl\nop createScript\n desc: Creates a new Script ECHO object via the Composer create-object flow.\n input:\n name?: string\n gistUrl?: string\n initialTemplateId?: string\n db: Database\n output: { object: Script }\n effects: [echo:write]\n note: Operation key `org.dxos.plugin.script.operation.create-script`.\n```\n\n## Features\n\n```mdl\nfeat F-1: Script ECHO Object\n\n req F-1.1: Script objects are registered via `addSchemaModule` and visible in space object lists.\n req F-1.2: Script objects can be created from the navtree \"+\" menu.\n req F-1.3:\n when: user creates a Script without a template\n then: source is seeded from the default template\n req F-1.4:\n when: user provides a GitHub Gist URL\n then: gist content is fetched and used as initial source\n```\n\n```mdl\nfeat F-2: Script Editor\n\n req F-2.1: ScriptArticle renders a TypeScript-aware CodeMirror editor for the Article role.\n req F-2.2: Editor keybinding mode (default/vim/emacs) is configurable via plugin settings.\n req F-2.3: Changes to source are persisted to the Script ECHO object reactively.\n req F-2.4:\n when: script object changes externally (peer edit)\n then: editor content updates without losing cursor position if possible\n```\n\n```mdl\nfeat F-3: Deploy to EDGE\n\n req F-3.1: A Deploy button in the ScriptToolbar opens the DeploymentDialog.\n req F-3.2:\n when: user confirms deployment\n then: op:deploy is called; script compiled and sent to EDGE runtime\n req F-3.3:\n when: compilation fails\n then: error messages are surfaced to the user; no deployment occurs\n req F-3.4:\n when: deployment succeeds\n then: dialog shows the function URL (if available)\n```\n\n```mdl\nfeat F-4: Execute Companion\n\n req F-4.1: An \"Execute\" companion node is added to every Script in the app graph.\n req F-4.2: TestContainer renders a form derived from the script's Operation input schema.\n req F-4.3:\n when: user submits the form\n then: op:invoke is called with the form payload; response displayed\n req F-4.4: A \"Logs\" companion node shows the invocation trace via InvocationTraceContainer.\n```\n\n```mdl\nfeat F-5: Script Skill\n\n req F-5.1: A skill with key `org.dxos.skill.script` is contributed via `addSkillDefinitionModule`.\n req F-5.2: Skill tool set includes: create, read, update, delete, deploy, invoke,\n inspectInvocations, queryDeployedFunctions, installFunction.\n req F-5.3: System instructions describe the EDGE Operation pattern, required export format,\n and available packages.\n req F-5.4: Skill is agent-enabled; the assistant can activate it autonomously.\n```\n\n```mdl\nfeat F-6: Notebook\n\n req F-6.1: Notebook objects are registered and can be created from the navtree.\n req F-6.2: NotebookArticle renders each linked Script as a sequential cell.\n req F-6.3: Cells can be added and removed independently.\n```\n\n```mdl\nfeat F-7: Plugin Settings\n\n req F-7.1: ScriptPluginSettings is rendered via the app settings surface.\n req F-7.2: Editor input mode is persisted in the Settings atom.\n req F-7.3: An Authenticate button lets the user write an access credential to HALO.\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create script from default template\n given: a space is open and plugin-script is loaded\n when: user creates a new Script without template selection\n then:\n - a Script object appears in the space\n - its source contains the default template code\n - ScriptArticle renders the source in the editor\n```\n\n```mdl\ntest T-2: Create script from Gist\n given: a public GitHub Gist URL is known\n when: user creates a Script with the Gist URL\n then:\n - gist content is fetched and stored as the script source\n - editor shows the fetched content\n```\n\n```mdl\ntest T-3: Edit and persist source\n given: a Script is open in ScriptArticle\n when: user edits the source\n then:\n - the Script ECHO object's source field is updated\n - closing and reopening the article shows the same content\n```\n\n```mdl\ntest T-4: Deploy script\n given: a Script with valid source following the Operation pattern\n when: user opens DeploymentDialog and confirms\n then:\n - op:deploy succeeds\n - dialog shows success state and function URL\n```\n\n```mdl\ntest T-5: Invoke deployed function\n given: a Script is deployed\n when: user opens the Execute companion and submits a payload\n then:\n - op:invoke is called with the payload\n - response is displayed in TestContainer\n```\n\n```mdl\ntest T-6: Inspect invocations\n given: a Script has been invoked at least once\n when: user opens the Logs companion\n then:\n - InvocationTraceContainer shows at least one invocation span\n - span includes timestamp, duration, and outcome\n```\n\n```mdl\ntest T-7: Skill tools resolve\n given: composer-app with plugin-script loaded\n when: AppCapabilities.SkillDefinition is queried for `org.dxos.skill.script`\n then:\n - skill is present\n - tool set includes create, read, update, delete, deploy, invoke,\n inspectInvocations, queryDeployedFunctions, and installFunction\n```\n\n```mdl\ntest T-8: Agent creates and deploys script\n given: a Script assistant session is active\n when: agent calls op:create with a name and source\n then: a Script object is created in the space\n when: agent calls op:deploy\n then: function is deployed; op returns a function ID\n when: agent calls op:invoke with a payload\n then: response is returned without error\n```\n\n```mdl\ntest T-9: QueryDeployedFunctions and install\n given: at least one function is deployed to the EDGE runtime\n when: op:queryDeployedFunctions is called\n then:\n - result contains at least one DeployedFunction entry\n when: op:installFunction is called with that entry's key\n then:\n - a new Script ECHO object appears in the space\n - op returns the function ID, name, and version\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive — the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n",
|
|
20
13
|
mimeType: "application/x-mdl"
|
|
21
|
-
}
|
|
14
|
+
})), Plugin.make);
|
|
22
15
|
//#endregion
|
|
23
16
|
export { ScriptPlugin, ScriptPlugin as default };
|
|
24
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptPlugin.mjs","names":[],"sources":["../../src/ScriptPlugin.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"ScriptPlugin.mjs","names":[],"sources":["../../src/ScriptPlugin.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as Script from '@dxos/compute/Script';\n\nimport {\n AppGraphBuilder,\n Compiler,\n CreateObject,\n OperationHandler,\n ReactSurface,\n ScriptSettings,\n SkillDefinition,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const ScriptPlugin = Plugin.define(meta).pipe(\n Plugin.addModule(AppGraphBuilder),\n Plugin.addModule(SkillDefinition),\n Plugin.addModule(CreateObject),\n Plugin.addModule(OperationHandler),\n Plugin.addModule(AppCapability.schema([Script.Script])),\n Plugin.addModule(ReactSurface),\n Plugin.addModule(AppCapability.translations(translations)),\n Plugin.addModule(ScriptSettings),\n Plugin.addModule(Compiler),\n Plugin.addModule(\n AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n }),\n ),\n Plugin.make,\n);\n\nexport default ScriptPlugin;\n"],"mappings":";;;;;;;;AAuBA,IAAa,eAAe,OAAO,OAAO,IAAI,CAAC,CAAC,KAC9C,OAAO,UAAU,eAAe,GAChC,OAAO,UAAU,eAAe,GAChC,OAAO,UAAU,YAAY,GAC7B,OAAO,UAAU,gBAAgB,GACjC,OAAO,UAAU,cAAc,OAAO,CAAC,OAAO,MAAM,CAAC,CAAC,GACtD,OAAO,UAAU,YAAY,GAC7B,OAAO,UAAU,cAAc,aAAa,YAAY,CAAC,GACzD,OAAO,UAAU,cAAc,GAC/B,OAAO,UAAU,QAAQ,GACzB,OAAO,UACL,cAAc,YAAY;CACxB,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC,CACH,GACA,OAAO,IACT"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Script } from "@dxos/compute";
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
1
|
import { meta } from "#meta";
|
|
4
|
-
import
|
|
2
|
+
import * as Script from "@dxos/compute/Script";
|
|
3
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
4
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
5
5
|
import { AppGraphBuilder, CreateObject, OperationHandler, SkillDefinition } from "#capabilities";
|
|
6
6
|
//#region src/ScriptPlugin.node.ts
|
|
7
|
-
var ScriptPlugin = Plugin.define(meta).pipe(
|
|
7
|
+
var ScriptPlugin = Plugin.define(meta).pipe(Plugin.addModule(AppGraphBuilder), Plugin.addModule(SkillDefinition), Plugin.addModule(CreateObject), Plugin.addModule(OperationHandler), Plugin.addModule(AppCapability.schema([Script.Script])), Plugin.make);
|
|
8
8
|
//#endregion
|
|
9
9
|
export { ScriptPlugin, ScriptPlugin as default };
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptPlugin.node.mjs","names":[],"sources":["../../src/ScriptPlugin.node.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"ScriptPlugin.node.mjs","names":[],"sources":["../../src/ScriptPlugin.node.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as Script from '@dxos/compute/Script';\n\nimport { AppGraphBuilder, CreateObject, OperationHandler, SkillDefinition } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const ScriptPlugin = Plugin.define(meta).pipe(\n Plugin.addModule(AppGraphBuilder),\n Plugin.addModule(SkillDefinition),\n Plugin.addModule(CreateObject),\n Plugin.addModule(OperationHandler),\n Plugin.addModule(AppCapability.schema([Script.Script])),\n Plugin.make,\n);\n\nexport default ScriptPlugin;\n"],"mappings":";;;;;;AAWA,IAAa,eAAe,OAAO,OAAO,IAAI,CAAC,CAAC,KAC9C,OAAO,UAAU,eAAe,GAChC,OAAO,UAAU,eAAe,GAChC,OAAO,UAAU,YAAY,GAC7B,OAAO,UAAU,gBAAgB,GACjC,OAAO,UAAU,cAAc,OAAO,CAAC,OAAO,MAAM,CAAC,CAAC,GACtD,OAAO,IACT"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Script } from "@dxos/compute";
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
1
|
import { meta } from "#meta";
|
|
4
|
-
import
|
|
2
|
+
import * as Script from "@dxos/compute/Script";
|
|
3
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
4
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
5
5
|
import { OperationHandler } from "#capabilities";
|
|
6
6
|
//#region src/ScriptPlugin.workerd.ts
|
|
7
|
-
var ScriptPlugin = Plugin.define(meta).pipe(
|
|
7
|
+
var ScriptPlugin = Plugin.define(meta).pipe(Plugin.addModule(OperationHandler), Plugin.addModule(AppCapability.schema([Script.Script])), Plugin.make);
|
|
8
8
|
//#endregion
|
|
9
9
|
export { ScriptPlugin, ScriptPlugin as default };
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptPlugin.workerd.mjs","names":[],"sources":["../../src/ScriptPlugin.workerd.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"ScriptPlugin.workerd.mjs","names":[],"sources":["../../src/ScriptPlugin.workerd.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as Script from '@dxos/compute/Script';\n\nimport { OperationHandler } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const ScriptPlugin = Plugin.define(meta).pipe(\n Plugin.addModule(OperationHandler),\n Plugin.addModule(AppCapability.schema([Script.Script])),\n Plugin.make,\n);\n\nexport default ScriptPlugin;\n"],"mappings":";;;;;;AAWA,IAAa,eAAe,OAAO,OAAO,IAAI,CAAC,CAAC,KAC9C,OAAO,UAAU,gBAAgB,GACjC,OAAO,UAAU,cAAc,OAAO,CAAC,OAAO,MAAM,CAAC,CAAC,GACtD,OAAO,IACT"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { EditorInputMode } from "@dxos/ui-editor/types";
|
|
4
|
+
//#region src/types/Settings.ts
|
|
5
|
+
var Settings_exports = /* @__PURE__ */ __exportAll({ Settings: () => Settings });
|
|
6
|
+
var Settings = Schema.mutable(Schema.Struct({ editorInputMode: EditorInputMode.annotations({
|
|
7
|
+
title: "Editor input mode",
|
|
8
|
+
description: "Choose the keybinding style for the script editor."
|
|
9
|
+
}) }));
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Settings, Settings_exports as t };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=Settings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.mjs","names":[],"sources":["../../src/types/Settings.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { EditorInputMode } from '@dxos/ui-editor/types';\n\nexport const Settings = Schema.mutable(\n Schema.Struct({\n editorInputMode: EditorInputMode.annotations({\n title: 'Editor input mode',\n description: 'Choose the keybinding style for the script editor.',\n }),\n }),\n);\n\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n"],"mappings":";;;;;AAUA,IAAa,WAAW,OAAO,QAC7B,OAAO,OAAO,EACZ,iBAAiB,gBAAgB,YAAY;CAC3C,OAAO;CACP,aAAa;AACf,CAAC,EACH,CAAC,CACH"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
2
|
+
import * as ActivationEvents from "@dxos/app-framework/ActivationEvents";
|
|
3
|
+
import * as SpaceCapability from "@dxos/plugin-space/SpaceCapability";
|
|
2
4
|
//#region src/capabilities/node.ts
|
|
3
|
-
var AppGraphBuilder =
|
|
4
|
-
var SkillDefinition =
|
|
5
|
-
var CreateObject =
|
|
6
|
-
var
|
|
7
|
-
var OperationHandler = Capability.lazy("OperationHandler", () => import("../chunk-operation-handler.mjs"));
|
|
5
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("../chunk-app-graph-builder.mjs"));
|
|
6
|
+
var SkillDefinition = AppCapability.skillDefinition(() => import("../chunk-skill-definition.mjs"));
|
|
7
|
+
var CreateObject = SpaceCapability.createObject(() => import("../chunk-create-object.mjs"));
|
|
8
|
+
var OperationHandler = AppCapability.operationHandler(() => import("../chunk-operation-handler.mjs"), { activatesOn: ActivationEvents.Idle });
|
|
8
9
|
//#endregion
|
|
9
|
-
export { AppGraphBuilder,
|
|
10
|
+
export { AppGraphBuilder, CreateObject, OperationHandler, SkillDefinition };
|
|
10
11
|
|
|
11
12
|
//# sourceMappingURL=node.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.mjs","names":[],"sources":["../../../src/capabilities/node.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"node.mjs","names":[],"sources":["../../../src/capabilities/node.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as SpaceCapability from '@dxos/plugin-space/SpaceCapability';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder'));\nexport const SkillDefinition = AppCapability.skillDefinition(() => import('./skill-definition'));\nexport const CreateObject = SpaceCapability.createObject(() => import('./create-object'));\nexport const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler'), {\n activatesOn: ActivationEvents.Idle,\n});\n"],"mappings":";;;;AAQA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,iCAAsB;AAChG,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAAqB;AAC/F,IAAa,eAAe,gBAAgB,mBAAmB,OAAO,6BAAkB;AACxF,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,mCAAwB,EAClG,aAAa,iBAAiB,KAChC,CAAC"}
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Compiler as Compiler$1, Settings } from "./ScriptCapabilities.mjs";
|
|
2
|
+
import { SetupCompiler } from "./ScriptEvents.mjs";
|
|
3
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
4
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
5
|
+
import * as ActivationEvents from "@dxos/app-framework/ActivationEvents";
|
|
6
|
+
import * as SpaceCapability from "@dxos/plugin-space/SpaceCapability";
|
|
2
7
|
//#region src/capabilities/index.ts
|
|
3
|
-
var AppGraphBuilder =
|
|
4
|
-
var SkillDefinition =
|
|
5
|
-
var CreateObject =
|
|
6
|
-
var Compiler = Capability.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"));
|
|
9
|
+
var SkillDefinition = AppCapability.skillDefinition(() => import("./chunk-skill-definition.mjs"));
|
|
10
|
+
var CreateObject = SpaceCapability.createObject(() => import("./chunk-create-object.mjs"));
|
|
11
|
+
var Compiler = Capability.lazyModule("Compiler", {
|
|
12
|
+
provides: [Compiler$1],
|
|
13
|
+
activatesOn: SetupCompiler
|
|
14
|
+
}, () => import("./chunk-compiler2.mjs"));
|
|
15
|
+
var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"), { activatesOn: ActivationEvents.Idle });
|
|
16
|
+
var ReactSurface = AppCapability.surface(() => import("./chunk-react-surface.mjs"), { roles: [
|
|
17
|
+
"org.dxos.role.article",
|
|
18
|
+
"org.dxos.role.dialog",
|
|
19
|
+
"org.dxos.role.objectProperties",
|
|
20
|
+
"org.dxos.role.section"
|
|
21
|
+
] });
|
|
22
|
+
var ScriptSettings = AppCapability.settings(() => import("./chunk-settings.mjs"), {
|
|
23
|
+
activatesOn: ActivationEvents.Idle,
|
|
24
|
+
provides: [Settings]
|
|
25
|
+
});
|
|
10
26
|
//#endregion
|
|
11
27
|
export { AppGraphBuilder, Compiler, CreateObject, OperationHandler, ReactSurface, ScriptSettings, SkillDefinition };
|
|
12
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as SpaceCapability from '@dxos/plugin-space/SpaceCapability';\n\nimport * as ScriptCapabilities from '../types/ScriptCapabilities';\nimport * as ScriptEvents from '../types/ScriptEvents';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder'));\nexport const SkillDefinition = AppCapability.skillDefinition(() => import('./skill-definition'));\nexport const CreateObject = SpaceCapability.createObject(() => import('./create-object'));\nexport const Compiler = Capability.lazyModule(\n 'Compiler',\n {\n provides: [ScriptCapabilities.Compiler],\n // Genuine runtime event: the compiler is only loaded on demand (`hooks/useCompiler.ts`), not at startup.\n activatesOn: ScriptEvents.SetupCompiler,\n },\n () => import('./compiler'),\n);\nexport const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler'), {\n activatesOn: ActivationEvents.Idle,\n});\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface'), {\n roles: ['org.dxos.role.article', 'org.dxos.role.dialog', 'org.dxos.role.objectProperties', 'org.dxos.role.section'],\n});\nexport const ScriptSettings = AppCapability.settings(() => import('./settings'), {\n activatesOn: ActivationEvents.Idle,\n provides: [ScriptCapabilities.Settings],\n});\n"],"mappings":";;;;;;;AAYA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAAsB;AAChG,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,+BAAqB;AAC/F,IAAa,eAAe,gBAAgB,mBAAmB,OAAO,4BAAkB;AACxF,IAAa,WAAW,WAAW,WACjC,YACA;CACE,UAAU,CAAC,UAA2B;CAEtC,aAAa;AACf,SACM,OAAO,wBACf;AACA,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,kCAAwB,EAClG,aAAa,iBAAiB,KAChC,CAAC;AACD,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAoB,EACjF,OAAO;CAAC;CAAyB;CAAwB;CAAkC;AAAuB,EACpH,CAAC;AACD,IAAa,iBAAiB,cAAc,eAAe,OAAO,yBAAe;CAC/E,aAAa,iBAAiB;CAC9B,UAAU,CAAC,QAA2B;AACxC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { meta } from "#meta";
|
|
2
|
-
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
3
2
|
import { useEffect, useMemo } from "react";
|
|
4
3
|
import { Button, Dialog, useTranslation } from "@dxos/react-ui";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
7
6
|
import { useCreateAndDeployScriptTemplates } from "#hooks";
|
|
8
7
|
import { getSpace } from "@dxos/react-client/echo";
|
|
8
|
+
import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
|
|
9
9
|
//#region src/containers/DeploymentDialog/DeploymentDialog.tsx
|
|
10
10
|
var DeploymentDialog = ({ accessToken, scriptTemplates }) => {
|
|
11
11
|
const { t } = useTranslation(meta.profile.key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-DeploymentDialog.mjs","names":[],"sources":["../../src/containers/DeploymentDialog/DeploymentDialog.tsx"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useEffect, useMemo } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport
|
|
1
|
+
{"version":3,"file":"chunk-DeploymentDialog.mjs","names":[],"sources":["../../src/containers/DeploymentDialog/DeploymentDialog.tsx"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useEffect, useMemo } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport { type AccessToken } from '@dxos/link';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Button, Dialog, useTranslation } from '@dxos/react-ui';\n\nimport { useCreateAndDeployScriptTemplates } from '#hooks';\nimport { meta } from '#meta';\n\nimport { type Template } from '../../templates';\n\n// TODO(ZaymonFC):\n// - Show activity and feedback to the user.\n// - Only take an array of templateIds and get the name from the data.\n// - Pending / onError states.\n\nexport type DeploymentDialogProps = {\n accessToken: AccessToken.AccessToken;\n scriptTemplates: Template[];\n};\n\nexport const DeploymentDialog = ({ accessToken, scriptTemplates }: DeploymentDialogProps) => {\n const { t } = useTranslation(meta.profile.key);\n const space = useMemo(() => getSpace(accessToken), [accessToken]);\n\n // TODO(ZaymonFC): Thinking further. All of this should get moved to intents to run async in the background.\n // Deployment shouldn't be tied to the lifecycle of the dialogue component.\n const { handleCreateAndDeployScripts, status } = useCreateAndDeployScriptTemplates(space, scriptTemplates);\n const { invokePromise } = useOperationInvoker();\n\n useEffect(() => {\n if (status === 'success') {\n // TODO(ZaymonFC): We can probably re-use this toast for normal script deployment.\n void invokePromise(LayoutOperation.AddToast, {\n id: `${meta.profile.key}.deployment-success`,\n icon: 'ph--check--regular',\n duration: Infinity,\n title: ['script-deployment-toast.label', { ns: meta.profile.key, count: scriptTemplates.length }],\n description: ['script-deployment-toast.description', { ns: meta.profile.key, count: scriptTemplates.length }],\n closeLabel: ['script-deployment-toast-close.label', { ns: meta.profile.key, count: scriptTemplates.length }],\n });\n void invokePromise(LayoutOperation.UpdateDialog, { state: false });\n }\n if (status === 'error') {\n void invokePromise(LayoutOperation.UpdateDialog, { state: false });\n void invokePromise(LayoutOperation.AddToast, {\n id: `${meta.profile.key}.deployment-error`,\n icon: 'ph--warning--regular',\n duration: Infinity,\n title: ['script-deployment-error-toast.label', { ns: meta.profile.key, count: scriptTemplates.length }],\n description: [\n 'script-deployment-error-toast.description',\n { ns: meta.profile.key, count: scriptTemplates.length },\n ],\n closeLabel: [\n 'script-deployment-error-toast-close.label',\n { ns: meta.profile.key, count: scriptTemplates.length },\n ],\n });\n }\n }, [status, invokePromise]);\n\n return (\n <Dialog.Content>\n <Dialog.Header>\n <Dialog.Title>{t('deployment-dialog.title')}</Dialog.Title>\n <Dialog.Close asChild>\n <Dialog.ActionIconButton action='close' />\n </Dialog.Close>\n </Dialog.Header>\n <Dialog.Body>\n <p>\n {t('deployment-dialog-scripts-found.message', {\n count: scriptTemplates.length,\n })}\n </p>\n <ul className='pt-2'>\n {scriptTemplates.map((template) => {\n return <li key={template.id}>{template.name}</li>;\n })}\n </ul>\n </Dialog.Body>\n <Dialog.ActionBar>\n <Dialog.Close asChild>\n <Button disabled={status === 'pending'}>{t('deployment-dialog-skip-button.label')}</Button>\n </Dialog.Close>\n <Button variant='primary' onClick={handleCreateAndDeployScripts} disabled={status === 'pending'}>\n {status === 'pending'\n ? t('deployment-dialog-deploy-functions-pending-button.label', {\n count: scriptTemplates.length,\n })\n : t('deployment-dialog-deploy-functions-button.label', {\n count: scriptTemplates.length,\n })}\n </Button>\n </Dialog.ActionBar>\n </Dialog.Content>\n );\n};\n\nDeploymentDialog.displayName = 'DeploymentDialog';\n"],"mappings":";;;;;;;;;AA2BA,IAAa,oBAAoB,EAAE,aAAa,sBAA6C;CAC3F,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAK7C,MAAM,EAAE,8BAA8B,WAAW,kCAJnC,cAAc,SAAS,WAAW,GAAG,CAAC,WAAW,CAIoB,GAAO,eAAe;CACzG,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,gBAAgB;EACd,IAAI,WAAW,WAAW;GAExB,cAAmB,gBAAgB,UAAU;IAC3C,IAAI,GAAG,KAAK,QAAQ,IAAI;IACxB,MAAM;IACN,UAAU;IACV,OAAO,CAAC,iCAAiC;KAAE,IAAI,KAAK,QAAQ;KAAK,OAAO,gBAAgB;IAAO,CAAC;IAChG,aAAa,CAAC,uCAAuC;KAAE,IAAI,KAAK,QAAQ;KAAK,OAAO,gBAAgB;IAAO,CAAC;IAC5G,YAAY,CAAC,uCAAuC;KAAE,IAAI,KAAK,QAAQ;KAAK,OAAO,gBAAgB;IAAO,CAAC;GAC7G,CAAC;GACD,cAAmB,gBAAgB,cAAc,EAAE,OAAO,MAAM,CAAC;EACnE;EACA,IAAI,WAAW,SAAS;GACtB,cAAmB,gBAAgB,cAAc,EAAE,OAAO,MAAM,CAAC;GACjE,cAAmB,gBAAgB,UAAU;IAC3C,IAAI,GAAG,KAAK,QAAQ,IAAI;IACxB,MAAM;IACN,UAAU;IACV,OAAO,CAAC,uCAAuC;KAAE,IAAI,KAAK,QAAQ;KAAK,OAAO,gBAAgB;IAAO,CAAC;IACtG,aAAa,CACX,6CACA;KAAE,IAAI,KAAK,QAAQ;KAAK,OAAO,gBAAgB;IAAO,CACxD;IACA,YAAY,CACV,6CACA;KAAE,IAAI,KAAK,QAAQ;KAAK,OAAO,gBAAgB;IAAO,CACxD;GACF,CAAC;EACH;CACF,GAAG,CAAC,QAAQ,aAAa,CAAC;CAE1B,OACE,qBAAC,OAAO,SAAR,EAAA,UAAA;EACE,qBAAC,OAAO,QAAR,EAAA,UAAA,CACE,oBAAC,OAAO,OAAR,EAAA,UAAe,EAAE,yBAAyB,EAAgB,CAAA,GAC1D,oBAAC,OAAO,OAAR;GAAc,SAAA;aACZ,oBAAC,OAAO,kBAAR,EAAyB,QAAO,QAAS,CAAA;EAC7B,CAAA,CACD,EAAA,CAAA;EACf,qBAAC,OAAO,MAAR,EAAA,UAAA,CACE,oBAAC,KAAD,EAAA,UACG,EAAE,2CAA2C,EAC5C,OAAO,gBAAgB,OACzB,CAAC,EACA,CAAA,GACH,oBAAC,MAAD;GAAI,WAAU;aACX,gBAAgB,KAAK,aAAa;IACjC,OAAO,oBAAC,MAAD,EAAA,UAAuB,SAAS,KAAS,GAAhC,SAAS,EAAuB;GAClD,CAAC;EACC,CAAA,CACO,EAAA,CAAA;EACb,qBAAC,OAAO,WAAR,EAAA,UAAA,CACE,oBAAC,OAAO,OAAR;GAAc,SAAA;aACZ,oBAAC,QAAD;IAAQ,UAAU,WAAW;cAAY,EAAE,qCAAqC;GAAU,CAAA;EAC9E,CAAA,GACd,oBAAC,QAAD;GAAQ,SAAQ;GAAU,SAAS;GAA8B,UAAU,WAAW;aACnF,WAAW,YACR,EAAE,2DAA2D,EAC3D,OAAO,gBAAgB,OACzB,CAAC,IACD,EAAE,mDAAmD,EACnD,OAAO,gBAAgB,OACzB,CAAC;EACC,CAAA,CACQ,EAAA,CAAA;CACJ,EAAA,CAAA;AAEpB;AAEA,iBAAiB,cAAc"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isNonNullable, trim } from "@dxos/util";
|
|
1
|
+
import * as Instructions from "@dxos/compute/Instructions";
|
|
3
2
|
import { Filter, Obj, Query, Ref } from "@dxos/echo";
|
|
4
|
-
import
|
|
3
|
+
import * as Graph from "@dxos/plugin-explorer/Graph";
|
|
5
4
|
import { Text, ViewModel } from "@dxos/schema";
|
|
6
5
|
import { meta } from "#meta";
|
|
6
|
+
import * as Operation from "@dxos/compute/Operation";
|
|
7
|
+
import { isNonNullable, trim } from "@dxos/util";
|
|
8
|
+
import * as Skill from "@dxos/compute/Skill";
|
|
7
9
|
import { log } from "@dxos/log";
|
|
8
10
|
import { useCallback, useContext, useMemo, useState } from "react";
|
|
9
11
|
import { DropdownMenu, IconButton, Panel, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
@@ -412,7 +414,7 @@ var ComputeGraph = class {
|
|
|
412
414
|
log.error("no expression for cell", { cellId }, {
|
|
413
415
|
"~LogMeta": "~LogMeta",
|
|
414
416
|
F: __dxlog_file$1,
|
|
415
|
-
L:
|
|
417
|
+
L: 104,
|
|
416
418
|
S: this
|
|
417
419
|
});
|
|
418
420
|
continue;
|
|
@@ -422,7 +424,7 @@ var ComputeGraph = class {
|
|
|
422
424
|
log.error("no source for cell", { cellId }, {
|
|
423
425
|
"~LogMeta": "~LogMeta",
|
|
424
426
|
F: __dxlog_file$1,
|
|
425
|
-
L:
|
|
427
|
+
L: 110,
|
|
426
428
|
S: this
|
|
427
429
|
});
|
|
428
430
|
continue;
|
|
@@ -448,7 +450,7 @@ var ComputeGraph = class {
|
|
|
448
450
|
}, {
|
|
449
451
|
"~LogMeta": "~LogMeta",
|
|
450
452
|
F: __dxlog_file$1,
|
|
451
|
-
L:
|
|
453
|
+
L: 146,
|
|
452
454
|
S: this
|
|
453
455
|
});
|
|
454
456
|
}
|
|
@@ -525,7 +527,7 @@ var NotebookArticle = ({ role, subject: notebook, attendableId, env }) => {
|
|
|
525
527
|
invariant(db, void 0, {
|
|
526
528
|
"~LogMeta": "~LogMeta",
|
|
527
529
|
F: __dxlog_file,
|
|
528
|
-
L:
|
|
530
|
+
L: 52,
|
|
529
531
|
S: void 0,
|
|
530
532
|
A: ["db", ""]
|
|
531
533
|
});
|
|
@@ -575,7 +577,7 @@ var NotebookArticle = ({ role, subject: notebook, attendableId, env }) => {
|
|
|
575
577
|
invariant(graph, void 0, {
|
|
576
578
|
"~LogMeta": "~LogMeta",
|
|
577
579
|
F: __dxlog_file,
|
|
578
|
-
L:
|
|
580
|
+
L: 97,
|
|
579
581
|
S: this,
|
|
580
582
|
A: ["graph", ""]
|
|
581
583
|
});
|
|
@@ -609,7 +611,7 @@ var NotebookArticle = ({ role, subject: notebook, attendableId, env }) => {
|
|
|
609
611
|
invariant(notebook, void 0, {
|
|
610
612
|
"~LogMeta": "~LogMeta",
|
|
611
613
|
F: __dxlog_file,
|
|
612
|
-
L:
|
|
614
|
+
L: 130,
|
|
613
615
|
S: void 0,
|
|
614
616
|
A: ["notebook", ""]
|
|
615
617
|
});
|
|
@@ -645,7 +647,7 @@ var NotebookArticle = ({ role, subject: notebook, attendableId, env }) => {
|
|
|
645
647
|
invariant(notebook, void 0, {
|
|
646
648
|
"~LogMeta": "~LogMeta",
|
|
647
649
|
F: __dxlog_file,
|
|
648
|
-
L:
|
|
650
|
+
L: 165,
|
|
649
651
|
S: void 0,
|
|
650
652
|
A: ["notebook", ""]
|
|
651
653
|
});
|
|
@@ -702,7 +704,7 @@ var runPrompt = Effect.fn(function* ({ instructions, input, onResult }) {
|
|
|
702
704
|
log.error(error.message, error.cause ?? error.stack, {
|
|
703
705
|
"~LogMeta": "~LogMeta",
|
|
704
706
|
F: __dxlog_file,
|
|
705
|
-
L:
|
|
707
|
+
L: 227,
|
|
706
708
|
S: this
|
|
707
709
|
});
|
|
708
710
|
onResult(error.message);
|