@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,8 +1,8 @@
1
1
  import {
2
2
  PromptEditor
3
- } from "./chunk-PSSWFA6A.mjs";
4
- import "./chunk-GGA62V7D.mjs";
5
- import "./chunk-3TNRXJTD.mjs";
3
+ } from "./chunk-2FOJUVYG.mjs";
4
+ import "./chunk-J4SYTP4Y.mjs";
5
+ import "./chunk-PQLGYMNY.mjs";
6
6
 
7
7
  // packages/plugins/experimental/plugin-automation/src/components/PromptContainer.tsx
8
8
  import React from "react";
@@ -16,4 +16,4 @@ var PromptContainer_default = PromptContainer;
16
16
  export {
17
17
  PromptContainer_default as default
18
18
  };
19
- //# sourceMappingURL=PromptContainer-RFMJXMUA.mjs.map
19
+ //# sourceMappingURL=PromptContainer-3GUENQHE.mjs.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ChainInputType
3
- } from "./chunk-GGA62V7D.mjs";
3
+ } from "./chunk-J4SYTP4Y.mjs";
4
4
  import {
5
5
  AUTOMATION_PLUGIN
6
- } from "./chunk-3TNRXJTD.mjs";
6
+ } from "./chunk-PQLGYMNY.mjs";
7
7
 
8
8
  // packages/plugins/experimental/plugin-automation/src/components/PromptEditor/PromptEditor.tsx
9
9
  import React, { useEffect } from "react";
@@ -214,4 +214,4 @@ var PromptEditor = ({ prompt, commandEditable = true }) => {
214
214
  export {
215
215
  PromptEditor
216
216
  };
217
- //# sourceMappingURL=chunk-PSSWFA6A.mjs.map
217
+ //# sourceMappingURL=chunk-2FOJUVYG.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AUTOMATION_PLUGIN
3
- } from "./chunk-3TNRXJTD.mjs";
3
+ } from "./chunk-PQLGYMNY.mjs";
4
4
 
5
5
  // packages/plugins/experimental/plugin-automation/src/types/chain.ts
6
6
  import { ref, S, TypedObject } from "@dxos/echo-schema";
@@ -52,4 +52,4 @@ export {
52
52
  ChainType,
53
53
  AutomationAction
54
54
  };
55
- //# sourceMappingURL=chunk-GGA62V7D.mjs.map
55
+ //# sourceMappingURL=chunk-J4SYTP4Y.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
  }
@@ -4,11 +4,15 @@ var meta_default = {
4
4
  id: AUTOMATION_PLUGIN,
5
5
  name: "Automation",
6
6
  description: "Automation workflows.",
7
- icon: "ph--magic-wand--regular"
7
+ icon: "ph--flow-arrow--regular",
8
+ source: "https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation",
9
+ tags: [
10
+ "experimental"
11
+ ]
8
12
  };
9
13
 
10
14
  export {
11
15
  AUTOMATION_PLUGIN,
12
16
  meta_default
13
17
  };
14
- //# sourceMappingURL=chunk-3TNRXJTD.mjs.map
18
+ //# sourceMappingURL=chunk-PQLGYMNY.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,17 +1,17 @@
1
1
  import {
2
2
  PromptEditor
3
- } from "./chunk-PSSWFA6A.mjs";
3
+ } from "./chunk-2FOJUVYG.mjs";
4
4
  import {
5
5
  AutomationAction,
6
6
  ChainInputSchema,
7
7
  ChainInputType,
8
8
  ChainPromptType,
9
9
  ChainType
10
- } from "./chunk-GGA62V7D.mjs";
10
+ } from "./chunk-J4SYTP4Y.mjs";
11
11
  import {
12
12
  AUTOMATION_PLUGIN,
13
13
  meta_default
14
- } from "./chunk-3TNRXJTD.mjs";
14
+ } from "./chunk-PQLGYMNY.mjs";
15
15
 
16
16
  // packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx
17
17
  import React6 from "react";
@@ -316,7 +316,7 @@ import { log as log3 } from "@dxos/log";
316
316
  import { ScriptType } from "@dxos/plugin-script/types";
317
317
  import { useClient } from "@dxos/react-client";
318
318
  import { Filter as Filter2, useQuery } from "@dxos/react-client/echo";
319
- import { Input as Input3, Select as Select2 } from "@dxos/react-ui";
319
+ import { Input as Input3, Select as Select2, useTranslation as useTranslation2 } from "@dxos/react-ui";
320
320
  import { distinctBy } from "@dxos/util";
321
321
 
322
322
  // packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx
@@ -660,12 +660,19 @@ var triggerTypes = [
660
660
  ];
661
661
  var registerTriggersMutex = new Mutex();
662
662
  var TriggerEditor = ({ space, trigger }) => {
663
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
663
664
  const client = useClient();
664
665
  const scripts = useQuery(space, Filter2.schema(ScriptType));
665
666
  const script = useMemo(() => scripts.find((script2) => script2.id === trigger.function), [
666
667
  trigger.function,
667
668
  scripts
668
669
  ]);
670
+ const triggerLabels = {
671
+ subscription: t("trigger type subscription"),
672
+ timer: t("trigger type timer"),
673
+ webhook: t("trigger type webhook"),
674
+ websocket: t("trigger type websocket")
675
+ };
669
676
  const [registry] = useState(/* @__PURE__ */ new Map());
670
677
  const triggers = useQuery(space, Filter2.schema(FunctionTrigger));
671
678
  useEffect(() => {
@@ -674,11 +681,11 @@ var TriggerEditor = ({ space, trigger }) => {
674
681
  const deprecated = new Set(Array.from(registry.keys()));
675
682
  log3.info("triggers", {
676
683
  deprecated,
677
- all: triggers.map((t) => t.id),
678
- enabled: triggers.filter((t) => t.enabled).map((t) => t.id)
684
+ all: triggers.map((t2) => t2.id),
685
+ enabled: triggers.filter((t2) => t2.enabled).map((t2) => t2.id)
679
686
  }, {
680
687
  F: __dxlog_file3,
681
- L: 47,
688
+ L: 56,
682
689
  S: void 0,
683
690
  C: (f, a) => f(...a)
684
691
  });
@@ -690,13 +697,13 @@ var TriggerEditor = ({ space, trigger }) => {
690
697
  }
691
698
  log3.info("activating trigger", trigger2.id, {
692
699
  F: __dxlog_file3,
693
- L: 59,
700
+ L: 68,
694
701
  S: void 0,
695
702
  C: (f, a) => f(...a)
696
703
  });
697
704
  const ctx = new Context(void 0, {
698
705
  F: __dxlog_file3,
699
- L: 61
706
+ L: 70
700
707
  });
701
708
  registry.set(trigger2.id, ctx);
702
709
  const triggerSpec = trigger2.spec;
@@ -710,7 +717,7 @@ var TriggerEditor = ({ space, trigger }) => {
710
717
  type: triggerSpec.type
711
718
  }, {
712
719
  F: __dxlog_file3,
713
- L: 71,
720
+ L: 80,
714
721
  S: void 0,
715
722
  C: (f, a) => f(...a)
716
723
  });
@@ -741,7 +748,7 @@ var TriggerEditor = ({ space, trigger }) => {
741
748
  };
742
749
  }, []);
743
750
  useEffect(() => {
744
- void space.db.schema.list().then((schemas) => {
751
+ void space.db.schemaRegistry.query().then((schemas) => {
745
752
  state.schemas = distinctBy([
746
753
  ...state.schemas,
747
754
  ...schemas
@@ -822,34 +829,35 @@ var TriggerEditor = ({ space, trigger }) => {
822
829
  }, /* @__PURE__ */ React5.createElement("table", {
823
830
  className: "is-full table-fixed"
824
831
  }, /* @__PURE__ */ React5.createElement("tbody", null, /* @__PURE__ */ React5.createElement(InputRow, {
825
- label: "Function"
832
+ label: t("function select label")
826
833
  }, /* @__PURE__ */ React5.createElement(Select2.Root, {
827
834
  value: script?.id,
828
835
  onValueChange: handleSelectFunction
829
836
  }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
830
- placeholder: "Select function"
837
+ classNames: "w-full",
838
+ placeholder: t("function select placeholder")
831
839
  }), /* @__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, {
832
840
  key: id,
833
841
  value: id
834
- }, name ?? "Unnamed"))))))), script?.description?.length && /* @__PURE__ */ React5.createElement(InputRow, null, /* @__PURE__ */ React5.createElement("div", {
842
+ }, name ?? id))))))), script?.description?.length && /* @__PURE__ */ React5.createElement(InputRow, null, /* @__PURE__ */ React5.createElement("div", {
835
843
  className: "px-2"
836
844
  }, /* @__PURE__ */ React5.createElement("p", {
837
845
  className: "text-sm text-description"
838
846
  }, script?.description?.length))), /* @__PURE__ */ React5.createElement(InputRow, {
839
- label: "Type"
847
+ label: t("trigger select label")
840
848
  }, /* @__PURE__ */ React5.createElement(Select2.Root, {
841
849
  value: trigger.spec?.type,
842
850
  onValueChange: handleSelectTriggerType
843
851
  }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
844
- placeholder: "Select trigger"
852
+ placeholder: t("trigger select placeholder")
845
853
  }), /* @__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, {
846
854
  key: trigger2,
847
855
  value: trigger2
848
- }, trigger2)))))))), /* @__PURE__ */ React5.createElement("tbody", null, trigger.spec && /* @__PURE__ */ React5.createElement(TriggerSpec, {
856
+ }, triggerLabels[trigger2])))))))), /* @__PURE__ */ React5.createElement("tbody", null, trigger.spec && /* @__PURE__ */ React5.createElement(TriggerSpec, {
849
857
  space,
850
858
  spec: trigger.spec
851
859
  }), /* @__PURE__ */ React5.createElement(InputRow, {
852
- label: "Enabled"
860
+ label: t("function enabled")
853
861
  }, /* @__PURE__ */ React5.createElement("div", {
854
862
  className: "flex items-center h-8"
855
863
  }, /* @__PURE__ */ React5.createElement(Input3.Switch, {
@@ -864,10 +872,11 @@ var TriggerEditor = ({ space, trigger }) => {
864
872
  }))));
865
873
  };
866
874
  var TriggerSpecSubscription = ({ spec }) => {
875
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
867
876
  if (!spec.filter) {
868
877
  return null;
869
878
  }
870
- const handleSelectSchema = (typename) => {
879
+ const handleValueChange = (typename) => {
871
880
  spec.filter = [
872
881
  {
873
882
  type: typename
@@ -875,10 +884,10 @@ var TriggerSpecSubscription = ({ spec }) => {
875
884
  ];
876
885
  };
877
886
  return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
878
- label: "Filter"
887
+ label: t("trigger filter")
879
888
  }, /* @__PURE__ */ React5.createElement(Select2.Root, {
880
889
  value: spec.filter.length > 0 ? spec.filter[0].type : void 0,
881
- onValueChange: handleSelectSchema
890
+ onValueChange: handleValueChange
882
891
  }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
883
892
  classNames: "w-full",
884
893
  placeholder: "Select type"
@@ -887,28 +896,35 @@ var TriggerSpecSubscription = ({ spec }) => {
887
896
  value: typename
888
897
  }, typename))))))));
889
898
  };
890
- var TriggerSpecTimer = ({ spec }) => /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
891
- label: "Cron"
892
- }, /* @__PURE__ */ React5.createElement(Input3.TextInput, {
893
- value: spec.cron,
894
- onChange: (event) => spec.cron = event.target.value
895
- })));
899
+ var TriggerSpecTimer = ({ spec }) => {
900
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
901
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
902
+ label: t("trigger cron")
903
+ }, /* @__PURE__ */ React5.createElement(Input3.TextInput, {
904
+ value: spec.cron,
905
+ onChange: (event) => spec.cron = event.target.value
906
+ })));
907
+ };
896
908
  var methods = [
897
909
  "GET",
898
910
  "POST"
899
911
  ];
900
- var TriggerSpecWebhook = ({ spec }) => /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
901
- label: "Method"
902
- }, /* @__PURE__ */ React5.createElement(Select2.Root, {
903
- value: spec.method,
904
- onValueChange: (value) => spec.method = value
905
- }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
906
- placeholder: "type"
907
- }), /* @__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, {
908
- key: method,
909
- value: method
910
- }, method))))))));
912
+ var TriggerSpecWebhook = ({ spec }) => {
913
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
914
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
915
+ label: t("trigger method")
916
+ }, /* @__PURE__ */ React5.createElement(Select2.Root, {
917
+ value: spec.method,
918
+ onValueChange: (value) => spec.method = value
919
+ }, /* @__PURE__ */ React5.createElement(Select2.TriggerButton, {
920
+ placeholder: "type"
921
+ }), /* @__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, {
922
+ key: method,
923
+ value: method
924
+ }, method))))))));
925
+ };
911
926
  var TriggerSpecWebsocket = ({ spec }) => {
927
+ const { t } = useTranslation2(AUTOMATION_PLUGIN);
912
928
  const handleChangeInit = (event) => {
913
929
  try {
914
930
  spec.init = JSON.parse(event.target.value);
@@ -916,7 +932,7 @@ var TriggerSpecWebsocket = ({ spec }) => {
916
932
  }
917
933
  };
918
934
  return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(InputRow, {
919
- label: "Endpoint"
935
+ label: t("trigger method")
920
936
  }, /* @__PURE__ */ React5.createElement(Input3.TextInput, {
921
937
  value: spec.url,
922
938
  onChange: (event) => spec.url = event.target.value,
@@ -944,7 +960,7 @@ var TriggerSpec = ({ space, spec }) => {
944
960
  };
945
961
 
946
962
  // packages/plugins/experimental/plugin-automation/src/components/index.ts
947
- var PromptContainer = lazy(() => import("./PromptContainer-RFMJXMUA.mjs"));
963
+ var PromptContainer = lazy(() => import("./PromptContainer-3GUENQHE.mjs"));
948
964
 
949
965
  // packages/plugins/experimental/plugin-automation/src/translations.ts
950
966
  var translations_default = [
@@ -959,7 +975,21 @@ var translations_default = [
959
975
  "command placeholder": "Enter slash command...",
960
976
  "template placeholder": "Enter template...",
961
977
  "value placeholder": "Enter value...",
962
- "select preset template placeholder": "Select preset"
978
+ "select preset template placeholder": "Select preset",
979
+ "open automation panel label": "Show Automations",
980
+ "function select label": "Function",
981
+ "function select placeholder": "Select function",
982
+ "function enabled": "Enabled",
983
+ "trigger select label": "Trigger",
984
+ "trigger select placeholder": "Trigger type",
985
+ "trigger type subscription": "Subscription",
986
+ "trigger type timer": "Timer",
987
+ "trigger type webhook": "Webhook",
988
+ "trigger type websocket": "Websocket",
989
+ "trigger filter": "Filter",
990
+ "trigger cron": "Cron",
991
+ "trigger method": "Method",
992
+ "trigger endpoint": "Endpoint"
963
993
  }
964
994
  }
965
995
  }
@@ -995,6 +1025,20 @@ var AutomationPlugin = () => {
995
1025
  FunctionTrigger2
996
1026
  ]
997
1027
  },
1028
+ complementary: {
1029
+ panels: [
1030
+ {
1031
+ id: "automation",
1032
+ label: [
1033
+ "open automation panel label",
1034
+ {
1035
+ ns: AUTOMATION_PLUGIN
1036
+ }
1037
+ ],
1038
+ icon: "ph--flow-arrow--regular"
1039
+ }
1040
+ ]
1041
+ },
998
1042
  graph: {
999
1043
  builder: (plugins) => {
1000
1044
  const clientPlugin = resolvePlugin(plugins, parseClientPlugin);
@@ -1003,7 +1047,7 @@ var AutomationPlugin = () => {
1003
1047
  const client = clientPlugin?.provides.client;
1004
1048
  invariant2(resolve, void 0, {
1005
1049
  F: __dxlog_file4,
1006
- L: 46,
1050
+ L: 55,
1007
1051
  S: void 0,
1008
1052
  A: [
1009
1053
  "resolve",
@@ -1012,7 +1056,7 @@ var AutomationPlugin = () => {
1012
1056
  });
1013
1057
  invariant2(client, void 0, {
1014
1058
  F: __dxlog_file4,
1015
- L: 47,
1059
+ L: 56,
1016
1060
  S: void 0,
1017
1061
  A: [
1018
1062
  "client",
@@ -1028,7 +1072,7 @@ var AutomationPlugin = () => {
1028
1072
  return;
1029
1073
  }
1030
1074
  const type = "orphan-settings-for-subject";
1031
- const icon = "ph--magic-wand--regular";
1075
+ const icon = "ph--flow-arrow--regular";
1032
1076
  const [subjectId] = id.split("~");
1033
1077
  const { spaceId, objectId } = parseId(subjectId);
1034
1078
  const space = client.spaces.get().find((space2) => space2.id === spaceId);