@dxos/plugin-automation 0.7.5-main.9d26e3a → 0.7.5-main.e9bb01b

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 (108) hide show
  1. package/dist/lib/browser/{AssistantPanel-32FH2RA6.mjs → AssistantPanel-NTOUHOWA.mjs} +3 -3
  2. package/dist/lib/browser/{AssistantPanel-32FH2RA6.mjs.map → AssistantPanel-NTOUHOWA.mjs.map} +2 -2
  3. package/dist/lib/browser/AutomationPanel-KT3YFV56.mjs +231 -0
  4. package/dist/lib/browser/AutomationPanel-KT3YFV56.mjs.map +7 -0
  5. package/dist/lib/browser/app-graph-builder-6FSMLMT4.mjs +131 -0
  6. package/dist/lib/browser/app-graph-builder-6FSMLMT4.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-4ODBJDXM.mjs +10 -0
  8. package/dist/lib/browser/chunk-4ODBJDXM.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-DN5M2QL5.mjs → chunk-DL6LB2NI.mjs} +2 -8
  10. package/dist/lib/browser/{chunk-DN5M2QL5.mjs.map → chunk-DL6LB2NI.mjs.map} +4 -4
  11. package/dist/lib/browser/{chunk-X5KMOH3I.mjs → chunk-DQ7ZSYJJ.mjs} +4 -4
  12. package/dist/lib/browser/chunk-DQ7ZSYJJ.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +89 -236
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/react-surface-5YTE5MRE.mjs +34 -0
  17. package/dist/lib/browser/react-surface-5YTE5MRE.mjs.map +7 -0
  18. package/dist/lib/browser/types/index.mjs +1 -3
  19. package/dist/lib/node/{AssistantPanel-XANI7YNV.cjs → AssistantPanel-U7GDWPRC.cjs} +7 -7
  20. package/dist/lib/node/{AssistantPanel-XANI7YNV.cjs.map → AssistantPanel-U7GDWPRC.cjs.map} +2 -2
  21. package/dist/lib/node/{AutomationPanel-VADY3HMP.cjs → AutomationPanel-H5WE4FIU.cjs} +112 -32
  22. package/dist/lib/node/AutomationPanel-H5WE4FIU.cjs.map +7 -0
  23. package/dist/lib/node/app-graph-builder-65TBXO3I.cjs +147 -0
  24. package/dist/lib/node/app-graph-builder-65TBXO3I.cjs.map +7 -0
  25. package/dist/lib/node/{chunk-NIL4TP6U.cjs → chunk-JNDMZQH7.cjs} +4 -9
  26. package/dist/lib/node/chunk-JNDMZQH7.cjs.map +7 -0
  27. package/dist/lib/node/chunk-JUSXT4U5.cjs +43 -0
  28. package/dist/lib/node/chunk-JUSXT4U5.cjs.map +7 -0
  29. package/dist/lib/node/{chunk-DTJ7XVO2.cjs → chunk-TQEDPRY5.cjs} +8 -8
  30. package/dist/lib/node/chunk-TQEDPRY5.cjs.map +7 -0
  31. package/dist/lib/node/index.cjs +112 -258
  32. package/dist/lib/node/index.cjs.map +4 -4
  33. package/dist/lib/node/meta.json +1 -1
  34. package/dist/lib/node/react-surface-S6U5ISJ6.cjs +57 -0
  35. package/dist/lib/node/react-surface-S6U5ISJ6.cjs.map +7 -0
  36. package/dist/lib/node/types/index.cjs +5 -7
  37. package/dist/lib/node/types/index.cjs.map +2 -2
  38. package/dist/lib/node-esm/{AssistantPanel-5M6O6JV7.mjs → AssistantPanel-M67P24GS.mjs} +3 -3
  39. package/dist/lib/node-esm/{AssistantPanel-5M6O6JV7.mjs.map → AssistantPanel-M67P24GS.mjs.map} +2 -2
  40. package/dist/lib/node-esm/AutomationPanel-MW42U6I4.mjs +232 -0
  41. package/dist/lib/node-esm/AutomationPanel-MW42U6I4.mjs.map +7 -0
  42. package/dist/lib/node-esm/app-graph-builder-4SD4F3KN.mjs +132 -0
  43. package/dist/lib/node-esm/app-graph-builder-4SD4F3KN.mjs.map +7 -0
  44. package/dist/lib/node-esm/{chunk-GCHXTXVT.mjs → chunk-GIAYUM5I.mjs} +2 -8
  45. package/dist/lib/node-esm/{chunk-GCHXTXVT.mjs.map → chunk-GIAYUM5I.mjs.map} +4 -4
  46. package/dist/lib/node-esm/{chunk-HNOBZHWK.mjs → chunk-JFHI22MF.mjs} +4 -4
  47. package/dist/lib/node-esm/chunk-JFHI22MF.mjs.map +7 -0
  48. package/dist/lib/node-esm/chunk-XVIEXSEZ.mjs +12 -0
  49. package/dist/lib/node-esm/chunk-XVIEXSEZ.mjs.map +7 -0
  50. package/dist/lib/node-esm/index.mjs +89 -236
  51. package/dist/lib/node-esm/index.mjs.map +4 -4
  52. package/dist/lib/node-esm/meta.json +1 -1
  53. package/dist/lib/node-esm/react-surface-RWTR3TKT.mjs +35 -0
  54. package/dist/lib/node-esm/react-surface-RWTR3TKT.mjs.map +7 -0
  55. package/dist/lib/node-esm/types/index.mjs +1 -3
  56. package/dist/types/src/AutomationPlugin.d.ts +1 -3
  57. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/app-graph-builder.d.ts +180 -0
  59. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  60. package/dist/types/src/capabilities/index.d.ts +179 -0
  61. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  62. package/dist/types/src/capabilities/react-surface.d.ts +4 -0
  63. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  64. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  65. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  66. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -2
  67. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  68. package/dist/types/src/components/index.d.ts +1 -1
  69. package/dist/types/src/components/index.d.ts.map +1 -1
  70. package/dist/types/src/index.d.ts +1 -2
  71. package/dist/types/src/index.d.ts.map +1 -1
  72. package/dist/types/src/meta.d.ts +1 -2
  73. package/dist/types/src/meta.d.ts.map +1 -1
  74. package/dist/types/src/translations.d.ts +7 -0
  75. package/dist/types/src/translations.d.ts.map +1 -1
  76. package/dist/types/src/types/index.d.ts +0 -1
  77. package/dist/types/src/types/index.d.ts.map +1 -1
  78. package/dist/types/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +38 -46
  80. package/src/AutomationPlugin.tsx +55 -193
  81. package/src/capabilities/app-graph-builder.ts +127 -0
  82. package/src/capabilities/index.ts +8 -0
  83. package/src/capabilities/react-surface.tsx +27 -0
  84. package/src/components/AssistantPanel/AssistantPanel.tsx +1 -4
  85. package/src/components/AutomationPanel/AutomationPanel.tsx +54 -37
  86. package/src/components/TriggerEditor/TriggerEditor.tsx +65 -8
  87. package/src/index.ts +1 -4
  88. package/src/meta.ts +3 -2
  89. package/src/translations.ts +9 -0
  90. package/src/types/index.ts +0 -1
  91. package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs +0 -151
  92. package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs.map +0 -7
  93. package/dist/lib/browser/chunk-X5KMOH3I.mjs.map +0 -7
  94. package/dist/lib/browser/meta.mjs +0 -9
  95. package/dist/lib/browser/meta.mjs.map +0 -7
  96. package/dist/lib/node/AutomationPanel-VADY3HMP.cjs.map +0 -7
  97. package/dist/lib/node/chunk-DTJ7XVO2.cjs.map +0 -7
  98. package/dist/lib/node/chunk-NIL4TP6U.cjs.map +0 -7
  99. package/dist/lib/node/meta.cjs +0 -30
  100. package/dist/lib/node/meta.cjs.map +0 -7
  101. package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs +0 -152
  102. package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs.map +0 -7
  103. package/dist/lib/node-esm/chunk-HNOBZHWK.mjs.map +0 -7
  104. package/dist/lib/node-esm/meta.mjs +0 -10
  105. package/dist/lib/node-esm/meta.mjs.map +0 -7
  106. package/dist/types/src/types/types.d.ts +0 -7
  107. package/dist/types/src/types/types.d.ts.map +0 -1
  108. package/src/types/types.ts +0 -27
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/AutomationPanel/AutomationPanel.tsx", "../../../src/components/TriggerEditor/TriggerEditor.tsx", "../../../src/components/AutomationPanel/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { S } from '@dxos/echo-schema';\nimport {\n FunctionType,\n FunctionTrigger,\n FunctionTriggerSchema,\n TriggerKind,\n type FunctionTriggerType,\n ScriptType,\n} from '@dxos/functions';\nimport { type Client, useClient } from '@dxos/react-client';\nimport { create, Filter, useQuery, type Space, type ReactiveObject, getSpace } from '@dxos/react-client/echo';\nimport { IconButton, Input, useTranslation, Button } from '@dxos/react-ui';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\nimport { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';\n\nconst grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';\n\nexport type AutomationPanelProps = {\n space: Space;\n object?: ReactiveObject<any>;\n};\n\n// TODO(burdon): Factor out common layout with ViewEditor.\nexport const AutomationPanel = ({ space, object }: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const client = useClient();\n const triggers = useQuery(space, Filter.schema(FunctionTrigger));\n const functions = useQuery(space, Filter.schema(FunctionType));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const [trigger, setTrigger] = useState<FunctionTriggerType>();\n const [selected, setSelected] = useState<FunctionTrigger>();\n\n const handleSelect = (trigger: FunctionTrigger) => {\n const { id: _, ...values } = trigger;\n setTrigger(values);\n setSelected(trigger);\n };\n\n const handleAdd = () => {\n setTrigger(create(FunctionTriggerSchema, { meta: {} }));\n setSelected(undefined);\n };\n\n const handleDelete = (trigger: FunctionTrigger) => {\n space.db.remove(trigger);\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleSave: TriggerEditorProps['onSave'] = (trigger) => {\n if (selected) {\n Object.assign(selected, trigger);\n } else {\n space.db.add(create(FunctionTrigger, trigger));\n }\n\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleCancel: TriggerEditorProps['onCancel'] = () => {\n setTrigger(undefined);\n };\n\n return (\n <div className='flex flex-col w-full divide-y divide-separator overflow-y-auto'>\n <List.Root<FunctionTrigger> items={triggers} isItem={S.is(FunctionTrigger)} getId={(field) => field.id}>\n {({ items: triggers }) => (\n <div role='list' className='flex flex-col w-full'>\n {triggers?.map((trigger) => {\n const copyAction = getCopyAction(client, trigger);\n return (\n <List.Item<FunctionTrigger>\n key={trigger.id}\n item={trigger}\n classNames={mx(grid, ghostHover, 'items-center', 'px-2')}\n >\n <Input.Root>\n <Input.Switch\n checked={trigger.enabled}\n onCheckedChange={(checked) => (trigger.enabled = checked)}\n />\n </Input.Root>\n\n <div className={'flex'}>\n <List.ItemTitle\n classNames='px-1 cursor-pointer w-0 shrink truncate'\n onClick={() => handleSelect(trigger)}\n >\n {getFunctionName(scripts, functions, trigger) ?? '∅'}\n </List.ItemTitle>\n\n {/* TODO: a better way to expose copy action */}\n {copyAction && (\n <Button onClick={() => navigator.clipboard.writeText(copyAction.contentProvider())}>\n {t(copyAction.translationKey)}\n </Button>\n )}\n </div>\n\n <List.ItemDeleteButton onClick={() => handleDelete(trigger)} />\n </List.Item>\n );\n })}\n </div>\n )}\n </List.Root>\n\n {trigger && <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />}\n\n {!trigger && (\n <div className='flex p-2 justify-center'>\n <IconButton icon='ph--plus--regular' label={t('new trigger')} onClick={handleAdd} />\n </div>\n )}\n </div>\n );\n};\n\nconst getCopyAction = (client: Client, trigger: FunctionTrigger | undefined) => {\n if (trigger?.spec?.type === TriggerKind.Email) {\n return { translationKey: 'trigger copy email', contentProvider: () => `${getSpace(trigger)!.id}@dxos.network` };\n }\n\n if (trigger?.spec?.type === TriggerKind.Webhook) {\n return { translationKey: 'trigger copy url', contentProvider: () => getWebhookUrl(client, trigger) };\n }\n\n return undefined;\n};\n\nconst getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {\n const spaceId = getSpace(trigger)!.id;\n const edgeUrl = new URL(client.config.values.runtime!.services!.edge!.url!);\n const isSecure = edgeUrl.protocol.startsWith('https') || edgeUrl.protocol.startsWith('wss');\n edgeUrl.protocol = isSecure ? 'https' : 'http';\n return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();\n};\n\nconst getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTriggerType) => {\n const shortId = trigger.function && `${trigger.function?.slice(0, 16)}…`;\n const functionObject = functions.find((fn) => fn.name === trigger.function);\n if (!functionObject) {\n return shortId;\n }\n return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport {\n FunctionType,\n FunctionTriggerSchema,\n type FunctionTriggerType,\n type FunctionTrigger,\n ScriptType,\n TriggerKind,\n} from '@dxos/functions';\nimport { Filter, useQuery, type Space } from '@dxos/react-client/echo';\nimport { IconButton, Input, useTranslation } from '@dxos/react-ui';\nimport { Form, SelectInput, TextInput } from '@dxos/react-ui-form';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nexport type TriggerEditorProps = {\n space: Space;\n trigger: FunctionTriggerType;\n onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;\n onCancel?: () => void;\n};\n\nexport const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n const functions = useQuery(space, Filter.schema(FunctionType));\n const scripts = useQuery(space, Filter.schema(ScriptType));\n\n const handleSave = (values: FunctionTriggerType) => {\n onSave?.(values);\n };\n\n return (\n <Form<FunctionTriggerType>\n schema={FunctionTriggerSchema}\n values={trigger}\n onSave={handleSave}\n onCancel={onCancel}\n Custom={{\n ['function' satisfies keyof FunctionTriggerType]: (props) => (\n <SelectInput\n {...props}\n options={functions.map((fn) => ({\n value: fn.name,\n label: getFunctionName(scripts, fn),\n }))}\n />\n ),\n ['spec.type' as const]: (props) => (\n <SelectInput\n {...props}\n options={Object.values(TriggerKind).map((kind) => ({\n value: kind,\n label: t(`trigger type ${kind}`),\n }))}\n />\n ),\n ['meta' as const]: (props) => {\n const meta = props.getValue()!;\n\n const [newMetaFieldName, setNewMetaFieldName] = useState('');\n\n React.useEffect(() => props.onValueChange('object', { ...meta }), []);\n\n return (\n <>\n <div>{props.label}</div>\n {[...Object.keys(meta)].map((key) => {\n const compositeKey: any = `meta.${key}`;\n return (\n <div key={compositeKey} role='none' className='flex items-center mt-2 gap-1'>\n <div role='none' className='flex-1'>\n <TextInput {...props} type={'string'} label={key} />\n </div>\n <IconButton\n icon='ph--trash--regular'\n iconOnly\n classNames={'mt-6'}\n label={t('trigger meta remove')}\n onClick={() => {\n const newValues: any = { ...props.getValue() };\n delete newValues[key];\n props.onValueChange('object', newValues);\n }}\n />\n </div>\n );\n })}\n <div role='none' className='flex items-center mt-2 gap-1 plb-1'>\n <div role='none' className='flex-1'>\n <Input.Root>\n <Input.TextInput\n placeholder={t('trigger meta prop name placeholder')}\n value={newMetaFieldName}\n onChange={(event) => setNewMetaFieldName(event.target.value)}\n />\n </Input.Root>\n </div>\n <IconButton\n icon='ph--plus--regular'\n iconOnly\n label={t('trigger meta add')}\n onClick={() => {\n if (newMetaFieldName.length) {\n const meta = props.getValue() ?? {};\n const metaWithNewProp = { ...meta, [newMetaFieldName]: '' };\n setNewMetaFieldName('');\n props.onValueChange('object', metaWithNewProp);\n }\n }}\n />\n </div>\n </>\n );\n },\n }}\n />\n );\n};\n\nconst getFunctionName = (scripts: ScriptType[], fn: FunctionType) => {\n return scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AutomationPanel } from './AutomationPanel';\n\nexport default AutomationPanel;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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,IAAI,YAAYF,OAAAA,IAAWnH,QAAQ+D,EAAE,IAAIqD,OAAAA,EAASU,SAAQ;AACvE;AAEA,IAAMnG,mBAAkB,CAAChB,SAAuBL,WAA2BN,YAAAA;AACzE,QAAM+H,UAAU/H,QAAQgI,YAAY,GAAGhI,QAAQgI,UAAUC,MAAM,GAAG,EAAA,CAAA;AAClE,QAAMC,iBAAiB5H,UAAUsD,KAAK,CAACrC,OAAOA,GAAGE,SAASzB,QAAQgI,QAAQ;AAC1E,MAAI,CAACE,gBAAgB;AACnB,WAAOH;EACT;AACA,SAAOpH,QAAQiD,KAAK,CAACC,MAAMqE,eAAepE,QAAQL,QAAQM,OAAOF,EAAEE,EAAE,GAAGtC,QAAQsG;AAClF;AEtJA,IAAA,0BAAe9D;",
6
+ "names": ["import_react", "import_functions", "import_echo", "import_react_ui", "TriggerEditor", "space", "trigger", "onSave", "onCancel", "t", "useTranslation", "AUTOMATION_PLUGIN", "functions", "useQuery", "Filter", "schema", "FunctionType", "scripts", "ScriptType", "handleSave", "values", "React", "Form", "FunctionTriggerSchema", "Custom", "props", "SelectInput", "options", "map", "fn", "value", "name", "label", "getFunctionName", "Object", "TriggerKind", "kind", "meta", "getValue", "newMetaFieldName", "setNewMetaFieldName", "useState", "useEffect", "onValueChange", "div", "keys", "key", "compositeKey", "role", "className", "TextInput", "type", "IconButton", "icon", "iconOnly", "classNames", "onClick", "newValues", "Input", "Root", "placeholder", "onChange", "event", "target", "length", "metaWithNewProp", "find", "s", "source", "id", "grid", "AutomationPanel", "object", "client", "useClient", "triggers", "FunctionTrigger", "setTrigger", "selected", "setSelected", "handleSelect", "_", "handleAdd", "create", "undefined", "handleDelete", "db", "remove", "assign", "add", "handleCancel", "List", "items", "isItem", "S", "is", "getId", "field", "copyAction", "getCopyAction", "Item", "item", "mx", "ghostHover", "Switch", "checked", "enabled", "onCheckedChange", "ItemTitle", "Button", "navigator", "clipboard", "writeText", "contentProvider", "translationKey", "ItemDeleteButton", "spec", "Email", "getSpace", "Webhook", "getWebhookUrl", "spaceId", "edgeUrl", "URL", "config", "runtime", "services", "edge", "url", "isSecure", "protocol", "startsWith", "toString", "shortId", "function", "slice", "functionObject"]
7
+ }
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var app_graph_builder_65TBXO3I_exports = {};
20
+ __export(app_graph_builder_65TBXO3I_exports, {
21
+ default: () => app_graph_builder_default
22
+ });
23
+ module.exports = __toCommonJS(app_graph_builder_65TBXO3I_exports);
24
+ var import_chunk_TQEDPRY5 = require("./chunk-TQEDPRY5.cjs");
25
+ var import_app_framework = require("@dxos/app-framework");
26
+ var import_plugin_client = require("@dxos/plugin-client");
27
+ var import_plugin_graph = require("@dxos/plugin-graph");
28
+ var import_plugin_space = require("@dxos/plugin-space");
29
+ var import_echo = require("@dxos/react-client/echo");
30
+ var app_graph_builder_default = (context) => {
31
+ const resolve = (typename) => context.requestCapabilities(import_app_framework.Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
32
+ return (0, import_app_framework.contributes)(import_app_framework.Capabilities.AppGraphBuilder, [
33
+ (0, import_plugin_graph.createExtension)({
34
+ id: `${import_chunk_TQEDPRY5.AUTOMATION_PLUGIN}/automation-for-subject`,
35
+ resolver: ({ id }) => {
36
+ if (!id.endsWith("~automation")) {
37
+ return;
38
+ }
39
+ const type = "orphan-settings-for-subject";
40
+ const icon = "ph--magic-wand--regular";
41
+ const client = context.requestCapability(import_plugin_client.ClientCapabilities.Client);
42
+ const [subjectId] = id.split("~");
43
+ const { spaceId, objectId } = (0, import_echo.parseId)(subjectId);
44
+ const spaces = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
45
+ const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === import_echo.SpaceState.SPACE_READY);
46
+ if (!objectId) {
47
+ const label2 = space ? space.properties.name || [
48
+ "unnamed space label",
49
+ {
50
+ ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
51
+ }
52
+ ] : [
53
+ "unnamed object settings label",
54
+ {
55
+ ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
56
+ }
57
+ ];
58
+ return {
59
+ id,
60
+ type,
61
+ data: null,
62
+ properties: {
63
+ icon,
64
+ label: label2,
65
+ showResolvedThreads: false,
66
+ object: null,
67
+ space
68
+ }
69
+ };
70
+ }
71
+ const [object] = (0, import_plugin_space.memoizeQuery)(space, {
72
+ id: objectId
73
+ });
74
+ if (!object || !subjectId) {
75
+ return;
76
+ }
77
+ const meta = resolve((0, import_echo.getTypename)(object) ?? "");
78
+ const label = meta.label?.(object) || object.name || meta.placeholder || [
79
+ "unnamed object settings label",
80
+ {
81
+ ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
82
+ }
83
+ ];
84
+ return {
85
+ id,
86
+ type,
87
+ data: null,
88
+ properties: {
89
+ icon,
90
+ label,
91
+ object
92
+ }
93
+ };
94
+ }
95
+ }),
96
+ (0, import_plugin_graph.createExtension)({
97
+ id: `${import_chunk_TQEDPRY5.AUTOMATION_PLUGIN}/assistant-for-subject`,
98
+ resolver: ({ id }) => {
99
+ if (!id.endsWith("~assistant")) {
100
+ return;
101
+ }
102
+ const client = context.requestCapability(import_plugin_client.ClientCapabilities.Client);
103
+ const [subjectId] = id.split("~");
104
+ const { spaceId, objectId } = (0, import_echo.parseId)(subjectId);
105
+ const spaces = (0, import_plugin_graph.toSignal)((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
106
+ const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === import_echo.SpaceState.SPACE_READY);
107
+ if (!objectId) {
108
+ return {
109
+ id,
110
+ type: "orphan-automation-for-subject",
111
+ data: null,
112
+ properties: {
113
+ icon: "ph--atom--regular",
114
+ label: [
115
+ "assistant panel label",
116
+ {
117
+ ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
118
+ }
119
+ ],
120
+ object: null,
121
+ space
122
+ }
123
+ };
124
+ }
125
+ const [object] = (0, import_plugin_space.memoizeQuery)(space, {
126
+ id: objectId
127
+ });
128
+ return {
129
+ id,
130
+ type: "orphan-automation-for-subject",
131
+ data: null,
132
+ properties: {
133
+ icon: "ph--atom--regular",
134
+ label: [
135
+ "assistant panel label",
136
+ {
137
+ ns: import_chunk_TQEDPRY5.AUTOMATION_PLUGIN
138
+ }
139
+ ],
140
+ object
141
+ }
142
+ };
143
+ }
144
+ })
145
+ ]);
146
+ };
147
+ //# sourceMappingURL=app-graph-builder-65TBXO3I.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { createExtension, toSignal } from '@dxos/plugin-graph';\nimport { memoizeQuery } from '@dxos/plugin-space';\nimport { getTypename, parseId, SpaceState } from '@dxos/react-client/echo';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport default (context: PluginsContext) => {\n const resolve = (typename: string) =>\n context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};\n\n return contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${AUTOMATION_PLUGIN}/automation-for-subject`,\n resolver: ({ id }) => {\n if (!id.endsWith('~automation')) {\n return;\n }\n\n const type = 'orphan-settings-for-subject';\n const icon = 'ph--magic-wand--regular';\n\n const client = context.requestCapability(ClientCapabilities.Client);\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const spaces = toSignal(\n (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,\n () => client.spaces.get(),\n );\n const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);\n if (!objectId) {\n // TODO(burdon): Ref SPACE_PLUGIN ns.\n const label = space\n ? space.properties.name || ['unnamed space label', { ns: AUTOMATION_PLUGIN }]\n : ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];\n\n // TODO(wittjosiah): Support comments for arbitrary subjects.\n // This is to ensure that the comments panel is not stuck on an old object.\n return {\n id,\n type,\n data: null,\n properties: {\n icon,\n label,\n showResolvedThreads: false,\n object: null,\n space,\n },\n };\n }\n\n const [object] = memoizeQuery(space, { id: objectId });\n if (!object || !subjectId) {\n return;\n }\n\n const meta = resolve(getTypename(object) ?? '');\n const label = meta.label?.(object) ||\n object.name ||\n meta.placeholder || ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];\n\n return {\n id,\n type,\n data: null,\n properties: {\n icon,\n label,\n object,\n },\n };\n },\n }),\n createExtension({\n id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,\n resolver: ({ id }) => {\n // TODO(Zan): Find util (or make one). Effect schema!!\n if (!id.endsWith('~assistant')) {\n return;\n }\n\n const client = context.requestCapability(ClientCapabilities.Client);\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const spaces = toSignal(\n (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,\n () => client.spaces.get(),\n );\n const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);\n if (!objectId) {\n // TODO(wittjosiah): Support assistant for arbitrary subjects.\n // This is to ensure that the assistant panel is not stuck on an old object.\n return {\n id,\n type: 'orphan-automation-for-subject',\n data: null,\n properties: {\n icon: 'ph--atom--regular',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n object: null,\n space,\n },\n };\n }\n\n const [object] = memoizeQuery(space, { id: objectId });\n\n return {\n id,\n type: 'orphan-automation-for-subject',\n data: null,\n properties: {\n icon: 'ph--atom--regular',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n object,\n },\n };\n },\n }),\n ]);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA+D;AAC/D,2BAAmC;AACnC,0BAA0C;AAC1C,0BAA6B;AAC7B,kBAAiD;AAIjD,IAAA,4BAAe,CAACA,YAAAA;AACd,QAAMC,UAAU,CAACC,aACfF,QAAQG,oBAAoBC,kCAAaC,QAAQ,EAAEC,KAAK,CAAC,EAAEC,GAAE,MAAOA,OAAOL,QAAAA,GAAWM,YAAY,CAAC;AAErG,aAAOC,kCAAYL,kCAAaM,iBAAiB;QAC/CC,qCAAgB;MACdJ,IAAI,GAAGK,uCAAAA;MACPC,UAAU,CAAC,EAAEN,GAAE,MAAE;AACf,YAAI,CAACA,GAAGO,SAAS,aAAA,GAAgB;AAC/B;QACF;AAEA,cAAMC,OAAO;AACb,cAAMC,OAAO;AAEb,cAAMC,SAASjB,QAAQkB,kBAAkBC,wCAAmBC,MAAM;AAClE,cAAM,CAACC,SAAAA,IAAad,GAAGe,MAAM,GAAA;AAC7B,cAAM,EAAEC,SAASC,SAAQ,QAAKC,qBAAQJ,SAAAA;AACtC,cAAMK,aAASC,8BACb,CAACC,aAAaX,OAAOS,OAAOG,UAAU,MAAMD,SAAAA,CAAAA,EAAYE,aACxD,MAAMb,OAAOS,OAAOK,IAAG,CAAA;AAEzB,cAAMC,QAAQN,QAAQpB,KAAK,CAAC0B,WAAU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zB,OAAOgB,WAAWS,OAAMC,MAAMF,IAAG,MAAOG,uBAAWC,WAAW;AAC1G,YAAI,CAACX,UAAU;AAGb,iBAAO;YACLjB;YACAQ,MAAM;YACNyB,MAAM;YACNH,YAAY;cACVrB,MAAM;cACNoB,OAAO;gBAAC;gBAAyB;kBAAEG,IAAI3B;gBAAkB;;cACzD8B,QAAQ;cACRV;YACF;UACF;QACF;AAEA,cAAM,CAACU,MAAAA,QAAUC,kCAAaX,OAAO;UAAEzB,IAAIiB;QAAS,CAAA;AAEpD,eAAO;UACLjB;UACAQ,MAAM;UACNyB,MAAM;UACNH,YAAY;YACVrB,MAAM;YACNoB,OAAO;cAAC;cAAyB;gBAAEG,IAAI3B;cAAkB;;YACzD8B;UACF;QACF;MACF;IACF,CAAA;GACD;AACH;",
6
+ "names": ["context", "resolve", "typename", "requestCapabilities", "Capabilities", "Metadata", "find", "id", "metadata", "contributes", "AppGraphBuilder", "createExtension", "AUTOMATION_PLUGIN", "resolver", "endsWith", "type", "icon", "client", "requestCapability", "ClientCapabilities", "Client", "subjectId", "split", "spaceId", "objectId", "parseId", "spaces", "toSignal", "onChange", "subscribe", "unsubscribe", "get", "space", "state", "SpaceState", "SPACE_READY", "label", "properties", "name", "ns", "data", "showResolvedThreads", "object", "memoizeQuery", "meta", "getTypename", "placeholder"]
7
+ }
@@ -16,15 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_NIL4TP6U_exports = {};
20
- __export(chunk_NIL4TP6U_exports, {
21
- AutomationAction: () => AutomationAction,
19
+ var chunk_JNDMZQH7_exports = {};
20
+ __export(chunk_JNDMZQH7_exports, {
22
21
  ChainInputSchema: () => ChainInputSchema,
23
22
  ChainInputType: () => ChainInputType,
24
23
  ChainPromptType: () => ChainPromptType,
25
24
  ChainType: () => ChainType
26
25
  });
27
- module.exports = __toCommonJS(chunk_NIL4TP6U_exports);
26
+ module.exports = __toCommonJS(chunk_JNDMZQH7_exports);
28
27
  var import_echo_schema = require("@dxos/echo-schema");
29
28
  var ChainInputType;
30
29
  (function(ChainInputType2) {
@@ -59,15 +58,11 @@ var ChainType = class extends (0, import_echo_schema.TypedObject)({
59
58
  prompts: import_echo_schema.S.optional(import_echo_schema.S.mutable(import_echo_schema.S.Array((0, import_echo_schema.Ref)(ChainPromptType))))
60
59
  }) {
61
60
  };
62
- var AutomationAction;
63
- /* @__PURE__ */ (function(AutomationAction2) {
64
- })(AutomationAction || (AutomationAction = {}));
65
61
  // Annotate the CommonJS export names for ESM import in node:
66
62
  0 && (module.exports = {
67
- AutomationAction,
68
63
  ChainInputSchema,
69
64
  ChainInputType,
70
65
  ChainPromptType,
71
66
  ChainType
72
67
  });
73
- //# sourceMappingURL=chunk-NIL4TP6U.cjs.map
68
+ //# sourceMappingURL=chunk-JNDMZQH7.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/schema.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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAoC;;UAGxBA,iBAAAA;;;;;;;;;GAAAA,mBAAAA,iBAAAA,CAAAA,EAAAA;AAWL,IAAMC,mBAAmBC,qBAAEC,QAChCD,qBAAEE,OAAO;EACPC,MAAMH,qBAAEI;EACRC,MAAML,qBAAEM,SAASN,qBAAEO,MAAMT,cAAAA,CAAAA;EACzBU,OAAOR,qBAAEM,SAASN,qBAAEI,MAAM;AAC5B,CAAA,CAAA;AAKK,IAAMK,kBAAN,kBAA8BC,gCAAY;EAAEC,UAAU;EAA6BC,SAAS;AAAQ,CAAA,EAAG;EAC5GC,SAASb,qBAAEM,SAASN,qBAAEI,MAAM;EAC5BU,UAAUd,qBAAEI;EACZW,QAAQf,qBAAEM,SAASN,qBAAEC,QAAQD,qBAAEgB,MAAMjB,gBAAAA,CAAAA,CAAAA;AACvC,CAAA,EAAA;AAAI;AAEG,IAAMkB,YAAN,kBAAwBP,gCAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAAG;EAChGT,MAAMH,qBAAEM,SAASN,qBAAEI,MAAM;EACzBc,SAASlB,qBAAEM,SAASN,qBAAEC,QAAQD,qBAAEgB,UAAMG,wBAAIV,eAAAA,CAAAA,CAAAA,CAAAA;AAC5C,CAAA,EAAA;AAAI;",
6
+ "names": ["ChainInputType", "ChainInputSchema", "S", "mutable", "Struct", "name", "String", "type", "optional", "Enums", "value", "ChainPromptType", "TypedObject", "typename", "version", "command", "template", "inputs", "Array", "ChainType", "prompts", "Ref"]
7
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_JUSXT4U5_exports = {};
30
+ __export(chunk_JUSXT4U5_exports, {
31
+ AssistantPanel: () => AssistantPanel,
32
+ AutomationPanel: () => AutomationPanel
33
+ });
34
+ module.exports = __toCommonJS(chunk_JUSXT4U5_exports);
35
+ var import_react = require("react");
36
+ var AssistantPanel = (0, import_react.lazy)(() => import("./AssistantPanel-U7GDWPRC.cjs"));
37
+ var AutomationPanel = (0, import_react.lazy)(() => import("./AutomationPanel-H5WE4FIU.cjs"));
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ AssistantPanel,
41
+ AutomationPanel
42
+ });
43
+ //# sourceMappingURL=chunk-JUSXT4U5.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const AssistantPanel = lazy(() => import('./AssistantPanel'));\nexport const AutomationPanel = lazy(() => import('./AutomationPanel'));\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAqB;AAEd,IAAMA,qBAAiBC,mBAAK,MAAM,OAAO,+BAAA,CAAA;AACzC,IAAMC,sBAAkBD,mBAAK,MAAM,OAAO,gCAAA,CAAA;",
6
+ "names": ["AssistantPanel", "lazy", "AutomationPanel"]
7
+ }
@@ -16,17 +16,17 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_DTJ7XVO2_exports = {};
20
- __export(chunk_DTJ7XVO2_exports, {
19
+ var chunk_TQEDPRY5_exports = {};
20
+ __export(chunk_TQEDPRY5_exports, {
21
21
  AUTOMATION_PLUGIN: () => AUTOMATION_PLUGIN,
22
- meta_default: () => meta_default
22
+ meta: () => meta
23
23
  });
24
- module.exports = __toCommonJS(chunk_DTJ7XVO2_exports);
24
+ module.exports = __toCommonJS(chunk_TQEDPRY5_exports);
25
25
  var AUTOMATION_PLUGIN = "dxos.org/plugin/automation";
26
- var meta_default = {
26
+ var meta = {
27
27
  id: AUTOMATION_PLUGIN,
28
28
  name: "Automation",
29
- description: "Automation workflows.",
29
+ description: "The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.",
30
30
  icon: "ph--magic-wand--regular",
31
31
  source: "https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation",
32
32
  tags: [
@@ -36,6 +36,6 @@ var meta_default = {
36
36
  // Annotate the CommonJS export names for ESM import in node:
37
37
  0 && (module.exports = {
38
38
  AUTOMATION_PLUGIN,
39
- meta_default
39
+ meta
40
40
  });
41
- //# sourceMappingURL=chunk-DTJ7XVO2.cjs.map
41
+ //# sourceMappingURL=chunk-TQEDPRY5.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 const meta = {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description:\n 'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',\n icon: 'ph--magic-wand--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;AAE1B,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;",
6
+ "names": ["AUTOMATION_PLUGIN", "meta", "id", "name", "description", "icon", "source", "tags"]
7
+ }