@dxos/plugin-automation 0.7.5-main.9cb18ac → 0.7.5-main.9d2a38b
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/{AssistantPanel-32FH2RA6.mjs → AssistantPanel-N276BTPV.mjs} +2 -2
- package/dist/lib/browser/AutomationPanel-IHZ4JKVS.mjs +232 -0
- package/dist/lib/browser/AutomationPanel-IHZ4JKVS.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-IJTTULDP.mjs +131 -0
- package/dist/lib/browser/app-graph-builder-IJTTULDP.mjs.map +7 -0
- package/dist/lib/browser/chunk-4AIMDHKY.mjs +10 -0
- package/dist/lib/browser/chunk-4AIMDHKY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DN5M2QL5.mjs → chunk-DL6LB2NI.mjs} +2 -8
- package/dist/lib/browser/{chunk-DN5M2QL5.mjs.map → chunk-DL6LB2NI.mjs.map} +4 -4
- package/dist/lib/browser/{chunk-X5KMOH3I.mjs → chunk-HKX3D3ZP.mjs} +3 -3
- package/dist/lib/browser/chunk-HKX3D3ZP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +89 -236
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-LL72F3F4.mjs +34 -0
- package/dist/lib/browser/react-surface-LL72F3F4.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -3
- package/dist/lib/node/{AssistantPanel-XANI7YNV.cjs → AssistantPanel-Z4GVHUF3.cjs} +6 -6
- package/dist/lib/node/{AutomationPanel-VADY3HMP.cjs → AutomationPanel-PPODB5XA.cjs} +113 -32
- package/dist/lib/node/AutomationPanel-PPODB5XA.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-MF5M4QRS.cjs +147 -0
- package/dist/lib/node/app-graph-builder-MF5M4QRS.cjs.map +7 -0
- package/dist/lib/node/chunk-25AQIF3L.cjs +43 -0
- package/dist/lib/node/chunk-25AQIF3L.cjs.map +7 -0
- package/dist/lib/node/{chunk-DTJ7XVO2.cjs → chunk-5VF5JKUN.cjs} +7 -7
- package/dist/lib/node/chunk-5VF5JKUN.cjs.map +7 -0
- package/dist/lib/node/{chunk-NIL4TP6U.cjs → chunk-JNDMZQH7.cjs} +4 -9
- package/dist/lib/node/chunk-JNDMZQH7.cjs.map +7 -0
- package/dist/lib/node/index.cjs +112 -258
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-DVAU4MGD.cjs +57 -0
- package/dist/lib/node/react-surface-DVAU4MGD.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +5 -7
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{AssistantPanel-5M6O6JV7.mjs → AssistantPanel-DDCQHBJX.mjs} +2 -2
- package/dist/lib/node-esm/AutomationPanel-R3D6CRF5.mjs +233 -0
- package/dist/lib/node-esm/AutomationPanel-R3D6CRF5.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-5N7OK23B.mjs +132 -0
- package/dist/lib/node-esm/app-graph-builder-5N7OK23B.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GCHXTXVT.mjs → chunk-GIAYUM5I.mjs} +2 -8
- package/dist/lib/node-esm/{chunk-GCHXTXVT.mjs.map → chunk-GIAYUM5I.mjs.map} +4 -4
- package/dist/lib/node-esm/{chunk-HNOBZHWK.mjs → chunk-X3LPRWIL.mjs} +3 -3
- package/dist/lib/node-esm/chunk-X3LPRWIL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XW7TEQA3.mjs +12 -0
- package/dist/lib/node-esm/chunk-XW7TEQA3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +89 -236
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-4BED2PZ4.mjs +35 -0
- package/dist/lib/node-esm/react-surface-4BED2PZ4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -3
- package/dist/types/src/AutomationPlugin.d.ts +1 -3
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +180 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +179 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -2
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +7 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -46
- package/src/AutomationPlugin.tsx +55 -193
- package/src/capabilities/app-graph-builder.ts +127 -0
- package/src/capabilities/index.ts +8 -0
- package/src/capabilities/react-surface.tsx +27 -0
- package/src/components/AutomationPanel/AutomationPanel.tsx +54 -37
- package/src/components/TriggerEditor/TriggerEditor.tsx +63 -6
- package/src/index.ts +1 -4
- package/src/meta.ts +1 -1
- package/src/translations.ts +9 -0
- package/src/types/index.ts +0 -1
- package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs +0 -151
- package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs.map +0 -7
- package/dist/lib/browser/chunk-X5KMOH3I.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/lib/node/AutomationPanel-VADY3HMP.cjs.map +0 -7
- package/dist/lib/node/chunk-DTJ7XVO2.cjs.map +0 -7
- package/dist/lib/node/chunk-NIL4TP6U.cjs.map +0 -7
- package/dist/lib/node/meta.cjs +0 -30
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs +0 -152
- package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HNOBZHWK.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/types/src/types/types.d.ts +0 -7
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/types/types.ts +0 -27
- /package/dist/lib/browser/{AssistantPanel-32FH2RA6.mjs.map → AssistantPanel-N276BTPV.mjs.map} +0 -0
- /package/dist/lib/node/{AssistantPanel-XANI7YNV.cjs.map → AssistantPanel-Z4GVHUF3.cjs.map} +0 -0
- /package/dist/lib/node-esm/{AssistantPanel-5M6O6JV7.mjs.map → AssistantPanel-DDCQHBJX.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/AutomationPlugin.tsx", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { createSurface, parseMetadataResolverPlugin, type PluginDefinition, resolvePlugin } from '@dxos/app-framework';\nimport { FunctionTrigger } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { parseClientPlugin } from '@dxos/plugin-client/types';\nimport { createExtension, toSignal } from '@dxos/plugin-graph';\nimport { memoizeQuery } from '@dxos/plugin-space';\nimport {\n getSpace,\n getTypename,\n isEchoObject,\n parseId,\n type ReactiveEchoObject,\n RefArray,\n SpaceState,\n} from '@dxos/react-client/echo';\nimport { translations as formTranslations } from '@dxos/react-ui-form';\n\nimport { AssistantPanel, AutomationPanel } from './components';\nimport meta, { AUTOMATION_PLUGIN } from './meta';\nimport translations from './translations';\nimport { type AutomationPluginProvides, ChainPromptType, ChainType } from './types';\n\nexport const AutomationPlugin = (): PluginDefinition<AutomationPluginProvides> => {\n return {\n meta,\n provides: {\n metadata: {\n records: {\n [ChainType.typename]: {\n placeholder: ['object placeholder', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: async (chain: ChainType) => await RefArray.loadAll(chain.prompts ?? []),\n },\n },\n },\n translations: [...translations, ...formTranslations],\n echo: {\n system: [ChainType, ChainPromptType, FunctionTrigger],\n },\n complementary: {\n panels: [\n {\n id: 'automation',\n label: ['open automation panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n },\n {\n id: 'assistant',\n label: ['open assistant panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--atom--regular',\n },\n ],\n },\n graph: {\n builder: (plugins) => {\n const clientPlugin = resolvePlugin(plugins, parseClientPlugin);\n const metadataPlugin = resolvePlugin(plugins, parseMetadataResolverPlugin);\n const resolve = metadataPlugin?.provides.metadata.resolver;\n const client = clientPlugin?.provides.client;\n invariant(resolve);\n invariant(client);\n\n return [\n // Create nodes for object settings.\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 [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(\n (space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY,\n );\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 [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(\n (space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY,\n );\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 },\n surface: {\n definitions: () => [\n createSurface({\n id: `${AUTOMATION_PLUGIN}/assistant`,\n role: 'complementary--assistant',\n component: ({ data }) => <AssistantPanel subject={data.subject} />,\n }),\n createSurface({\n id: `${AUTOMATION_PLUGIN}/automation`,\n role: 'complementary--automation',\n filter: (data): data is { subject: ReactiveEchoObject<any> } =>\n isEchoObject(data.subject) && !!getSpace(data.subject),\n component: ({ data }) => <AutomationPanel space={getSpace(data.subject)!} object={data.subject} />,\n }),\n ],\n },\n intent: {\n resolvers: () => [],\n },\n },\n };\n};\n", "//\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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AUTOMATION_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [AUTOMATION_PLUGIN]: {\n 'plugin name': 'Automation',\n 'object placeholder': 'New prompt',\n 'create object label': 'Create prompt',\n 'create trigger label': 'Create trigger',\n 'create stack section label': 'Create prompt',\n 'command placeholder': 'Enter slash command...',\n 'template placeholder': 'Enter template...',\n 'value placeholder': 'Enter value...',\n 'select preset template placeholder': 'Select preset',\n 'open automation panel label': 'Show Automations',\n\n 'function select label': 'Function',\n 'function select placeholder': 'Select function',\n 'function enabled': 'Enabled',\n 'trigger select label': 'Trigger',\n 'trigger select placeholder': 'Trigger type',\n\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n 'trigger type subscription': 'Subscription',\n\n 'trigger filter': 'Filter',\n 'trigger cron': 'Cron',\n 'trigger method': 'Method',\n 'trigger endpoint': 'Endpoint',\n\n 'open assistant panel label': 'Show Assistant',\n 'assistant panel label': 'Assistant',\n },\n },\n },\n];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { create } from '@dxos/live-object';\n\nimport { ChainInputType, ChainPromptType } from './types';\n\nexport const str = (...text: (string | undefined | boolean)[]): string =>\n text\n .filter((value) => value !== undefined && value !== false)\n .flat()\n .join('\\n');\n\nexport type Preset = {\n id: string;\n title: string;\n createPrompt: () => ChainPromptType;\n};\n\nexport const chainPresets: Preset[] = [\n {\n id: 'dxos.org/prompt/translate',\n title: 'Translate',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'say',\n template: str(\n // prettier-ignore\n 'Translate the following into {language}:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.VALUE,\n name: 'language',\n value: 'japanese',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n // TODO(burdon): Message.\n // {\n // type: ChainInputType.CONTEXT,\n // name: 'input',\n // value: 'object.text',\n // },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/chess',\n title: 'Chess',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'hint',\n template: str(\n // prettier-ignore\n 'You are a machine that is an expert chess player.',\n '',\n 'The move history of the current game is: {history}',\n '',\n 'Suggest the next move and very briefly explain your strategy in a couple of sentences.',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'history',\n value: 'object.pgn',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/mermaid',\n title: 'Mermaid',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'draw',\n template: str(\n // prettier-ignore\n 'Create a simplified mermaid graph representing the text below.',\n 'Do not explain anything.',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/list',\n title: 'List',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'list',\n template: str(\n // prettier-ignore\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a single array of JSON objects.',\n '',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{schema}',\n '',\n '---',\n '',\n '{question}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'schema',\n value: 'example.com/type/project',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'question',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/base',\n title: 'RAG',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'rag',\n template: str(\n // prettier-ignore\n \"Very briefly answer the question based only on the following context and say if you don't know the answer.\",\n // 'answer the question using the following context as well as your training data:',\n '',\n '{context}',\n '',\n '---',\n '',\n 'question: {question}',\n ),\n inputs: [\n {\n type: ChainInputType.RETRIEVER,\n name: 'context',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'question',\n value: 'object.text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/lookup',\n title: 'Lookup',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'lookup',\n template: str(\n // prettier-ignore\n 'Lookup and very briefly summarize the following topic in one or two sentences:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/extract',\n title: 'Extract',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'extract',\n template: str(\n // prettier-ignore\n 'List all people and companies mentioned in the text below.',\n '',\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{contact}',\n '{company}',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'contact',\n value: 'example.com/type/contact',\n },\n {\n type: ChainInputType.SCHEMA,\n name: 'company',\n value: 'example.com/type/organization',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/discord',\n title: 'Summarize',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'summarize',\n template: str(\n // prettier-ignore\n 'Summarize what the team is working on and format it as a markdown table without any explanation.',\n '',\n '---',\n '',\n '{context}',\n ),\n inputs: [\n {\n type: ChainInputType.RESOLVER,\n name: 'context',\n value: 'discord.messages.recent',\n },\n ],\n }),\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AutomationPlugin } from './AutomationPlugin';\n\nexport default AutomationPlugin;\n\nexport * from './AutomationPlugin';\nexport * from './components';\nexport * from './presets';\nexport * from './types';\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/AutomationPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts", "../../../src/presets.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\nimport { FunctionTrigger } from '@dxos/functions';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { RefArray } from '@dxos/react-client/echo';\n\nimport { AppGraphBuilder, ReactSurface } from './capabilities';\nimport { AUTOMATION_PLUGIN, meta } from './meta';\nimport translations from './translations';\nimport { ChainPromptType, ChainType } from './types';\n\nexport const AutomationPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: ChainType.typename,\n metadata: {\n placeholder: ['object placeholder', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: async (chain: ChainType) => await RefArray.loadAll(chain.prompts ?? []),\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupClient,\n activate: () => contributes(ClientCapabilities.SystemSchema, [ChainType, ChainPromptType, FunctionTrigger]),\n }),\n defineModule({\n id: `${meta.id}/module/complementary-panels`,\n activatesOn: Events.Startup,\n activate: () => [\n contributes(DeckCapabilities.ComplementaryPanel, {\n id: 'automation',\n label: ['automation panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n }),\n contributes(DeckCapabilities.ComplementaryPanel, {\n id: 'assistant',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--atom--regular',\n }),\n ],\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.Startup,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AUTOMATION_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [AUTOMATION_PLUGIN]: {\n 'plugin name': 'Automation',\n 'object placeholder': 'New prompt',\n 'create object label': 'Create prompt',\n 'create trigger label': 'Create trigger',\n 'create stack section label': 'Create prompt',\n 'command placeholder': 'Enter slash command...',\n 'template placeholder': 'Enter template...',\n 'value placeholder': 'Enter value...',\n 'select preset template placeholder': 'Select preset',\n 'open automation panel label': 'Show Automations',\n 'automation panel label': 'Automations',\n\n 'function select label': 'Function',\n 'function select placeholder': 'Select function',\n 'function enabled': 'Enabled',\n 'trigger select label': 'Trigger',\n 'trigger select placeholder': 'Trigger type',\n\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n 'trigger type subscription': 'Subscription',\n 'trigger type email': 'Email',\n\n 'trigger filter': 'Filter',\n 'trigger cron': 'Cron',\n 'trigger method': 'Method',\n 'trigger endpoint': 'Endpoint',\n\n 'trigger copy url': 'Copy URL',\n 'trigger copy email': 'Copy Email',\n\n 'trigger meta add': 'Add',\n 'trigger meta remove': 'Remove',\n 'trigger meta prop name placeholder': 'New meta property name',\n\n 'open assistant panel label': 'Show Assistant',\n 'assistant panel label': 'Assistant',\n },\n },\n },\n];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { create } from '@dxos/live-object';\n\nimport { ChainInputType, ChainPromptType } from './types';\n\nexport const str = (...text: (string | undefined | boolean)[]): string =>\n text\n .filter((value) => value !== undefined && value !== false)\n .flat()\n .join('\\n');\n\nexport type Preset = {\n id: string;\n title: string;\n createPrompt: () => ChainPromptType;\n};\n\nexport const chainPresets: Preset[] = [\n {\n id: 'dxos.org/prompt/translate',\n title: 'Translate',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'say',\n template: str(\n // prettier-ignore\n 'Translate the following into {language}:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.VALUE,\n name: 'language',\n value: 'japanese',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n // TODO(burdon): Message.\n // {\n // type: ChainInputType.CONTEXT,\n // name: 'input',\n // value: 'object.text',\n // },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/chess',\n title: 'Chess',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'hint',\n template: str(\n // prettier-ignore\n 'You are a machine that is an expert chess player.',\n '',\n 'The move history of the current game is: {history}',\n '',\n 'Suggest the next move and very briefly explain your strategy in a couple of sentences.',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'history',\n value: 'object.pgn',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/mermaid',\n title: 'Mermaid',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'draw',\n template: str(\n // prettier-ignore\n 'Create a simplified mermaid graph representing the text below.',\n 'Do not explain anything.',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/list',\n title: 'List',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'list',\n template: str(\n // prettier-ignore\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a single array of JSON objects.',\n '',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{schema}',\n '',\n '---',\n '',\n '{question}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'schema',\n value: 'example.com/type/project',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'question',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/base',\n title: 'RAG',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'rag',\n template: str(\n // prettier-ignore\n \"Very briefly answer the question based only on the following context and say if you don't know the answer.\",\n // 'answer the question using the following context as well as your training data:',\n '',\n '{context}',\n '',\n '---',\n '',\n 'question: {question}',\n ),\n inputs: [\n {\n type: ChainInputType.RETRIEVER,\n name: 'context',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'question',\n value: 'object.text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/lookup',\n title: 'Lookup',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'lookup',\n template: str(\n // prettier-ignore\n 'Lookup and very briefly summarize the following topic in one or two sentences:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/extract',\n title: 'Extract',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'extract',\n template: str(\n // prettier-ignore\n 'List all people and companies mentioned in the text below.',\n '',\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{contact}',\n '{company}',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'contact',\n value: 'example.com/type/contact',\n },\n {\n type: ChainInputType.SCHEMA,\n name: 'company',\n value: 'example.com/type/organization',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/discord',\n title: 'Summarize',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'summarize',\n template: str(\n // prettier-ignore\n 'Summarize what the team is working on and format it as a markdown table without any explanation.',\n '',\n '---',\n '',\n '{context}',\n ),\n inputs: [\n {\n type: ChainInputType.RESOLVER,\n name: 'context',\n value: 'discord.messages.recent',\n },\n ],\n }),\n },\n];\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["import_app_framework", "AppGraphBuilder", "lazy", "ReactSurface", "AUTOMATION_PLUGIN", "AutomationPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "oneOf", "Startup", "SetupAppGraph", "Metadata", "ChainType", "typename", "metadata", "placeholder", "ns", "icon", "loadReferences", "chain", "RefArray", "loadAll", "prompts", "ClientEvents", "SetupClient", "ClientCapabilities", "SystemSchema", "ChainPromptType", "FunctionTrigger", "DeckCapabilities", "ComplementaryPanel", "label", "str", "text", "filter", "value", "undefined", "flat", "join", "chainPresets", "title", "createPrompt", "create", "command", "template", "inputs", "type", "ChainInputType", "VALUE", "name", "PASS_THROUGH", "CONTEXT", "SCHEMA", "RETRIEVER", "RESOLVER"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytes":16049,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1626,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":28000,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts","kind":"import-statement","original":"./system-instructions"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx","kind":"import-statement","original":"./AssistantPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":7128,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":16783,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4459,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":604,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-automation/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":29041,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":1109,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23991},"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-NIL4TP6U.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-XANI7YNV.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-VADY3HMP.cjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AssistantPanel","AutomationAction","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":7755},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1277},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":15618},"packages/plugins/experimental/plugin-automation/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"}],"exports":["AUTOMATION_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/meta.ts","inputs":{},"bytes":169},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-NIL4TP6U.cjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":266},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-NIL4TP6U.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2879},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-NIL4TP6U.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytesInOutput":118}},"bytes":1653},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-XANI7YNV.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22398},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-XANI7YNV.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytesInOutput":7244},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytesInOutput":4067},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytesInOutput":45}},"bytes":11915},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-VADY3HMP.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13284},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-VADY3HMP.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4160},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":1456},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":6223},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":763},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":333}},"bytes":489}}}
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1663,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts":{"bytes":16198,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytes":16049,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":28000,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts","kind":"import-statement","original":"./system-instructions"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx","kind":"import-statement","original":"./AssistantPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":15553,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":19445,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx":{"bytes":3922,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts":{"bytes":1109,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts","kind":"dynamic-import","original":"./app-graph-builder"},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":5419,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":519,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":10110,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":885,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16220},"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JNDMZQH7.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-25AQIF3L.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-5VF5JKUN.cjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/app-graph-builder-MF5M4QRS.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/react-surface-DVAU4MGD.cjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AUTOMATION_PLUGIN","AssistantPanel","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","meta","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":2261},"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts":{"bytesInOutput":193},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1597},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":10389},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JNDMZQH7.cjs","kind":"import-statement"}],"exports":["ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":226},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JNDMZQH7.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2081},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JNDMZQH7.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0}},"bytes":1444},"packages/plugins/experimental/plugin-automation/dist/lib/node/app-graph-builder-MF5M4QRS.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7468},"packages/plugins/experimental/plugin-automation/dist/lib/node/app-graph-builder-MF5M4QRS.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-5VF5JKUN.cjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts":{"bytesInOutput":3950}},"bytes":4207},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-Z4GVHUF3.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22398},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-Z4GVHUF3.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-5VF5JKUN.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytesInOutput":7244},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytesInOutput":4067},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytesInOutput":45}},"bytes":11915},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-PPODB5XA.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18804},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-PPODB5XA.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-5VF5JKUN.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4886},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":3947},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":9440},"packages/plugins/experimental/plugin-automation/dist/lib/node/react-surface-DVAU4MGD.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1915},"packages/plugins/experimental/plugin-automation/dist/lib/node/react-surface-DVAU4MGD.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-25AQIF3L.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-5VF5JKUN.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx":{"bytesInOutput":812}},"bytes":1134},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-25AQIF3L.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":503},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-25AQIF3L.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-Z4GVHUF3.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-PPODB5XA.cjs","kind":"dynamic-import"}],"exports":["AssistantPanel","AutomationPanel"],"inputs":{"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180}},"bytes":348},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-5VF5JKUN.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":778},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-5VF5JKUN.cjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":325}},"bytes":473}}}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 react_surface_DVAU4MGD_exports = {};
|
|
30
|
+
__export(react_surface_DVAU4MGD_exports, {
|
|
31
|
+
default: () => react_surface_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(react_surface_DVAU4MGD_exports);
|
|
34
|
+
var import_chunk_25AQIF3L = require("./chunk-25AQIF3L.cjs");
|
|
35
|
+
var import_chunk_5VF5JKUN = require("./chunk-5VF5JKUN.cjs");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
38
|
+
var import_echo = require("@dxos/react-client/echo");
|
|
39
|
+
var react_surface_default = () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
|
|
40
|
+
(0, import_app_framework.createSurface)({
|
|
41
|
+
id: `${import_chunk_5VF5JKUN.AUTOMATION_PLUGIN}/assistant`,
|
|
42
|
+
role: "complementary--assistant",
|
|
43
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_25AQIF3L.AssistantPanel, {
|
|
44
|
+
subject: data.subject
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
(0, import_app_framework.createSurface)({
|
|
48
|
+
id: `${import_chunk_5VF5JKUN.AUTOMATION_PLUGIN}/automation`,
|
|
49
|
+
role: "complementary--automation",
|
|
50
|
+
filter: (data) => (0, import_echo.isEchoObject)(data.subject) && !!(0, import_echo.getSpace)(data.subject),
|
|
51
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_25AQIF3L.AutomationPanel, {
|
|
52
|
+
space: (0, import_echo.getSpace)(data.subject),
|
|
53
|
+
object: data.subject
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
]);
|
|
57
|
+
//# sourceMappingURL=react-surface-DVAU4MGD.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { getSpace, isEchoObject, type ReactiveEchoObject } from '@dxos/react-client/echo';\n\nimport { AssistantPanel, AutomationPanel } from '../components';\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${AUTOMATION_PLUGIN}/assistant`,\n role: 'complementary--assistant',\n component: ({ data }) => <AssistantPanel subject={data.subject} />,\n }),\n createSurface({\n id: `${AUTOMATION_PLUGIN}/automation`,\n role: 'complementary--automation',\n filter: (data): data is { subject: ReactiveEchoObject<any> } =>\n isEchoObject(data.subject) && !!getSpace(data.subject),\n component: ({ data }) => <AutomationPanel space={getSpace(data.subject)!} object={data.subject} />,\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAyD;AACzD,kBAAgE;AAKhE,IAAA,wBAAe,UACbA,kCAAYC,kCAAaC,cAAc;MACrCC,oCAAc;IACZC,IAAI,GAAGC,uCAAAA;IACPC,MAAM;IACNC,WAAW,CAAC,EAAEC,KAAI,MAAO,6BAAAC,QAAA,cAACC,sCAAAA;MAAeC,SAASH,KAAKG;;EACzD,CAAA;MACAR,oCAAc;IACZC,IAAI,GAAGC,uCAAAA;IACPC,MAAM;IACNM,QAAQ,CAACJ,aACPK,0BAAaL,KAAKG,OAAO,KAAK,CAAC,KAACG,sBAASN,KAAKG,OAAO;IACvDJ,WAAW,CAAC,EAAEC,KAAI,MAAO,6BAAAC,QAAA,cAACM,uCAAAA;MAAgBC,WAAOF,sBAASN,KAAKG,OAAO;MAAIM,QAAQT,KAAKG;;EACzF,CAAA;CACD;",
|
|
6
|
+
"names": ["contributes", "Capabilities", "ReactSurface", "createSurface", "id", "AUTOMATION_PLUGIN", "role", "component", "data", "React", "AssistantPanel", "subject", "filter", "isEchoObject", "getSpace", "AutomationPanel", "space", "object"]
|
|
7
|
+
}
|
|
@@ -18,17 +18,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
ChainType: () => import_chunk_NIL4TP6U.ChainType
|
|
21
|
+
ChainInputSchema: () => import_chunk_JNDMZQH7.ChainInputSchema,
|
|
22
|
+
ChainInputType: () => import_chunk_JNDMZQH7.ChainInputType,
|
|
23
|
+
ChainPromptType: () => import_chunk_JNDMZQH7.ChainPromptType,
|
|
24
|
+
ChainType: () => import_chunk_JNDMZQH7.ChainType
|
|
26
25
|
});
|
|
27
26
|
module.exports = __toCommonJS(types_exports);
|
|
28
|
-
var
|
|
27
|
+
var import_chunk_JNDMZQH7 = require("../chunk-JNDMZQH7.cjs");
|
|
29
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
29
|
0 && (module.exports = {
|
|
31
|
-
AutomationAction,
|
|
32
30
|
ChainInputSchema,
|
|
33
31
|
ChainInputType,
|
|
34
32
|
ChainPromptType,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["import {\n ChainInputSchema,\n ChainInputType,\n ChainPromptType,\n ChainType\n} from \"../chunk-JNDMZQH7.cjs\";\nexport {\n ChainInputSchema,\n ChainInputType,\n ChainPromptType,\n ChainType\n};\n//# sourceMappingURL=index.cjs.map\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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-
|
|
4
|
+
} from "./chunk-X3LPRWIL.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx
|
|
7
7
|
import React, { useEffect, useRef, useState } from "react";
|
|
@@ -337,4 +337,4 @@ var AssistantPanel_default = AssistantPanel;
|
|
|
337
337
|
export {
|
|
338
338
|
AssistantPanel_default as default
|
|
339
339
|
};
|
|
340
|
-
//# sourceMappingURL=AssistantPanel-
|
|
340
|
+
//# sourceMappingURL=AssistantPanel-DDCQHBJX.mjs.map
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
AUTOMATION_PLUGIN
|
|
4
|
+
} from "./chunk-X3LPRWIL.mjs";
|
|
5
|
+
|
|
6
|
+
// packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx
|
|
7
|
+
import React2, { useState as useState2 } from "react";
|
|
8
|
+
import { S } from "@dxos/echo-schema";
|
|
9
|
+
import { FunctionType as FunctionType2, FunctionTrigger, FunctionTriggerSchema as FunctionTriggerSchema2, TriggerKind as TriggerKind2, ScriptType as ScriptType2 } from "@dxos/functions";
|
|
10
|
+
import { useClient } from "@dxos/react-client";
|
|
11
|
+
import { create, Filter as Filter2, useQuery as useQuery2, getSpace } from "@dxos/react-client/echo";
|
|
12
|
+
import { IconButton as IconButton2, Input as Input2, useTranslation as useTranslation2, Button } from "@dxos/react-ui";
|
|
13
|
+
import { List } from "@dxos/react-ui-list";
|
|
14
|
+
import { ghostHover, mx } from "@dxos/react-ui-theme";
|
|
15
|
+
|
|
16
|
+
// packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx
|
|
17
|
+
import React, { useState } from "react";
|
|
18
|
+
import { FunctionType, FunctionTriggerSchema, ScriptType, TriggerKind } from "@dxos/functions";
|
|
19
|
+
import { Filter, useQuery } from "@dxos/react-client/echo";
|
|
20
|
+
import { IconButton, Input, useTranslation } from "@dxos/react-ui";
|
|
21
|
+
import { Form, SelectInput, TextInput } from "@dxos/react-ui-form";
|
|
22
|
+
var TriggerEditor = ({ space, trigger, onSave, onCancel }) => {
|
|
23
|
+
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
24
|
+
const functions = useQuery(space, Filter.schema(FunctionType));
|
|
25
|
+
const scripts = useQuery(space, Filter.schema(ScriptType));
|
|
26
|
+
const handleSave = (values) => {
|
|
27
|
+
onSave?.(values);
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ React.createElement(Form, {
|
|
30
|
+
schema: FunctionTriggerSchema,
|
|
31
|
+
values: trigger,
|
|
32
|
+
onSave: handleSave,
|
|
33
|
+
onCancel,
|
|
34
|
+
Custom: {
|
|
35
|
+
["function"]: (props) => /* @__PURE__ */ React.createElement(SelectInput, {
|
|
36
|
+
...props,
|
|
37
|
+
options: functions.map((fn) => ({
|
|
38
|
+
value: fn.name,
|
|
39
|
+
label: getFunctionName(scripts, fn)
|
|
40
|
+
}))
|
|
41
|
+
}),
|
|
42
|
+
["spec.type"]: (props) => /* @__PURE__ */ React.createElement(SelectInput, {
|
|
43
|
+
...props,
|
|
44
|
+
options: Object.values(TriggerKind).map((kind) => ({
|
|
45
|
+
value: kind,
|
|
46
|
+
label: t(`trigger type ${kind}`)
|
|
47
|
+
}))
|
|
48
|
+
}),
|
|
49
|
+
["meta"]: (props) => {
|
|
50
|
+
const meta = props.getValue("meta");
|
|
51
|
+
const [newMetaFieldName, setNewMetaFieldName] = useState("");
|
|
52
|
+
React.useEffect(() => props.onValueChange("meta", "object", {
|
|
53
|
+
...meta
|
|
54
|
+
}), []);
|
|
55
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", null, props.label), [
|
|
56
|
+
...Object.keys(meta)
|
|
57
|
+
].map((key) => {
|
|
58
|
+
const compositeKey = `meta.${key}`;
|
|
59
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
60
|
+
key: compositeKey,
|
|
61
|
+
role: "none",
|
|
62
|
+
className: "flex items-center mt-2 gap-1"
|
|
63
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
64
|
+
role: "none",
|
|
65
|
+
className: "flex-1"
|
|
66
|
+
}, /* @__PURE__ */ React.createElement(TextInput, {
|
|
67
|
+
...props,
|
|
68
|
+
property: compositeKey,
|
|
69
|
+
type: "string",
|
|
70
|
+
label: key
|
|
71
|
+
})), /* @__PURE__ */ React.createElement(IconButton, {
|
|
72
|
+
icon: "ph--trash--regular",
|
|
73
|
+
iconOnly: true,
|
|
74
|
+
classNames: "mt-6",
|
|
75
|
+
label: t("trigger meta remove"),
|
|
76
|
+
onClick: () => {
|
|
77
|
+
const newValues = {
|
|
78
|
+
...props.getValue("meta")
|
|
79
|
+
};
|
|
80
|
+
delete newValues[key];
|
|
81
|
+
props.onValueChange("meta", "object", newValues);
|
|
82
|
+
}
|
|
83
|
+
}));
|
|
84
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
85
|
+
role: "none",
|
|
86
|
+
className: "flex items-center mt-2 gap-1 plb-1"
|
|
87
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
88
|
+
role: "none",
|
|
89
|
+
className: "flex-1"
|
|
90
|
+
}, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.TextInput, {
|
|
91
|
+
placeholder: t("trigger meta prop name placeholder"),
|
|
92
|
+
value: newMetaFieldName,
|
|
93
|
+
onChange: (event) => setNewMetaFieldName(event.target.value)
|
|
94
|
+
}))), /* @__PURE__ */ React.createElement(IconButton, {
|
|
95
|
+
icon: "ph--plus--regular",
|
|
96
|
+
iconOnly: true,
|
|
97
|
+
label: t("trigger meta add"),
|
|
98
|
+
onClick: () => {
|
|
99
|
+
if (newMetaFieldName.length) {
|
|
100
|
+
const meta2 = props.getValue("meta") ?? {};
|
|
101
|
+
const metaWithNewProp = {
|
|
102
|
+
...meta2,
|
|
103
|
+
[newMetaFieldName]: ""
|
|
104
|
+
};
|
|
105
|
+
setNewMetaFieldName("");
|
|
106
|
+
props.onValueChange("meta", "object", metaWithNewProp);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
})));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
var getFunctionName = (scripts, fn) => {
|
|
115
|
+
return scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx
|
|
119
|
+
var grid = "grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]";
|
|
120
|
+
var AutomationPanel = ({ space, object }) => {
|
|
121
|
+
const { t } = useTranslation2(AUTOMATION_PLUGIN);
|
|
122
|
+
const client = useClient();
|
|
123
|
+
const triggers = useQuery2(space, Filter2.schema(FunctionTrigger));
|
|
124
|
+
const functions = useQuery2(space, Filter2.schema(FunctionType2));
|
|
125
|
+
const scripts = useQuery2(space, Filter2.schema(ScriptType2));
|
|
126
|
+
const [trigger, setTrigger] = useState2();
|
|
127
|
+
const [selected, setSelected] = useState2();
|
|
128
|
+
const handleSelect = (trigger2) => {
|
|
129
|
+
const { id: _, ...values } = trigger2;
|
|
130
|
+
setTrigger(values);
|
|
131
|
+
setSelected(trigger2);
|
|
132
|
+
};
|
|
133
|
+
const handleAdd = () => {
|
|
134
|
+
setTrigger(create(FunctionTriggerSchema2, {
|
|
135
|
+
meta: {}
|
|
136
|
+
}));
|
|
137
|
+
setSelected(void 0);
|
|
138
|
+
};
|
|
139
|
+
const handleDelete = (trigger2) => {
|
|
140
|
+
space.db.remove(trigger2);
|
|
141
|
+
setTrigger(void 0);
|
|
142
|
+
setSelected(void 0);
|
|
143
|
+
};
|
|
144
|
+
const handleSave = (trigger2) => {
|
|
145
|
+
if (selected) {
|
|
146
|
+
Object.assign(selected, trigger2);
|
|
147
|
+
} else {
|
|
148
|
+
space.db.add(create(FunctionTrigger, trigger2));
|
|
149
|
+
}
|
|
150
|
+
setTrigger(void 0);
|
|
151
|
+
setSelected(void 0);
|
|
152
|
+
};
|
|
153
|
+
const handleCancel = () => {
|
|
154
|
+
setTrigger(void 0);
|
|
155
|
+
};
|
|
156
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
157
|
+
className: "flex flex-col w-full divide-y divide-separator overflow-y-auto"
|
|
158
|
+
}, /* @__PURE__ */ React2.createElement(List.Root, {
|
|
159
|
+
items: triggers,
|
|
160
|
+
isItem: S.is(FunctionTrigger),
|
|
161
|
+
getId: (field) => field.id
|
|
162
|
+
}, ({ items: triggers2 }) => /* @__PURE__ */ React2.createElement("div", {
|
|
163
|
+
role: "list",
|
|
164
|
+
className: "flex flex-col w-full"
|
|
165
|
+
}, triggers2?.map((trigger2) => {
|
|
166
|
+
const copyAction = getCopyAction(client, trigger2);
|
|
167
|
+
return /* @__PURE__ */ React2.createElement(List.Item, {
|
|
168
|
+
key: trigger2.id,
|
|
169
|
+
item: trigger2,
|
|
170
|
+
classNames: mx(grid, ghostHover, "items-center", "px-2")
|
|
171
|
+
}, /* @__PURE__ */ React2.createElement(Input2.Root, null, /* @__PURE__ */ React2.createElement(Input2.Switch, {
|
|
172
|
+
checked: trigger2.enabled,
|
|
173
|
+
onCheckedChange: (checked) => trigger2.enabled = checked
|
|
174
|
+
})), /* @__PURE__ */ React2.createElement("div", {
|
|
175
|
+
className: "flex"
|
|
176
|
+
}, /* @__PURE__ */ React2.createElement(List.ItemTitle, {
|
|
177
|
+
classNames: "px-1 cursor-pointer w-0 shrink truncate",
|
|
178
|
+
onClick: () => handleSelect(trigger2)
|
|
179
|
+
}, getFunctionName2(scripts, functions, trigger2) ?? "\u2205"), copyAction && /* @__PURE__ */ React2.createElement(Button, {
|
|
180
|
+
onClick: () => navigator.clipboard.writeText(copyAction.contentProvider())
|
|
181
|
+
}, t(copyAction.translationKey))), /* @__PURE__ */ React2.createElement(List.ItemDeleteButton, {
|
|
182
|
+
onClick: () => handleDelete(trigger2)
|
|
183
|
+
}));
|
|
184
|
+
}))), trigger && /* @__PURE__ */ React2.createElement(TriggerEditor, {
|
|
185
|
+
space,
|
|
186
|
+
trigger,
|
|
187
|
+
onSave: handleSave,
|
|
188
|
+
onCancel: handleCancel
|
|
189
|
+
}), !trigger && /* @__PURE__ */ React2.createElement("div", {
|
|
190
|
+
className: "flex p-2 justify-center"
|
|
191
|
+
}, /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
192
|
+
icon: "ph--plus--regular",
|
|
193
|
+
label: t("new trigger"),
|
|
194
|
+
onClick: handleAdd
|
|
195
|
+
})));
|
|
196
|
+
};
|
|
197
|
+
var getCopyAction = (client, trigger) => {
|
|
198
|
+
if (trigger?.spec?.type === TriggerKind2.Email) {
|
|
199
|
+
return {
|
|
200
|
+
translationKey: "trigger copy email",
|
|
201
|
+
contentProvider: () => `${getSpace(trigger).id}@dxos.network`
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
if (trigger?.spec?.type === TriggerKind2.Webhook) {
|
|
205
|
+
return {
|
|
206
|
+
translationKey: "trigger copy url",
|
|
207
|
+
contentProvider: () => getWebhookUrl(client, trigger)
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
return void 0;
|
|
211
|
+
};
|
|
212
|
+
var getWebhookUrl = (client, trigger) => {
|
|
213
|
+
const spaceId = getSpace(trigger).id;
|
|
214
|
+
const edgeUrl = new URL(client.config.values.runtime.services.edge.url);
|
|
215
|
+
const isSecure = edgeUrl.protocol.startsWith("https") || edgeUrl.protocol.startsWith("wss");
|
|
216
|
+
edgeUrl.protocol = isSecure ? "https" : "http";
|
|
217
|
+
return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();
|
|
218
|
+
};
|
|
219
|
+
var getFunctionName2 = (scripts, functions, trigger) => {
|
|
220
|
+
const shortId = trigger.function && `${trigger.function?.slice(0, 16)}\u2026`;
|
|
221
|
+
const functionObject = functions.find((fn) => fn.name === trigger.function);
|
|
222
|
+
if (!functionObject) {
|
|
223
|
+
return shortId;
|
|
224
|
+
}
|
|
225
|
+
return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts
|
|
229
|
+
var AutomationPanel_default = AutomationPanel;
|
|
230
|
+
export {
|
|
231
|
+
AutomationPanel_default as default
|
|
232
|
+
};
|
|
233
|
+
//# sourceMappingURL=AutomationPanel-R3D6CRF5.mjs.map
|