@dxos/plugin-automation 0.8.4-main.9735255 → 0.8.4-main.9be5663bfe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-POEIL4RN.mjs +44 -0
- package/dist/lib/browser/chunk-POEIL4RN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JOXPQ27I.mjs → chunk-WQLEMRPU.mjs} +9 -38
- package/dist/lib/browser/chunk-WQLEMRPU.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +122 -107
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/create-trigger-from-template-JZ62EZTB.mjs +77 -0
- package/dist/lib/browser/create-trigger-from-template-JZ62EZTB.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +79 -7
- package/dist/lib/browser/hooks/index.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +60 -92
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +14 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -4
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/{chunk-RX52VKI2.mjs → chunk-JWZAVQLF.mjs} +9 -37
- package/dist/lib/node-esm/chunk-JWZAVQLF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SP3P4OUI.mjs +45 -0
- package/dist/lib/node-esm/chunk-SP3P4OUI.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +122 -107
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/create-trigger-from-template-224Z7WJI.mjs +78 -0
- package/dist/lib/node-esm/create-trigger-from-template-224Z7WJI.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +79 -7
- package/dist/lib/node-esm/hooks/index.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +60 -92
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +15 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -4
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts +6 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +3 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/index.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/list.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/remove.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/util.d.ts +2 -2
- package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +3 -4
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +28 -30
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +2 -2
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +91 -91
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +4 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/FunctionsContainer}/FunctionsContainer.d.ts +0 -1
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntime.d.ts +7 -0
- package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +1 -4
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts +5 -0
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +2 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +19 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +2 -0
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +29 -31
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +6 -3
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +9 -30
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +73 -46
- package/src/AutomationPlugin.tsx +13 -10
- package/src/capabilities/app-graph-builder.ts +62 -0
- package/src/capabilities/compute-runtime.ts +248 -0
- package/src/capabilities/index.ts +10 -4
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +59 -0
- package/src/cli/commands/trigger/create/queue.ts +7 -6
- package/src/cli/commands/trigger/create/subscription.ts +7 -6
- package/src/cli/commands/trigger/create/timer.ts +7 -6
- package/src/cli/commands/trigger/list.ts +3 -2
- package/src/cli/commands/trigger/remove.ts +2 -2
- package/src/cli/commands/trigger/update/queue.ts +21 -21
- package/src/cli/commands/trigger/update/subscription.ts +20 -19
- package/src/cli/commands/trigger/update/timer.ts +21 -20
- package/src/cli/commands/trigger/util.ts +43 -29
- package/src/cli/plugin.ts +6 -6
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +10 -8
- package/src/components/AutomationPanel/AutomationPanel.tsx +160 -87
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +37 -31
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +27 -24
- package/src/components/FunctionsRegistry/index.ts +4 -1
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +17 -8
- package/src/components/TriggerEditor/SpecSelector.tsx +12 -3
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +56 -13
- package/src/components/TriggerEditor/TriggerEditor.tsx +46 -17
- package/src/components/index.ts +1 -2
- package/src/containers/AutomationSettings/AutomationSettings.tsx +28 -0
- package/src/containers/AutomationSettings/index.ts +5 -0
- package/src/containers/FunctionsContainer/FunctionsContainer.tsx +34 -0
- package/src/containers/FunctionsContainer/index.ts +5 -0
- package/src/{components → containers/TriggerSettings}/TriggerSettings.tsx +8 -7
- package/src/containers/TriggerSettings/index.ts +6 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useComputeRuntime.ts +16 -0
- package/src/hooks/useComputeRuntimeCallback.ts +4 -39
- package/src/hooks/useComputeRuntimeService.ts +24 -0
- package/src/hooks/useTriggerRuntimeControls.ts +22 -8
- package/src/index.ts +2 -6
- package/src/meta.ts +2 -2
- package/src/operations/create-trigger-from-template.ts +75 -0
- package/src/operations/definitions.ts +28 -0
- package/src/operations/index.ts +9 -0
- package/src/testing/test-functions.ts +8 -5
- package/src/translations.ts +35 -36
- package/src/types/capabilities.ts +20 -6
- package/src/types/events.ts +2 -2
- package/src/types/schema.ts +3 -24
- package/dist/lib/browser/AutomationPanel-FAS6ADCW.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs +0 -56
- package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs +0 -129
- package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-ZX4J75UM.mjs +0 -10
- package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs +0 -84
- package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs.map +0 -7
- package/dist/lib/browser/chunk-54PANILA.mjs +0 -14
- package/dist/lib/browser/chunk-54PANILA.mjs.map +0 -7
- package/dist/lib/browser/chunk-BFUIVUQH.mjs +0 -102
- package/dist/lib/browser/chunk-BFUIVUQH.mjs.map +0 -7
- package/dist/lib/browser/chunk-BKFQBKYO.mjs +0 -8
- package/dist/lib/browser/chunk-BKFQBKYO.mjs.map +0 -7
- package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +0 -7
- package/dist/lib/browser/chunk-PZNBEKO5.mjs +0 -17
- package/dist/lib/browser/chunk-PZNBEKO5.mjs.map +0 -7
- package/dist/lib/browser/chunk-QW3EM35H.mjs +0 -248
- package/dist/lib/browser/chunk-QW3EM35H.mjs.map +0 -7
- package/dist/lib/browser/chunk-RAF2FJST.mjs +0 -86
- package/dist/lib/browser/chunk-RAF2FJST.mjs.map +0 -7
- package/dist/lib/browser/chunk-YWLEY2FD.mjs +0 -200
- package/dist/lib/browser/chunk-YWLEY2FD.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs +0 -114
- package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs +0 -82
- package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs.map +0 -7
- package/dist/lib/browser/react-surface-EV3AC62F.mjs +0 -65
- package/dist/lib/browser/react-surface-EV3AC62F.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-B7NAGDFA.mjs +0 -12
- package/dist/lib/node-esm/AutomationPanel-B7NAGDFA.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs +0 -57
- package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs +0 -130
- package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-SS6GIVNU.mjs +0 -11
- package/dist/lib/node-esm/FunctionsPanel-SS6GIVNU.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs +0 -85
- package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2CKVH7JC.mjs +0 -201
- package/dist/lib/node-esm/chunk-2CKVH7JC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +0 -19
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7QRUPEHH.mjs +0 -16
- package/dist/lib/node-esm/chunk-7QRUPEHH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HQLVREIX.mjs +0 -87
- package/dist/lib/node-esm/chunk-HQLVREIX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K7GCM342.mjs +0 -10
- package/dist/lib/node-esm/chunk-K7GCM342.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KWKWOGS5.mjs +0 -103
- package/dist/lib/node-esm/chunk-KWKWOGS5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs +0 -249
- package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs +0 -115
- package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs +0 -83
- package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs +0 -66
- package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
- package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/AutomationSettings.d.ts +0 -5
- package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -71
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/compute-runtime/compute-runtime.ts +0 -133
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -79
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -60
- package/src/components/AutomationSettings.tsx +0 -30
- package/src/components/FunctionsContainer.tsx +0 -36
- /package/dist/lib/browser/{AutomationPanel-FAS6ADCW.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-ZX4J75UM.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
- /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
- /package/src/capabilities/{compute-runtime/index.ts → node.ts} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/TriggerEditor/TriggerEditor.tsx", "../../../src/components/TriggerEditor/FunctionInputEditor.tsx", "../../../src/components/TriggerEditor/SpecSelector.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { DXN, type Database, type Query } from '@dxos/echo';\nimport { Function, Script, Trigger } from '@dxos/functions';\nimport { Filter, Ref, useQuery } from '@dxos/react-client/echo';\nimport { Input } from '@dxos/react-ui';\nimport { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';\nimport {\n type ExcludeId,\n Form,\n FormFieldLabel,\n type FormFieldMap,\n type FormRootProps,\n SelectField,\n omitId,\n} from '@dxos/react-ui-form';\n\nimport { FunctionInputEditor } from './FunctionInputEditor';\nimport { SpecSelector } from './SpecSelector';\n\ntype TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;\n\nexport type TriggerEditorProps = {\n db: Database.Database;\n trigger: Trigger.Trigger;\n // TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.\n readonlySpec?: boolean;\n} &\n // prettier-ignore\n Pick<QueryFormProps, 'types' | 'tags'> &\n Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;\n\nexport const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {\n const fieldMap = useCustomInputs({\n db,\n types,\n tags,\n readonlySpec,\n });\n\n return (\n <Form.Root<TriggerFormSchema>\n {...formProps}\n schema={omitId(Trigger.Trigger)}\n values={trigger}\n db={db}\n fieldMap={fieldMap}\n >\n <Form.Viewport>\n <Form.Content>\n <Form.FieldSet />\n <Form.Actions />\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n\ntype UseCustomInputsProps = {\n db: Database.Database;\n readonlySpec?: boolean;\n} & Pick<QueryFormProps, 'types' | 'tags'>;\n\nconst useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {\n const functions = useQuery(db, Filter.type(Function.Function));\n const workflows = useQuery(db, Filter.type(ComputeGraph));\n const scripts = useQuery(db, Filter.type(Script.Script));\n\n return useMemo(\n (): FormFieldMap => ({\n // Function selector.\n ['function' satisfies keyof Trigger.Trigger]: (props) => {\n const getValue = useCallback(() => {\n const formValue = props.getValue();\n if (Ref.isRef(formValue)) {\n return formValue.dxn.toString() as string;\n }\n return undefined;\n }, [props]);\n\n const handleOnValueChange = useCallback(\n (_type: any, dxnString: string) => {\n const dxn = DXN.parse(dxnString);\n if (dxn) {\n const ref = Ref.fromDXN(dxn);\n props.onValueChange(props.type, ref);\n }\n },\n [props.type, props.onValueChange],\n );\n\n return (\n <SelectField\n {...props}\n getValue={getValue as any}\n onValueChange={handleOnValueChange}\n options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}\n />\n );\n },\n\n // Spec selector.\n ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec} />,\n\n // TODO(wittjosiah): Copied from ViewEditor.\n // Query input editor.\n ['spec.query' as const]: (props) => {\n const handleChange = useCallback(\n (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),\n [props.type, props.onValueChange],\n );\n\n return (\n <Input.Root>\n <FormFieldLabel label={props.label} asChild />\n <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />\n </Input.Root>\n );\n },\n\n // Function input editor.\n ['input' as const]: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,\n }),\n [workflows, scripts, functions, readonlySpec],\n );\n};\n\nconst getWorkflowOptions = (graphs: ComputeGraph[]) => {\n return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));\n};\n\nconst getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {\n const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;\n return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as SchemaAST from 'effect/SchemaAST';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type Database, Ref, Type } from '@dxos/echo';\nimport { type JsonPath } from '@dxos/echo/internal';\nimport { type Function } from '@dxos/functions';\nimport { useOnTransition, useTranslation } from '@dxos/react-ui';\nimport { Form, type FormFieldStateProps, type FormRootProps, useFormValues } from '@dxos/react-ui-form';\n\nimport { meta } from '../../meta';\n\nexport type FunctionInputEditorProps = {\n type: SchemaAST.AST;\n functions: Function.Function[];\n db?: Database.Database;\n} & FormFieldStateProps;\n\nexport const FunctionInputEditor = ({ type, functions, db, getValue, onValueChange }: FunctionInputEditorProps) => {\n const { t } = useTranslation(meta.id);\n const selectedFunctionValue = useFormValues(FunctionInputEditor.displayName, ['function' as JsonPath]);\n const selectedFunctionId = useMemo(() => {\n if (Ref.isRef(selectedFunctionValue)) {\n return selectedFunctionValue.dxn.toString().split('dxn:echo:@:').at(1);\n }\n }, [selectedFunctionValue]);\n\n const selectedFunction = useMemo(\n () => functions.find((fn) => fn.id === selectedFunctionId),\n [functions, selectedFunctionId],\n );\n\n useOnTransition(\n // Clear function parameter input when the function changes.\n selectedFunctionValue,\n (prevValue) => {\n if (!Ref.isRef(prevValue) || !Ref.isRef(selectedFunctionValue)) {\n return false;\n }\n\n return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();\n },\n (currValue) => currValue !== undefined,\n () => onValueChange(type, {}),\n );\n\n const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);\n const effectSchema = useMemo(() => (inputSchema ? Type.toEffectSchema(inputSchema) : undefined), [inputSchema]);\n const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;\n const values = useMemo(() => getValue() ?? {}, [getValue]);\n\n const handleValuesChanged = useCallback<NonNullable<FormRootProps['onValuesChanged']>>(\n (values) => {\n onValueChange(type, values);\n },\n [type, onValueChange],\n );\n\n if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {\n return null;\n }\n\n return (\n <>\n <Form.Label label={t('function parameters label')} asChild />\n <Form.Root schema={effectSchema} values={values} db={db} onValuesChanged={handleValuesChanged}>\n <Form.FieldSet />\n </Form.Root>\n </>\n );\n};\n\nFunctionInputEditor.displayName = 'AutomationTrigger.FunctionInputEditor';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { Filter, Query } from '@dxos/echo';\nimport { Trigger } from '@dxos/functions';\nimport { useTranslation } from '@dxos/react-ui';\nimport { type FormFieldComponentProps, SelectField, useFormFieldState } from '@dxos/react-ui-form';\n\nimport { meta } from '../../meta';\n\nexport type SpecSelectorProps = FormFieldComponentProps;\n\nexport const SpecSelector = (props: SpecSelectorProps) => {\n const { t } = useTranslation(meta.id);\n const specProps = useFormFieldState(SpecSelector.displayName, ['spec' satisfies keyof Trigger.Trigger]);\n\n const handleTypeChange = useCallback(\n (_type: any, value: string): Trigger.Spec | undefined => {\n const getDefaultTriggerSpec = (kind: string) => {\n switch (kind) {\n case 'timer':\n return { kind: 'timer', cron: '' };\n case 'subscription':\n return {\n kind: 'subscription',\n query: {\n ast: Query.select(Filter.nothing()).ast,\n },\n };\n case 'queue':\n return { kind: 'queue', queue: 'dxn:' };\n case 'email':\n return { kind: 'email' };\n case 'webhook':\n return { kind: 'webhook' };\n default:\n return undefined;\n }\n };\n\n const defaultSpec = getDefaultTriggerSpec(value);\n if (!defaultSpec) {\n return;\n }\n\n // Update the entire spec object, not just the `spec.kind`.\n specProps.onValueChange(props.type, defaultSpec);\n },\n [props.type, specProps],\n );\n\n const options = useMemo(\n () =>\n Trigger.Kinds.map((kind) => ({\n value: kind,\n label: t(`trigger type ${kind}`),\n })),\n [t],\n );\n\n return <SelectField {...props} options={options} onValueChange={handleTypeChange} />;\n};\n\nSpecSelector.displayName = 'Form.SpecSelector';\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,UAASC,eAAAA,cAAaC,WAAAA,gBAAe;AAE5C,SAASC,oBAAoB;AAC7B,SAASC,WAAsC;AAC/C,SAASC,UAAUC,QAAQC,WAAAA,gBAAe;AAC1C,SAASC,UAAAA,SAAQC,OAAAA,MAAKC,gBAAgB;AACtC,SAASC,aAAa;AACtB,SAASC,iBAAsC;AAC/C,SAEEC,QAAAA,OACAC,gBAGAC,eAAAA,cACAC,cACK;;;ACfP,OAAOC,SAASC,aAAaC,eAAe;AAE5C,SAAwBC,KAAKC,YAAY;AAGzC,SAASC,iBAAiBC,sBAAsB;AAChD,SAASC,MAAoDC,qBAAqB;AAU3E,IAAMC,sBAAsB,CAAC,EAAEC,MAAMC,WAAWC,IAAIC,UAAUC,cAAa,MAA4B;AA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EA,IAAMjB,qBAAqB,CAACxB,SAA0BP,cAAAA;AACpD,QAAMkD,WAAW,CAACC,OAA0B5C,QAAQ6C,KAAK,CAACC,MAAMF,GAAGG,QAAQC,QAAQP,OAAOK,EAAEL,EAAE,GAAGQ,QAAQL,GAAGK;AAC5G,SAAOxD,UAAU8C,IAAI,CAACK,QAAQ;IAAEZ,OAAOW,SAASC,EAAAA;IAAKF,OAAO,cAAcE,GAAGH,EAAE;EAAG,EAAA;AACpF;",
|
|
6
|
-
"names": ["React", "useCallback", "useMemo", "ComputeGraph", "DXN", "Function", "Script", "Trigger", "Filter", "Ref", "useQuery", "Input", "QueryForm", "Form", "FormFieldLabel", "SelectField", "omitId", "React", "useCallback", "useMemo", "Ref", "Type", "useOnTransition", "useTranslation", "Form", "useFormValues", "FunctionInputEditor", "type", "functions", "db", "getValue", "onValueChange", "t", "useTranslation", "meta", "id", "selectedFunctionValue", "useFormValues", "displayName", "selectedFunctionId", "useMemo", "Ref", "isRef", "dxn", "toString", "split", "at", "selectedFunction", "find", "fn", "useOnTransition", "prevValue", "currValue", "undefined", "inputSchema", "effectSchema", "Type", "toEffectSchema", "propertyCount", "properties", "Object", "keys", "length", "values", "handleValuesChanged", "useCallback", "Form", "Label", "label", "asChild", "Root", "schema", "onValuesChanged", "FieldSet", "React", "useCallback", "useMemo", "Filter", "Query", "Trigger", "useTranslation", "SelectField", "useFormFieldState", "SpecSelector", "props", "t", "useTranslation", "meta", "id", "specProps", "useFormFieldState", "displayName", "handleTypeChange", "useCallback", "_type", "value", "getDefaultTriggerSpec", "kind", "cron", "query", "ast", "Query", "select", "Filter", "nothing", "queue", "undefined", "defaultSpec", "onValueChange", "type", "options", "useMemo", "Trigger", "Kinds", "map", "label", "React", "SelectField", "TriggerEditor", "db", "types", "tags", "readonlySpec", "trigger", "formProps", "fieldMap", "useCustomInputs", "React", "Form", "Root", "schema", "omitId", "Trigger", "values", "Viewport", "Content", "FieldSet", "Actions", "functions", "useQuery", "Filter", "type", "Function", "workflows", "ComputeGraph", "scripts", "Script", "useMemo", "props", "getValue", "useCallback", "formValue", "Ref", "isRef", "dxn", "toString", "undefined", "handleOnValueChange", "_type", "dxnString", "DXN", "parse", "ref", "fromDXN", "onValueChange", "SelectField", "options", "getWorkflowOptions", "concat", "getFunctionOptions", "SpecSelector", "readonly", "handleChange", "query", "ast", "Input", "FormFieldLabel", "label", "asChild", "QueryForm", "initialQuery", "onChange", "FunctionInputEditor", "graphs", "map", "graph", "id", "value", "getLabel", "fn", "find", "s", "source", "target", "name"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/events.ts", "../../../src/types/schema.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { type AiService, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';\nimport { Capability } from '@dxos/app-framework';\nimport { type Database } from '@dxos/echo';\nimport type { CredentialsService, FunctionInvocationService, QueueService, TracingService } from '@dxos/functions';\nimport type { TriggerDispatcher, TriggerStateStore } from '@dxos/functions-runtime';\nimport type { SpaceId } from '@dxos/keys';\n\nimport { meta } from '../meta';\n\nexport namespace AutomationCapabilities {\n /**\n * Service stack for executing agents, functions, and triggers.\n */\n export type ComputeServices =\n | TriggerDispatcher\n | TriggerStateStore\n | AiService.AiService\n | Database.Service\n | QueueService\n | CredentialsService\n | FunctionInvocationService\n | TracingService\n // TODO(dmaretskyi): Those should be provided at AI-chat call site.\n | ToolResolverService\n | ToolExecutionService;\n\n export type ComputeRuntime = ManagedRuntime.ManagedRuntime<AutomationCapabilities.ComputeServices, never>;\n export interface ComputeRuntimeProvider {\n getRuntime(spaceId: SpaceId): ComputeRuntime;\n }\n\n /**\n * Runtime for executing agents, functions, and triggers.\n */\n export const ComputeRuntime = Capability.make<ComputeRuntimeProvider>(`${meta.id}/capability/compute-runtime`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvent } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\n\nexport namespace AutomationEvents {\n export const ComputeRuntimeReady = ActivationEvent.make(`${meta.id}/event/compute-runtime-ready`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Database } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '../meta';\n\nconst TriggerTemplate = Schema.Union(\n Schema.Struct({ type: Schema.Literal('timer'), cron: Schema.String }),\n Schema.Struct({ type: Schema.Literal('queue'), queueDXN: Schema.Any }),\n);\n\nexport namespace AutomationAction {\n export class CreateTriggerFromTemplate extends Schema.TaggedClass<CreateTriggerFromTemplate>()(\n `${meta.id}/action/create-trigger-from-template`,\n {\n input: Schema.Struct({\n db: Database.Database,\n template: TriggerTemplate,\n enabled: Schema.optional(Schema.Boolean),\n // TODO(wittjosiah): Improve how this lookup is done.\n scriptName: Schema.optional(Schema.String),\n input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n }),\n output: Schema.Void,\n },\n ) {}\n}\n\nconst AUTOMATION_OPERATION = `${meta.id}/operation`;\n\nexport namespace AutomationOperation {\n export const CreateTriggerFromTemplate = Operation.make({\n meta: { key: `${AUTOMATION_OPERATION}/create-trigger-from-template`, name: 'Create Trigger From Template' },\n services: [Capability.Service],\n schema: {\n input: Schema.Struct({\n db: Database.Database,\n template: TriggerTemplate,\n enabled: Schema.optional(Schema.Boolean),\n scriptName: Schema.optional(Schema.String),\n input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n }),\n output: Schema.Void,\n },\n });\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;AAOA,SAASA,kBAAkB;UAQVC,yBAAAA;0BAyBFC,iBAAiBC,WAAWC,KAA6B,GAAGC,KAAKC,EAAE,6BAA6B;AA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chB;QAAI,CAAA,CAAA;MAC/E,CAAA;MACAiB,QAAeC;IACjB;EACF,CAAA;AACF,GAfiBE,wBAAAA,sBAAAA,CAAAA,EAAAA;;;",
|
|
6
|
-
"names": ["Capability", "AutomationCapabilities", "ComputeRuntime", "Capability", "make", "meta", "id", "ActivationEvent", "AutomationEvents", "ComputeRuntimeReady", "ActivationEvent", "make", "meta", "id", "Schema", "Capability", "Database", "Operation", "TriggerTemplate", "Union", "Struct", "type", "Literal", "cron", "String", "queueDXN", "Any", "AutomationAction", "CreateTriggerFromTemplate", "TaggedClass", "meta", "id", "input", "db", "Database", "template", "enabled", "optional", "Boolean", "scriptName", "Record", "key", "value", "output", "Void", "AUTOMATION_OPERATION", "AutomationOperation", "Operation", "make", "name", "services", "Capability", "Service", "schema"]
|
|
7
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AutomationCapabilities
|
|
4
|
-
} from "./chunk-RX52VKI2.mjs";
|
|
5
|
-
import "./chunk-5FXNN3MV.mjs";
|
|
6
|
-
|
|
7
|
-
// src/capabilities/compute-runtime/compute-runtime.ts
|
|
8
|
-
import * as BrowserKeyValueStore from "@effect/platform-browser/BrowserKeyValueStore";
|
|
9
|
-
import * as Effect from "effect/Effect";
|
|
10
|
-
import * as Layer from "effect/Layer";
|
|
11
|
-
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
12
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
13
|
-
import { GenericToolkit, makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from "@dxos/assistant";
|
|
14
|
-
import { SpaceProperties } from "@dxos/client/echo";
|
|
15
|
-
import { Resource } from "@dxos/context";
|
|
16
|
-
import { Database, Obj, Query, Ref } from "@dxos/echo";
|
|
17
|
-
import { CredentialsService, QueueService } from "@dxos/functions";
|
|
18
|
-
import { FunctionImplementationResolver, FunctionInvocationServiceLayerWithLocalLoopbackExecutor, RemoteFunctionExecutionService, TracingServiceExt, TriggerDispatcher, TriggerStateStore } from "@dxos/functions-runtime";
|
|
19
|
-
import { invariant } from "@dxos/invariant";
|
|
20
|
-
import { ClientCapabilities } from "@dxos/plugin-client/types";
|
|
21
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-automation/src/capabilities/compute-runtime/compute-runtime.ts";
|
|
22
|
-
var compute_runtime_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
23
|
-
const capabilities = yield* Capability.Service;
|
|
24
|
-
const provider = yield* Effect.tryPromise(() => new ComputeRuntimeProviderImpl(capabilities).open());
|
|
25
|
-
return Capability.contributes(AutomationCapabilities.ComputeRuntime, provider, () => Effect.tryPromise(() => provider.close()));
|
|
26
|
-
}));
|
|
27
|
-
var ComputeRuntimeProviderImpl = class extends Resource {
|
|
28
|
-
#runtimes = /* @__PURE__ */ new Map();
|
|
29
|
-
#capabilities;
|
|
30
|
-
constructor(capabilities) {
|
|
31
|
-
super();
|
|
32
|
-
this.#capabilities = capabilities;
|
|
33
|
-
}
|
|
34
|
-
async _open() {
|
|
35
|
-
}
|
|
36
|
-
async _close() {
|
|
37
|
-
await Promise.all(Array.from(this.#runtimes.values()).map((rt) => rt.dispose()));
|
|
38
|
-
this.#runtimes.clear();
|
|
39
|
-
}
|
|
40
|
-
getRuntime(spaceId) {
|
|
41
|
-
if (this.#runtimes.has(spaceId)) {
|
|
42
|
-
return this.#runtimes.get(spaceId);
|
|
43
|
-
}
|
|
44
|
-
const layer = Layer.unwrapEffect(Effect.gen(this, function* () {
|
|
45
|
-
const client = this.#capabilities.get(ClientCapabilities.Client);
|
|
46
|
-
const aiServiceLayer = this.#capabilities.get(Common.Capability.AiServiceLayer) ?? Layer.die("AiService not found");
|
|
47
|
-
const functions = this.#capabilities.getAll(Common.Capability.Functions).flat();
|
|
48
|
-
const toolkits = this.#capabilities.getAll(Common.Capability.Toolkit);
|
|
49
|
-
const mergedToolkit = GenericToolkit.merge(...toolkits);
|
|
50
|
-
const toolkit = mergedToolkit.toolkit;
|
|
51
|
-
const toolkitLayer = mergedToolkit.layer;
|
|
52
|
-
const space = client.spaces.get(spaceId);
|
|
53
|
-
invariant(space, `Invalid space: ${spaceId}`, {
|
|
54
|
-
F: __dxlog_file,
|
|
55
|
-
L: 78,
|
|
56
|
-
S: this,
|
|
57
|
-
A: [
|
|
58
|
-
"space",
|
|
59
|
-
"`Invalid space: ${spaceId}`"
|
|
60
|
-
]
|
|
61
|
-
});
|
|
62
|
-
yield* Effect.promise(() => space.waitUntilReady());
|
|
63
|
-
return Layer.mergeAll(TriggerDispatcher.layer({
|
|
64
|
-
timeControl: "natural"
|
|
65
|
-
})).pipe(Layer.provideMerge(Layer.mergeAll(TracingServiceLive, TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)), makeToolResolverFromFunctions(functions, toolkit), makeToolExecutionServiceFromFunctions(toolkit, toolkitLayer))), Layer.provideMerge(FunctionInvocationServiceLayerWithLocalLoopbackExecutor.pipe(Layer.provideMerge(FunctionImplementationResolver.layerTest({
|
|
66
|
-
functions
|
|
67
|
-
})), Layer.provideMerge(RemoteFunctionExecutionService.fromClient(
|
|
68
|
-
client,
|
|
69
|
-
// If agent is not enabled do not provide spaceId because space context will be unavailable on EDGE.
|
|
70
|
-
client.config.get("runtime.client.edgeFeatures.agents") ? spaceId : void 0
|
|
71
|
-
)), Layer.provideMerge(aiServiceLayer), Layer.provideMerge(CredentialsService.layerFromDatabase()), Layer.provideMerge(space ? Database.Service.layer(space.db) : Database.Service.notAvailable), Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable))));
|
|
72
|
-
}));
|
|
73
|
-
const runtime = ManagedRuntime.make(layer);
|
|
74
|
-
this.#runtimes.set(spaceId, runtime);
|
|
75
|
-
return runtime;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
var TracingServiceLive = Layer.unwrapEffect(Effect.gen(function* () {
|
|
79
|
-
const objects = yield* Database.Service.runQuery(Query.type(SpaceProperties));
|
|
80
|
-
const [properties] = objects;
|
|
81
|
-
invariant(properties, void 0, {
|
|
82
|
-
F: __dxlog_file,
|
|
83
|
-
L: 120,
|
|
84
|
-
S: this,
|
|
85
|
-
A: [
|
|
86
|
-
"properties",
|
|
87
|
-
""
|
|
88
|
-
]
|
|
89
|
-
});
|
|
90
|
-
if (!properties.invocationTraceQueue || !properties.invocationTraceQueue.target) {
|
|
91
|
-
const queue2 = yield* QueueService.createQueue({
|
|
92
|
-
subspaceTag: "trace"
|
|
93
|
-
});
|
|
94
|
-
Obj.change(properties, (m) => {
|
|
95
|
-
m.invocationTraceQueue = Ref.fromDXN(queue2.dxn);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const queue = properties.invocationTraceQueue.target;
|
|
99
|
-
invariant(queue, void 0, {
|
|
100
|
-
F: __dxlog_file,
|
|
101
|
-
L: 130,
|
|
102
|
-
S: this,
|
|
103
|
-
A: [
|
|
104
|
-
"queue",
|
|
105
|
-
""
|
|
106
|
-
]
|
|
107
|
-
});
|
|
108
|
-
return TracingServiceExt.layerInvocationsQueue({
|
|
109
|
-
invocationTraceQueue: queue
|
|
110
|
-
});
|
|
111
|
-
}));
|
|
112
|
-
export {
|
|
113
|
-
compute_runtime_default as default
|
|
114
|
-
};
|
|
115
|
-
//# sourceMappingURL=compute-runtime-ZHROOBLY.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/compute-runtime/compute-runtime.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as BrowserKeyValueStore from '@effect/platform-browser/BrowserKeyValueStore';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { Capability, type CapabilityManager, Common } from '@dxos/app-framework';\nimport { GenericToolkit, makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';\nimport { SpaceProperties } from '@dxos/client/echo';\nimport { Resource } from '@dxos/context';\nimport { Database, Obj, Query, Ref } from '@dxos/echo';\nimport { CredentialsService, QueueService } from '@dxos/functions';\nimport {\n FunctionImplementationResolver,\n FunctionInvocationServiceLayerWithLocalLoopbackExecutor,\n RemoteFunctionExecutionService,\n TracingServiceExt,\n TriggerDispatcher,\n TriggerStateStore,\n} from '@dxos/functions-runtime';\nimport { invariant } from '@dxos/invariant';\nimport { type SpaceId } from '@dxos/keys';\nimport { ClientCapabilities } from '@dxos/plugin-client/types';\n\nimport { AutomationCapabilities } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n const provider = yield* Effect.tryPromise(() => new ComputeRuntimeProviderImpl(capabilities).open());\n return Capability.contributes(AutomationCapabilities.ComputeRuntime, provider, () =>\n Effect.tryPromise(() => provider.close()),\n );\n }),\n);\n\n/**\n * Adapts plugin capabilities to runtime layers.\n */\nclass ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilities.ComputeRuntimeProvider {\n readonly #runtimes = new Map<SpaceId, AutomationCapabilities.ComputeRuntime>();\n readonly #capabilities: CapabilityManager.CapabilityManager;\n\n constructor(capabilities: CapabilityManager.CapabilityManager) {\n super();\n this.#capabilities = capabilities;\n }\n\n protected override async _open() {}\n\n protected override async _close() {\n await Promise.all(Array.from(this.#runtimes.values()).map((rt) => rt.dispose()));\n this.#runtimes.clear();\n }\n\n getRuntime(spaceId: SpaceId): AutomationCapabilities.ComputeRuntime {\n if (this.#runtimes.has(spaceId)) {\n return this.#runtimes.get(spaceId)!;\n }\n\n const layer = Layer.unwrapEffect(\n Effect.gen(this, function* () {\n const client = this.#capabilities.get(ClientCapabilities.Client);\n const aiServiceLayer =\n this.#capabilities.get(Common.Capability.AiServiceLayer) ?? Layer.die('AiService not found');\n\n // TODO(dmaretskyi): Make these reactive.\n const functions = this.#capabilities.getAll(Common.Capability.Functions).flat();\n const toolkits = this.#capabilities.getAll(Common.Capability.Toolkit);\n const mergedToolkit = GenericToolkit.merge(...toolkits);\n const toolkit = mergedToolkit.toolkit;\n const toolkitLayer = mergedToolkit.layer;\n\n const space = client.spaces.get(spaceId);\n invariant(space, `Invalid space: ${spaceId}`);\n yield* Effect.promise(() => space.waitUntilReady());\n\n return Layer.mergeAll(TriggerDispatcher.layer({ timeControl: 'natural' })).pipe(\n Layer.provideMerge(\n Layer.mergeAll(\n TracingServiceLive,\n TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)),\n makeToolResolverFromFunctions(functions, toolkit),\n makeToolExecutionServiceFromFunctions(toolkit, toolkitLayer),\n ),\n ),\n Layer.provideMerge(\n FunctionInvocationServiceLayerWithLocalLoopbackExecutor.pipe(\n Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions })),\n Layer.provideMerge(\n RemoteFunctionExecutionService.fromClient(\n client,\n // If agent is not enabled do not provide spaceId because space context will be unavailable on EDGE.\n client.config.get('runtime.client.edgeFeatures.agents') ? spaceId : undefined,\n ),\n ),\n Layer.provideMerge(aiServiceLayer),\n Layer.provideMerge(CredentialsService.layerFromDatabase()),\n Layer.provideMerge(space ? Database.Service.layer(space.db) : Database.Service.notAvailable),\n Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),\n ),\n ),\n );\n }),\n );\n\n const runtime = ManagedRuntime.make(layer);\n this.#runtimes.set(spaceId, runtime);\n return runtime;\n }\n}\n\nconst TracingServiceLive = Layer.unwrapEffect(\n Effect.gen(function* () {\n const objects = yield* Database.Service.runQuery(Query.type(SpaceProperties));\n const [properties] = objects;\n invariant(properties);\n // TODO(burdon): Check ref target has loaded?\n if (!properties.invocationTraceQueue || !properties.invocationTraceQueue.target) {\n const queue = yield* QueueService.createQueue({ subspaceTag: 'trace' });\n Obj.change(properties, (m) => {\n m.invocationTraceQueue = Ref.fromDXN(queue.dxn);\n });\n }\n\n const queue = properties.invocationTraceQueue.target;\n invariant(queue);\n return TracingServiceExt.layerInvocationsQueue({ invocationTraceQueue: queue });\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,0BAA0B;AACtC,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,oBAAoB;AAEhC,SAASC,YAAoCC,cAAc;AAC3D,SAASC,gBAAgBC,uCAAuCC,qCAAqC;AACrG,SAASC,uBAAuB;AAChC,SAASC,gBAAgB;AACzB,SAASC,UAAUC,KAAKC,OAAOC,WAAW;AAC1C,SAASC,oBAAoBC,oBAAoB;AACjD,SACEC,gCACAC,yDACAC,gCACAC,mBACAC,mBACAC,yBACK;AACP,SAASC,iBAAiB;AAE1B,SAASC,0BAA0B;;AAInC,IAAA,0BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,eAAe,OAAOH,WAAWI;AACvC,QAAMC,WAAW,OAAcC,kBAAW,MAAM,IAAIC,2BAA2BJ,YAAAA,EAAcK,KAAI,CAAA;AACjG,SAAOR,WAAWS,YAAYC,uBAAuBC,gBAAgBN,UAAU,MACtEC,kBAAW,MAAMD,SAASO,MAAK,CAAA,CAAA;AAE1C,CAAA,CAAA;AAMF,IAAML,6BAAN,cAAyCM,SAAAA;EAC9B,YAAY,oBAAIC,IAAAA;EAChB;EAET,YAAYX,cAAmD;AAC7D,UAAK;AACL,SAAK,gBAAgBA;EACvB;EAEA,MAAyBY,QAAQ;EAAC;EAElC,MAAyBC,SAAS;AAChC,UAAMC,QAAQC,IAAIC,MAAMC,KAAK,KAAK,UAAUC,OAAM,CAAA,EAAIC,IAAI,CAACC,OAAOA,GAAGC,QAAO,CAAA,CAAA;AAC5E,SAAK,UAAUC,MAAK;EACtB;EAEAC,WAAWC,SAAyD;AAClE,QAAI,KAAK,UAAUC,IAAID,OAAAA,GAAU;AAC/B,aAAO,KAAK,UAAUE,IAAIF,OAAAA;IAC5B;AAEA,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,IAAID,aAAaD,YAAY,CAAA,CAAA,CAAA;IAI/F,CAAA,CAAA;AAGF,UAAMG,UAAyBC,oBAAKrD,KAAAA;AACpC,SAAK,UAAUsD,IAAIzD,SAASuD,OAAAA;AAC5B,WAAOA;EACT;AACF;AAEA,IAAMrB,qBAA2B9B,mBACxBC,WAAI,aAAA;AACT,QAAMqD,UAAU,OAAOR,SAASzE,QAAQkF,SAASC,MAAMC,KAAKC,eAAAA,CAAAA;AAC5D,QAAM,CAACC,UAAAA,IAAcL;AACrBhC,YAAUqC,YAAAA,QAAAA;;;;;;;;;AAEV,MAAI,CAACA,WAAWC,wBAAwB,CAACD,WAAWC,qBAAqBC,QAAQ;AAC/E,UAAMC,SAAQ,OAAOb,aAAac,YAAY;MAAEC,aAAa;IAAQ,CAAA;AACrEC,QAAIC,OAAOP,YAAY,CAACQ,MAAAA;AACtBA,QAAEP,uBAAuBQ,IAAIC,QAAQP,OAAMQ,GAAG;IAChD,CAAA;EACF;AAEA,QAAMR,QAAQH,WAAWC,qBAAqBC;AAC9CvC,YAAUwC,OAAAA,QAAAA;;;;;;;;;AACV,SAAOS,kBAAkBC,sBAAsB;IAAEZ,sBAAsBE;EAAM,CAAA;AAC/E,CAAA,CAAA;",
|
|
6
|
-
"names": ["BrowserKeyValueStore", "Effect", "Layer", "ManagedRuntime", "Capability", "Common", "GenericToolkit", "makeToolExecutionServiceFromFunctions", "makeToolResolverFromFunctions", "SpaceProperties", "Resource", "Database", "Obj", "Query", "Ref", "CredentialsService", "QueueService", "FunctionImplementationResolver", "FunctionInvocationServiceLayerWithLocalLoopbackExecutor", "RemoteFunctionExecutionService", "TracingServiceExt", "TriggerDispatcher", "TriggerStateStore", "invariant", "ClientCapabilities", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "provider", "tryPromise", "ComputeRuntimeProviderImpl", "open", "contributes", "AutomationCapabilities", "ComputeRuntime", "close", "Resource", "Map", "_open", "_close", "Promise", "all", "Array", "from", "values", "map", "rt", "dispose", "clear", "getRuntime", "spaceId", "has", "get", "layer", "unwrapEffect", "gen", "client", "ClientCapabilities", "Client", "aiServiceLayer", "Common", "AiServiceLayer", "die", "functions", "getAll", "Functions", "flat", "toolkits", "Toolkit", "mergedToolkit", "GenericToolkit", "merge", "toolkit", "toolkitLayer", "space", "spaces", "invariant", "promise", "waitUntilReady", "mergeAll", "TriggerDispatcher", "timeControl", "pipe", "provideMerge", "TracingServiceLive", "TriggerStateStore", "layerKv", "provide", "layerLocalStorage", "makeToolResolverFromFunctions", "makeToolExecutionServiceFromFunctions", "FunctionInvocationServiceLayerWithLocalLoopbackExecutor", "FunctionImplementationResolver", "layerTest", "RemoteFunctionExecutionService", "fromClient", "config", "undefined", "CredentialsService", "layerFromDatabase", "Database", "db", "notAvailable", "QueueService", "queues", "runtime", "make", "set", "objects", "runQuery", "Query", "type", "SpaceProperties", "properties", "invocationTraceQueue", "target", "queue", "createQueue", "subspaceTag", "Obj", "change", "m", "Ref", "fromDXN", "dxn", "TracingServiceExt", "layerInvocationsQueue"]
|
|
7
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AutomationOperation
|
|
4
|
-
} from "./chunk-RX52VKI2.mjs";
|
|
5
|
-
import "./chunk-5FXNN3MV.mjs";
|
|
6
|
-
|
|
7
|
-
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
8
|
-
import * as Effect from "effect/Effect";
|
|
9
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
10
|
-
import { Obj, Ref } from "@dxos/echo";
|
|
11
|
-
import { Function, Script, Trigger } from "@dxos/functions";
|
|
12
|
-
import { Operation, OperationResolver } from "@dxos/operation";
|
|
13
|
-
import { ATTENDABLE_PATH_SEPARATOR } from "@dxos/plugin-deck/types";
|
|
14
|
-
import { SpaceOperation } from "@dxos/plugin-space/types";
|
|
15
|
-
import { Filter } from "@dxos/react-client/echo";
|
|
16
|
-
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
17
|
-
return Capability.contributes(Common.Capability.OperationResolver, [
|
|
18
|
-
OperationResolver.make({
|
|
19
|
-
operation: AutomationOperation.CreateTriggerFromTemplate,
|
|
20
|
-
handler: Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
|
|
21
|
-
const trigger = Trigger.make({
|
|
22
|
-
enabled,
|
|
23
|
-
input
|
|
24
|
-
});
|
|
25
|
-
if (scriptName) {
|
|
26
|
-
const scripts = yield* Effect.promise(() => db.query(Filter.type(Script.Script, {
|
|
27
|
-
name: scriptName
|
|
28
|
-
})).run());
|
|
29
|
-
const [script] = scripts;
|
|
30
|
-
if (script) {
|
|
31
|
-
const functions = yield* Effect.promise(() => db.query(Filter.type(Function.Function, {
|
|
32
|
-
source: Ref.make(script)
|
|
33
|
-
})).run());
|
|
34
|
-
const [fn] = functions;
|
|
35
|
-
if (fn) {
|
|
36
|
-
Obj.change(trigger, (t) => {
|
|
37
|
-
t.function = Ref.make(fn);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
switch (template.type) {
|
|
43
|
-
case "timer": {
|
|
44
|
-
Obj.change(trigger, (t) => {
|
|
45
|
-
t.spec = {
|
|
46
|
-
kind: "timer",
|
|
47
|
-
cron: template.cron
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
case "queue": {
|
|
53
|
-
Obj.change(trigger, (t) => {
|
|
54
|
-
t.spec = {
|
|
55
|
-
kind: "queue",
|
|
56
|
-
queue: template.queueDXN.toString()
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
default: {
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
66
|
-
object: trigger,
|
|
67
|
-
target: db,
|
|
68
|
-
hidden: true
|
|
69
|
-
});
|
|
70
|
-
yield* Operation.invoke(Common.LayoutOperation.Open, {
|
|
71
|
-
subject: [
|
|
72
|
-
`automation-settings${ATTENDABLE_PATH_SEPARATOR}${db.spaceId}`
|
|
73
|
-
],
|
|
74
|
-
workspace: db.spaceId
|
|
75
|
-
});
|
|
76
|
-
})
|
|
77
|
-
})
|
|
78
|
-
]);
|
|
79
|
-
}));
|
|
80
|
-
export {
|
|
81
|
-
operation_resolver_default as default
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=operation-resolver-R5GA4YNO.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Obj, Ref } from '@dxos/echo';\nimport { Function, Script, Trigger } from '@dxos/functions';\nimport { type DXN } from '@dxos/keys';\nimport { Operation, OperationResolver } from '@dxos/operation';\nimport { ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';\nimport { SpaceOperation } from '@dxos/plugin-space/types';\nimport { Filter } from '@dxos/react-client/echo';\n\nimport { AutomationOperation } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Common.Capability.OperationResolver, [\n OperationResolver.make({\n operation: AutomationOperation.CreateTriggerFromTemplate,\n handler: Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {\n const trigger = Trigger.make({ enabled, input });\n\n // TODO(wittjosiah): Factor out function lookup by script name?\n if (scriptName) {\n const scripts = yield* Effect.promise(() =>\n db.query(Filter.type(Script.Script, { name: scriptName })).run(),\n );\n const [script] = scripts;\n if (script) {\n const functions = yield* Effect.promise(() =>\n db.query(Filter.type(Function.Function, { source: Ref.make(script) })).run(),\n );\n const [fn] = functions;\n if (fn) {\n Obj.change(trigger, (t) => {\n t.function = Ref.make(fn);\n });\n }\n }\n }\n\n switch (template.type) {\n case 'timer': {\n Obj.change(trigger, (t) => {\n t.spec = { kind: 'timer', cron: template.cron };\n });\n break;\n }\n case 'queue': {\n Obj.change(trigger, (t) => {\n t.spec = {\n kind: 'queue',\n queue: (template.queueDXN as DXN).toString(),\n };\n });\n break;\n }\n default: {\n break;\n }\n }\n\n yield* Operation.invoke(SpaceOperation.AddObject, {\n object: trigger,\n target: db,\n hidden: true,\n });\n yield* Operation.invoke(Common.LayoutOperation.Open, {\n subject: [`automation-settings${ATTENDABLE_PATH_SEPARATOR}${db.spaceId}`],\n workspace: db.spaceId,\n });\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,KAAKC,WAAW;AACzB,SAASC,UAAUC,QAAQC,eAAe;AAE1C,SAASC,WAAWC,yBAAyB;AAC7C,SAASC,iCAAiC;AAC1C,SAASC,sBAAsB;AAC/B,SAASC,cAAc;AAIvB,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,OAAOJ,WAAWK,mBAAmB;IACjEA,kBAAkBC,KAAK;MACrBC,WAAWC,oBAAoBC;MAC/BC,SAAgBR,kBAAW,WAAW,EAAES,IAAIC,UAAUC,UAAU,OAAOC,YAAYC,MAAK,GAAE;AACxF,cAAMC,UAAUC,QAAQX,KAAK;UAAEO;UAASE;QAAM,CAAA;AAG9C,YAAID,YAAY;AACd,gBAAMI,UAAU,OAAcC,eAAQ,MACpCR,GAAGS,MAAMC,OAAOC,KAAKC,OAAOA,QAAQ;YAAEC,MAAMV;UAAW,CAAA,CAAA,EAAIW,IAAG,CAAA;AAEhE,gBAAM,CAACC,MAAAA,IAAUR;AACjB,cAAIQ,QAAQ;AACV,kBAAMC,YAAY,OAAcR,eAAQ,MACtCR,GAAGS,MAAMC,OAAOC,KAAKM,SAASA,UAAU;cAAEC,QAAQC,IAAIxB,KAAKoB,MAAAA;YAAQ,CAAA,CAAA,EAAID,IAAG,CAAA;AAE5E,kBAAM,CAACM,EAAAA,IAAMJ;AACb,gBAAII,IAAI;AACNC,kBAAIC,OAAOjB,SAAS,CAACkB,MAAAA;AACnBA,kBAAEC,WAAWL,IAAIxB,KAAKyB,EAAAA;cACxB,CAAA;YACF;UACF;QACF;AAEA,gBAAQnB,SAASU,MAAI;UACnB,KAAK,SAAS;AACZU,gBAAIC,OAAOjB,SAAS,CAACkB,MAAAA;AACnBA,gBAAEE,OAAO;gBAAEC,MAAM;gBAASC,MAAM1B,SAAS0B;cAAK;YAChD,CAAA;AACA;UACF;UACA,KAAK,SAAS;AACZN,gBAAIC,OAAOjB,SAAS,CAACkB,MAAAA;AACnBA,gBAAEE,OAAO;gBACPC,MAAM;gBACNE,OAAQ3B,SAAS4B,SAAiBC,SAAQ;cAC5C;YACF,CAAA;AACA;UACF;UACA,SAAS;AACP;UACF;QACF;AAEA,eAAOC,UAAUC,OAAOC,eAAeC,WAAW;UAChDC,QAAQ9B;UACR+B,QAAQpC;UACRqC,QAAQ;QACV,CAAA;AACA,eAAON,UAAUC,OAAOvC,OAAO6C,gBAAgBC,MAAM;UACnDC,SAAS;YAAC,sBAAsBC,yBAAAA,GAA4BzC,GAAG0C,OAAO;;UACtEC,WAAW3C,GAAG0C;QAChB,CAAA;MACF,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Common", "Obj", "Ref", "Function", "Script", "Trigger", "Operation", "OperationResolver", "ATTENDABLE_PATH_SEPARATOR", "SpaceOperation", "Filter", "Capability", "makeModule", "fnUntraced", "contributes", "Common", "OperationResolver", "make", "operation", "AutomationOperation", "CreateTriggerFromTemplate", "handler", "db", "template", "enabled", "scriptName", "input", "trigger", "Trigger", "scripts", "promise", "query", "Filter", "type", "Script", "name", "run", "script", "functions", "Function", "source", "Ref", "fn", "Obj", "change", "t", "function", "spec", "kind", "cron", "queue", "queueDXN", "toString", "Operation", "invoke", "SpaceOperation", "AddObject", "object", "target", "hidden", "LayoutOperation", "Open", "subject", "ATTENDABLE_PATH_SEPARATOR", "spaceId", "workspace"]
|
|
7
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AutomationSettings,
|
|
4
|
-
FunctionsContainer
|
|
5
|
-
} from "./chunk-7QRUPEHH.mjs";
|
|
6
|
-
import "./chunk-LJAXQ6CX.mjs";
|
|
7
|
-
import {
|
|
8
|
-
meta
|
|
9
|
-
} from "./chunk-5FXNN3MV.mjs";
|
|
10
|
-
|
|
11
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
12
|
-
import * as Effect from "effect/Effect";
|
|
13
|
-
import React from "react";
|
|
14
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
15
|
-
import { useLayout } from "@dxos/app-framework/react";
|
|
16
|
-
import { Obj } from "@dxos/echo";
|
|
17
|
-
import { getSpace, parseId, useSpace } from "@dxos/react-client/echo";
|
|
18
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactSurface, [
|
|
19
|
-
Common.createSurface({
|
|
20
|
-
id: `${meta.id}/space-settings-functions`,
|
|
21
|
-
role: "article",
|
|
22
|
-
filter: (data) => data.subject === `${meta.id}/space-settings-functions`,
|
|
23
|
-
component: () => {
|
|
24
|
-
const layout = useLayout();
|
|
25
|
-
const { spaceId } = parseId(layout.workspace);
|
|
26
|
-
const space = useSpace(spaceId);
|
|
27
|
-
if (!space) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
return /* @__PURE__ */ React.createElement(FunctionsContainer, {
|
|
31
|
-
space
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}),
|
|
35
|
-
Common.createSurface({
|
|
36
|
-
id: `${meta.id}/space-settings-automation`,
|
|
37
|
-
role: "article",
|
|
38
|
-
filter: (data) => data.subject === `${meta.id}/space-settings-automation`,
|
|
39
|
-
component: () => {
|
|
40
|
-
const layout = useLayout();
|
|
41
|
-
const { spaceId } = parseId(layout.workspace);
|
|
42
|
-
const space = useSpace(spaceId);
|
|
43
|
-
if (!space) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
return /* @__PURE__ */ React.createElement(AutomationSettings, {
|
|
47
|
-
space
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}),
|
|
51
|
-
Common.createSurface({
|
|
52
|
-
id: `${meta.id}/companion/automation`,
|
|
53
|
-
role: "article",
|
|
54
|
-
filter: (data) => Obj.isObject(data.companionTo) && data.subject === "automation",
|
|
55
|
-
component: ({ data }) => {
|
|
56
|
-
return /* @__PURE__ */ React.createElement(AutomationSettings, {
|
|
57
|
-
space: getSpace(data.companionTo),
|
|
58
|
-
object: data.companionTo
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
])));
|
|
63
|
-
export {
|
|
64
|
-
react_surface_default as default
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=react-surface-S6VZJCEZ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { useLayout } from '@dxos/app-framework/react';\nimport { Obj } from '@dxos/echo';\nimport { getSpace, parseId, useSpace } from '@dxos/react-client/echo';\n\nimport { AutomationSettings, FunctionsContainer } from '../../components';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Common.Capability.ReactSurface, [\n Common.createSurface({\n id: `${meta.id}/space-settings-functions`,\n role: 'article',\n filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-functions`,\n component: () => {\n const layout = useLayout();\n const { spaceId } = parseId(layout.workspace);\n const space = useSpace(spaceId);\n if (!space) {\n return null;\n }\n\n return <FunctionsContainer space={space} />;\n },\n }),\n Common.createSurface({\n id: `${meta.id}/space-settings-automation`,\n role: 'article',\n filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-automation`,\n component: () => {\n const layout = useLayout();\n const { spaceId } = parseId(layout.workspace);\n const space = useSpace(spaceId);\n if (!space) {\n return null;\n }\n\n return <AutomationSettings space={space} />;\n },\n }),\n Common.createSurface({\n id: `${meta.id}/companion/automation`,\n role: 'article',\n filter: (data): data is { companionTo: Obj.Unknown; subject: 'automation' } =>\n Obj.isObject(data.companionTo) && data.subject === 'automation',\n component: ({ data }) => {\n return <AutomationSettings space={getSpace(data.companionTo)!} object={data.companionTo} />;\n },\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,UAAUC,SAASC,gBAAgB;AAK5C,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,OAAOJ,WAAWK,cAAc;EACrDD,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SAAsCA,KAAKC,YAAY,GAAGJ,KAAKD,EAAE;IAC1EM,WAAW,MAAA;AACT,YAAMC,SAASC,UAAAA;AACf,YAAM,EAAEC,QAAO,IAAKC,QAAQH,OAAOI,SAAS;AAC5C,YAAMC,QAAQC,SAASJ,OAAAA;AACvB,UAAI,CAACG,OAAO;AACV,eAAO;MACT;AAEA,aAAO,sBAAA,cAACE,oBAAAA;QAAmBF;;IAC7B;EACF,CAAA;EACAf,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SAAsCA,KAAKC,YAAY,GAAGJ,KAAKD,EAAE;IAC1EM,WAAW,MAAA;AACT,YAAMC,SAASC,UAAAA;AACf,YAAM,EAAEC,QAAO,IAAKC,QAAQH,OAAOI,SAAS;AAC5C,YAAMC,QAAQC,SAASJ,OAAAA;AACvB,UAAI,CAACG,OAAO;AACV,eAAO;MACT;AAEA,aAAO,sBAAA,cAACG,oBAAAA;QAAmBH;;IAC7B;EACF,CAAA;EACAf,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SACPY,IAAIC,SAASb,KAAKc,WAAW,KAAKd,KAAKC,YAAY;IACrDC,WAAW,CAAC,EAAEF,KAAI,MAAE;AAClB,aAAO,sBAAA,cAACW,oBAAAA;QAAmBH,OAAOO,SAASf,KAAKc,WAAW;QAAIE,QAAQhB,KAAKc;;IAC9E;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capability", "Common", "useLayout", "Obj", "getSpace", "parseId", "useSpace", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "subject", "component", "layout", "useLayout", "spaceId", "parseId", "workspace", "space", "useSpace", "FunctionsContainer", "AutomationSettings", "Obj", "isObject", "companionTo", "getSpace", "object"]
|
|
7
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
import { GraphBuilder } from '@dxos/plugin-graph';
|
|
4
|
-
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<GraphBuilder.BuilderExtensions>>, never, never>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=app-graph-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAC;;AAK/D,wBAwDE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/app-graph-builder/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,eAAe,qIAA0E,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
import { AutomationCapabilities } from '../../types';
|
|
4
|
-
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<AutomationCapabilities.ComputeRuntimeProvider>>, import("effect/Cause").UnknownException, Capability.Service>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=compute-runtime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compute-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/compute-runtime/compute-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,UAAU,EAAkC,MAAM,qBAAqB,CAAC;AAkBjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;;AAErD,wBAQE"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
export declare const ComputeRuntime: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("../..").AutomationCapabilities.ComputeRuntimeProvider>>, Error>;
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/compute-runtime/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,cAAc,uJAAuE,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
export declare const OperationResolver: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Common").Capability.OperationResolver[]>>, Error>;
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,6JAA6E,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Common.Capability.OperationResolver[]>>, never, never>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=operation-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/operation-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;AAWzD,wBA6DE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,sJAAmE,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Common.Capability.ReactSurface>>, never, never>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=react-surface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/react-surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;AAQzD,wBA4CE"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AutomationPanelProps } from './AutomationPanel';
|
|
3
|
-
export declare const AutomationSettings: (props: AutomationPanelProps) => React.JSX.Element;
|
|
4
|
-
export default AutomationSettings;
|
|
5
|
-
//# sourceMappingURL=AutomationSettings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/AutomationSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG/E,eAAO,MAAM,kBAAkB,GAAI,OAAO,oBAAoB,sBAa7D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionsContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/FunctionsContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AASrD,eAAO,MAAM,kBAAkB,GAAI,WAAW;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,sBAkB7D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/TriggerSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAO3C,eAAO,MAAM,gBAAgB,GAAI,QAAQ;IAAE,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAA;CAAE,sBAWjE,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capability, Common } from '@dxos/app-framework';
|
|
8
|
-
import { Script } from '@dxos/functions';
|
|
9
|
-
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
10
|
-
import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
11
|
-
import { meta as spaceMeta } from '@dxos/plugin-space';
|
|
12
|
-
|
|
13
|
-
import { meta } from '../../meta';
|
|
14
|
-
|
|
15
|
-
export default Capability.makeModule(
|
|
16
|
-
Effect.fnUntraced(function* () {
|
|
17
|
-
const extensions = yield* Effect.all([
|
|
18
|
-
GraphBuilder.createExtension({
|
|
19
|
-
id: `${meta.id}/space-settings-automation`,
|
|
20
|
-
match: NodeMatcher.whenNodeType(`${spaceMeta.id}/settings`),
|
|
21
|
-
connector: (node) =>
|
|
22
|
-
Effect.succeed([
|
|
23
|
-
{
|
|
24
|
-
id: `automation-${node.id}`,
|
|
25
|
-
type: `${meta.id}/space-settings-automation`,
|
|
26
|
-
data: `${meta.id}/space-settings-automation`,
|
|
27
|
-
properties: {
|
|
28
|
-
label: ['automation panel label', { ns: meta.id }],
|
|
29
|
-
icon: 'ph--lightning--regular',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
]),
|
|
33
|
-
}),
|
|
34
|
-
GraphBuilder.createExtension({
|
|
35
|
-
id: `${meta.id}/space-settings-functions`,
|
|
36
|
-
match: NodeMatcher.whenNodeType(`${spaceMeta.id}/settings`),
|
|
37
|
-
connector: (node) =>
|
|
38
|
-
Effect.succeed([
|
|
39
|
-
{
|
|
40
|
-
id: `functions-${node.id}`,
|
|
41
|
-
type: `${meta.id}/space-settings-functions`,
|
|
42
|
-
data: `${meta.id}/space-settings-functions`,
|
|
43
|
-
properties: {
|
|
44
|
-
label: ['functions panel label', { ns: meta.id }],
|
|
45
|
-
icon: 'ph--function--regular',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
]),
|
|
49
|
-
}),
|
|
50
|
-
GraphBuilder.createTypeExtension({
|
|
51
|
-
id: `${meta.id}/script-companion`,
|
|
52
|
-
type: Script.Script,
|
|
53
|
-
connector: (script) =>
|
|
54
|
-
Effect.succeed([
|
|
55
|
-
{
|
|
56
|
-
id: [script.id, 'automation'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
57
|
-
type: PLANK_COMPANION_TYPE,
|
|
58
|
-
data: 'automation',
|
|
59
|
-
properties: {
|
|
60
|
-
label: ['script automation label', { ns: meta.id }],
|
|
61
|
-
icon: 'ph--lightning--regular',
|
|
62
|
-
disposition: 'hidden',
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
]),
|
|
66
|
-
}),
|
|
67
|
-
]);
|
|
68
|
-
|
|
69
|
-
return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);
|
|
70
|
-
}),
|
|
71
|
-
);
|