@dxos/plugin-script 0.9.1-main.c7dcc2e112 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLUGIN.mdl +9 -9
- package/dist/lib/neutral/{NotebookArticle-E35G2Y2I.mjs → NotebookArticle-AOBB3XGD.mjs} +27 -45
- package/dist/lib/neutral/NotebookArticle-AOBB3XGD.mjs.map +7 -0
- package/dist/lib/neutral/{ScriptArticle-QW26LOKU.mjs → ScriptArticle-I3DOJARR.mjs} +4 -4
- package/dist/lib/neutral/ScriptArticle-I3DOJARR.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.mjs +4 -4
- package/dist/lib/neutral/ScriptPlugin.mjs.map +3 -3
- package/dist/lib/neutral/ScriptPlugin.node.mjs +3 -3
- package/dist/lib/neutral/ScriptPlugin.node.mjs.map +3 -3
- package/dist/lib/neutral/{ScriptProperties-ADTWXG6O.mjs → ScriptProperties-RHDQGMGT.mjs} +148 -148
- package/dist/lib/neutral/ScriptProperties-RHDQGMGT.mjs.map +7 -0
- package/dist/lib/neutral/ScriptSettings-NS3ZY7ZR.mjs +35 -0
- package/dist/lib/neutral/ScriptSettings-NS3ZY7ZR.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +6 -6
- package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
- package/dist/lib/neutral/capabilities/node.mjs +5 -5
- package/dist/lib/neutral/capabilities/node.mjs.map +3 -3
- package/dist/lib/neutral/{chunk-ZPFRRBZW.mjs → chunk-652CIABA.mjs} +10 -9
- package/dist/lib/neutral/chunk-652CIABA.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-TRKXIP2Q.mjs → chunk-6DOWVKIW.mjs} +4 -5
- package/dist/lib/neutral/chunk-6DOWVKIW.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-BDHDBPVM.mjs → chunk-CHNFYLKW.mjs} +12 -12
- package/dist/lib/neutral/chunk-CHNFYLKW.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-VXDJH6OL.mjs → chunk-INFWOSTM.mjs} +14 -8
- package/dist/lib/neutral/chunk-INFWOSTM.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-JAJ64B3E.mjs → chunk-KSVKXCTX.mjs} +2 -2
- package/dist/lib/neutral/chunk-USJ44FIU.mjs +8 -0
- package/dist/lib/neutral/{chunk-O6A5PTB3.mjs.map → chunk-USJ44FIU.mjs.map} +1 -1
- package/dist/lib/neutral/{chunk-QV6NCUGM.mjs → chunk-WAGQ77UQ.mjs} +6 -6
- package/dist/lib/neutral/chunk-WAGQ77UQ.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +120 -91
- package/dist/lib/neutral/components/index.mjs.map +4 -4
- package/dist/lib/neutral/containers/index.mjs +5 -3
- package/dist/lib/neutral/containers/index.mjs.map +3 -3
- package/dist/lib/neutral/{create-6LC57CCC.mjs → create-SGHWWTET.mjs} +4 -4
- package/dist/lib/neutral/{create-6LC57CCC.mjs.map → create-SGHWWTET.mjs.map} +4 -4
- package/dist/lib/neutral/{create-object-FZM5ASWM.mjs → create-object-QW66KQWS.mjs} +1 -3
- package/dist/lib/neutral/{create-object-FZM5ASWM.mjs.map → create-object-QW66KQWS.mjs.map} +3 -3
- package/dist/lib/neutral/{create-script-YW437XYZ.mjs → create-script-CIEJOBIU.mjs} +4 -4
- package/dist/lib/neutral/{create-script-YW437XYZ.mjs.map → create-script-CIEJOBIU.mjs.map} +3 -3
- package/dist/lib/neutral/{delete-HCQIQFVP.mjs → delete-72RXVLVI.mjs} +3 -3
- package/dist/lib/neutral/{delete-HCQIQFVP.mjs.map → delete-72RXVLVI.mjs.map} +1 -1
- package/dist/lib/neutral/{deploy-7JVMMHSH.mjs → deploy-PJTJAQZY.mjs} +10 -6
- package/dist/lib/neutral/deploy-PJTJAQZY.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +2 -2
- package/dist/lib/neutral/hooks/index.mjs.map +2 -2
- package/dist/lib/neutral/index.mjs +8 -8
- package/dist/lib/neutral/{inspect-invocations-TAOYDT4H.mjs → inspect-invocations-ZUXVUAML.mjs} +5 -5
- package/dist/lib/neutral/inspect-invocations-ZUXVUAML.mjs.map +7 -0
- package/dist/lib/neutral/{install-function-FJIE2JAI.mjs → install-function-YFDZLVMJ.mjs} +4 -4
- package/dist/lib/neutral/{install-function-FJIE2JAI.mjs.map → install-function-YFDZLVMJ.mjs.map} +1 -1
- package/dist/lib/neutral/{invoke-3HVWY2KF.mjs → invoke-CDRBQ2WA.mjs} +4 -4
- package/dist/lib/neutral/{invoke-3HVWY2KF.mjs.map → invoke-CDRBQ2WA.mjs.map} +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{operation-handler-6IZ7L4L2.mjs → operation-handler-M3B6IRMV.mjs} +3 -3
- package/dist/lib/neutral/{operation-handler-6IZ7L4L2.mjs.map → operation-handler-M3B6IRMV.mjs.map} +1 -1
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/lib/neutral/{query-deployed-functions-F4FHJNWO.mjs → query-deployed-functions-RBQMGON2.mjs} +4 -4
- package/dist/lib/neutral/{query-deployed-functions-F4FHJNWO.mjs.map → query-deployed-functions-RBQMGON2.mjs.map} +1 -1
- package/dist/lib/neutral/{react-surface-2TZDZQYA.mjs → react-surface-GEXOZLBC.mjs} +4 -5
- package/dist/lib/neutral/react-surface-GEXOZLBC.mjs.map +7 -0
- package/dist/lib/neutral/{read-RQESBAQI.mjs → read-OY3K5R3V.mjs} +3 -3
- package/dist/lib/neutral/{read-RQESBAQI.mjs.map → read-OY3K5R3V.mjs.map} +3 -3
- package/dist/lib/neutral/skill-definition-JZ7UYBT7.mjs +15 -0
- package/dist/lib/neutral/skill-definition-JZ7UYBT7.mjs.map +7 -0
- package/dist/lib/neutral/skills/index.mjs +10 -0
- package/dist/lib/neutral/templates/index.mjs +1 -1
- package/dist/lib/neutral/translations.mjs +6 -7
- package/dist/lib/neutral/translations.mjs.map +2 -2
- package/dist/lib/neutral/types/index.mjs +2 -2
- package/dist/lib/neutral/update-Z5VGOLBN.mjs +44 -0
- package/dist/lib/neutral/update-Z5VGOLBN.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/compiler.d.ts +1 -2
- package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -12
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +1 -1
- package/dist/types/src/capabilities/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -3
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +2 -3
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +18 -21
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +18 -21
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +18 -21
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts +20 -23
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts +20 -23
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/SkillEditor.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/SkillEditor.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts +8 -0
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts.map +1 -0
- package/dist/types/src/{components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts → containers/ScriptSettings/ScriptSettings.stories.d.ts} +20 -23
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptSettings/index.d.ts +2 -0
- package/dist/types/src/containers/ScriptSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +1 -0
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +6 -15
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +2 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +2 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-script.d.ts.map +1 -1
- package/dist/types/src/skills/functions/create.d.ts.map +1 -0
- package/dist/types/src/skills/functions/definitions.d.ts +75 -0
- package/dist/types/src/skills/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/skills/functions/delete.d.ts +7 -0
- package/dist/types/src/skills/functions/delete.d.ts.map +1 -0
- package/dist/types/src/skills/functions/deploy.d.ts +11 -0
- package/dist/types/src/skills/functions/deploy.d.ts.map +1 -0
- package/dist/types/src/skills/functions/index.d.ts.map +1 -0
- package/dist/types/src/skills/functions/inspect-invocations.d.ts +18 -0
- package/dist/types/src/skills/functions/inspect-invocations.d.ts.map +1 -0
- package/dist/types/src/skills/functions/install-function.d.ts.map +1 -0
- package/dist/types/src/skills/functions/invoke.d.ts +11 -0
- package/dist/types/src/skills/functions/invoke.d.ts.map +1 -0
- package/dist/types/src/skills/functions/query-deployed-functions.d.ts.map +1 -0
- package/dist/types/src/skills/functions/read.d.ts +11 -0
- package/dist/types/src/skills/functions/read.d.ts.map +1 -0
- package/dist/types/src/skills/functions/update.d.ts +16 -0
- package/dist/types/src/skills/functions/update.d.ts.map +1 -0
- package/dist/types/src/skills/index.d.ts +2 -0
- package/dist/types/src/skills/index.d.ts.map +1 -0
- package/dist/types/src/skills/script-skill.d.ts +4 -0
- package/dist/types/src/skills/script-skill.d.ts.map +1 -0
- package/dist/types/src/templates/chess-bot.d.ts +1 -4
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +1 -4
- package/dist/types/src/templates/commentary.d.ts.map +1 -1
- package/dist/types/src/testing/test-script.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +18 -21
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +11 -81
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/ScriptOperation.d.ts +2 -10
- package/dist/types/src/types/ScriptOperation.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts +1 -1
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +75 -74
- package/src/ScriptPlugin.node.ts +2 -2
- package/src/ScriptPlugin.test.ts +1 -1
- package/src/ScriptPlugin.tsx +2 -2
- package/src/capabilities/create-object.ts +0 -2
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/node.ts +1 -1
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +9 -7
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/components/NotebookStack/NotebookCell.tsx +11 -29
- package/src/components/NotebookStack/NotebookStack.stories.tsx +3 -3
- package/src/components/NotebookStack/NotebookStack.tsx +101 -43
- package/src/components/QueryEditor/QueryEditor.stories.tsx +2 -7
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +2 -2
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +7 -8
- package/src/components/index.ts +0 -4
- package/src/containers/NotebookArticle/NotebookArticle.stories.tsx +4 -4
- package/src/containers/NotebookArticle/NotebookArticle.tsx +20 -42
- package/src/containers/ScriptArticle/ScriptArticle.stories.tsx +5 -5
- package/src/containers/ScriptArticle/ScriptArticle.tsx +3 -3
- package/src/containers/ScriptProperties/FunctionBinding.tsx +1 -1
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +1 -1
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +5 -5
- package/src/containers/ScriptProperties/ScriptProperties.tsx +2 -2
- package/src/containers/ScriptProperties/{BlueprintEditor.tsx → SkillEditor.tsx} +22 -22
- package/src/{components/ScriptPluginSettings/ScriptPluginSettings.stories.tsx → containers/ScriptSettings/ScriptSettings.stories.tsx} +4 -4
- package/src/containers/ScriptSettings/ScriptSettings.tsx +47 -0
- package/src/containers/ScriptSettings/index.ts +5 -0
- package/src/containers/index.ts +1 -0
- package/src/e2e/ai.test.ts +14 -11
- package/src/e2e/deploy.test.ts +5 -1
- package/src/hooks/deploy.ts +1 -1
- package/src/index.ts +1 -1
- package/src/operations/create-script.ts +1 -1
- package/src/{blueprints → skills}/functions/create.ts +1 -1
- package/src/{blueprints → skills}/functions/definitions.ts +4 -2
- package/src/{blueprints → skills}/functions/deploy.ts +7 -2
- package/src/{blueprints → skills}/functions/inspect-invocations.ts +2 -2
- package/src/{blueprints → skills}/functions/read.ts +1 -1
- package/src/skills/functions/update.ts +48 -0
- package/src/skills/index.ts +5 -0
- package/src/{blueprints/script-blueprint.ts → skills/script-skill.ts} +12 -12
- package/src/templates/anthropic.ts +1 -1
- package/src/templates/chess-bot.ts +2 -2
- package/src/templates/commentary.ts +4 -4
- package/src/templates/discord.ts +1 -1
- package/src/templates/gmail.ts +1 -1
- package/src/testing/test-notebook.ts +5 -5
- package/src/testing/test-script.ts +1 -1
- package/src/translations.ts +6 -7
- package/src/types/Notebook.ts +9 -13
- package/src/types/ScriptOperation.ts +2 -2
- package/src/util/deploy.ts +7 -3
- package/src/util/functions.ts +3 -3
- package/dist/lib/neutral/NotebookArticle-E35G2Y2I.mjs.map +0 -7
- package/dist/lib/neutral/ScriptArticle-QW26LOKU.mjs.map +0 -7
- package/dist/lib/neutral/ScriptPluginSettings-5AURDJTI.mjs +0 -31
- package/dist/lib/neutral/ScriptPluginSettings-5AURDJTI.mjs.map +0 -7
- package/dist/lib/neutral/ScriptProperties-ADTWXG6O.mjs.map +0 -7
- package/dist/lib/neutral/blueprint-definition-PJ7I3JIQ.mjs +0 -15
- package/dist/lib/neutral/blueprint-definition-PJ7I3JIQ.mjs.map +0 -7
- package/dist/lib/neutral/blueprints/index.mjs +0 -10
- package/dist/lib/neutral/chunk-BDHDBPVM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-O6A5PTB3.mjs +0 -8
- package/dist/lib/neutral/chunk-QV6NCUGM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-TRKXIP2Q.mjs.map +0 -7
- package/dist/lib/neutral/chunk-VXDJH6OL.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZPFRRBZW.mjs.map +0 -7
- package/dist/lib/neutral/deploy-7JVMMHSH.mjs.map +0 -7
- package/dist/lib/neutral/inspect-invocations-TAOYDT4H.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-2TZDZQYA.mjs.map +0 -7
- package/dist/lib/neutral/update-CO7B6UBS.mjs +0 -63
- package/dist/lib/neutral/update-CO7B6UBS.mjs.map +0 -7
- package/dist/types/src/blueprints/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/definitions.d.ts +0 -135
- package/dist/types/src/blueprints/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/delete.d.ts +0 -17
- package/dist/types/src/blueprints/functions/delete.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/deploy.d.ts +0 -21
- package/dist/types/src/blueprints/functions/deploy.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +0 -28
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/install-function.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/invoke.d.ts +0 -21
- package/dist/types/src/blueprints/functions/invoke.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/read.d.ts +0 -21
- package/dist/types/src/blueprints/functions/read.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/update.d.ts +0 -26
- package/dist/types/src/blueprints/functions/update.d.ts.map +0 -1
- package/dist/types/src/blueprints/index.d.ts +0 -2
- package/dist/types/src/blueprints/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/script-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts +0 -8
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +0 -1
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts.map +0 -1
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts +0 -2
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts +0 -7
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts.map +0 -1
- package/src/blueprints/functions/update.ts +0 -68
- package/src/blueprints/index.ts +0 -5
- package/src/capabilities/blueprint-definition.ts +0 -19
- package/src/components/ScriptPluginSettings/ScriptPluginSettings.tsx +0 -42
- package/src/components/ScriptPluginSettings/index.ts +0 -5
- /package/dist/lib/neutral/{chunk-JAJ64B3E.mjs.map → chunk-KSVKXCTX.mjs.map} +0 -0
- /package/dist/lib/neutral/{blueprints → skills}/index.mjs.map +0 -0
- /package/dist/types/src/{blueprints → skills}/functions/create.d.ts +0 -0
- /package/dist/types/src/{blueprints → skills}/functions/index.d.ts +0 -0
- /package/dist/types/src/{blueprints → skills}/functions/install-function.d.ts +0 -0
- /package/dist/types/src/{blueprints → skills}/functions/query-deployed-functions.d.ts +0 -0
- /package/src/{blueprints → skills}/functions/delete.ts +0 -0
- /package/src/{blueprints → skills}/functions/index.ts +0 -0
- /package/src/{blueprints → skills}/functions/install-function.ts +0 -0
- /package/src/{blueprints → skills}/functions/invoke.ts +0 -0
- /package/src/{blueprints → skills}/functions/query-deployed-functions.ts +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { ToolId } from '@dxos/ai';
|
|
8
|
-
import {
|
|
8
|
+
import { Skill, Template } from '@dxos/compute';
|
|
9
9
|
import { type Script } from '@dxos/compute';
|
|
10
10
|
import { Operation } from '@dxos/compute';
|
|
11
11
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
@@ -16,29 +16,29 @@ import { kebabize } from '@dxos/util';
|
|
|
16
16
|
|
|
17
17
|
import { meta } from '#meta';
|
|
18
18
|
|
|
19
|
-
export type
|
|
19
|
+
export type SkillEditorProps = { object: Script.Script };
|
|
20
20
|
|
|
21
|
-
export const
|
|
21
|
+
export const SkillEditor = ({ object }: SkillEditorProps) => {
|
|
22
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
|
-
const
|
|
25
|
+
const skills = useQuery(db, Filter.type(Skill.Skill));
|
|
26
26
|
|
|
27
27
|
const [creating, setCreating] = useState(false);
|
|
28
28
|
// TODO(burdon): Remove?
|
|
29
29
|
const [instructions, setInstructions] = useState<string>(`You can run the script "${object.name ?? 'script'}".`);
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const skillKey = `org.dxos.skill.${kebabize(object.name ?? 'script')}`;
|
|
31
|
+
const existingSkill = skills.find((bp) => Obj.getMeta(bp).key === skillKey);
|
|
32
32
|
const fnKey = fn ? Obj.getMeta(fn).key : undefined;
|
|
33
33
|
|
|
34
34
|
useAsyncEffect(async () => {
|
|
35
|
-
if (!
|
|
35
|
+
if (!existingSkill) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const source = await
|
|
39
|
+
const source = await existingSkill.instructions.source.load();
|
|
40
40
|
setInstructions(source.content ?? '');
|
|
41
|
-
}, [
|
|
41
|
+
}, [existingSkill]);
|
|
42
42
|
|
|
43
43
|
const handleSave = useCallback(async () => {
|
|
44
44
|
if (!db) {
|
|
@@ -47,24 +47,24 @@ export const BlueprintEditor = ({ object }: BlueprintEditorProps) => {
|
|
|
47
47
|
|
|
48
48
|
setCreating(true);
|
|
49
49
|
try {
|
|
50
|
-
if (
|
|
51
|
-
const text = await
|
|
50
|
+
if (existingSkill) {
|
|
51
|
+
const text = await existingSkill.instructions.source.load();
|
|
52
52
|
Obj.update(text, (text) => {
|
|
53
53
|
text.content = instructions;
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
if (fnKey) {
|
|
57
57
|
const toolId = ToolId.make(fnKey);
|
|
58
|
-
if (!
|
|
59
|
-
Obj.update(
|
|
60
|
-
|
|
58
|
+
if (!existingSkill.tools?.includes(toolId)) {
|
|
59
|
+
Obj.update(existingSkill, (existingSkill) => {
|
|
60
|
+
existingSkill.tools = [...(existingSkill.tools ?? []), toolId];
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
} else if (fnKey) {
|
|
65
65
|
db.add(
|
|
66
|
-
|
|
67
|
-
key:
|
|
66
|
+
Skill.make({
|
|
67
|
+
key: skillKey,
|
|
68
68
|
name: object.name ?? 'Script',
|
|
69
69
|
instructions: Template.make({ source: instructions }),
|
|
70
70
|
tools: [ToolId.make(fnKey)],
|
|
@@ -75,16 +75,16 @@ export const BlueprintEditor = ({ object }: BlueprintEditorProps) => {
|
|
|
75
75
|
} finally {
|
|
76
76
|
setCreating(false);
|
|
77
77
|
}
|
|
78
|
-
}, [db,
|
|
78
|
+
}, [db, existingSkill, fnKey, skillKey, object.name, instructions]);
|
|
79
79
|
|
|
80
80
|
return (
|
|
81
81
|
<div className='flex flex-col'>
|
|
82
|
-
<Form.Section
|
|
82
|
+
<Form.Section title={t('skill-editor.label')} description={t('skill-editor.description')} />
|
|
83
83
|
|
|
84
84
|
<Input.Root>
|
|
85
|
-
<Input.Label>{t('
|
|
85
|
+
<Input.Label>{t('skill-instructions.label')}</Input.Label>
|
|
86
86
|
<Input.TextArea
|
|
87
|
-
placeholder={t('
|
|
87
|
+
placeholder={t('skill-instructions.placeholder')}
|
|
88
88
|
rows={6}
|
|
89
89
|
value={instructions}
|
|
90
90
|
onChange={(event) => setInstructions(event.target.value)}
|
|
@@ -93,8 +93,8 @@ export const BlueprintEditor = ({ object }: BlueprintEditorProps) => {
|
|
|
93
93
|
</Input.Root>
|
|
94
94
|
|
|
95
95
|
<div className='pt-2'>
|
|
96
|
-
<Button disabled={(!
|
|
97
|
-
{t(
|
|
96
|
+
<Button disabled={(!existingSkill && !fnKey) || creating} onClick={handleSave}>
|
|
97
|
+
{t(existingSkill ? 'update-skill.label' : 'create-skill.label')}
|
|
98
98
|
</Button>
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
@@ -8,18 +8,18 @@ import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
|
8
8
|
|
|
9
9
|
import { translations } from '#translations';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { ScriptSettings } from './ScriptSettings';
|
|
12
12
|
|
|
13
13
|
const meta = {
|
|
14
|
-
title: 'plugins/plugin-script/
|
|
15
|
-
component:
|
|
14
|
+
title: 'plugins/plugin-script/containers/ScriptSettings',
|
|
15
|
+
component: ScriptSettings,
|
|
16
16
|
tags: ['settings'],
|
|
17
17
|
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
18
18
|
parameters: {
|
|
19
19
|
layout: 'fullscreen',
|
|
20
20
|
translations,
|
|
21
21
|
},
|
|
22
|
-
} satisfies Meta<typeof
|
|
22
|
+
} satisfies Meta<typeof ScriptSettings>;
|
|
23
23
|
|
|
24
24
|
export default meta;
|
|
25
25
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { Button, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { Form } from '@dxos/react-ui-form';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { Settings } from '#types';
|
|
13
|
+
|
|
14
|
+
export type ScriptSettingsProps = AppSurface.SettingsProps<
|
|
15
|
+
Settings.Settings,
|
|
16
|
+
{
|
|
17
|
+
onAuthenticate?: () => void;
|
|
18
|
+
}
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export const ScriptSettings = ({ settings, onSettingsChange, onAuthenticate }: ScriptSettingsProps) => {
|
|
22
|
+
const { t } = useTranslation(meta.profile.key);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Form.Root
|
|
26
|
+
schema={Settings.Settings}
|
|
27
|
+
values={settings}
|
|
28
|
+
variant='settings'
|
|
29
|
+
readonly={!onSettingsChange}
|
|
30
|
+
onValuesChanged={(values) => onSettingsChange?.((current) => ({ ...current, ...values }))}
|
|
31
|
+
>
|
|
32
|
+
<Form.Viewport scroll>
|
|
33
|
+
<Form.Content>
|
|
34
|
+
<Form.Section title={meta.profile.name ?? meta.profile.key}>
|
|
35
|
+
{/* TODO(wittjosiah): Hide outside of dev environments. */}
|
|
36
|
+
<Form.Row label={t('authenticate-action.label')} description={t('authenticate-action.description')}>
|
|
37
|
+
<Button disabled={!onSettingsChange} onClick={onAuthenticate}>
|
|
38
|
+
{t('authenticate-button.label')}
|
|
39
|
+
</Button>
|
|
40
|
+
</Form.Row>
|
|
41
|
+
<Form.FieldSet />
|
|
42
|
+
</Form.Section>
|
|
43
|
+
</Form.Content>
|
|
44
|
+
</Form.Viewport>
|
|
45
|
+
</Form.Root>
|
|
46
|
+
);
|
|
47
|
+
};
|
package/src/containers/index.ts
CHANGED
|
@@ -8,4 +8,5 @@ export const DeploymentDialog: ComponentType<any> = lazy(() => import('./Deploym
|
|
|
8
8
|
export const NotebookArticle: ComponentType<any> = lazy(() => import('./NotebookArticle'));
|
|
9
9
|
export const ScriptArticle: ComponentType<any> = lazy(() => import('./ScriptArticle'));
|
|
10
10
|
export const ScriptProperties: ComponentType<any> = lazy(() => import('./ScriptProperties'));
|
|
11
|
+
export const ScriptSettings: ComponentType<any> = lazy(() => import('./ScriptSettings'));
|
|
11
12
|
export const TestContainer: ComponentType<any> = lazy(() => import('./TestContainer'));
|
package/src/e2e/ai.test.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { configPreset } from '@dxos/config';
|
|
|
12
12
|
import { Context } from '@dxos/context';
|
|
13
13
|
import { FunctionsServiceClient } from '@dxos/functions-runtime/edge';
|
|
14
14
|
import { bundleFunction } from '@dxos/functions-runtime/native';
|
|
15
|
+
import { failedInvariant } from '@dxos/invariant';
|
|
15
16
|
import { FunctionRuntimeKind } from '@dxos/protocols';
|
|
16
17
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
17
18
|
|
|
@@ -27,11 +28,11 @@ describe.skip('Function', { tags: ['functions-e2e'] }, () => {
|
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
test('deploy empty function', { timeout: 120_000 }, async () => {
|
|
30
|
-
const { space, functionsServiceClient } = await setup();
|
|
31
|
+
const { space, functionsServiceClient, ownerUri } = await setup();
|
|
31
32
|
|
|
32
33
|
await sync(space);
|
|
33
34
|
const func = await deployFunction(
|
|
34
|
-
|
|
35
|
+
ownerUri,
|
|
35
36
|
functionsServiceClient,
|
|
36
37
|
new URL('../templates/ping.ts', import.meta.url).pathname,
|
|
37
38
|
);
|
|
@@ -40,10 +41,10 @@ describe.skip('Function', { tags: ['functions-e2e'] }, () => {
|
|
|
40
41
|
});
|
|
41
42
|
|
|
42
43
|
test('deploy and invoke anthropic function', { timeout: 120_000 }, async () => {
|
|
43
|
-
const { space, functionsServiceClient } = await setup();
|
|
44
|
+
const { space, functionsServiceClient, ownerUri } = await setup();
|
|
44
45
|
await sync(space);
|
|
45
46
|
const func = await deployFunction(
|
|
46
|
-
|
|
47
|
+
ownerUri,
|
|
47
48
|
functionsServiceClient,
|
|
48
49
|
new URL('../templates/anthropic.ts', import.meta.url).pathname,
|
|
49
50
|
);
|
|
@@ -57,13 +58,14 @@ describe.skip('Function', { tags: ['functions-e2e'] }, () => {
|
|
|
57
58
|
const setup = async () => {
|
|
58
59
|
const client = await new Client({ config, types: [Operation.PersistentOperation] }).initialize();
|
|
59
60
|
await client.halo.createIdentity();
|
|
61
|
+
const ownerUri = client.halo.identity.get()?.did ?? failedInvariant('identity not created');
|
|
60
62
|
|
|
61
63
|
const space = await client.spaces.create();
|
|
62
64
|
await space.waitUntilReady();
|
|
63
65
|
await space.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED);
|
|
64
66
|
|
|
65
67
|
const functionsServiceClient = FunctionsServiceClient.fromClient(client);
|
|
66
|
-
return { client, space, functionsServiceClient };
|
|
68
|
+
return { client, space, functionsServiceClient, ownerUri };
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
const sync = async (space: Space) => {
|
|
@@ -74,20 +76,21 @@ describe.skip('Function', { tags: ['functions-e2e'] }, () => {
|
|
|
74
76
|
});
|
|
75
77
|
};
|
|
76
78
|
|
|
77
|
-
const deployFunction = async (
|
|
79
|
+
const deployFunction = async (
|
|
80
|
+
ownerUri: string,
|
|
81
|
+
functionsServiceClient: FunctionsServiceClient,
|
|
82
|
+
entryPoint: string,
|
|
83
|
+
) => {
|
|
78
84
|
const artifact = await bundleFunction({
|
|
79
85
|
entryPoint,
|
|
80
86
|
verbose: true,
|
|
81
87
|
});
|
|
82
|
-
|
|
88
|
+
return functionsServiceClient.deploy(Context.default(), {
|
|
83
89
|
version: '0.0.1',
|
|
84
|
-
|
|
90
|
+
ownerUri,
|
|
85
91
|
entryPoint: artifact.entryPoint,
|
|
86
92
|
assets: artifact.assets,
|
|
87
93
|
runtime: FunctionRuntimeKind.enums.WORKER_LOADER,
|
|
88
94
|
});
|
|
89
|
-
|
|
90
|
-
space.db.add(func);
|
|
91
|
-
return func;
|
|
92
95
|
};
|
|
93
96
|
});
|
package/src/e2e/deploy.test.ts
CHANGED
|
@@ -44,8 +44,12 @@ describe.skip('Functions deployment', { tags: ['functions-e2e'] }, () => {
|
|
|
44
44
|
}
|
|
45
45
|
const functionsServiceClient = FunctionsServiceClient.fromClient(client);
|
|
46
46
|
|
|
47
|
+
const identity = client.halo.identity.get();
|
|
48
|
+
if (!identity) {
|
|
49
|
+
throw new Error('Identity not available.');
|
|
50
|
+
}
|
|
47
51
|
const func = await functionsServiceClient.deploy(Context.default(), {
|
|
48
|
-
|
|
52
|
+
ownerUri: identity.did,
|
|
49
53
|
version: '0.0.1',
|
|
50
54
|
entryPoint: buildResult.entryPoint,
|
|
51
55
|
assets: buildResult.assets,
|
package/src/hooks/deploy.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Operation, Script } from '@dxos/compute';
|
|
8
8
|
import { Obj, Query, Ref } from '@dxos/echo';
|
|
9
9
|
import { getUserFunctionIdInMetadata } from '@dxos/functions';
|
|
10
10
|
import { log } from '@dxos/log';
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Octokit } from '@octokit/core';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Operation, Script } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
import { templates } from '../templates';
|
|
11
11
|
import { ScriptOperation } from '../types';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { CollectionModel } from '@dxos/app-toolkit';
|
|
8
|
-
import {
|
|
8
|
+
import { Operation, Script } from '@dxos/compute';
|
|
9
9
|
import { Database, Obj, Ref } from '@dxos/echo';
|
|
10
10
|
|
|
11
11
|
import { Create } from './definitions';
|
|
@@ -6,7 +6,7 @@ import * as Schema from 'effect/Schema';
|
|
|
6
6
|
|
|
7
7
|
import { ClientService } from '@dxos/client';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
|
-
import { Database,
|
|
9
|
+
import { Database, DXN, Ref } from '@dxos/echo';
|
|
10
10
|
import { trim } from '@dxos/util';
|
|
11
11
|
|
|
12
12
|
const FunctionRef = Ref.Ref(Operation.PersistentOperation).annotations({
|
|
@@ -136,6 +136,8 @@ export const Read = Operation.make({
|
|
|
136
136
|
services: [Database.Service],
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
+
// The edit descriptions feed the script skill's LLM tool definition (and its memoized
|
|
140
|
+
// fixtures), so the schema stays local and context-tuned; the apply logic is shared via `Doc.applyEdits`.
|
|
139
141
|
const Edit = Schema.Struct({
|
|
140
142
|
oldString: Schema.String.annotations({
|
|
141
143
|
description: 'The text to find in the source.',
|
|
@@ -269,7 +271,7 @@ export const InspectInvocations = Operation.make({
|
|
|
269
271
|
description: 'Total number of invocations found.',
|
|
270
272
|
}),
|
|
271
273
|
}),
|
|
272
|
-
services: [Database.Service
|
|
274
|
+
services: [Database.Service],
|
|
273
275
|
});
|
|
274
276
|
|
|
275
277
|
const DeployedFunctionSchema = Schema.Struct({
|
|
@@ -6,7 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
7
7
|
|
|
8
8
|
import { ClientService } from '@dxos/client';
|
|
9
|
-
import {
|
|
9
|
+
import { Operation, Script } from '@dxos/compute';
|
|
10
10
|
import { Context } from '@dxos/context';
|
|
11
11
|
import { Database, Obj } from '@dxos/echo';
|
|
12
12
|
import { getUserFunctionIdInMetadata } from '@dxos/functions';
|
|
@@ -41,10 +41,15 @@ export default Deploy.pipe(
|
|
|
41
41
|
const existingFunctionId = getUserFunctionIdInMetadata(Obj.getMeta(loaded));
|
|
42
42
|
const currentVersion = Obj.getMeta(loaded).version;
|
|
43
43
|
|
|
44
|
+
const identity = client.halo.identity.get();
|
|
45
|
+
if (!identity) {
|
|
46
|
+
return yield* Effect.fail(new Error('Identity not available.'));
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
const functionsService = FunctionsServiceClient.fromClient(client);
|
|
45
50
|
const newFunction = yield* Effect.promise(() =>
|
|
46
51
|
functionsService.deploy(Context.default(), {
|
|
47
|
-
|
|
52
|
+
ownerUri: identity.did,
|
|
48
53
|
version: currentVersion ? incrementSemverPatch(currentVersion) : '0.0.1',
|
|
49
54
|
functionId: existingFunctionId,
|
|
50
55
|
entryPoint: buildResult.entryPoint,
|
|
@@ -24,8 +24,8 @@ export default InspectInvocations.pipe(
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const feed = yield* Database.load(properties.invocationTraceFeed);
|
|
27
|
-
const startEvents = yield* Feed.
|
|
28
|
-
const endEvents = yield* Feed.
|
|
27
|
+
const startEvents = yield* Feed.query(feed, Filter.type(InvocationTraceStartEvent)).run;
|
|
28
|
+
const endEvents = yield* Feed.query(feed, Filter.type(InvocationTraceEndEvent)).run;
|
|
29
29
|
const allSpans = createInvocationSpans([...startEvents, ...endEvents]);
|
|
30
30
|
|
|
31
31
|
const functionId = getUserFunctionIdInMetadata(Obj.getMeta(loaded));
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation, type Script } from '@dxos/compute';
|
|
8
|
+
import { Database, Obj } from '@dxos/echo';
|
|
9
|
+
import { Doc, applyEdits } from '@dxos/echo-doc';
|
|
10
|
+
|
|
11
|
+
import { Update } from './definitions';
|
|
12
|
+
|
|
13
|
+
export default Update.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ function: fn, name, description, edits }) {
|
|
16
|
+
const loaded = yield* Database.load(fn);
|
|
17
|
+
if (!loaded.source) {
|
|
18
|
+
return yield* Effect.fail(new Error('Function has no source script.'));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const script = (yield* Database.load(loaded.source)) as Script.Script;
|
|
22
|
+
if (name !== undefined || description !== undefined) {
|
|
23
|
+
Obj.update(script, (script) => {
|
|
24
|
+
if (name !== undefined) {
|
|
25
|
+
script.name = name;
|
|
26
|
+
}
|
|
27
|
+
if (description !== undefined) {
|
|
28
|
+
script.description = description;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (edits && edits.length > 0) {
|
|
34
|
+
const text = yield* Database.load(script.source);
|
|
35
|
+
const accessor = Doc.createAccessor(text, ['content']);
|
|
36
|
+
applyEdits(accessor, edits);
|
|
37
|
+
|
|
38
|
+
Obj.update(script, (script) => {
|
|
39
|
+
script.changed = true;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
function: Obj.getURI(loaded),
|
|
45
|
+
};
|
|
46
|
+
}),
|
|
47
|
+
),
|
|
48
|
+
);
|
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Skill, Template } from '@dxos/compute';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
Create,
|
|
10
|
-
Read,
|
|
11
|
-
Update,
|
|
12
10
|
Delete,
|
|
13
11
|
Deploy,
|
|
14
|
-
Invoke,
|
|
15
12
|
InspectInvocations,
|
|
16
|
-
QueryDeployedFunctions,
|
|
17
13
|
InstallFunction,
|
|
14
|
+
Invoke,
|
|
15
|
+
QueryDeployedFunctions,
|
|
16
|
+
Read,
|
|
17
|
+
Update,
|
|
18
18
|
} from './functions';
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const SKILL_KEY = 'org.dxos.skill.script';
|
|
21
21
|
|
|
22
22
|
const make = () =>
|
|
23
|
-
|
|
24
|
-
key:
|
|
23
|
+
Skill.make({
|
|
24
|
+
key: SKILL_KEY,
|
|
25
25
|
name: 'Script',
|
|
26
26
|
agentCanEnable: true,
|
|
27
|
-
tools:
|
|
27
|
+
tools: Skill.toolDefinitions({
|
|
28
28
|
operations: [
|
|
29
29
|
Create,
|
|
30
30
|
Read,
|
|
@@ -47,9 +47,9 @@ const make = () =>
|
|
|
47
47
|
}),
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
const
|
|
51
|
-
key:
|
|
50
|
+
const skill: Skill.Definition = {
|
|
51
|
+
key: SKILL_KEY,
|
|
52
52
|
make,
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
export default
|
|
55
|
+
export default skill;
|
|
@@ -28,7 +28,7 @@ const Anthropic = Operation.make({
|
|
|
28
28
|
export default Anthropic.pipe(
|
|
29
29
|
Operation.withHandler(
|
|
30
30
|
Effect.fn(function* ({ message }) {
|
|
31
|
-
const model =
|
|
31
|
+
const model = AiService.model('com.anthropic.model.claude-sonnet-4-6.default');
|
|
32
32
|
|
|
33
33
|
//
|
|
34
34
|
// Basic example.
|
|
@@ -7,9 +7,9 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import * as Schema from 'effect/Schema';
|
|
8
8
|
|
|
9
9
|
import { Operation } from '@dxos/compute';
|
|
10
|
-
import { Database,
|
|
10
|
+
import { Database, DXN, Obj } from '@dxos/echo';
|
|
11
11
|
import { Chess } from '@dxos/plugin-chess';
|
|
12
|
-
import {
|
|
12
|
+
import { Game, GameRef, loadGame } from '@dxos/plugin-game';
|
|
13
13
|
|
|
14
14
|
const ChessBot = Operation.make({
|
|
15
15
|
meta: {
|
|
@@ -14,9 +14,9 @@ import * as Schema from 'effect/Schema';
|
|
|
14
14
|
import { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
15
15
|
import { AppAnnotation } from '@dxos/app-toolkit';
|
|
16
16
|
import { AiRequest, GenerationObserver } from '@dxos/assistant';
|
|
17
|
-
import {
|
|
17
|
+
import { Operation, Trace } from '@dxos/compute';
|
|
18
18
|
import { Annotation, Collection, Database, DXN, Filter, Obj, Ref, Relation, URI } from '@dxos/echo';
|
|
19
|
-
import {
|
|
19
|
+
import { Doc } from '@dxos/echo-doc';
|
|
20
20
|
import { registryLayerNoop } from '@dxos/echo/testing';
|
|
21
21
|
import { log } from '@dxos/log';
|
|
22
22
|
import { Chess } from '@dxos/plugin-chess';
|
|
@@ -196,7 +196,7 @@ export default Commentary.pipe(
|
|
|
196
196
|
|
|
197
197
|
// Load the text content and append the commentary
|
|
198
198
|
const text = yield* Database.load(document.content);
|
|
199
|
-
const accessor =
|
|
199
|
+
const accessor = Doc.createAccessor(text, ['content']);
|
|
200
200
|
accessor.handle.change((doc: A.Doc<Text.Text>) => {
|
|
201
201
|
A.splice(doc, accessor.path.slice(), text.content.length, 0, commentary);
|
|
202
202
|
});
|
|
@@ -213,7 +213,7 @@ export default Commentary.pipe(
|
|
|
213
213
|
},
|
|
214
214
|
Effect.provide(
|
|
215
215
|
Layer.mergeAll(
|
|
216
|
-
AiService.model('
|
|
216
|
+
AiService.model('com.anthropic.model.claude-haiku-4-5.default'),
|
|
217
217
|
ToolResolverService.layerEmpty,
|
|
218
218
|
ToolExecutionService.layerEmpty,
|
|
219
219
|
Trace.writerLayerNoop,
|
package/src/templates/discord.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import { DXN, EchoObject,
|
|
6
|
+
import { DXN, EchoObject, EntityId, Filter, S, create, defineFunction } from 'dxos:functions';
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
import { FetchHttpClient } from 'https://esm.sh/@effect/platform@0.89.0?deps=effect@3.17.0&bundle=false';
|
|
9
9
|
import {
|
package/src/templates/gmail.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Instructions } from '@dxos/compute';
|
|
6
6
|
import { Ref, Type } from '@dxos/echo';
|
|
7
7
|
import { createObject } from '@dxos/echo-client';
|
|
8
8
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -45,8 +45,8 @@ export const createNotebook = (): Notebook.Notebook =>
|
|
|
45
45
|
type: 'prompt',
|
|
46
46
|
prompt: Ref.make(
|
|
47
47
|
createObject(
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
Instructions.make({
|
|
49
|
+
text: 'Very briefly, what colors are associated with the numbers {{a}} and {{b}}.',
|
|
50
50
|
}),
|
|
51
51
|
),
|
|
52
52
|
),
|
|
@@ -61,8 +61,8 @@ export const createNotebook = (): Notebook.Notebook =>
|
|
|
61
61
|
type: 'prompt',
|
|
62
62
|
prompt: Ref.make(
|
|
63
63
|
createObject(
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
Instructions.make({
|
|
65
|
+
text: 'Very briefly, summarize the documents: {{docs}}',
|
|
66
66
|
}),
|
|
67
67
|
),
|
|
68
68
|
),
|