@dxos/plugin-script 0.9.0 → 0.9.1-staging.ee54ba693a
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/{DeploymentDialog-M3AFYQHC.mjs → DeploymentDialog-7OIIL7LB.mjs} +10 -10
- package/dist/lib/neutral/DeploymentDialog-7OIIL7LB.mjs.map +7 -0
- package/dist/lib/neutral/{NotebookArticle-NV4AHOOS.mjs → NotebookArticle-AOBB3XGD.mjs} +28 -46
- 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 +6 -6
- package/dist/lib/neutral/ScriptPlugin.mjs.map +4 -4
- package/dist/lib/neutral/ScriptPlugin.node.mjs +3 -3
- package/dist/lib/neutral/ScriptPlugin.node.mjs.map +3 -3
- package/dist/lib/neutral/{ScriptProperties-RLXNAN3N.mjs → ScriptProperties-RHDQGMGT.mjs} +153 -154
- 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/{app-graph-builder-7AWFCEQF.mjs → app-graph-builder-POP3CX6G.mjs} +3 -3
- package/dist/lib/neutral/{app-graph-builder-7AWFCEQF.mjs.map → app-graph-builder-POP3CX6G.mjs.map} +3 -3
- package/dist/lib/neutral/capabilities/index.mjs +8 -8
- package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
- package/dist/lib/neutral/capabilities/node.mjs +6 -6
- package/dist/lib/neutral/capabilities/node.mjs.map +3 -3
- package/dist/lib/neutral/{chunk-HABDH5SS.mjs → chunk-652CIABA.mjs} +14 -13
- 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-BKXYHCJ6.mjs → chunk-KSVKXCTX.mjs} +2 -2
- package/dist/lib/neutral/chunk-NVV5UYY4.mjs +50 -0
- package/dist/lib/neutral/chunk-NVV5UYY4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-USJ44FIU.mjs +8 -0
- package/dist/lib/neutral/{chunk-XFM63AKT.mjs.map → chunk-USJ44FIU.mjs.map} +1 -1
- package/dist/lib/neutral/{chunk-PHKPB5JN.mjs → chunk-WAGQ77UQ.mjs} +16 -16
- package/dist/lib/neutral/chunk-WAGQ77UQ.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +124 -93
- package/dist/lib/neutral/components/index.mjs.map +4 -4
- package/dist/lib/neutral/containers/index.mjs +6 -4
- package/dist/lib/neutral/containers/index.mjs.map +3 -3
- package/dist/lib/neutral/{create-AAA53WDL.mjs → create-SGHWWTET.mjs} +4 -4
- package/dist/lib/neutral/{create-AAA53WDL.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-P46JOEHH.mjs → create-script-CIEJOBIU.mjs} +4 -4
- package/dist/lib/neutral/{create-script-P46JOEHH.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 +6 -6
- package/dist/lib/neutral/hooks/index.mjs.map +3 -3
- package/dist/lib/neutral/index.mjs +9 -9
- 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/meta.mjs +1 -1
- package/dist/lib/neutral/{operation-handler-YMUADD7Y.mjs → operation-handler-M3B6IRMV.mjs} +3 -3
- package/dist/lib/neutral/{operation-handler-YMUADD7Y.mjs.map → operation-handler-M3B6IRMV.mjs.map} +1 -1
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- 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-ACNZ35FV.mjs → react-surface-GEXOZLBC.mjs} +7 -8
- 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/{settings-VJBW4OMK.mjs → settings-FD7HXEY6.mjs} +3 -3
- package/dist/lib/neutral/{settings-VJBW4OMK.mjs.map → settings-FD7HXEY6.mjs.map} +3 -3
- package/dist/lib/neutral/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 +7 -8
- package/dist/lib/neutral/translations.mjs.map +3 -3
- 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/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -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 +6 -17
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +4 -15
- package/dist/types/src/capabilities/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/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.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/constants.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.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/NotebookArticle/NotebookArticle.stories.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.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 +14 -15
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +6 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +6 -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 +32 -2
- 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/ScriptCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/ScriptEvents.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/dx.config.ts +26 -0
- package/package.json +77 -75
- package/src/ScriptPlugin.node.ts +2 -2
- package/src/ScriptPlugin.test.ts +2 -2
- package/src/ScriptPlugin.tsx +3 -3
- package/src/capabilities/app-graph-builder.ts +2 -2
- package/src/capabilities/create-object.ts +0 -2
- package/src/capabilities/index.ts +1 -7
- package/src/capabilities/node.ts +1 -7
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +11 -9
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/components/NotebookStack/NotebookCell.tsx +13 -31
- package/src/components/NotebookStack/NotebookMenu.tsx +1 -1
- package/src/components/NotebookStack/NotebookStack.stories.tsx +3 -3
- package/src/components/NotebookStack/NotebookStack.tsx +102 -44
- package/src/components/QueryEditor/QueryEditor.stories.tsx +2 -7
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +3 -2
- package/src/components/TestPanel/TestPanel.tsx +1 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +2 -2
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +7 -7
- package/src/components/index.ts +0 -4
- package/src/constants.ts +1 -1
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +15 -9
- package/src/containers/NotebookArticle/NotebookArticle.stories.tsx +6 -5
- package/src/containers/NotebookArticle/NotebookArticle.tsx +21 -43
- package/src/containers/ScriptArticle/ScriptArticle.stories.tsx +5 -5
- package/src/containers/ScriptArticle/ScriptArticle.tsx +3 -3
- package/src/containers/ScriptProperties/FunctionBinding.tsx +2 -2
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +2 -2
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +5 -5
- package/src/containers/ScriptProperties/ScriptProperties.tsx +13 -6
- package/src/containers/ScriptProperties/{BlueprintEditor.tsx → SkillEditor.tsx} +23 -23
- 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 +4 -4
- package/src/hooks/format.ts +1 -1
- package/src/index.ts +1 -1
- package/src/meta.ts +3 -19
- 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 +8 -7
- 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 +7 -8
- package/src/types/Notebook.ts +9 -13
- package/src/types/ScriptCapabilities.ts +4 -2
- package/src/types/ScriptEvents.ts +1 -1
- package/src/types/ScriptOperation.ts +3 -3
- package/src/util/deploy.ts +7 -3
- package/src/util/functions.ts +3 -3
- package/dist/lib/neutral/DeploymentDialog-M3AFYQHC.mjs.map +0 -7
- package/dist/lib/neutral/NotebookArticle-NV4AHOOS.mjs.map +0 -7
- package/dist/lib/neutral/ScriptArticle-QW26LOKU.mjs.map +0 -7
- package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs +0 -31
- package/dist/lib/neutral/ScriptPluginSettings-T4JMUSHN.mjs.map +0 -7
- package/dist/lib/neutral/ScriptProperties-RLXNAN3N.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-HABDH5SS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-PHKPB5JN.mjs.map +0 -7
- package/dist/lib/neutral/chunk-TRKXIP2Q.mjs.map +0 -7
- package/dist/lib/neutral/chunk-UA3BWOCZ.mjs +0 -38
- package/dist/lib/neutral/chunk-UA3BWOCZ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-VXDJH6OL.mjs.map +0 -7
- package/dist/lib/neutral/chunk-XFM63AKT.mjs +0 -8
- 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-ACNZ35FV.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-BKXYHCJ6.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
|
@@ -22,7 +22,7 @@ export type FunctionPublishingProps = { object: Script.Script };
|
|
|
22
22
|
|
|
23
23
|
// TODO(burdon): Move to separate tab?
|
|
24
24
|
export const FunctionPublishing = ({ object }: FunctionPublishingProps) => {
|
|
25
|
-
const { t } = useTranslation(meta.
|
|
25
|
+
const { t } = useTranslation(meta.profile.key);
|
|
26
26
|
const { invokePromise } = useOperationInvoker();
|
|
27
27
|
const db = Obj.getDatabase(object);
|
|
28
28
|
|
|
@@ -95,7 +95,7 @@ export const FunctionPublishing = ({ object }: FunctionPublishingProps) => {
|
|
|
95
95
|
|
|
96
96
|
return (
|
|
97
97
|
<div className='flex flex-col'>
|
|
98
|
-
<Form.Section
|
|
98
|
+
<Form.Section title={t('script-publish-settings.label')} description={t('script-publish-settings.description')} />
|
|
99
99
|
|
|
100
100
|
{!githubToken && (
|
|
101
101
|
<div className='flex flex-col py-form-gap'>
|
|
@@ -7,7 +7,7 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import {
|
|
10
|
+
import { Skill } from '@dxos/compute';
|
|
11
11
|
import { Script } from '@dxos/compute';
|
|
12
12
|
import { Operation } from '@dxos/compute';
|
|
13
13
|
import { Filter } from '@dxos/echo';
|
|
@@ -24,9 +24,9 @@ import { translations } from '#translations';
|
|
|
24
24
|
|
|
25
25
|
import { ScriptProperties } from './ScriptProperties';
|
|
26
26
|
|
|
27
|
-
type
|
|
27
|
+
type StoryArgs = {};
|
|
28
28
|
|
|
29
|
-
const DefaultStory = (_:
|
|
29
|
+
const DefaultStory = (_: StoryArgs) => {
|
|
30
30
|
const [space] = useSpaces();
|
|
31
31
|
const [script] = useQuery(space?.db, Filter.type(Script.Script));
|
|
32
32
|
if (!script) {
|
|
@@ -50,7 +50,7 @@ const meta = {
|
|
|
50
50
|
plugins: [
|
|
51
51
|
...corePlugins(),
|
|
52
52
|
ClientPlugin({
|
|
53
|
-
types: [Script.Script, Operation.PersistentOperation,
|
|
53
|
+
types: [Script.Script, Operation.PersistentOperation, Skill.Skill, Text.Text],
|
|
54
54
|
onClientInitialized: ({ client }) =>
|
|
55
55
|
Effect.gen(function* () {
|
|
56
56
|
yield* initializeIdentity(client);
|
|
@@ -67,7 +67,7 @@ const meta = {
|
|
|
67
67
|
layout: 'fullscreen',
|
|
68
68
|
translations,
|
|
69
69
|
},
|
|
70
|
-
} satisfies Meta<
|
|
70
|
+
} satisfies Meta<StoryArgs>;
|
|
71
71
|
|
|
72
72
|
export default meta;
|
|
73
73
|
|
|
@@ -6,19 +6,26 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { type Script } from '@dxos/compute';
|
|
9
|
+
import { Form } from '@dxos/react-ui-form';
|
|
9
10
|
|
|
10
|
-
import { BlueprintEditor } from './BlueprintEditor';
|
|
11
11
|
import { FunctionBinding } from './FunctionBinding';
|
|
12
12
|
import { FunctionPublishing } from './FunctionPublishing';
|
|
13
|
+
import { SkillEditor } from './SkillEditor';
|
|
13
14
|
|
|
14
15
|
export type ScriptPropertiesProps = AppSurface.ObjectPropertiesProps<Script.Script>;
|
|
15
16
|
|
|
16
17
|
export const ScriptProperties = ({ subject: object }: ScriptPropertiesProps) => {
|
|
17
18
|
return (
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
<>
|
|
20
|
+
<Form.Section>
|
|
21
|
+
<FunctionBinding object={object} />
|
|
22
|
+
</Form.Section>
|
|
23
|
+
<Form.Section>
|
|
24
|
+
<SkillEditor object={object} />
|
|
25
|
+
</Form.Section>
|
|
26
|
+
<Form.Section>
|
|
27
|
+
<FunctionPublishing object={object} />
|
|
28
|
+
</Form.Section>
|
|
29
|
+
</>
|
|
23
30
|
);
|
|
24
31
|
};
|
|
@@ -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
|
|
22
|
-
const { t } = useTranslation(meta.
|
|
21
|
+
export const SkillEditor = ({ object }: SkillEditorProps) => {
|
|
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';
|
|
@@ -44,7 +44,7 @@ export const createDeploy = ({ state, script, space, fn, client, existingFunctio
|
|
|
44
44
|
|
|
45
45
|
// TODO(wittjosiah): Should this be an action?
|
|
46
46
|
const errorItem = createMenuAction('error', () => {}, {
|
|
47
|
-
label: value.error ?? ['no-error.label', { ns: meta.
|
|
47
|
+
label: value.error ?? ['no-error.label', { ns: meta.profile.key }],
|
|
48
48
|
icon: 'ph--warning-circle--regular',
|
|
49
49
|
hidden: !value.error,
|
|
50
50
|
classNames: value.error && messageValence('error'),
|
|
@@ -71,7 +71,7 @@ export const createDeploy = ({ state, script, space, fn, client, existingFunctio
|
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
type: 'deploy',
|
|
74
|
-
label: [value.deploying ? 'publishing.label' : 'deploy.label', { ns: meta.
|
|
74
|
+
label: [value.deploying ? 'publishing.label' : 'deploy.label', { ns: meta.profile.key }],
|
|
75
75
|
icon: value.deploying ? 'ph--spinner-gap--regular' : 'ph--cloud-arrow-up--regular',
|
|
76
76
|
disabled: value.deploying,
|
|
77
77
|
classNames: value.deploying ? '[&_svg]:animate-spin' : '',
|
|
@@ -87,7 +87,7 @@ export const createDeploy = ({ state, script, space, fn, client, existingFunctio
|
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
type: 'copy',
|
|
90
|
-
label: ['copy-link.label', { ns: meta.
|
|
90
|
+
label: ['copy-link.label', { ns: meta.profile.key }],
|
|
91
91
|
icon: 'ph--link--regular',
|
|
92
92
|
disabled: !value.functionUrl,
|
|
93
93
|
},
|
package/src/hooks/format.ts
CHANGED
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -4,26 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { DXN } from '@dxos/keys';
|
|
7
|
-
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
author: 'DXOS',
|
|
13
|
-
spec: 'PLUGIN.mdl',
|
|
14
|
-
description: trim`
|
|
15
|
-
Write, deploy, and run custom TypeScript functions as ECHO objects directly inside your Composer spaces.
|
|
16
|
-
Scripts execute on the Cloudflare Workers-based EDGE runtime and have access to the full DXOS SDK,
|
|
17
|
-
Effect-TS, and a curated set of third-party libraries including HTTP, JSON, CSV, and date utilities.
|
|
18
|
-
An AI Script assistant wires CRUD, deploy, invoke, and invocation-inspection operations as tools
|
|
19
|
-
so an agent can scaffold, iterate, and test functions entirely within a chat session.
|
|
20
|
-
`,
|
|
21
|
-
icon: 'ph--code--regular',
|
|
22
|
-
iconHue: 'sky',
|
|
23
|
-
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',
|
|
24
|
-
tags: ['labs'],
|
|
25
|
-
screenshots: ['https://dxos.network/plugin-details-scripts-dark.png'],
|
|
26
|
-
});
|
|
8
|
+
import config from '../dx.config';
|
|
9
|
+
|
|
10
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
|
27
11
|
|
|
28
12
|
// TODO(ZaymonFC): Configure by scopes?
|
|
29
13
|
export const defaultScriptsForIntegration: Record<string, string[]> = {
|
|
@@ -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
|
+
);
|