@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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/containers/ScriptSettings/ScriptSettings.tsx
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Button, useTranslation } from "@dxos/react-ui";
|
|
6
|
+
import { Form } from "@dxos/react-ui-form";
|
|
7
|
+
import { meta } from "#meta";
|
|
8
|
+
import { Settings } from "#types";
|
|
9
|
+
var ScriptSettings = ({ settings, onSettingsChange, onAuthenticate }) => {
|
|
10
|
+
const { t } = useTranslation(meta.profile.key);
|
|
11
|
+
return /* @__PURE__ */ React.createElement(Form.Root, {
|
|
12
|
+
schema: Settings.Settings,
|
|
13
|
+
values: settings,
|
|
14
|
+
variant: "settings",
|
|
15
|
+
readonly: !onSettingsChange,
|
|
16
|
+
onValuesChanged: (values) => onSettingsChange?.((current) => ({
|
|
17
|
+
...current,
|
|
18
|
+
...values
|
|
19
|
+
}))
|
|
20
|
+
}, /* @__PURE__ */ React.createElement(Form.Viewport, {
|
|
21
|
+
scroll: true
|
|
22
|
+
}, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.Section, {
|
|
23
|
+
title: meta.profile.name ?? meta.profile.key
|
|
24
|
+
}, /* @__PURE__ */ React.createElement(Form.Row, {
|
|
25
|
+
label: t("authenticate-action.label"),
|
|
26
|
+
description: t("authenticate-action.description")
|
|
27
|
+
}, /* @__PURE__ */ React.createElement(Button, {
|
|
28
|
+
disabled: !onSettingsChange,
|
|
29
|
+
onClick: onAuthenticate
|
|
30
|
+
}, t("authenticate-button.label"))), /* @__PURE__ */ React.createElement(Form.FieldSet, null)))));
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
ScriptSettings as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=ScriptSettings-NS3ZY7ZR.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/ScriptSettings/ScriptSettings.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Button, useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { Settings } from '#types';\n\nexport type ScriptSettingsProps = AppSurface.SettingsProps<\n Settings.Settings,\n {\n onAuthenticate?: () => void;\n }\n>;\n\nexport const ScriptSettings = ({ settings, onSettingsChange, onAuthenticate }: ScriptSettingsProps) => {\n const { t } = useTranslation(meta.profile.key);\n\n return (\n <Form.Root\n schema={Settings.Settings}\n values={settings}\n variant='settings'\n readonly={!onSettingsChange}\n onValuesChanged={(values) => onSettingsChange?.((current) => ({ ...current, ...values }))}\n >\n <Form.Viewport scroll>\n <Form.Content>\n <Form.Section title={meta.profile.name ?? meta.profile.key}>\n {/* TODO(wittjosiah): Hide outside of dev environments. */}\n <Form.Row label={t('authenticate-action.label')} description={t('authenticate-action.description')}>\n <Button disabled={!onSettingsChange} onClick={onAuthenticate}>\n {t('authenticate-button.label')}\n </Button>\n </Form.Row>\n <Form.FieldSet />\n </Form.Section>\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,OAAOA,WAAW;AAGlB,SAASC,QAAQC,sBAAsB;AACvC,SAASC,YAAY;AAErB,SAASC,YAAY;AACrB,SAASC,gBAAgB;AASlB,IAAMC,iBAAiB,CAAC,EAAEC,UAAUC,kBAAkBC,eAAc,MAAuB;AAChG,QAAM,EAAEC,EAAC,IAAKR,eAAeE,KAAKO,QAAQC,GAAG;AAE7C,SACE,sBAAA,cAACT,KAAKU,MAAI;IACRC,QAAQT,SAASA;IACjBU,QAAQR;IACRS,SAAQ;IACRC,UAAU,CAACT;IACXU,iBAAiB,CAACH,WAAWP,mBAAmB,CAACW,aAAa;MAAE,GAAGA;MAAS,GAAGJ;IAAO,EAAA;KAEtF,sBAAA,cAACZ,KAAKiB,UAAQ;IAACC,QAAAA;KACb,sBAAA,cAAClB,KAAKmB,SAAO,MACX,sBAAA,cAACnB,KAAKoB,SAAO;IAACC,OAAOpB,KAAKO,QAAQc,QAAQrB,KAAKO,QAAQC;KAErD,sBAAA,cAACT,KAAKuB,KAAG;IAACC,OAAOjB,EAAE,2BAAA;IAA8BkB,aAAalB,EAAE,iCAAA;KAC9D,sBAAA,cAACT,QAAAA;IAAO4B,UAAU,CAACrB;IAAkBsB,SAASrB;KAC3CC,EAAE,2BAAA,CAAA,CAAA,GAGP,sBAAA,cAACP,KAAK4B,UAAQ,IAAA,CAAA,CAAA,CAAA,CAAA;AAM1B;",
|
|
6
|
+
"names": ["React", "Button", "useTranslation", "Form", "meta", "Settings", "ScriptSettings", "settings", "onSettingsChange", "onAuthenticate", "t", "profile", "key", "Root", "schema", "values", "variant", "readonly", "onValuesChanged", "current", "Viewport", "scroll", "Content", "Section", "title", "name", "Row", "label", "description", "disabled", "onClick", "FieldSet"]
|
|
7
|
+
}
|
|
@@ -18,7 +18,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
18
18
|
label: [
|
|
19
19
|
"script-test.label",
|
|
20
20
|
{
|
|
21
|
-
ns: meta.
|
|
21
|
+
ns: meta.profile.key
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
24
|
icon: "ph--terminal--regular",
|
|
@@ -35,7 +35,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
35
35
|
label: [
|
|
36
36
|
"script-logs.label",
|
|
37
37
|
{
|
|
38
|
-
ns: meta.
|
|
38
|
+
ns: meta.profile.key
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
icon: "ph--clock-countdown--regular",
|
|
@@ -49,4 +49,4 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
49
49
|
export {
|
|
50
50
|
app_graph_builder_default as default
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=app-graph-builder-
|
|
52
|
+
//# sourceMappingURL=app-graph-builder-POP3CX6G.mjs.map
|
package/dist/lib/neutral/{app-graph-builder-7AWFCEQF.mjs.map → app-graph-builder-POP3CX6G.mjs.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode } from '@dxos/app-toolkit';\nimport { Script } from '@dxos/compute';\nimport { GraphBuilder } from '@dxos/plugin-graph';\n\nimport { meta } from '#meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n GraphBuilder.createTypeExtension({\n id: 'execute',\n type: Script.Script,\n connector: () =>\n Effect.succeed([\n AppNode.makeCompanion({\n id: 'execute',\n label: ['script-test.label', { ns: meta.
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,eAAe;AACzC,SAASC,cAAc;AACvB,SAASC,oBAAoB;AAE7B,SAASC,YAAY;AAErB,IAAA,4BAAeL,WAAWM,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAcC,WAAI;IACnCL,aAAaM,oBAAoB;MAC/BC,IAAI;MACJC,MAAMT,OAAOA;MACbU,WAAW,MACFC,eAAQ;QACbZ,QAAQa,cAAc;UACpBJ,IAAI;UACJK,OAAO;YAAC;YAAqB;cAAEC,IAAIZ,
|
|
6
|
-
"names": ["Effect", "Capability", "AppCapabilities", "AppNode", "Script", "GraphBuilder", "meta", "makeModule", "fnUntraced", "extensions", "all", "createTypeExtension", "id", "type", "connector", "succeed", "makeCompanion", "label", "ns", "icon", "data", "contributes", "AppGraphBuilder"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode } from '@dxos/app-toolkit';\nimport { Script } from '@dxos/compute';\nimport { GraphBuilder } from '@dxos/plugin-graph';\n\nimport { meta } from '#meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n GraphBuilder.createTypeExtension({\n id: 'execute',\n type: Script.Script,\n connector: () =>\n Effect.succeed([\n AppNode.makeCompanion({\n id: 'execute',\n label: ['script-test.label', { ns: meta.profile.key }],\n icon: 'ph--terminal--regular',\n data: 'execute',\n }),\n ]),\n }),\n GraphBuilder.createTypeExtension({\n id: 'logs',\n type: Script.Script,\n connector: () =>\n Effect.succeed([\n AppNode.makeCompanion({\n id: 'logs',\n label: ['script-logs.label', { ns: meta.profile.key }],\n icon: 'ph--clock-countdown--regular',\n data: 'logs',\n }),\n ]),\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,eAAe;AACzC,SAASC,cAAc;AACvB,SAASC,oBAAoB;AAE7B,SAASC,YAAY;AAErB,IAAA,4BAAeL,WAAWM,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAcC,WAAI;IACnCL,aAAaM,oBAAoB;MAC/BC,IAAI;MACJC,MAAMT,OAAOA;MACbU,WAAW,MACFC,eAAQ;QACbZ,QAAQa,cAAc;UACpBJ,IAAI;UACJK,OAAO;YAAC;YAAqB;cAAEC,IAAIZ,KAAKa,QAAQC;YAAI;;UACpDC,MAAM;UACNC,MAAM;QACR,CAAA;OACD;IACL,CAAA;IACAjB,aAAaM,oBAAoB;MAC/BC,IAAI;MACJC,MAAMT,OAAOA;MACbU,WAAW,MACFC,eAAQ;QACbZ,QAAQa,cAAc;UACpBJ,IAAI;UACJK,OAAO;YAAC;YAAqB;cAAEC,IAAIZ,KAAKa,QAAQC;YAAI;;UACpDC,MAAM;UACNC,MAAM;QACR,CAAA;OACD;IACL,CAAA;GACD;AAED,SAAOrB,WAAWsB,YAAYrB,gBAAgBsB,iBAAiBf,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capability", "AppCapabilities", "AppNode", "Script", "GraphBuilder", "meta", "makeModule", "fnUntraced", "extensions", "all", "createTypeExtension", "id", "type", "connector", "succeed", "makeCompanion", "label", "ns", "profile", "key", "icon", "data", "contributes", "AppGraphBuilder"]
|
|
7
7
|
}
|
|
@@ -2,20 +2,20 @@ import "../chunk-J5LGTIGS.mjs";
|
|
|
2
2
|
|
|
3
3
|
// src/capabilities/index.ts
|
|
4
4
|
import { Capability } from "@dxos/app-framework";
|
|
5
|
-
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-
|
|
6
|
-
var
|
|
7
|
-
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-
|
|
5
|
+
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-POP3CX6G.mjs"));
|
|
6
|
+
var SkillDefinition = Capability.lazy("SkillDefinition", () => import("../skill-definition-JZ7UYBT7.mjs"));
|
|
7
|
+
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-QW66KQWS.mjs"));
|
|
8
8
|
var Compiler = Capability.lazy("Compiler", () => import("../compiler-ODK4UA2N.mjs"));
|
|
9
|
-
var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-
|
|
10
|
-
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-
|
|
11
|
-
var ScriptSettings = Capability.lazy("ScriptSettings", () => import("../settings-
|
|
9
|
+
var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-M3B6IRMV.mjs"));
|
|
10
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-GEXOZLBC.mjs"));
|
|
11
|
+
var ScriptSettings = Capability.lazy("ScriptSettings", () => import("../settings-FD7HXEY6.mjs"));
|
|
12
12
|
export {
|
|
13
13
|
AppGraphBuilder,
|
|
14
|
-
BlueprintDefinition,
|
|
15
14
|
Compiler,
|
|
16
15
|
CreateObject,
|
|
17
16
|
OperationHandler,
|
|
18
17
|
ReactSurface,
|
|
19
|
-
ScriptSettings
|
|
18
|
+
ScriptSettings,
|
|
19
|
+
SkillDefinition
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,kBAAkB;
|
|
6
|
-
"names": ["Capability", "AppGraphBuilder", "lazy", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const Compiler = Capability.lazy('Compiler', () => import('./compiler'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const ScriptSettings = Capability.lazy('ScriptSettings', () => import('./settings'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,kBAAkB;AAGpB,IAAMC,kBAAkBD,WAAWE,KAAK,mBAAmB,MAAM,OAAO,mCAAA,CAAA;AACxE,IAAMC,kBAAkBH,WAAWE,KAAK,mBAAmB,MAAM,OAAO,kCAAA,CAAA;AACxE,IAAME,eAAeJ,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMG,WAAWL,WAAWE,KAAK,YAAY,MAAM,OAAO,0BAAA,CAAA;AAC1D,IAAMI,mBAAmBN,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAMK,eAAeP,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMM,iBAAiBR,WAAWE,KAAK,kBAAkB,MAAM,OAAO,0BAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "AppGraphBuilder", "lazy", "SkillDefinition", "CreateObject", "Compiler", "OperationHandler", "ReactSurface", "ScriptSettings"]
|
|
7
7
|
}
|
|
@@ -2,16 +2,16 @@ import "../chunk-J5LGTIGS.mjs";
|
|
|
2
2
|
|
|
3
3
|
// src/capabilities/node.ts
|
|
4
4
|
import { Capability } from "@dxos/app-framework";
|
|
5
|
-
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-
|
|
6
|
-
var
|
|
7
|
-
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-
|
|
5
|
+
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-POP3CX6G.mjs"));
|
|
6
|
+
var SkillDefinition = Capability.lazy("SkillDefinition", () => import("../skill-definition-JZ7UYBT7.mjs"));
|
|
7
|
+
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-QW66KQWS.mjs"));
|
|
8
8
|
var Compiler = Capability.lazy("Compiler", () => import("../compiler-ODK4UA2N.mjs"));
|
|
9
|
-
var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-
|
|
9
|
+
var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-M3B6IRMV.mjs"));
|
|
10
10
|
export {
|
|
11
11
|
AppGraphBuilder,
|
|
12
|
-
BlueprintDefinition,
|
|
13
12
|
Compiler,
|
|
14
13
|
CreateObject,
|
|
15
|
-
OperationHandler
|
|
14
|
+
OperationHandler,
|
|
15
|
+
SkillDefinition
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=node.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/capabilities/node.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,kBAAkB;
|
|
6
|
-
"names": ["Capability", "AppGraphBuilder", "lazy", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const Compiler = Capability.lazy('Compiler', () => import('./compiler'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,kBAAkB;AAGpB,IAAMC,kBAAkBD,WAAWE,KAAK,mBAAmB,MAAM,OAAO,mCAAA,CAAA;AACxE,IAAMC,kBAAkBH,WAAWE,KAAK,mBAAmB,MAAM,OAAO,kCAAA,CAAA;AACxE,IAAME,eAAeJ,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMG,WAAWL,WAAWE,KAAK,YAAY,MAAM,OAAO,0BAAA,CAAA;AAC1D,IAAMI,mBAAmBN,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "AppGraphBuilder", "lazy", "SkillDefinition", "CreateObject", "Compiler", "OperationHandler"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
templates
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WAGQ77UQ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
6
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -27,8 +27,8 @@ __export(Notebook_exports, {
|
|
|
27
27
|
make: () => make
|
|
28
28
|
});
|
|
29
29
|
import * as Schema2 from "effect/Schema";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
30
|
+
import { Instructions } from "@dxos/compute";
|
|
31
|
+
import { Annotation, DXN, Obj, Ref, Type } from "@dxos/echo";
|
|
32
32
|
import { FormInputAnnotation } from "@dxos/echo/Annotation";
|
|
33
33
|
import { LabelAnnotation } from "@dxos/echo/Annotation";
|
|
34
34
|
import { Graph } from "@dxos/plugin-explorer";
|
|
@@ -39,10 +39,10 @@ var Cell = Schema2.Struct({
|
|
|
39
39
|
name: Schema2.optional(Schema2.String),
|
|
40
40
|
// TODO(burdon): Union type.
|
|
41
41
|
source: Schema2.optional(Ref.Ref(Text.Text)),
|
|
42
|
-
prompt: Schema2.optional(Ref.Ref(
|
|
42
|
+
prompt: Schema2.optional(Ref.Ref(Instructions.Instructions)),
|
|
43
43
|
graph: Schema2.optional(Ref.Ref(Graph.Graph))
|
|
44
44
|
});
|
|
45
|
-
var Notebook = Schema2.Struct({
|
|
45
|
+
var Notebook = class extends Type.makeObject(DXN.make("org.dxos.type.notebook", "0.1.0"))(Schema2.Struct({
|
|
46
46
|
name: Schema2.String.pipe(Schema2.optional),
|
|
47
47
|
cells: Cell.pipe(Schema2.Array, FormInputAnnotation.set(false))
|
|
48
48
|
}).pipe(LabelAnnotation.set([
|
|
@@ -50,7 +50,8 @@ var Notebook = Schema2.Struct({
|
|
|
50
50
|
]), Annotation.IconAnnotation.set({
|
|
51
51
|
icon: "ph--notebook--regular",
|
|
52
52
|
hue: "sky"
|
|
53
|
-
})
|
|
53
|
+
}))) {
|
|
54
|
+
};
|
|
54
55
|
var make = (props = {
|
|
55
56
|
cells: []
|
|
56
57
|
}) => Obj.make(Notebook, props);
|
|
@@ -63,8 +64,8 @@ __export(ScriptCapabilities_exports, {
|
|
|
63
64
|
});
|
|
64
65
|
import { Capability } from "@dxos/app-framework";
|
|
65
66
|
import { meta } from "#meta";
|
|
66
|
-
var Settings2 = Capability.make(`${meta.
|
|
67
|
-
var Compiler = Capability.make(`${meta.
|
|
67
|
+
var Settings2 = Capability.make(`${meta.profile.key}.capability.settings`);
|
|
68
|
+
var Compiler = Capability.make(`${meta.profile.key}.capability.compiler`);
|
|
68
69
|
|
|
69
70
|
// src/types/ScriptEvents.ts
|
|
70
71
|
var ScriptEvents_exports = {};
|
|
@@ -73,7 +74,7 @@ __export(ScriptEvents_exports, {
|
|
|
73
74
|
});
|
|
74
75
|
import { ActivationEvent } from "@dxos/app-framework";
|
|
75
76
|
import { meta as meta2 } from "#meta";
|
|
76
|
-
var SetupCompiler = ActivationEvent.make(`${meta2.
|
|
77
|
+
var SetupCompiler = ActivationEvent.make(`${meta2.profile.key}.event.setupCompiler`);
|
|
77
78
|
|
|
78
79
|
// src/types/ScriptOperation.ts
|
|
79
80
|
var ScriptOperation_exports = {};
|
|
@@ -83,10 +84,10 @@ __export(ScriptOperation_exports, {
|
|
|
83
84
|
ScriptProps: () => ScriptProps
|
|
84
85
|
});
|
|
85
86
|
import * as Schema3 from "effect/Schema";
|
|
86
|
-
import {
|
|
87
|
-
import { Database,
|
|
87
|
+
import { Operation, Script } from "@dxos/compute";
|
|
88
|
+
import { Database, DXN as DXN2, Type as Type2 } from "@dxos/echo";
|
|
88
89
|
import { meta as meta3 } from "#meta";
|
|
89
|
-
var makeKey = (name) => DXN2.make(`${meta3.
|
|
90
|
+
var makeKey = (name) => DXN2.make(`${meta3.profile.key}.operation.${name}`);
|
|
90
91
|
var ScriptProps = Schema3.Struct({
|
|
91
92
|
name: Schema3.optional(Schema3.String),
|
|
92
93
|
gistUrl: Schema3.optional(Schema3.String.annotations({
|
|
@@ -120,4 +121,4 @@ export {
|
|
|
120
121
|
ScriptEvents_exports,
|
|
121
122
|
ScriptOperation_exports
|
|
122
123
|
};
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-652CIABA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/Settings.ts", "../../../src/types/Notebook.ts", "../../../src/types/ScriptCapabilities.ts", "../../../src/types/ScriptEvents.ts", "../../../src/types/ScriptOperation.ts"],
|
|
4
|
+
"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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Instructions } from '@dxos/compute';\nimport { Annotation, DXN, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/Annotation';\nimport { LabelAnnotation } from '@dxos/echo/Annotation';\nimport { Graph } from '@dxos/plugin-explorer';\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", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\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.make<Atom.Writable<import('./Settings').Settings>>(\n `${meta.profile.key}.capability.settings`,\n);\nexport const Compiler = Capability.make<CompilerType>(`${meta.profile.key}.capability.compiler`);\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { ActivationEvent } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nexport const SetupCompiler = ActivationEvent.make(`${meta.profile.key}.event.setupCompiler`);\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Operation, Script } from '@dxos/compute';\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.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AAWC,WAAWE,KACjC,GAAGD,KAAKE,QAAQC,GAAG,sBAAsB;AAEpC,IAAMC,WAAWL,WAAWE,KAAmB,GAAGD,KAAKE,QAAQC,GAAG,sBAAsB;;;ACnB/F;;;;AAMA,SAASE,uBAAuB;AAEhC,SAASC,QAAAA,aAAY;AAEd,IAAMC,gBAAgBF,gBAAgBG,KAAK,GAAGF,MAAKG,QAAQC,GAAG,sBAAsB;;;ACV3F;;;;;;AAMA,YAAYC,aAAY;AAExB,SAASC,WAAWC,cAAc;AAClC,SAASC,UAAUC,OAAAA,MAAKC,QAAAA,aAAY;AAEpC,SAASC,QAAAA,aAAY;AAIrB,IAAMC,UAAU,CAACC,SAAiBC,KAAIC,KAAK,GAAGC,MAAKC,QAAQC,GAAG,cAAcL,IAAAA,EAAM;AAE3E,IAAMM,cAAqBC,eAAO;EACvCP,MAAaQ,iBAAgBC,cAAM;EACnCC,SAAgBF,iBAAgBC,eAAOE,YAAY;IAAEC,OAAO;EAAyB,CAAA,CAAA;EACrFC,mBAA0BC,gBAAO,GAAIC,UAAUC,IAAI,CAAC,EAAEC,GAAE,MAAOA,EAAAA,CAAAA,EAAKC,KAC3DP,oBAAY;IAAEC,OAAO;EAAW,CAAA,GAChCJ,gBAAQ;AAEnB,CAAA;AAEO,IAAMW,gBAAuBZ,eAAO;EACzCP,MAAaQ,iBAAgBC,cAAM;AACrC,CAAA;AAEO,IAAMW,eAAeC,UAAUnB,KAAK;EACzCC,MAAM;IAAEE,KAAKN,QAAQ,cAAA;IAAiBC,MAAM;IAAiBsB,MAAM;EAAoB;EACvFC,OAAcC,eACZlB,aACOC,eAAO;IACZkB,IAAIC,SAASA;EACf,CAAA,CAAA;EAEFC,QAAepB,eAAO;IACpBqB,QAAQC,MAAKC,UAAUC,OAAOA,MAAM;EACtC,CAAA;AACF,CAAA;",
|
|
6
|
+
"names": ["Schema", "EditorInputMode", "Settings", "mutable", "Struct", "editorInputMode", "annotations", "title", "description", "Schema", "Instructions", "Annotation", "DXN", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "Graph", "Text", "Cell", "Struct", "id", "String", "type", "name", "optional", "source", "prompt", "graph", "Notebook", "makeObject", "make", "pipe", "cells", "Array", "set", "IconAnnotation", "icon", "hue", "props", "Settings", "Capability", "meta", "make", "profile", "key", "Compiler", "ActivationEvent", "meta", "SetupCompiler", "make", "profile", "key", "Schema", "Operation", "Script", "Database", "DXN", "Type", "meta", "makeKey", "name", "DXN", "make", "meta", "profile", "key", "ScriptProps", "Struct", "optional", "String", "gistUrl", "annotations", "title", "initialTemplateId", "Literal", "templates", "map", "id", "pipe", "NotebookProps", "CreateScript", "Operation", "icon", "input", "extend", "db", "Database", "output", "object", "Type", "getSchema", "Script"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/skills/functions/definitions.ts
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
import { ClientService } from "@dxos/client";
|
|
4
4
|
import { Operation } from "@dxos/compute";
|
|
5
|
-
import { Database,
|
|
5
|
+
import { Database, DXN, Ref } from "@dxos/echo";
|
|
6
6
|
import { trim } from "@dxos/util";
|
|
7
7
|
var FunctionRef = Ref.Ref(Operation.PersistentOperation).annotations({
|
|
8
8
|
description: "The ID of the function."
|
|
@@ -267,8 +267,7 @@ var InspectInvocations = Operation.make({
|
|
|
267
267
|
})
|
|
268
268
|
}),
|
|
269
269
|
services: [
|
|
270
|
-
Database.Service
|
|
271
|
-
Feed.FeedService
|
|
270
|
+
Database.Service
|
|
272
271
|
]
|
|
273
272
|
});
|
|
274
273
|
var DeployedFunctionSchema = Schema.Struct({
|
|
@@ -342,4 +341,4 @@ export {
|
|
|
342
341
|
QueryDeployedFunctions,
|
|
343
342
|
InstallFunction
|
|
344
343
|
};
|
|
345
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-6DOWVKIW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/skills/functions/definitions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { ClientService } from '@dxos/client';\nimport { Operation } from '@dxos/compute';\nimport { Database, DXN, Ref } from '@dxos/echo';\nimport { trim } from '@dxos/util';\n\nconst FunctionRef = Ref.Ref(Operation.PersistentOperation).annotations({\n description: 'The ID of the function.',\n});\n\nconst FunctionId = Schema.String.annotations({\n description: 'The ID of the function. Can be passed as the function parameter to other operations.',\n});\n\nconst FUNCTION_FORMAT = trim`\n IMPORTANT: Every function MUST follow this exact pattern — define an Operation, then export default the handler:\n\n \\`\\`\\`typescript\n import * as Effect from 'effect/Effect';\n import * as Schema from 'effect/Schema';\n\n import { Operation } from '@dxos/compute';\n\n const MyFunction = Operation.make({\n meta: {\n key: DXN.make('org.dxos.script.myFunction'),\n name: 'My Function',\n },\n input: Schema.Struct({\n city: Schema.String.annotations({ description: 'City name' }),\n }),\n output: Schema.Any,\n });\n\n export default MyFunction.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ city }) {\n const res = yield* Effect.promise(() =>\n fetch(\\`https://wttr.in/\\${city}?format=j1\\`)\n );\n const data = yield* Effect.promise(() => res.json());\n return data;\n }),\n ),\n );\n \\`\\`\\`\n\n Key rules:\n - The file MUST have a single \\`export default\\` of Operation.pipe(Operation.withHandler(...)).\n - Use \\`Effect.fn(function* (...) { ... })\\` for the handler body.\n - Wrap async calls with \\`yield* Effect.promise(() => ...)\\`.\n - Do NOT use top-level await; do NOT export named functions; do NOT use module.exports.\n`;\n\nconst AVAILABLE_PACKAGES = trim`\n Scripts run in an Edge runtime (Cloudflare Workers) with the following pre-bundled packages:\n\n DXOS SDK:\n - \\`@dxos/echo\\` — Reactive local-first database: query, filter, and mutate ECHO objects in spaces.\n - \\`@dxos/functions\\` — Edge function framework: triggers, queues, and function definitions.\n - \\`@dxos/ai\\` — AI/LLM integration via AiService (access models like Claude, GPT).\n - \\`@dxos/schema\\` — Schema utilities and built-in DXOS types.\n - \\`@dxos/types\\` — DXOS type definitions.\n - \\`@dxos/operation\\` — Define and handle typed operations with input/output schemas.\n - \\`@dxos/util\\` — General utility functions.\n - \\`@dxos/log\\` — Structured logging.\n\n Effect-TS (functional programming toolkit):\n - \\`effect\\` — Core effect system with sub-modules: Effect, Schema, Stream, Schedule, Array, Record, Option, Either, Match, etc.\n - \\`@effect/platform\\` — HTTP client (\\`HttpClient\\`), platform abstractions for making typed API requests.\n\n Data format parsing & querying:\n - \\`jsonata\\` — Powerful query and transformation expressions for JSON data (filter, sort, group, aggregate, reshape).\n - \\`yaml\\` — Parse and stringify YAML documents.\n - \\`fast-xml-parser\\` — Fast XML parser and builder; convert between XML and JSON.\n - \\`papaparse\\` — CSV parsing and serialization; stream large files, auto-detect delimiters.\n\n Text & markup processing:\n - \\`turndown\\` — HTML to Markdown converter (useful for feeding web content to LLMs).\n\n HTML/DOM parsing:\n - \\`linkedom\\` — Lightweight DOM parser for worker environments; parse and query HTML documents.\n\n Data processing & utilities:\n - \\`date-fns\\` — Comprehensive date utility library: parsing, formatting, comparison, arithmetic, time zones.\n\n Other:\n - \\`@automerge/automerge\\` — CRDT library for conflict-free collaborative data structures.\n - \\`chess.js\\` — Chess game logic, move generation, and validation.\n`;\n\nexport const Create = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.create'),\n name: 'Create',\n description: `Creates a new function with TypeScript source code and adds it to the space. ${FUNCTION_FORMAT} ${AVAILABLE_PACKAGES}`,\n icon: 'ph--code--regular',\n },\n input: Schema.Struct({\n name: Schema.String.annotations({\n description: 'Name of the function.',\n }),\n source: Schema.optional(Schema.String).annotations({\n description: 'TypeScript source code for the function.',\n }),\n templateId: Schema.optional(Schema.String).annotations({\n description: 'ID of a template to use as the initial source.',\n }),\n }),\n output: Schema.Struct({\n function: FunctionId,\n }),\n services: [Database.Service],\n});\n\nexport const Read = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.read'),\n name: 'Read',\n description: 'Reads the source code and metadata of a function.',\n icon: 'ph--file-text--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n }),\n output: Schema.Struct({\n name: Schema.optional(Schema.String),\n source: Schema.String,\n description: Schema.optional(Schema.String),\n }),\n services: [Database.Service],\n});\n\n// The edit descriptions feed the script skill's LLM tool definition (and its memoized\n// fixtures), so the schema stays local and context-tuned; the apply logic is shared via `Doc.applyEdits`.\nconst Edit = Schema.Struct({\n oldString: Schema.String.annotations({\n description: 'The text to find in the source.',\n }),\n newString: Schema.String.annotations({\n description: 'The text to replace it with.',\n }),\n replaceAll: Schema.optional(Schema.Boolean).annotations({\n description: 'If true, replaces all occurrences. Defaults to false (first occurrence only).',\n }),\n});\n\nexport const Update = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.update'),\n name: 'Update',\n description: `Updates the source code or metadata of a function. ${FUNCTION_FORMAT}`,\n icon: 'ph--pencil--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n name: Schema.optional(Schema.String).annotations({\n description: 'New name for the function.',\n }),\n description: Schema.optional(Schema.String).annotations({\n description: 'New description for the function.',\n }),\n edits: Schema.optional(Schema.Array(Edit)).annotations({\n description: 'Edits to apply to the source. Each edit finds oldString and replaces it with newString.',\n }),\n }),\n output: Schema.Struct({\n function: FunctionId,\n }),\n services: [Database.Service],\n});\n\nexport const Delete = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.delete'),\n name: 'Delete',\n description: 'Deletes a function and its source from the space.',\n icon: 'ph--trash--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n\nexport const Deploy = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.deploy'),\n name: 'Deploy',\n description: `Deploys a function to the Edge runtime. The function source must follow the required format: a single export default of Operation.pipe(Operation.withHandler(Effect.fn(function* (...) { ... }))). See the Create operation description for a full example.`,\n icon: 'ph--rocket-launch--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n }),\n output: Schema.Struct({\n function: FunctionId,\n functionUrl: Schema.optional(Schema.String).annotations({\n description: 'The URL of the deployed function.',\n }),\n }),\n services: [Database.Service, ClientService],\n});\n\nexport const Invoke = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.invoke'),\n name: 'Invoke',\n description: 'Invokes a deployed Edge function with the given payload.',\n icon: 'ph--play--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n payload: Schema.optional(Schema.Unknown).annotations({\n description: 'The input payload to pass to the function.',\n }),\n }),\n output: Schema.Struct({\n response: Schema.Unknown.annotations({\n description: 'The response from the function.',\n }),\n }),\n services: [Database.Service, ClientService],\n});\n\nconst InvocationSpanSchema = Schema.Struct({\n id: Schema.String.annotations({\n description: 'The invocation ID.',\n }),\n timestamp: Schema.Number.annotations({\n description: 'Start time of the invocation (epoch ms).',\n }),\n duration: Schema.Number.annotations({\n description: 'Duration in milliseconds.',\n }),\n outcome: Schema.String.annotations({\n description: 'Invocation outcome: success, failure, or pending.',\n }),\n input: Schema.Object.annotations({\n description: 'The input payload passed to the function.',\n }),\n error: Schema.optional(Schema.Object).annotations({\n description: 'Error details if the invocation failed.',\n }),\n});\n\nexport const InspectInvocations = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.inspectInvocations'),\n name: 'InspectInvocations',\n description: 'Queries the invocation trace feed for a function, returning its invocation history.',\n icon: 'ph--magnifying-glass--regular',\n },\n input: Schema.Struct({\n function: FunctionRef,\n limit: Schema.optional(Schema.Number).annotations({\n description: 'Maximum number of invocations to return. Defaults to 20.',\n }),\n }),\n output: Schema.Struct({\n invocations: Schema.Array(InvocationSpanSchema).annotations({\n description: 'List of invocation spans, most recent first.',\n }),\n total: Schema.Number.annotations({\n description: 'Total number of invocations found.',\n }),\n }),\n services: [Database.Service],\n});\n\nconst DeployedFunctionSchema = Schema.Struct({\n key: Schema.optional(Schema.String).annotations({\n description: 'Unique key identifying the function. Pass to InstallFunction to install it.',\n }),\n name: Schema.String.annotations({\n description: 'Display name of the function.',\n }),\n version: Schema.String.annotations({\n description: 'Semantic version of the deployed function.',\n }),\n description: Schema.optional(Schema.String).annotations({\n description: 'Description of what the function does.',\n }),\n updated: Schema.optional(Schema.String).annotations({\n description: 'ISO timestamp of the last deployment.',\n }),\n});\n\nexport const QueryDeployedFunctions = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.queryDeployed'),\n name: 'QueryDeployedFunctions',\n description: 'Lists all functions deployed to the EDGE runtime. Use InstallFunction to add one to the space.',\n icon: 'ph--list--regular',\n },\n input: Schema.Void,\n output: Schema.Struct({\n functions: Schema.Array(DeployedFunctionSchema).annotations({\n description: 'List of deployed functions.',\n }),\n }),\n services: [ClientService],\n});\n\nexport const InstallFunction = Operation.make({\n meta: {\n key: DXN.make('org.dxos.function.script.install'),\n name: 'InstallFunction',\n description:\n 'Installs a deployed EDGE function into the current space by key. The returned function ID can be passed directly to Invoke.',\n icon: 'ph--download--regular',\n },\n input: Schema.Struct({\n key: Schema.String.annotations({\n description: 'The unique key of the deployed function to install (from QueryDeployedFunctions).',\n }),\n }),\n output: Schema.Struct({\n function: FunctionId,\n name: Schema.String.annotations({\n description: 'Name of the installed function.',\n }),\n version: Schema.String.annotations({\n description: 'Version of the installed function.',\n }),\n }),\n services: [ClientService],\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,qBAAqB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,KAAKC,WAAW;AACnC,SAASC,YAAY;AAErB,IAAMC,cAAcF,IAAIA,IAAIH,UAAUM,mBAAmB,EAAEC,YAAY;EACrEC,aAAa;AACf,CAAA;AAEA,IAAMC,aAAoBC,cAAOH,YAAY;EAC3CC,aAAa;AACf,CAAA;AAEA,IAAMG,kBAAkBP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCxB,IAA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AEO,IAAMoD,yBAAyB5D,UAAUc,KAAK;EACnDC,MAAM;IACJC,KAAKd,IAAIY,KAAK,wCAAA;IACdG,MAAM;IACNT,aAAa;IACbU,MAAM;EACR;EACAC,OAAcmB;EACdd,QAAeJ,cAAO;IACpByC,WAAkBzB,aAAMqB,sBAAAA,EAAwBlD,YAAY;MAC1DC,aAAa;IACf,CAAA;EACF,CAAA;EACAkB,UAAU;IAAC3B;;AACb,CAAA;AAEO,IAAM+D,kBAAkB9D,UAAUc,KAAK;EAC5CC,MAAM;IACJC,KAAKd,IAAIY,KAAK,kCAAA;IACdG,MAAM;IACNT,aACE;IACFU,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBJ,KAAYN,cAAOH,YAAY;MAC7BC,aAAa;IACf,CAAA;EACF,CAAA;EACAgB,QAAeJ,cAAO;IACpBK,UAAUhB;IACVQ,MAAaP,cAAOH,YAAY;MAC9BC,aAAa;IACf,CAAA;IACAkD,SAAgBhD,cAAOH,YAAY;MACjCC,aAAa;IACf,CAAA;EACF,CAAA;EACAkB,UAAU;IAAC3B;;AACb,CAAA;",
|
|
6
|
+
"names": ["Schema", "ClientService", "Operation", "Database", "DXN", "Ref", "trim", "FunctionRef", "PersistentOperation", "annotations", "description", "FunctionId", "String", "FUNCTION_FORMAT", "AVAILABLE_PACKAGES", "Create", "make", "meta", "key", "name", "icon", "input", "Struct", "source", "optional", "templateId", "output", "function", "services", "Service", "Read", "Edit", "oldString", "newString", "replaceAll", "Boolean", "Update", "edits", "Array", "Delete", "Void", "Deploy", "functionUrl", "Invoke", "payload", "Unknown", "response", "InvocationSpanSchema", "id", "timestamp", "Number", "duration", "outcome", "Object", "error", "InspectInvocations", "limit", "invocations", "total", "DeployedFunctionSchema", "version", "updated", "QueryDeployedFunctions", "functions", "InstallFunction"]
|
|
7
|
+
}
|
|
@@ -8,17 +8,17 @@ import {
|
|
|
8
8
|
QueryDeployedFunctions,
|
|
9
9
|
Read,
|
|
10
10
|
Update
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6DOWVKIW.mjs";
|
|
12
12
|
|
|
13
|
-
// src/
|
|
14
|
-
import {
|
|
13
|
+
// src/skills/script-skill.ts
|
|
14
|
+
import { Skill, Template } from "@dxos/compute";
|
|
15
15
|
import { trim } from "@dxos/util";
|
|
16
|
-
var
|
|
17
|
-
var make = () =>
|
|
18
|
-
key:
|
|
16
|
+
var SKILL_KEY = "org.dxos.skill.script";
|
|
17
|
+
var make = () => Skill.make({
|
|
18
|
+
key: SKILL_KEY,
|
|
19
19
|
name: "Script",
|
|
20
20
|
agentCanEnable: true,
|
|
21
|
-
tools:
|
|
21
|
+
tools: Skill.toolDefinitions({
|
|
22
22
|
operations: [
|
|
23
23
|
Create,
|
|
24
24
|
Read,
|
|
@@ -40,13 +40,13 @@ var make = () => Blueprint.make({
|
|
|
40
40
|
`
|
|
41
41
|
})
|
|
42
42
|
});
|
|
43
|
-
var
|
|
44
|
-
key:
|
|
43
|
+
var skill = {
|
|
44
|
+
key: SKILL_KEY,
|
|
45
45
|
make
|
|
46
46
|
};
|
|
47
|
-
var
|
|
47
|
+
var script_skill_default = skill;
|
|
48
48
|
|
|
49
49
|
export {
|
|
50
|
-
|
|
50
|
+
script_skill_default
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
52
|
+
//# sourceMappingURL=chunk-CHNFYLKW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/skills/script-skill.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Skill, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport {\n Create,\n Delete,\n Deploy,\n InspectInvocations,\n InstallFunction,\n Invoke,\n QueryDeployedFunctions,\n Read,\n Update,\n} from './functions';\n\nconst SKILL_KEY = 'org.dxos.skill.script';\n\nconst make = () =>\n Skill.make({\n key: SKILL_KEY,\n name: 'Script',\n agentCanEnable: true,\n tools: Skill.toolDefinitions({\n operations: [\n Create,\n Read,\n Update,\n Delete,\n Deploy,\n Invoke,\n InspectInvocations,\n QueryDeployedFunctions,\n InstallFunction,\n ],\n }),\n instructions: Template.make({\n source: trim`\n You can create, read, update, and delete scripts which contain TypeScript code.\n You can deploy scripts to the Edge runtime and invoke deployed scripts.\n You can inspect the invocation history of a deployed script.\n You can query all functions deployed to the EDGE runtime and install them into the current space.\n `,\n }),\n });\n\nconst skill: Skill.Definition = {\n key: SKILL_KEY,\n make,\n};\n\nexport default skill;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,SAASA,OAAOC,gBAAgB;AAChC,SAASC,YAAY;AAcrB,IAAMC,YAAY;AAElB,IAAMC,OAAO,MACXC,MAAMD,KAAK;EACTE,KAAKH;EACLI,MAAM;EACNC,gBAAgB;EAChBC,OAAOJ,MAAMK,gBAAgB;IAC3BC,YAAY;MACVC;MACAC;MACAC;MACAC;MACAC;MACAC;MACAC;MACAC;MACAC;;EAEJ,CAAA;EACAC,cAAcC,SAASlB,KAAK;IAC1BmB,QAAQC;;;;;;EAMV,CAAA;AACF,CAAA;AAEF,IAAMC,QAA0B;EAC9BnB,KAAKH;EACLC;AACF;AAEA,IAAA,uBAAeqB;",
|
|
6
|
+
"names": ["Skill", "Template", "trim", "SKILL_KEY", "make", "Skill", "key", "name", "agentCanEnable", "tools", "toolDefinitions", "operations", "Create", "Read", "Update", "Delete", "Deploy", "Invoke", "InspectInvocations", "QueryDeployedFunctions", "InstallFunction", "instructions", "Template", "source", "trim", "skill"]
|
|
7
|
+
}
|
|
@@ -20,6 +20,13 @@ var deployScript = async ({ script, client, space, fn, existingFunctionId }) =>
|
|
|
20
20
|
error: validationError
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
+
const identity = client.halo.identity.get();
|
|
24
|
+
if (!identity) {
|
|
25
|
+
return {
|
|
26
|
+
success: false,
|
|
27
|
+
error: new Error("Identity not available.")
|
|
28
|
+
};
|
|
29
|
+
}
|
|
23
30
|
try {
|
|
24
31
|
const buildResult = await bundleFunction({
|
|
25
32
|
source: script.source.target.content
|
|
@@ -28,9 +35,8 @@ var deployScript = async ({ script, client, space, fn, existingFunctionId }) =>
|
|
|
28
35
|
throw buildResult.error || new Error("Bundle creation failed");
|
|
29
36
|
}
|
|
30
37
|
const functionsServiceClient = FunctionsServiceClient.fromClient(client);
|
|
31
|
-
const newFunction = await functionsServiceClient.deploy(Context.default(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L:
|
|
32
|
-
|
|
33
|
-
ownerPublicKey: space.key,
|
|
38
|
+
const newFunction = await functionsServiceClient.deploy(Context.default(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 41 }), {
|
|
39
|
+
ownerUri: identity.did,
|
|
34
40
|
version: fn ? incrementSemverPatch(Obj.getMeta(fn).version ?? "0.0.0") : "0.0.1",
|
|
35
41
|
functionId: existingFunctionId,
|
|
36
42
|
entryPoint: buildResult.entryPoint,
|
|
@@ -46,7 +52,7 @@ var deployScript = async ({ script, client, space, fn, existingFunctionId }) =>
|
|
|
46
52
|
functionId: getUserFunctionIdInMetadata(Obj.getMeta(storedFunction))
|
|
47
53
|
};
|
|
48
54
|
} catch (err) {
|
|
49
|
-
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L:
|
|
55
|
+
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 58, S: void 0 });
|
|
50
56
|
return {
|
|
51
57
|
success: false,
|
|
52
58
|
error: err
|
|
@@ -129,10 +135,10 @@ var getAccessCredential = (identityKey) => {
|
|
|
129
135
|
id: identityKey,
|
|
130
136
|
assertion: {
|
|
131
137
|
"@type": "dxos.halo.credentials.ServiceAccess",
|
|
132
|
-
serverName: "hub.dxos.network",
|
|
133
|
-
serverKey: identityKey,
|
|
138
|
+
"serverName": "hub.dxos.network",
|
|
139
|
+
"serverKey": identityKey,
|
|
134
140
|
identityKey,
|
|
135
|
-
capabilities: [
|
|
141
|
+
"capabilities": [
|
|
136
142
|
"composer:beta"
|
|
137
143
|
]
|
|
138
144
|
}
|
|
@@ -147,4 +153,4 @@ export {
|
|
|
147
153
|
updateFunctionMetadata,
|
|
148
154
|
getAccessCredential
|
|
149
155
|
};
|
|
150
|
-
//# sourceMappingURL=chunk-
|
|
156
|
+
//# sourceMappingURL=chunk-INFWOSTM.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/deploy.ts", "../../../src/util/functions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Client } from '@dxos/client';\nimport { Operation, Script } from '@dxos/compute';\nimport { Context } from '@dxos/context';\nimport { Obj, Ref } from '@dxos/echo';\nimport { getUserFunctionIdInMetadata } from '@dxos/functions';\nimport { bundleFunction } from '@dxos/functions-runtime/bundler';\nimport { FunctionsServiceClient, incrementSemverPatch } from '@dxos/functions-runtime/edge';\nimport { log } from '@dxos/log';\nimport { FunctionRuntimeKind } from '@dxos/protocols';\nimport { type Space } from '@dxos/react-client/echo';\n\nexport const isScriptDeployed = ({ script, fn }: { script: Script.Script; fn: any }): boolean => {\n const existingFunctionId = fn && getUserFunctionIdInMetadata(Obj.getMeta(fn));\n return Boolean(existingFunctionId) && !script.changed;\n};\n\ntype DeployScriptProps = {\n script: Script.Script;\n client: Client;\n space: Space;\n fn?: Operation.PersistentOperation;\n existingFunctionId?: string;\n};\n\ntype DeployScriptResult = { success: boolean; error?: Error; functionId?: string };\n\n/**\n * Deploy a script to a space, handling bundling and uploading to the FaaS infrastructure.\n */\nexport const deployScript = async ({\n script,\n client,\n space,\n fn,\n existingFunctionId,\n}: DeployScriptProps): Promise<DeployScriptResult> => {\n const validationError = validateDeployInputs(script, space);\n if (validationError) {\n return { success: false, error: validationError };\n }\n\n const identity = client.halo.identity.get();\n if (!identity) {\n return { success: false, error: new Error('Identity not available.') };\n }\n\n try {\n const buildResult = await bundleFunction({\n source: script.source!.target!.content,\n });\n if ('error' in buildResult) {\n throw buildResult.error || new Error('Bundle creation failed');\n }\n\n const functionsServiceClient = FunctionsServiceClient.fromClient(client);\n const newFunction = await functionsServiceClient.deploy(Context.default(), {\n ownerUri: identity.did,\n version: fn ? incrementSemverPatch(Obj.getMeta(fn).version ?? '0.0.0') : '0.0.1',\n functionId: existingFunctionId,\n entryPoint: buildResult.entryPoint,\n assets: buildResult.assets,\n runtime: FunctionRuntimeKind.enums.WORKER_LOADER,\n });\n\n const storedFunction = createOrUpdateFunctionInSpace(space, fn, script, newFunction);\n Obj.update(script, (script) => {\n script.changed = false;\n });\n\n return { success: true, functionId: getUserFunctionIdInMetadata(Obj.getMeta(storedFunction)) };\n } catch (err: any) {\n log.catch(err);\n return { success: false, error: err };\n }\n};\n\n/**\n * Validate inputs for script deployment.\n */\nconst validateDeployInputs = (script: Script.Script, space: Space): Error | null => {\n if (!script.source || !space) {\n return new Error('Script source or space not available');\n }\n return null;\n};\n\nconst createOrUpdateFunctionInSpace = (\n space: Space,\n fn: Operation.PersistentOperation | undefined,\n script: Script.Script,\n newFunction: Operation.PersistentOperation,\n): Operation.PersistentOperation => {\n if (fn) {\n Operation.setFrom(fn, newFunction);\n return fn;\n } else {\n Obj.update(newFunction, (newFunction) => {\n newFunction.source = Ref.make(script);\n });\n return space.db.add(newFunction);\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Operation, Script } from '@dxos/compute';\nimport { Obj } from '@dxos/echo';\nimport { getUserFunctionIdInMetadata } from '@dxos/functions';\nimport { getInvocationUrl } from '@dxos/functions-runtime';\nimport { type PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\n/**\n * Get the function URL for a given script and client configuration\n */\nexport const getFunctionUrl = ({\n script,\n fn,\n edgeUrl,\n}: {\n script: Script.Script;\n fn: any;\n edgeUrl: string;\n}): string | undefined => {\n const spaceId = Obj.getDatabase(script)?.spaceId;\n const existingFunctionId = fn && getUserFunctionIdInMetadata(Obj.getMeta(fn));\n\n if (!existingFunctionId) {\n return undefined;\n }\n\n return getInvocationUrl(existingFunctionId, edgeUrl, {\n spaceId,\n });\n};\n\nexport const updateFunctionMetadata = (\n script: Script.Script,\n storedFunction: Operation.PersistentOperation,\n meta: any,\n functionId: string,\n) => {\n Obj.update(storedFunction, (storedFunction) => {\n if (script.description !== undefined && script.description.trim() !== '') {\n storedFunction.description = script.description;\n } else if (meta.description) {\n storedFunction.description = meta.description;\n } else {\n log.verbose('no description in function metadata', { functionId });\n }\n\n if (meta.inputSchema) {\n storedFunction.inputSchema = meta.inputSchema;\n } else {\n log.verbose('no input schema in function metadata', { functionId });\n }\n\n if (meta.outputSchema) {\n storedFunction.outputSchema = meta.outputSchema;\n } else {\n log.verbose('no output schema in function metadata', { functionId });\n }\n\n if (meta.key) {\n Obj.getMeta(storedFunction).key = meta.key;\n } else {\n log.verbose('no key in function metadata', { functionId });\n }\n });\n};\n\nexport const getAccessCredential = (identityKey: PublicKey): Credential => {\n return {\n issuer: identityKey,\n issuanceDate: new Date(),\n subject: {\n id: identityKey,\n assertion: {\n '@type': 'dxos.halo.credentials.ServiceAccess',\n 'serverName': 'hub.dxos.network',\n 'serverKey': identityKey,\n identityKey,\n 'capabilities': ['composer:beta'],\n },\n },\n };\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,iBAAyB;AAClC,SAASC,eAAe;AACxB,SAASC,KAAKC,WAAW;AACzB,SAASC,mCAAmC;AAC5C,SAASC,sBAAsB;AAC/B,SAASC,wBAAwBC,4BAA4B;AAC7D,SAASC,WAAW;AACpB,SAASC,2BAA2B;AAGpC,IAAA,eAAaC;AAEX,IAAOC,mBAAQC,CAAAA,EAAAA,QAAwBC,GAAAA,MAAOC;AAC9C,QAAA,qBAAA,MAAA,4BAAA,IAAA,QAAA,EAAA,C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,eAAA,KAAA;;AAAsD,MAAAA,KAAA,QAAA,yCAAA;QACpE;MAEIS,GAAAA,EAAAA,YAAU,YAAA,GAAAR,eAAA,GAAA,IAAA,GAAA,OAAA,CAAA;;AAEd,QAAA,KAAO,KAAA;AACLD,MAAAA,KAAIY,QAAQJ,eAAA,EAAA,MAAA,KAAA;;AAA4C,MAAAR,KAAA,QAAA,+BAAA;QAC1D;MACF,GAAA,EAAA,YAAA,YAAA,GAAAC,eAAA,GAAA,IAAA,GAAA,OAAA,CAAA;IACA;EAEF,CAAA;;IAEIY,sBAAQC,CAAAA,gBAAAA;SACRC;IACAC,QAAAA;kBACMF,oBAAAA,KAAAA;aACJG;UACE;iBACA;QACA,SAAA;QACAH,cAAAA;QACA,aAAA;;wBAAiC;UACnC;QACF;MACF;IACA;;;",
|
|
6
|
+
"names": ["Operation", "Context", "Obj", "Ref", "getUserFunctionIdInMetadata", "bundleFunction", "FunctionsServiceClient", "incrementSemverPatch", "log", "FunctionRuntimeKind", "isScriptDeployed", "Boolean", "existingFunctionId", "script", "changed", "validationError", "error", "success", "buildResult", "functionsServiceClient", "client", "ownerUri", "version", "getMeta", "functionId", "entryPoint", "assets", "runtime", "storedFunction", "createOrUpdateFunctionInSpace", "newFunction", "update", "add", "Obj", "getUserFunctionIdInMetadata", "getInvocationUrl", "log", "__dxlog_file", "existingFunctionId", "fn", "undefined", "script", "description", "trim", "storedFunction", "meta", "inputSchema", "outputSchema", "verbose", "issuer", "identityKey", "issuanceDate", "subject", "assertion"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/operations/index.ts
|
|
2
2
|
import { OperationHandlerSet } from "@dxos/compute";
|
|
3
|
-
var ScriptOperationHandlerSet = OperationHandlerSet.lazy(() => import("./create-script-
|
|
3
|
+
var ScriptOperationHandlerSet = OperationHandlerSet.lazy(() => import("./create-script-CIEJOBIU.mjs"));
|
|
4
4
|
|
|
5
5
|
export {
|
|
6
6
|
ScriptOperationHandlerSet
|
|
7
7
|
};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-KSVKXCTX.mjs.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/meta.ts
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
import { DXN } from "@dxos/keys";
|
|
4
|
+
|
|
5
|
+
// dx.config.ts
|
|
6
|
+
import { Config2 } from "@dxos/app-framework/config";
|
|
7
|
+
import { trim } from "@dxos/util";
|
|
8
|
+
var dx_config_default = Config2.make({
|
|
9
|
+
plugin: {
|
|
10
|
+
key: "org.dxos.plugin.script",
|
|
11
|
+
name: "Scripts",
|
|
12
|
+
author: "DXOS",
|
|
13
|
+
description: trim`
|
|
14
|
+
Write, deploy, and run custom TypeScript functions as ECHO objects directly inside your Composer spaces.
|
|
15
|
+
Scripts execute on the Cloudflare Workers-based EDGE runtime and have access to the full DXOS SDK,
|
|
16
|
+
Effect-TS, and a curated set of third-party libraries including HTTP, JSON, CSV, and date utilities.
|
|
17
|
+
An AI Script assistant wires CRUD, deploy, invoke, and invocation-inspection operations as tools
|
|
18
|
+
so an agent can scaffold, iterate, and test functions entirely within a chat session.
|
|
19
|
+
`,
|
|
20
|
+
icon: {
|
|
21
|
+
key: "ph--code--regular",
|
|
22
|
+
hue: "sky"
|
|
23
|
+
},
|
|
24
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer",
|
|
25
|
+
spec: "PLUGIN.mdl",
|
|
26
|
+
tags: [
|
|
27
|
+
"labs"
|
|
28
|
+
],
|
|
29
|
+
screenshots: [
|
|
30
|
+
{
|
|
31
|
+
dark: "https://dxos.network/plugin-details-scripts-dark.png"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// src/meta.ts
|
|
38
|
+
var meta = Plugin.getMetaFromConfig(dx_config_default);
|
|
39
|
+
var defaultScriptsForIntegration = {
|
|
40
|
+
// TODO(wittjosiah): Also include content extraction scripts in the default set.
|
|
41
|
+
"gmail.com": [
|
|
42
|
+
DXN.make("org.dxos.script.gmail")
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
meta,
|
|
48
|
+
defaultScriptsForIntegration
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-NVV5UYY4.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts", "../../../dx.config.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n\n// TODO(ZaymonFC): Configure by scopes?\nexport const defaultScriptsForIntegration: Record<string, string[]> = {\n // TODO(wittjosiah): Also include content extraction scripts in the default set.\n 'gmail.com': [DXN.make('org.dxos.script.gmail')],\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.script',\n name: 'Scripts',\n author: 'DXOS',\n description: trim`\n Write, deploy, and run custom TypeScript functions as ECHO objects directly inside your Composer spaces.\n Scripts execute on the Cloudflare Workers-based EDGE runtime and have access to the full DXOS SDK,\n Effect-TS, and a curated set of third-party libraries including HTTP, JSON, CSV, and date utilities.\n An AI Script assistant wires CRUD, deploy, invoke, and invocation-inspection operations as tools\n so an agent can scaffold, iterate, and test functions entirely within a chat session.\n `,\n icon: { key: 'ph--code--regular', hue: 'sky' },\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-explorer',\n spec: 'PLUGIN.mdl',\n tags: ['labs'],\n screenshots: [{ dark: 'https://dxos.network/plugin-details-scripts-dark.png' }],\n },\n});\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,WAAW;;;ACDpB,SAASC,eAAe;AACxB,SAASC,YAAY;AAErB,IAAA,oBAAeD,QAAQE,KAAK;EAC1BC,QAAQ;IACNC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,aAAaN;;;;;;;IAObO,MAAM;MAAEJ,KAAK;MAAqBK,KAAK;IAAM;IAC7CC,QAAQ;IACRC,MAAM;IACNC,MAAM;MAAC;;IACPC,aAAa;MAAC;QAAEC,MAAM;MAAuD;;EAC/E;AACF,CAAA;;;ADhBO,IAAMC,OAAOC,OAAOC,kBAAkBC,iBAAAA;AAGtC,IAAMC,+BAAyD;;EAEpE,aAAa;IAACC,IAAIC,KAAK,uBAAA;;AACzB;",
|
|
6
|
+
"names": ["Plugin", "DXN", "Config2", "trim", "make", "plugin", "key", "name", "author", "description", "icon", "hue", "source", "spec", "tags", "screenshots", "dark", "meta", "Plugin", "getMetaFromConfig", "config", "defaultScriptsForIntegration", "DXN", "make"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// src/skills/functions/index.ts
|
|
2
|
+
import { OperationHandlerSet } from "@dxos/compute";
|
|
3
|
+
var ScriptHandlers = OperationHandlerSet.lazy(() => import("./create-SGHWWTET.mjs"), () => import("./read-OY3K5R3V.mjs"), () => import("./update-Z5VGOLBN.mjs"), () => import("./delete-72RXVLVI.mjs"), () => import("./deploy-PJTJAQZY.mjs"), () => import("./invoke-CDRBQ2WA.mjs"), () => import("./inspect-invocations-ZUXVUAML.mjs"), () => import("./query-deployed-functions-RBQMGON2.mjs"), () => import("./install-function-YFDZLVMJ.mjs"));
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
ScriptHandlers
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=chunk-USJ44FIU.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
3
|
+
"sources": ["../../../src/skills/functions/index.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport * from './definitions';\n\nexport const ScriptHandlers = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./read'),\n () => import('./update'),\n () => import('./delete'),\n () => import('./deploy'),\n () => import('./invoke'),\n () => import('./inspect-invocations'),\n () => import('./query-deployed-functions'),\n () => import('./install-function'),\n);\n"],
|
|
5
5
|
"mappings": ";AAIA,SAASA,2BAA2B;AAI7B,IAAMC,iBAAiBD,oBAAoBE,KAChD,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,oCAAA,GACb,MAAM,OAAO,yCAAA,GACb,MAAM,OAAO,iCAAA,CAAA;",
|
|
6
6
|
"names": ["OperationHandlerSet", "ScriptHandlers", "lazy"]
|