@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.c4373fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{TemplateContainer-RPJ2LBOB.mjs → BlueprintContainer-TO35YXHT.mjs} +11 -9
- package/dist/lib/browser/BlueprintContainer-TO35YXHT.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-ZIKNUUSU.mjs +127 -0
- package/dist/lib/browser/ChatCompanion-ZIKNUUSU.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs → ChatContainer-MA5BVDGH.mjs} +33 -14
- package/dist/lib/browser/ChatContainer-MA5BVDGH.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs → ChatDialog-7OXLIWZI.mjs} +26 -12
- package/dist/lib/browser/ChatDialog-7OXLIWZI.mjs.map +7 -0
- package/dist/lib/browser/{SequenceContainer-3UDVKWPA.mjs → SequenceContainer-2FEWMQGW.mjs} +7 -19
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs.map +7 -0
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +19 -0
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-VKFRYY2N.mjs +154 -0
- package/dist/lib/browser/app-graph-builder-VKFRYY2N.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs.map +7 -0
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs +175 -0
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-43I2LR6O.mjs +216 -0
- package/dist/lib/browser/chunk-43I2LR6O.mjs.map +7 -0
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs +16 -0
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-5RICKAMN.mjs +18 -0
- package/dist/lib/browser/chunk-5RICKAMN.mjs.map +7 -0
- package/dist/lib/browser/chunk-B2RCJXEO.mjs +202 -0
- package/dist/lib/browser/chunk-B2RCJXEO.mjs.map +7 -0
- package/dist/lib/browser/chunk-BRJMNZOS.mjs +169 -0
- package/dist/lib/browser/chunk-BRJMNZOS.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-P5P7QXBS.mjs +296 -0
- package/dist/lib/browser/chunk-P5P7QXBS.mjs.map +7 -0
- package/dist/lib/browser/chunk-UDH4MR7H.mjs +1744 -0
- package/dist/lib/browser/chunk-UDH4MR7H.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +18 -0
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +161 -68
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-5LB25ZRN.mjs +112 -0
- package/dist/lib/browser/intent-resolver-5LB25ZRN.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +17 -0
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-WQZXU624.mjs +107 -0
- package/dist/lib/browser/react-surface-WQZXU624.mjs.map +7 -0
- package/dist/lib/browser/{settings-2DGP3UTS.mjs → settings-4B2NA4CE.mjs} +8 -7
- package/dist/lib/{node-esm/settings-47RYZOU4.mjs.map → browser/settings-4B2NA4CE.mjs.map} +1 -1
- package/dist/lib/browser/state-LXTS54DI.mjs +21 -0
- package/dist/lib/browser/state-LXTS54DI.mjs.map +7 -0
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs +199 -0
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -4
- package/dist/lib/node-esm/{TemplateContainer-A3NAQCZE.mjs → BlueprintContainer-J664LTU3.mjs} +11 -9
- package/dist/lib/node-esm/BlueprintContainer-J664LTU3.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-YDXJIVCF.mjs +128 -0
- package/dist/lib/node-esm/ChatCompanion-YDXJIVCF.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs → ChatContainer-WLTOQLHH.mjs} +33 -14
- package/dist/lib/node-esm/ChatContainer-WLTOQLHH.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs → ChatDialog-ADKF62SY.mjs} +26 -12
- package/dist/lib/node-esm/ChatDialog-ADKF62SY.mjs.map +7 -0
- package/dist/lib/node-esm/{SequenceContainer-RQQH5XOC.mjs → SequenceContainer-PGGJUQ46.mjs} +7 -19
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +20 -0
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-K6AYO4YM.mjs +155 -0
- package/dist/lib/node-esm/app-graph-builder-K6AYO4YM.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs +20 -0
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DBDKOC3I.mjs +203 -0
- package/dist/lib/node-esm/chunk-DBDKOC3I.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs +217 -0
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-I7BZMIAG.mjs +170 -0
- package/dist/lib/node-esm/chunk-I7BZMIAG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TBQOICXZ.mjs +297 -0
- package/dist/lib/node-esm/chunk-TBQOICXZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs +177 -0
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UPPSDTOJ.mjs +1745 -0
- package/dist/lib/node-esm/chunk-UPPSDTOJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs +17 -0
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +19 -0
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +161 -68
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-I64MNI4C.mjs +113 -0
- package/dist/lib/node-esm/intent-resolver-I64MNI4C.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +18 -0
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-TVVVRIR3.mjs +108 -0
- package/dist/lib/node-esm/react-surface-TVVVRIR3.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-47RYZOU4.mjs → settings-7Y3CRASE.mjs} +8 -7
- package/dist/lib/{browser/settings-2DGP3UTS.mjs.map → node-esm/settings-7Y3CRASE.mjs.map} +1 -1
- package/dist/lib/node-esm/state-BO6GUFLB.mjs +22 -0
- package/dist/lib/node-esm/state-BO6GUFLB.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs +200 -0
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -4
- package/dist/types/src/AssistantPlugin.d.ts +1 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +4 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +7 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +11 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +11 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +4 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +8 -0
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +20 -17
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +13 -0
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +4 -4
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +4 -5
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +10 -7
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +115 -75
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts +40 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +264 -3
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +262 -7
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +3 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +259 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +11 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -9
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +262 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/functions/analysis.d.ts +5 -0
- package/dist/types/src/functions/analysis.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/list.d.ts +10 -0
- package/dist/types/src/functions/list.d.ts.map +1 -0
- package/dist/types/src/functions/load.d.ts +8 -0
- package/dist/types/src/functions/load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +7 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +25 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -21
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -6
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
- package/dist/types/src/hooks/useItemTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +3 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +3 -3
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +74 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/stories/Chat.stories.d.ts +29 -246
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/stories/QueryEditor.stories.d.ts +7 -0
- package/dist/types/src/stories/QueryEditor.stories.d.ts.map +1 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +4 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/DebugCard.d.ts +8 -0
- package/dist/types/src/stories/components/DebugCard.d.ts.map +1 -0
- package/dist/types/src/stories/components/ExecutionGraphContainer.d.ts +7 -0
- package/dist/types/src/stories/components/ExecutionGraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts +6 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts +4 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ProjectContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ProjectContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts +6 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ScriptContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ScriptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +4 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +18 -0
- package/dist/types/src/stories/components/index.d.ts.map +1 -0
- package/dist/types/src/stories/components/types.d.ts +7 -0
- package/dist/types/src/stories/components/types.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +9 -0
- package/dist/types/src/stories/testing/data.d.ts.map +1 -0
- package/dist/types/src/stories/testing/index.d.ts +3 -0
- package/dist/types/src/stories/testing/index.d.ts.map +1 -0
- package/dist/types/src/stories/testing/schema.d.ts +7 -0
- package/dist/types/src/stories/testing/schema.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +51 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +14 -0
- package/dist/types/src/testing/test-data.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +5 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +7 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +29 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +42 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +107 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +15 -12
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -92
- package/src/AssistantPlugin.tsx +151 -82
- package/src/capabilities/ai-service.ts +27 -0
- package/src/capabilities/app-graph-builder.ts +47 -137
- package/src/capabilities/blueprint-definition.ts +64 -0
- package/src/capabilities/capabilities.ts +18 -0
- package/src/capabilities/edge-model-resolver.ts +25 -0
- package/src/capabilities/index.ts +9 -0
- package/src/capabilities/intent-resolver.ts +51 -15
- package/src/capabilities/local-model-resolver.ts +30 -0
- package/src/capabilities/react-surface.tsx +17 -64
- package/src/capabilities/state.ts +20 -0
- package/src/capabilities/toolkit.ts +168 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +83 -76
- package/src/components/BlueprintContainer.tsx +24 -0
- package/src/components/Chat/Chat.tsx +180 -176
- package/src/components/Chat/events.ts +7 -0
- package/src/components/ChatCompanion.tsx +114 -0
- package/src/components/ChatContainer.tsx +19 -13
- package/src/components/ChatDialog.tsx +18 -14
- package/src/components/ChatProgress/ChatProgress.tsx +67 -0
- package/src/components/ChatProgress/index.ts +5 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -24
- package/src/components/ChatPrompt/ChatOptions.tsx +225 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +31 -36
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +98 -112
- package/src/components/ChatThread/ChatThread.tsx +65 -29
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/reducers.ts +151 -0
- package/src/components/ChatThread/registry.tsx +184 -0
- package/src/components/ChatThread/sync.test.ts +81 -0
- package/src/components/ChatThread/sync.ts +113 -0
- package/src/components/PromptSettings.tsx +1 -0
- package/src/components/SequenceContainer.tsx +29 -30
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +11 -8
- package/src/components/SequenceEditor/SequenceEditor.tsx +3 -3
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +28 -17
- package/src/components/TemplateEditor/TemplateEditor.tsx +21 -52
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +18 -13
- package/src/components/TemplateEditor/TemplateForm.tsx +7 -4
- package/src/components/TemplateEditor/handlebars-extension.ts +165 -0
- package/src/components/ToolBlock/ToolBlock.tsx +152 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbar/Toolbar.tsx +21 -0
- package/src/components/Toolbar/index.ts +5 -0
- package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +13 -22
- package/src/components/Toolbox/Toolbox.tsx +21 -51
- package/src/components/index.ts +4 -5
- package/src/events.ts +2 -2
- package/src/functions/analysis.ts +22 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +48 -0
- package/src/functions/load.ts +46 -0
- package/src/hooks/index.ts +7 -4
- package/src/hooks/useBlueprintRegistry.ts +94 -0
- package/src/hooks/useChatProcessor.ts +21 -98
- package/src/hooks/useChatServices.ts +29 -71
- package/src/hooks/useContextBinder.ts +18 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +11 -9
- package/src/meta.ts +4 -6
- package/src/processor/index.ts +6 -0
- package/src/{hooks → processor}/presets.ts +15 -7
- package/src/processor/processor.test.ts +81 -0
- package/src/processor/processor.ts +303 -0
- package/src/queue-logger.ts +10 -10
- package/src/stories/Chat.stories.tsx +818 -314
- package/src/stories/QueryEditor.stories.tsx +114 -0
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +74 -0
- package/src/stories/components/ChessContainer.tsx +17 -0
- package/src/stories/components/CommentsContainer.tsx +25 -0
- package/src/stories/components/DebugCard.tsx +61 -0
- package/src/stories/components/ExecutionGraphContainer.tsx +30 -0
- package/src/stories/components/GraphContainer.tsx +106 -0
- package/src/stories/components/InvocationsContainer.tsx +17 -0
- package/src/stories/components/MessageContainer.tsx +22 -0
- package/src/stories/components/ProjectContainer.tsx +17 -0
- package/src/stories/components/PromptContainer.tsx +52 -0
- package/src/stories/components/ResearchInputStack.tsx +30 -0
- package/src/stories/components/ResearchOutputStack.tsx +29 -0
- package/src/stories/components/ScriptContainer.tsx +28 -0
- package/src/stories/components/TasksContainer.tsx +47 -0
- package/src/stories/components/TokenManagerContainer.tsx +14 -0
- package/src/stories/components/TriggersContainer.tsx +12 -0
- package/src/stories/components/index.ts +22 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/testing/data.ts +135 -0
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/schema.ts +17 -0
- package/src/stories/testing/testing.tsx +291 -0
- package/src/testing/index.ts +3 -1
- package/src/testing/test-data.ts +248 -0
- package/src/testing/test-functions.ts +8 -3
- package/src/testing/test-generator.ts +261 -0
- package/src/testing/test-sequence.ts +2 -27
- package/src/translations.ts +32 -22
- package/src/types/Assistant.ts +61 -0
- package/src/types/AssistantAction.ts +62 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -1
- package/src/types/service.ts +2 -2
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs +0 -223
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEAEKWOC.mjs +0 -98
- package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +0 -7
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs +0 -108
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-FDCJSQYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-JQBVLTM5.mjs +0 -158
- package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
- package/dist/lib/browser/chunk-OWY4CUQY.mjs +0 -2245
- package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs +0 -60
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-66VY37YQ.mjs +0 -150
- package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs +0 -224
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs +0 -99
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs +0 -159
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs +0 -109
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs +0 -2246
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs +0 -61
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs +0 -151
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +0 -7
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -8
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -86
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -88
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatThread/ChatMessage.tsx +0 -268
- package/src/components/ChatThread/ToolBlock.tsx +0 -121
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/TemplateContainer.tsx +0 -24
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/chat-processor.ts +0 -314
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -95
- package/src/typings.d.ts +0 -9
|
@@ -2,88 +2,57 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { HighlightStyle, LanguageSupport, syntaxHighlighting } from '@codemirror/language';
|
|
6
|
-
import { styleTags, tags } from '@lezer/highlight';
|
|
7
|
-
import { handlebarsLanguage } from '@xiechao/codemirror-lang-handlebars';
|
|
8
5
|
import React from 'react';
|
|
9
6
|
|
|
10
7
|
import { type Template } from '@dxos/blueprints';
|
|
11
|
-
import { invariant } from '@dxos/invariant';
|
|
12
8
|
import { createDocAccessor } from '@dxos/react-client/echo';
|
|
13
|
-
import { useThemeContext, useTranslation
|
|
9
|
+
import { type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
14
10
|
import {
|
|
15
11
|
createBasicExtensions,
|
|
16
12
|
createDataExtensions,
|
|
13
|
+
createMarkdownExtensions,
|
|
17
14
|
createThemeExtensions,
|
|
15
|
+
decorateMarkdown,
|
|
18
16
|
useTextEditor,
|
|
19
17
|
} from '@dxos/react-ui-editor';
|
|
20
18
|
import { mx } from '@dxos/react-ui-theme';
|
|
19
|
+
import { isTruthy } from '@dxos/util';
|
|
21
20
|
|
|
22
21
|
import { meta } from '../../meta';
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
props: [
|
|
26
|
-
styleTags({
|
|
27
|
-
'---': tags.lineComment,
|
|
28
|
-
}),
|
|
29
|
-
],
|
|
30
|
-
});
|
|
23
|
+
import { handlebars } from './handlebars-extension';
|
|
31
24
|
|
|
32
25
|
export type TemplateEditorProps = ThemedClassName<{
|
|
26
|
+
id: string;
|
|
33
27
|
template: Template.Template;
|
|
34
28
|
}>;
|
|
35
29
|
|
|
36
|
-
export const TemplateEditor = ({ classNames, template }: TemplateEditorProps) => {
|
|
30
|
+
export const TemplateEditor = ({ id, classNames, template }: TemplateEditorProps) => {
|
|
37
31
|
const { t } = useTranslation(meta.id);
|
|
38
32
|
const { themeMode } = useThemeContext();
|
|
39
33
|
const { parentRef } = useTextEditor(() => {
|
|
40
|
-
|
|
34
|
+
const text = template.source?.target;
|
|
35
|
+
if (!text) {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
|
|
41
39
|
return {
|
|
42
|
-
initialValue:
|
|
40
|
+
initialValue: text.content ?? '',
|
|
43
41
|
extensions: [
|
|
44
|
-
createDataExtensions({
|
|
45
|
-
id: template.id,
|
|
46
|
-
text: createDocAccessor(template.source.target, ['content']),
|
|
47
|
-
}),
|
|
42
|
+
createDataExtensions({ id, text: createDocAccessor(text, ['content']) }),
|
|
48
43
|
createBasicExtensions({
|
|
49
44
|
bracketMatching: false,
|
|
50
45
|
lineNumbers: true,
|
|
51
46
|
lineWrapping: true,
|
|
52
|
-
monospace: true,
|
|
53
47
|
placeholder: t('template placeholder'),
|
|
54
48
|
}),
|
|
55
|
-
createThemeExtensions({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
new LanguageSupport(handlebarsLanguage, syntaxHighlighting(handlebarsHighlightStyle)),
|
|
61
|
-
],
|
|
49
|
+
createThemeExtensions({ themeMode }),
|
|
50
|
+
createMarkdownExtensions(),
|
|
51
|
+
decorateMarkdown(),
|
|
52
|
+
handlebars(),
|
|
53
|
+
].filter(isTruthy),
|
|
62
54
|
};
|
|
63
|
-
}, [themeMode, template]);
|
|
55
|
+
}, [themeMode, template.source?.target]);
|
|
64
56
|
|
|
65
|
-
return <div ref={parentRef} className={mx('
|
|
57
|
+
return <div ref={parentRef} className={mx('bs-full overflow-hidden', classNames)} />;
|
|
66
58
|
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* https://github.com/xiechao/lang-handlebars/blob/direct/src/highlight.js
|
|
70
|
-
*/
|
|
71
|
-
export const handlebarsHighlightStyle = HighlightStyle.define([
|
|
72
|
-
{
|
|
73
|
-
// Braces.
|
|
74
|
-
tag: tags.tagName,
|
|
75
|
-
class: 'text-redText',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
tag: tags.variableName,
|
|
79
|
-
class: 'text-blueText',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
tag: tags.keyword,
|
|
83
|
-
class: 'text-greenText',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
tag: tags.comment,
|
|
87
|
-
class: 'text-subdued',
|
|
88
|
-
},
|
|
89
|
-
]);
|
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta } from '@storybook/react-vite';
|
|
8
6
|
import React, { useState } from 'react';
|
|
9
7
|
|
|
10
|
-
import { Template } from '@dxos/blueprints';
|
|
8
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
11
9
|
import { useClient } from '@dxos/react-client';
|
|
12
10
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
|
-
import {
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
12
|
import { trim } from '@dxos/util';
|
|
15
13
|
|
|
16
|
-
import { TemplateForm } from './TemplateForm';
|
|
17
14
|
import { translations } from '../../translations';
|
|
18
15
|
|
|
16
|
+
import { TemplateForm } from './TemplateForm';
|
|
17
|
+
|
|
19
18
|
const TEMPLATE = trim`
|
|
20
19
|
You are a machine that is an expert chess player.
|
|
21
20
|
The move history of the current game is: {{history}}
|
|
@@ -28,35 +27,41 @@ const TEMPLATE = trim`
|
|
|
28
27
|
|
|
29
28
|
const DefaultStory = () => {
|
|
30
29
|
const client = useClient();
|
|
31
|
-
const [
|
|
30
|
+
const [blueprint] = useState(() => {
|
|
32
31
|
const space = client.spaces.default;
|
|
33
|
-
return space.db.add(
|
|
32
|
+
return space.db.add(
|
|
33
|
+
Blueprint.make({
|
|
34
|
+
key: 'example.com/blueprint/test',
|
|
35
|
+
name: 'Test',
|
|
36
|
+
instructions: Template.make({ source: TEMPLATE }),
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
34
39
|
});
|
|
35
40
|
|
|
36
41
|
return (
|
|
37
42
|
<div role='none' className='flex w-[40rem] border border-separator overflow-hidden'>
|
|
38
|
-
<TemplateForm template={
|
|
43
|
+
<TemplateForm id={blueprint.id} template={blueprint.instructions} />
|
|
39
44
|
</div>
|
|
40
45
|
);
|
|
41
46
|
};
|
|
42
47
|
|
|
43
|
-
const meta
|
|
48
|
+
const meta = {
|
|
44
49
|
title: 'plugins/plugin-assistant/TemplateForm',
|
|
45
50
|
component: TemplateForm,
|
|
46
51
|
render: DefaultStory,
|
|
47
52
|
decorators: [
|
|
53
|
+
withTheme,
|
|
48
54
|
withClientProvider({
|
|
55
|
+
types: [Blueprint.Blueprint],
|
|
49
56
|
createIdentity: true,
|
|
50
57
|
createSpace: true,
|
|
51
|
-
types: [Template.Template],
|
|
52
58
|
}),
|
|
53
|
-
withLayout({ fullscreen: true, classNames: 'flex justify-center' }),
|
|
54
|
-
withTheme,
|
|
55
59
|
],
|
|
56
60
|
parameters: {
|
|
61
|
+
layout: 'column',
|
|
57
62
|
translations,
|
|
58
63
|
},
|
|
59
|
-
}
|
|
64
|
+
} satisfies Meta<typeof TemplateForm>;
|
|
60
65
|
|
|
61
66
|
export default meta;
|
|
62
67
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import type * as Schema from 'effect/Schema';
|
|
6
6
|
import React, { Fragment, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type Template } from '@dxos/blueprints';
|
|
@@ -10,16 +10,18 @@ import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
|
10
10
|
import { attentionSurface, groupBorder, mx } from '@dxos/react-ui-theme';
|
|
11
11
|
import { isNonNullable } from '@dxos/util';
|
|
12
12
|
|
|
13
|
-
import { TemplateEditor } from './TemplateEditor';
|
|
14
13
|
import { meta } from '../../meta';
|
|
15
14
|
|
|
15
|
+
import { TemplateEditor } from './TemplateEditor';
|
|
16
|
+
|
|
16
17
|
export type TemplateFormProps = {
|
|
18
|
+
id: string;
|
|
17
19
|
template: Template.Template;
|
|
18
20
|
schema?: Schema.Schema<any, any, any>;
|
|
19
21
|
commandEditable?: boolean;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
|
-
export const TemplateForm = ({ template, commandEditable = true }: TemplateFormProps) => {
|
|
24
|
+
export const TemplateForm = ({ id, template, commandEditable = true }: TemplateFormProps) => {
|
|
23
25
|
const { t } = useTranslation(meta.id);
|
|
24
26
|
usePromptInputs(template);
|
|
25
27
|
|
|
@@ -41,7 +43,7 @@ export const TemplateForm = ({ template, commandEditable = true }: TemplateFormP
|
|
|
41
43
|
</div>
|
|
42
44
|
)} */}
|
|
43
45
|
|
|
44
|
-
<TemplateEditor template={template} classNames={[attentionSurface, 'min-h-[120px]']} />
|
|
46
|
+
<TemplateEditor id={id} template={template} classNames={[attentionSurface, 'min-h-[120px]']} />
|
|
45
47
|
|
|
46
48
|
{(template.inputs?.length ?? 0) > 0 && (
|
|
47
49
|
<div className='grid grid-cols-[10rem_10rem_1fr] gap-1 items-center'>
|
|
@@ -66,6 +68,7 @@ export const TemplateForm = ({ template, commandEditable = true }: TemplateFormP
|
|
|
66
68
|
</Select.Option>
|
|
67
69
|
))}
|
|
68
70
|
</Select.Viewport>
|
|
71
|
+
<Select.Arrow />
|
|
69
72
|
</Select.Content>
|
|
70
73
|
</Select.Portal>
|
|
71
74
|
</Select.Root>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
type CompletionContext,
|
|
7
|
+
type CompletionResult,
|
|
8
|
+
autocompletion,
|
|
9
|
+
completionKeymap,
|
|
10
|
+
} from '@codemirror/autocomplete';
|
|
11
|
+
import { type Extension } from '@codemirror/state';
|
|
12
|
+
import { Decoration, type DecorationSet, type EditorView, ViewPlugin, type ViewUpdate, keymap } from '@codemirror/view';
|
|
13
|
+
|
|
14
|
+
export type HandlebarsOptions = {};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Simple Handlebars plugin for CodeMirror.
|
|
18
|
+
* Supports:
|
|
19
|
+
* - Comments: {{! comment }}
|
|
20
|
+
* - Commands: {{#command}} {{/command}}
|
|
21
|
+
* - Variables: {{var}}
|
|
22
|
+
* - Commands with variables: {{#each items}} {{/each}}
|
|
23
|
+
*/
|
|
24
|
+
export const handlebars = (_: HandlebarsOptions = {}): Extension => {
|
|
25
|
+
return [
|
|
26
|
+
handlebarsHighlightPlugin,
|
|
27
|
+
autocompletion({
|
|
28
|
+
activateOnTyping: true,
|
|
29
|
+
aboveCursor: true,
|
|
30
|
+
closeOnBlur: true,
|
|
31
|
+
override: [handlebarsCompletions],
|
|
32
|
+
}),
|
|
33
|
+
keymap.of(completionKeymap),
|
|
34
|
+
];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const regex = {
|
|
38
|
+
comment: /\{\{!\s*[^}]*\}\}/g,
|
|
39
|
+
brackets: /\{\{[^}]*\}\}/g,
|
|
40
|
+
command: /\{\{[#/]([^}]+)\}\}/g,
|
|
41
|
+
var: /\{\{(?!\s*!)(\w[^}]*)\}\}/g,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* ViewPlugin that decorates Handlebars syntax.
|
|
46
|
+
*/
|
|
47
|
+
const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
48
|
+
class {
|
|
49
|
+
decorations: DecorationSet;
|
|
50
|
+
|
|
51
|
+
constructor(view: EditorView) {
|
|
52
|
+
this.decorations = this.buildDecorations(view);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
buildDecorations(view: EditorView) {
|
|
56
|
+
const widgets: any[] = [];
|
|
57
|
+
|
|
58
|
+
for (const { from, to } of view.visibleRanges) {
|
|
59
|
+
const text = view.state.doc.sliceString(from, to);
|
|
60
|
+
|
|
61
|
+
// Match comments: {{! comment }}
|
|
62
|
+
{
|
|
63
|
+
let match;
|
|
64
|
+
while ((match = regex.comment.exec(text)) !== null) {
|
|
65
|
+
const start = from + match.index;
|
|
66
|
+
const end = start + match[0].length;
|
|
67
|
+
widgets.push(Decoration.mark({ class: 'text-subdued' }).range(start, end));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Match brackets: {{ and }}
|
|
72
|
+
{
|
|
73
|
+
let match;
|
|
74
|
+
while ((match = regex.brackets.exec(text)) !== null) {
|
|
75
|
+
const start = from + match.index;
|
|
76
|
+
const end = start + match[0].length;
|
|
77
|
+
widgets.push(Decoration.mark({ class: 'text-subdued' }).range(start, end));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Match commands: {{#command}} and {{/command}}
|
|
82
|
+
{
|
|
83
|
+
let match;
|
|
84
|
+
while ((match = regex.command.exec(text)) !== null) {
|
|
85
|
+
const start = from + match.index + 2;
|
|
86
|
+
let end = start + match[0].length - 4;
|
|
87
|
+
const text = view.state.doc.sliceString(start, end);
|
|
88
|
+
const parts = text.split(/\s+/);
|
|
89
|
+
if (parts.length > 1) {
|
|
90
|
+
const idx = start + parts[0].length;
|
|
91
|
+
widgets.push(Decoration.mark({ class: 'text-greenText' }).range(idx, end));
|
|
92
|
+
end = idx;
|
|
93
|
+
}
|
|
94
|
+
widgets.push(Decoration.mark({ class: 'text-blueText' }).range(start, end));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Match variables: {{var}}
|
|
99
|
+
{
|
|
100
|
+
let match;
|
|
101
|
+
while ((match = regex.var.exec(text)) !== null) {
|
|
102
|
+
const start = from + match.index + 2;
|
|
103
|
+
const end = start + match[0].length - 4;
|
|
104
|
+
widgets.push(Decoration.mark({ class: 'text-greenText' }).range(start, end));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Sort decorations by position to avoid "Ranges must be added sorted" error.
|
|
110
|
+
widgets.sort((a, b) => a.from - b.from || a.startSide - b.startSide);
|
|
111
|
+
return Decoration.set(widgets);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
update(update: ViewUpdate) {
|
|
115
|
+
if (update.docChanged || update.viewportChanged) {
|
|
116
|
+
this.decorations = this.buildDecorations(update.view);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
decorations: (v) => v.decorations,
|
|
122
|
+
},
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
// TODO(burdon): Pass in variables.
|
|
126
|
+
const variables = ['this'];
|
|
127
|
+
const commands = ['this', 'each', 'if', 'unless', 'with'];
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Provides completions for Handlebars variables.
|
|
131
|
+
*/
|
|
132
|
+
function handlebarsCompletions(context: CompletionContext): CompletionResult | null {
|
|
133
|
+
const match = context.matchBefore(/\{\{[^}]*/);
|
|
134
|
+
if (!match || match.from === match.to) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let type = 'variable';
|
|
139
|
+
let text = match.text.slice(2);
|
|
140
|
+
let from = match.from + 2;
|
|
141
|
+
let matches = [];
|
|
142
|
+
if (text.startsWith('#') || text.startsWith('/')) {
|
|
143
|
+
const idx = text.lastIndexOf(' ');
|
|
144
|
+
if (idx !== -1) {
|
|
145
|
+
type = 'variable';
|
|
146
|
+
matches = variables;
|
|
147
|
+
text = text.slice(idx + 1);
|
|
148
|
+
from += idx + 1;
|
|
149
|
+
} else {
|
|
150
|
+
type = 'command';
|
|
151
|
+
text = text.slice(1);
|
|
152
|
+
matches = commands;
|
|
153
|
+
from += 1;
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
type = 'variable';
|
|
157
|
+
matches = variables;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const options = matches.filter((name) => name.startsWith(text)).map((name) => ({ type, label: name }));
|
|
161
|
+
return {
|
|
162
|
+
from,
|
|
163
|
+
options,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type * as Tool from '@effect/ai/Tool';
|
|
6
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type AgentStatus } from '@dxos/ai';
|
|
9
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import {
|
|
11
|
+
NumericTabs,
|
|
12
|
+
TextCrawl,
|
|
13
|
+
ToggleContainer,
|
|
14
|
+
chatMessageJson,
|
|
15
|
+
chatMessagePanel,
|
|
16
|
+
chatMessagePanelContent,
|
|
17
|
+
chatMessagePanelHeader,
|
|
18
|
+
} from '@dxos/react-ui-components';
|
|
19
|
+
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
20
|
+
import { type ContentBlock, type DataType } from '@dxos/schema';
|
|
21
|
+
import { isNonNullable, safeParseJson } from '@dxos/util';
|
|
22
|
+
|
|
23
|
+
import { meta } from '../../meta';
|
|
24
|
+
|
|
25
|
+
export const isToolMessage = (message: DataType.Message) => {
|
|
26
|
+
return message.blocks.some((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type ToolBlockProps = {
|
|
30
|
+
blocks: ContentBlock.Any[];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const ToolBlock = ({ blocks = [] }: ToolBlockProps) => {
|
|
34
|
+
const { t } = useTranslation(meta.id);
|
|
35
|
+
|
|
36
|
+
const getToolCaption = (tool?: Tool.Any, status?: AgentStatus) => {
|
|
37
|
+
if (!tool) {
|
|
38
|
+
return t('calling tool label');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return status?.message ?? tool.description ?? [t('calling label'), tool.name].join(' ');
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const items = useMemo(() => {
|
|
45
|
+
let lastToolCall: { tool: Tool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
|
|
46
|
+
// TODO(burdon): Get from context?
|
|
47
|
+
const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
|
|
48
|
+
return blocks
|
|
49
|
+
.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === 'summary')
|
|
50
|
+
.map((block) => {
|
|
51
|
+
switch (block._tag) {
|
|
52
|
+
case 'toolCall': {
|
|
53
|
+
if (block.pending && lastToolCall?.block.toolCallId === block.toolCallId) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const tool = tools.find((tool) => tool.name === block.name);
|
|
58
|
+
lastToolCall = { tool, block };
|
|
59
|
+
return {
|
|
60
|
+
title: getToolCaption(lastToolCall?.tool),
|
|
61
|
+
content: {
|
|
62
|
+
...block,
|
|
63
|
+
input: safeParseJson(block.input),
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
case 'toolResult': {
|
|
69
|
+
// TODO(burdon): Parse error type.
|
|
70
|
+
if (block.error) {
|
|
71
|
+
return {
|
|
72
|
+
title: t('error label'),
|
|
73
|
+
content: block,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const title = getToolCaption(lastToolCall?.tool ?? t('tool result label'));
|
|
78
|
+
lastToolCall = undefined;
|
|
79
|
+
return {
|
|
80
|
+
title,
|
|
81
|
+
content: {
|
|
82
|
+
...block,
|
|
83
|
+
result: safeParseJson(block.result),
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
case 'summary': {
|
|
89
|
+
if (!lastToolCall) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
title: t('summary label'),
|
|
95
|
+
content: block,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
.filter(isNonNullable);
|
|
101
|
+
}, [blocks]);
|
|
102
|
+
|
|
103
|
+
if (!items.length) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return <ToolContainer items={items} />;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
ToolBlock.displayName = 'ToolBlock';
|
|
111
|
+
|
|
112
|
+
type ToolContainerParams = {
|
|
113
|
+
items: { title: string; content: any }[];
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// TODO(burdon): Maintain scroll position when closing.
|
|
117
|
+
export const ToolContainer = ({ items }: ToolContainerParams) => {
|
|
118
|
+
const tabsRef = useRef<HTMLDivElement>(null);
|
|
119
|
+
const [selected, setSelected] = useState(0);
|
|
120
|
+
const [open, setOpen] = useState(false);
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (open) {
|
|
123
|
+
tabsRef.current?.focus();
|
|
124
|
+
}
|
|
125
|
+
}, [open]);
|
|
126
|
+
|
|
127
|
+
const handleSelect = (index: number) => {
|
|
128
|
+
setSelected(index);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const data = items[selected]?.content;
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<ToggleContainer.Root classNames={chatMessagePanel} open={open} onChangeOpen={setOpen}>
|
|
135
|
+
<ToggleContainer.Header classNames={chatMessagePanelHeader}>
|
|
136
|
+
<TextCrawl key='status-roll' lines={items.map((item) => item.title)} />
|
|
137
|
+
</ToggleContainer.Header>
|
|
138
|
+
<ToggleContainer.Content classNames={['grid grid-cols-[32px_1fr]', chatMessagePanelContent]}>
|
|
139
|
+
<NumericTabs ref={tabsRef} classNames='p-1' length={items.length} selected={selected} onSelect={handleSelect} />
|
|
140
|
+
<Json
|
|
141
|
+
data={data}
|
|
142
|
+
classNames={chatMessageJson}
|
|
143
|
+
replacer={{
|
|
144
|
+
maxDepth: 3,
|
|
145
|
+
maxArrayLen: 10,
|
|
146
|
+
maxStringLen: 128,
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
</ToggleContainer.Content>
|
|
150
|
+
</ToggleContainer.Root>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
8
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
9
|
+
import { MenuProvider, ToolbarMenu } from '@dxos/react-ui-menu';
|
|
10
|
+
|
|
11
|
+
import { type ChatToolbarActionsProps, useChatToolbarActions } from './useChatToolbarActions';
|
|
12
|
+
|
|
13
|
+
export const Toolbar = ({ chat, companionTo, onReset, classNames }: ThemedClassName<ChatToolbarActionsProps>) => {
|
|
14
|
+
const menu = useChatToolbarActions({ chat, companionTo, onReset });
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<MenuProvider {...menu} attendableId={companionTo ? fullyQualifiedId(companionTo) : fullyQualifiedId(chat)}>
|
|
18
|
+
<ToolbarMenu classNames={classNames} />
|
|
19
|
+
</MenuProvider>
|
|
20
|
+
);
|
|
21
|
+
};
|