@dxos/plugin-automation 0.6.14-main.8b352a0 → 0.6.14-staging.3e2eaca

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.
Files changed (57) hide show
  1. package/dist/lib/browser/{PromptContainer-RFMJXMUA.mjs → PromptContainer-3GUENQHE.mjs} +4 -4
  2. package/dist/lib/browser/{chunk-PSSWFA6A.mjs → chunk-2FOJUVYG.mjs} +3 -3
  3. package/dist/lib/browser/{chunk-GGA62V7D.mjs → chunk-J4SYTP4Y.mjs} +2 -2
  4. package/dist/lib/browser/{chunk-GGA62V7D.mjs.map → chunk-J4SYTP4Y.mjs.map} +2 -2
  5. package/dist/lib/browser/{chunk-3TNRXJTD.mjs → chunk-PQLGYMNY.mjs} +6 -2
  6. package/dist/lib/browser/{chunk-3TNRXJTD.mjs.map → chunk-PQLGYMNY.mjs.map} +3 -3
  7. package/dist/lib/browser/index.mjs +88 -44
  8. package/dist/lib/browser/index.mjs.map +3 -3
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/meta.mjs +1 -1
  11. package/dist/lib/browser/types/index.mjs +2 -2
  12. package/dist/lib/node/{PromptContainer-FRSY6FNL.cjs → PromptContainer-74ZRO4HK.cjs} +8 -8
  13. package/dist/lib/node/{chunk-E2H3AGKB.cjs → chunk-4TMTUB4X.cjs} +18 -18
  14. package/dist/lib/node/{chunk-UPPUTAPL.cjs → chunk-JSZ6PAYL.cjs} +9 -5
  15. package/dist/lib/node/{chunk-UPPUTAPL.cjs.map → chunk-JSZ6PAYL.cjs.map} +3 -3
  16. package/dist/lib/node/{chunk-N5IDAUFU.cjs → chunk-XS53UP75.cjs} +6 -6
  17. package/dist/lib/node/{chunk-N5IDAUFU.cjs.map → chunk-XS53UP75.cjs.map} +2 -2
  18. package/dist/lib/node/index.cjs +128 -84
  19. package/dist/lib/node/index.cjs.map +3 -3
  20. package/dist/lib/node/meta.cjs +3 -3
  21. package/dist/lib/node/meta.cjs.map +1 -1
  22. package/dist/lib/node/meta.json +1 -1
  23. package/dist/lib/node/types/index.cjs +7 -7
  24. package/dist/lib/node/types/index.cjs.map +1 -1
  25. package/dist/lib/node-esm/{PromptContainer-4VHFPEQH.mjs → PromptContainer-5OK4GWIR.mjs} +4 -4
  26. package/dist/lib/node-esm/{chunk-UT6QKU6J.mjs → chunk-AAUSG7OA.mjs} +2 -2
  27. package/dist/lib/node-esm/{chunk-UT6QKU6J.mjs.map → chunk-AAUSG7OA.mjs.map} +2 -2
  28. package/dist/lib/node-esm/{chunk-QAPWYK2P.mjs → chunk-B35UD3D7.mjs} +6 -2
  29. package/dist/lib/node-esm/{chunk-QAPWYK2P.mjs.map → chunk-B35UD3D7.mjs.map} +3 -3
  30. package/dist/lib/node-esm/{chunk-HFTXKLRR.mjs → chunk-FN6DOJZP.mjs} +3 -3
  31. package/dist/lib/node-esm/index.mjs +88 -44
  32. package/dist/lib/node-esm/index.mjs.map +3 -3
  33. package/dist/lib/node-esm/meta.json +1 -1
  34. package/dist/lib/node-esm/meta.mjs +1 -1
  35. package/dist/lib/node-esm/types/index.mjs +2 -2
  36. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  37. package/dist/types/src/components/AutomationPanel.d.ts.map +1 -1
  38. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  39. package/dist/types/src/meta.d.ts +2 -0
  40. package/dist/types/src/meta.d.ts.map +1 -1
  41. package/dist/types/src/translations.d.ts +14 -0
  42. package/dist/types/src/translations.d.ts.map +1 -1
  43. package/dist/types/src/types/types.d.ts +2 -1
  44. package/dist/types/src/types/types.d.ts.map +1 -1
  45. package/package.json +33 -31
  46. package/src/AutomationPlugin.tsx +10 -1
  47. package/src/components/AutomationPanel.tsx +2 -0
  48. package/src/components/TriggerEditor/TriggerEditor.tsx +59 -44
  49. package/src/meta.ts +3 -1
  50. package/src/translations.ts +16 -6
  51. package/src/types/types.ts +3 -1
  52. /package/dist/lib/browser/{PromptContainer-RFMJXMUA.mjs.map → PromptContainer-3GUENQHE.mjs.map} +0 -0
  53. /package/dist/lib/browser/{chunk-PSSWFA6A.mjs.map → chunk-2FOJUVYG.mjs.map} +0 -0
  54. /package/dist/lib/node/{PromptContainer-FRSY6FNL.cjs.map → PromptContainer-74ZRO4HK.cjs.map} +0 -0
  55. /package/dist/lib/node/{chunk-E2H3AGKB.cjs.map → chunk-4TMTUB4X.cjs.map} +0 -0
  56. /package/dist/lib/node-esm/{PromptContainer-4VHFPEQH.mjs.map → PromptContainer-5OK4GWIR.mjs.map} +0 -0
  57. /package/dist/lib/node-esm/{chunk-HFTXKLRR.mjs.map → chunk-FN6DOJZP.mjs.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  PromptEditor
4
- } from "./chunk-HFTXKLRR.mjs";
5
- import "./chunk-UT6QKU6J.mjs";
6
- import "./chunk-QAPWYK2P.mjs";
4
+ } from "./chunk-FN6DOJZP.mjs";
5
+ import "./chunk-AAUSG7OA.mjs";
6
+ import "./chunk-B35UD3D7.mjs";
7
7
 
8
8
  // packages/plugins/experimental/plugin-automation/src/components/PromptContainer.tsx
9
9
  import React from "react";
@@ -17,4 +17,4 @@ var PromptContainer_default = PromptContainer;
17
17
  export {
18
18
  PromptContainer_default as default
19
19
  };
20
- //# sourceMappingURL=PromptContainer-4VHFPEQH.mjs.map
20
+ //# sourceMappingURL=PromptContainer-5OK4GWIR.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  AUTOMATION_PLUGIN
4
- } from "./chunk-QAPWYK2P.mjs";
4
+ } from "./chunk-B35UD3D7.mjs";
5
5
 
6
6
  // packages/plugins/experimental/plugin-automation/src/types/chain.ts
7
7
  import { ref, S, TypedObject } from "@dxos/echo-schema";
@@ -53,4 +53,4 @@ export {
53
53
  ChainType,
54
54
  AutomationAction
55
55
  };
56
- //# sourceMappingURL=chunk-UT6QKU6J.mjs.map
56
+ //# sourceMappingURL=chunk-AAUSG7OA.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/types/chain.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Change to S.Literal (and discriminated union).\nexport enum ChainInputType {\n VALUE = 0,\n PASS_THROUGH = 1,\n RETRIEVER = 2,\n FUNCTION = 3,\n QUERY = 4,\n RESOLVER = 5,\n CONTEXT = 6,\n SCHEMA = 7,\n}\n\nexport const ChainInputSchema = S.mutable(\n S.Struct({\n name: S.String,\n type: S.optional(S.Enums(ChainInputType)),\n value: S.optional(S.String),\n }),\n);\n\nexport type ChainInput = S.Schema.Type<typeof ChainInputSchema>;\n\nexport class ChainPromptType extends TypedObject({ typename: 'dxos.org/type/ChainPrompt', version: '0.1.0' })({\n command: S.optional(S.String),\n template: S.String,\n inputs: S.optional(S.mutable(S.Array(ChainInputSchema))),\n}) {}\n\nexport class ChainType extends TypedObject({ typename: 'dxos.org/type/Chain', version: '0.1.0' })({\n name: S.optional(S.String),\n prompts: S.optional(S.mutable(S.Array(ref(ChainPromptType)))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SurfaceProvides,\n TranslationsProvides,\n} from '@dxos/app-framework';\nimport { type SchemaProvides } from '@dxos/plugin-client';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nconst AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;\n\nexport enum AutomationAction {\n CREATE = `${AUTOMATION_ACTION}/create`,\n}\n\nexport type AutomationPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n MetadataRecordsProvides &\n TranslationsProvides &\n GraphBuilderProvides &\n SchemaProvides;\n"],
5
- "mappings": ";;;;;;AAIA,SAASA,KAAKC,GAAGC,mBAAmB;;UAGxBC,iBAAAA;;;;;;;;;GAAAA,mBAAAA,iBAAAA,CAAAA,EAAAA;AAWL,IAAMC,mBAAmBC,EAAEC,QAChCD,EAAEE,OAAO;EACPC,MAAMH,EAAEI;EACRC,MAAML,EAAEM,SAASN,EAAEO,MAAMT,cAAAA,CAAAA;EACzBU,OAAOR,EAAEM,SAASN,EAAEI,MAAM;AAC5B,CAAA,CAAA;AAKK,IAAMK,kBAAN,cAA8BC,YAAY;EAAEC,UAAU;EAA6BC,SAAS;AAAQ,CAAA,EAAG;EAC5GC,SAASb,EAAEM,SAASN,EAAEI,MAAM;EAC5BU,UAAUd,EAAEI;EACZW,QAAQf,EAAEM,SAASN,EAAEC,QAAQD,EAAEgB,MAAMjB,gBAAAA,CAAAA,CAAAA;AACvC,CAAA,EAAA;AAAI;AAEG,IAAMkB,YAAN,cAAwBP,YAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAAG;EAChGT,MAAMH,EAAEM,SAASN,EAAEI,MAAM;EACzBc,SAASlB,EAAEM,SAASN,EAAEC,QAAQD,EAAEgB,MAAMG,IAAIV,eAAAA,CAAAA,CAAAA,CAAAA;AAC5C,CAAA,EAAA;AAAI;;;ACtBJ,IAAMW,oBAAoB,GAAGC,iBAAAA;;UAEjBC,mBAAAA;kDACD,GAAGF,iBAAAA,SAA0B,IAAA;GAD5BE,qBAAAA,mBAAAA,CAAAA,EAAAA;",
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Change to S.Literal (and discriminated union).\nexport enum ChainInputType {\n VALUE = 0,\n PASS_THROUGH = 1,\n RETRIEVER = 2,\n FUNCTION = 3,\n QUERY = 4,\n RESOLVER = 5,\n CONTEXT = 6,\n SCHEMA = 7,\n}\n\nexport const ChainInputSchema = S.mutable(\n S.Struct({\n name: S.String,\n type: S.optional(S.Enums(ChainInputType)),\n value: S.optional(S.String),\n }),\n);\n\nexport type ChainInput = S.Schema.Type<typeof ChainInputSchema>;\n\nexport class ChainPromptType extends TypedObject({ typename: 'dxos.org/type/ChainPrompt', version: '0.1.0' })({\n command: S.optional(S.String),\n template: S.String,\n inputs: S.optional(S.mutable(S.Array(ChainInputSchema))),\n}) {}\n\nexport class ChainType extends TypedObject({ typename: 'dxos.org/type/Chain', version: '0.1.0' })({\n name: S.optional(S.String),\n prompts: S.optional(S.mutable(S.Array(ref(ChainPromptType)))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SurfaceProvides,\n TranslationsProvides,\n} from '@dxos/app-framework';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport { type PanelProvides } from '@dxos/plugin-deck/types';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nconst AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;\n\nexport enum AutomationAction {\n CREATE = `${AUTOMATION_ACTION}/create`,\n}\n\nexport type AutomationPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n MetadataRecordsProvides &\n TranslationsProvides &\n GraphBuilderProvides &\n SchemaProvides &\n PanelProvides;\n"],
5
+ "mappings": ";;;;;;AAIA,SAASA,KAAKC,GAAGC,mBAAmB;;UAGxBC,iBAAAA;;;;;;;;;GAAAA,mBAAAA,iBAAAA,CAAAA,EAAAA;AAWL,IAAMC,mBAAmBC,EAAEC,QAChCD,EAAEE,OAAO;EACPC,MAAMH,EAAEI;EACRC,MAAML,EAAEM,SAASN,EAAEO,MAAMT,cAAAA,CAAAA;EACzBU,OAAOR,EAAEM,SAASN,EAAEI,MAAM;AAC5B,CAAA,CAAA;AAKK,IAAMK,kBAAN,cAA8BC,YAAY;EAAEC,UAAU;EAA6BC,SAAS;AAAQ,CAAA,EAAG;EAC5GC,SAASb,EAAEM,SAASN,EAAEI,MAAM;EAC5BU,UAAUd,EAAEI;EACZW,QAAQf,EAAEM,SAASN,EAAEC,QAAQD,EAAEgB,MAAMjB,gBAAAA,CAAAA,CAAAA;AACvC,CAAA,EAAA;AAAI;AAEG,IAAMkB,YAAN,cAAwBP,YAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAAG;EAChGT,MAAMH,EAAEM,SAASN,EAAEI,MAAM;EACzBc,SAASlB,EAAEM,SAASN,EAAEC,QAAQD,EAAEgB,MAAMG,IAAIV,eAAAA,CAAAA,CAAAA,CAAAA;AAC5C,CAAA,EAAA;AAAI;;;ACrBJ,IAAMW,oBAAoB,GAAGC,iBAAAA;;UAEjBC,mBAAAA;kDACD,GAAGF,iBAAAA,SAA0B,IAAA;GAD5BE,qBAAAA,mBAAAA,CAAAA,EAAAA;",
6
6
  "names": ["ref", "S", "TypedObject", "ChainInputType", "ChainInputSchema", "S", "mutable", "Struct", "name", "String", "type", "optional", "Enums", "value", "ChainPromptType", "TypedObject", "typename", "version", "command", "template", "inputs", "Array", "ChainType", "prompts", "ref", "AUTOMATION_ACTION", "AUTOMATION_PLUGIN", "AutomationAction"]
7
7
  }
@@ -6,11 +6,15 @@ var meta_default = {
6
6
  id: AUTOMATION_PLUGIN,
7
7
  name: "Automation",
8
8
  description: "Automation workflows.",
9
- icon: "ph--magic-wand--regular"
9
+ icon: "ph--flow-arrow--regular",
10
+ source: "https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation",
11
+ tags: [
12
+ "experimental"
13
+ ]
10
14
  };
11
15
 
12
16
  export {
13
17
  AUTOMATION_PLUGIN,
14
18
  meta_default
15
19
  };
16
- //# sourceMappingURL=chunk-QAPWYK2P.mjs.map
20
+ //# sourceMappingURL=chunk-B35UD3D7.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';\n\nexport default {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description: 'Automation workflows.',\n icon: 'ph--magic-wand--regular',\n} satisfies PluginMeta;\n"],
5
- "mappings": ";;;AAMO,IAAMA,oBAAoB;AAEjC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,aAAa;EACbC,MAAM;AACR;",
6
- "names": ["AUTOMATION_PLUGIN", "id", "name", "description", "icon"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';\n\nexport default {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description: 'Automation workflows.',\n icon: 'ph--flow-arrow--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation',\n tags: ['experimental'],\n} satisfies PluginMeta;\n"],
5
+ "mappings": ";;;AAMO,IAAMA,oBAAoB;AAEjC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;",
6
+ "names": ["AUTOMATION_PLUGIN", "id", "name", "description", "icon", "source", "tags"]
7
7
  }
@@ -1,10 +1,10 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  ChainInputType
4
- } from "./chunk-UT6QKU6J.mjs";
4
+ } from "./chunk-AAUSG7OA.mjs";
5
5
  import {
6
6
  AUTOMATION_PLUGIN
7
- } from "./chunk-QAPWYK2P.mjs";
7
+ } from "./chunk-B35UD3D7.mjs";
8
8
 
9
9
  // packages/plugins/experimental/plugin-automation/src/components/PromptEditor/PromptEditor.tsx
10
10
  import React, { useEffect } from "react";
@@ -215,4 +215,4 @@ var PromptEditor = ({ prompt, commandEditable = true }) => {
215
215
  export {
216
216
  PromptEditor
217
217
  };
218
- //# sourceMappingURL=chunk-HFTXKLRR.mjs.map
218
+ //# sourceMappingURL=chunk-FN6DOJZP.mjs.map
@@ -1,18 +1,18 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  PromptEditor
4
- } from "./chunk-HFTXKLRR.mjs";
4
+ } from "./chunk-FN6DOJZP.mjs";
5
5
  import {
6
6
  AutomationAction,
7
7
  ChainInputSchema,
8
8
  ChainInputType,
9
9
  ChainPromptType,
10
10
  ChainType
11
- } from "./chunk-UT6QKU6J.mjs";
11
+ } from "./chunk-AAUSG7OA.mjs";
12
12
  import {
13
13
  AUTOMATION_PLUGIN,
14
14
  meta_default
15
- } from "./chunk-QAPWYK2P.mjs";
15
+ } from "./chunk-B35UD3D7.mjs";
16
16
 
17
17
  // packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx
18
18
  import React6 from "react";
@@ -317,7 +317,7 @@ import { log as log3 } from "@dxos/log";
317
317
  import { ScriptType } from "@dxos/plugin-script/types";
318
318
  import { useClient } from "@dxos/react-client";
319
319
  import { Filter as Filter2, useQuery } from "@dxos/react-client/echo";
320
- import { Input as Input3, Select as Select2 } from "@dxos/react-ui";
320
+ import { Input as Input3, Select as Select2, useTranslation as useTranslation2 } from "@dxos/react-ui";
321
321
  import { distinctBy } from "@dxos/util";
322
322
 
323
323
  // packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx
@@ -661,12 +661,19 @@ var triggerTypes = [
661
661
  ];
662
662
  var registerTriggersMutex = new Mutex();
663
663
  var TriggerEditor = ({ space, trigger }) => {
664
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
664
665
  const client = useClient();
665
666
  const scripts = useQuery(space, Filter2.schema(ScriptType));
666
667
  const script = useMemo(() => scripts.find((script2) => script2.id === trigger.function), [
667
668
  trigger.function,
668
669
  scripts
669
670
  ]);
671
+ const triggerLabels = {
672
+ subscription: t("trigger type subscription"),
673
+ timer: t("trigger type timer"),
674
+ webhook: t("trigger type webhook"),
675
+ websocket: t("trigger type websocket")
676
+ };
670
677
  const [registry] = useState(/* @__PURE__ */ new Map());
671
678
  const triggers = useQuery(space, Filter2.schema(FunctionTrigger));
672
679
  useEffect(() => {
@@ -675,11 +682,11 @@ var TriggerEditor = ({ space, trigger }) => {
675
682
  const deprecated = new Set(Array.from(registry.keys()));
676
683
  log3.info("triggers", {
677
684
  deprecated,
678
- all: triggers.map((t) => t.id),
679
- enabled: triggers.filter((t) => t.enabled).map((t) => t.id)
685
+ all: triggers.map((t2) => t2.id),
686
+ enabled: triggers.filter((t2) => t2.enabled).map((t2) => t2.id)
680
687
  }, {
681
688
  F: __dxlog_file3,
682
- L: 47,
689
+ L: 56,
683
690
  S: void 0,
684
691
  C: (f, a) => f(...a)
685
692
  });
@@ -691,13 +698,13 @@ var TriggerEditor = ({ space, trigger }) => {
691
698
  }
692
699
  log3.info("activating trigger", trigger2.id, {
693
700
  F: __dxlog_file3,
694
- L: 59,
701
+ L: 68,
695
702
  S: void 0,
696
703
  C: (f, a) => f(...a)
697
704
  });
698
705
  const ctx = new Context(void 0, {
699
706
  F: __dxlog_file3,
700
- L: 61
707
+ L: 70
701
708
  });
702
709
  registry.set(trigger2.id, ctx);
703
710
  const triggerSpec = trigger2.spec;
@@ -711,7 +718,7 @@ var TriggerEditor = ({ space, trigger }) => {
711
718
  type: triggerSpec.type
712
719
  }, {
713
720
  F: __dxlog_file3,
714
- L: 71,
721
+ L: 80,
715
722
  S: void 0,
716
723
  C: (f, a) => f(...a)
717
724
  });
@@ -742,7 +749,7 @@ var TriggerEditor = ({ space, trigger }) => {
742
749
  };
743
750
  }, []);
744
751
  useEffect(() => {
745
- void space.db.schema.list().then((schemas) => {
752
+ void space.db.schemaRegistry.query().then((schemas) => {
746
753
  state.schemas = distinctBy([
747
754
  ...state.schemas,
748
755
  ...schemas
@@ -823,34 +830,35 @@ var TriggerEditor = ({ space, trigger }) => {
823
830
  }, /* @__PURE__ */ React5.createElement("table", {
824
831
  className: "is-full table-fixed"
825
832
  }, /* @__PURE__ */ React5.createElement("tbody", null, /* @__PURE__ */ React5.createElement(InputRow, {
826
- label: "Function"
833
+ label: t("function select label")
827
834
  }, /* @__PURE__ */ React5.createElement(Select2.Root, {
828
835
  value: script?.id,
829
836
  onValueChange: handleSelectFunction
830
837
  }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
831
- placeholder: "Select function"
838
+ classNames: "w-full",
839
+ placeholder: t("function select placeholder")
832
840
  }), /* @__PURE__ */ React5.createElement(Select2.Portal, null, /* @__PURE__ */ React5.createElement(Select2.Content, null, /* @__PURE__ */ React5.createElement(Select2.Viewport, null, scripts.map(({ id, name }) => /* @__PURE__ */ React5.createElement(Select2.Option, {
833
841
  key: id,
834
842
  value: id
835
- }, name ?? "Unnamed"))))))), script?.description?.length && /* @__PURE__ */ React5.createElement(InputRow, null, /* @__PURE__ */ React5.createElement("div", {
843
+ }, name ?? id))))))), script?.description?.length && /* @__PURE__ */ React5.createElement(InputRow, null, /* @__PURE__ */ React5.createElement("div", {
836
844
  className: "px-2"
837
845
  }, /* @__PURE__ */ React5.createElement("p", {
838
846
  className: "text-sm text-description"
839
847
  }, script?.description?.length))), /* @__PURE__ */ React5.createElement(InputRow, {
840
- label: "Type"
848
+ label: t("trigger select label")
841
849
  }, /* @__PURE__ */ React5.createElement(Select2.Root, {
842
850
  value: trigger.spec?.type,
843
851
  onValueChange: handleSelectTriggerType
844
852
  }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
845
- placeholder: "Select trigger"
853
+ placeholder: t("trigger select placeholder")
846
854
  }), /* @__PURE__ */ React5.createElement(Select2.Portal, null, /* @__PURE__ */ React5.createElement(Select2.Content, null, /* @__PURE__ */ React5.createElement(Select2.Viewport, null, triggerTypes.map((trigger2) => /* @__PURE__ */ React5.createElement(Select2.Option, {
847
855
  key: trigger2,
848
856
  value: trigger2
849
- }, trigger2)))))))), /* @__PURE__ */ React5.createElement("tbody", null, trigger.spec && /* @__PURE__ */ React5.createElement(TriggerSpec, {
857
+ }, triggerLabels[trigger2])))))))), /* @__PURE__ */ React5.createElement("tbody", null, trigger.spec && /* @__PURE__ */ React5.createElement(TriggerSpec, {
850
858
  space,
851
859
  spec: trigger.spec
852
860
  }), /* @__PURE__ */ React5.createElement(InputRow, {
853
- label: "Enabled"
861
+ label: t("function enabled")
854
862
  }, /* @__PURE__ */ React5.createElement("div", {
855
863
  className: "flex items-center h-8"
856
864
  }, /* @__PURE__ */ React5.createElement(Input3.Switch, {
@@ -865,10 +873,11 @@ var TriggerEditor = ({ space, trigger }) => {
865
873
  }))));
866
874
  };
867
875
  var TriggerSpecSubscription = ({ spec }) => {
876
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
868
877
  if (!spec.filter) {
869
878
  return null;
870
879
  }
871
- const handleSelectSchema = (typename) => {
880
+ const handleValueChange = (typename) => {
872
881
  spec.filter = [
873
882
  {
874
883
  type: typename
@@ -876,10 +885,10 @@ var TriggerSpecSubscription = ({ spec }) => {
876
885
  ];
877
886
  };
878
887
  return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
879
- label: "Filter"
888
+ label: t("trigger filter")
880
889
  }, /* @__PURE__ */ React5.createElement(Select2.Root, {
881
890
  value: spec.filter.length > 0 ? spec.filter[0].type : void 0,
882
- onValueChange: handleSelectSchema
891
+ onValueChange: handleValueChange
883
892
  }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
884
893
  classNames: "w-full",
885
894
  placeholder: "Select type"
@@ -888,28 +897,35 @@ var TriggerSpecSubscription = ({ spec }) => {
888
897
  value: typename
889
898
  }, typename))))))));
890
899
  };
891
- var TriggerSpecTimer = ({ spec }) => /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
892
- label: "Cron"
893
- }, /* @__PURE__ */ React5.createElement(Input3.TextInput, {
894
- value: spec.cron,
895
- onChange: (event) => spec.cron = event.target.value
896
- })));
900
+ var TriggerSpecTimer = ({ spec }) => {
901
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
902
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
903
+ label: t("trigger cron")
904
+ }, /* @__PURE__ */ React5.createElement(Input3.TextInput, {
905
+ value: spec.cron,
906
+ onChange: (event) => spec.cron = event.target.value
907
+ })));
908
+ };
897
909
  var methods = [
898
910
  "GET",
899
911
  "POST"
900
912
  ];
901
- var TriggerSpecWebhook = ({ spec }) => /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
902
- label: "Method"
903
- }, /* @__PURE__ */ React5.createElement(Select2.Root, {
904
- value: spec.method,
905
- onValueChange: (value) => spec.method = value
906
- }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
907
- placeholder: "type"
908
- }), /* @__PURE__ */ React5.createElement(Select2.Portal, null, /* @__PURE__ */ React5.createElement(Select2.Content, null, /* @__PURE__ */ React5.createElement(Select2.Viewport, null, methods.map((method) => /* @__PURE__ */ React5.createElement(Select2.Option, {
909
- key: method,
910
- value: method
911
- }, method))))))));
913
+ var TriggerSpecWebhook = ({ spec }) => {
914
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
915
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
916
+ label: t("trigger method")
917
+ }, /* @__PURE__ */ React5.createElement(Select2.Root, {
918
+ value: spec.method,
919
+ onValueChange: (value) => spec.method = value
920
+ }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
921
+ placeholder: "type"
922
+ }), /* @__PURE__ */ React5.createElement(Select2.Portal, null, /* @__PURE__ */ React5.createElement(Select2.Content, null, /* @__PURE__ */ React5.createElement(Select2.Viewport, null, methods.map((method) => /* @__PURE__ */ React5.createElement(Select2.Option, {
923
+ key: method,
924
+ value: method
925
+ }, method))))))));
926
+ };
912
927
  var TriggerSpecWebsocket = ({ spec }) => {
928
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
913
929
  const handleChangeInit = (event) => {
914
930
  try {
915
931
  spec.init = JSON.parse(event.target.value);
@@ -917,7 +933,7 @@ var TriggerSpecWebsocket = ({ spec }) => {
917
933
  }
918
934
  };
919
935
  return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
920
- label: "Endpoint"
936
+ label: t("trigger method")
921
937
  }, /* @__PURE__ */ React5.createElement(Input3.TextInput, {
922
938
  value: spec.url,
923
939
  onChange: (event) => spec.url = event.target.value,
@@ -945,7 +961,7 @@ var TriggerSpec = ({ space, spec }) => {
945
961
  };
946
962
 
947
963
  // packages/plugins/experimental/plugin-automation/src/components/index.ts
948
- var PromptContainer = lazy(() => import("./PromptContainer-4VHFPEQH.mjs"));
964
+ var PromptContainer = lazy(() => import("./PromptContainer-5OK4GWIR.mjs"));
949
965
 
950
966
  // packages/plugins/experimental/plugin-automation/src/translations.ts
951
967
  var translations_default = [
@@ -960,7 +976,21 @@ var translations_default = [
960
976
  "command placeholder": "Enter slash command...",
961
977
  "template placeholder": "Enter template...",
962
978
  "value placeholder": "Enter value...",
963
- "select preset template placeholder": "Select preset"
979
+ "select preset template placeholder": "Select preset",
980
+ "open automation panel label": "Show Automations",
981
+ "function select label": "Function",
982
+ "function select placeholder": "Select function",
983
+ "function enabled": "Enabled",
984
+ "trigger select label": "Trigger",
985
+ "trigger select placeholder": "Trigger type",
986
+ "trigger type subscription": "Subscription",
987
+ "trigger type timer": "Timer",
988
+ "trigger type webhook": "Webhook",
989
+ "trigger type websocket": "Websocket",
990
+ "trigger filter": "Filter",
991
+ "trigger cron": "Cron",
992
+ "trigger method": "Method",
993
+ "trigger endpoint": "Endpoint"
964
994
  }
965
995
  }
966
996
  }
@@ -996,6 +1026,20 @@ var AutomationPlugin = () => {
996
1026
  FunctionTrigger2
997
1027
  ]
998
1028
  },
1029
+ complementary: {
1030
+ panels: [
1031
+ {
1032
+ id: "automation",
1033
+ label: [
1034
+ "open automation panel label",
1035
+ {
1036
+ ns: AUTOMATION_PLUGIN
1037
+ }
1038
+ ],
1039
+ icon: "ph--flow-arrow--regular"
1040
+ }
1041
+ ]
1042
+ },
999
1043
  graph: {
1000
1044
  builder: (plugins) => {
1001
1045
  const clientPlugin = resolvePlugin(plugins, parseClientPlugin);
@@ -1004,7 +1048,7 @@ var AutomationPlugin = () => {
1004
1048
  const client = clientPlugin?.provides.client;
1005
1049
  invariant2(resolve, void 0, {
1006
1050
  F: __dxlog_file4,
1007
- L: 46,
1051
+ L: 55,
1008
1052
  S: void 0,
1009
1053
  A: [
1010
1054
  "resolve",
@@ -1013,7 +1057,7 @@ var AutomationPlugin = () => {
1013
1057
  });
1014
1058
  invariant2(client, void 0, {
1015
1059
  F: __dxlog_file4,
1016
- L: 47,
1060
+ L: 56,
1017
1061
  S: void 0,
1018
1062
  A: [
1019
1063
  "client",
@@ -1029,7 +1073,7 @@ var AutomationPlugin = () => {
1029
1073
  return;
1030
1074
  }
1031
1075
  const type = "orphan-settings-for-subject";
1032
- const icon = "ph--magic-wand--regular";
1076
+ const icon = "ph--flow-arrow--regular";
1033
1077
  const [subjectId] = id.split("~");
1034
1078
  const { spaceId, objectId } = parseId(subjectId);
1035
1079
  const space = client.spaces.get().find((space2) => space2.id === spaceId);