@dxos/plugin-automation 0.7.0 → 0.7.1-staging.8709ba7
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/{PromptContainer-3GUENQHE.mjs → PromptContainer-6CBNCUKQ.mjs} +3 -3
- package/dist/lib/browser/{chunk-J4SYTP4Y.mjs → chunk-B3Z4NQC2.mjs} +2 -2
- package/dist/lib/browser/{chunk-J4SYTP4Y.mjs.map → chunk-B3Z4NQC2.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-2FOJUVYG.mjs → chunk-CJMV64XO.mjs} +2 -2
- package/dist/lib/browser/index.mjs +299 -213
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{PromptContainer-74ZRO4HK.cjs → PromptContainer-7RCGCU3K.cjs} +7 -7
- package/dist/lib/node/{chunk-XS53UP75.cjs → chunk-SUMUWFZA.cjs} +4 -4
- package/dist/lib/node/{chunk-XS53UP75.cjs.map → chunk-SUMUWFZA.cjs.map} +1 -1
- package/dist/lib/node/{chunk-4TMTUB4X.cjs → chunk-YGRHTCOX.cjs} +16 -16
- package/dist/lib/node/index.cjs +322 -240
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +6 -6
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{PromptContainer-5OK4GWIR.mjs → PromptContainer-4SCHQV5C.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-FN6DOJZP.mjs → chunk-62AB5HXX.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-AAUSG7OA.mjs → chunk-PYT2WY4B.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-AAUSG7OA.mjs.map → chunk-PYT2WY4B.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +299 -213
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +4 -3
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/meta.d.ts.map +1 -1
- package/dist/types/src/hooks/email.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/{components/TriggerEditor/invokation-handler.d.ts → hooks/invocation-handler.d.ts} +1 -1
- package/dist/types/src/hooks/invocation-handler.d.ts.map +1 -0
- package/dist/types/src/hooks/useLocalTriggerManager.d.ts +3 -0
- package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/{chain.d.ts → schema.d.ts} +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/package.json +35 -34
- package/src/AutomationPlugin.tsx +0 -3
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +4 -3
- package/src/components/TriggerEditor/TriggerEditor.tsx +69 -86
- package/src/components/TriggerEditor/meta.tsx +1 -0
- package/src/hooks/index.ts +5 -0
- package/src/{components/TriggerEditor/invokation-handler.ts → hooks/invocation-handler.ts} +4 -2
- package/src/hooks/useLocalTriggerManager.ts +84 -0
- package/src/types/index.ts +1 -1
- package/dist/types/src/components/TriggerEditor/email.d.ts.map +0 -1
- package/dist/types/src/components/TriggerEditor/invokation-handler.d.ts.map +0 -1
- package/dist/types/src/types/chain.d.ts.map +0 -1
- /package/dist/lib/browser/{PromptContainer-3GUENQHE.mjs.map → PromptContainer-6CBNCUKQ.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-2FOJUVYG.mjs.map → chunk-CJMV64XO.mjs.map} +0 -0
- /package/dist/lib/node/{PromptContainer-74ZRO4HK.cjs.map → PromptContainer-7RCGCU3K.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-4TMTUB4X.cjs.map → chunk-YGRHTCOX.cjs.map} +0 -0
- /package/dist/lib/node-esm/{PromptContainer-5OK4GWIR.mjs.map → PromptContainer-4SCHQV5C.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-FN6DOJZP.mjs.map → chunk-62AB5HXX.mjs.map} +0 -0
- /package/dist/types/src/{components/TriggerEditor → hooks}/email.d.ts +0 -0
- /package/src/{components/TriggerEditor → hooks}/email.ts +0 -0
- /package/src/types/{chain.ts → schema.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/AutomationPlugin.tsx", "../../../src/components/index.ts", "../../../src/components/AutomationPanel.tsx", "../../../src/components/Chain.tsx", "../../../src/presets.ts", "../../../src/components/TriggerEditor/TriggerEditor.tsx", "../../../src/components/TriggerEditor/Form.tsx", "../../../src/components/TriggerEditor/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type PluginDefinition, parseMetadataResolverPlugin, resolvePlugin } from '@dxos/app-framework';\nimport { FunctionDef, FunctionTrigger } from '@dxos/functions/types';\nimport { invariant } from '@dxos/invariant';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { createExtension, toSignal } from '@dxos/plugin-graph';\nimport { getTypename, loadObjectReferences, parseId } from '@dxos/react-client/echo';\n\nimport { AutomationPanel } from './components';\nimport meta, { AUTOMATION_PLUGIN } from './meta';\nimport translations from './translations';\nimport { AutomationAction, type AutomationPluginProvides, ChainPromptType, ChainType } from './types';\n\n// TODO(burdon): Prompt article.\n// TODO(burdon): Trigger panel.\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: (chain: ChainType) => loadObjectReferences(chain, (chain) => chain.prompts),\n },\n },\n },\n translations,\n echo: {\n schema: [ChainType, ChainPromptType, FunctionDef, FunctionTrigger],\n },\n complementary: {\n panels: [\n {\n id: 'automation',\n label: ['open automation panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--flow-arrow--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--flow-arrow--regular';\n\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const space = client.spaces.get().find((space) => space.id === spaceId);\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 = toSignal(\n (onChange) => {\n const timeout = setTimeout(async () => {\n await space?.db.loadObjectById(objectId);\n onChange();\n });\n\n return () => clearTimeout(timeout);\n },\n () => space?.db.getObjectById(objectId),\n subjectId,\n );\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 ];\n },\n },\n surface: {\n component: ({ data, role }) => {\n switch (role) {\n // case 'article':\n // return data.object instanceof ChainType ? <ChainArticle chain={data.object} /> : null;\n\n case 'complementary--automation':\n return <AutomationPanel />;\n }\n\n return null;\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case AutomationAction.CREATE: {\n return {\n // data: create(ChainType, { prompts: [] }),\n // data: create(FunctionTrigger, { function: '', spec: { type: 'timer', cron: '' } }),\n };\n }\n }\n },\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const PromptContainer = lazy(() => import('./PromptContainer'));\n\nexport * from './AutomationPanel';\nexport * from './Chain';\nexport * from './PromptEditor';\nexport * from './TriggerEditor';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Button, Icon, Toolbar } from '@dxos/react-ui';\n\n// TODO(burdon): Form components.\n\nexport const AutomationPanel = () => {\n const handleCreate = () => {};\n\n return (\n <div className='flex flex-col'>\n <Toolbar.Root classNames='p-2'>\n <Button onClick={handleCreate}>\n <Icon icon='ph--plus--regular' />\n </Button>\n </Toolbar.Root>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Select, useTranslation } from '@dxos/react-ui';\nimport { nonNullable } from '@dxos/util';\n\nimport { PromptEditor } from './PromptEditor';\nimport { AUTOMATION_PLUGIN } from '../meta';\nimport { chainPresets, type Preset } from '../presets';\nimport { type ChainType } from '../types';\n\nexport type ChainProps = {\n chain: ChainType;\n};\n\nexport const Chain = ({ chain }: ChainProps) => {\n const space = getSpace(chain);\n if (!space) {\n return null;\n }\n\n const handleSelectPreset = (preset: Preset) => {\n chain.name = preset.title;\n // TODO(burdon): API issue.\n chain.prompts?.filter(nonNullable).forEach((prompt) => space.db.remove(prompt));\n chain.prompts = [preset.createPrompt()];\n };\n\n return (\n <div className='flex flex-col my-2 gap-4'>\n {chain.prompts?.filter(nonNullable).map((prompt, i) => <PromptEditor key={i} prompt={prompt} />)}\n <div className='p-2'>\n <ChainPresets presets={chainPresets} onSelect={handleSelectPreset} />\n </div>\n </div>\n );\n};\n\nexport const ChainPresets: FC<{ presets: Preset[]; onSelect: (preset: Preset) => void }> = ({ presets, onSelect }) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n return (\n <Select.Root\n onValueChange={(value) => {\n onSelect(presets.find(({ id }) => id === value)!);\n }}\n >\n <Select.TriggerButton classNames='w-full' placeholder={t('select preset template placeholder')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {presets.map(({ id, title }) => (\n <Select.Option key={id} value={id}>\n {title}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { create } from '@dxos/echo-schema';\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 2024 DXOS.org\n//\n\nimport React, { type ChangeEventHandler, type FC, useEffect, useMemo, useState } from 'react';\n\nimport { Mutex } from '@dxos/async';\nimport { Context } from '@dxos/context';\nimport { createSubscriptionTrigger, createWebsocketTrigger, type TriggerFactory } from '@dxos/functions';\nimport {\n FunctionTrigger,\n type FunctionTriggerType,\n type SubscriptionTrigger,\n type TimerTrigger,\n type TriggerSpec,\n type WebhookTrigger,\n type WebsocketTrigger,\n} from '@dxos/functions/types';\nimport { log } from '@dxos/log';\nimport { ScriptType } from '@dxos/plugin-script/types';\nimport { useClient } from '@dxos/react-client';\nimport { Filter, type Space, useQuery } from '@dxos/react-client/echo';\nimport { Input, Select, useTranslation } from '@dxos/react-ui';\nimport { distinctBy } from '@dxos/util';\n\nimport { InputRow } from './Form';\nimport { invokeFunction } from './invokation-handler';\nimport { getFunctionMetaExtension, state } from './meta';\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nconst triggerTypes: FunctionTriggerType[] = ['subscription', 'timer', 'webhook', 'websocket'];\n\nconst registerTriggersMutex = new Mutex();\n\nexport const TriggerEditor = ({ space, trigger }: { space: Space; trigger: FunctionTrigger }) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const client = useClient();\n const scripts = useQuery(space, Filter.schema(ScriptType));\n const script = useMemo(() => scripts.find((script) => script.id === trigger.function), [trigger.function, scripts]);\n\n const triggerLabels: Record<FunctionTriggerType, string> = {\n subscription: t('trigger type subscription'),\n timer: t('trigger type timer'),\n webhook: t('trigger type webhook'),\n websocket: t('trigger type websocket'),\n };\n\n // TODO(burdon): Factor out, creating context for plugin (runs outside of component).\n const [registry] = useState(new Map<string, Context>());\n const triggers = useQuery(space, Filter.schema(FunctionTrigger));\n useEffect(() => {\n setTimeout(async () => {\n // Mark-and-sweep removing disabled triggers.\n await registerTriggersMutex.executeSynchronized(async () => {\n const deprecated = new Set(Array.from(registry.keys()));\n log.info('triggers', {\n deprecated,\n all: triggers.map((t) => t.id),\n enabled: triggers.filter((t) => t.enabled).map((t) => t.id),\n });\n\n for (const trigger of triggers) {\n if (trigger.enabled) {\n if (registry.has(trigger.id)) {\n deprecated.delete(trigger.id);\n continue;\n }\n log.info('activating trigger', trigger.id);\n\n const ctx = new Context();\n registry.set(trigger.id, ctx);\n const triggerSpec = trigger.spec;\n\n let triggerFactory: TriggerFactory<any>;\n if (triggerSpec.type === 'subscription') {\n triggerFactory = createSubscriptionTrigger;\n } else if (triggerSpec.type === 'websocket') {\n triggerFactory = createWebsocketTrigger;\n } else {\n log.info('unsupported trigger', { type: triggerSpec.type });\n continue;\n }\n\n await triggerFactory(ctx, space, trigger.spec, (data: any) => {\n return invokeFunction(client, space, trigger, data);\n });\n }\n }\n\n for (const id of deprecated) {\n const ctx = registry.get(id);\n if (ctx) {\n await ctx.dispose();\n registry.delete(id);\n }\n }\n });\n });\n }, [JSON.stringify(triggers)]);\n\n useEffect(() => {\n return () => {\n for (const ctx of registry.values()) {\n void ctx.dispose();\n }\n };\n }, []);\n\n useEffect(() => {\n void space.db.schemaRegistry\n .query()\n .then((schemas) => {\n // TODO(zan): We should solve double adding of stored schemas in the schema registry.\n state.schemas = distinctBy([...state.schemas, ...schemas], (schema) => schema.typename).sort((a, b) =>\n a.typename < b.typename ? -1 : 1,\n );\n })\n .catch(() => {});\n }, [space]);\n\n // Keen an enriched version of the schema in memory so we can share it with prompt editor.\n useEffect(() => {\n const spec = trigger.spec;\n if (spec.type === 'subscription') {\n if (spec.filter && spec.filter.length > 0) {\n const type = spec.filter[0].type;\n const foundSchema = state.schemas.find((schema) => schema.typename === type);\n if (foundSchema) {\n state.selectedSchema[trigger.id] = foundSchema;\n }\n }\n }\n // TODO(burdon): API issue.\n }, [JSON.stringify(trigger.spec), state.schemas]);\n\n useEffect(() => {\n if (!trigger.meta) {\n const extension = getFunctionMetaExtension(trigger, script);\n trigger.meta = extension?.initialValue?.();\n }\n }, [trigger.function, trigger.meta]);\n\n const handleSelectFunction = (value: string) => {\n const match = scripts.find((fn) => fn.id === value);\n if (match) {\n trigger.function = match.id;\n }\n };\n\n const handleSelectTriggerType = (triggerType: string) => {\n switch (triggerType as FunctionTriggerType) {\n case 'subscription': {\n trigger.spec = { type: 'subscription', filter: [] };\n break;\n }\n case 'timer': {\n trigger.spec = { type: 'timer', cron: '0 0 * * *' };\n break;\n }\n case 'webhook': {\n trigger.spec = { type: 'webhook', method: 'GET' };\n break;\n }\n case 'websocket': {\n // TODO(burdon): The `init` property is currently mail worker specific.\n trigger.spec = { type: 'websocket', url: '', init: { type: 'sync' } };\n break;\n }\n }\n };\n\n const TriggerMeta = getFunctionMetaExtension(trigger, script)?.component;\n\n return (\n <div className='flex flex-col py-1'>\n <table className='is-full table-fixed'>\n <tbody>\n <InputRow label={t('function select label')}>\n <Select.Root value={script?.id} onValueChange={handleSelectFunction}>\n <Select.TriggerButton classNames='w-full' placeholder={t('function select placeholder')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {scripts.map(({ id, name }) => (\n <Select.Option key={id} value={id}>\n {name ?? id}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </InputRow>\n {script?.description?.length && (\n <InputRow>\n <div className='px-2'>\n <p className='text-sm text-description'>{script?.description?.length}</p>\n </div>\n </InputRow>\n )}\n <InputRow label={t('trigger select label')}>\n <Select.Root value={trigger.spec?.type} onValueChange={handleSelectTriggerType}>\n <Select.TriggerButton placeholder={t('trigger select placeholder')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {triggerTypes.map((trigger) => (\n <Select.Option key={trigger} value={trigger}>\n {triggerLabels[trigger]}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </InputRow>\n </tbody>\n <tbody>\n {trigger.spec && <TriggerSpec space={space} spec={trigger.spec} />}\n <InputRow label={t('function enabled')}>\n {/* TODO(burdon): Hack to make the switch the same height as other controls. */}\n <div className='flex items-center h-8'>\n <Input.Switch checked={trigger.enabled} onCheckedChange={(checked) => (trigger.enabled = !!checked)} />\n </div>\n </InputRow>\n </tbody>\n {TriggerMeta && (\n <tbody>\n <tr>\n <td />\n <td className='py-2'>\n <div className='border-b border-separator' />\n </td>\n </tr>\n <TriggerMeta meta={trigger.meta} />\n </tbody>\n )}\n </table>\n </div>\n );\n};\n\n//\n// Trigger specs\n//\n\nconst TriggerSpecSubscription = ({ spec }: TriggerSpecProps<SubscriptionTrigger>) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n if (!spec.filter) {\n return null;\n }\n\n const handleValueChange = (typename: string) => {\n spec.filter = [{ type: typename }];\n };\n\n return (\n <>\n <InputRow label={t('trigger filter')}>\n <Select.Root value={spec.filter.length > 0 ? spec.filter[0].type : undefined} onValueChange={handleValueChange}>\n <Select.TriggerButton classNames='w-full' placeholder={'Select type'} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {state.schemas.map(({ typename }: any) => (\n <Select.Option key={typename} value={typename}>\n {typename}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </InputRow>\n </>\n );\n};\n\nconst TriggerSpecTimer = ({ spec }: TriggerSpecProps<TimerTrigger>) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <>\n <InputRow label={t('trigger cron')}>\n <Input.TextInput value={spec.cron} onChange={(event) => (spec.cron = event.target.value)} />\n </InputRow>\n </>\n );\n};\n\nconst methods = ['GET', 'POST'];\n\nconst TriggerSpecWebhook = ({ spec }: TriggerSpecProps<WebhookTrigger>) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <>\n <InputRow label={t('trigger method')}>\n <Select.Root value={spec.method} onValueChange={(value) => (spec.method = value)}>\n <Select.TriggerButton placeholder={'type'} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {methods.map((method) => (\n <Select.Option key={method} value={method}>\n {method}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </InputRow>\n </>\n );\n};\n\nconst TriggerSpecWebsocket = ({ spec }: TriggerSpecProps<WebsocketTrigger>) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n const handleChangeInit: ChangeEventHandler<HTMLInputElement> = (event) => {\n try {\n spec.init = JSON.parse(event.target.value);\n } catch (err) {\n // Ignore.\n }\n };\n\n return (\n <>\n <InputRow label={t('trigger method')}>\n <Input.TextInput\n value={spec.url}\n onChange={(event) => (spec.url = event.target.value)}\n placeholder='https://'\n />\n </InputRow>\n <InputRow label='Init'>\n <Input.TextInput value={JSON.stringify(spec.init)} onChange={handleChangeInit} placeholder='Initial message.' />\n </InputRow>\n </>\n );\n};\n\n//\n// Trigger spec.\n//\n\ntype TriggerSpecProps<T = TriggerSpec> = { space: Space; spec: T };\n\nconst triggerRenderers: {\n [key in FunctionTriggerType]: FC<TriggerSpecProps<any>>;\n} = {\n subscription: TriggerSpecSubscription,\n timer: TriggerSpecTimer,\n webhook: TriggerSpecWebhook,\n websocket: TriggerSpecWebsocket,\n};\n\nconst TriggerSpec = ({ space, spec }: TriggerSpecProps) => {\n const Component = triggerRenderers[spec.type];\n return Component ? <Component space={space} spec={spec} /> : null;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Input } from '@dxos/react-ui';\n\nexport const InputRow = ({ label, children }: PropsWithChildren<{ label?: string }>) => (\n <Input.Root>\n <tr>\n <td className='w-[80px] px-2 text-right align-top pt-3 overflow-hidden'>\n <Input.Label classNames='truncate text-xs'>{label}</Input.Label>\n </td>\n <td className='p-1 pr-2'>{children}</td>\n </tr>\n </Input.Root>\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { sleep } from '@dxos/async';\nimport { getObjectCore } from '@dxos/echo-db';\nimport type { AnyObjectData } from '@dxos/echo-schema';\nimport { type FunctionTrigger } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { DXN, LOCAL_SPACE_TAG } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { FunctionType } from '@dxos/plugin-script';\nimport { type Client, type Config } from '@dxos/react-client';\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { handleEmail } from './email';\n\nconst MAX_RETRIES = 3;\nconst RETRY_DELAY = 1_000;\n\nconst callFunction = async (funcUrl: string, trigger: any, data: any) => {\n const body = { event: 'trigger', trigger, data };\n\n let retryCount = 0;\n while (retryCount < MAX_RETRIES) {\n log.info('exec', { funcUrl, body, retryCount });\n const response = await fetch(funcUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n });\n\n const data = await response.text();\n log.info('response', { status: response.status, body: data });\n if (response.status === 409) {\n retryCount++;\n await sleep(RETRY_DELAY * Math.min(retryCount, 2));\n continue;\n }\n\n return { status: response.status, data };\n }\n return { status: 500 };\n};\n\nexport const invokeFunction = async (client: Client, space: Space, trigger: FunctionTrigger, data: any) => {\n try {\n if (trigger.spec.type === 'websocket') {\n return handleEmail(space, data.data);\n }\n\n const script = await space.crud.query({ id: trigger.function }).first();\n const { objects: functions } = await space.crud.query({ __typename: FunctionType.typename }).run();\n const func = functions.find((fn) => referenceEquals(fn.source, trigger.function)) as AnyObjectData | undefined;\n const funcSlug = func?.__meta.keys.find((key) => key.source === USERFUNCTIONS_META_KEY)?.id;\n if (!funcSlug) {\n log.warn('function not deployed', { scriptId: script.id, name: script.name });\n return 404;\n }\n\n const funcUrl = getFunctionUrl(client.config, funcSlug, space.id);\n const triggerData: AnyObjectData = {\n ...getObjectCore(trigger).toPlainObject(),\n // TODO: Remove when functions can query by DXN.\n promptId: trigger.meta?.prompt?.id,\n };\n // TODO: Remove when functions can add objects and easily modify collections (push, splice).\n return (await callFunction(funcUrl, triggerData, data)).status;\n } catch (err) {\n return 400;\n }\n};\n\nconst USERFUNCTIONS_META_KEY = 'dxos.org/service/function';\n\nconst getFunctionUrl = (config: Config, slug: string, spaceId?: string) => {\n const baseUrl = new URL('functions/', config.values.runtime?.services?.edge?.url);\n\n // Leading slashes cause the URL to be treated as an absolute path.\n const relativeUrl = slug.replace(/^\\//, '');\n const url = new URL(`./${relativeUrl}`, baseUrl.toString());\n spaceId && url.searchParams.set('spaceId', spaceId);\n url.protocol = 'https';\n return url.toString();\n};\n\n// TODO(dmaretskyi): Factor out.\n\ntype ReferenceLike = { '/': string } | string;\n\nconst referenceEquals = (a: ReferenceLike, b: ReferenceLike): boolean => {\n const aDXN = toDXN(a);\n const bDXN = toDXN(b);\n return aDXN.toString() === bDXN.toString();\n};\n\nconst toDXN = (ref: ReferenceLike): DXN => {\n if (typeof ref === 'string') {\n if (ref.startsWith('dxn:')) {\n return DXN.parse(ref);\n } else {\n return new DXN(DXN.kind.ECHO, [LOCAL_SPACE_TAG, ref]);\n }\n }\n\n invariant(typeof ref['/'] === 'string');\n return DXN.parse(ref['/']);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { findObjectWithForeignKey } from '@dxos/echo-db';\nimport { create, foreignKey } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { MailboxType } from '@dxos/plugin-inbox/types';\nimport { MessageType } from '@dxos/plugin-space/types';\nimport { type Space, Filter } from '@dxos/react-client/echo';\n\nexport const SOURCE_ID = 'hub.dxos.network/api/mailbox';\n\nexport const handleEmail = async (space: Space, data: any) => {\n const { messages } = data;\n\n // Create mailbox if doesn't exist.\n const { objects: mailboxes } = await space.db.query(Filter.schema(MailboxType)).run();\n const mailbox = mailboxes[0] ?? space.db.add(create(MailboxType, { messages: [] }));\n\n log.info('messages', { count: messages.length, existingMailbox: mailboxes.length > 0 });\n\n const { objects } = await space.db.query(Filter.schema(MessageType)).run();\n for (const message of messages) {\n let object = findObjectWithForeignKey(objects, { source: SOURCE_ID, id: String(message.id) });\n if (!object) {\n object = space.db.add(\n create(\n MessageType,\n {\n sender: { email: message.from },\n timestamp: new Date(message.created).toISOString(),\n text: message.body,\n properties: {\n subject: message.subject,\n to: [{ email: message.to }],\n },\n },\n {\n keys: [foreignKey(SOURCE_ID, String(message.id))],\n },\n ),\n );\n mailbox.messages?.push(object);\n }\n }\n\n return 200;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { create, getMeta as getEchoMeta } from '@dxos/echo-schema';\nimport { type FunctionTrigger } from '@dxos/functions/types';\nimport { GameType } from '@dxos/plugin-chess/types';\nimport { FileType } from '@dxos/plugin-ipfs/types';\nimport { DocumentType } from '@dxos/plugin-markdown';\nimport { type ScriptType } from '@dxos/plugin-script';\nimport { DiagramType } from '@dxos/plugin-sketch/types';\nimport { CollectionType, MessageType } from '@dxos/plugin-space';\nimport { Input } from '@dxos/react-ui';\nimport { safeParseInt } from '@dxos/util';\n\nimport { InputRow } from './Form';\nimport { chainPresets } from '../../presets';\nimport { type ChainPromptType } from '../../types';\nimport { ChainPresets } from '../Chain';\nimport { PromptEditor } from '../PromptEditor';\n\n// TODO(burdon): Factor out deps (remove from package.json). Provide via plugins.\n\ntype TriggerId = string;\n\nconst stateInitialValues = {\n schemas: [\n // TODO(burdon): Get all schema from API.\n DocumentType,\n FileType,\n GameType,\n MessageType,\n DiagramType,\n CollectionType,\n ] as any[],\n selectedSchema: {} as Record<TriggerId, any>,\n};\n\n// TODO(burdon): What is this for?\nexport const state = create<typeof stateInitialValues>(stateInitialValues);\n\n//\n// Trigger meta.\n// TODO(burdon): Custom/generated UX to provide values to functions from types/other metadata.\n//\n\ntype MetaProps<T> = { meta: T } & { triggerId?: string };\n\ntype MetaExtension<T> = {\n initialValue?: () => T;\n component: FC<MetaProps<T>>;\n};\n\nconst USERFUNCTIONS_PRESET_META_KEY = 'dxos.org/service/function-preset';\n\n/**\n * Create meta type from function.\n * @param trigger - function trigger.\n * @param script - function script.\n */\nexport const getFunctionMetaExtension = (\n trigger: FunctionTrigger,\n script?: ScriptType,\n): MetaExtension<any> | undefined => {\n if (script) {\n const meta = getEchoMeta(script).keys.find((key) => key.source === USERFUNCTIONS_PRESET_META_KEY);\n const extension = meta && metaExtensions[meta.id];\n if (extension) {\n return extension;\n }\n }\n // TODO: try to infer by spec type?\n return trigger?.function ? metaExtensions[trigger.function] : metaExtensions['dxos.org/function/gpt'];\n};\n\n//\n// Default (generic).\n// TODO(burdon): Create property editor.\n//\n\ntype DefaultMeta = {};\n\nconst DefaultMetaProps = ({ meta }: MetaProps<DefaultMeta>) => {\n return <></>;\n};\n\n//\n// Chess\n//\n\ntype ChessMeta = { level?: number };\n\nconst ChessMetaProps = ({ meta }: MetaProps<ChessMeta>) => {\n if (!meta) {\n return null;\n }\n\n return (\n <>\n <InputRow label='Level'>\n <Input.TextInput\n type='number'\n value={meta.level ?? 1}\n onChange={(event) => (meta.level = safeParseInt(event.target.value))}\n placeholder='Engine strength.'\n />\n </InputRow>\n </>\n );\n};\n\n//\n// Email\n//\n\ntype EmailWorkerMeta = { account?: string };\n\nconst EmailWorkerMetaProps = ({ meta }: MetaProps<EmailWorkerMeta>) => {\n if (!meta) {\n return null;\n }\n\n return (\n <>\n <InputRow label='Account'>\n <Input.TextInput\n value={meta.account ?? ''}\n onChange={(event) => (meta.account = event.target.value)}\n placeholder='https://'\n />\n </InputRow>\n </>\n );\n};\n\n//\n// Chain\n//\n\ntype ChainPromptMeta = { model?: string; prompt?: ChainPromptType };\n\nconst ChainPromptMetaProps = ({ meta, triggerId }: MetaProps<ChainPromptMeta>) => {\n const schema = triggerId ? state.selectedSchema[triggerId] : undefined;\n if (!meta) {\n return null;\n }\n\n return (\n <>\n <InputRow label='Model'>\n <Input.TextInput\n value={meta.model ?? ''}\n onChange={(event) => (meta.model = event.target.value)}\n placeholder='llama2'\n />\n </InputRow>\n <InputRow label='Presets'>\n <ChainPresets\n presets={chainPresets}\n onSelect={(preset) => {\n meta.prompt = preset.createPrompt();\n }}\n />\n </InputRow>\n {meta.prompt && (\n <InputRow label='Prompt'>\n <PromptEditor prompt={meta.prompt} schema={schema} />\n </InputRow>\n )}\n </>\n );\n};\n\n//\n// Embedding\n//\n\ntype EmbeddingMeta = { model?: string; prompt?: ChainPromptType };\n\nconst EmbeddingMetaProps = ({ meta }: MetaProps<EmbeddingMeta>) => {\n if (!meta) {\n return null;\n }\n\n return (\n <>\n <InputRow label='Model'>\n <Input.TextInput\n value={meta.model ?? ''}\n onChange={(event) => (meta.model = event.target.value)}\n placeholder='llama2'\n />\n </InputRow>\n </>\n );\n};\n\nconst metaExtensions: Record<string, MetaExtension<any>> = {\n __DEFAULT__: {\n initialValue: () => ({}),\n component: DefaultMetaProps,\n } satisfies MetaExtension<DefaultMeta>,\n\n 'dxos.org/function/chess': {\n initialValue: () => ({ level: 2 }),\n component: ChessMetaProps,\n } satisfies MetaExtension<ChessMeta>,\n\n 'dxos.org/function/email-worker': {\n initialValue: () => ({ account: 'hello@dxos.network' }),\n component: EmailWorkerMetaProps,\n } satisfies MetaExtension<EmailWorkerMeta>,\n\n 'dxos.org/function/gpt': {\n initialValue: () => ({ model: 'llama2' }),\n component: ChainPromptMetaProps,\n } satisfies MetaExtension<ChainPromptMeta>,\n\n 'dxos.org/function/embedding': {\n initialValue: () => ({ model: 'llama2' }),\n component: EmbeddingMetaProps,\n } satisfies MetaExtension<EmbeddingMeta>,\n};\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 subscription': 'Subscription',\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n\n 'trigger filter': 'Filter',\n 'trigger cron': 'Cron',\n 'trigger method': 'Method',\n 'trigger endpoint': 'Endpoint',\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAkF;AAClF,mBAA6C;AAC7C,uBAA0B;AAC1B,2BAAkC;AAClC,0BAA0C;AAC1C,kBAA2D;ACP3D,IAAAA,gBAAqB;ACArB,IAAAA,gBAAkB;AAElB,sBAAsC;ACFtC,IAAAA,gBAA+B;AAE/B,IAAAC,eAAyB;AACzB,IAAAC,mBAAuC;AACvC,kBAA4B;ACJ5B,yBAAuB;ACAvB,IAAAF,gBAAsF;AAEtF,mBAAsB;AACtB,qBAAwB;AACxB,uBAAuF;AACvF,IAAAG,gBAQO;AACP,iBAAoB;AACpB,IAAAA,gBAA2B;AAC3B,0BAA0B;AAC1B,IAAAF,eAA6C;AAC7C,IAAAC,mBAA8C;AAC9C,IAAAE,eAA2B;ACnB3B,IAAAJ,gBAA8C;AAE9C,IAAAE,mBAAsB;ACFtB,IAAAG,gBAAsB;AACtB,qBAA8B;AAG9B,IAAAC,oBAA0B;AAC1B,kBAAqC;AACrC,IAAAC,cAAoB;AACpB,2BAA6B;ACP7B,IAAAC,kBAAyC;AACzC,IAAAC,sBAAmC;AACnC,IAAAF,cAAoB;AACpB,IAAAJ,gBAA4B;AAC5B,IAAAA,gBAA4B;AAC5B,IAAAF,eAAmC;ACLnC,IAAAD,gBAA+B;AAE/B,IAAAS,sBAA+C;AAE/C,IAAAN,gBAAyB;AACzB,IAAAA,gBAAyB;AACzB,6BAA6B;AAE7B,IAAAA,gBAA4B;AAC5B,0BAA4C;AAC5C,IAAAD,mBAAsB;AACtB,IAAAE,eAA6B;APLtB,IAAMM,kBAAkB,MAAA;AAC7B,QAAMC,eAAe,MAAA;EAAO;AAE5B,SACE,8BAAAC,QAAA,cAACC,OAAAA;IAAIC,WAAU;KACb,8BAAAF,QAAA,c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AAI,CAACtN,UAAU,CAACsN,WAAW;AACzB;gBACF;AAEA,sBAAM1J,OAAOsJ,YAAQe,yBAAYjO,MAAAA,KAAW,EAAA;AAC5C,sBAAM1B,QAAQsF,KAAKtF,QAAQ0B,MAAAA,KACzBA,OAAOhE,QACP4H,KAAK5F,eAAe;kBAAC;kBAAiC;oBAAEkO,IAAIvO;kBAAkB;;AAEhF,uBAAO;kBACLtC;kBACAQ;kBACAiD,MAAM;kBACN8B,YAAY;oBACVhG;oBACA0D;oBACA0B;kBACF;gBACF;cACF;YACF,CAAA;;QAEJ;MACF;MACAkO,SAAS;QACP3G,WAAW,CAAC,EAAEzI,MAAMqP,KAAI,MAAE;AACxB,kBAAQA,MAAAA;;;YAIN,KAAK;AACH,qBAAOhU,6BAAAA,QAAA,cAACF,iBAAAA,IAAAA;UACZ;AAEA,iBAAO;QACT;MACF;MACAmU,QAAQ;QACNjB,UAAU,CAACiB,WAAAA;AACT,kBAAQA,OAAOC,QAAM;YACnB,KAAKC,uCAAiBC,QAAQ;AAC5B,qBAAO,CAGP;YACF;UACF;QACF;MACF;IACF;EACF;AACF;AWvJA,IAAA,cAAe1C;",
|
|
6
|
-
"names": ["import_react", "import_echo", "import_react_ui", "import_types", "
|
|
3
|
+
"sources": ["../../../src/AutomationPlugin.tsx", "../../../src/components/index.ts", "../../../src/components/AutomationPanel.tsx", "../../../src/components/Chain.tsx", "../../../src/presets.ts", "../../../src/components/TriggerEditor/TriggerEditor.tsx", "../../../src/components/TriggerEditor/Form.tsx", "../../../src/components/TriggerEditor/meta.tsx", "../../../src/hooks/useLocalTriggerManager.ts", "../../../src/hooks/invocation-handler.ts", "../../../src/hooks/email.ts", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type PluginDefinition, parseMetadataResolverPlugin, resolvePlugin } from '@dxos/app-framework';\nimport { FunctionDef, FunctionTrigger } from '@dxos/functions/types';\nimport { invariant } from '@dxos/invariant';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { createExtension, toSignal } from '@dxos/plugin-graph';\nimport { getTypename, loadObjectReferences, parseId } from '@dxos/react-client/echo';\n\nimport { AutomationPanel } from './components';\nimport meta, { AUTOMATION_PLUGIN } from './meta';\nimport translations from './translations';\nimport { AutomationAction, 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: (chain: ChainType) => loadObjectReferences(chain, (chain) => chain.prompts),\n },\n },\n },\n translations,\n echo: {\n schema: [ChainType, ChainPromptType, FunctionDef, FunctionTrigger],\n },\n complementary: {\n panels: [\n {\n id: 'automation',\n label: ['open automation panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--flow-arrow--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--flow-arrow--regular';\n\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const space = client.spaces.get().find((space) => space.id === spaceId);\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 = toSignal(\n (onChange) => {\n const timeout = setTimeout(async () => {\n await space?.db.loadObjectById(objectId);\n onChange();\n });\n\n return () => clearTimeout(timeout);\n },\n () => space?.db.getObjectById(objectId),\n subjectId,\n );\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 ];\n },\n },\n surface: {\n component: ({ data, role }) => {\n switch (role) {\n // case 'article':\n // return data.object instanceof ChainType ? <ChainArticle chain={data.object} /> : null;\n\n case 'complementary--automation':\n return <AutomationPanel />;\n }\n\n return null;\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case AutomationAction.CREATE: {\n return {\n // data: create(ChainType, { prompts: [] }),\n // data: create(FunctionTrigger, { function: '', spec: { type: 'timer', cron: '' } }),\n };\n }\n }\n },\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const PromptContainer = lazy(() => import('./PromptContainer'));\n\nexport * from './AutomationPanel';\nexport * from './Chain';\nexport * from './PromptEditor';\nexport * from './TriggerEditor';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Button, Icon, Toolbar } from '@dxos/react-ui';\n\n// TODO(burdon): Form components.\n\nexport const AutomationPanel = () => {\n const handleCreate = () => {};\n\n return (\n <div className='flex flex-col'>\n <Toolbar.Root classNames='p-2'>\n <Button onClick={handleCreate}>\n <Icon icon='ph--plus--regular' />\n </Button>\n </Toolbar.Root>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Select, useTranslation } from '@dxos/react-ui';\nimport { nonNullable } from '@dxos/util';\n\nimport { PromptEditor } from './PromptEditor';\nimport { AUTOMATION_PLUGIN } from '../meta';\nimport { chainPresets, type Preset } from '../presets';\nimport { type ChainType } from '../types';\n\nexport type ChainProps = {\n chain: ChainType;\n};\n\nexport const Chain = ({ chain }: ChainProps) => {\n const space = getSpace(chain);\n if (!space) {\n return null;\n }\n\n const handleSelectPreset = (preset: Preset) => {\n chain.name = preset.title;\n // TODO(burdon): API issue.\n chain.prompts?.filter(nonNullable).forEach((prompt) => space.db.remove(prompt));\n chain.prompts = [preset.createPrompt()];\n };\n\n return (\n <div className='flex flex-col my-2 gap-4'>\n {chain.prompts?.filter(nonNullable).map((prompt, i) => <PromptEditor key={i} prompt={prompt} />)}\n <div className='p-2'>\n <ChainPresets presets={chainPresets} onSelect={handleSelectPreset} />\n </div>\n </div>\n );\n};\n\nexport const ChainPresets: FC<{ presets: Preset[]; onSelect: (preset: Preset) => void }> = ({ presets, onSelect }) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n return (\n <Select.Root\n onValueChange={(value) => {\n onSelect(presets.find(({ id }) => id === value)!);\n }}\n >\n <Select.TriggerButton classNames='w-full' placeholder={t('select preset template placeholder')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {presets.map(({ id, title }) => (\n <Select.Option key={id} value={id}>\n {title}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { create } from '@dxos/echo-schema';\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 2024 DXOS.org\n//\n\nimport React, { type ChangeEventHandler, type FC, useEffect, useMemo } from 'react';\n\nimport {\n FunctionTriggerSchema,\n type FunctionTriggerType,\n type FunctionTrigger,\n type SubscriptionTrigger,\n type TimerTrigger,\n type TriggerType,\n type TriggerKind,\n type WebhookTrigger,\n type WebsocketTrigger,\n} from '@dxos/functions/types';\nimport { invariant } from '@dxos/invariant';\nimport { ScriptType } from '@dxos/plugin-script/types';\nimport { Filter, type Space, useQuery } from '@dxos/react-client/echo';\nimport { Input, Select, useTranslation } from '@dxos/react-ui';\nimport { Form, SelectInput } from '@dxos/react-ui-form';\nimport { distinctBy } from '@dxos/util';\n\nimport { InputRow } from './Form';\nimport { getFunctionMetaExtension, state } from './meta';\nimport { useLocalTriggerManager } from '../../hooks';\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nconst triggerTypes: TriggerKind[] = ['timer', 'webhook', 'websocket', 'subscription'];\n\nexport type TriggerEditorProps = {\n space: Space;\n trigger: FunctionTrigger;\n};\n\nexport const TriggerEditor = ({ space, trigger }: TriggerEditorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const scripts = useQuery(space, Filter.schema(ScriptType));\n const script = useMemo(() => scripts.find((script) => script.id === trigger.function), [trigger.function, scripts]);\n useLocalTriggerManager(space);\n\n const triggerLabels: Record<TriggerKind, string> = {\n subscription: t('trigger type subscription'),\n timer: t('trigger type timer'),\n webhook: t('trigger type webhook'),\n websocket: t('trigger type websocket'),\n };\n\n useEffect(() => {\n void space.db.schemaRegistry\n .query()\n .then((schemas) => {\n // TODO(zan): We should solve double adding of stored schemas in the schema registry.\n state.schemas = distinctBy([...state.schemas, ...schemas], (schema) => schema.typename).sort((a, b) =>\n a.typename < b.typename ? -1 : 1,\n );\n })\n .catch(() => {});\n }, [space]);\n\n // Keen an enriched version of the schema in memory so we can share it with prompt editor.\n useEffect(() => {\n const spec = trigger.spec;\n invariant(spec);\n if (spec.type === 'subscription') {\n if (spec.filter) {\n const type = spec.filter.type;\n const foundSchema = state.schemas.find((schema) => schema.typename === type);\n if (foundSchema) {\n state.selectedSchema[trigger.id] = foundSchema;\n }\n }\n }\n // TODO(burdon): API issue.\n }, [JSON.stringify(trigger.spec), state.schemas]);\n\n useEffect(() => {\n if (!trigger.meta) {\n const extension = getFunctionMetaExtension(trigger, script);\n trigger.meta = extension?.initialValue?.();\n }\n }, [trigger.function, trigger.meta]);\n\n const handleSelectFunction = (value: string) => {\n const match = scripts.find((fn) => fn.id === value);\n if (match) {\n trigger.function = match.id;\n }\n };\n\n const handleSelectTriggerType = (triggerType: string) => {\n switch (triggerType as TriggerKind) {\n case 'subscription': {\n trigger.spec = { type: 'subscription', filter: {} };\n break;\n }\n case 'timer': {\n trigger.spec = { type: 'timer', cron: '0 0 * * *' };\n break;\n }\n case 'webhook': {\n trigger.spec = { type: 'webhook', method: 'GET' };\n break;\n }\n case 'websocket': {\n // TODO(burdon): The `init` property is currently mail worker specific.\n trigger.spec = { type: 'websocket', url: '', init: { type: 'sync' } };\n break;\n }\n }\n };\n\n const TriggerMeta = getFunctionMetaExtension(trigger, script)?.component;\n\n const test = true;\n if (test) {\n const object: FunctionTriggerType = {\n spec: {\n // type: 'timer',\n type: 'subscription',\n // cron: '0 0 * * *'\n filter: { type: 'dxos.org/type/Event' },\n },\n };\n\n return (\n <Form<FunctionTriggerType>\n schema={FunctionTriggerSchema}\n values={object}\n filter={(props) => props.filter((p) => p.name !== 'meta')}\n Custom={{\n ['function' satisfies keyof FunctionTriggerType]: (props) => (\n <SelectInput<FunctionTriggerType>\n {...props}\n // TODO(burdon): Query for functions.\n options={[].map((value) => ({\n value,\n label: value,\n }))}\n />\n ),\n ['spec.type' as const]: (props) => (\n <SelectInput<FunctionTriggerType>\n {...props}\n options={['timer', 'subscription'].map((value) => ({\n value,\n label: value,\n }))}\n />\n ),\n }}\n />\n );\n }\n\n return (\n <div className='flex flex-col py-1'>\n <table className='is-full table-fixed'>\n <tbody>\n <InputRow label={t('function select label')}>\n <Select.Root value={script?.id} onValueChange={handleSelectFunction}>\n <Select.TriggerButton classNames='w-full' placeholder={t('function select placeholder')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {scripts.map(({ id, name }) => (\n <Select.Option key={id} value={id}>\n {name ?? id}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </InputRow>\n {script?.description?.length && (\n <InputRow>\n <div className='px-2'>\n <p className='text-sm text-description'>{script?.description?.length}</p>\n </div>\n </InputRow>\n )}\n <InputRow label={t('trigger select label')}>\n <Select.Root value={trigger.spec?.type} onValueChange={handleSelectTriggerType}>\n <Select.TriggerButton placeholder={t('trigger select placeholder')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {triggerTypes.map((trigger) => (\n <Select.Option key={trigger} value={trigger}>\n {triggerLabels[trigger]}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </InputRow>\n </tbody>\n <tbody>\n {trigger.spec && <TriggerType space={space} spec={trigger.spec} />}\n <InputRow label={t('function enabled')}>\n {/* TODO(burdon): Hack to make the switch the same height as other controls. */}\n <div className='flex items-center h-8'>\n <Input.Switch checked={trigger.enabled} onCheckedChange={(checked) => (trigger.enabled = !!checked)} />\n </div>\n </InputRow>\n </tbody>\n {TriggerMeta && trigger.meta && (\n <tbody>\n <tr>\n <td />\n <td className='py-2'>\n <div className='border-b border-separator' />\n </td>\n </tr>\n <TriggerMeta meta={trigger.meta} />\n </tbody>\n )}\n </table>\n </div>\n );\n};\n\n//\n// Trigger specs\n//\n\nconst TriggerSpecSubscription = ({ spec }: TriggerSpecProps<SubscriptionTrigger>) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n if (!spec.filter) {\n return null;\n }\n\n const handleValueChange = (typename: string) => {\n spec.filter = { type: typename };\n };\n\n return (\n <>\n <InputRow label={t('trigger filter')}>\n <Select.Root value={spec.filter?.type} onValueChange={handleValueChange}>\n <Select.TriggerButton classNames='w-full' placeholder={'Select type'} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {state.schemas.map(({ typename }: any) => (\n <Select.Option key={typename} value={typename}>\n {typename}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </InputRow>\n </>\n );\n};\n\nconst TriggerSpecTimer = ({ spec }: TriggerSpecProps<TimerTrigger>) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <>\n <InputRow label={t('trigger cron')}>\n <Input.TextInput value={spec.cron} onChange={(event) => (spec.cron = event.target.value)} />\n </InputRow>\n </>\n );\n};\n\nconst methods = ['GET', 'POST'];\n\nconst TriggerSpecWebhook = ({ spec }: TriggerSpecProps<WebhookTrigger>) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <>\n <InputRow label={t('trigger method')}>\n <Select.Root value={spec.method} onValueChange={(value) => (spec.method = value)}>\n <Select.TriggerButton placeholder={'type'} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {methods.map((method) => (\n <Select.Option key={method} value={method}>\n {method}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </InputRow>\n </>\n );\n};\n\nconst TriggerSpecWebsocket = ({ spec }: TriggerSpecProps<WebsocketTrigger>) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n\n const handleChangeInit: ChangeEventHandler<HTMLInputElement> = (event) => {\n try {\n spec.init = JSON.parse(event.target.value);\n } catch (err) {\n // Ignore.\n }\n };\n\n return (\n <>\n <InputRow label={t('trigger method')}>\n <Input.TextInput\n value={spec.url}\n onChange={(event) => (spec.url = event.target.value)}\n placeholder='https://'\n />\n </InputRow>\n <InputRow label='Init'>\n <Input.TextInput value={JSON.stringify(spec.init)} onChange={handleChangeInit} placeholder='Initial message.' />\n </InputRow>\n </>\n );\n};\n\n//\n// Trigger spec.\n//\n\ntype TriggerSpecProps<T = TriggerType> = { space: Space; spec: T };\n\nconst triggerRenderers: {\n [key in TriggerKind]: FC<TriggerSpecProps<any>>;\n} = {\n subscription: TriggerSpecSubscription,\n timer: TriggerSpecTimer,\n webhook: TriggerSpecWebhook,\n websocket: TriggerSpecWebsocket,\n};\n\nconst TriggerType = ({ space, spec }: TriggerSpecProps) => {\n const Component = triggerRenderers[spec.type];\n return Component ? <Component space={space} spec={spec} /> : null;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Input } from '@dxos/react-ui';\n\nexport const InputRow = ({ label, children }: PropsWithChildren<{ label?: string }>) => (\n <Input.Root>\n <tr>\n <td className='w-[80px] px-2 text-right align-top pt-3 overflow-hidden'>\n <Input.Label classNames='truncate text-xs'>{label}</Input.Label>\n </td>\n <td className='p-1 pr-2'>{children}</td>\n </tr>\n </Input.Root>\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { create, getMeta as getEchoMeta } from '@dxos/echo-schema';\nimport { type FunctionTrigger } from '@dxos/functions/types';\nimport { GameType } from '@dxos/plugin-chess/types';\nimport { FileType } from '@dxos/plugin-ipfs/types';\nimport { DocumentType } from '@dxos/plugin-markdown';\nimport { type ScriptType } from '@dxos/plugin-script';\nimport { DiagramType } from '@dxos/plugin-sketch/types';\nimport { CollectionType, MessageType } from '@dxos/plugin-space';\nimport { Input } from '@dxos/react-ui';\nimport { safeParseInt } from '@dxos/util';\n\nimport { InputRow } from './Form';\nimport { chainPresets } from '../../presets';\nimport { type ChainPromptType } from '../../types';\nimport { ChainPresets } from '../Chain';\nimport { PromptEditor } from '../PromptEditor';\n\n// TODO(burdon): Factor out deps (remove from package.json). Provide via plugins.\n\ntype TriggerId = string;\n\nconst stateInitialValues = {\n schemas: [\n // TODO(burdon): Get all schema from API.\n DocumentType,\n FileType,\n GameType,\n MessageType,\n DiagramType,\n CollectionType,\n ] as any[],\n selectedSchema: {} as Record<TriggerId, any>,\n};\n\n// TODO(burdon): What is this for?\nexport const state = create<typeof stateInitialValues>(stateInitialValues);\n\n//\n// Trigger meta.\n// TODO(burdon): Custom/generated UX to provide values to functions from types/other metadata.\n//\n\ntype MetaProps<T> = { meta: T } & { triggerId?: string };\n\ntype MetaExtension<T> = {\n initialValue?: () => T;\n component: FC<MetaProps<T>>;\n};\n\nconst USERFUNCTIONS_PRESET_META_KEY = 'dxos.org/service/function-preset';\n\n/**\n * Create meta type from function.\n * @param trigger - function trigger.\n * @param script - function script.\n */\nexport const getFunctionMetaExtension = (\n trigger: FunctionTrigger,\n script?: ScriptType,\n): MetaExtension<any> | undefined => {\n if (script) {\n const meta = getEchoMeta(script).keys.find((key) => key.source === USERFUNCTIONS_PRESET_META_KEY);\n const extension = meta && metaExtensions[meta.id];\n if (extension) {\n return extension;\n }\n }\n\n // TODO: try to infer by spec type?\n return trigger?.function ? metaExtensions[trigger.function] : metaExtensions['dxos.org/function/gpt'];\n};\n\n//\n// Default (generic).\n// TODO(burdon): Create property editor.\n//\n\ntype DefaultMeta = {};\n\nconst DefaultMetaProps = ({ meta }: MetaProps<DefaultMeta>) => {\n return <></>;\n};\n\n//\n// Chess\n//\n\ntype ChessMeta = { level?: number };\n\nconst ChessMetaProps = ({ meta }: MetaProps<ChessMeta>) => {\n if (!meta) {\n return null;\n }\n\n return (\n <>\n <InputRow label='Level'>\n <Input.TextInput\n type='number'\n value={meta.level ?? 1}\n onChange={(event) => (meta.level = safeParseInt(event.target.value))}\n placeholder='Engine strength.'\n />\n </InputRow>\n </>\n );\n};\n\n//\n// Email\n//\n\ntype EmailWorkerMeta = { account?: string };\n\nconst EmailWorkerMetaProps = ({ meta }: MetaProps<EmailWorkerMeta>) => {\n if (!meta) {\n return null;\n }\n\n return (\n <>\n <InputRow label='Account'>\n <Input.TextInput\n value={meta.account ?? ''}\n onChange={(event) => (meta.account = event.target.value)}\n placeholder='https://'\n />\n </InputRow>\n </>\n );\n};\n\n//\n// Chain\n//\n\ntype ChainPromptMeta = { model?: string; prompt?: ChainPromptType };\n\nconst ChainPromptMetaProps = ({ meta, triggerId }: MetaProps<ChainPromptMeta>) => {\n const schema = triggerId ? state.selectedSchema[triggerId] : undefined;\n if (!meta) {\n return null;\n }\n\n return (\n <>\n <InputRow label='Model'>\n <Input.TextInput\n value={meta.model ?? ''}\n onChange={(event) => (meta.model = event.target.value)}\n placeholder='llama2'\n />\n </InputRow>\n <InputRow label='Presets'>\n <ChainPresets\n presets={chainPresets}\n onSelect={(preset) => {\n meta.prompt = preset.createPrompt();\n }}\n />\n </InputRow>\n {meta.prompt && (\n <InputRow label='Prompt'>\n <PromptEditor prompt={meta.prompt} schema={schema} />\n </InputRow>\n )}\n </>\n );\n};\n\n//\n// Embedding\n//\n\ntype EmbeddingMeta = { model?: string; prompt?: ChainPromptType };\n\nconst EmbeddingMetaProps = ({ meta }: MetaProps<EmbeddingMeta>) => {\n if (!meta) {\n return null;\n }\n\n return (\n <>\n <InputRow label='Model'>\n <Input.TextInput\n value={meta.model ?? ''}\n onChange={(event) => (meta.model = event.target.value)}\n placeholder='llama2'\n />\n </InputRow>\n </>\n );\n};\n\nconst metaExtensions: Record<string, MetaExtension<any>> = {\n __DEFAULT__: {\n initialValue: () => ({}),\n component: DefaultMetaProps,\n } satisfies MetaExtension<DefaultMeta>,\n\n 'dxos.org/function/chess': {\n initialValue: () => ({ level: 2 }),\n component: ChessMetaProps,\n } satisfies MetaExtension<ChessMeta>,\n\n 'dxos.org/function/email-worker': {\n initialValue: () => ({ account: 'hello@dxos.network' }),\n component: EmailWorkerMetaProps,\n } satisfies MetaExtension<EmailWorkerMeta>,\n\n 'dxos.org/function/gpt': {\n initialValue: () => ({ model: 'llama2' }),\n component: ChainPromptMetaProps,\n } satisfies MetaExtension<ChainPromptMeta>,\n\n 'dxos.org/function/embedding': {\n initialValue: () => ({ model: 'llama2' }),\n component: EmbeddingMetaProps,\n } satisfies MetaExtension<EmbeddingMeta>,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { Mutex } from '@dxos/async';\nimport { Context } from '@dxos/context';\nimport { createSubscriptionTrigger, createWebsocketTrigger, type TriggerFactory } from '@dxos/functions';\nimport { FunctionTrigger } from '@dxos/functions/types';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { useClient } from '@dxos/react-client';\nimport { Filter, type Space, useQuery } from '@dxos/react-client/echo';\n\nimport { invokeFunction } from './invocation-handler';\n\nconst registerTriggersMutex = new Mutex();\n\nexport const useLocalTriggerManager = (space: Space) => {\n const client = useClient();\n\n // TODO(burdon): Factor out, creating context for plugin (runs outside of component).\n const [registry] = useState(new Map<string, Context>());\n const triggers = useQuery(space, Filter.schema(FunctionTrigger));\n useEffect(() => {\n setTimeout(async () => {\n // Mark-and-sweep removing disabled triggers.\n await registerTriggersMutex.executeSynchronized(async () => {\n const deprecated = new Set(Array.from(registry.keys()));\n log('triggers', {\n deprecated,\n all: triggers.map((t) => t.id),\n enabled: triggers.filter((t) => t.enabled).map((t) => t.id),\n });\n\n for (const trigger of triggers) {\n if (trigger.enabled) {\n if (registry.has(trigger.id)) {\n deprecated.delete(trigger.id);\n continue;\n }\n log.info('activating trigger', trigger.id);\n\n const ctx = new Context();\n registry.set(trigger.id, ctx);\n const triggerSpec = trigger.spec;\n invariant(triggerSpec);\n\n let triggerFactory: TriggerFactory<any>;\n if (triggerSpec.type === 'subscription') {\n triggerFactory = createSubscriptionTrigger;\n } else if (triggerSpec.type === 'websocket') {\n triggerFactory = createWebsocketTrigger;\n } else {\n log.info('unsupported trigger', { type: triggerSpec.type });\n continue;\n }\n\n await triggerFactory(ctx, space, trigger.spec, (data: any) => {\n return invokeFunction(client, space, trigger, data);\n });\n }\n }\n\n for (const id of deprecated) {\n const ctx = registry.get(id);\n if (ctx) {\n await ctx.dispose();\n registry.delete(id);\n }\n }\n });\n });\n }, [JSON.stringify(triggers)]);\n\n useEffect(() => {\n return () => {\n for (const ctx of registry.values()) {\n void ctx.dispose();\n }\n };\n }, []);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { sleep } from '@dxos/async';\nimport { getObjectCore } from '@dxos/echo-db';\nimport { type AnyObjectData } from '@dxos/echo-schema';\nimport { type FunctionTrigger } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { DXN, LOCAL_SPACE_TAG } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { FunctionType } from '@dxos/plugin-script';\nimport { type Client, type Config } from '@dxos/react-client';\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { handleEmail } from './email';\n\nconst MAX_RETRIES = 3;\nconst RETRY_DELAY = 1_000;\n\nconst callFunction = async (funcUrl: string, trigger: any, data: any) => {\n const body = { event: 'trigger', trigger, data };\n\n let retryCount = 0;\n while (retryCount < MAX_RETRIES) {\n log.info('exec', { funcUrl, body, retryCount });\n const response = await fetch(funcUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n });\n\n const data = await response.text();\n log.info('response', { status: response.status, body: data });\n if (response.status === 409) {\n retryCount++;\n await sleep(RETRY_DELAY * Math.min(retryCount, 2));\n continue;\n }\n\n return { status: response.status, data };\n }\n return { status: 500 };\n};\n\nexport const invokeFunction = async (client: Client, space: Space, trigger: FunctionTrigger, data: any) => {\n try {\n invariant(trigger.spec);\n invariant(trigger.function);\n if (trigger.spec.type === 'websocket') {\n return handleEmail(space, data.data);\n }\n\n const script = await space.crud.query({ id: trigger.function }).first();\n const { objects: functions } = await space.crud.query({ __typename: FunctionType.typename }).run();\n const func = functions.find((fn) => referenceEquals(fn.source, trigger.function!)) as AnyObjectData | undefined;\n const funcSlug = func?.__meta.keys.find((key) => key.source === USERFUNCTIONS_META_KEY)?.id;\n if (!funcSlug) {\n log.warn('function not deployed', { scriptId: script.id, name: script.name });\n return 404;\n }\n\n const funcUrl = getFunctionUrl(client.config, funcSlug, space.id);\n const triggerData: AnyObjectData = {\n ...getObjectCore(trigger).toPlainObject(),\n // TODO: Remove when functions can query by DXN.\n promptId: trigger.meta?.prompt?.id,\n };\n // TODO: Remove when functions can add objects and easily modify collections (push, splice).\n return (await callFunction(funcUrl, triggerData, data)).status;\n } catch (err) {\n return 400;\n }\n};\n\nconst USERFUNCTIONS_META_KEY = 'dxos.org/service/function';\n\nconst getFunctionUrl = (config: Config, slug: string, spaceId?: string) => {\n const baseUrl = new URL('functions/', config.values.runtime?.services?.edge?.url);\n\n // Leading slashes cause the URL to be treated as an absolute path.\n const relativeUrl = slug.replace(/^\\//, '');\n const url = new URL(`./${relativeUrl}`, baseUrl.toString());\n spaceId && url.searchParams.set('spaceId', spaceId);\n url.protocol = 'https';\n return url.toString();\n};\n\n// TODO(dmaretskyi): Factor out.\n\ntype ReferenceLike = { '/': string } | string;\n\nconst referenceEquals = (a: ReferenceLike, b: ReferenceLike): boolean => {\n const aDXN = toDXN(a);\n const bDXN = toDXN(b);\n return aDXN.toString() === bDXN.toString();\n};\n\nconst toDXN = (ref: ReferenceLike): DXN => {\n if (typeof ref === 'string') {\n if (ref.startsWith('dxn:')) {\n return DXN.parse(ref);\n } else {\n return new DXN(DXN.kind.ECHO, [LOCAL_SPACE_TAG, ref]);\n }\n }\n\n invariant(typeof ref['/'] === 'string');\n return DXN.parse(ref['/']);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { findObjectWithForeignKey } from '@dxos/echo-db';\nimport { create, foreignKey } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { MailboxType } from '@dxos/plugin-inbox/types';\nimport { MessageType } from '@dxos/plugin-space/types';\nimport { type Space, Filter } from '@dxos/react-client/echo';\n\nexport const SOURCE_ID = 'hub.dxos.network/api/mailbox';\n\nexport const handleEmail = async (space: Space, data: any) => {\n const { messages } = data;\n\n // Create mailbox if doesn't exist.\n const { objects: mailboxes } = await space.db.query(Filter.schema(MailboxType)).run();\n const mailbox = mailboxes[0] ?? space.db.add(create(MailboxType, { messages: [] }));\n\n log.info('messages', { count: messages.length, existingMailbox: mailboxes.length > 0 });\n\n const { objects } = await space.db.query(Filter.schema(MessageType)).run();\n for (const message of messages) {\n let object = findObjectWithForeignKey(objects, { source: SOURCE_ID, id: String(message.id) });\n if (!object) {\n object = space.db.add(\n create(\n MessageType,\n {\n sender: { email: message.from },\n timestamp: new Date(message.created).toISOString(),\n text: message.body,\n properties: {\n subject: message.subject,\n to: [{ email: message.to }],\n },\n },\n {\n keys: [foreignKey(SOURCE_ID, String(message.id))],\n },\n ),\n );\n mailbox.messages?.push(object);\n }\n }\n\n return 200;\n};\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 subscription': 'Subscription',\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n\n 'trigger filter': 'Filter',\n 'trigger cron': 'Cron',\n 'trigger method': 'Method',\n 'trigger endpoint': 'Endpoint',\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACxB,kBAAQA,MAAAA;;;YAIN,KAAK;AACH,qBAAOxU,6BAAAA,QAAA,cAACF,iBAAAA,IAAAA;UACZ;AAEA,iBAAO;QACT;MACF;MACA2U,QAAQ;QACNjB,UAAU,CAACiB,WAAAA;AACT,kBAAQA,OAAOC,QAAM;YACnB,KAAKC,uCAAiBC,QAAQ;AAC5B,qBAAO,CAGP;YACF;UACF;QACF;MACF;IACF;EACF;AACF;AYpJA,IAAA,cAAe1C;",
|
|
6
|
+
"names": ["import_react", "import_echo", "import_react_ui", "import_types", "import_invariant", "import_util", "import_echo_schema", "import_async", "import_log", "import_echo_db", "AutomationPanel", "handleCreate", "React", "div", "className", "Toolbar", "Root", "classNames", "Button", "onClick", "Icon", "icon", "str", "text", "filter", "value", "undefined", "flat", "join", "chainPresets", "id", "title", "createPrompt", "create", "ChainPromptType", "command", "template", "inputs", "type", "ChainInputType", "VALUE", "name", "PASS_THROUGH", "CONTEXT", "SCHEMA", "RETRIEVER", "RESOLVER", "Chain", "chain", "space", "getSpace", "handleSelectPreset", "preset", "prompts", "nonNullable", "forEach", "prompt", "db", "remove", "map", "i", "PromptEditor", "key", "ChainPresets", "presets", "onSelect", "t", "useTranslation", "AUTOMATION_PLUGIN", "Select", "onValueChange", "find", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "Option", "InputRow", "label", "children", "Input", "tr", "td", "Label", "stateInitialValues", "schemas", "DocumentType", "FileType", "GameType", "MessageType", "DiagramType", "CollectionType", "selectedSchema", "state", "USERFUNCTIONS_PRESET_META_KEY", "getFunctionMetaExtension", "trigger", "script", "meta", "getEchoMeta", "keys", "source", "extension", "metaExtensions", "function", "DefaultMetaProps", "ChessMetaProps", "TextInput", "level", "onChange", "event", "safeParseInt", "target", "EmailWorkerMetaProps", "account", "ChainPromptMetaProps", "triggerId", "schema", "model", "EmbeddingMetaProps", "__DEFAULT__", "initialValue", "component", "SOURCE_ID", "handleEmail", "data", "messages", "objects", "mailboxes", "query", "Filter", "MailboxType", "run", "mailbox", "add", "log", "info", "count", "length", "existingMailbox", "message", "object", "findObjectWithForeignKey", "String", "sender", "email", "from", "timestamp", "Date", "created", "toISOString", "body", "properties", "subject", "to", "foreignKey", "push", "MAX_RETRIES", "RETRY_DELAY", "callFunction", "funcUrl", "retryCount", "response", "fetch", "method", "headers", "JSON", "stringify", "status", "sleep", "Math", "min", "invokeFunction", "client", "invariant", "spec", "crud", "first", "functions", "__typename", "FunctionType", "typename", "func", "fn", "referenceEquals", "funcSlug", "__meta", "USERFUNCTIONS_META_KEY", "warn", "scriptId", "getFunctionUrl", "config", "triggerData", "getObjectCore", "toPlainObject", "promptId", "err", "slug", "spaceId", "baseUrl", "URL", "values", "runtime", "services", "edge", "url", "relativeUrl", "replace", "toString", "searchParams", "set", "protocol", "a", "b", "aDXN", "toDXN", "bDXN", "ref", "startsWith", "DXN", "parse", "kind", "ECHO", "LOCAL_SPACE_TAG", "registerTriggersMutex", "Mutex", "useLocalTriggerManager", "useClient", "registry", "useState", "Map", "triggers", "useQuery", "FunctionTrigger", "useEffect", "setTimeout", "executeSynchronized", "deprecated", "Set", "Array", "all", "enabled", "has", "delete", "ctx", "Context", "triggerSpec", "triggerFactory", "createSubscriptionTrigger", "createWebsocketTrigger", "get", "dispose", "triggerTypes", "TriggerEditor", "scripts", "ScriptType", "useMemo", "triggerLabels", "subscription", "timer", "webhook", "websocket", "schemaRegistry", "then", "distinctBy", "sort", "catch", "foundSchema", "handleSelectFunction", "match", "handleSelectTriggerType", "triggerType", "cron", "init", "TriggerMeta", "test", "Form", "FunctionTriggerSchema", "props", "p", "Custom", "SelectInput", "options", "table", "tbody", "description", "TriggerType", "Switch", "checked", "onCheckedChange", "TriggerSpecSubscription", "handleValueChange", "TriggerSpecTimer", "methods", "TriggerSpecWebhook", "TriggerSpecWebsocket", "handleChangeInit", "triggerRenderers", "Component", "PromptContainer", "lazy", "AutomationPlugin", "provides", "metadata", "records", "ChainType", "ns", "loadReferences", "loadObjectReferences", "translations", "echo", "FunctionDef", "complementary", "panels", "graph", "builder", "plugins", "clientPlugin", "resolvePlugin", "parseClientPlugin", "metadataPlugin", "parseMetadataResolverPlugin", "resolve", "resolver", "createExtension", "endsWith", "subjectId", "split", "objectId", "parseId", "spaces", "showResolvedThreads", "toSignal", "timeout", "loadObjectById", "clearTimeout", "getObjectById", "getTypename", "surface", "role", "intent", "action", "AutomationAction", "CREATE"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel.tsx":{"bytes":2118,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/prompt-extension.ts":{"bytes":4002,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","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/types/chain.ts":{"bytes":4247,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytes":1920,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":599,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/chain.ts","kind":"import-statement","original":"./chain"},{"path":"packages/plugins/experimental/plugin-automation/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/PromptEditor.tsx":{"bytes":23894,"imports":[{"path":"react","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-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/prompt-extension.ts","kind":"import-statement","original":"./prompt-extension"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts":{"bytes":555,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/PromptEditor.tsx","kind":"import-statement","original":"./PromptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/echo-schema","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/components/Chain.tsx":{"bytes":7176,"imports":[{"path":"react","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/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts","kind":"import-statement","original":"./PromptEditor"},{"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"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx":{"bytes":2078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/email.ts":{"bytes":6682,"imports":[{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-inbox/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/invokation-handler.ts":{"bytes":14280,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/email.ts","kind":"import-statement","original":"./email"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/meta.tsx":{"bytes":17556,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-chess/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx","kind":"import-statement","original":"./Form"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"../../presets"},{"path":"packages/plugins/experimental/plugin-automation/src/components/Chain.tsx","kind":"import-statement","original":"../Chain"},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts","kind":"import-statement","original":"../PromptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":42861,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-script/types","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/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx","kind":"import-statement","original":"./Form"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/invokation-handler.ts","kind":"import-statement","original":"./invokation-handler"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/meta.tsx","kind":"import-statement","original":"./meta"},{"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/PromptContainer.tsx":{"bytes":1607,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts","kind":"import-statement","original":"./PromptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1219,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/Chain.tsx","kind":"import-statement","original":"./Chain"},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts","kind":"import-statement","original":"./PromptEditor"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"./TriggerEditor"},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptContainer.tsx","kind":"dynamic-import","original":"./PromptContainer"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4161,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":20618,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/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"},{"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/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":67677},"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-4TMTUB4X.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-XS53UP75.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","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/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-script/types","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/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-inbox/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-chess/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/PromptContainer-74ZRO4HK.cjs","kind":"dynamic-import"}],"exports":["AutomationAction","AutomationPanel","AutomationPlugin","Chain","ChainInputSchema","ChainInputType","ChainPresets","ChainPromptType","ChainType","PromptContainer","PromptEditor","TriggerEditor","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":5445},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":106},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel.tsx":{"bytesInOutput":481},"packages/plugins/experimental/plugin-automation/src/components/Chain.tsx":{"bytesInOutput":1653},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":11844},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx":{"bytesInOutput":513},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/invokation-handler.ts":{"bytesInOutput":3584},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/email.ts":{"bytesInOutput":1706},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/meta.tsx":{"bytesInOutput":4119},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1175},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36}},"bytes":38137},"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-JSZ6PAYL.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-XS53UP75.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":298},"packages/plugins/experimental/plugin-automation/dist/lib/node/PromptContainer-74ZRO4HK.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":792},"packages/plugins/experimental/plugin-automation/dist/lib/node/PromptContainer-74ZRO4HK.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-4TMTUB4X.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-XS53UP75.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/PromptContainer.tsx","inputs":{"packages/plugins/experimental/plugin-automation/src/components/PromptContainer.tsx":{"bytesInOutput":282}},"bytes":589},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-4TMTUB4X.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14359},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-4TMTUB4X.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-XS53UP75.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"},{"path":"react","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-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["PromptEditor"],"inputs":{"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/PromptEditor.tsx":{"bytesInOutput":5699},"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/prompt-extension.ts":{"bytesInOutput":825},"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts":{"bytesInOutput":0}},"bytes":7007},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-XS53UP75.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3020},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-XS53UP75.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/chain.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytesInOutput":250}},"bytes":1845},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":763},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.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/components/AutomationPanel.tsx":{"bytes":2118,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/prompt-extension.ts":{"bytes":4002,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","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/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":1920,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"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/components/PromptEditor/PromptEditor.tsx":{"bytes":23894,"imports":[{"path":"react","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-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/prompt-extension.ts","kind":"import-statement","original":"./prompt-extension"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts":{"bytes":555,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/PromptEditor.tsx","kind":"import-statement","original":"./PromptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/echo-schema","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/components/Chain.tsx":{"bytes":7176,"imports":[{"path":"react","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/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts","kind":"import-statement","original":"./PromptEditor"},{"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"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx":{"bytes":2078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/meta.tsx":{"bytes":17560,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-chess/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx","kind":"import-statement","original":"./Form"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"../../presets"},{"path":"packages/plugins/experimental/plugin-automation/src/components/Chain.tsx","kind":"import-statement","original":"../Chain"},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts","kind":"import-statement","original":"../PromptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/hooks/email.ts":{"bytes":6663,"imports":[{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-inbox/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/hooks/invocation-handler.ts":{"bytes":14883,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/hooks/email.ts","kind":"import-statement","original":"./email"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/hooks/useLocalTriggerManager.ts":{"bytes":11522,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","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":"packages/plugins/experimental/plugin-automation/src/hooks/invocation-handler.ts","kind":"import-statement","original":"./invocation-handler"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/hooks/index.ts":{"bytes":559,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/hooks/useLocalTriggerManager.ts","kind":"import-statement","original":"./useLocalTriggerManager"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":37816,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-script/types","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":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx","kind":"import-statement","original":"./Form"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/hooks/index.ts","kind":"import-statement","original":"../../hooks"},{"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/PromptContainer.tsx":{"bytes":1607,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts","kind":"import-statement","original":"./PromptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1219,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/Chain.tsx","kind":"import-statement","original":"./Chain"},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts","kind":"import-statement","original":"./PromptEditor"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"./TriggerEditor"},{"path":"packages/plugins/experimental/plugin-automation/src/components/PromptContainer.tsx","kind":"dynamic-import","original":"./PromptContainer"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4161,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":20421,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/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"},{"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/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":70715},"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-YGRHTCOX.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-SUMUWFZA.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","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/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-script/types","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":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-chess/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions/types","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","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/async","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-inbox/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/PromptContainer-7RCGCU3K.cjs","kind":"dynamic-import"}],"exports":["AutomationAction","AutomationPanel","AutomationPlugin","Chain","ChainInputSchema","ChainInputType","ChainPresets","ChainPromptType","ChainType","PromptContainer","PromptEditor","TriggerEditor","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":5445},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":106},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel.tsx":{"bytesInOutput":481},"packages/plugins/experimental/plugin-automation/src/components/Chain.tsx":{"bytesInOutput":1653},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":10429},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/Form.tsx":{"bytesInOutput":513},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/meta.tsx":{"bytesInOutput":4102},"packages/plugins/experimental/plugin-automation/src/hooks/useLocalTriggerManager.ts":{"bytesInOutput":3269},"packages/plugins/experimental/plugin-automation/src/hooks/invocation-handler.ts":{"bytesInOutput":3881},"packages/plugins/experimental/plugin-automation/src/hooks/email.ts":{"bytesInOutput":1705},"packages/plugins/experimental/plugin-automation/src/hooks/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1175},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36}},"bytes":40389},"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-JSZ6PAYL.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-SUMUWFZA.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":298},"packages/plugins/experimental/plugin-automation/dist/lib/node/PromptContainer-7RCGCU3K.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":792},"packages/plugins/experimental/plugin-automation/dist/lib/node/PromptContainer-7RCGCU3K.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-YGRHTCOX.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-SUMUWFZA.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/PromptContainer.tsx","inputs":{"packages/plugins/experimental/plugin-automation/src/components/PromptContainer.tsx":{"bytesInOutput":282}},"bytes":589},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-YGRHTCOX.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14359},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-YGRHTCOX.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-SUMUWFZA.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"},{"path":"react","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-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["PromptEditor"],"inputs":{"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/PromptEditor.tsx":{"bytesInOutput":5699},"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/prompt-extension.ts":{"bytesInOutput":825},"packages/plugins/experimental/plugin-automation/src/components/PromptEditor/index.ts":{"bytesInOutput":0}},"bytes":7007},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-SUMUWFZA.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3021},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-SUMUWFZA.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs","kind":"import-statement"},{"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":250}},"bytes":1846},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":763},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JSZ6PAYL.cjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":333}},"bytes":489}}}
|
|
@@ -18,14 +18,14 @@ 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
|
-
AutomationAction: () =>
|
|
22
|
-
ChainInputSchema: () =>
|
|
23
|
-
ChainInputType: () =>
|
|
24
|
-
ChainPromptType: () =>
|
|
25
|
-
ChainType: () =>
|
|
21
|
+
AutomationAction: () => import_chunk_SUMUWFZA.AutomationAction,
|
|
22
|
+
ChainInputSchema: () => import_chunk_SUMUWFZA.ChainInputSchema,
|
|
23
|
+
ChainInputType: () => import_chunk_SUMUWFZA.ChainInputType,
|
|
24
|
+
ChainPromptType: () => import_chunk_SUMUWFZA.ChainPromptType,
|
|
25
|
+
ChainType: () => import_chunk_SUMUWFZA.ChainType
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(types_exports);
|
|
28
|
-
var
|
|
28
|
+
var import_chunk_SUMUWFZA = require("../chunk-SUMUWFZA.cjs");
|
|
29
29
|
var import_chunk_JSZ6PAYL = require("../chunk-JSZ6PAYL.cjs");
|
|
30
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
31
|
0 && (module.exports = {
|