@dxos/plugin-script 0.9.1-main.c7dcc2e112 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLUGIN.mdl +9 -9
- package/dist/lib/neutral/{NotebookArticle-E35G2Y2I.mjs → NotebookArticle-AOBB3XGD.mjs} +27 -45
- package/dist/lib/neutral/NotebookArticle-AOBB3XGD.mjs.map +7 -0
- package/dist/lib/neutral/{ScriptArticle-QW26LOKU.mjs → ScriptArticle-I3DOJARR.mjs} +4 -4
- package/dist/lib/neutral/ScriptArticle-I3DOJARR.mjs.map +7 -0
- package/dist/lib/neutral/ScriptPlugin.mjs +4 -4
- package/dist/lib/neutral/ScriptPlugin.mjs.map +3 -3
- package/dist/lib/neutral/ScriptPlugin.node.mjs +3 -3
- package/dist/lib/neutral/ScriptPlugin.node.mjs.map +3 -3
- package/dist/lib/neutral/{ScriptProperties-ADTWXG6O.mjs → ScriptProperties-RHDQGMGT.mjs} +148 -148
- package/dist/lib/neutral/ScriptProperties-RHDQGMGT.mjs.map +7 -0
- package/dist/lib/neutral/ScriptSettings-NS3ZY7ZR.mjs +35 -0
- package/dist/lib/neutral/ScriptSettings-NS3ZY7ZR.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +6 -6
- package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
- package/dist/lib/neutral/capabilities/node.mjs +5 -5
- package/dist/lib/neutral/capabilities/node.mjs.map +3 -3
- package/dist/lib/neutral/{chunk-ZPFRRBZW.mjs → chunk-652CIABA.mjs} +10 -9
- package/dist/lib/neutral/chunk-652CIABA.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-TRKXIP2Q.mjs → chunk-6DOWVKIW.mjs} +4 -5
- package/dist/lib/neutral/chunk-6DOWVKIW.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-BDHDBPVM.mjs → chunk-CHNFYLKW.mjs} +12 -12
- package/dist/lib/neutral/chunk-CHNFYLKW.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-VXDJH6OL.mjs → chunk-INFWOSTM.mjs} +14 -8
- package/dist/lib/neutral/chunk-INFWOSTM.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-JAJ64B3E.mjs → chunk-KSVKXCTX.mjs} +2 -2
- package/dist/lib/neutral/chunk-USJ44FIU.mjs +8 -0
- package/dist/lib/neutral/{chunk-O6A5PTB3.mjs.map → chunk-USJ44FIU.mjs.map} +1 -1
- package/dist/lib/neutral/{chunk-QV6NCUGM.mjs → chunk-WAGQ77UQ.mjs} +6 -6
- package/dist/lib/neutral/chunk-WAGQ77UQ.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +120 -91
- package/dist/lib/neutral/components/index.mjs.map +4 -4
- package/dist/lib/neutral/containers/index.mjs +5 -3
- package/dist/lib/neutral/containers/index.mjs.map +3 -3
- package/dist/lib/neutral/{create-6LC57CCC.mjs → create-SGHWWTET.mjs} +4 -4
- package/dist/lib/neutral/{create-6LC57CCC.mjs.map → create-SGHWWTET.mjs.map} +4 -4
- package/dist/lib/neutral/{create-object-FZM5ASWM.mjs → create-object-QW66KQWS.mjs} +1 -3
- package/dist/lib/neutral/{create-object-FZM5ASWM.mjs.map → create-object-QW66KQWS.mjs.map} +3 -3
- package/dist/lib/neutral/{create-script-YW437XYZ.mjs → create-script-CIEJOBIU.mjs} +4 -4
- package/dist/lib/neutral/{create-script-YW437XYZ.mjs.map → create-script-CIEJOBIU.mjs.map} +3 -3
- package/dist/lib/neutral/{delete-HCQIQFVP.mjs → delete-72RXVLVI.mjs} +3 -3
- package/dist/lib/neutral/{delete-HCQIQFVP.mjs.map → delete-72RXVLVI.mjs.map} +1 -1
- package/dist/lib/neutral/{deploy-7JVMMHSH.mjs → deploy-PJTJAQZY.mjs} +10 -6
- package/dist/lib/neutral/deploy-PJTJAQZY.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +2 -2
- package/dist/lib/neutral/hooks/index.mjs.map +2 -2
- package/dist/lib/neutral/index.mjs +8 -8
- package/dist/lib/neutral/{inspect-invocations-TAOYDT4H.mjs → inspect-invocations-ZUXVUAML.mjs} +5 -5
- package/dist/lib/neutral/inspect-invocations-ZUXVUAML.mjs.map +7 -0
- package/dist/lib/neutral/{install-function-FJIE2JAI.mjs → install-function-YFDZLVMJ.mjs} +4 -4
- package/dist/lib/neutral/{install-function-FJIE2JAI.mjs.map → install-function-YFDZLVMJ.mjs.map} +1 -1
- package/dist/lib/neutral/{invoke-3HVWY2KF.mjs → invoke-CDRBQ2WA.mjs} +4 -4
- package/dist/lib/neutral/{invoke-3HVWY2KF.mjs.map → invoke-CDRBQ2WA.mjs.map} +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{operation-handler-6IZ7L4L2.mjs → operation-handler-M3B6IRMV.mjs} +3 -3
- package/dist/lib/neutral/{operation-handler-6IZ7L4L2.mjs.map → operation-handler-M3B6IRMV.mjs.map} +1 -1
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/lib/neutral/{query-deployed-functions-F4FHJNWO.mjs → query-deployed-functions-RBQMGON2.mjs} +4 -4
- package/dist/lib/neutral/{query-deployed-functions-F4FHJNWO.mjs.map → query-deployed-functions-RBQMGON2.mjs.map} +1 -1
- package/dist/lib/neutral/{react-surface-2TZDZQYA.mjs → react-surface-GEXOZLBC.mjs} +4 -5
- package/dist/lib/neutral/react-surface-GEXOZLBC.mjs.map +7 -0
- package/dist/lib/neutral/{read-RQESBAQI.mjs → read-OY3K5R3V.mjs} +3 -3
- package/dist/lib/neutral/{read-RQESBAQI.mjs.map → read-OY3K5R3V.mjs.map} +3 -3
- package/dist/lib/neutral/skill-definition-JZ7UYBT7.mjs +15 -0
- package/dist/lib/neutral/skill-definition-JZ7UYBT7.mjs.map +7 -0
- package/dist/lib/neutral/skills/index.mjs +10 -0
- package/dist/lib/neutral/templates/index.mjs +1 -1
- package/dist/lib/neutral/translations.mjs +6 -7
- package/dist/lib/neutral/translations.mjs.map +2 -2
- package/dist/lib/neutral/types/index.mjs +2 -2
- package/dist/lib/neutral/update-Z5VGOLBN.mjs +44 -0
- package/dist/lib/neutral/update-Z5VGOLBN.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/compiler.d.ts +1 -2
- package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -12
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +1 -1
- package/dist/types/src/capabilities/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -3
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +2 -3
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +18 -21
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +18 -21
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +18 -21
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts +20 -23
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts +20 -23
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/SkillEditor.d.ts +7 -0
- package/dist/types/src/containers/ScriptProperties/SkillEditor.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts +8 -0
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts.map +1 -0
- package/dist/types/src/{components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts → containers/ScriptSettings/ScriptSettings.stories.d.ts} +20 -23
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ScriptSettings/index.d.ts +2 -0
- package/dist/types/src/containers/ScriptSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +1 -0
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +6 -15
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +2 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +2 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-script.d.ts.map +1 -1
- package/dist/types/src/skills/functions/create.d.ts.map +1 -0
- package/dist/types/src/skills/functions/definitions.d.ts +75 -0
- package/dist/types/src/skills/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/skills/functions/delete.d.ts +7 -0
- package/dist/types/src/skills/functions/delete.d.ts.map +1 -0
- package/dist/types/src/skills/functions/deploy.d.ts +11 -0
- package/dist/types/src/skills/functions/deploy.d.ts.map +1 -0
- package/dist/types/src/skills/functions/index.d.ts.map +1 -0
- package/dist/types/src/skills/functions/inspect-invocations.d.ts +18 -0
- package/dist/types/src/skills/functions/inspect-invocations.d.ts.map +1 -0
- package/dist/types/src/skills/functions/install-function.d.ts.map +1 -0
- package/dist/types/src/skills/functions/invoke.d.ts +11 -0
- package/dist/types/src/skills/functions/invoke.d.ts.map +1 -0
- package/dist/types/src/skills/functions/query-deployed-functions.d.ts.map +1 -0
- package/dist/types/src/skills/functions/read.d.ts +11 -0
- package/dist/types/src/skills/functions/read.d.ts.map +1 -0
- package/dist/types/src/skills/functions/update.d.ts +16 -0
- package/dist/types/src/skills/functions/update.d.ts.map +1 -0
- package/dist/types/src/skills/index.d.ts +2 -0
- package/dist/types/src/skills/index.d.ts.map +1 -0
- package/dist/types/src/skills/script-skill.d.ts +4 -0
- package/dist/types/src/skills/script-skill.d.ts.map +1 -0
- package/dist/types/src/templates/chess-bot.d.ts +1 -4
- package/dist/types/src/templates/chess-bot.d.ts.map +1 -1
- package/dist/types/src/templates/commentary.d.ts +1 -4
- package/dist/types/src/templates/commentary.d.ts.map +1 -1
- package/dist/types/src/testing/test-script.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +18 -21
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts +11 -81
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/ScriptOperation.d.ts +2 -10
- package/dist/types/src/types/ScriptOperation.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts +1 -1
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +75 -74
- package/src/ScriptPlugin.node.ts +2 -2
- package/src/ScriptPlugin.test.ts +1 -1
- package/src/ScriptPlugin.tsx +2 -2
- package/src/capabilities/create-object.ts +0 -2
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/node.ts +1 -1
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +9 -7
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/components/NotebookStack/NotebookCell.tsx +11 -29
- package/src/components/NotebookStack/NotebookStack.stories.tsx +3 -3
- package/src/components/NotebookStack/NotebookStack.tsx +101 -43
- package/src/components/QueryEditor/QueryEditor.stories.tsx +2 -7
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +2 -2
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +7 -8
- package/src/components/index.ts +0 -4
- package/src/containers/NotebookArticle/NotebookArticle.stories.tsx +4 -4
- package/src/containers/NotebookArticle/NotebookArticle.tsx +20 -42
- package/src/containers/ScriptArticle/ScriptArticle.stories.tsx +5 -5
- package/src/containers/ScriptArticle/ScriptArticle.tsx +3 -3
- package/src/containers/ScriptProperties/FunctionBinding.tsx +1 -1
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +1 -1
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +5 -5
- package/src/containers/ScriptProperties/ScriptProperties.tsx +2 -2
- package/src/containers/ScriptProperties/{BlueprintEditor.tsx → SkillEditor.tsx} +22 -22
- package/src/{components/ScriptPluginSettings/ScriptPluginSettings.stories.tsx → containers/ScriptSettings/ScriptSettings.stories.tsx} +4 -4
- package/src/containers/ScriptSettings/ScriptSettings.tsx +47 -0
- package/src/containers/ScriptSettings/index.ts +5 -0
- package/src/containers/index.ts +1 -0
- package/src/e2e/ai.test.ts +14 -11
- package/src/e2e/deploy.test.ts +5 -1
- package/src/hooks/deploy.ts +1 -1
- package/src/index.ts +1 -1
- package/src/operations/create-script.ts +1 -1
- package/src/{blueprints → skills}/functions/create.ts +1 -1
- package/src/{blueprints → skills}/functions/definitions.ts +4 -2
- package/src/{blueprints → skills}/functions/deploy.ts +7 -2
- package/src/{blueprints → skills}/functions/inspect-invocations.ts +2 -2
- package/src/{blueprints → skills}/functions/read.ts +1 -1
- package/src/skills/functions/update.ts +48 -0
- package/src/skills/index.ts +5 -0
- package/src/{blueprints/script-blueprint.ts → skills/script-skill.ts} +12 -12
- package/src/templates/anthropic.ts +1 -1
- package/src/templates/chess-bot.ts +2 -2
- package/src/templates/commentary.ts +4 -4
- package/src/templates/discord.ts +1 -1
- package/src/templates/gmail.ts +1 -1
- package/src/testing/test-notebook.ts +5 -5
- package/src/testing/test-script.ts +1 -1
- package/src/translations.ts +6 -7
- package/src/types/Notebook.ts +9 -13
- package/src/types/ScriptOperation.ts +2 -2
- package/src/util/deploy.ts +7 -3
- package/src/util/functions.ts +3 -3
- package/dist/lib/neutral/NotebookArticle-E35G2Y2I.mjs.map +0 -7
- package/dist/lib/neutral/ScriptArticle-QW26LOKU.mjs.map +0 -7
- package/dist/lib/neutral/ScriptPluginSettings-5AURDJTI.mjs +0 -31
- package/dist/lib/neutral/ScriptPluginSettings-5AURDJTI.mjs.map +0 -7
- package/dist/lib/neutral/ScriptProperties-ADTWXG6O.mjs.map +0 -7
- package/dist/lib/neutral/blueprint-definition-PJ7I3JIQ.mjs +0 -15
- package/dist/lib/neutral/blueprint-definition-PJ7I3JIQ.mjs.map +0 -7
- package/dist/lib/neutral/blueprints/index.mjs +0 -10
- package/dist/lib/neutral/chunk-BDHDBPVM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-O6A5PTB3.mjs +0 -8
- package/dist/lib/neutral/chunk-QV6NCUGM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-TRKXIP2Q.mjs.map +0 -7
- package/dist/lib/neutral/chunk-VXDJH6OL.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZPFRRBZW.mjs.map +0 -7
- package/dist/lib/neutral/deploy-7JVMMHSH.mjs.map +0 -7
- package/dist/lib/neutral/inspect-invocations-TAOYDT4H.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-2TZDZQYA.mjs.map +0 -7
- package/dist/lib/neutral/update-CO7B6UBS.mjs +0 -63
- package/dist/lib/neutral/update-CO7B6UBS.mjs.map +0 -7
- package/dist/types/src/blueprints/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/definitions.d.ts +0 -135
- package/dist/types/src/blueprints/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/delete.d.ts +0 -17
- package/dist/types/src/blueprints/functions/delete.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/deploy.d.ts +0 -21
- package/dist/types/src/blueprints/functions/deploy.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts +0 -28
- package/dist/types/src/blueprints/functions/inspect-invocations.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/install-function.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/invoke.d.ts +0 -21
- package/dist/types/src/blueprints/functions/invoke.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/query-deployed-functions.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/read.d.ts +0 -21
- package/dist/types/src/blueprints/functions/read.d.ts.map +0 -1
- package/dist/types/src/blueprints/functions/update.d.ts +0 -26
- package/dist/types/src/blueprints/functions/update.d.ts.map +0 -1
- package/dist/types/src/blueprints/index.d.ts +0 -2
- package/dist/types/src/blueprints/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/script-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/script-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts +0 -8
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.d.ts.map +0 -1
- package/dist/types/src/components/ScriptPluginSettings/ScriptPluginSettings.stories.d.ts.map +0 -1
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts +0 -2
- package/dist/types/src/components/ScriptPluginSettings/index.d.ts.map +0 -1
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts +0 -7
- package/dist/types/src/containers/ScriptProperties/BlueprintEditor.d.ts.map +0 -1
- package/src/blueprints/functions/update.ts +0 -68
- package/src/blueprints/index.ts +0 -5
- package/src/capabilities/blueprint-definition.ts +0 -19
- package/src/components/ScriptPluginSettings/ScriptPluginSettings.tsx +0 -42
- package/src/components/ScriptPluginSettings/index.ts +0 -5
- /package/dist/lib/neutral/{chunk-JAJ64B3E.mjs.map → chunk-KSVKXCTX.mjs.map} +0 -0
- /package/dist/lib/neutral/{blueprints → skills}/index.mjs.map +0 -0
- /package/dist/types/src/{blueprints → skills}/functions/create.d.ts +0 -0
- /package/dist/types/src/{blueprints → skills}/functions/index.d.ts +0 -0
- /package/dist/types/src/{blueprints → skills}/functions/install-function.d.ts +0 -0
- /package/dist/types/src/{blueprints → skills}/functions/query-deployed-functions.d.ts +0 -0
- /package/src/{blueprints → skills}/functions/delete.ts +0 -0
- /package/src/{blueprints → skills}/functions/index.ts +0 -0
- /package/src/{blueprints → skills}/functions/install-function.ts +0 -0
- /package/src/{blueprints → skills}/functions/invoke.ts +0 -0
- /package/src/{blueprints → skills}/functions/query-deployed-functions.ts +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/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, Feed, Ref, DXN } 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\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, Feed.FeedService],\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,MAAMC,KAAKC,WAAW;AACzC,SAASC,YAAY;AAErB,IAAMC,cAAcH,IAAIA,IAAIH,UAAUO,mBAAmB,EAAEC,YAAY;EACrEC,aAAa;AACf,CAAA;AAEA,IAAMC,aAAoBC,cAAOH,YAAY;EAC3CC,aAAa;AACf,CAAA;AAEA,IAAMG,kBAAkBP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCxB,IAAMQ,qBAAqBR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCpB,IAAMS,SAASd,UAAUe,KAAK;EACnCC,MAAM;IACJC,KAAKb,IAAIW,KAAK,iCAAA;IACdG,MAAM;IACNT,aAAa,gFAAgFG,eAAAA,IAAmBC,kBAAAA;IAChHM,MAAM;EACR;EACAC,OAAcC,cAAO;IACnBH,MAAaP,cAAOH,YAAY;MAC9BC,aAAa;IACf,CAAA;IACAa,QAAeC,gBAAgBZ,aAAM,EAAEH,YAAY;MACjDC,aAAa;IACf,CAAA;IACAe,YAAmBD,gBAAgBZ,aAAM,EAAEH,YAAY;MACr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M;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;IACAmD,SAAgBjD,cAAOH,YAAY;MACjCC,aAAa;IACf,CAAA;EACF,CAAA;EACAkB,UAAU;IAAC5B;;AACb,CAAA;",
|
|
6
|
-
"names": ["Schema", "ClientService", "Operation", "Database", "Feed", "Ref", "DXN", "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", "FeedService", "DeployedFunctionSchema", "version", "updated", "QueryDeployedFunctions", "functions", "InstallFunction"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { Script, Operation } 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 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 // TODO(dmaretskyi): Space key or identity key.\n ownerPublicKey: space.key,\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,SAAiBA,iBAAiB;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,CAAA;AAYF,SAAA,QAAA,kBAAA,KAAA,CAAA,OAAA;;AAWMC,IAAAA,eAAiB,OAAA,EAAA,QAAA,QAAA,OAAA,IAAA,mBAAA,MAAA;QACnB,kBAAO,qBAAA,QAAA,KAAA;uBAAW;WAAOC;MAAuB,SAAA;MAClD,OAAA;IAEI;;;AAGF,UAAA,cAAA,MAAA,eAAA;MACI,QAAA,OAAWC,OAAAA,OAAa;;AAE5B,QAAA,WAAA,aAAA;AAEA,YAAMC,YAAAA,SAAyBZ,IAAAA,MAAAA,wBAAkCa;IACjE;UACE,yBAAA,uBAA+C,WAAA,MAAA;UAC/CC,cAAgBC,MAAMC,uBAAG,OAAA,QAAA,QAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,GAAA,CAAA,GAAA;;MAEzBC,gBAAYX,MAAAA;MACZY,SAAAA,KAAYP,qBAAsB,IAAA,QAAA,EAAA,EAAA,WAAA,OAAA,IAAA;MAClCQ,YAAQR;MACRS,YAASjB,YAAAA;MACX,QAAA,YAAA;MAEA,SAAMkB,oBAAiBC,MAAAA;IACvB1B,CAAAA;UACEW,iBAAiB,8BAAA,OAAA,IAAA,QAAA,WAAA;AACnB,QAAA,OAAA,QAAA,CAAAA,YAAA;AAEA,MA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AA;;AAAoD,MAAAA,KAAA,QAAA,uCAAA;QAClE;MAEIS,GAAAA,EAAAA,YAAKC,YAAa,GAAAT,eAAA,GAAA,IAAA,GAAA,OAAA,CAAA;;AAEtB,QAAA,KAAO,aAAA;AACLD,MAAAA,gBAAY,cAAA,KAAA;;AAAqD,MAAAA,KAAA,QAAA,wCAAA;QACnE;MAEIS,GAAAA,EAAAA,YAAKE,YAAc,GAAAV,eAAA,GAAA,IAAA,GAAA,OAAA,CAAA;;AAEvB,QAAA,KAAO,cAAA;AACLD,MAAAA,gBAAY,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;iBACAC;QACAC,SAAAA;QACAL,YAAAA;QACAM,WAAAA;;sBAA+B;UACjC;QACF;MACF;IACA;;;",
|
|
6
|
-
"names": ["Operation", "Context", "Obj", "Ref", "getUserFunctionIdInMetadata", "bundleFunction", "FunctionsServiceClient", "incrementSemverPatch", "log", "FunctionRuntimeKind", "isScriptDeployed", "Boolean", "existingFunctionId", "script", "changed", "validationError", "error", "buildResult", "functionsServiceClient", "client", "ownerPublicKey", "space", "key", "functionId", "entryPoint", "assets", "runtime", "storedFunction", "createOrUpdateFunctionInSpace", "success", "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", "serverName", "serverKey", "capabilities"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { Routine } from '@dxos/compute';\nimport { DXN, Annotation, 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(Routine.Routine)),\n graph: Schema.optional(Ref.Ref(Graph.Graph)),\n});\n\nexport type Cell = Schema.Schema.Type<typeof Cell>;\n\nexport const Notebook = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n cells: Cell.pipe(Schema.Array, FormInputAnnotation.set(false)),\n}).pipe(\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--notebook--regular', hue: 'sky' }),\n Type.makeObject(DXN.make('org.dxos.type.notebook', '0.1.0')),\n);\n\nexport type Notebook = Type.InstanceType<typeof Notebook>;\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 { Script, Operation } from '@dxos/compute';\nimport { Database, Type, DXN } from '@dxos/echo';\n\nimport { meta } from '#meta';\n\nimport { templates } from '../templates';\n\nconst makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);\n\nexport const ScriptProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n gistUrl: Schema.optional(Schema.String.annotations({ title: 'Import from Gist (url)' })),\n initialTemplateId: Schema.Literal(...templates.map(({ id }) => id)).pipe(\n Schema.annotations({ title: 'Template' }),\n Schema.optional,\n ),\n});\n\nexport const NotebookProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n});\n\nexport const CreateScript = Operation.make({\n meta: { key: makeKey('createScript'), name: 'Create Script', icon: 'ph--code--regular' },\n input: Schema.extend(\n ScriptProps,\n Schema.Struct({\n db: Database.Database,\n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AAKE,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,QAAQC,iBAAiB;AAClC,SAASC,UAAUC,QAAAA,OAAMC,OAAAA,YAAW;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", "Routine", "DXN", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "Graph", "Text", "Cell", "Struct", "id", "String", "type", "name", "optional", "source", "prompt", "graph", "Notebook", "pipe", "cells", "Array", "set", "IconAnnotation", "icon", "hue", "makeObject", "make", "props", "Settings", "Capability", "meta", "make", "profile", "key", "Compiler", "ActivationEvent", "meta", "SetupCompiler", "make", "profile", "key", "Schema", "Script", "Operation", "Database", "Type", "DXN", "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,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/functions/deploy.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport wasmUrl from 'esbuild-wasm/esbuild.wasm?url';\n\nimport { ClientService } from '@dxos/client';\nimport { Script, Operation } from '@dxos/compute';\nimport { Context } from '@dxos/context';\nimport { Database, Obj } from '@dxos/echo';\nimport { getUserFunctionIdInMetadata } from '@dxos/functions';\nimport { bundleFunction, initializeBundler } from '@dxos/functions-runtime/bundler';\nimport { FunctionsServiceClient, incrementSemverPatch } from '@dxos/functions-runtime/edge';\nimport { FunctionRuntimeKind } from '@dxos/protocols';\nimport { getSpace } from '@dxos/react-client/echo';\n\nimport { Deploy } from './definitions';\n\nexport default Deploy.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ function: fn }) {\n const loaded = yield* Database.load(fn);\n const client = yield* ClientService;\n if (!loaded.source) {\n return yield* Effect.fail(new Error('Function has no source script.'));\n }\n const script = (yield* Database.load(loaded.source)) as Script.Script;\n\n const space = getSpace(loaded);\n if (!space || !script.source?.target?.content) {\n return yield* Effect.fail(new Error('Script source or space not available'));\n }\n\n yield* Effect.promise(() => initializeBundler({ wasmUrl }));\n const buildResult = yield* Effect.promise(() => bundleFunction({ source: script.source!.target!.content }));\n if ('error' in buildResult) {\n return yield* Effect.fail(buildResult.error ?? new Error('Bundle creation failed'));\n }\n\n const existingFunctionId = getUserFunctionIdInMetadata(Obj.getMeta(loaded));\n const currentVersion = Obj.getMeta(loaded).version;\n\n const functionsService = FunctionsServiceClient.fromClient(client);\n const newFunction = yield* Effect.promise(() =>\n functionsService.deploy(Context.default(), {\n ownerPublicKey: space.key,\n version: currentVersion ? incrementSemverPatch(currentVersion) : '0.0.1',\n functionId: existingFunctionId,\n entryPoint: buildResult.entryPoint,\n assets: buildResult.assets,\n runtime: FunctionRuntimeKind.enums.WORKER_LOADER,\n }),\n );\n\n Operation.setFrom(loaded, newFunction);\n\n Obj.update(script, (script) => {\n script.changed = false;\n });\n\n const edgeFunctionId = getUserFunctionIdInMetadata(Obj.getMeta(loaded));\n return {\n function: Obj.getURI(loaded),\n functionUrl: edgeFunctionId\n ? `${client.config.values.runtime?.services?.edge?.url ?? ''}/functions/${edgeFunctionId}`\n : undefined,\n };\n }),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,aAAa;AAEpB,SAASC,qBAAqB;AAC9B,SAAiBC,iBAAiB;AAClC,SAASC,eAAe;AACxB,SAASC,UAAUC,WAAW;AAC9B,SAASC,mCAAmC;AAC5C,SAASC,gBAAgBC,yBAAyB;AAClD,SAASC,wBAAwBC,4BAA4B;AAC7D,SAASC,2BAA2B;AACpC,SAASC,gBAAgB;AAIzB,IAAA,eAAeC;IAIT,iBAAMC,OAAS,KAAOC,UAAAA,YAAAA,UAAAA,WAAAA,EAAAA,UAAAA,IAAAA,GAAAA;AACtB,QAAKC,SAAOC,OAAQ,SAAA,KAAAC,GAAA;QAClB,SAAO,OAAOC;AAChB,MAAA,CAAA,OAAA,QAAA;AACA,WAAMC,OAAiBC,YAAAA,IAAS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"getUserFunctionIdInMetadata", "bundleFunction", "initializeBundler", "FunctionsServiceClient", "incrementSemverPatch", "FunctionRuntimeKind", "getSpace", "Deploy", "client", "ClientService", "loaded", "source", "fn", "Effect", "script", "Database", "load", "space", "target", "content", "initializeBundler", "buildResult", "existingFunctionId", "getUserFunctionIdInMetadata", "Obj", "getMeta", "functionsService", "FunctionsServiceClient", "fromClient", "newFunction", "promise", "currentVersion", "incrementSemverPatch", "functionId", "entryPoint", "assets", "runtime", "FunctionRuntimeKind", "Operation", "update", "edgeFunctionId", "function", "getURI", "functionUrl"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/functions/inspect-invocations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { SpaceProperties } from '@dxos/client-protocol';\nimport { Operation } from '@dxos/compute';\nimport { Database, Feed, Filter, Obj, Query } from '@dxos/echo';\nimport { getUserFunctionIdInMetadata } from '@dxos/functions';\nimport { InvocationTraceEndEvent, InvocationTraceStartEvent, createInvocationSpans } from '@dxos/functions-runtime';\n\nimport { InspectInvocations } from './definitions';\n\nexport default InspectInvocations.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ function: fn, limit }) {\n const loaded = yield* Database.load(fn);\n const maxResults = limit ?? 20;\n\n const [properties] = yield* Database.query(Query.type(SpaceProperties)).run;\n if (!properties?.invocationTraceFeed) {\n return { invocations: [], total: 0 };\n }\n\n const feed = yield* Database.load(properties.invocationTraceFeed);\n const startEvents = yield* Feed.runQuery(feed, Filter.type(InvocationTraceStartEvent));\n const endEvents = yield* Feed.runQuery(feed, Filter.type(InvocationTraceEndEvent));\n const allSpans = createInvocationSpans([...startEvents, ...endEvents]);\n\n const functionId = getUserFunctionIdInMetadata(Obj.getMeta(loaded));\n\n const filtered = allSpans.filter((span) => {\n if (!span.invocationTarget || !functionId) {\n return false;\n }\n const targetDxn = span.invocationTarget.uri;\n const uuidPart = targetDxn.split(':').pop();\n return uuidPart === functionId;\n });\n\n filtered.sort((a, b) => b.timestamp - a.timestamp);\n const total = filtered.length;\n const invocations = filtered.slice(0, maxResults).map((span) => ({\n id: span.id,\n timestamp: span.timestamp,\n duration: span.duration,\n outcome: `${span.outcome}`,\n input: span.input !== null && typeof span.input === 'object' ? span.input : { value: span.input },\n error: span.error ? (span.error as object) : undefined,\n }));\n\n return { invocations, total };\n }),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,MAAMC,QAAQC,KAAKC,aAAa;AACnD,SAASC,mCAAmC;AAC5C,SAASC,yBAAyBC,2BAA2BC,6BAA6B;AAI1F,IAAA,8BAAeC,mBAAmBC,KAChCC,UAAUC,YACDC,UAAG,WAAW,EAAEC,UAAUD,KAAIE,MAAK,GAAE;AAC1C,QAAMC,SAAS,OAAOC,SAASC,KAAKL,GAAAA;AACpC,QAAMM,aAAaJ,SAAS;AAE5B,QAAM,CAACK,UAAAA,IAAc,OAAOH,SAASI,MAAMC,MAAMC,KAAKC,eAAAA,CAAAA,EAAkBC;AACxE,MAAI,CAACL,YAAYM,qBAAqB;AACpC,WAAO;MAAEC,aAAa,CAAA;MAAIC,OAAO;IAAE;EACrC;AAEA,QAAMC,OAAO,OAAOZ,SAASC,KAAKE,WAAWM,mBAAmB;AAChE,QAAMI,cAAc,OAAOC,KAAKC,SAASH,MAAMI,OAAOV,KAAKW,yBAAAA,CAAAA;AAC3D,QAAMC,YAAY,OAAOJ,KAAKC,SAASH,MAAMI,OAAOV,KAAKa,uBAAAA,CAAAA;AACzD,QAAMC,WAAWC,sBAAsB;OAAIR;OAAgBK;GAAU;AAErE,QAAMI,aAAaC,4BAA4BC,IAAIC,QAAQ1B,MAAAA,CAAAA;AAE3D,QAAM2B,WAAWN,SAASO,OAAO,CAACC,SAAAA;AAChC,QAAI,CAACA,KAAKC,oBAAoB,CAACP,YAAY;AACzC,aAAO;IACT;AACA,UAAMQ,YAAYF,KAAKC,iBAAiBE;AACxC,UAAMC,WAAWF,UAAUG,MAAM,GAAA,EAAKC,IAAG;AACzC,WAAOF,aAAaV;EACtB,CAAA;AAEAI,WAASS,KAAK,CAACC,GAAGC,MAAMA,EAAEC,YAAYF,EAAEE,SAAS;AACjD,QAAM3B,QAAQe,SAASa;AACvB,QAAM7B,cAAcgB,SAASc,MAAM,GAAGtC,UAAAA,EAAYuC,IAAI,CAACb,UAAU;IAC/Dc,IAAId,KAAKc;IACTJ,WAAWV,KAAKU;IAChBK,UAAUf,KAAKe;IACfC,SAAS,GAAGhB,KAAKgB,OAAO;IACxBC,OAAOjB,KAAKiB,UAAU,QAAQ,OAAOjB,KAAKiB,UAAU,WAAWjB,KAAKiB,QAAQ;MAAEC,OAAOlB,KAAKiB;IAAM;IAChGE,OAAOnB,KAAKmB,QAASnB,KAAKmB,QAAmBC;EAC/C,EAAA;AAEA,SAAO;IAAEtC;IAAaC;EAAM;AAC9B,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "SpaceProperties", "Operation", "Database", "Feed", "Filter", "Obj", "Query", "getUserFunctionIdInMetadata", "InvocationTraceEndEvent", "InvocationTraceStartEvent", "createInvocationSpans", "InspectInvocations", "pipe", "Operation", "withHandler", "fn", "function", "limit", "loaded", "Database", "load", "maxResults", "properties", "query", "Query", "type", "SpaceProperties", "run", "invocationTraceFeed", "invocations", "total", "feed", "startEvents", "Feed", "runQuery", "Filter", "InvocationTraceStartEvent", "endEvents", "InvocationTraceEndEvent", "allSpans", "createInvocationSpans", "functionId", "getUserFunctionIdInMetadata", "Obj", "getMeta", "filtered", "filter", "span", "invocationTarget", "targetDxn", "uri", "uuidPart", "split", "pop", "sort", "a", "b", "timestamp", "length", "slice", "map", "id", "duration", "outcome", "input", "value", "error", "undefined"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/constants.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React, { type ComponentProps } from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface, useAtomCapability, useSettingsState } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Script } from '@dxos/compute';\nimport { InvocationTraceContainer } from '@dxos/devtools';\nimport { Feed } from '@dxos/echo';\nimport { useClient } from '@dxos/react-client';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\n\nimport { ScriptPluginSettings } from '#components';\nimport { DeploymentDialog, NotebookArticle, ScriptArticle, ScriptProperties, TestContainer } from '#containers';\nimport { useCompiler } from '#hooks';\nimport { meta } from '#meta';\nimport { Notebook, ScriptCapabilities, type Settings } from '#types';\n\nimport { DEPLOYMENT_DIALOG } from '../constants';\nimport { getAccessCredential } from '../util';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: 'pluginSettings',\n filter: AppSurface.settings(AppSurface.Article, meta.profile.key),\n component: ({ data: { subject } }) => {\n const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);\n const client = useClient();\n // TODO(burdon): Check token.\n const handleAuthenticate = async () => {\n const { identityKey } = client.halo.identity.get()!;\n await client.halo.writeCredentials([getAccessCredential(identityKey)]);\n };\n return (\n <ScriptPluginSettings\n settings={settings}\n onSettingsChange={updateSettings}\n onAuthenticate={handleAuthenticate}\n />\n );\n },\n }),\n Surface.create({\n id: 'script.article',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.object(AppSurface.Article, Script.Script),\n AppSurface.object(AppSurface.Section, Script.Script),\n ),\n component: ({ data, role }) => {\n const compiler = useCompiler();\n const settings = useAtomCapability(ScriptCapabilities.Settings);\n return (\n <ScriptArticle\n role={role}\n subject={data.subject}\n attendableId={data.attendableId}\n settings={settings}\n env={compiler?.environment}\n />\n );\n },\n }),\n Surface.create({\n id: 'notebook.article',\n filter: AppSurface.object(AppSurface.Article, Notebook.Notebook),\n component: ({ data, role }) => {\n const compiler = useCompiler();\n return (\n <NotebookArticle\n role={role}\n subject={data.subject}\n attendableId={data.attendableId}\n env={compiler?.environment}\n />\n );\n },\n }),\n Surface.create({\n id: 'objectProperties',\n filter: AppSurface.object(AppSurface.ObjectProperties, Script.Script),\n component: ({ data, role }) => <ScriptProperties role={role} subject={data.subject} />,\n }),\n Surface.create({\n id: 'companion.execute',\n filter: AppSurface.allOf(\n AppSurface.literal(AppSurface.Article, 'execute'),\n AppSurface.companion(AppSurface.Article, Script.Script),\n ),\n component: ({ data, role }) => <TestContainer script={data.companionTo} role={role} />,\n }),\n Surface.create({\n id: 'companion.logs',\n filter: AppSurface.allOf(\n AppSurface.literal(AppSurface.Article, 'logs'),\n AppSurface.companion(AppSurface.Article, Script.Script),\n ),\n component: ({ data, role }) => {\n const space = getSpace(data.companionTo);\n const feed = space?.properties.invocationTraceFeed?.target;\n const feedDXN = feed ? Feed.getQueueUri(feed) : undefined;\n return (\n <Panel.Root role={role}>\n <Panel.Content>\n <InvocationTraceContainer\n db={space?.db}\n feedDXN={feedDXN}\n target={data.companionTo}\n detailAxis='block'\n />\n </Panel.Content>\n </Panel.Root>\n );\n },\n }),\n Surface.create({\n id: DEPLOYMENT_DIALOG,\n filter: AppSurface.component<ComponentProps<typeof DeploymentDialog>>(AppSurface.Dialog, DEPLOYMENT_DIALOG),\n component: ({ data }) => <DeploymentDialog {...data.props} />,\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { DXN } from '@dxos/keys';\n\nimport { meta } from '#meta';\n\nexport const D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ACvCF,WAAW4C,UAAU5C,WAAWE,SAASwB,OAAOA,MAAM,CAAA;IAExDpB,WAAW,CAAC,EAAEC,MAAMqB,KAAI,MAAE;AACxB,YAAMoB,QAAQC,SAAS1C,KAAKwC,WAAW;AACvC,YAAMG,OAAOF,OAAOG,WAAWC,qBAAqBC;AACpD,YAAMC,UAAUJ,OAAOK,KAAKC,YAAYN,IAAAA,IAAQO;AAChD,aACE,sBAAA,cAACC,MAAMC,MAAI;QAAC/B;SACV,sBAAA,cAAC8B,MAAME,SAAO,MACZ,sBAAA,cAACC,0BAAAA;QACCC,IAAId,OAAOc;QACXR;QACAD,QAAQ9C,KAAKwC;QACbgB,YAAW;;IAKrB;EACF,CAAA;EACAnE,QAAQC,OAAO;IACbC,IAAIkE;IACJjE,QAAQC,WAAWM,UAAmDN,WAAWiE,QAAQD,iBAAAA;IACzF1D,WAAW,CAAC,EAAEC,KAAI,MAAO,sBAAA,cAAC2D,kBAAqB3D,KAAK4D,KAAK;EAC3D,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "useAtomCapability", "useSettingsState", "AppSurface", "Script", "InvocationTraceContainer", "Feed", "useClient", "getSpace", "Panel", "ScriptPluginSettings", "DeploymentDialog", "NotebookArticle", "ScriptArticle", "ScriptProperties", "TestContainer", "useCompiler", "meta", "Notebook", "ScriptCapabilities", "DXN", "meta", "DEPLOYMENT_DIALOG", "make", "profile", "key", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "filter", "AppSurface", "settings", "Article", "meta", "profile", "key", "component", "data", "subject", "updateSettings", "useSettingsState", "atom", "client", "useClient", "handleAuthenticate", "identityKey", "halo", "identity", "get", "writeCredentials", "getAccessCredential", "ScriptPluginSettings", "onSettingsChange", "onAuthenticate", "oneOf", "object", "Script", "Section", "role", "compiler", "useCompiler", "useAtomCapability", "ScriptCapabilities", "Settings", "ScriptArticle", "attendableId", "env", "environment", "Notebook", "NotebookArticle", "ObjectProperties", "ScriptProperties", "allOf", "literal", "companion", "TestContainer", "script", "companionTo", "space", "getSpace", "feed", "properties", "invocationTraceFeed", "target", "feedDXN", "Feed", "getQueueUri", "undefined", "Panel", "Root", "Content", "InvocationTraceContainer", "db", "detailAxis", "DEPLOYMENT_DIALOG", "Dialog", "DeploymentDialog", "props"]
|
|
7
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Update
|
|
3
|
-
} from "./chunk-TRKXIP2Q.mjs";
|
|
4
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
-
|
|
6
|
-
// src/blueprints/functions/update.ts
|
|
7
|
-
import { next as A } from "@automerge/automerge";
|
|
8
|
-
import * as Effect from "effect/Effect";
|
|
9
|
-
import { Operation } from "@dxos/compute";
|
|
10
|
-
import { Database, Obj } from "@dxos/echo";
|
|
11
|
-
import { DocAccessor, createDocAccessor } from "@dxos/echo-client";
|
|
12
|
-
var update_default = Update.pipe(Operation.withHandler(Effect.fn(function* ({ function: fn2, name, description, edits }) {
|
|
13
|
-
const loaded = yield* Database.load(fn2);
|
|
14
|
-
if (!loaded.source) {
|
|
15
|
-
return yield* Effect.fail(new Error("Function has no source script."));
|
|
16
|
-
}
|
|
17
|
-
const script = yield* Database.load(loaded.source);
|
|
18
|
-
if (name !== void 0 || description !== void 0) {
|
|
19
|
-
Obj.update(script, (script2) => {
|
|
20
|
-
if (name !== void 0) {
|
|
21
|
-
script2.name = name;
|
|
22
|
-
}
|
|
23
|
-
if (description !== void 0) {
|
|
24
|
-
script2.description = description;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
if (edits && edits.length > 0) {
|
|
29
|
-
const text = yield* Database.load(script.source);
|
|
30
|
-
const accessor = createDocAccessor(text, [
|
|
31
|
-
"content"
|
|
32
|
-
]);
|
|
33
|
-
for (const edit of edits) {
|
|
34
|
-
accessor.handle.change((doc) => {
|
|
35
|
-
const source = DocAccessor.getValue(accessor);
|
|
36
|
-
if (edit.replaceAll) {
|
|
37
|
-
let idx = source.indexOf(edit.oldString);
|
|
38
|
-
while (idx !== -1) {
|
|
39
|
-
A.splice(doc, accessor.path, idx, edit.oldString.length, edit.newString);
|
|
40
|
-
const updated = DocAccessor.getValue(accessor);
|
|
41
|
-
idx = updated.indexOf(edit.oldString, idx + edit.newString.length);
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
const idx = source.indexOf(edit.oldString);
|
|
45
|
-
if (idx === -1) {
|
|
46
|
-
throw new Error(`Edit not found: ${JSON.stringify(edit.oldString)}`);
|
|
47
|
-
}
|
|
48
|
-
A.splice(doc, accessor.path, idx, edit.oldString.length, edit.newString);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
Obj.update(script, (script2) => {
|
|
53
|
-
script2.changed = true;
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
function: Obj.getURI(loaded)
|
|
58
|
-
};
|
|
59
|
-
})));
|
|
60
|
-
export {
|
|
61
|
-
update_default as default
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=update-CO7B6UBS.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blueprints/functions/update.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { next as A, type Doc } from '@automerge/automerge';\nimport * as Effect from 'effect/Effect';\n\nimport { type Script, Operation } from '@dxos/compute';\nimport { Database, Obj } from '@dxos/echo';\nimport { DocAccessor, createDocAccessor } from '@dxos/echo-client';\n\nimport { Update } from './definitions';\n\nexport default Update.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ function: fn, name, description, edits }) {\n const loaded = yield* Database.load(fn);\n if (!loaded.source) {\n return yield* Effect.fail(new Error('Function has no source script.'));\n }\n const script = (yield* Database.load(loaded.source)) as Script.Script;\n\n if (name !== undefined || description !== undefined) {\n Obj.update(script, (script) => {\n if (name !== undefined) {\n script.name = name;\n }\n if (description !== undefined) {\n script.description = description;\n }\n });\n }\n\n if (edits && edits.length > 0) {\n const text = yield* Database.load(script.source);\n const accessor = createDocAccessor(text, ['content']);\n\n for (const edit of edits) {\n accessor.handle.change((doc: Doc<typeof text>) => {\n const source = DocAccessor.getValue<string>(accessor);\n if (edit.replaceAll) {\n let idx = source.indexOf(edit.oldString);\n while (idx !== -1) {\n A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);\n const updated = DocAccessor.getValue<string>(accessor);\n idx = updated.indexOf(edit.oldString, idx + edit.newString.length);\n }\n } else {\n const idx = source.indexOf(edit.oldString);\n if (idx === -1) {\n throw new Error(`Edit not found: ${JSON.stringify(edit.oldString)}`);\n }\n A.splice(doc, accessor.path as A.Prop[], idx, edit.oldString.length, edit.newString);\n }\n });\n }\n\n Obj.update(script, (script) => {\n script.changed = true;\n });\n }\n\n return {\n function: Obj.getURI(loaded),\n };\n }),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,QAAQC,SAAmB;AACpC,YAAYC,YAAY;AAExB,SAAsBC,iBAAiB;AACvC,SAASC,UAAUC,WAAW;AAC9B,SAASC,aAAaC,yBAAyB;AAI/C,IAAA,iBAAeC,OAAOC,KACpBC,UAAUC,YACDC,UAAG,WAAW,EAAEC,UAAUD,KAAIE,MAAMC,aAAaC,MAAK,GAAE;AAC7D,QAAMC,SAAS,OAAOC,SAASC,KAAKP,GAAAA;AACpC,MAAI,CAACK,OAAOG,QAAQ;AAClB,WAAO,OAAcC,YAAK,IAAIC,MAAM,gCAAA,CAAA;EACtC;AACA,QAAMC,SAAU,OAAOL,SAASC,KAAKF,OAAOG,MAAM;AAElD,MAAIN,SAASU,UAAaT,gBAAgBS,QAAW;AACnDC,QAAIC,OAAOH,QAAQ,CAACA,YAAAA;AAClB,UAAIT,SAASU,QAAW;AACtBD,QAAAA,QAAOT,OAAOA;MAChB;AACA,UAAIC,gBAAgBS,QAAW;AAC7BD,QAAAA,QAAOR,cAAcA;MACvB;IACF,CAAA;EACF;AAEA,MAAIC,SAASA,MAAMW,SAAS,GAAG;AAC7B,UAAMC,OAAO,OAAOV,SAASC,KAAKI,OAAOH,MAAM;AAC/C,UAAMS,WAAWC,kBAAkBF,MAAM;MAAC;KAAU;AAEpD,eAAWG,QAAQf,OAAO;AACxBa,eAASG,OAAOC,OAAO,CAACC,QAAAA;AACtB,cAAMd,SAASe,YAAYC,SAAiBP,QAAAA;AAC5C,YAAIE,KAAKM,YAAY;AACnB,cAAIC,MAAMlB,OAAOmB,QAAQR,KAAKS,SAAS;AACvC,iBAAOF,QAAQ,IAAI;AACjBG,cAAEC,OAAOR,KAAKL,SAASc,MAAkBL,KAAKP,KAAKS,UAAUb,QAAQI,KAAKa,SAAS;AACnF,kBAAMC,UAAUV,YAAYC,SAAiBP,QAAAA;AAC7CS,kBAAMO,QAAQN,QAAQR,KAAKS,WAAWF,MAAMP,KAAKa,UAAUjB,MAAM;UACnE;QACF,OAAO;AACL,gBAAMW,MAAMlB,OAAOmB,QAAQR,KAAKS,SAAS;AACzC,cAAIF,QAAQ,IAAI;AACd,kBAAM,IAAIhB,MAAM,mBAAmBwB,KAAKC,UAAUhB,KAAKS,SAAS,CAAA,EAAG;UACrE;AACAC,YAAEC,OAAOR,KAAKL,SAASc,MAAkBL,KAAKP,KAAKS,UAAUb,QAAQI,KAAKa,SAAS;QACrF;MACF,CAAA;IACF;AAEAnB,QAAIC,OAAOH,QAAQ,CAACA,YAAAA;AAClBA,MAAAA,QAAOyB,UAAU;IACnB,CAAA;EACF;AAEA,SAAO;IACLnC,UAAUY,IAAIwB,OAAOhC,MAAAA;EACvB;AACF,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["next", "A", "Effect", "Operation", "Database", "Obj", "DocAccessor", "createDocAccessor", "Update", "pipe", "Operation", "withHandler", "fn", "function", "name", "description", "edits", "loaded", "Database", "load", "source", "fail", "Error", "script", "undefined", "Obj", "update", "length", "text", "accessor", "createDocAccessor", "edit", "handle", "change", "doc", "DocAccessor", "getValue", "replaceAll", "idx", "indexOf", "oldString", "A", "splice", "path", "newString", "updated", "JSON", "stringify", "changed", "getURI"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/create.ts"],"names":[],"mappings":"AAOA,OAAO,EAAU,SAAS,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAY,MAAM,YAAY,CAAC"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { ClientService } from '@dxos/client';
|
|
2
|
-
import { Operation } from '@dxos/compute';
|
|
3
|
-
import { Database, Feed } from '@dxos/echo';
|
|
4
|
-
export declare const Create: Operation.Definition<{
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly source?: string | undefined;
|
|
7
|
-
readonly templateId?: string | undefined;
|
|
8
|
-
}, {
|
|
9
|
-
readonly function: string;
|
|
10
|
-
}, Database.Service>;
|
|
11
|
-
export declare const Read: Operation.Definition<{
|
|
12
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
13
|
-
readonly name: string;
|
|
14
|
-
readonly description?: string | undefined;
|
|
15
|
-
readonly updated?: string | undefined;
|
|
16
|
-
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Obj").Unknown> | undefined;
|
|
17
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
18
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
19
|
-
readonly services?: readonly string[] | undefined;
|
|
20
|
-
readonly binding?: string | undefined;
|
|
21
|
-
readonly icon?: string | undefined;
|
|
22
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
23
|
-
}, {
|
|
24
|
-
readonly name?: string | undefined;
|
|
25
|
-
readonly source: string;
|
|
26
|
-
readonly description?: string | undefined;
|
|
27
|
-
}, Database.Service>;
|
|
28
|
-
export declare const Update: Operation.Definition<{
|
|
29
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
30
|
-
readonly name: string;
|
|
31
|
-
readonly description?: string | undefined;
|
|
32
|
-
readonly updated?: string | undefined;
|
|
33
|
-
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Obj").Unknown> | undefined;
|
|
34
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
35
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
36
|
-
readonly services?: readonly string[] | undefined;
|
|
37
|
-
readonly binding?: string | undefined;
|
|
38
|
-
readonly icon?: string | undefined;
|
|
39
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
40
|
-
readonly name?: string | undefined;
|
|
41
|
-
readonly description?: string | undefined;
|
|
42
|
-
readonly edits?: readonly {
|
|
43
|
-
readonly oldString: string;
|
|
44
|
-
readonly newString: string;
|
|
45
|
-
readonly replaceAll?: boolean | undefined;
|
|
46
|
-
}[] | undefined;
|
|
47
|
-
}, {
|
|
48
|
-
readonly function: string;
|
|
49
|
-
}, Database.Service>;
|
|
50
|
-
export declare const Delete: Operation.Definition<{
|
|
51
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
52
|
-
readonly name: string;
|
|
53
|
-
readonly description?: string | undefined;
|
|
54
|
-
readonly updated?: string | undefined;
|
|
55
|
-
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Obj").Unknown> | undefined;
|
|
56
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
57
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
58
|
-
readonly services?: readonly string[] | undefined;
|
|
59
|
-
readonly binding?: string | undefined;
|
|
60
|
-
readonly icon?: string | undefined;
|
|
61
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
62
|
-
}, void, Database.Service>;
|
|
63
|
-
export declare const Deploy: Operation.Definition<{
|
|
64
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
65
|
-
readonly name: string;
|
|
66
|
-
readonly description?: string | undefined;
|
|
67
|
-
readonly updated?: string | undefined;
|
|
68
|
-
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Obj").Unknown> | undefined;
|
|
69
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
70
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
71
|
-
readonly services?: readonly string[] | undefined;
|
|
72
|
-
readonly binding?: string | undefined;
|
|
73
|
-
readonly icon?: string | undefined;
|
|
74
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
75
|
-
}, {
|
|
76
|
-
readonly function: string;
|
|
77
|
-
readonly functionUrl?: string | undefined;
|
|
78
|
-
}, ClientService | Database.Service>;
|
|
79
|
-
export declare const Invoke: Operation.Definition<{
|
|
80
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
81
|
-
readonly name: string;
|
|
82
|
-
readonly description?: string | undefined;
|
|
83
|
-
readonly updated?: string | undefined;
|
|
84
|
-
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Obj").Unknown> | undefined;
|
|
85
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
86
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
87
|
-
readonly services?: readonly string[] | undefined;
|
|
88
|
-
readonly binding?: string | undefined;
|
|
89
|
-
readonly icon?: string | undefined;
|
|
90
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
91
|
-
readonly payload?: unknown;
|
|
92
|
-
}, {
|
|
93
|
-
readonly response: unknown;
|
|
94
|
-
}, ClientService | Database.Service>;
|
|
95
|
-
export declare const InspectInvocations: Operation.Definition<{
|
|
96
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
97
|
-
readonly name: string;
|
|
98
|
-
readonly description?: string | undefined;
|
|
99
|
-
readonly updated?: string | undefined;
|
|
100
|
-
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Obj").Unknown> | undefined;
|
|
101
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
102
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
103
|
-
readonly services?: readonly string[] | undefined;
|
|
104
|
-
readonly binding?: string | undefined;
|
|
105
|
-
readonly icon?: string | undefined;
|
|
106
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
107
|
-
readonly limit?: number | undefined;
|
|
108
|
-
}, {
|
|
109
|
-
readonly invocations: readonly {
|
|
110
|
-
readonly id: string;
|
|
111
|
-
readonly timestamp: number;
|
|
112
|
-
readonly duration: number;
|
|
113
|
-
readonly outcome: string;
|
|
114
|
-
readonly input: object;
|
|
115
|
-
readonly error?: object | undefined;
|
|
116
|
-
}[];
|
|
117
|
-
readonly total: number;
|
|
118
|
-
}, Feed.FeedService | Database.Service>;
|
|
119
|
-
export declare const QueryDeployedFunctions: Operation.Definition<void, {
|
|
120
|
-
readonly functions: readonly {
|
|
121
|
-
readonly key?: string | undefined;
|
|
122
|
-
readonly name: string;
|
|
123
|
-
readonly version: string;
|
|
124
|
-
readonly description?: string | undefined;
|
|
125
|
-
readonly updated?: string | undefined;
|
|
126
|
-
}[];
|
|
127
|
-
}, ClientService>;
|
|
128
|
-
export declare const InstallFunction: Operation.Definition<{
|
|
129
|
-
readonly key: string;
|
|
130
|
-
}, {
|
|
131
|
-
readonly function: string;
|
|
132
|
-
readonly name: string;
|
|
133
|
-
readonly version: string;
|
|
134
|
-
}, ClientService>;
|
|
135
|
-
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/definitions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAY,MAAM,YAAY,CAAC;AAwFtD,eAAO,MAAM,MAAM;;;;;;oBAsBjB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;oBAgBf,CAAC;AAcH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;oBAuBjB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;0BAYjB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;oCAiBjB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;oCAmBjB,CAAC;AAuBH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;uCAsB7B,CAAC;AAoBH,eAAO,MAAM,sBAAsB;;;;;;;;iBAcjC,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;iBAuB1B,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Operation } from '@dxos/compute';
|
|
2
|
-
import { Database } from '@dxos/echo';
|
|
3
|
-
declare const _default: Operation.WithHandler<Operation.Definition<{
|
|
4
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly description?: string | undefined;
|
|
7
|
-
readonly updated?: string | undefined;
|
|
8
|
-
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Obj").Unknown> | undefined;
|
|
9
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
10
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
11
|
-
readonly services?: readonly string[] | undefined;
|
|
12
|
-
readonly binding?: string | undefined;
|
|
13
|
-
readonly icon?: string | undefined;
|
|
14
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
15
|
-
}, void, Database.Service>>;
|
|
16
|
-
export default _default;
|
|
17
|
-
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/delete.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ClientService } from '@dxos/client';
|
|
2
|
-
import { Operation } from '@dxos/compute';
|
|
3
|
-
import { Database, Obj } from '@dxos/echo';
|
|
4
|
-
declare const _default: Operation.WithHandler<Operation.Definition<{
|
|
5
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
6
|
-
readonly name: string;
|
|
7
|
-
readonly description?: string | undefined;
|
|
8
|
-
readonly updated?: string | undefined;
|
|
9
|
-
readonly source?: import("@dxos/echo/internal").Ref<Obj.Unknown> | undefined;
|
|
10
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
11
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
12
|
-
readonly services?: readonly string[] | undefined;
|
|
13
|
-
readonly binding?: string | undefined;
|
|
14
|
-
readonly icon?: string | undefined;
|
|
15
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
16
|
-
}, {
|
|
17
|
-
readonly function: string;
|
|
18
|
-
readonly functionUrl?: string | undefined;
|
|
19
|
-
}, ClientService | Database.Service>>;
|
|
20
|
-
export default _default;
|
|
21
|
-
//# sourceMappingURL=deploy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/deploy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAU,SAAS,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,cAAc,eAAe,CAAC;AAE9B,eAAO,MAAM,cAAc,yCAU1B,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Operation } from '@dxos/compute';
|
|
2
|
-
import { Database, Feed, Obj } from '@dxos/echo';
|
|
3
|
-
declare const _default: Operation.WithHandler<Operation.Definition<{
|
|
4
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly description?: string | undefined;
|
|
7
|
-
readonly updated?: string | undefined;
|
|
8
|
-
readonly source?: import("@dxos/echo/internal").Ref<Obj.Unknown> | undefined;
|
|
9
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
10
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
11
|
-
readonly services?: readonly string[] | undefined;
|
|
12
|
-
readonly binding?: string | undefined;
|
|
13
|
-
readonly icon?: string | undefined;
|
|
14
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
15
|
-
readonly limit?: number | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
readonly invocations: readonly {
|
|
18
|
-
readonly id: string;
|
|
19
|
-
readonly timestamp: number;
|
|
20
|
-
readonly duration: number;
|
|
21
|
-
readonly outcome: string;
|
|
22
|
-
readonly input: object;
|
|
23
|
-
readonly error?: object | undefined;
|
|
24
|
-
}[];
|
|
25
|
-
readonly total: number;
|
|
26
|
-
}, Feed.FeedService | Database.Service>>;
|
|
27
|
-
export default _default;
|
|
28
|
-
//# sourceMappingURL=inspect-invocations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspect-invocations.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/inspect-invocations.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAU,GAAG,EAAS,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-function.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/install-function.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ClientService } from '@dxos/client';
|
|
2
|
-
import { Operation } from '@dxos/compute';
|
|
3
|
-
import { Database, Obj } from '@dxos/echo';
|
|
4
|
-
declare const _default: Operation.WithHandler<Operation.Definition<{
|
|
5
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
6
|
-
readonly name: string;
|
|
7
|
-
readonly description?: string | undefined;
|
|
8
|
-
readonly updated?: string | undefined;
|
|
9
|
-
readonly source?: import("@dxos/echo/internal").Ref<Obj.Unknown> | undefined;
|
|
10
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
11
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
12
|
-
readonly services?: readonly string[] | undefined;
|
|
13
|
-
readonly binding?: string | undefined;
|
|
14
|
-
readonly icon?: string | undefined;
|
|
15
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
16
|
-
readonly payload?: unknown;
|
|
17
|
-
}, {
|
|
18
|
-
readonly response: unknown;
|
|
19
|
-
}, ClientService | Database.Service>>;
|
|
20
|
-
export default _default;
|
|
21
|
-
//# sourceMappingURL=invoke.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/invoke.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-deployed-functions.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/query-deployed-functions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Operation } from '@dxos/compute';
|
|
2
|
-
import { Database } from '@dxos/echo';
|
|
3
|
-
declare const _default: Operation.WithHandler<Operation.Definition<{
|
|
4
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly description?: string | undefined;
|
|
7
|
-
readonly updated?: string | undefined;
|
|
8
|
-
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Obj").Unknown> | undefined;
|
|
9
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
10
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
11
|
-
readonly services?: readonly string[] | undefined;
|
|
12
|
-
readonly binding?: string | undefined;
|
|
13
|
-
readonly icon?: string | undefined;
|
|
14
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
15
|
-
}, {
|
|
16
|
-
readonly name?: string | undefined;
|
|
17
|
-
readonly source: string;
|
|
18
|
-
readonly description?: string | undefined;
|
|
19
|
-
}, Database.Service>>;
|
|
20
|
-
export default _default;
|
|
21
|
-
//# sourceMappingURL=read.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/read.ts"],"names":[],"mappings":"AAMA,OAAO,EAAe,SAAS,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Operation } from '@dxos/compute';
|
|
2
|
-
import { Database, Obj } from '@dxos/echo';
|
|
3
|
-
declare const _default: Operation.WithHandler<Operation.Definition<{
|
|
4
|
-
readonly function: import("@dxos/echo/internal").Ref<{
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly description?: string | undefined;
|
|
7
|
-
readonly updated?: string | undefined;
|
|
8
|
-
readonly source?: import("@dxos/echo/internal").Ref<Obj.Unknown> | undefined;
|
|
9
|
-
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
10
|
-
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
11
|
-
readonly services?: readonly string[] | undefined;
|
|
12
|
-
readonly binding?: string | undefined;
|
|
13
|
-
readonly icon?: string | undefined;
|
|
14
|
-
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
15
|
-
readonly name?: string | undefined;
|
|
16
|
-
readonly description?: string | undefined;
|
|
17
|
-
readonly edits?: readonly {
|
|
18
|
-
readonly oldString: string;
|
|
19
|
-
readonly newString: string;
|
|
20
|
-
readonly replaceAll?: boolean | undefined;
|
|
21
|
-
}[] | undefined;
|
|
22
|
-
}, {
|
|
23
|
-
readonly function: string;
|
|
24
|
-
}, Database.Service>>;
|
|
25
|
-
export default _default;
|
|
26
|
-
//# sourceMappingURL=update.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../../src/blueprints/functions/update.ts"],"names":[],"mappings":"AAOA,OAAO,EAAe,SAAS,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blueprints/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"script-blueprint.d.ts","sourceRoot":"","sources":["../../../../src/blueprints/script-blueprint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAY,MAAM,eAAe,CAAC;AA6CpD,QAAA,MAAM,SAAS,EAAE,SAAS,CAAC,UAG1B,CAAC;eAEa,SAAS"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
4
|
-
declare const blueprintDefinition: () => Effect.Effect<Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[], never, Capability.Service>;
|
|
5
|
-
export default blueprintDefinition;
|
|
6
|
-
//# sourceMappingURL=blueprint-definition.d.ts.map
|