@dxos/plugin-automation 0.7.3-staging.cc8dd3e → 0.7.3-staging.d887a4b

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.
@@ -97,7 +97,7 @@ var preprocessContextObject = async (object) => {
97
97
  };
98
98
  }
99
99
  case "dxos.org/type/Table": {
100
- const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.typename) : void 0;
100
+ const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.type) : void 0;
101
101
  const { objects: rows } = (schema && await space.db.query(Filter.schema(schema), {
102
102
  format: ResultFormat.Plain,
103
103
  limit: TABLE_ROWS_LIMIT
@@ -338,4 +338,4 @@ var AssistantPanel_default = AssistantPanel;
338
338
  export {
339
339
  AssistantPanel_default as default
340
340
  };
341
- //# sourceMappingURL=AssistantPanel-622FK3DP.mjs.map
341
+ //# sourceMappingURL=AssistantPanel-N3QSALKY.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/AssistantPanel/AssistantPanel.tsx", "../../../src/components/AssistantPanel/system-instructions.ts", "../../../src/components/AssistantPanel/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { type AIServiceClient, AIServiceClientImpl, ObjectId, type Message } from '@dxos/assistant';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { SpaceId } from '@dxos/keys';\nimport { useClient, useConfig } from '@dxos/react-client';\nimport { ContextMenu, type ThemedClassName } from '@dxos/react-ui';\nimport { Icon, Input, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { createSystemInstructions } from './system-instructions';\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nconst PROPERTIES_ASSISTANT_KEY = 'dxos.assistant.beta.properties';\n\nexport type AssistantPanelProps = ThemedClassName<{\n subject?: ReactiveEchoObject<any>;\n}>;\n\nexport const AssistantPanel = ({ subject, classNames }: AssistantPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const config = useConfig();\n const client = useClient();\n const aiClient = useRef<AIServiceClient>();\n const [contextSpaceId, setContextSpaceId] = useState<SpaceId | undefined>();\n const [threadId, setThreadId] = useState<ObjectId | undefined>();\n const [history, setHistory] = useState<Message[]>([]);\n const [input, setInput] = useState('');\n\n useEffect(() => {\n if (!aiClient.current) {\n const endpoint = config.values.runtime?.services?.ai?.server;\n if (!endpoint) {\n throw new Error('AI service endpoint is not configured');\n }\n aiClient.current = new AIServiceClientImpl({\n endpoint,\n });\n }\n\n queueMicrotask(async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId ??= ObjectId.random();\n\n const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId, threadId);\n setHistory(messages);\n });\n }, []);\n\n const handleRequest = async (input: string) => {\n if (input === '') {\n return;\n }\n\n setInput('');\n\n // TODO(dmaretskyi): Can we call `create(Message, { ... })` here?\n const userMessage: Message = {\n id: ObjectId.random(),\n spaceId: contextSpaceId!,\n threadId: threadId!,\n role: 'user',\n content: [{ type: 'text', text: input }],\n };\n await aiClient.current!.insertMessages([userMessage]);\n setHistory([...history, userMessage]);\n\n const generationStream = await aiClient.current!.generate({\n model: '@anthropic/claude-3-5-sonnet-20241022',\n spaceId: contextSpaceId!,\n threadId: threadId!,\n tools: [],\n systemPrompt: await getSystemPrompt(),\n });\n\n const historyBefore = [...history, userMessage];\n for await (const _event of generationStream) {\n setHistory([...historyBefore, ...generationStream.accumulatedMessages]);\n }\n\n await aiClient.current!.insertMessages(await generationStream.complete());\n };\n\n const getSystemPrompt = async () => {\n return createSystemInstructions({ subject });\n };\n\n const clearThread = async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n // properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId = ObjectId.random();\n\n // const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n // setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId!, threadId);\n setHistory(messages);\n };\n\n // TODO(burdon): Factor out with script plugin.\n return (\n <div className={mx('flex flex-col h-full overflow-hidden', classNames)}>\n {history.length > 0 && (\n <div className='flex flex-col gap-6 h-full p-2 overflow-x-hidden overflow-y-auto'>\n {history.map((message) => (\n <MessageItem key={message.id} message={message} />\n ))}\n </div>\n )}\n\n <Toolbar.Root classNames='p-1'>\n <Input.Root>\n <Input.TextInput\n autoFocus\n placeholder={t('ask me anything')}\n value={input}\n onChange={(ev) => setInput(ev.target.value)}\n onKeyDown={(ev) => ev.key === 'Enter' && handleRequest(input)}\n />\n </Input.Root>\n <ContextMenu.Root>\n <ContextMenu.Trigger asChild>\n <Toolbar.Button onClick={() => handleRequest(input)}>\n <Icon icon='ph--play--regular' size={4} />\n </Toolbar.Button>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content classNames='z-[31]'>\n <ContextMenu.Viewport>\n <ContextMenu.Item onClick={clearThread}>Clear thread</ContextMenu.Item>\n <ContextMenu.Item onClick={async () => console.log(await getSystemPrompt())}>\n Print instructions to console\n </ContextMenu.Item>\n </ContextMenu.Viewport>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n\n {/* <Toolbar.Button onClick={() => (state ? handleStop() : handleClear())}>\n <Icon icon={state ? 'ph--stop--regular' : 'ph--trash--regular'} size={4} />\n </Toolbar.Button> */}\n </Toolbar.Root>\n </div>\n );\n};\n\nconst MessageItem = ({ classNames, message }: ThemedClassName<{ message: Message }>) => {\n const { id: _, role, content } = message;\n const styleContainer = 'flex flex-col overflow-x-hidden overflow-y-auto rounded-md gap-2 divide-y divide-separator';\n\n return (\n <div className={mx('flex', role === 'user' ? 'ml-[1rem] justify-end' : 'mr-[1rem]', classNames)}>\n {content.map((content, i) => {\n switch (content.type) {\n case 'text': {\n const { cot, message } = parseMessage(content.text);\n return (\n <div\n key={i}\n role='none'\n className={mx(\n styleContainer,\n role === 'user' ? 'bg-primary-400 dark:bg-primary-600' : 'bg-hoverSurface',\n )}\n >\n {cot && <div className='p-2 whitespace-pre-wrap text-xs text-subdued'>{cot}</div>}\n <div className='p-2 whitespace-pre-wrap'>{message}</div>\n </div>\n );\n }\n\n case 'tool_use': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs')}>\n <div>\n <span className='p-2 text-primary'>Tool use</span>: {content.name} {content.id}\n </div>\n <SyntaxHighlighter language='json'>{content.inputJson}</SyntaxHighlighter>\n </div>\n );\n }\n\n case 'tool_result': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs', content.isError && 'text-error')}>\n <div>\n <span className='p-2 text-primary'>Tool result</span>: {content.toolUseId}\n </div>\n <SyntaxHighlighter language='json'>{content.content}</SyntaxHighlighter>\n </div>\n );\n }\n }\n\n return null;\n })}\n </div>\n );\n};\n\n// TODO(burdon): Move to server-side parsing.\nconst parseMessage = (text: string): { cot?: string; message: string } => {\n const regex = /<cot>([\\s\\S]*?)<\\/cot>\\s*([\\s\\S]*)/;\n const match = text.match(regex);\n return {\n cot: match?.[1].trim(),\n message: match?.[2] ?? text ?? '\\u00D8',\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { asyncTimeout } from '@dxos/async';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { getTypename } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { Filter, getSpace, ResultFormat } from '@dxos/react-client/echo';\n\n// TODO(burdon): Move into assistant-protocol.\nexport type ThreadContext = {\n subject?: ReactiveEchoObject<any>;\n};\n\nexport const createSystemInstructions = async (context: ThreadContext): Promise<string> => {\n let instructions = `\n <instructions>\n Before replying always think step-by-step on how to proceed.\n Print your thoughts inside <cot> tags.\n\n <example>\n <cot>To answer the question I need to ...</cot>\n </example>\n </instructions>\n\n <current_time>${new Date().toLocaleString()}</current_time>\n `;\n\n if (context.subject) {\n instructions += `\n <user_attention>\n The user is currently interacting with an object in Composer application:\n\n ${await formatContextObject(context.subject)}\n </user_attention>\n `;\n }\n\n return looseFormatXml(instructions);\n};\n\nconst formatContextObject = async (object: ReactiveEchoObject<any>): Promise<string> => {\n let data;\n try {\n data = await asyncTimeout(preprocessContextObject(object), CONTEXT_OBJECT_QUERY_TIMEOUT);\n } catch (err: any) {\n log.error('Failed to preprocess context object:', { err });\n data = object;\n }\n\n if (typeof data === 'string') {\n return data;\n } else {\n return `\n <object>\n <type>${getTypename(object)}</type>\n <id>${object.id}</id>\n ${formatObjectAsXMLTags(data)}\n </object>\n `;\n }\n};\n\nconst preprocessContextObject = async (object: ReactiveEchoObject<any>): Promise<Record<string, any> | string> => {\n const space = getSpace(object);\n if (!space) {\n return { ...object };\n }\n\n // TODO(dmaretskyi): Serialize based on schema annotations.\n switch (getTypename(object)) {\n // TODO(dmaretskyi): Reference types somehow without plugin-automation depending on other plugins.\n case 'dxos.org/type/Document': {\n const data = space.db\n .query({ id: object.id }, { format: ResultFormat.Plain, include: { content: true } })\n .first() ?? { content: { content: '' } };\n\n return {\n ...data,\n threads: undefined,\n };\n }\n\n case 'dxos.org/type/Table': {\n // TODO(dmaretskyi): Load references.\n const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.typename) : undefined;\n const { objects: rows } =\n (schema &&\n (await space.db\n .query(Filter.schema(schema), { format: ResultFormat.Plain, limit: TABLE_ROWS_LIMIT })\n .run())) ??\n {};\n\n // TODO(dmaretskyi): Format table schema.\n return `\n <object>\n <id>${object.id}</id>\n <type>${getTypename(object)}</type>\n ${formatObjectAsXMLTags(object)}\n\n <rows>\n <!-- Limited to first ${TABLE_ROWS_LIMIT} rows. -->\n ${rows\n ?.map(\n (row: any) => `<row>\n ${formatObjectAsXMLTags(row)}\n </row>`,\n )\n .join('\\n')}\n </rows>\n\n `;\n }\n\n default:\n return { ...object };\n }\n};\n\nconst formatObjectAsXMLTags = (object: any, depth = 1): string => {\n return Object.entries(object)\n .filter(([key, value]) => ['string', 'number', 'boolean', 'object'].includes(typeof value))\n .map(([key, value]) => {\n if (typeof value === 'object' && value !== null) {\n if (depth === 0) {\n return '';\n } else {\n return `<${key}>\n ${formatObjectAsXMLTags(value, depth - 1)}\n </${key}>`;\n }\n }\n\n return `<${key}>${value}</${key}>`;\n })\n .join('\\n');\n};\n\nconst CONTEXT_OBJECT_QUERY_TIMEOUT = 5_000;\n\nconst TABLE_ROWS_LIMIT = 10;\n\n/**\n * Formats XML indentation for instructions so they are easier to read during debugging.\n */\nconst looseFormatXml = (xml: string): string => {\n let currentIndent = 0;\n\n return xml\n .split('\\n')\n .map((line) => {\n if (line.match(RE_CLOSE_TAG_LINE)) {\n currentIndent--;\n }\n const indent = currentIndent;\n if (line.match(RE_OPEN_TAG_LINE)) {\n currentIndent++;\n }\n return ' '.repeat(indent * 2) + line.trimStart();\n })\n .join('\\n');\n};\n\nconst RE_OPEN_TAG_LINE = /^[ ]*<[a-zA-Z0-9\\-_]+>[ ]*$/;\nconst RE_CLOSE_TAG_LINE = /^[ ]*<\\/[a-zA-Z0-9\\-_]+>[ ]*$/;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AssistantPanel } from './AssistantPanel';\n\nexport default AssistantPanel;\n"],
5
- "mappings": ";;;;;AAMA,OAAOA,SAASC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A;UAAkBC,UAAS;WAAQzD,SAAQA,OAAO,CAAA;MAGzD;IACF;AAEA,WAAO;EACT,CAAA,CAAA;AAGN;AAGA,IAAMqD,eAAe,CAACnD,SAAAA;AACpB,QAAM2D,QAAQ;AACd,QAAMC,QAAQ5D,KAAK4D,MAAMD,KAAAA;AACzB,SAAO;IACLT,KAAKU,QAAQ,CAAA,EAAGC,KAAAA;IAChB1C,SAASyC,QAAQ,CAAA,KAAM5D,QAAQ;EACjC;AACF;;;AE/NA,IAAA,yBAAe8D;",
6
- "names": ["React", "useEffect", "useRef", "useState", "AIServiceClientImpl", "ObjectId", "SpaceId", "useClient", "useConfig", "ContextMenu", "Icon", "Input", "Toolbar", "useTranslation", "SyntaxHighlighter", "mx", "asyncTimeout", "getTypename", "log", "Filter", "getSpace", "ResultFormat", "createSystemInstructions", "context", "instructions", "Date", "toLocaleString", "subject", "formatContextObject", "looseFormatXml", "object", "data", "preprocessContextObject", "CONTEXT_OBJECT_QUERY_TIMEOUT", "err", "error", "id", "formatObjectAsXMLTags", "space", "db", "query", "format", "Plain", "include", "content", "first", "threads", "undefined", "schema", "view", "schemaRegistry", "getSchema", "typename", "objects", "rows", "limit", "TABLE_ROWS_LIMIT", "run", "map", "row", "join", "depth", "Object", "entries", "filter", "key", "value", "includes", "xml", "currentIndent", "split", "line", "match", "RE_CLOSE_TAG_LINE", "indent", "RE_OPEN_TAG_LINE", "repeat", "trimStart", "PROPERTIES_ASSISTANT_KEY", "AssistantPanel", "subject", "classNames", "t", "useTranslation", "AUTOMATION_PLUGIN", "config", "useConfig", "client", "useClient", "aiClient", "useRef", "contextSpaceId", "setContextSpaceId", "useState", "threadId", "setThreadId", "history", "setHistory", "input", "setInput", "useEffect", "current", "endpoint", "values", "runtime", "services", "ai", "server", "Error", "AIServiceClientImpl", "queueMicrotask", "properties", "spaces", "default", "SpaceId", "random", "ObjectId", "messages", "getMessagesInThread", "handleRequest", "userMessage", "id", "spaceId", "role", "content", "type", "text", "insertMessages", "generationStream", "generate", "model", "tools", "systemPrompt", "getSystemPrompt", "historyBefore", "_event", "accumulatedMessages", "complete", "createSystemInstructions", "clearThread", "div", "className", "mx", "length", "map", "message", "MessageItem", "key", "Toolbar", "Root", "Input", "TextInput", "autoFocus", "placeholder", "value", "onChange", "ev", "target", "onKeyDown", "ContextMenu", "Trigger", "asChild", "Button", "onClick", "Icon", "icon", "size", "Portal", "Content", "Viewport", "Item", "console", "log", "_", "styleContainer", "i", "cot", "parseMessage", "span", "name", "SyntaxHighlighter", "language", "inputJson", "isError", "toolUseId", "regex", "match", "trim", "AssistantPanel"]
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { type AIServiceClient, AIServiceClientImpl, ObjectId, type Message } from '@dxos/assistant';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { SpaceId } from '@dxos/keys';\nimport { useClient, useConfig } from '@dxos/react-client';\nimport { ContextMenu, type ThemedClassName } from '@dxos/react-ui';\nimport { Icon, Input, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { createSystemInstructions } from './system-instructions';\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nconst PROPERTIES_ASSISTANT_KEY = 'dxos.assistant.beta.properties';\n\nexport type AssistantPanelProps = ThemedClassName<{\n subject?: ReactiveEchoObject<any>;\n}>;\n\nexport const AssistantPanel = ({ subject, classNames }: AssistantPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const config = useConfig();\n const client = useClient();\n const aiClient = useRef<AIServiceClient>();\n const [contextSpaceId, setContextSpaceId] = useState<SpaceId | undefined>();\n const [threadId, setThreadId] = useState<ObjectId | undefined>();\n const [history, setHistory] = useState<Message[]>([]);\n const [input, setInput] = useState('');\n\n useEffect(() => {\n if (!aiClient.current) {\n const endpoint = config.values.runtime?.services?.ai?.server;\n if (!endpoint) {\n throw new Error('AI service endpoint is not configured');\n }\n aiClient.current = new AIServiceClientImpl({\n endpoint,\n });\n }\n\n queueMicrotask(async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId ??= ObjectId.random();\n\n const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId, threadId);\n setHistory(messages);\n });\n }, []);\n\n const handleRequest = async (input: string) => {\n if (input === '') {\n return;\n }\n\n setInput('');\n\n // TODO(dmaretskyi): Can we call `create(Message, { ... })` here?\n const userMessage: Message = {\n id: ObjectId.random(),\n spaceId: contextSpaceId!,\n threadId: threadId!,\n role: 'user',\n content: [{ type: 'text', text: input }],\n };\n await aiClient.current!.insertMessages([userMessage]);\n setHistory([...history, userMessage]);\n\n const generationStream = await aiClient.current!.generate({\n model: '@anthropic/claude-3-5-sonnet-20241022',\n spaceId: contextSpaceId!,\n threadId: threadId!,\n tools: [],\n systemPrompt: await getSystemPrompt(),\n });\n\n const historyBefore = [...history, userMessage];\n for await (const _event of generationStream) {\n setHistory([...historyBefore, ...generationStream.accumulatedMessages]);\n }\n\n await aiClient.current!.insertMessages(await generationStream.complete());\n };\n\n const getSystemPrompt = async () => {\n return createSystemInstructions({ subject });\n };\n\n const clearThread = async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n // properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId = ObjectId.random();\n\n // const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n // setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId!, threadId);\n setHistory(messages);\n };\n\n // TODO(burdon): Factor out with script plugin.\n return (\n <div className={mx('flex flex-col h-full overflow-hidden', classNames)}>\n {history.length > 0 && (\n <div className='flex flex-col gap-6 h-full p-2 overflow-x-hidden overflow-y-auto'>\n {history.map((message) => (\n <MessageItem key={message.id} message={message} />\n ))}\n </div>\n )}\n\n <Toolbar.Root classNames='p-1'>\n <Input.Root>\n <Input.TextInput\n autoFocus\n placeholder={t('ask me anything')}\n value={input}\n onChange={(ev) => setInput(ev.target.value)}\n onKeyDown={(ev) => ev.key === 'Enter' && handleRequest(input)}\n />\n </Input.Root>\n <ContextMenu.Root>\n <ContextMenu.Trigger asChild>\n <Toolbar.Button onClick={() => handleRequest(input)}>\n <Icon icon='ph--play--regular' size={4} />\n </Toolbar.Button>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content classNames='z-[31]'>\n <ContextMenu.Viewport>\n <ContextMenu.Item onClick={clearThread}>Clear thread</ContextMenu.Item>\n <ContextMenu.Item onClick={async () => console.log(await getSystemPrompt())}>\n Print instructions to console\n </ContextMenu.Item>\n </ContextMenu.Viewport>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n\n {/* <Toolbar.Button onClick={() => (state ? handleStop() : handleClear())}>\n <Icon icon={state ? 'ph--stop--regular' : 'ph--trash--regular'} size={4} />\n </Toolbar.Button> */}\n </Toolbar.Root>\n </div>\n );\n};\n\nconst MessageItem = ({ classNames, message }: ThemedClassName<{ message: Message }>) => {\n const { id: _, role, content } = message;\n const styleContainer = 'flex flex-col overflow-x-hidden overflow-y-auto rounded-md gap-2 divide-y divide-separator';\n\n return (\n <div className={mx('flex', role === 'user' ? 'ml-[1rem] justify-end' : 'mr-[1rem]', classNames)}>\n {content.map((content, i) => {\n switch (content.type) {\n case 'text': {\n const { cot, message } = parseMessage(content.text);\n return (\n <div\n key={i}\n role='none'\n className={mx(\n styleContainer,\n role === 'user' ? 'bg-primary-400 dark:bg-primary-600' : 'bg-hoverSurface',\n )}\n >\n {cot && <div className='p-2 whitespace-pre-wrap text-xs text-subdued'>{cot}</div>}\n <div className='p-2 whitespace-pre-wrap'>{message}</div>\n </div>\n );\n }\n\n case 'tool_use': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs')}>\n <div>\n <span className='p-2 text-primary'>Tool use</span>: {content.name} {content.id}\n </div>\n <SyntaxHighlighter language='json'>{content.inputJson}</SyntaxHighlighter>\n </div>\n );\n }\n\n case 'tool_result': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs', content.isError && 'text-error')}>\n <div>\n <span className='p-2 text-primary'>Tool result</span>: {content.toolUseId}\n </div>\n <SyntaxHighlighter language='json'>{content.content}</SyntaxHighlighter>\n </div>\n );\n }\n }\n\n return null;\n })}\n </div>\n );\n};\n\n// TODO(burdon): Move to server-side parsing.\nconst parseMessage = (text: string): { cot?: string; message: string } => {\n const regex = /<cot>([\\s\\S]*?)<\\/cot>\\s*([\\s\\S]*)/;\n const match = text.match(regex);\n return {\n cot: match?.[1].trim(),\n message: match?.[2] ?? text ?? '\\u00D8',\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { asyncTimeout } from '@dxos/async';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { getTypename } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { Filter, getSpace, ResultFormat } from '@dxos/react-client/echo';\n\n// TODO(burdon): Move into assistant-protocol.\nexport type ThreadContext = {\n subject?: ReactiveEchoObject<any>;\n};\n\nexport const createSystemInstructions = async (context: ThreadContext): Promise<string> => {\n let instructions = `\n <instructions>\n Before replying always think step-by-step on how to proceed.\n Print your thoughts inside <cot> tags.\n\n <example>\n <cot>To answer the question I need to ...</cot>\n </example>\n </instructions>\n\n <current_time>${new Date().toLocaleString()}</current_time>\n `;\n\n if (context.subject) {\n instructions += `\n <user_attention>\n The user is currently interacting with an object in Composer application:\n\n ${await formatContextObject(context.subject)}\n </user_attention>\n `;\n }\n\n return looseFormatXml(instructions);\n};\n\nconst formatContextObject = async (object: ReactiveEchoObject<any>): Promise<string> => {\n let data;\n try {\n data = await asyncTimeout(preprocessContextObject(object), CONTEXT_OBJECT_QUERY_TIMEOUT);\n } catch (err: any) {\n log.error('Failed to preprocess context object:', { err });\n data = object;\n }\n\n if (typeof data === 'string') {\n return data;\n } else {\n return `\n <object>\n <type>${getTypename(object)}</type>\n <id>${object.id}</id>\n ${formatObjectAsXMLTags(data)}\n </object>\n `;\n }\n};\n\nconst preprocessContextObject = async (object: ReactiveEchoObject<any>): Promise<Record<string, any> | string> => {\n const space = getSpace(object);\n if (!space) {\n return { ...object };\n }\n\n // TODO(dmaretskyi): Serialize based on schema annotations.\n switch (getTypename(object)) {\n // TODO(dmaretskyi): Reference types somehow without plugin-automation depending on other plugins.\n case 'dxos.org/type/Document': {\n const data = space.db\n .query({ id: object.id }, { format: ResultFormat.Plain, include: { content: true } })\n .first() ?? { content: { content: '' } };\n\n return {\n ...data,\n threads: undefined,\n };\n }\n\n case 'dxos.org/type/Table': {\n // TODO(dmaretskyi): Load references.\n const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.type) : undefined;\n const { objects: rows } =\n (schema &&\n (await space.db\n .query(Filter.schema(schema), { format: ResultFormat.Plain, limit: TABLE_ROWS_LIMIT })\n .run())) ??\n {};\n\n // TODO(dmaretskyi): Format table schema.\n return `\n <object>\n <id>${object.id}</id>\n <type>${getTypename(object)}</type>\n ${formatObjectAsXMLTags(object)}\n\n <rows>\n <!-- Limited to first ${TABLE_ROWS_LIMIT} rows. -->\n ${rows\n ?.map(\n (row: any) => `<row>\n ${formatObjectAsXMLTags(row)}\n </row>`,\n )\n .join('\\n')}\n </rows>\n\n `;\n }\n\n default:\n return { ...object };\n }\n};\n\nconst formatObjectAsXMLTags = (object: any, depth = 1): string => {\n return Object.entries(object)\n .filter(([key, value]) => ['string', 'number', 'boolean', 'object'].includes(typeof value))\n .map(([key, value]) => {\n if (typeof value === 'object' && value !== null) {\n if (depth === 0) {\n return '';\n } else {\n return `<${key}>\n ${formatObjectAsXMLTags(value, depth - 1)}\n </${key}>`;\n }\n }\n\n return `<${key}>${value}</${key}>`;\n })\n .join('\\n');\n};\n\nconst CONTEXT_OBJECT_QUERY_TIMEOUT = 5_000;\n\nconst TABLE_ROWS_LIMIT = 10;\n\n/**\n * Formats XML indentation for instructions so they are easier to read during debugging.\n */\nconst looseFormatXml = (xml: string): string => {\n let currentIndent = 0;\n\n return xml\n .split('\\n')\n .map((line) => {\n if (line.match(RE_CLOSE_TAG_LINE)) {\n currentIndent--;\n }\n const indent = currentIndent;\n if (line.match(RE_OPEN_TAG_LINE)) {\n currentIndent++;\n }\n return ' '.repeat(indent * 2) + line.trimStart();\n })\n .join('\\n');\n};\n\nconst RE_OPEN_TAG_LINE = /^[ ]*<[a-zA-Z0-9\\-_]+>[ ]*$/;\nconst RE_CLOSE_TAG_LINE = /^[ ]*<\\/[a-zA-Z0-9\\-_]+>[ ]*$/;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AssistantPanel } from './AssistantPanel';\n\nexport default AssistantPanel;\n"],
5
+ "mappings": ";;;;;AAMA,OAAOA,SAASC,WAAWC,QAAQC,gBAAgB;AAEnD,SAA+BC,qBAAqBC,gBAA8B;AAElF,SAASC,eAAe;AACxB,SAASC,WAAWC,iBAAiB;AACrC,SAASC,mBAAyC;AAClD,SAASC,MAAMC,OAAOC,SAASC,sBAAsB;AACrD,SAASC,yBAAyB;AAClC,SAASC,UAAU;;;ACXnB,SAASC,oBAAoB;AAE7B,SAASC,mBAAmB;AAC5B,SAASC,WAAW;AACpB,SAASC,QAAQC,UAAUC,oBAAoB;;AAOxC,IAAMC,2BAA2B,OAAOC,YAAAA;AAC7C,MAAIC,eAAe;;;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ceClientImpl", "ObjectId", "SpaceId", "useClient", "useConfig", "ContextMenu", "Icon", "Input", "Toolbar", "useTranslation", "SyntaxHighlighter", "mx", "asyncTimeout", "getTypename", "log", "Filter", "getSpace", "ResultFormat", "createSystemInstructions", "context", "instructions", "Date", "toLocaleString", "subject", "formatContextObject", "looseFormatXml", "object", "data", "preprocessContextObject", "CONTEXT_OBJECT_QUERY_TIMEOUT", "err", "error", "id", "formatObjectAsXMLTags", "space", "db", "query", "format", "Plain", "include", "content", "first", "threads", "undefined", "schema", "view", "schemaRegistry", "getSchema", "type", "objects", "rows", "limit", "TABLE_ROWS_LIMIT", "run", "map", "row", "join", "depth", "Object", "entries", "filter", "key", "value", "includes", "xml", "currentIndent", "split", "line", "match", "RE_CLOSE_TAG_LINE", "indent", "RE_OPEN_TAG_LINE", "repeat", "trimStart", "PROPERTIES_ASSISTANT_KEY", "AssistantPanel", "subject", "classNames", "t", "useTranslation", "AUTOMATION_PLUGIN", "config", "useConfig", "client", "useClient", "aiClient", "useRef", "contextSpaceId", "setContextSpaceId", "useState", "threadId", "setThreadId", "history", "setHistory", "input", "setInput", "useEffect", "current", "endpoint", "values", "runtime", "services", "ai", "server", "Error", "AIServiceClientImpl", "queueMicrotask", "properties", "spaces", "default", "SpaceId", "random", "ObjectId", "messages", "getMessagesInThread", "handleRequest", "userMessage", "id", "spaceId", "role", "content", "type", "text", "insertMessages", "generationStream", "generate", "model", "tools", "systemPrompt", "getSystemPrompt", "historyBefore", "_event", "accumulatedMessages", "complete", "createSystemInstructions", "clearThread", "div", "className", "mx", "length", "map", "message", "MessageItem", "key", "Toolbar", "Root", "Input", "TextInput", "autoFocus", "placeholder", "value", "onChange", "ev", "target", "onKeyDown", "ContextMenu", "Trigger", "asChild", "Button", "onClick", "Icon", "icon", "size", "Portal", "Content", "Viewport", "Item", "console", "log", "_", "styleContainer", "i", "cot", "parseMessage", "span", "name", "SyntaxHighlighter", "language", "inputJson", "isError", "toolUseId", "regex", "match", "trim", "AssistantPanel"]
7
7
  }
@@ -23,7 +23,7 @@ import { translations as formTranslations } from "@dxos/react-ui-form";
23
23
 
24
24
  // packages/plugins/experimental/plugin-automation/src/components/index.ts
25
25
  import { lazy } from "react";
26
- var AssistantPanel = lazy(() => import("./AssistantPanel-622FK3DP.mjs"));
26
+ var AssistantPanel = lazy(() => import("./AssistantPanel-N3QSALKY.mjs"));
27
27
  var AutomationPanel = lazy(() => import("./AutomationPanel-AQMN2CQR.mjs"));
28
28
 
29
29
  // packages/plugins/experimental/plugin-automation/src/translations.ts
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytes":16065,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1626,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":28076,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts","kind":"import-statement","original":"./system-instructions"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx","kind":"import-statement","original":"./AssistantPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":7188,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","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":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":16837,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4459,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":604,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-automation/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":29269,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":1109,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23857},"packages/plugins/experimental/plugin-automation/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-7KB4UMXO.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/AssistantPanel-622FK3DP.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AssistantPanel","AutomationAction","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":8000},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1277},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":15863},"packages/plugins/experimental/plugin-automation/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs","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/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-7KB4UMXO.mjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":266},"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-7KB4UMXO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2879},"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-7KB4UMXO.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytesInOutput":118}},"bytes":1653},"packages/plugins/experimental/plugin-automation/dist/lib/browser/AssistantPanel-622FK3DP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22439},"packages/plugins/experimental/plugin-automation/dist/lib/browser/AssistantPanel-622FK3DP.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytesInOutput":7270},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytesInOutput":4071},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytesInOutput":45}},"bytes":11945},"packages/plugins/experimental/plugin-automation/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13313},"packages/plugins/experimental/plugin-automation/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/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}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4190},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":1492},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":6289},"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":763},"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs":{"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/AssistantPanel/system-instructions.ts":{"bytes":16049,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1626,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":28076,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts","kind":"import-statement","original":"./system-instructions"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx","kind":"import-statement","original":"./AssistantPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":7188,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","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":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":16837,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4459,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":604,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-automation/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":29269,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":1109,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23857},"packages/plugins/experimental/plugin-automation/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-7KB4UMXO.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/AssistantPanel-N3QSALKY.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AssistantPanel","AutomationAction","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":8000},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1277},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":15863},"packages/plugins/experimental/plugin-automation/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs","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/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-7KB4UMXO.mjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":266},"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-7KB4UMXO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2879},"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-7KB4UMXO.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytesInOutput":118}},"bytes":1653},"packages/plugins/experimental/plugin-automation/dist/lib/browser/AssistantPanel-N3QSALKY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22431},"packages/plugins/experimental/plugin-automation/dist/lib/browser/AssistantPanel-N3QSALKY.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytesInOutput":7270},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytesInOutput":4067},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytesInOutput":45}},"bytes":11941},"packages/plugins/experimental/plugin-automation/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13313},"packages/plugins/experimental/plugin-automation/dist/lib/browser/AutomationPanel-AQMN2CQR.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/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}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4190},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":1492},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":6289},"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":763},"packages/plugins/experimental/plugin-automation/dist/lib/browser/chunk-X5KMOH3I.mjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":333}},"bytes":489}}}
@@ -26,11 +26,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var AssistantPanel_HRJRVOZD_exports = {};
30
- __export(AssistantPanel_HRJRVOZD_exports, {
29
+ var AssistantPanel_RIA4TI3B_exports = {};
30
+ __export(AssistantPanel_RIA4TI3B_exports, {
31
31
  default: () => AssistantPanel_default
32
32
  });
33
- module.exports = __toCommonJS(AssistantPanel_HRJRVOZD_exports);
33
+ module.exports = __toCommonJS(AssistantPanel_RIA4TI3B_exports);
34
34
  var import_chunk_DTJ7XVO2 = require("./chunk-DTJ7XVO2.cjs");
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_assistant = require("@dxos/assistant");
@@ -124,7 +124,7 @@ var preprocessContextObject = async (object) => {
124
124
  };
125
125
  }
126
126
  case "dxos.org/type/Table": {
127
- const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.typename) : void 0;
127
+ const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.type) : void 0;
128
128
  const { objects: rows } = (schema && await space.db.query(import_echo.Filter.schema(schema), {
129
129
  format: import_echo.ResultFormat.Plain,
130
130
  limit: TABLE_ROWS_LIMIT
@@ -358,4 +358,4 @@ var parseMessage = (text) => {
358
358
  };
359
359
  };
360
360
  var AssistantPanel_default = AssistantPanel;
361
- //# sourceMappingURL=AssistantPanel-HRJRVOZD.cjs.map
361
+ //# sourceMappingURL=AssistantPanel-RIA4TI3B.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/AssistantPanel/AssistantPanel.tsx", "../../../src/components/AssistantPanel/system-instructions.ts", "../../../src/components/AssistantPanel/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { type AIServiceClient, AIServiceClientImpl, ObjectId, type Message } from '@dxos/assistant';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { SpaceId } from '@dxos/keys';\nimport { useClient, useConfig } from '@dxos/react-client';\nimport { ContextMenu, type ThemedClassName } from '@dxos/react-ui';\nimport { Icon, Input, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { createSystemInstructions } from './system-instructions';\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nconst PROPERTIES_ASSISTANT_KEY = 'dxos.assistant.beta.properties';\n\nexport type AssistantPanelProps = ThemedClassName<{\n subject?: ReactiveEchoObject<any>;\n}>;\n\nexport const AssistantPanel = ({ subject, classNames }: AssistantPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const config = useConfig();\n const client = useClient();\n const aiClient = useRef<AIServiceClient>();\n const [contextSpaceId, setContextSpaceId] = useState<SpaceId | undefined>();\n const [threadId, setThreadId] = useState<ObjectId | undefined>();\n const [history, setHistory] = useState<Message[]>([]);\n const [input, setInput] = useState('');\n\n useEffect(() => {\n if (!aiClient.current) {\n const endpoint = config.values.runtime?.services?.ai?.server;\n if (!endpoint) {\n throw new Error('AI service endpoint is not configured');\n }\n aiClient.current = new AIServiceClientImpl({\n endpoint,\n });\n }\n\n queueMicrotask(async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId ??= ObjectId.random();\n\n const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId, threadId);\n setHistory(messages);\n });\n }, []);\n\n const handleRequest = async (input: string) => {\n if (input === '') {\n return;\n }\n\n setInput('');\n\n // TODO(dmaretskyi): Can we call `create(Message, { ... })` here?\n const userMessage: Message = {\n id: ObjectId.random(),\n spaceId: contextSpaceId!,\n threadId: threadId!,\n role: 'user',\n content: [{ type: 'text', text: input }],\n };\n await aiClient.current!.insertMessages([userMessage]);\n setHistory([...history, userMessage]);\n\n const generationStream = await aiClient.current!.generate({\n model: '@anthropic/claude-3-5-sonnet-20241022',\n spaceId: contextSpaceId!,\n threadId: threadId!,\n tools: [],\n systemPrompt: await getSystemPrompt(),\n });\n\n const historyBefore = [...history, userMessage];\n for await (const _event of generationStream) {\n setHistory([...historyBefore, ...generationStream.accumulatedMessages]);\n }\n\n await aiClient.current!.insertMessages(await generationStream.complete());\n };\n\n const getSystemPrompt = async () => {\n return createSystemInstructions({ subject });\n };\n\n const clearThread = async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n // properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId = ObjectId.random();\n\n // const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n // setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId!, threadId);\n setHistory(messages);\n };\n\n // TODO(burdon): Factor out with script plugin.\n return (\n <div className={mx('flex flex-col h-full overflow-hidden', classNames)}>\n {history.length > 0 && (\n <div className='flex flex-col gap-6 h-full p-2 overflow-x-hidden overflow-y-auto'>\n {history.map((message) => (\n <MessageItem key={message.id} message={message} />\n ))}\n </div>\n )}\n\n <Toolbar.Root classNames='p-1'>\n <Input.Root>\n <Input.TextInput\n autoFocus\n placeholder={t('ask me anything')}\n value={input}\n onChange={(ev) => setInput(ev.target.value)}\n onKeyDown={(ev) => ev.key === 'Enter' && handleRequest(input)}\n />\n </Input.Root>\n <ContextMenu.Root>\n <ContextMenu.Trigger asChild>\n <Toolbar.Button onClick={() => handleRequest(input)}>\n <Icon icon='ph--play--regular' size={4} />\n </Toolbar.Button>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content classNames='z-[31]'>\n <ContextMenu.Viewport>\n <ContextMenu.Item onClick={clearThread}>Clear thread</ContextMenu.Item>\n <ContextMenu.Item onClick={async () => console.log(await getSystemPrompt())}>\n Print instructions to console\n </ContextMenu.Item>\n </ContextMenu.Viewport>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n\n {/* <Toolbar.Button onClick={() => (state ? handleStop() : handleClear())}>\n <Icon icon={state ? 'ph--stop--regular' : 'ph--trash--regular'} size={4} />\n </Toolbar.Button> */}\n </Toolbar.Root>\n </div>\n );\n};\n\nconst MessageItem = ({ classNames, message }: ThemedClassName<{ message: Message }>) => {\n const { id: _, role, content } = message;\n const styleContainer = 'flex flex-col overflow-x-hidden overflow-y-auto rounded-md gap-2 divide-y divide-separator';\n\n return (\n <div className={mx('flex', role === 'user' ? 'ml-[1rem] justify-end' : 'mr-[1rem]', classNames)}>\n {content.map((content, i) => {\n switch (content.type) {\n case 'text': {\n const { cot, message } = parseMessage(content.text);\n return (\n <div\n key={i}\n role='none'\n className={mx(\n styleContainer,\n role === 'user' ? 'bg-primary-400 dark:bg-primary-600' : 'bg-hoverSurface',\n )}\n >\n {cot && <div className='p-2 whitespace-pre-wrap text-xs text-subdued'>{cot}</div>}\n <div className='p-2 whitespace-pre-wrap'>{message}</div>\n </div>\n );\n }\n\n case 'tool_use': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs')}>\n <div>\n <span className='p-2 text-primary'>Tool use</span>: {content.name} {content.id}\n </div>\n <SyntaxHighlighter language='json'>{content.inputJson}</SyntaxHighlighter>\n </div>\n );\n }\n\n case 'tool_result': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs', content.isError && 'text-error')}>\n <div>\n <span className='p-2 text-primary'>Tool result</span>: {content.toolUseId}\n </div>\n <SyntaxHighlighter language='json'>{content.content}</SyntaxHighlighter>\n </div>\n );\n }\n }\n\n return null;\n })}\n </div>\n );\n};\n\n// TODO(burdon): Move to server-side parsing.\nconst parseMessage = (text: string): { cot?: string; message: string } => {\n const regex = /<cot>([\\s\\S]*?)<\\/cot>\\s*([\\s\\S]*)/;\n const match = text.match(regex);\n return {\n cot: match?.[1].trim(),\n message: match?.[2] ?? text ?? '\\u00D8',\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { asyncTimeout } from '@dxos/async';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { getTypename } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { Filter, getSpace, ResultFormat } from '@dxos/react-client/echo';\n\n// TODO(burdon): Move into assistant-protocol.\nexport type ThreadContext = {\n subject?: ReactiveEchoObject<any>;\n};\n\nexport const createSystemInstructions = async (context: ThreadContext): Promise<string> => {\n let instructions = `\n <instructions>\n Before replying always think step-by-step on how to proceed.\n Print your thoughts inside <cot> tags.\n\n <example>\n <cot>To answer the question I need to ...</cot>\n </example>\n </instructions>\n\n <current_time>${new Date().toLocaleString()}</current_time>\n `;\n\n if (context.subject) {\n instructions += `\n <user_attention>\n The user is currently interacting with an object in Composer application:\n\n ${await formatContextObject(context.subject)}\n </user_attention>\n `;\n }\n\n return looseFormatXml(instructions);\n};\n\nconst formatContextObject = async (object: ReactiveEchoObject<any>): Promise<string> => {\n let data;\n try {\n data = await asyncTimeout(preprocessContextObject(object), CONTEXT_OBJECT_QUERY_TIMEOUT);\n } catch (err: any) {\n log.error('Failed to preprocess context object:', { err });\n data = object;\n }\n\n if (typeof data === 'string') {\n return data;\n } else {\n return `\n <object>\n <type>${getTypename(object)}</type>\n <id>${object.id}</id>\n ${formatObjectAsXMLTags(data)}\n </object>\n `;\n }\n};\n\nconst preprocessContextObject = async (object: ReactiveEchoObject<any>): Promise<Record<string, any> | string> => {\n const space = getSpace(object);\n if (!space) {\n return { ...object };\n }\n\n // TODO(dmaretskyi): Serialize based on schema annotations.\n switch (getTypename(object)) {\n // TODO(dmaretskyi): Reference types somehow without plugin-automation depending on other plugins.\n case 'dxos.org/type/Document': {\n const data = space.db\n .query({ id: object.id }, { format: ResultFormat.Plain, include: { content: true } })\n .first() ?? { content: { content: '' } };\n\n return {\n ...data,\n threads: undefined,\n };\n }\n\n case 'dxos.org/type/Table': {\n // TODO(dmaretskyi): Load references.\n const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.typename) : undefined;\n const { objects: rows } =\n (schema &&\n (await space.db\n .query(Filter.schema(schema), { format: ResultFormat.Plain, limit: TABLE_ROWS_LIMIT })\n .run())) ??\n {};\n\n // TODO(dmaretskyi): Format table schema.\n return `\n <object>\n <id>${object.id}</id>\n <type>${getTypename(object)}</type>\n ${formatObjectAsXMLTags(object)}\n\n <rows>\n <!-- Limited to first ${TABLE_ROWS_LIMIT} rows. -->\n ${rows\n ?.map(\n (row: any) => `<row>\n ${formatObjectAsXMLTags(row)}\n </row>`,\n )\n .join('\\n')}\n </rows>\n\n `;\n }\n\n default:\n return { ...object };\n }\n};\n\nconst formatObjectAsXMLTags = (object: any, depth = 1): string => {\n return Object.entries(object)\n .filter(([key, value]) => ['string', 'number', 'boolean', 'object'].includes(typeof value))\n .map(([key, value]) => {\n if (typeof value === 'object' && value !== null) {\n if (depth === 0) {\n return '';\n } else {\n return `<${key}>\n ${formatObjectAsXMLTags(value, depth - 1)}\n </${key}>`;\n }\n }\n\n return `<${key}>${value}</${key}>`;\n })\n .join('\\n');\n};\n\nconst CONTEXT_OBJECT_QUERY_TIMEOUT = 5_000;\n\nconst TABLE_ROWS_LIMIT = 10;\n\n/**\n * Formats XML indentation for instructions so they are easier to read during debugging.\n */\nconst looseFormatXml = (xml: string): string => {\n let currentIndent = 0;\n\n return xml\n .split('\\n')\n .map((line) => {\n if (line.match(RE_CLOSE_TAG_LINE)) {\n currentIndent--;\n }\n const indent = currentIndent;\n if (line.match(RE_OPEN_TAG_LINE)) {\n currentIndent++;\n }\n return ' '.repeat(indent * 2) + line.trimStart();\n })\n .join('\\n');\n};\n\nconst RE_OPEN_TAG_LINE = /^[ ]*<[a-zA-Z0-9\\-_]+>[ ]*$/;\nconst RE_CLOSE_TAG_LINE = /^[ ]*<\\/[a-zA-Z0-9\\-_]+>[ ]*$/;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AssistantPanel } from './AssistantPanel';\n\nexport default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gBAAgB,WAAW5H,SAAQqI,WAAW,YAAA;WACvE,6BAAAxC,QAAA,cAACC,OAAAA,MACC,6BAAAD,QAAA,cAACmC,QAAAA;UAAKjC,WAAU;WAAmB,aAAA,GAAkB,MAAG/F,SAAQsI,SAAS,GAE3E,6BAAAzC,QAAA,cAACqC,sDAAAA;UAAkBC,UAAS;WAAQnI,SAAQA,OAAO,CAAA;MAGzD;IACF;AAEA,WAAO;EACT,CAAA,CAAA;AAGN;AAGA,IAAM+H,eAAe,CAAC/C,SAAAA;AACpB,QAAMuD,QAAQ;AACd,QAAM1G,QAAQmD,KAAKnD,MAAM0G,KAAAA;AACzB,SAAO;IACLT,KAAKjG,QAAQ,CAAA,EAAG2G,KAAAA;IAChBtC,SAASrE,QAAQ,CAAA,KAAMmD,QAAQ;EACjC;AACF;AE/NA,IAAA,yBAAe5C;",
6
- "names": ["import_react_ui", "createSystemInstructions", "context", "instructions", "Date", "toLocaleString", "subject", "formatContextObject", "looseFormatXml", "object", "data", "asyncTimeout", "preprocessContextObject", "CONTEXT_OBJECT_QUERY_TIMEOUT", "err", "log", "error", "getTypename", "id", "formatObjectAsXMLTags", "space", "getSpace", "db", "query", "format", "ResultFormat", "Plain", "include", "content", "first", "threads", "undefined", "schema", "view", "schemaRegistry", "getSchema", "typename", "objects", "rows", "Filter", "limit", "TABLE_ROWS_LIMIT", "run", "map", "row", "join", "depth", "Object", "entries", "filter", "key", "value", "includes", "xml", "currentIndent", "split", "line", "match", "RE_CLOSE_TAG_LINE", "indent", "RE_OPEN_TAG_LINE", "repeat", "trimStart", "PROPERTIES_ASSISTANT_KEY", "AssistantPanel", "classNames", "t", "useTranslation", "AUTOMATION_PLUGIN", "config", "useConfig", "client", "useClient", "aiClient", "useRef", "contextSpaceId", "setContextSpaceId", "useState", "threadId", "setThreadId", "history", "setHistory", "input", "setInput", "useEffect", "current", "endpoint", "values", "runtime", "services", "ai", "server", "Error", "AIServiceClientImpl", "queueMicrotask", "properties", "spaces", "default", "SpaceId", "random", "ObjectId", "messages", "getMessagesInThread", "handleRequest", "userMessage", "spaceId", "role", "type", "text", "insertMessages", "generationStream", "generate", "model", "tools", "systemPrompt", "getSystemPrompt", "historyBefore", "_event", "accumulatedMessages", "complete", "clearThread", "React", "div", "className", "mx", "length", "message", "MessageItem", "Toolbar", "Root", "Input", "TextInput", "autoFocus", "placeholder", "onChange", "ev", "target", "onKeyDown", "ContextMenu", "Trigger", "asChild", "Button", "onClick", "Icon", "icon", "size", "Portal", "Content", "Viewport", "Item", "console", "_", "styleContainer", "i", "cot", "parseMessage", "span", "name", "SyntaxHighlighter", "language", "inputJson", "isError", "toolUseId", "regex", "trim"]
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { type AIServiceClient, AIServiceClientImpl, ObjectId, type Message } from '@dxos/assistant';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { SpaceId } from '@dxos/keys';\nimport { useClient, useConfig } from '@dxos/react-client';\nimport { ContextMenu, type ThemedClassName } from '@dxos/react-ui';\nimport { Icon, Input, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { createSystemInstructions } from './system-instructions';\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nconst PROPERTIES_ASSISTANT_KEY = 'dxos.assistant.beta.properties';\n\nexport type AssistantPanelProps = ThemedClassName<{\n subject?: ReactiveEchoObject<any>;\n}>;\n\nexport const AssistantPanel = ({ subject, classNames }: AssistantPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const config = useConfig();\n const client = useClient();\n const aiClient = useRef<AIServiceClient>();\n const [contextSpaceId, setContextSpaceId] = useState<SpaceId | undefined>();\n const [threadId, setThreadId] = useState<ObjectId | undefined>();\n const [history, setHistory] = useState<Message[]>([]);\n const [input, setInput] = useState('');\n\n useEffect(() => {\n if (!aiClient.current) {\n const endpoint = config.values.runtime?.services?.ai?.server;\n if (!endpoint) {\n throw new Error('AI service endpoint is not configured');\n }\n aiClient.current = new AIServiceClientImpl({\n endpoint,\n });\n }\n\n queueMicrotask(async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId ??= ObjectId.random();\n\n const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId, threadId);\n setHistory(messages);\n });\n }, []);\n\n const handleRequest = async (input: string) => {\n if (input === '') {\n return;\n }\n\n setInput('');\n\n // TODO(dmaretskyi): Can we call `create(Message, { ... })` here?\n const userMessage: Message = {\n id: ObjectId.random(),\n spaceId: contextSpaceId!,\n threadId: threadId!,\n role: 'user',\n content: [{ type: 'text', text: input }],\n };\n await aiClient.current!.insertMessages([userMessage]);\n setHistory([...history, userMessage]);\n\n const generationStream = await aiClient.current!.generate({\n model: '@anthropic/claude-3-5-sonnet-20241022',\n spaceId: contextSpaceId!,\n threadId: threadId!,\n tools: [],\n systemPrompt: await getSystemPrompt(),\n });\n\n const historyBefore = [...history, userMessage];\n for await (const _event of generationStream) {\n setHistory([...historyBefore, ...generationStream.accumulatedMessages]);\n }\n\n await aiClient.current!.insertMessages(await generationStream.complete());\n };\n\n const getSystemPrompt = async () => {\n return createSystemInstructions({ subject });\n };\n\n const clearThread = async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n // properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId = ObjectId.random();\n\n // const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n // setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId!, threadId);\n setHistory(messages);\n };\n\n // TODO(burdon): Factor out with script plugin.\n return (\n <div className={mx('flex flex-col h-full overflow-hidden', classNames)}>\n {history.length > 0 && (\n <div className='flex flex-col gap-6 h-full p-2 overflow-x-hidden overflow-y-auto'>\n {history.map((message) => (\n <MessageItem key={message.id} message={message} />\n ))}\n </div>\n )}\n\n <Toolbar.Root classNames='p-1'>\n <Input.Root>\n <Input.TextInput\n autoFocus\n placeholder={t('ask me anything')}\n value={input}\n onChange={(ev) => setInput(ev.target.value)}\n onKeyDown={(ev) => ev.key === 'Enter' && handleRequest(input)}\n />\n </Input.Root>\n <ContextMenu.Root>\n <ContextMenu.Trigger asChild>\n <Toolbar.Button onClick={() => handleRequest(input)}>\n <Icon icon='ph--play--regular' size={4} />\n </Toolbar.Button>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content classNames='z-[31]'>\n <ContextMenu.Viewport>\n <ContextMenu.Item onClick={clearThread}>Clear thread</ContextMenu.Item>\n <ContextMenu.Item onClick={async () => console.log(await getSystemPrompt())}>\n Print instructions to console\n </ContextMenu.Item>\n </ContextMenu.Viewport>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n\n {/* <Toolbar.Button onClick={() => (state ? handleStop() : handleClear())}>\n <Icon icon={state ? 'ph--stop--regular' : 'ph--trash--regular'} size={4} />\n </Toolbar.Button> */}\n </Toolbar.Root>\n </div>\n );\n};\n\nconst MessageItem = ({ classNames, message }: ThemedClassName<{ message: Message }>) => {\n const { id: _, role, content } = message;\n const styleContainer = 'flex flex-col overflow-x-hidden overflow-y-auto rounded-md gap-2 divide-y divide-separator';\n\n return (\n <div className={mx('flex', role === 'user' ? 'ml-[1rem] justify-end' : 'mr-[1rem]', classNames)}>\n {content.map((content, i) => {\n switch (content.type) {\n case 'text': {\n const { cot, message } = parseMessage(content.text);\n return (\n <div\n key={i}\n role='none'\n className={mx(\n styleContainer,\n role === 'user' ? 'bg-primary-400 dark:bg-primary-600' : 'bg-hoverSurface',\n )}\n >\n {cot && <div className='p-2 whitespace-pre-wrap text-xs text-subdued'>{cot}</div>}\n <div className='p-2 whitespace-pre-wrap'>{message}</div>\n </div>\n );\n }\n\n case 'tool_use': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs')}>\n <div>\n <span className='p-2 text-primary'>Tool use</span>: {content.name} {content.id}\n </div>\n <SyntaxHighlighter language='json'>{content.inputJson}</SyntaxHighlighter>\n </div>\n );\n }\n\n case 'tool_result': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs', content.isError && 'text-error')}>\n <div>\n <span className='p-2 text-primary'>Tool result</span>: {content.toolUseId}\n </div>\n <SyntaxHighlighter language='json'>{content.content}</SyntaxHighlighter>\n </div>\n );\n }\n }\n\n return null;\n })}\n </div>\n );\n};\n\n// TODO(burdon): Move to server-side parsing.\nconst parseMessage = (text: string): { cot?: string; message: string } => {\n const regex = /<cot>([\\s\\S]*?)<\\/cot>\\s*([\\s\\S]*)/;\n const match = text.match(regex);\n return {\n cot: match?.[1].trim(),\n message: match?.[2] ?? text ?? '\\u00D8',\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { asyncTimeout } from '@dxos/async';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { getTypename } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { Filter, getSpace, ResultFormat } from '@dxos/react-client/echo';\n\n// TODO(burdon): Move into assistant-protocol.\nexport type ThreadContext = {\n subject?: ReactiveEchoObject<any>;\n};\n\nexport const createSystemInstructions = async (context: ThreadContext): Promise<string> => {\n let instructions = `\n <instructions>\n Before replying always think step-by-step on how to proceed.\n Print your thoughts inside <cot> tags.\n\n <example>\n <cot>To answer the question I need to ...</cot>\n </example>\n </instructions>\n\n <current_time>${new Date().toLocaleString()}</current_time>\n `;\n\n if (context.subject) {\n instructions += `\n <user_attention>\n The user is currently interacting with an object in Composer application:\n\n ${await formatContextObject(context.subject)}\n </user_attention>\n `;\n }\n\n return looseFormatXml(instructions);\n};\n\nconst formatContextObject = async (object: ReactiveEchoObject<any>): Promise<string> => {\n let data;\n try {\n data = await asyncTimeout(preprocessContextObject(object), CONTEXT_OBJECT_QUERY_TIMEOUT);\n } catch (err: any) {\n log.error('Failed to preprocess context object:', { err });\n data = object;\n }\n\n if (typeof data === 'string') {\n return data;\n } else {\n return `\n <object>\n <type>${getTypename(object)}</type>\n <id>${object.id}</id>\n ${formatObjectAsXMLTags(data)}\n </object>\n `;\n }\n};\n\nconst preprocessContextObject = async (object: ReactiveEchoObject<any>): Promise<Record<string, any> | string> => {\n const space = getSpace(object);\n if (!space) {\n return { ...object };\n }\n\n // TODO(dmaretskyi): Serialize based on schema annotations.\n switch (getTypename(object)) {\n // TODO(dmaretskyi): Reference types somehow without plugin-automation depending on other plugins.\n case 'dxos.org/type/Document': {\n const data = space.db\n .query({ id: object.id }, { format: ResultFormat.Plain, include: { content: true } })\n .first() ?? { content: { content: '' } };\n\n return {\n ...data,\n threads: undefined,\n };\n }\n\n case 'dxos.org/type/Table': {\n // TODO(dmaretskyi): Load references.\n const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.type) : undefined;\n const { objects: rows } =\n (schema &&\n (await space.db\n .query(Filter.schema(schema), { format: ResultFormat.Plain, limit: TABLE_ROWS_LIMIT })\n .run())) ??\n {};\n\n // TODO(dmaretskyi): Format table schema.\n return `\n <object>\n <id>${object.id}</id>\n <type>${getTypename(object)}</type>\n ${formatObjectAsXMLTags(object)}\n\n <rows>\n <!-- Limited to first ${TABLE_ROWS_LIMIT} rows. -->\n ${rows\n ?.map(\n (row: any) => `<row>\n ${formatObjectAsXMLTags(row)}\n </row>`,\n )\n .join('\\n')}\n </rows>\n\n `;\n }\n\n default:\n return { ...object };\n }\n};\n\nconst formatObjectAsXMLTags = (object: any, depth = 1): string => {\n return Object.entries(object)\n .filter(([key, value]) => ['string', 'number', 'boolean', 'object'].includes(typeof value))\n .map(([key, value]) => {\n if (typeof value === 'object' && value !== null) {\n if (depth === 0) {\n return '';\n } else {\n return `<${key}>\n ${formatObjectAsXMLTags(value, depth - 1)}\n </${key}>`;\n }\n }\n\n return `<${key}>${value}</${key}>`;\n })\n .join('\\n');\n};\n\nconst CONTEXT_OBJECT_QUERY_TIMEOUT = 5_000;\n\nconst TABLE_ROWS_LIMIT = 10;\n\n/**\n * Formats XML indentation for instructions so they are easier to read during debugging.\n */\nconst looseFormatXml = (xml: string): string => {\n let currentIndent = 0;\n\n return xml\n .split('\\n')\n .map((line) => {\n if (line.match(RE_CLOSE_TAG_LINE)) {\n currentIndent--;\n }\n const indent = currentIndent;\n if (line.match(RE_OPEN_TAG_LINE)) {\n currentIndent++;\n }\n return ' '.repeat(indent * 2) + line.trimStart();\n })\n .join('\\n');\n};\n\nconst RE_OPEN_TAG_LINE = /^[ ]*<[a-zA-Z0-9\\-_]+>[ ]*$/;\nconst RE_CLOSE_TAG_LINE = /^[ ]*<\\/[a-zA-Z0-9\\-_]+>[ ]*$/;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AssistantPanel } from './AssistantPanel';\n\nexport default AssistantPanel;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,mBAAmD;AAEnD,uBAAkF;AAElF,kBAAwB;AACxB,0BAAqC;AACrC,sBAAkD;AAClD,IAAAA,mBAAqD;AACrD,yCAAkC;AAClC,4BAAmB;ACXnB,mBAA6B;AAE7B,yBAA4B;AAC5B,iBAAoB;AACpB,kBAA+C;;AAOxC,IAAMC,2BAA2B,OAAOC,YAAAA;AAC7C,MAAIC,eAAe;;;;;;;;;;qBAUD,oBAAIC,KAAAA,GAAOC,eAAc,CAAA;;AAG3C,MA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KlD,MAAMyG,KAAAA;AACzB,SAAO;IACLT,KAAKhG,QAAQ,CAAA,EAAG0G,KAAAA;IAChBtC,SAASpE,QAAQ,CAAA,KAAMkD,QAAQ;EACjC;AACF;AE/NA,IAAA,yBAAe3C;",
6
+ "names": ["import_react_ui", "createSystemInstructions", "context", "instructions", "Date", "toLocaleString", "subject", "formatContextObject", "looseFormatXml", "object", "data", "asyncTimeout", "preprocessContextObject", "CONTEXT_OBJECT_QUERY_TIMEOUT", "err", "log", "error", "getTypename", "id", "formatObjectAsXMLTags", "space", "getSpace", "db", "query", "format", "ResultFormat", "Plain", "include", "content", "first", "threads", "undefined", "schema", "view", "schemaRegistry", "getSchema", "type", "objects", "rows", "Filter", "limit", "TABLE_ROWS_LIMIT", "run", "map", "row", "join", "depth", "Object", "entries", "filter", "key", "value", "includes", "xml", "currentIndent", "split", "line", "match", "RE_CLOSE_TAG_LINE", "indent", "RE_OPEN_TAG_LINE", "repeat", "trimStart", "PROPERTIES_ASSISTANT_KEY", "AssistantPanel", "classNames", "t", "useTranslation", "AUTOMATION_PLUGIN", "config", "useConfig", "client", "useClient", "aiClient", "useRef", "contextSpaceId", "setContextSpaceId", "useState", "threadId", "setThreadId", "history", "setHistory", "input", "setInput", "useEffect", "current", "endpoint", "values", "runtime", "services", "ai", "server", "Error", "AIServiceClientImpl", "queueMicrotask", "properties", "spaces", "default", "SpaceId", "random", "ObjectId", "messages", "getMessagesInThread", "handleRequest", "userMessage", "spaceId", "role", "text", "insertMessages", "generationStream", "generate", "model", "tools", "systemPrompt", "getSystemPrompt", "historyBefore", "_event", "accumulatedMessages", "complete", "clearThread", "React", "div", "className", "mx", "length", "message", "MessageItem", "Toolbar", "Root", "Input", "TextInput", "autoFocus", "placeholder", "onChange", "ev", "target", "onKeyDown", "ContextMenu", "Trigger", "asChild", "Button", "onClick", "Icon", "icon", "size", "Portal", "Content", "Viewport", "Item", "console", "_", "styleContainer", "i", "cot", "parseMessage", "span", "name", "SyntaxHighlighter", "language", "inputJson", "isError", "toolUseId", "regex", "trim"]
7
7
  }
@@ -54,7 +54,7 @@ var import_echo = require("@dxos/react-client/echo");
54
54
  var import_react_ui_form = require("@dxos/react-ui-form");
55
55
  var import_react2 = require("react");
56
56
  var import_live_object = require("@dxos/live-object");
57
- var AssistantPanel = (0, import_react2.lazy)(() => import("./AssistantPanel-HRJRVOZD.cjs"));
57
+ var AssistantPanel = (0, import_react2.lazy)(() => import("./AssistantPanel-RIA4TI3B.cjs"));
58
58
  var AutomationPanel = (0, import_react2.lazy)(() => import("./AutomationPanel-HZS5WKI5.cjs"));
59
59
  var translations_default = [
60
60
  {
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytes":16065,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1626,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":28076,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts","kind":"import-statement","original":"./system-instructions"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx","kind":"import-statement","original":"./AssistantPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":7188,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","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":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":16837,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4459,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":604,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-automation/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":29269,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":1109,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23857},"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-CUCUWUAF.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-HRJRVOZD.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-HZS5WKI5.cjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AssistantPanel","AutomationAction","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":8000},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1277},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":15863},"packages/plugins/experimental/plugin-automation/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"}],"exports":["AUTOMATION_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/meta.ts","inputs":{},"bytes":169},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-CUCUWUAF.cjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":266},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-CUCUWUAF.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2879},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-CUCUWUAF.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytesInOutput":118}},"bytes":1653},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-HRJRVOZD.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22439},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-HRJRVOZD.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytesInOutput":7270},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytesInOutput":4071},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytesInOutput":45}},"bytes":11945},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-HZS5WKI5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13313},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-HZS5WKI5.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/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}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4190},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":1492},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":6289},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":763},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":333}},"bytes":489}}}
1
+ {"inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytes":16049,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1626,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":28076,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts","kind":"import-statement","original":"./system-instructions"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx","kind":"import-statement","original":"./AssistantPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":7188,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","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":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":16837,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4459,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":604,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-automation/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":29269,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":1109,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23857},"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-CUCUWUAF.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-RIA4TI3B.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-HZS5WKI5.cjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AssistantPanel","AutomationAction","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":8000},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1277},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":15863},"packages/plugins/experimental/plugin-automation/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"}],"exports":["AUTOMATION_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/meta.ts","inputs":{},"bytes":169},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-CUCUWUAF.cjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":266},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-CUCUWUAF.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2879},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-CUCUWUAF.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytesInOutput":118}},"bytes":1653},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-RIA4TI3B.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22431},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-RIA4TI3B.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytesInOutput":7270},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytesInOutput":4067},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytesInOutput":45}},"bytes":11941},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-HZS5WKI5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13313},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-HZS5WKI5.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/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}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4190},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":1492},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":6289},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":763},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":333}},"bytes":489}}}
@@ -98,7 +98,7 @@ var preprocessContextObject = async (object) => {
98
98
  };
99
99
  }
100
100
  case "dxos.org/type/Table": {
101
- const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.typename) : void 0;
101
+ const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.type) : void 0;
102
102
  const { objects: rows } = (schema && await space.db.query(Filter.schema(schema), {
103
103
  format: ResultFormat.Plain,
104
104
  limit: TABLE_ROWS_LIMIT
@@ -339,4 +339,4 @@ var AssistantPanel_default = AssistantPanel;
339
339
  export {
340
340
  AssistantPanel_default as default
341
341
  };
342
- //# sourceMappingURL=AssistantPanel-QIIX7S4V.mjs.map
342
+ //# sourceMappingURL=AssistantPanel-72YH43CH.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/AssistantPanel/AssistantPanel.tsx", "../../../src/components/AssistantPanel/system-instructions.ts", "../../../src/components/AssistantPanel/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { type AIServiceClient, AIServiceClientImpl, ObjectId, type Message } from '@dxos/assistant';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { SpaceId } from '@dxos/keys';\nimport { useClient, useConfig } from '@dxos/react-client';\nimport { ContextMenu, type ThemedClassName } from '@dxos/react-ui';\nimport { Icon, Input, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { createSystemInstructions } from './system-instructions';\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nconst PROPERTIES_ASSISTANT_KEY = 'dxos.assistant.beta.properties';\n\nexport type AssistantPanelProps = ThemedClassName<{\n subject?: ReactiveEchoObject<any>;\n}>;\n\nexport const AssistantPanel = ({ subject, classNames }: AssistantPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const config = useConfig();\n const client = useClient();\n const aiClient = useRef<AIServiceClient>();\n const [contextSpaceId, setContextSpaceId] = useState<SpaceId | undefined>();\n const [threadId, setThreadId] = useState<ObjectId | undefined>();\n const [history, setHistory] = useState<Message[]>([]);\n const [input, setInput] = useState('');\n\n useEffect(() => {\n if (!aiClient.current) {\n const endpoint = config.values.runtime?.services?.ai?.server;\n if (!endpoint) {\n throw new Error('AI service endpoint is not configured');\n }\n aiClient.current = new AIServiceClientImpl({\n endpoint,\n });\n }\n\n queueMicrotask(async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId ??= ObjectId.random();\n\n const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId, threadId);\n setHistory(messages);\n });\n }, []);\n\n const handleRequest = async (input: string) => {\n if (input === '') {\n return;\n }\n\n setInput('');\n\n // TODO(dmaretskyi): Can we call `create(Message, { ... })` here?\n const userMessage: Message = {\n id: ObjectId.random(),\n spaceId: contextSpaceId!,\n threadId: threadId!,\n role: 'user',\n content: [{ type: 'text', text: input }],\n };\n await aiClient.current!.insertMessages([userMessage]);\n setHistory([...history, userMessage]);\n\n const generationStream = await aiClient.current!.generate({\n model: '@anthropic/claude-3-5-sonnet-20241022',\n spaceId: contextSpaceId!,\n threadId: threadId!,\n tools: [],\n systemPrompt: await getSystemPrompt(),\n });\n\n const historyBefore = [...history, userMessage];\n for await (const _event of generationStream) {\n setHistory([...historyBefore, ...generationStream.accumulatedMessages]);\n }\n\n await aiClient.current!.insertMessages(await generationStream.complete());\n };\n\n const getSystemPrompt = async () => {\n return createSystemInstructions({ subject });\n };\n\n const clearThread = async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n // properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId = ObjectId.random();\n\n // const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n // setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId!, threadId);\n setHistory(messages);\n };\n\n // TODO(burdon): Factor out with script plugin.\n return (\n <div className={mx('flex flex-col h-full overflow-hidden', classNames)}>\n {history.length > 0 && (\n <div className='flex flex-col gap-6 h-full p-2 overflow-x-hidden overflow-y-auto'>\n {history.map((message) => (\n <MessageItem key={message.id} message={message} />\n ))}\n </div>\n )}\n\n <Toolbar.Root classNames='p-1'>\n <Input.Root>\n <Input.TextInput\n autoFocus\n placeholder={t('ask me anything')}\n value={input}\n onChange={(ev) => setInput(ev.target.value)}\n onKeyDown={(ev) => ev.key === 'Enter' && handleRequest(input)}\n />\n </Input.Root>\n <ContextMenu.Root>\n <ContextMenu.Trigger asChild>\n <Toolbar.Button onClick={() => handleRequest(input)}>\n <Icon icon='ph--play--regular' size={4} />\n </Toolbar.Button>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content classNames='z-[31]'>\n <ContextMenu.Viewport>\n <ContextMenu.Item onClick={clearThread}>Clear thread</ContextMenu.Item>\n <ContextMenu.Item onClick={async () => console.log(await getSystemPrompt())}>\n Print instructions to console\n </ContextMenu.Item>\n </ContextMenu.Viewport>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n\n {/* <Toolbar.Button onClick={() => (state ? handleStop() : handleClear())}>\n <Icon icon={state ? 'ph--stop--regular' : 'ph--trash--regular'} size={4} />\n </Toolbar.Button> */}\n </Toolbar.Root>\n </div>\n );\n};\n\nconst MessageItem = ({ classNames, message }: ThemedClassName<{ message: Message }>) => {\n const { id: _, role, content } = message;\n const styleContainer = 'flex flex-col overflow-x-hidden overflow-y-auto rounded-md gap-2 divide-y divide-separator';\n\n return (\n <div className={mx('flex', role === 'user' ? 'ml-[1rem] justify-end' : 'mr-[1rem]', classNames)}>\n {content.map((content, i) => {\n switch (content.type) {\n case 'text': {\n const { cot, message } = parseMessage(content.text);\n return (\n <div\n key={i}\n role='none'\n className={mx(\n styleContainer,\n role === 'user' ? 'bg-primary-400 dark:bg-primary-600' : 'bg-hoverSurface',\n )}\n >\n {cot && <div className='p-2 whitespace-pre-wrap text-xs text-subdued'>{cot}</div>}\n <div className='p-2 whitespace-pre-wrap'>{message}</div>\n </div>\n );\n }\n\n case 'tool_use': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs')}>\n <div>\n <span className='p-2 text-primary'>Tool use</span>: {content.name} {content.id}\n </div>\n <SyntaxHighlighter language='json'>{content.inputJson}</SyntaxHighlighter>\n </div>\n );\n }\n\n case 'tool_result': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs', content.isError && 'text-error')}>\n <div>\n <span className='p-2 text-primary'>Tool result</span>: {content.toolUseId}\n </div>\n <SyntaxHighlighter language='json'>{content.content}</SyntaxHighlighter>\n </div>\n );\n }\n }\n\n return null;\n })}\n </div>\n );\n};\n\n// TODO(burdon): Move to server-side parsing.\nconst parseMessage = (text: string): { cot?: string; message: string } => {\n const regex = /<cot>([\\s\\S]*?)<\\/cot>\\s*([\\s\\S]*)/;\n const match = text.match(regex);\n return {\n cot: match?.[1].trim(),\n message: match?.[2] ?? text ?? '\\u00D8',\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { asyncTimeout } from '@dxos/async';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { getTypename } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { Filter, getSpace, ResultFormat } from '@dxos/react-client/echo';\n\n// TODO(burdon): Move into assistant-protocol.\nexport type ThreadContext = {\n subject?: ReactiveEchoObject<any>;\n};\n\nexport const createSystemInstructions = async (context: ThreadContext): Promise<string> => {\n let instructions = `\n <instructions>\n Before replying always think step-by-step on how to proceed.\n Print your thoughts inside <cot> tags.\n\n <example>\n <cot>To answer the question I need to ...</cot>\n </example>\n </instructions>\n\n <current_time>${new Date().toLocaleString()}</current_time>\n `;\n\n if (context.subject) {\n instructions += `\n <user_attention>\n The user is currently interacting with an object in Composer application:\n\n ${await formatContextObject(context.subject)}\n </user_attention>\n `;\n }\n\n return looseFormatXml(instructions);\n};\n\nconst formatContextObject = async (object: ReactiveEchoObject<any>): Promise<string> => {\n let data;\n try {\n data = await asyncTimeout(preprocessContextObject(object), CONTEXT_OBJECT_QUERY_TIMEOUT);\n } catch (err: any) {\n log.error('Failed to preprocess context object:', { err });\n data = object;\n }\n\n if (typeof data === 'string') {\n return data;\n } else {\n return `\n <object>\n <type>${getTypename(object)}</type>\n <id>${object.id}</id>\n ${formatObjectAsXMLTags(data)}\n </object>\n `;\n }\n};\n\nconst preprocessContextObject = async (object: ReactiveEchoObject<any>): Promise<Record<string, any> | string> => {\n const space = getSpace(object);\n if (!space) {\n return { ...object };\n }\n\n // TODO(dmaretskyi): Serialize based on schema annotations.\n switch (getTypename(object)) {\n // TODO(dmaretskyi): Reference types somehow without plugin-automation depending on other plugins.\n case 'dxos.org/type/Document': {\n const data = space.db\n .query({ id: object.id }, { format: ResultFormat.Plain, include: { content: true } })\n .first() ?? { content: { content: '' } };\n\n return {\n ...data,\n threads: undefined,\n };\n }\n\n case 'dxos.org/type/Table': {\n // TODO(dmaretskyi): Load references.\n const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.typename) : undefined;\n const { objects: rows } =\n (schema &&\n (await space.db\n .query(Filter.schema(schema), { format: ResultFormat.Plain, limit: TABLE_ROWS_LIMIT })\n .run())) ??\n {};\n\n // TODO(dmaretskyi): Format table schema.\n return `\n <object>\n <id>${object.id}</id>\n <type>${getTypename(object)}</type>\n ${formatObjectAsXMLTags(object)}\n\n <rows>\n <!-- Limited to first ${TABLE_ROWS_LIMIT} rows. -->\n ${rows\n ?.map(\n (row: any) => `<row>\n ${formatObjectAsXMLTags(row)}\n </row>`,\n )\n .join('\\n')}\n </rows>\n\n `;\n }\n\n default:\n return { ...object };\n }\n};\n\nconst formatObjectAsXMLTags = (object: any, depth = 1): string => {\n return Object.entries(object)\n .filter(([key, value]) => ['string', 'number', 'boolean', 'object'].includes(typeof value))\n .map(([key, value]) => {\n if (typeof value === 'object' && value !== null) {\n if (depth === 0) {\n return '';\n } else {\n return `<${key}>\n ${formatObjectAsXMLTags(value, depth - 1)}\n </${key}>`;\n }\n }\n\n return `<${key}>${value}</${key}>`;\n })\n .join('\\n');\n};\n\nconst CONTEXT_OBJECT_QUERY_TIMEOUT = 5_000;\n\nconst TABLE_ROWS_LIMIT = 10;\n\n/**\n * Formats XML indentation for instructions so they are easier to read during debugging.\n */\nconst looseFormatXml = (xml: string): string => {\n let currentIndent = 0;\n\n return xml\n .split('\\n')\n .map((line) => {\n if (line.match(RE_CLOSE_TAG_LINE)) {\n currentIndent--;\n }\n const indent = currentIndent;\n if (line.match(RE_OPEN_TAG_LINE)) {\n currentIndent++;\n }\n return ' '.repeat(indent * 2) + line.trimStart();\n })\n .join('\\n');\n};\n\nconst RE_OPEN_TAG_LINE = /^[ ]*<[a-zA-Z0-9\\-_]+>[ ]*$/;\nconst RE_CLOSE_TAG_LINE = /^[ ]*<\\/[a-zA-Z0-9\\-_]+>[ ]*$/;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AssistantPanel } from './AssistantPanel';\n\nexport default AssistantPanel;\n"],
5
- "mappings": ";;;;;;AAMA,OAAOA,SAASC,WAAWC,QAAQC,gBAAgB;AAEnD,SAA+BC,qBAAqBC,gBAA8B;AAElF,SAASC,eAAe;AACxB,SAASC,WAAWC,iBAAiB;AACrC,SAASC,mBAAyC;AAClD,SAASC,MAAMC,OAAOC,SAASC,sBAAsB;AACrD,SAASC,yBAAyB;AAClC,SAASC,UAAU;;;ACXnB,SAASC,oBAAoB;AAE7B,SAASC,mBAAmB;AAC5B,SAASC,WAAW;AACpB,SAASC,QAAQC,UAAUC,oBAAoB;;AAOxC,IAAMC,2BAA2B,OAAOC,YAAAA;AAC7C,MAAIC,eAAe;;;;;;;;;;qBAUD,oBAAIC,KAAAA,GAAOC,eAAc,CAAA;;AAG3C,MAAIH,QAAQI,S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,MAAK;UACLkB,WAAWC,GACTgC,gBACAnD,SAAS,SAAS,uCAAuC,iBAAA;WAG1DqD,OAAO,sBAAA,cAACpC,OAAAA;UAAIC,WAAU;WAAgDmC,GAAAA,GACvE,sBAAA,cAACpC,OAAAA;UAAIC,WAAU;WAA2BI,QAAAA,CAAAA;MAGhD;MAEA,KAAK,YAAY;AACf,eACE,sBAAA,cAACL,OAAAA;UAAIO,KAAK4B;UAAGlC,WAAWC,GAAGgC,gBAAgB,SAAA;WACzC,sBAAA,cAAClC,OAAAA,MACC,sBAAA,cAACsC,QAAAA;UAAKrC,WAAU;WAAmB,UAAA,GAAe,MAAGjB,SAAQuD,MAAK,KAAEvD,SAAQH,EAAE,GAEhF,sBAAA,cAAC2D,mBAAAA;UAAkBC,UAAS;WAAQzD,SAAQ0D,SAAS,CAAA;MAG3D;MAEA,KAAK,eAAe;AAClB,eACE,sBAAA,cAAC1C,OAAAA;UAAIO,KAAK4B;UAAGlC,WAAWC,GAAGgC,gBAAgB,WAAWlD,SAAQ2D,WAAW,YAAA;WACvE,sBAAA,cAAC3C,OAAAA,MACC,sBAAA,cAACsC,QAAAA;UAAKrC,WAAU;WAAmB,aAAA,GAAkB,MAAGjB,SAAQ4D,SAAS,GAE3E,sBAAA,cAACJ,mBAAAA;UAAkBC,UAAS;WAAQzD,SAAQA,OAAO,CAAA;MAGzD;IACF;AAEA,WAAO;EACT,CAAA,CAAA;AAGN;AAGA,IAAMqD,eAAe,CAACnD,SAAAA;AACpB,QAAM2D,QAAQ;AACd,QAAMC,QAAQ5D,KAAK4D,MAAMD,KAAAA;AACzB,SAAO;IACLT,KAAKU,QAAQ,CAAA,EAAGC,KAAAA;IAChB1C,SAASyC,QAAQ,CAAA,KAAM5D,QAAQ;EACjC;AACF;;;AE/NA,IAAA,yBAAe8D;",
6
- "names": ["React", "useEffect", "useRef", "useState", "AIServiceClientImpl", "ObjectId", "SpaceId", "useClient", "useConfig", "ContextMenu", "Icon", "Input", "Toolbar", "useTranslation", "SyntaxHighlighter", "mx", "asyncTimeout", "getTypename", "log", "Filter", "getSpace", "ResultFormat", "createSystemInstructions", "context", "instructions", "Date", "toLocaleString", "subject", "formatContextObject", "looseFormatXml", "object", "data", "preprocessContextObject", "CONTEXT_OBJECT_QUERY_TIMEOUT", "err", "error", "id", "formatObjectAsXMLTags", "space", "db", "query", "format", "Plain", "include", "content", "first", "threads", "undefined", "schema", "view", "schemaRegistry", "getSchema", "typename", "objects", "rows", "limit", "TABLE_ROWS_LIMIT", "run", "map", "row", "join", "depth", "Object", "entries", "filter", "key", "value", "includes", "xml", "currentIndent", "split", "line", "match", "RE_CLOSE_TAG_LINE", "indent", "RE_OPEN_TAG_LINE", "repeat", "trimStart", "PROPERTIES_ASSISTANT_KEY", "AssistantPanel", "subject", "classNames", "t", "useTranslation", "AUTOMATION_PLUGIN", "config", "useConfig", "client", "useClient", "aiClient", "useRef", "contextSpaceId", "setContextSpaceId", "useState", "threadId", "setThreadId", "history", "setHistory", "input", "setInput", "useEffect", "current", "endpoint", "values", "runtime", "services", "ai", "server", "Error", "AIServiceClientImpl", "queueMicrotask", "properties", "spaces", "default", "SpaceId", "random", "ObjectId", "messages", "getMessagesInThread", "handleRequest", "userMessage", "id", "spaceId", "role", "content", "type", "text", "insertMessages", "generationStream", "generate", "model", "tools", "systemPrompt", "getSystemPrompt", "historyBefore", "_event", "accumulatedMessages", "complete", "createSystemInstructions", "clearThread", "div", "className", "mx", "length", "map", "message", "MessageItem", "key", "Toolbar", "Root", "Input", "TextInput", "autoFocus", "placeholder", "value", "onChange", "ev", "target", "onKeyDown", "ContextMenu", "Trigger", "asChild", "Button", "onClick", "Icon", "icon", "size", "Portal", "Content", "Viewport", "Item", "console", "log", "_", "styleContainer", "i", "cot", "parseMessage", "span", "name", "SyntaxHighlighter", "language", "inputJson", "isError", "toolUseId", "regex", "match", "trim", "AssistantPanel"]
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { type AIServiceClient, AIServiceClientImpl, ObjectId, type Message } from '@dxos/assistant';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { SpaceId } from '@dxos/keys';\nimport { useClient, useConfig } from '@dxos/react-client';\nimport { ContextMenu, type ThemedClassName } from '@dxos/react-ui';\nimport { Icon, Input, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { createSystemInstructions } from './system-instructions';\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nconst PROPERTIES_ASSISTANT_KEY = 'dxos.assistant.beta.properties';\n\nexport type AssistantPanelProps = ThemedClassName<{\n subject?: ReactiveEchoObject<any>;\n}>;\n\nexport const AssistantPanel = ({ subject, classNames }: AssistantPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const config = useConfig();\n const client = useClient();\n const aiClient = useRef<AIServiceClient>();\n const [contextSpaceId, setContextSpaceId] = useState<SpaceId | undefined>();\n const [threadId, setThreadId] = useState<ObjectId | undefined>();\n const [history, setHistory] = useState<Message[]>([]);\n const [input, setInput] = useState('');\n\n useEffect(() => {\n if (!aiClient.current) {\n const endpoint = config.values.runtime?.services?.ai?.server;\n if (!endpoint) {\n throw new Error('AI service endpoint is not configured');\n }\n aiClient.current = new AIServiceClientImpl({\n endpoint,\n });\n }\n\n queueMicrotask(async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId ??= ObjectId.random();\n\n const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId, threadId);\n setHistory(messages);\n });\n }, []);\n\n const handleRequest = async (input: string) => {\n if (input === '') {\n return;\n }\n\n setInput('');\n\n // TODO(dmaretskyi): Can we call `create(Message, { ... })` here?\n const userMessage: Message = {\n id: ObjectId.random(),\n spaceId: contextSpaceId!,\n threadId: threadId!,\n role: 'user',\n content: [{ type: 'text', text: input }],\n };\n await aiClient.current!.insertMessages([userMessage]);\n setHistory([...history, userMessage]);\n\n const generationStream = await aiClient.current!.generate({\n model: '@anthropic/claude-3-5-sonnet-20241022',\n spaceId: contextSpaceId!,\n threadId: threadId!,\n tools: [],\n systemPrompt: await getSystemPrompt(),\n });\n\n const historyBefore = [...history, userMessage];\n for await (const _event of generationStream) {\n setHistory([...historyBefore, ...generationStream.accumulatedMessages]);\n }\n\n await aiClient.current!.insertMessages(await generationStream.complete());\n };\n\n const getSystemPrompt = async () => {\n return createSystemInstructions({ subject });\n };\n\n const clearThread = async () => {\n const properties = client.spaces.default.properties;\n\n properties[PROPERTIES_ASSISTANT_KEY] ??= {};\n // properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId ??= SpaceId.random();\n properties[PROPERTIES_ASSISTANT_KEY].threadId = ObjectId.random();\n\n // const contextSpaceId = properties[PROPERTIES_ASSISTANT_KEY].contextSpaceId;\n const threadId = properties[PROPERTIES_ASSISTANT_KEY].threadId;\n\n // setContextSpaceId(contextSpaceId);\n setThreadId(threadId);\n\n const messages = await aiClient.current!.getMessagesInThread(contextSpaceId!, threadId);\n setHistory(messages);\n };\n\n // TODO(burdon): Factor out with script plugin.\n return (\n <div className={mx('flex flex-col h-full overflow-hidden', classNames)}>\n {history.length > 0 && (\n <div className='flex flex-col gap-6 h-full p-2 overflow-x-hidden overflow-y-auto'>\n {history.map((message) => (\n <MessageItem key={message.id} message={message} />\n ))}\n </div>\n )}\n\n <Toolbar.Root classNames='p-1'>\n <Input.Root>\n <Input.TextInput\n autoFocus\n placeholder={t('ask me anything')}\n value={input}\n onChange={(ev) => setInput(ev.target.value)}\n onKeyDown={(ev) => ev.key === 'Enter' && handleRequest(input)}\n />\n </Input.Root>\n <ContextMenu.Root>\n <ContextMenu.Trigger asChild>\n <Toolbar.Button onClick={() => handleRequest(input)}>\n <Icon icon='ph--play--regular' size={4} />\n </Toolbar.Button>\n </ContextMenu.Trigger>\n <ContextMenu.Portal>\n <ContextMenu.Content classNames='z-[31]'>\n <ContextMenu.Viewport>\n <ContextMenu.Item onClick={clearThread}>Clear thread</ContextMenu.Item>\n <ContextMenu.Item onClick={async () => console.log(await getSystemPrompt())}>\n Print instructions to console\n </ContextMenu.Item>\n </ContextMenu.Viewport>\n </ContextMenu.Content>\n </ContextMenu.Portal>\n </ContextMenu.Root>\n\n {/* <Toolbar.Button onClick={() => (state ? handleStop() : handleClear())}>\n <Icon icon={state ? 'ph--stop--regular' : 'ph--trash--regular'} size={4} />\n </Toolbar.Button> */}\n </Toolbar.Root>\n </div>\n );\n};\n\nconst MessageItem = ({ classNames, message }: ThemedClassName<{ message: Message }>) => {\n const { id: _, role, content } = message;\n const styleContainer = 'flex flex-col overflow-x-hidden overflow-y-auto rounded-md gap-2 divide-y divide-separator';\n\n return (\n <div className={mx('flex', role === 'user' ? 'ml-[1rem] justify-end' : 'mr-[1rem]', classNames)}>\n {content.map((content, i) => {\n switch (content.type) {\n case 'text': {\n const { cot, message } = parseMessage(content.text);\n return (\n <div\n key={i}\n role='none'\n className={mx(\n styleContainer,\n role === 'user' ? 'bg-primary-400 dark:bg-primary-600' : 'bg-hoverSurface',\n )}\n >\n {cot && <div className='p-2 whitespace-pre-wrap text-xs text-subdued'>{cot}</div>}\n <div className='p-2 whitespace-pre-wrap'>{message}</div>\n </div>\n );\n }\n\n case 'tool_use': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs')}>\n <div>\n <span className='p-2 text-primary'>Tool use</span>: {content.name} {content.id}\n </div>\n <SyntaxHighlighter language='json'>{content.inputJson}</SyntaxHighlighter>\n </div>\n );\n }\n\n case 'tool_result': {\n return (\n <div key={i} className={mx(styleContainer, 'text-xs', content.isError && 'text-error')}>\n <div>\n <span className='p-2 text-primary'>Tool result</span>: {content.toolUseId}\n </div>\n <SyntaxHighlighter language='json'>{content.content}</SyntaxHighlighter>\n </div>\n );\n }\n }\n\n return null;\n })}\n </div>\n );\n};\n\n// TODO(burdon): Move to server-side parsing.\nconst parseMessage = (text: string): { cot?: string; message: string } => {\n const regex = /<cot>([\\s\\S]*?)<\\/cot>\\s*([\\s\\S]*)/;\n const match = text.match(regex);\n return {\n cot: match?.[1].trim(),\n message: match?.[2] ?? text ?? '\\u00D8',\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { asyncTimeout } from '@dxos/async';\nimport type { ReactiveEchoObject } from '@dxos/echo-db';\nimport { getTypename } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { Filter, getSpace, ResultFormat } from '@dxos/react-client/echo';\n\n// TODO(burdon): Move into assistant-protocol.\nexport type ThreadContext = {\n subject?: ReactiveEchoObject<any>;\n};\n\nexport const createSystemInstructions = async (context: ThreadContext): Promise<string> => {\n let instructions = `\n <instructions>\n Before replying always think step-by-step on how to proceed.\n Print your thoughts inside <cot> tags.\n\n <example>\n <cot>To answer the question I need to ...</cot>\n </example>\n </instructions>\n\n <current_time>${new Date().toLocaleString()}</current_time>\n `;\n\n if (context.subject) {\n instructions += `\n <user_attention>\n The user is currently interacting with an object in Composer application:\n\n ${await formatContextObject(context.subject)}\n </user_attention>\n `;\n }\n\n return looseFormatXml(instructions);\n};\n\nconst formatContextObject = async (object: ReactiveEchoObject<any>): Promise<string> => {\n let data;\n try {\n data = await asyncTimeout(preprocessContextObject(object), CONTEXT_OBJECT_QUERY_TIMEOUT);\n } catch (err: any) {\n log.error('Failed to preprocess context object:', { err });\n data = object;\n }\n\n if (typeof data === 'string') {\n return data;\n } else {\n return `\n <object>\n <type>${getTypename(object)}</type>\n <id>${object.id}</id>\n ${formatObjectAsXMLTags(data)}\n </object>\n `;\n }\n};\n\nconst preprocessContextObject = async (object: ReactiveEchoObject<any>): Promise<Record<string, any> | string> => {\n const space = getSpace(object);\n if (!space) {\n return { ...object };\n }\n\n // TODO(dmaretskyi): Serialize based on schema annotations.\n switch (getTypename(object)) {\n // TODO(dmaretskyi): Reference types somehow without plugin-automation depending on other plugins.\n case 'dxos.org/type/Document': {\n const data = space.db\n .query({ id: object.id }, { format: ResultFormat.Plain, include: { content: true } })\n .first() ?? { content: { content: '' } };\n\n return {\n ...data,\n threads: undefined,\n };\n }\n\n case 'dxos.org/type/Table': {\n // TODO(dmaretskyi): Load references.\n const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.type) : undefined;\n const { objects: rows } =\n (schema &&\n (await space.db\n .query(Filter.schema(schema), { format: ResultFormat.Plain, limit: TABLE_ROWS_LIMIT })\n .run())) ??\n {};\n\n // TODO(dmaretskyi): Format table schema.\n return `\n <object>\n <id>${object.id}</id>\n <type>${getTypename(object)}</type>\n ${formatObjectAsXMLTags(object)}\n\n <rows>\n <!-- Limited to first ${TABLE_ROWS_LIMIT} rows. -->\n ${rows\n ?.map(\n (row: any) => `<row>\n ${formatObjectAsXMLTags(row)}\n </row>`,\n )\n .join('\\n')}\n </rows>\n\n `;\n }\n\n default:\n return { ...object };\n }\n};\n\nconst formatObjectAsXMLTags = (object: any, depth = 1): string => {\n return Object.entries(object)\n .filter(([key, value]) => ['string', 'number', 'boolean', 'object'].includes(typeof value))\n .map(([key, value]) => {\n if (typeof value === 'object' && value !== null) {\n if (depth === 0) {\n return '';\n } else {\n return `<${key}>\n ${formatObjectAsXMLTags(value, depth - 1)}\n </${key}>`;\n }\n }\n\n return `<${key}>${value}</${key}>`;\n })\n .join('\\n');\n};\n\nconst CONTEXT_OBJECT_QUERY_TIMEOUT = 5_000;\n\nconst TABLE_ROWS_LIMIT = 10;\n\n/**\n * Formats XML indentation for instructions so they are easier to read during debugging.\n */\nconst looseFormatXml = (xml: string): string => {\n let currentIndent = 0;\n\n return xml\n .split('\\n')\n .map((line) => {\n if (line.match(RE_CLOSE_TAG_LINE)) {\n currentIndent--;\n }\n const indent = currentIndent;\n if (line.match(RE_OPEN_TAG_LINE)) {\n currentIndent++;\n }\n return ' '.repeat(indent * 2) + line.trimStart();\n })\n .join('\\n');\n};\n\nconst RE_OPEN_TAG_LINE = /^[ ]*<[a-zA-Z0-9\\-_]+>[ ]*$/;\nconst RE_CLOSE_TAG_LINE = /^[ ]*<\\/[a-zA-Z0-9\\-_]+>[ ]*$/;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AssistantPanel } from './AssistantPanel';\n\nexport default AssistantPanel;\n"],
5
+ "mappings": ";;;;;;AAMA,OAAOA,SAASC,WAAWC,QAAQC,gBAAgB;AAEnD,SAA+BC,qBAAqBC,gBAA8B;AAElF,SAASC,eAAe;AACxB,SAASC,WAAWC,iBAAiB;AACrC,SAASC,mBAAyC;AAClD,SAASC,MAAMC,OAAOC,SAASC,sBAAsB;AACrD,SAASC,yBAAyB;AAClC,SAASC,UAAU;;;ACXnB,SAASC,oBAAoB;AAE7B,SAASC,mBAAmB;AAC5B,SAASC,WAAW;AACpB,SAASC,QAAQC,UAAUC,oBAAoB;;AAOxC,IAAMC,2BAA2B,OAAOC,YAAAA;AAC7C,MAAIC,eAAe;;;;;;;;;;qBAUD,oBAAIC,KAAAA,GAAOC,eAAc,CAAA;;AAG3C,MAAIH,QAAQI,SAAS;AACnBH,oBAAgB;;;;UAIV,MAAMI,oBAAoBL,QAAQI,OAAO,CAAA;;;EAGjD;AAEA,SAAOE,eAAeL,YAAAA;AACxB;AAEA,IAAMI,sBAAsB,OAAOE,WAAAA;AACjC,MAAIC;AACJ,MAAI;AACFA,WAAO,MAAMf,aAAagB,wBAAwBF,MAAAA,GAASG,4BAAAA;EAC7D,SAASC,KAAU;AACjBhB,QAAIiB,MAAM,wCAAwC;MAAED;IAAI,GAAA;;;;;;AACxDH,WAAOD;EACT;AAEA,MAAI,OAAOC,SAAS,UAAU;AAC5B,WA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rC,WAAU;WAAmB,UAAA,GAAe,MAAGjB,SAAQuD,MAAK,KAAEvD,SAAQH,EAAE,GAEhF,sBAAA,cAAC2D,mBAAAA;UAAkBC,UAAS;WAAQzD,SAAQ0D,SAAS,CAAA;MAG3D;MAEA,KAAK,eAAe;AAClB,eACE,sBAAA,cAAC1C,OAAAA;UAAIO,KAAK4B;UAAGlC,WAAWC,GAAGgC,gBAAgB,WAAWlD,SAAQ2D,WAAW,YAAA;WACvE,sBAAA,cAAC3C,OAAAA,MACC,sBAAA,cAACsC,QAAAA;UAAKrC,WAAU;WAAmB,aAAA,GAAkB,MAAGjB,SAAQ4D,SAAS,GAE3E,sBAAA,cAACJ,mBAAAA;UAAkBC,UAAS;WAAQzD,SAAQA,OAAO,CAAA;MAGzD;IACF;AAEA,WAAO;EACT,CAAA,CAAA;AAGN;AAGA,IAAMqD,eAAe,CAACnD,SAAAA;AACpB,QAAM2D,QAAQ;AACd,QAAMC,QAAQ5D,KAAK4D,MAAMD,KAAAA;AACzB,SAAO;IACLT,KAAKU,QAAQ,CAAA,EAAGC,KAAAA;IAChB1C,SAASyC,QAAQ,CAAA,KAAM5D,QAAQ;EACjC;AACF;;;AE/NA,IAAA,yBAAe8D;",
6
+ "names": ["React", "useEffect", "useRef", "useState", "AIServiceClientImpl", "ObjectId", "SpaceId", "useClient", "useConfig", "ContextMenu", "Icon", "Input", "Toolbar", "useTranslation", "SyntaxHighlighter", "mx", "asyncTimeout", "getTypename", "log", "Filter", "getSpace", "ResultFormat", "createSystemInstructions", "context", "instructions", "Date", "toLocaleString", "subject", "formatContextObject", "looseFormatXml", "object", "data", "preprocessContextObject", "CONTEXT_OBJECT_QUERY_TIMEOUT", "err", "error", "id", "formatObjectAsXMLTags", "space", "db", "query", "format", "Plain", "include", "content", "first", "threads", "undefined", "schema", "view", "schemaRegistry", "getSchema", "type", "objects", "rows", "limit", "TABLE_ROWS_LIMIT", "run", "map", "row", "join", "depth", "Object", "entries", "filter", "key", "value", "includes", "xml", "currentIndent", "split", "line", "match", "RE_CLOSE_TAG_LINE", "indent", "RE_OPEN_TAG_LINE", "repeat", "trimStart", "PROPERTIES_ASSISTANT_KEY", "AssistantPanel", "subject", "classNames", "t", "useTranslation", "AUTOMATION_PLUGIN", "config", "useConfig", "client", "useClient", "aiClient", "useRef", "contextSpaceId", "setContextSpaceId", "useState", "threadId", "setThreadId", "history", "setHistory", "input", "setInput", "useEffect", "current", "endpoint", "values", "runtime", "services", "ai", "server", "Error", "AIServiceClientImpl", "queueMicrotask", "properties", "spaces", "default", "SpaceId", "random", "ObjectId", "messages", "getMessagesInThread", "handleRequest", "userMessage", "id", "spaceId", "role", "content", "type", "text", "insertMessages", "generationStream", "generate", "model", "tools", "systemPrompt", "getSystemPrompt", "historyBefore", "_event", "accumulatedMessages", "complete", "createSystemInstructions", "clearThread", "div", "className", "mx", "length", "map", "message", "MessageItem", "key", "Toolbar", "Root", "Input", "TextInput", "autoFocus", "placeholder", "value", "onChange", "ev", "target", "onKeyDown", "ContextMenu", "Trigger", "asChild", "Button", "onClick", "Icon", "icon", "size", "Portal", "Content", "Viewport", "Item", "console", "log", "_", "styleContainer", "i", "cot", "parseMessage", "span", "name", "SyntaxHighlighter", "language", "inputJson", "isError", "toolUseId", "regex", "match", "trim", "AssistantPanel"]
7
7
  }
@@ -24,7 +24,7 @@ import { translations as formTranslations } from "@dxos/react-ui-form";
24
24
 
25
25
  // packages/plugins/experimental/plugin-automation/src/components/index.ts
26
26
  import { lazy } from "react";
27
- var AssistantPanel = lazy(() => import("./AssistantPanel-QIIX7S4V.mjs"));
27
+ var AssistantPanel = lazy(() => import("./AssistantPanel-72YH43CH.mjs"));
28
28
  var AutomationPanel = lazy(() => import("./AutomationPanel-JUHOWQWW.mjs"));
29
29
 
30
30
  // packages/plugins/experimental/plugin-automation/src/translations.ts
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytes":16065,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1626,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":28076,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts","kind":"import-statement","original":"./system-instructions"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx","kind":"import-statement","original":"./AssistantPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":7188,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","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":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":16837,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4459,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":604,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-automation/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":29269,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":1109,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23858},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-23LY7DYS.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AssistantPanel-QIIX7S4V.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AssistantPanel","AutomationAction","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":8000},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1277},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":15955},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs","kind":"import-statement"}],"exports":["AUTOMATION_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/meta.ts","inputs":{},"bytes":261},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-23LY7DYS.mjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":358},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-23LY7DYS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2881},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-23LY7DYS.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytesInOutput":118}},"bytes":1746},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AssistantPanel-QIIX7S4V.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22440},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AssistantPanel-QIIX7S4V.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytesInOutput":7270},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytesInOutput":4071},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytesInOutput":45}},"bytes":12037},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13314},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/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}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4190},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":1492},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":6381},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":765},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":333}},"bytes":582}}}
1
+ {"inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytes":16049,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1626,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":28076,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts","kind":"import-statement","original":"./system-instructions"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx","kind":"import-statement","original":"./AssistantPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":7188,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","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":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":16837,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4459,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":604,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-automation/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":29269,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":1109,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23858},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-23LY7DYS.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AssistantPanel-72YH43CH.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AssistantPanel","AutomationAction","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":8000},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1277},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":15955},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs","kind":"import-statement"}],"exports":["AUTOMATION_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/meta.ts","inputs":{},"bytes":261},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-23LY7DYS.mjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":358},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-23LY7DYS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2881},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-23LY7DYS.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytesInOutput":118}},"bytes":1746},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AssistantPanel-72YH43CH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22432},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AssistantPanel-72YH43CH.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytesInOutput":7270},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytesInOutput":4067},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytesInOutput":45}},"bytes":12033},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13314},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/AutomationPanel-JUHOWQWW.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-script","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/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}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4190},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":1492},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":6381},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":765},"packages/plugins/experimental/plugin-automation/dist/lib/node-esm/chunk-HNOBZHWK.mjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":333}},"bytes":582}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-automation",
3
- "version": "0.7.3-staging.cc8dd3e",
3
+ "version": "0.7.3-staging.d887a4b",
4
4
  "description": "Prompt chain plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -47,36 +47,36 @@
47
47
  "@effect/schema": "^0.75.5",
48
48
  "@preact/signals-core": "^1.6.0",
49
49
  "lodash.get": "^4.4.2",
50
- "@dxos/app-framework": "0.7.3-staging.cc8dd3e",
51
- "@dxos/assistant": "0.7.3-staging.cc8dd3e",
52
- "@dxos/async": "0.7.3-staging.cc8dd3e",
53
- "@dxos/chain": "0.7.3-staging.cc8dd3e",
54
- "@dxos/context": "0.7.3-staging.cc8dd3e",
55
- "@dxos/invariant": "0.7.3-staging.cc8dd3e",
56
- "@dxos/functions": "0.7.3-staging.cc8dd3e",
57
- "@dxos/echo-schema": "0.7.3-staging.cc8dd3e",
58
- "@dxos/keys": "0.7.3-staging.cc8dd3e",
59
- "@dxos/echo-db": "0.7.3-staging.cc8dd3e",
60
- "@dxos/live-object": "0.7.3-staging.cc8dd3e",
61
- "@dxos/log": "0.7.3-staging.cc8dd3e",
62
- "@dxos/plugin-chess": "0.7.3-staging.cc8dd3e",
63
- "@dxos/plugin-client": "0.7.3-staging.cc8dd3e",
64
- "@dxos/plugin-deck": "0.7.3-staging.cc8dd3e",
65
- "@dxos/plugin-inbox": "0.7.3-staging.cc8dd3e",
66
- "@dxos/plugin-graph": "0.7.3-staging.cc8dd3e",
67
- "@dxos/plugin-markdown": "0.7.3-staging.cc8dd3e",
68
- "@dxos/plugin-ipfs": "0.7.3-staging.cc8dd3e",
69
- "@dxos/plugin-sketch": "0.7.3-staging.cc8dd3e",
70
- "@dxos/plugin-script": "0.7.3-staging.cc8dd3e",
71
- "@dxos/plugin-space": "0.7.3-staging.cc8dd3e",
72
- "@dxos/plugin-stack": "0.7.3-staging.cc8dd3e",
73
- "@dxos/react-client": "0.7.3-staging.cc8dd3e",
74
- "@dxos/react-ui-editor": "0.7.3-staging.cc8dd3e",
75
- "@dxos/react-ui-form": "0.7.3-staging.cc8dd3e",
76
- "@dxos/react-ui-list": "0.7.3-staging.cc8dd3e",
77
- "@dxos/react-ui-syntax-highlighter": "0.7.3-staging.cc8dd3e",
78
- "@dxos/util": "0.7.3-staging.cc8dd3e",
79
- "@dxos/schema": "0.7.3-staging.cc8dd3e"
50
+ "@dxos/app-framework": "0.7.3-staging.d887a4b",
51
+ "@dxos/assistant": "0.7.3-staging.d887a4b",
52
+ "@dxos/async": "0.7.3-staging.d887a4b",
53
+ "@dxos/chain": "0.7.3-staging.d887a4b",
54
+ "@dxos/echo-db": "0.7.3-staging.d887a4b",
55
+ "@dxos/echo-schema": "0.7.3-staging.d887a4b",
56
+ "@dxos/context": "0.7.3-staging.d887a4b",
57
+ "@dxos/functions": "0.7.3-staging.d887a4b",
58
+ "@dxos/invariant": "0.7.3-staging.d887a4b",
59
+ "@dxos/keys": "0.7.3-staging.d887a4b",
60
+ "@dxos/live-object": "0.7.3-staging.d887a4b",
61
+ "@dxos/log": "0.7.3-staging.d887a4b",
62
+ "@dxos/plugin-chess": "0.7.3-staging.d887a4b",
63
+ "@dxos/plugin-client": "0.7.3-staging.d887a4b",
64
+ "@dxos/plugin-deck": "0.7.3-staging.d887a4b",
65
+ "@dxos/plugin-graph": "0.7.3-staging.d887a4b",
66
+ "@dxos/plugin-inbox": "0.7.3-staging.d887a4b",
67
+ "@dxos/plugin-markdown": "0.7.3-staging.d887a4b",
68
+ "@dxos/plugin-ipfs": "0.7.3-staging.d887a4b",
69
+ "@dxos/plugin-script": "0.7.3-staging.d887a4b",
70
+ "@dxos/plugin-sketch": "0.7.3-staging.d887a4b",
71
+ "@dxos/plugin-stack": "0.7.3-staging.d887a4b",
72
+ "@dxos/plugin-space": "0.7.3-staging.d887a4b",
73
+ "@dxos/react-client": "0.7.3-staging.d887a4b",
74
+ "@dxos/react-ui-editor": "0.7.3-staging.d887a4b",
75
+ "@dxos/react-ui-form": "0.7.3-staging.d887a4b",
76
+ "@dxos/react-ui-list": "0.7.3-staging.d887a4b",
77
+ "@dxos/util": "0.7.3-staging.d887a4b",
78
+ "@dxos/react-ui-syntax-highlighter": "0.7.3-staging.d887a4b",
79
+ "@dxos/schema": "0.7.3-staging.d887a4b"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@phosphor-icons/react": "^2.1.5",
@@ -86,18 +86,18 @@
86
86
  "react": "~18.2.0",
87
87
  "react-dom": "~18.2.0",
88
88
  "vite": "5.4.7",
89
- "@dxos/random": "0.7.3-staging.cc8dd3e",
90
- "@dxos/echo-db": "0.7.3-staging.cc8dd3e",
91
- "@dxos/react-ui": "0.7.3-staging.cc8dd3e",
92
- "@dxos/storybook-utils": "0.7.3-staging.cc8dd3e",
93
- "@dxos/react-ui-theme": "0.7.3-staging.cc8dd3e"
89
+ "@dxos/echo-db": "0.7.3-staging.d887a4b",
90
+ "@dxos/react-ui": "0.7.3-staging.d887a4b",
91
+ "@dxos/react-ui-theme": "0.7.3-staging.d887a4b",
92
+ "@dxos/random": "0.7.3-staging.d887a4b",
93
+ "@dxos/storybook-utils": "0.7.3-staging.d887a4b"
94
94
  },
95
95
  "peerDependencies": {
96
96
  "@phosphor-icons/react": "^2.1.5",
97
97
  "react": "~18.2.0",
98
98
  "react-dom": "~18.2.0",
99
- "@dxos/react-ui-theme": "0.7.3-staging.cc8dd3e",
100
- "@dxos/react-ui": "0.7.3-staging.cc8dd3e"
99
+ "@dxos/react-ui": "0.7.3-staging.d887a4b",
100
+ "@dxos/react-ui-theme": "0.7.3-staging.d887a4b"
101
101
  },
102
102
  "publishConfig": {
103
103
  "access": "public"
@@ -84,7 +84,7 @@ const preprocessContextObject = async (object: ReactiveEchoObject<any>): Promise
84
84
 
85
85
  case 'dxos.org/type/Table': {
86
86
  // TODO(dmaretskyi): Load references.
87
- const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.typename) : undefined;
87
+ const schema = object.view ? space?.db.schemaRegistry.getSchema(object.view.query.type) : undefined;
88
88
  const { objects: rows } =
89
89
  (schema &&
90
90
  (await space.db