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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/lib/browser/{AssistantPanel-32FH2RA6.mjs → AssistantPanel-NTOUHOWA.mjs} +3 -3
  2. package/dist/lib/browser/{AssistantPanel-32FH2RA6.mjs.map → AssistantPanel-NTOUHOWA.mjs.map} +2 -2
  3. package/dist/lib/browser/AutomationPanel-KT3YFV56.mjs +231 -0
  4. package/dist/lib/browser/AutomationPanel-KT3YFV56.mjs.map +7 -0
  5. package/dist/lib/browser/app-graph-builder-6FSMLMT4.mjs +131 -0
  6. package/dist/lib/browser/app-graph-builder-6FSMLMT4.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-4ODBJDXM.mjs +10 -0
  8. package/dist/lib/browser/chunk-4ODBJDXM.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-DN5M2QL5.mjs → chunk-DL6LB2NI.mjs} +2 -8
  10. package/dist/lib/browser/{chunk-DN5M2QL5.mjs.map → chunk-DL6LB2NI.mjs.map} +4 -4
  11. package/dist/lib/browser/{chunk-X5KMOH3I.mjs → chunk-DQ7ZSYJJ.mjs} +4 -4
  12. package/dist/lib/browser/chunk-DQ7ZSYJJ.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +89 -236
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/react-surface-5YTE5MRE.mjs +34 -0
  17. package/dist/lib/browser/react-surface-5YTE5MRE.mjs.map +7 -0
  18. package/dist/lib/browser/types/index.mjs +1 -3
  19. package/dist/lib/node/{AssistantPanel-XANI7YNV.cjs → AssistantPanel-U7GDWPRC.cjs} +7 -7
  20. package/dist/lib/node/{AssistantPanel-XANI7YNV.cjs.map → AssistantPanel-U7GDWPRC.cjs.map} +2 -2
  21. package/dist/lib/node/{AutomationPanel-VADY3HMP.cjs → AutomationPanel-H5WE4FIU.cjs} +112 -32
  22. package/dist/lib/node/AutomationPanel-H5WE4FIU.cjs.map +7 -0
  23. package/dist/lib/node/app-graph-builder-65TBXO3I.cjs +147 -0
  24. package/dist/lib/node/app-graph-builder-65TBXO3I.cjs.map +7 -0
  25. package/dist/lib/node/{chunk-NIL4TP6U.cjs → chunk-JNDMZQH7.cjs} +4 -9
  26. package/dist/lib/node/chunk-JNDMZQH7.cjs.map +7 -0
  27. package/dist/lib/node/chunk-JUSXT4U5.cjs +43 -0
  28. package/dist/lib/node/chunk-JUSXT4U5.cjs.map +7 -0
  29. package/dist/lib/node/{chunk-DTJ7XVO2.cjs → chunk-TQEDPRY5.cjs} +8 -8
  30. package/dist/lib/node/chunk-TQEDPRY5.cjs.map +7 -0
  31. package/dist/lib/node/index.cjs +112 -258
  32. package/dist/lib/node/index.cjs.map +4 -4
  33. package/dist/lib/node/meta.json +1 -1
  34. package/dist/lib/node/react-surface-S6U5ISJ6.cjs +57 -0
  35. package/dist/lib/node/react-surface-S6U5ISJ6.cjs.map +7 -0
  36. package/dist/lib/node/types/index.cjs +5 -7
  37. package/dist/lib/node/types/index.cjs.map +2 -2
  38. package/dist/lib/node-esm/{AssistantPanel-5M6O6JV7.mjs → AssistantPanel-M67P24GS.mjs} +3 -3
  39. package/dist/lib/node-esm/{AssistantPanel-5M6O6JV7.mjs.map → AssistantPanel-M67P24GS.mjs.map} +2 -2
  40. package/dist/lib/node-esm/AutomationPanel-MW42U6I4.mjs +232 -0
  41. package/dist/lib/node-esm/AutomationPanel-MW42U6I4.mjs.map +7 -0
  42. package/dist/lib/node-esm/app-graph-builder-4SD4F3KN.mjs +132 -0
  43. package/dist/lib/node-esm/app-graph-builder-4SD4F3KN.mjs.map +7 -0
  44. package/dist/lib/node-esm/{chunk-GCHXTXVT.mjs → chunk-GIAYUM5I.mjs} +2 -8
  45. package/dist/lib/node-esm/{chunk-GCHXTXVT.mjs.map → chunk-GIAYUM5I.mjs.map} +4 -4
  46. package/dist/lib/node-esm/{chunk-HNOBZHWK.mjs → chunk-JFHI22MF.mjs} +4 -4
  47. package/dist/lib/node-esm/chunk-JFHI22MF.mjs.map +7 -0
  48. package/dist/lib/node-esm/chunk-XVIEXSEZ.mjs +12 -0
  49. package/dist/lib/node-esm/chunk-XVIEXSEZ.mjs.map +7 -0
  50. package/dist/lib/node-esm/index.mjs +89 -236
  51. package/dist/lib/node-esm/index.mjs.map +4 -4
  52. package/dist/lib/node-esm/meta.json +1 -1
  53. package/dist/lib/node-esm/react-surface-RWTR3TKT.mjs +35 -0
  54. package/dist/lib/node-esm/react-surface-RWTR3TKT.mjs.map +7 -0
  55. package/dist/lib/node-esm/types/index.mjs +1 -3
  56. package/dist/types/src/AutomationPlugin.d.ts +1 -3
  57. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/app-graph-builder.d.ts +180 -0
  59. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  60. package/dist/types/src/capabilities/index.d.ts +179 -0
  61. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  62. package/dist/types/src/capabilities/react-surface.d.ts +4 -0
  63. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  64. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  65. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  66. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -2
  67. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  68. package/dist/types/src/components/index.d.ts +1 -1
  69. package/dist/types/src/components/index.d.ts.map +1 -1
  70. package/dist/types/src/index.d.ts +1 -2
  71. package/dist/types/src/index.d.ts.map +1 -1
  72. package/dist/types/src/meta.d.ts +1 -2
  73. package/dist/types/src/meta.d.ts.map +1 -1
  74. package/dist/types/src/translations.d.ts +7 -0
  75. package/dist/types/src/translations.d.ts.map +1 -1
  76. package/dist/types/src/types/index.d.ts +0 -1
  77. package/dist/types/src/types/index.d.ts.map +1 -1
  78. package/dist/types/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +38 -46
  80. package/src/AutomationPlugin.tsx +55 -193
  81. package/src/capabilities/app-graph-builder.ts +127 -0
  82. package/src/capabilities/index.ts +8 -0
  83. package/src/capabilities/react-surface.tsx +27 -0
  84. package/src/components/AssistantPanel/AssistantPanel.tsx +1 -4
  85. package/src/components/AutomationPanel/AutomationPanel.tsx +54 -37
  86. package/src/components/TriggerEditor/TriggerEditor.tsx +65 -8
  87. package/src/index.ts +1 -4
  88. package/src/meta.ts +3 -2
  89. package/src/translations.ts +9 -0
  90. package/src/types/index.ts +0 -1
  91. package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs +0 -151
  92. package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs.map +0 -7
  93. package/dist/lib/browser/chunk-X5KMOH3I.mjs.map +0 -7
  94. package/dist/lib/browser/meta.mjs +0 -9
  95. package/dist/lib/browser/meta.mjs.map +0 -7
  96. package/dist/lib/node/AutomationPanel-VADY3HMP.cjs.map +0 -7
  97. package/dist/lib/node/chunk-DTJ7XVO2.cjs.map +0 -7
  98. package/dist/lib/node/chunk-NIL4TP6U.cjs.map +0 -7
  99. package/dist/lib/node/meta.cjs +0 -30
  100. package/dist/lib/node/meta.cjs.map +0 -7
  101. package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs +0 -152
  102. package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs.map +0 -7
  103. package/dist/lib/node-esm/chunk-HNOBZHWK.mjs.map +0 -7
  104. package/dist/lib/node-esm/meta.mjs +0 -10
  105. package/dist/lib/node-esm/meta.mjs.map +0 -7
  106. package/dist/types/src/types/types.d.ts +0 -7
  107. package/dist/types/src/types/types.d.ts.map +0 -1
  108. package/src/types/types.ts +0 -27
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/AutomationPlugin.tsx", "../../../src/components/index.ts", "../../../src/translations.ts", "../../../src/presets.ts", "../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { createSurface, parseMetadataResolverPlugin, type PluginDefinition, resolvePlugin } from '@dxos/app-framework';\nimport { FunctionTrigger } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { parseClientPlugin } from '@dxos/plugin-client/types';\nimport { createExtension, toSignal } from '@dxos/plugin-graph';\nimport { memoizeQuery } from '@dxos/plugin-space';\nimport {\n getSpace,\n getTypename,\n isEchoObject,\n parseId,\n type ReactiveEchoObject,\n RefArray,\n SpaceState,\n} from '@dxos/react-client/echo';\nimport { translations as formTranslations } from '@dxos/react-ui-form';\n\nimport { AssistantPanel, AutomationPanel } from './components';\nimport meta, { AUTOMATION_PLUGIN } from './meta';\nimport translations from './translations';\nimport { type AutomationPluginProvides, ChainPromptType, ChainType } from './types';\n\nexport const AutomationPlugin = (): PluginDefinition<AutomationPluginProvides> => {\n return {\n meta,\n provides: {\n metadata: {\n records: {\n [ChainType.typename]: {\n placeholder: ['object placeholder', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: async (chain: ChainType) => await RefArray.loadAll(chain.prompts ?? []),\n },\n },\n },\n translations: [...translations, ...formTranslations],\n echo: {\n system: [ChainType, ChainPromptType, FunctionTrigger],\n },\n complementary: {\n panels: [\n {\n id: 'automation',\n label: ['open automation panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n },\n {\n id: 'assistant',\n label: ['open assistant panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--atom--regular',\n },\n ],\n },\n graph: {\n builder: (plugins) => {\n const clientPlugin = resolvePlugin(plugins, parseClientPlugin);\n const metadataPlugin = resolvePlugin(plugins, parseMetadataResolverPlugin);\n const resolve = metadataPlugin?.provides.metadata.resolver;\n const client = clientPlugin?.provides.client;\n invariant(resolve);\n invariant(client);\n\n return [\n // Create nodes for object settings.\n createExtension({\n id: `${AUTOMATION_PLUGIN}/automation-for-subject`,\n resolver: ({ id }) => {\n if (!id.endsWith('~automation')) {\n return;\n }\n\n const type = 'orphan-settings-for-subject';\n const icon = 'ph--magic-wand--regular';\n\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const spaces = toSignal(\n (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,\n () => client.spaces.get(),\n );\n const space = spaces?.find(\n (space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY,\n );\n if (!objectId) {\n // TODO(burdon): Ref SPACE_PLUGIN ns.\n const label = space\n ? space.properties.name || ['unnamed space label', { ns: AUTOMATION_PLUGIN }]\n : ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];\n\n // TODO(wittjosiah): Support comments for arbitrary subjects.\n // This is to ensure that the comments panel is not stuck on an old object.\n return {\n id,\n type,\n data: null,\n properties: {\n icon,\n label,\n showResolvedThreads: false,\n object: null,\n space,\n },\n };\n }\n\n const [object] = memoizeQuery(space, { id: objectId });\n if (!object || !subjectId) {\n return;\n }\n\n const meta = resolve(getTypename(object) ?? '');\n const label = meta.label?.(object) ||\n object.name ||\n meta.placeholder || ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];\n\n return {\n id,\n type,\n data: null,\n properties: {\n icon,\n label,\n object,\n },\n };\n },\n }),\n createExtension({\n id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,\n resolver: ({ id }) => {\n // TODO(Zan): Find util (or make one). Effect schema!!\n if (!id.endsWith('~assistant')) {\n return;\n }\n\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const spaces = toSignal(\n (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,\n () => client.spaces.get(),\n );\n const space = spaces?.find(\n (space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY,\n );\n if (!objectId) {\n // TODO(wittjosiah): Support assistant for arbitrary subjects.\n // This is to ensure that the assistant panel is not stuck on an old object.\n return {\n id,\n type: 'orphan-automation-for-subject',\n data: null,\n properties: {\n icon: 'ph--atom--regular',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n object: null,\n space,\n },\n };\n }\n\n const [object] = memoizeQuery(space, { id: objectId });\n\n return {\n id,\n type: 'orphan-automation-for-subject',\n data: null,\n properties: {\n icon: 'ph--atom--regular',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n object,\n },\n };\n },\n }),\n ];\n },\n },\n surface: {\n definitions: () => [\n createSurface({\n id: `${AUTOMATION_PLUGIN}/assistant`,\n role: 'complementary--assistant',\n component: ({ data }) => <AssistantPanel subject={data.subject} />,\n }),\n createSurface({\n id: `${AUTOMATION_PLUGIN}/automation`,\n role: 'complementary--automation',\n filter: (data): data is { subject: ReactiveEchoObject<any> } =>\n isEchoObject(data.subject) && !!getSpace(data.subject),\n component: ({ data }) => <AutomationPanel space={getSpace(data.subject)!} object={data.subject} />,\n }),\n ],\n },\n intent: {\n resolvers: () => [],\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const AssistantPanel = lazy(() => import('./AssistantPanel'));\nexport const AutomationPanel = lazy(() => import('./AutomationPanel'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AUTOMATION_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [AUTOMATION_PLUGIN]: {\n 'plugin name': 'Automation',\n 'object placeholder': 'New prompt',\n 'create object label': 'Create prompt',\n 'create trigger label': 'Create trigger',\n 'create stack section label': 'Create prompt',\n 'command placeholder': 'Enter slash command...',\n 'template placeholder': 'Enter template...',\n 'value placeholder': 'Enter value...',\n 'select preset template placeholder': 'Select preset',\n 'open automation panel label': 'Show Automations',\n\n 'function select label': 'Function',\n 'function select placeholder': 'Select function',\n 'function enabled': 'Enabled',\n 'trigger select label': 'Trigger',\n 'trigger select placeholder': 'Trigger type',\n\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n 'trigger type subscription': 'Subscription',\n\n 'trigger filter': 'Filter',\n 'trigger cron': 'Cron',\n 'trigger method': 'Method',\n 'trigger endpoint': 'Endpoint',\n\n 'open assistant panel label': 'Show Assistant',\n 'assistant panel label': 'Assistant',\n },\n },\n },\n];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { create } from '@dxos/live-object';\n\nimport { ChainInputType, ChainPromptType } from './types';\n\nexport const str = (...text: (string | undefined | boolean)[]): string =>\n text\n .filter((value) => value !== undefined && value !== false)\n .flat()\n .join('\\n');\n\nexport type Preset = {\n id: string;\n title: string;\n createPrompt: () => ChainPromptType;\n};\n\nexport const chainPresets: Preset[] = [\n {\n id: 'dxos.org/prompt/translate',\n title: 'Translate',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'say',\n template: str(\n // prettier-ignore\n 'Translate the following into {language}:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.VALUE,\n name: 'language',\n value: 'japanese',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n // TODO(burdon): Message.\n // {\n // type: ChainInputType.CONTEXT,\n // name: 'input',\n // value: 'object.text',\n // },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/chess',\n title: 'Chess',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'hint',\n template: str(\n // prettier-ignore\n 'You are a machine that is an expert chess player.',\n '',\n 'The move history of the current game is: {history}',\n '',\n 'Suggest the next move and very briefly explain your strategy in a couple of sentences.',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'history',\n value: 'object.pgn',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/mermaid',\n title: 'Mermaid',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'draw',\n template: str(\n // prettier-ignore\n 'Create a simplified mermaid graph representing the text below.',\n 'Do not explain anything.',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/list',\n title: 'List',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'list',\n template: str(\n // prettier-ignore\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a single array of JSON objects.',\n '',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{schema}',\n '',\n '---',\n '',\n '{question}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'schema',\n value: 'example.com/type/project',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'question',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/base',\n title: 'RAG',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'rag',\n template: str(\n // prettier-ignore\n \"Very briefly answer the question based only on the following context and say if you don't know the answer.\",\n // 'answer the question using the following context as well as your training data:',\n '',\n '{context}',\n '',\n '---',\n '',\n 'question: {question}',\n ),\n inputs: [\n {\n type: ChainInputType.RETRIEVER,\n name: 'context',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'question',\n value: 'object.text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/lookup',\n title: 'Lookup',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'lookup',\n template: str(\n // prettier-ignore\n 'Lookup and very briefly summarize the following topic in one or two sentences:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/extract',\n title: 'Extract',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'extract',\n template: str(\n // prettier-ignore\n 'List all people and companies mentioned in the text below.',\n '',\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{contact}',\n '{company}',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'contact',\n value: 'example.com/type/contact',\n },\n {\n type: ChainInputType.SCHEMA,\n name: 'company',\n value: 'example.com/type/organization',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/discord',\n title: 'Summarize',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'summarize',\n template: str(\n // prettier-ignore\n 'Summarize what the team is working on and format it as a markdown table without any explanation.',\n '',\n '---',\n '',\n '{context}',\n ),\n inputs: [\n {\n type: ChainInputType.RESOLVER,\n name: 'context',\n value: 'discord.messages.recent',\n },\n ],\n }),\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AutomationPlugin } from './AutomationPlugin';\n\nexport default AutomationPlugin;\n\nexport * from './AutomationPlugin';\nexport * from './components';\nexport * from './presets';\nexport * from './types';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAiG;AACjG,uBAAgC;AAChC,uBAA0B;AAC1B,mBAAkC;AAClC,0BAA0C;AAC1C,0BAA6B;AAC7B,kBAQO;AACP,2BAAiD;ACjBjD,IAAAA,gBAAqB;AEArB,yBAAuB;AFEhB,IAAMC,qBAAiBC,oBAAK,MAAM,OAAO,+BAAA,CAAA;AACzC,IAAMC,sBAAkBD,oBAAK,MAAM,OAAO,gCAAA,CAAA;ACDjD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,uCAAAA,GAAoB;QACnB,eAAe;QACf,sBAAsB;QACtB,uBAAuB;QACvB,wBAAwB;QACxB,8BAA8B;QAC9B,uBAAuB;QACvB,wBAAwB;QACxB,qBAAqB;QACrB,sCAAsC;QACtC,+BAA+B;QAE/B,yBAAyB;QACzB,+BAA+B;QAC/B,oBAAo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react", "AssistantPanel", "lazy", "AutomationPanel", "AUTOMATION_PLUGIN", "AutomationPlugin", "meta", "provides", "metadata", "records", "ChainType", "typename", "placeholder", "ns", "icon", "loadReferences", "chain", "RefArray", "loadAll", "prompts", "translations", "formTranslations", "echo", "system", "ChainPromptType", "FunctionTrigger", "complementary", "panels", "id", "label", "graph", "builder", "plugins", "clientPlugin", "resolvePlugin", "parseClientPlugin", "metadataPlugin", "parseMetadataResolverPlugin", "resolve", "resolver", "client", "invariant", "createExtension", "endsWith", "type", "subjectId", "split", "spaceId", "objectId", "parseId", "spaces", "toSignal", "onChange", "subscribe", "unsubscribe", "get", "space", "find", "state", "SpaceState", "SPACE_READY", "properties", "name", "data", "showResolvedThreads", "object", "memoizeQuery", "getTypename", "surface", "definitions", "createSurface", "role", "component", "React", "subject", "filter", "isEchoObject", "getSpace", "intent", "resolvers", "str", "text", "value", "undefined", "flat", "join", "chainPresets", "title", "createPrompt", "create", "command", "template", "inputs", "ChainInputType", "VALUE", "PASS_THROUGH", "CONTEXT", "SCHEMA", "RETRIEVER", "RESOLVER"]
3
+ "sources": ["../../../src/AutomationPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts", "../../../src/presets.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { FunctionTrigger } from '@dxos/functions';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { RefArray } from '@dxos/react-client/echo';\n\nimport { AppGraphBuilder, ReactSurface } from './capabilities';\nimport { AUTOMATION_PLUGIN, meta } from './meta';\nimport translations from './translations';\nimport { ChainPromptType, ChainType } from './types';\n\nexport const AutomationPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: ChainType.typename,\n metadata: {\n placeholder: ['object placeholder', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: async (chain: ChainType) => await RefArray.loadAll(chain.prompts ?? []),\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.SystemSchema, [ChainType, ChainPromptType, FunctionTrigger]),\n }),\n defineModule({\n id: `${meta.id}/module/complementary-panels`,\n activatesOn: Events.Startup,\n activate: () => [\n contributes(DeckCapabilities.ComplementaryPanel, {\n id: 'automation',\n label: ['automation panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n }),\n contributes(DeckCapabilities.ComplementaryPanel, {\n id: 'assistant',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--atom--regular',\n }),\n ],\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupSurfaces,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AUTOMATION_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [AUTOMATION_PLUGIN]: {\n 'plugin name': 'Automation',\n 'object placeholder': 'New prompt',\n 'create object label': 'Create prompt',\n 'create trigger label': 'Create trigger',\n 'create stack section label': 'Create prompt',\n 'command placeholder': 'Enter slash command...',\n 'template placeholder': 'Enter template...',\n 'value placeholder': 'Enter value...',\n 'select preset template placeholder': 'Select preset',\n 'open automation panel label': 'Show Automations',\n 'automation panel label': 'Automations',\n\n 'function select label': 'Function',\n 'function select placeholder': 'Select function',\n 'function enabled': 'Enabled',\n 'trigger select label': 'Trigger',\n 'trigger select placeholder': 'Trigger type',\n\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n 'trigger type subscription': 'Subscription',\n 'trigger type email': 'Email',\n\n 'trigger filter': 'Filter',\n 'trigger cron': 'Cron',\n 'trigger method': 'Method',\n 'trigger endpoint': 'Endpoint',\n\n 'trigger copy url': 'Copy URL',\n 'trigger copy email': 'Copy Email',\n\n 'trigger meta add': 'Add',\n 'trigger meta remove': 'Remove',\n 'trigger meta prop name placeholder': 'New meta property name',\n\n 'open assistant panel label': 'Show Assistant',\n 'assistant panel label': 'Assistant',\n },\n },\n },\n];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { create } from '@dxos/live-object';\n\nimport { ChainInputType, ChainPromptType } from './types';\n\nexport const str = (...text: (string | undefined | boolean)[]): string =>\n text\n .filter((value) => value !== undefined && value !== false)\n .flat()\n .join('\\n');\n\nexport type Preset = {\n id: string;\n title: string;\n createPrompt: () => ChainPromptType;\n};\n\nexport const chainPresets: Preset[] = [\n {\n id: 'dxos.org/prompt/translate',\n title: 'Translate',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'say',\n template: str(\n // prettier-ignore\n 'Translate the following into {language}:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.VALUE,\n name: 'language',\n value: 'japanese',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n // TODO(burdon): Message.\n // {\n // type: ChainInputType.CONTEXT,\n // name: 'input',\n // value: 'object.text',\n // },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/chess',\n title: 'Chess',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'hint',\n template: str(\n // prettier-ignore\n 'You are a machine that is an expert chess player.',\n '',\n 'The move history of the current game is: {history}',\n '',\n 'Suggest the next move and very briefly explain your strategy in a couple of sentences.',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'history',\n value: 'object.pgn',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/mermaid',\n title: 'Mermaid',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'draw',\n template: str(\n // prettier-ignore\n 'Create a simplified mermaid graph representing the text below.',\n 'Do not explain anything.',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/list',\n title: 'List',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'list',\n template: str(\n // prettier-ignore\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a single array of JSON objects.',\n '',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{schema}',\n '',\n '---',\n '',\n '{question}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'schema',\n value: 'example.com/type/project',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'question',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/base',\n title: 'RAG',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'rag',\n template: str(\n // prettier-ignore\n \"Very briefly answer the question based only on the following context and say if you don't know the answer.\",\n // 'answer the question using the following context as well as your training data:',\n '',\n '{context}',\n '',\n '---',\n '',\n 'question: {question}',\n ),\n inputs: [\n {\n type: ChainInputType.RETRIEVER,\n name: 'context',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'question',\n value: 'object.text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/lookup',\n title: 'Lookup',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'lookup',\n template: str(\n // prettier-ignore\n 'Lookup and very briefly summarize the following topic in one or two sentences:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/extract',\n title: 'Extract',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'extract',\n template: str(\n // prettier-ignore\n 'List all people and companies mentioned in the text below.',\n '',\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{contact}',\n '{company}',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'contact',\n value: 'example.com/type/contact',\n },\n {\n type: ChainInputType.SCHEMA,\n name: 'company',\n value: 'example.com/type/organization',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/discord',\n title: 'Summarize',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'summarize',\n template: str(\n // prettier-ignore\n 'Summarize what the team is working on and format it as a markdown table without any explanation.',\n '',\n '---',\n '',\n '{context}',\n ),\n inputs: [\n {\n type: ChainInputType.RESOLVER,\n name: 'context',\n value: 'discord.messages.recent',\n },\n ],\n }),\n },\n];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA8E;AAC9E,uBAAgC;AAChC,2BAAiD;AACjD,yBAAiC;AACjC,kBAAyB;ACJzB,IAAAA,wBAAqB;AEArB,yBAAuB;AFEhB,IAAMC,sBAAkBC,4BAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,mBAAeD,4BAAK,MAAM,OAAO,8BAAA,CAAA;ACD9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,uCAAAA,GAAoB;QACnB,eAAe;QACf,sBAAsB;QACtB,uBAAuB;QACvB,wBAAwB;QACxB,8BAA8B;QA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ACtBmB,SAAS;MACTC,UAAUZ;;QAER;QACA;QACA;QACA;QACA;MAAA;MAEFa,QAAQ;QACN;UACEC,MAAMC,qCAAeO;UACrBL,MAAM;UACNd,OAAO;QACT;;IAEJ,CAAA;EACJ;;",
6
+ "names": ["import_app_framework", "AppGraphBuilder", "lazy", "ReactSurface", "AUTOMATION_PLUGIN", "AutomationPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "ChainType", "typename", "metadata", "placeholder", "ns", "icon", "loadReferences", "chain", "RefArray", "loadAll", "prompts", "ClientEvents", "SetupSchema", "ClientCapabilities", "SystemSchema", "ChainPromptType", "FunctionTrigger", "Startup", "DeckCapabilities", "ComplementaryPanel", "label", "SetupSurfaces", "SetupAppGraph", "str", "text", "filter", "value", "undefined", "flat", "join", "chainPresets", "title", "createPrompt", "create", "command", "template", "inputs", "type", "ChainInputType", "VALUE", "name", "PASS_THROUGH", "CONTEXT", "SCHEMA", "RETRIEVER", "RESOLVER"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytes":16049,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1626,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":28000,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts","kind":"import-statement","original":"./system-instructions"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytes":739,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx","kind":"import-statement","original":"./AssistantPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytes":7128,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":16783,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":4459,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytes":1464,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":604,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/experimental/plugin-automation/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":29041,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":1109,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23991},"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-NIL4TP6U.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-XANI7YNV.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-VADY3HMP.cjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AssistantPanel","AutomationAction","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","default","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":7755},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1277},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":36},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":15618},"packages/plugins/experimental/plugin-automation/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"}],"exports":["AUTOMATION_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/meta.ts","inputs":{},"bytes":169},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-NIL4TP6U.cjs","kind":"import-statement"}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":266},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-NIL4TP6U.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2879},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-NIL4TP6U.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AutomationAction","ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/types/types.ts":{"bytesInOutput":118}},"bytes":1653},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-XANI7YNV.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22398},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-XANI7YNV.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytesInOutput":7244},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytesInOutput":4067},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts":{"bytesInOutput":45}},"bytes":11915},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-VADY3HMP.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13284},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-VADY3HMP.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4160},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":1456},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytesInOutput":47}},"bytes":6223},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":763},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-DTJ7XVO2.cjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":333}},"bytes":489}}}
1
+ {"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytes":1924,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts":{"bytes":16198,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/system-instructions.ts":{"bytes":16049,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx":{"bytes":27867,"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":15243,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts":{"bytes":557,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx","kind":"import-statement","original":"./TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytes":19445,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/index.ts","kind":"import-statement","original":"../TriggerEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts":{"bytes":751,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx","kind":"import-statement","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytes":1078,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/index.ts","kind":"dynamic-import","original":"./AssistantPanel"},{"path":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","kind":"dynamic-import","original":"./AutomationPanel"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx":{"bytes":3922,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts":{"bytes":1109,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts","kind":"dynamic-import","original":"./app-graph-builder"},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytes":5419,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytes":4248,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytes":519,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/types/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytes":10038,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytes":19268,"imports":[{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytes":885,"imports":[{"path":"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx","kind":"import-statement","original":"./AutomationPlugin"},{"path":"packages/plugins/experimental/plugin-automation/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-automation/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-automation/src/presets.ts","kind":"import-statement","original":"./presets"},{"path":"packages/plugins/experimental/plugin-automation/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16189},"packages/plugins/experimental/plugin-automation/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JNDMZQH7.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JUSXT4U5.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-TQEDPRY5.cjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/app-graph-builder-65TBXO3I.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/react-surface-S6U5ISJ6.cjs","kind":"dynamic-import"},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["AUTOMATION_PLUGIN","AssistantPanel","AutomationPanel","AutomationPlugin","ChainInputSchema","ChainInputType","ChainPromptType","ChainType","chainPresets","meta","str"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx":{"bytesInOutput":2237},"packages/plugins/experimental/plugin-automation/src/capabilities/index.ts":{"bytesInOutput":193},"packages/plugins/experimental/plugin-automation/src/translations.ts":{"bytesInOutput":1597},"packages/plugins/experimental/plugin-automation/src/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-automation/src/presets.ts":{"bytesInOutput":5489}},"bytes":10365},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-automation/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JNDMZQH7.cjs","kind":"import-statement"}],"exports":["ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/types/index.ts","inputs":{},"bytes":226},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JNDMZQH7.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2081},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JNDMZQH7.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["ChainInputSchema","ChainInputType","ChainPromptType","ChainType"],"inputs":{"packages/plugins/experimental/plugin-automation/src/types/schema.ts":{"bytesInOutput":1247},"packages/plugins/experimental/plugin-automation/src/types/index.ts":{"bytesInOutput":0}},"bytes":1444},"packages/plugins/experimental/plugin-automation/dist/lib/node/app-graph-builder-65TBXO3I.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7468},"packages/plugins/experimental/plugin-automation/dist/lib/node/app-graph-builder-65TBXO3I.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-TQEDPRY5.cjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts":{"bytesInOutput":3950}},"bytes":4207},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-U7GDWPRC.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22315},"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-U7GDWPRC.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-TQEDPRY5.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":7219},"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":11890},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-H5WE4FIU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18642},"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-H5WE4FIU.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-TQEDPRY5.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/index.ts","inputs":{"packages/plugins/experimental/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx":{"bytesInOutput":4886},"packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx":{"bytesInOutput":3869},"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":9362},"packages/plugins/experimental/plugin-automation/dist/lib/node/react-surface-S6U5ISJ6.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1915},"packages/plugins/experimental/plugin-automation/dist/lib/node/react-surface-S6U5ISJ6.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JUSXT4U5.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-TQEDPRY5.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/experimental/plugin-automation/src/capabilities/react-surface.tsx":{"bytesInOutput":812}},"bytes":1134},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JUSXT4U5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":503},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-JUSXT4U5.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AssistantPanel-U7GDWPRC.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-automation/dist/lib/node/AutomationPanel-H5WE4FIU.cjs","kind":"dynamic-import"}],"exports":["AssistantPanel","AutomationPanel"],"inputs":{"packages/plugins/experimental/plugin-automation/src/components/index.ts":{"bytesInOutput":180}},"bytes":348},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-TQEDPRY5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":892},"packages/plugins/experimental/plugin-automation/dist/lib/node/chunk-TQEDPRY5.cjs":{"imports":[],"exports":["AUTOMATION_PLUGIN","meta"],"inputs":{"packages/plugins/experimental/plugin-automation/src/meta.ts":{"bytesInOutput":434}},"bytes":582}}}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_surface_S6U5ISJ6_exports = {};
30
+ __export(react_surface_S6U5ISJ6_exports, {
31
+ default: () => react_surface_default
32
+ });
33
+ module.exports = __toCommonJS(react_surface_S6U5ISJ6_exports);
34
+ var import_chunk_JUSXT4U5 = require("./chunk-JUSXT4U5.cjs");
35
+ var import_chunk_TQEDPRY5 = require("./chunk-TQEDPRY5.cjs");
36
+ var import_react = __toESM(require("react"));
37
+ var import_app_framework = require("@dxos/app-framework");
38
+ var import_echo = require("@dxos/react-client/echo");
39
+ var react_surface_default = () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, [
40
+ (0, import_app_framework.createSurface)({
41
+ id: `${import_chunk_TQEDPRY5.AUTOMATION_PLUGIN}/assistant`,
42
+ role: "complementary--assistant",
43
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_JUSXT4U5.AssistantPanel, {
44
+ subject: data.subject
45
+ })
46
+ }),
47
+ (0, import_app_framework.createSurface)({
48
+ id: `${import_chunk_TQEDPRY5.AUTOMATION_PLUGIN}/automation`,
49
+ role: "complementary--automation",
50
+ filter: (data) => (0, import_echo.isEchoObject)(data.subject) && !!(0, import_echo.getSpace)(data.subject),
51
+ component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(import_chunk_JUSXT4U5.AutomationPanel, {
52
+ space: (0, import_echo.getSpace)(data.subject),
53
+ object: data.subject
54
+ })
55
+ })
56
+ ]);
57
+ //# sourceMappingURL=react-surface-S6U5ISJ6.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/react-surface.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { getSpace, isEchoObject, type ReactiveEchoObject } from '@dxos/react-client/echo';\n\nimport { AssistantPanel, AutomationPanel } from '../components';\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${AUTOMATION_PLUGIN}/assistant`,\n role: 'complementary--assistant',\n component: ({ data }) => <AssistantPanel subject={data.subject} />,\n }),\n createSurface({\n id: `${AUTOMATION_PLUGIN}/automation`,\n role: 'complementary--automation',\n filter: (data): data is { subject: ReactiveEchoObject<any> } =>\n isEchoObject(data.subject) && !!getSpace(data.subject),\n component: ({ data }) => <AutomationPanel space={getSpace(data.subject)!} object={data.subject} />,\n }),\n ]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAyD;AACzD,kBAAgE;AAKhE,IAAA,wBAAe,UACbA,kCAAYC,kCAAaC,cAAc;MACrCC,oCAAc;IACZC,IAAI,GAAGC,uCAAAA;IACPC,MAAM;IACNC,WAAW,CAAC,EAAEC,KAAI,MAAO,6BAAAC,QAAA,cAACC,sCAAAA;MAAeC,SAASH,KAAKG;;EACzD,CAAA;MACAR,oCAAc;IACZC,IAAI,GAAGC,uCAAAA;IACPC,MAAM;IACNM,QAAQ,CAACJ,aACPK,0BAAaL,KAAKG,OAAO,KAAK,CAAC,KAACG,sBAASN,KAAKG,OAAO;IACvDJ,WAAW,CAAC,EAAEC,KAAI,MAAO,6BAAAC,QAAA,cAACM,uCAAAA;MAAgBC,WAAOF,sBAASN,KAAKG,OAAO;MAAIM,QAAQT,KAAKG;;EACzF,CAAA;CACD;",
6
+ "names": ["contributes", "Capabilities", "ReactSurface", "createSurface", "id", "AUTOMATION_PLUGIN", "role", "component", "data", "React", "AssistantPanel", "subject", "filter", "isEchoObject", "getSpace", "AutomationPanel", "space", "object"]
7
+ }
@@ -18,17 +18,15 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var types_exports = {};
20
20
  __export(types_exports, {
21
- AutomationAction: () => import_chunk_NIL4TP6U.AutomationAction,
22
- ChainInputSchema: () => import_chunk_NIL4TP6U.ChainInputSchema,
23
- ChainInputType: () => import_chunk_NIL4TP6U.ChainInputType,
24
- ChainPromptType: () => import_chunk_NIL4TP6U.ChainPromptType,
25
- ChainType: () => import_chunk_NIL4TP6U.ChainType
21
+ ChainInputSchema: () => import_chunk_JNDMZQH7.ChainInputSchema,
22
+ ChainInputType: () => import_chunk_JNDMZQH7.ChainInputType,
23
+ ChainPromptType: () => import_chunk_JNDMZQH7.ChainPromptType,
24
+ ChainType: () => import_chunk_JNDMZQH7.ChainType
26
25
  });
27
26
  module.exports = __toCommonJS(types_exports);
28
- var import_chunk_NIL4TP6U = require("../chunk-NIL4TP6U.cjs");
27
+ var import_chunk_JNDMZQH7 = require("../chunk-JNDMZQH7.cjs");
29
28
  // Annotate the CommonJS export names for ESM import in node:
30
29
  0 && (module.exports = {
31
- AutomationAction,
32
30
  ChainInputSchema,
33
31
  ChainInputType,
34
32
  ChainPromptType,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["index.cjs"],
4
- "sourcesContent": ["import {\n AutomationAction,\n ChainInputSchema,\n ChainInputType,\n ChainPromptType,\n ChainType\n} from \"../chunk-NIL4TP6U.cjs\";\nexport {\n AutomationAction,\n ChainInputSchema,\n ChainInputType,\n ChainPromptType,\n ChainType\n};\n//# sourceMappingURL=index.cjs.map\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAMO;",
4
+ "sourcesContent": ["import {\n ChainInputSchema,\n ChainInputType,\n ChainPromptType,\n ChainType\n} from \"../chunk-JNDMZQH7.cjs\";\nexport {\n ChainInputSchema,\n ChainInputType,\n ChainPromptType,\n ChainType\n};\n//# sourceMappingURL=index.cjs.map\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKO;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  AUTOMATION_PLUGIN
4
- } from "./chunk-HNOBZHWK.mjs";
4
+ } from "./chunk-JFHI22MF.mjs";
5
5
 
6
6
  // packages/plugins/experimental/plugin-automation/src/components/AssistantPanel/AssistantPanel.tsx
7
7
  import React, { useEffect, useRef, useState } from "react";
@@ -292,7 +292,7 @@ var MessageItem = ({ classNames, message }) => {
292
292
  return /* @__PURE__ */ React.createElement("div", {
293
293
  key: i,
294
294
  role: "none",
295
- className: mx(styleContainer, role === "user" ? "bg-primary-400 dark:bg-primary-600" : "bg-hoverSurface")
295
+ className: mx(styleContainer, role === "user" ? "bg-accentSurface" : "bg-input")
296
296
  }, cot && /* @__PURE__ */ React.createElement("div", {
297
297
  className: "p-2 whitespace-pre-wrap text-xs text-subdued"
298
298
  }, cot), /* @__PURE__ */ React.createElement("div", {
@@ -337,4 +337,4 @@ var AssistantPanel_default = AssistantPanel;
337
337
  export {
338
338
  AssistantPanel_default as default
339
339
  };
340
- //# sourceMappingURL=AssistantPanel-5M6O6JV7.mjs.map
340
+ //# sourceMappingURL=AssistantPanel-M67P24GS.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>\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,iBAA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,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;",
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>\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(styleContainer, role === 'user' ? 'bg-accentSurface' : 'bg-input')}\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,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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;;;AE5NA,IAAA,yBAAe8D;",
6
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
  }