@dxos/plugin-assistant 0.8.4-main.28f8d3d → 0.8.4-main.406dc2a
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/{BlueprintContainer-H7H4BQ2C.mjs → BlueprintContainer-WX2SSDVI.mjs} +6 -7
- package/dist/lib/browser/{BlueprintContainer-H7H4BQ2C.mjs.map → BlueprintContainer-WX2SSDVI.mjs.map} +3 -3
- package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs +150 -0
- package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-OUVSX5V5.mjs → ChatContainer-RYGNN73X.mjs} +20 -23
- package/dist/lib/browser/ChatContainer-RYGNN73X.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-P4FLEOHG.mjs → ChatDialog-MVHH2U66.mjs} +12 -12
- package/dist/lib/browser/ChatDialog-MVHH2U66.mjs.map +7 -0
- package/dist/lib/browser/{SequenceContainer-627OQ557.mjs → SequenceContainer-2FEWMQGW.mjs} +6 -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-AVHHQ3KV.mjs → app-graph-builder-2U7SLCRX.mjs} +22 -34
- package/dist/lib/browser/app-graph-builder-2U7SLCRX.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/{blueprint-definition-CMGIZAOW.mjs → chunk-2CE2KPKZ.mjs} +69 -40
- 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-CQ7UHYTT.mjs +296 -0
- package/dist/lib/browser/chunk-CQ7UHYTT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HRLMD35M.mjs → chunk-FP56WB24.mjs} +36 -15
- package/dist/lib/browser/chunk-FP56WB24.mjs.map +7 -0
- package/dist/lib/browser/chunk-JZRZVB2A.mjs +170 -0
- package/dist/lib/browser/chunk-JZRZVB2A.mjs.map +7 -0
- package/dist/lib/browser/chunk-WRJGOT5P.mjs +1794 -0
- package/dist/lib/browser/chunk-WRJGOT5P.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 +127 -54
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-MVOIEJXZ.mjs → intent-resolver-3GOJMBXJ.mjs} +48 -15
- package/dist/lib/browser/intent-resolver-3GOJMBXJ.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-4HXS3YLT.mjs → react-surface-FTKCE6GG.mjs} +20 -76
- package/dist/lib/browser/react-surface-FTKCE6GG.mjs.map +7 -0
- package/dist/lib/browser/{settings-G2EZXMWT.mjs → settings-HBF32KV6.mjs} +5 -5
- package/dist/lib/browser/{settings-G2EZXMWT.mjs.map → settings-HBF32KV6.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 +2 -2
- package/dist/lib/node-esm/{BlueprintContainer-VH4EE4CM.mjs → BlueprintContainer-4MKN6ZRB.mjs} +6 -7
- package/dist/lib/node-esm/{BlueprintContainer-VH4EE4CM.mjs.map → BlueprintContainer-4MKN6ZRB.mjs.map} +3 -3
- package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs +151 -0
- package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-D5FABDNE.mjs → ChatContainer-UTJGCQXF.mjs} +20 -23
- package/dist/lib/node-esm/ChatContainer-UTJGCQXF.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-NKWVXHJP.mjs → ChatDialog-QEYZ4IOV.mjs} +12 -12
- package/dist/lib/node-esm/ChatDialog-QEYZ4IOV.mjs.map +7 -0
- package/dist/lib/node-esm/{SequenceContainer-EQ5NP2PG.mjs → SequenceContainer-PGGJUQ46.mjs} +6 -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-RMOUJMMG.mjs → app-graph-builder-OKNLR7H2.mjs} +22 -34
- package/dist/lib/node-esm/app-graph-builder-OKNLR7H2.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-DSE2IILK.mjs +217 -0
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-E2WXZND7.mjs +297 -0
- package/dist/lib/node-esm/chunk-E2WXZND7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HXIBCBH4.mjs +171 -0
- package/dist/lib/node-esm/chunk-HXIBCBH4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-F7RXCX5Y.mjs → chunk-TNR46C3L.mjs} +36 -15
- package/dist/lib/node-esm/chunk-TNR46C3L.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-AEWYMW6I.mjs → chunk-U2NYUS2N.mjs} +69 -39
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UFKLCEAE.mjs +1795 -0
- package/dist/lib/node-esm/chunk-UFKLCEAE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-X6AANUHZ.mjs → chunk-XQGWSZ4T.mjs} +4 -4
- 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 +127 -54
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-DTDNCX3C.mjs → intent-resolver-6XLVTRDJ.mjs} +48 -15
- package/dist/lib/node-esm/intent-resolver-6XLVTRDJ.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-V6JNEZVO.mjs → react-surface-K7ZXQLAP.mjs} +20 -76
- package/dist/lib/node-esm/react-surface-K7ZXQLAP.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-AIP5FOJG.mjs → settings-CWP6MTWP.mjs} +5 -5
- package/dist/lib/node-esm/{settings-AIP5FOJG.mjs.map → settings-CWP6MTWP.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 +2 -2
- 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 +2 -3
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- 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 +5 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +8 -8
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +2 -3
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +7 -4
- 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 +2 -3
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +16 -10
- 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 +3 -4
- package/dist/types/src/components/ChatContainer.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 +11 -4
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -4
- 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/ChatThread/ChatThread.d.ts +12 -7
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +112 -56
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- 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 +0 -5
- 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 +1 -1
- 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 +1 -3
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +263 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/analysis.d.ts.map +1 -1
- package/dist/types/src/functions/list.d.ts.map +1 -1
- package/dist/types/src/functions/load.d.ts +1 -1
- package/dist/types/src/functions/load.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +4 -4
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +4 -10
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -5
- 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.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/usePresets.d.ts +2 -2
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/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 +1 -1
- 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/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.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/testing/test-services.d.ts +2 -2
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +27 -16
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +16 -5
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +23 -6
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +21 -18
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +90 -96
- package/src/AssistantPlugin.tsx +138 -116
- package/src/capabilities/ai-service.ts +6 -7
- package/src/capabilities/app-graph-builder.ts +39 -45
- package/src/capabilities/blueprint-definition.ts +51 -19
- package/src/capabilities/capabilities.ts +8 -12
- package/src/capabilities/edge-model-resolver.ts +17 -21
- package/src/capabilities/index.ts +5 -2
- package/src/capabilities/intent-resolver.ts +38 -15
- package/src/capabilities/local-model-resolver.ts +30 -0
- package/src/capabilities/react-surface.tsx +9 -63
- package/src/capabilities/state.ts +20 -0
- package/src/capabilities/toolkit.ts +93 -31
- package/src/components/AssistantSettings/AssistantSettings.tsx +82 -75
- package/src/components/BlueprintContainer.tsx +2 -2
- package/src/components/Chat/Chat.tsx +167 -172
- package/src/components/Chat/events.ts +7 -0
- package/src/components/ChatCompanion.tsx +136 -0
- package/src/components/ChatContainer.tsx +13 -31
- package/src/components/ChatDialog.tsx +11 -11
- 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 +200 -34
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +29 -36
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatThread/ChatThread.stories.tsx +74 -205
- package/src/components/ChatThread/ChatThread.tsx +69 -29
- package/src/components/ChatThread/Link.tsx +8 -21
- 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 +27 -29
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +8 -6
- package/src/components/SequenceEditor/SequenceEditor.tsx +2 -2
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +17 -13
- package/src/components/TemplateEditor/TemplateEditor.tsx +16 -50
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +6 -8
- package/src/components/TemplateEditor/TemplateForm.tsx +2 -1
- 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/{Timeline → Toolbar}/index.ts +1 -1
- package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +9 -12
- package/src/components/Toolbox/Toolbox.tsx +10 -16
- package/src/components/index.ts +3 -1
- package/src/functions/analysis.ts +6 -4
- package/src/functions/list.ts +9 -3
- package/src/functions/load.ts +8 -5
- package/src/hooks/index.ts +4 -5
- package/src/hooks/useBlueprintRegistry.ts +24 -9
- package/src/hooks/useChatProcessor.ts +19 -26
- package/src/hooks/useChatServices.ts +30 -53
- package/src/hooks/useContextBinder.ts +30 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/usePresets.ts +4 -5
- package/src/index.ts +2 -0
- package/src/meta.ts +4 -6
- package/src/processor/index.ts +6 -0
- package/src/{hooks → processor}/presets.ts +10 -3
- package/src/processor/processor.test.ts +81 -0
- package/src/processor/processor.ts +302 -0
- package/src/queue-logger.ts +5 -5
- package/src/testing/index.ts +1 -1
- package/src/testing/test-generator.ts +261 -0
- package/src/testing/test-sequence.ts +1 -26
- package/src/testing/test-services.ts +2 -8
- package/src/translations.ts +29 -17
- package/src/types/Assistant.ts +9 -4
- package/src/types/AssistantAction.ts +11 -3
- package/src/types/service.ts +15 -7
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/ChatContainer-OUVSX5V5.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-P4FLEOHG.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs.map +0 -7
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs +0 -22
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-AVHHQ3KV.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs.map +0 -7
- package/dist/lib/browser/chunk-BRLHDHOF.mjs +0 -244
- package/dist/lib/browser/chunk-BRLHDHOF.mjs.map +0 -7
- package/dist/lib/browser/chunk-HRLMD35M.mjs.map +0 -7
- package/dist/lib/browser/chunk-LKP65RPA.mjs +0 -20
- package/dist/lib/browser/chunk-LKP65RPA.mjs.map +0 -7
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs +0 -89
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs.map +0 -7
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs +0 -16
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-VEBVAHNM.mjs +0 -2231
- package/dist/lib/browser/chunk-VEBVAHNM.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs +0 -24
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MVOIEJXZ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-4HXS3YLT.mjs.map +0 -7
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs +0 -105
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-D5FABDNE.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-NKWVXHJP.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-LDD32477.mjs +0 -23
- package/dist/lib/node-esm/ai-service-LDD32477.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-RMOUJMMG.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3SOC5GOP.mjs +0 -2232
- package/dist/lib/node-esm/chunk-3SOC5GOP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F7RXCX5Y.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs +0 -90
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs +0 -22
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RD755HN3.mjs +0 -245
- package/dist/lib/node-esm/chunk-RD755HN3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs +0 -25
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-DTDNCX3C.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-V6JNEZVO.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs +0 -106
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs.map +0 -7
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -18
- 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/Timeline/Timeline.d.ts +0 -24
- package/dist/types/src/components/Timeline/Timeline.d.ts.map +0 -1
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts +0 -9
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +0 -1
- package/dist/types/src/components/Timeline/index.d.ts +0 -2
- package/dist/types/src/components/Timeline/index.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -72
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/errors.d.ts +0 -4
- package/dist/types/src/hooks/errors.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useResolveRef.d.ts +0 -4
- package/dist/types/src/hooks/useResolveRef.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/stories/Chat.stories.d.ts +0 -268
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +0 -5
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ChatContainer.d.ts +0 -5
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/GraphContainer.d.ts +0 -6
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/LoggingContainer.d.ts +0 -5
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/SurfaceContainer.d.ts +0 -8
- package/dist/types/src/stories/components/SurfaceContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/TasksContainer.d.ts +0 -5
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/index.d.ts +0 -8
- package/dist/types/src/stories/components/index.d.ts.map +0 -1
- package/dist/types/src/stories/components/types.d.ts +0 -7
- package/dist/types/src/stories/components/types.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/index.d.ts +0 -3
- package/dist/types/src/stories/hooks/index.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/useFlush.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts +0 -3
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts.map +0 -1
- package/dist/types/src/stories/testing/data.d.ts +0 -142
- package/dist/types/src/stories/testing/data.d.ts.map +0 -1
- package/dist/types/src/stories/testing/index.d.ts +0 -3
- package/dist/types/src/stories/testing/index.d.ts.map +0 -1
- package/dist/types/src/stories/testing/testing.d.ts +0 -26
- package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -6
- package/dist/types/src/testing/test-functions.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/src/components/ChatThread/ChatMessage.tsx +0 -282
- package/src/components/ChatThread/ToolBlock.tsx +0 -125
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/Timeline/Timeline.stories.tsx +0 -53
- package/src/components/Timeline/Timeline.tsx +0 -159
- package/src/hooks/chat-processor.ts +0 -260
- package/src/hooks/errors.ts +0 -8
- package/src/hooks/useResolveRef.ts +0 -33
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -74
- 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/stories/Chat.stories.tsx +0 -317
- package/src/stories/components/BlueprintContainer.tsx +0 -34
- package/src/stories/components/ChatContainer.tsx +0 -80
- package/src/stories/components/GraphContainer.tsx +0 -118
- package/src/stories/components/LoggingContainer.tsx +0 -22
- package/src/stories/components/SurfaceContainer.tsx +0 -62
- package/src/stories/components/TasksContainer.tsx +0 -51
- package/src/stories/components/index.ts +0 -12
- package/src/stories/components/types.ts +0 -11
- package/src/stories/hooks/index.ts +0 -6
- package/src/stories/hooks/useMatcherExtension.ts +0 -45
- package/src/stories/testing/data.ts +0 -130
- package/src/stories/testing/index.ts +0 -6
- package/src/stories/testing/testing.tsx +0 -162
- package/src/testing/test-functions.ts +0 -16
- package/src/tools/function.ts +0 -49
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -219
- package/src/tools/openapi.ts +0 -341
- package/src/typings.d.ts +0 -9
- /package/dist/types/src/{stories/hooks → hooks}/useFlush.d.ts +0 -0
- /package/src/{stories/hooks → hooks}/useFlush.ts +0 -0
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type DataType } from '@dxos/schema';
|
|
6
|
-
|
|
7
|
-
// TODO(burdon): Move to util?
|
|
8
|
-
type Reducer<R, I> = (acc: R, value: I) => R;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Reducer that collapses related message blocks into single messages.
|
|
12
|
-
* For example, combines tool request/response pairs into a single message.
|
|
13
|
-
*/
|
|
14
|
-
export const messageReducer: Reducer<{ messages: DataType.Message[]; current?: DataType.Message }, DataType.Message> = (
|
|
15
|
-
{ current, messages },
|
|
16
|
-
message,
|
|
17
|
-
) => {
|
|
18
|
-
let i = 0;
|
|
19
|
-
for (const block of message.blocks) {
|
|
20
|
-
switch (block._tag) {
|
|
21
|
-
case 'toolCall':
|
|
22
|
-
case 'toolResult': {
|
|
23
|
-
if (current) {
|
|
24
|
-
current.blocks.push(block);
|
|
25
|
-
} else {
|
|
26
|
-
current = {
|
|
27
|
-
...message,
|
|
28
|
-
id: [message.id, i].join('_'),
|
|
29
|
-
blocks: [block],
|
|
30
|
-
};
|
|
31
|
-
messages.push(current);
|
|
32
|
-
}
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
case 'text':
|
|
37
|
-
default: {
|
|
38
|
-
current = undefined;
|
|
39
|
-
messages.push({
|
|
40
|
-
...message,
|
|
41
|
-
id: [message.id, i].join('_'),
|
|
42
|
-
blocks: [block],
|
|
43
|
-
});
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
i++;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return { current, messages };
|
|
52
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
-
|
|
9
|
-
import { faker } from '@dxos/random';
|
|
10
|
-
import { withTheme } from '@dxos/storybook-utils';
|
|
11
|
-
|
|
12
|
-
import { Timeline } from './Timeline';
|
|
13
|
-
|
|
14
|
-
faker.seed(1);
|
|
15
|
-
|
|
16
|
-
const meta: Meta<typeof Timeline> = {
|
|
17
|
-
title: 'plugins/plugin-assistant/Timeline',
|
|
18
|
-
component: Timeline,
|
|
19
|
-
decorators: [withTheme],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
export const Default: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
branches: [{ name: 'main' }, { name: 'feature-a' }, { name: 'feature-b' }, { name: 'feature-c' }],
|
|
29
|
-
commits: [
|
|
30
|
-
{ id: 'c1', message: faker.lorem.paragraph(), branch: 'main' },
|
|
31
|
-
{ id: 'c2', message: faker.lorem.paragraph(), branch: 'main', parent: 'c1' },
|
|
32
|
-
{ id: 'c3', message: faker.lorem.paragraph(), branch: 'feature-a', parent: 'c2' },
|
|
33
|
-
{ id: 'c4', message: faker.lorem.paragraph(), branch: 'main', parent: 'c2' },
|
|
34
|
-
{ id: 'c5', message: faker.lorem.paragraph(), branch: 'feature-b', parent: 'c2' },
|
|
35
|
-
{ id: 'c6', message: faker.lorem.paragraph(), branch: 'feature-a', parent: 'c3' },
|
|
36
|
-
{ id: 'c7', message: faker.lorem.paragraph(), branch: 'feature-a', parent: 'c6' },
|
|
37
|
-
{ id: 'c8', message: faker.lorem.paragraph(), branch: 'feature-c', parent: 'c6' },
|
|
38
|
-
{ id: 'c9', message: faker.lorem.paragraph(), branch: 'main', parent: 'c4' },
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const Linear: Story = {
|
|
44
|
-
args: {
|
|
45
|
-
branches: [{ name: 'main' }],
|
|
46
|
-
commits: [
|
|
47
|
-
{ id: 'c1', message: faker.lorem.paragraph(), branch: 'main' },
|
|
48
|
-
{ id: 'c2', message: faker.lorem.paragraph(), branch: 'main', parent: 'c1' },
|
|
49
|
-
{ id: 'c3', message: faker.lorem.paragraph(), branch: 'main', parent: 'c2' },
|
|
50
|
-
{ id: 'c4', message: faker.lorem.paragraph(), branch: 'main', parent: 'c3' },
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
};
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { Fragment, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
9
|
-
import { trim } from '@dxos/util';
|
|
10
|
-
|
|
11
|
-
export type Commit = {
|
|
12
|
-
id: string;
|
|
13
|
-
parent?: string;
|
|
14
|
-
branch: string;
|
|
15
|
-
message: string;
|
|
16
|
-
timestamp?: Date;
|
|
17
|
-
tags?: string[];
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type Branch = {
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type Span = {
|
|
25
|
-
start: number;
|
|
26
|
-
end: number;
|
|
27
|
-
parent?: number;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type TimelineProps = ThemedClassName<{ branches: Branch[]; commits: Commit[] }>;
|
|
31
|
-
|
|
32
|
-
// TODO(burdon): Reuse in toolCall messages.
|
|
33
|
-
// TODO(burdon): Key up/down; selected.
|
|
34
|
-
export const Timeline = ({ classNames, branches, commits }: TimelineProps) => {
|
|
35
|
-
const spans = useMemo(() => {
|
|
36
|
-
const spans = new Map<string, Span>();
|
|
37
|
-
branches.forEach((branch) => {
|
|
38
|
-
spans.set(branch.name, { start: -1, end: -1 });
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
commits.forEach((commit, index) => {
|
|
42
|
-
const span = spans.get(commit.branch);
|
|
43
|
-
if (span) {
|
|
44
|
-
if (span.start === -1) {
|
|
45
|
-
const parentIndex = commit.parent ? commits.findIndex((c) => c.id === commit.parent) : 0;
|
|
46
|
-
span.start = parentIndex;
|
|
47
|
-
span.parent = commit.parent
|
|
48
|
-
? branches.findIndex((branch) => branch.name === commits[parentIndex].branch)
|
|
49
|
-
: undefined;
|
|
50
|
-
}
|
|
51
|
-
span.end = index;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
return spans;
|
|
56
|
-
}, [commits, branches]);
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<div className={mx('flex flex-col w-full overflow-hidden', classNames)}>
|
|
60
|
-
{commits.map((commit, index) => {
|
|
61
|
-
return (
|
|
62
|
-
<div
|
|
63
|
-
key={commit.id}
|
|
64
|
-
className='group flex items-center gap-2 overflow-hidden hover:bg-hoverSurface'
|
|
65
|
-
style={{ height: `${lineHeight}px` }}
|
|
66
|
-
>
|
|
67
|
-
<svg width={branches.length * columnWidth} height={lineHeight} className='shrink-0'>
|
|
68
|
-
{branches.map((branch, j) => {
|
|
69
|
-
const span = spans.get(branch.name);
|
|
70
|
-
const color = colors[j % colors.length];
|
|
71
|
-
if (!span) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<Fragment key={j}>
|
|
77
|
-
{/* Upper */}
|
|
78
|
-
{index !== 0 && span.start !== -1 && span.start < index && span.end >= index && (
|
|
79
|
-
<line
|
|
80
|
-
x1={j * columnWidth + columnWidth / 2}
|
|
81
|
-
y1={0}
|
|
82
|
-
x2={j * columnWidth + columnWidth / 2}
|
|
83
|
-
y2={lineHeight / 2}
|
|
84
|
-
className={mx('stroke-2', color.stroke)}
|
|
85
|
-
/>
|
|
86
|
-
)}
|
|
87
|
-
{/* Lower */}
|
|
88
|
-
{span.end !== -1 && (span.start < index || span.start === 0) && index < span.end && (
|
|
89
|
-
<line
|
|
90
|
-
x1={j * columnWidth + columnWidth / 2}
|
|
91
|
-
y1={lineHeight / 2}
|
|
92
|
-
x2={j * columnWidth + columnWidth / 2}
|
|
93
|
-
y2={lineHeight}
|
|
94
|
-
className={mx('stroke-2', color.stroke)}
|
|
95
|
-
/>
|
|
96
|
-
)}
|
|
97
|
-
{/* Arc to parent */}
|
|
98
|
-
{span.start === index && span.parent !== undefined && span.parent !== -1 && (
|
|
99
|
-
<path
|
|
100
|
-
d={trim`
|
|
101
|
-
M ${0.5 + span.parent * columnWidth + columnWidth / 2} ${lineHeight / 2}
|
|
102
|
-
L ${j * columnWidth + columnWidth / 4} ${lineHeight / 2}
|
|
103
|
-
A ${lineHeight / 4} ${lineHeight / 4} 0 0 1 ${j * columnWidth + columnWidth / 2} ${(lineHeight * 3) / 4}
|
|
104
|
-
L ${j * columnWidth + columnWidth / 2} ${lineHeight}
|
|
105
|
-
`}
|
|
106
|
-
className={mx('stroke-2', color.stroke)}
|
|
107
|
-
fill='none'
|
|
108
|
-
/>
|
|
109
|
-
)}
|
|
110
|
-
{branch.name === commit.branch && (
|
|
111
|
-
<circle
|
|
112
|
-
cx={j * columnWidth + columnWidth / 2}
|
|
113
|
-
cy={lineHeight / 2}
|
|
114
|
-
r={nodeRadius}
|
|
115
|
-
className={mx('stroke-2 fill-red-500', color.stroke, color.hover)}
|
|
116
|
-
/>
|
|
117
|
-
)}
|
|
118
|
-
</Fragment>
|
|
119
|
-
);
|
|
120
|
-
})}
|
|
121
|
-
{branches.map((branch, j) => {
|
|
122
|
-
const color = colors[j % colors.length];
|
|
123
|
-
return (
|
|
124
|
-
branch.name === commit.branch && (
|
|
125
|
-
<circle
|
|
126
|
-
key={j}
|
|
127
|
-
cx={j * columnWidth + columnWidth / 2}
|
|
128
|
-
cy={lineHeight / 2}
|
|
129
|
-
r={nodeRadius}
|
|
130
|
-
className={mx('stroke-2', color.stroke, color.hover)}
|
|
131
|
-
/>
|
|
132
|
-
)
|
|
133
|
-
);
|
|
134
|
-
})}
|
|
135
|
-
</svg>
|
|
136
|
-
<div className='text-sm truncate cursor-pointer text-subdued group-hover:text-baseText'>
|
|
137
|
-
{commit.message}
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
);
|
|
141
|
-
})}
|
|
142
|
-
</div>
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const lineHeight = 24;
|
|
147
|
-
const columnWidth = 24;
|
|
148
|
-
const nodeRadius = 6;
|
|
149
|
-
|
|
150
|
-
const colors = [
|
|
151
|
-
{ stroke: 'stroke-orange-500', hover: 'group-hover:fill-orange-500' },
|
|
152
|
-
{ stroke: 'stroke-sky-500', hover: 'group-hover:fill-sky-500' },
|
|
153
|
-
{ stroke: 'stroke-green-500', hover: 'group-hover:fill-green-500' },
|
|
154
|
-
{ stroke: 'stroke-fuchsia-500', hover: 'group-hover:fill-fuchsia-500' },
|
|
155
|
-
{ stroke: 'stroke-cyan-500', hover: 'group-hover:fill-cyan-500' },
|
|
156
|
-
{ stroke: 'stroke-emerald-500', hover: 'group-hover:fill-emerald-500' },
|
|
157
|
-
{ stroke: 'stroke-violet-500', hover: 'group-hover:fill-violet-500' },
|
|
158
|
-
{ stroke: 'stroke-teal-500', hover: 'group-hover:fill-teal-500' },
|
|
159
|
-
];
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Registry, Result, Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import { Effect, type Layer, Option, Stream, pipe } from 'effect';
|
|
7
|
-
|
|
8
|
-
import { AiService, DEFAULT_EDGE_MODEL, type ModelName, type ModelRegistry } from '@dxos/ai';
|
|
9
|
-
import { type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
10
|
-
import {
|
|
11
|
-
type AiConversation,
|
|
12
|
-
type AiConversationRunParams,
|
|
13
|
-
AiSession,
|
|
14
|
-
ArtifactDiffResolver,
|
|
15
|
-
createSystemPrompt,
|
|
16
|
-
} from '@dxos/assistant';
|
|
17
|
-
import { type Blueprint } from '@dxos/blueprints';
|
|
18
|
-
import { Context } from '@dxos/context';
|
|
19
|
-
import { Obj } from '@dxos/echo';
|
|
20
|
-
import { runAndForwardErrors } from '@dxos/effect';
|
|
21
|
-
import { log } from '@dxos/log';
|
|
22
|
-
import { Filter, type Space, getVersion } from '@dxos/react-client/echo';
|
|
23
|
-
import { type ContentBlock, DataType } from '@dxos/schema';
|
|
24
|
-
|
|
25
|
-
import { AiServiceOverloadedError } from './errors';
|
|
26
|
-
import { type AiChatServices } from './useChatServices';
|
|
27
|
-
|
|
28
|
-
// TODO(burdon): Is this still used?
|
|
29
|
-
declare global {
|
|
30
|
-
interface ToolContextExtensions {
|
|
31
|
-
space?: Space;
|
|
32
|
-
dispatch?: PromiseIntentDispatcher;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type AiRequestOptions = {
|
|
37
|
-
// Empty for now.
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export type AiChatProcessorOptions = {
|
|
41
|
-
model?: ModelName;
|
|
42
|
-
modelRegistry?: ModelRegistry;
|
|
43
|
-
blueprintRegistry?: Blueprint.Registry;
|
|
44
|
-
observableRegistry?: Registry.Registry;
|
|
45
|
-
extensions?: ToolContextExtensions;
|
|
46
|
-
} & Pick<AiConversationRunParams<any>, 'system'>;
|
|
47
|
-
|
|
48
|
-
const defaultOptions: Partial<AiChatProcessorOptions> = {
|
|
49
|
-
model: DEFAULT_EDGE_MODEL,
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Handles interactions with the AI service.
|
|
54
|
-
* Maintains a queue of messages and handles streaming responses from the AI service.
|
|
55
|
-
* Executes tools based on AI responses.
|
|
56
|
-
* Supports cancellation of in-progress requests.
|
|
57
|
-
*/
|
|
58
|
-
export class AiChatProcessor {
|
|
59
|
-
/**
|
|
60
|
-
* Last error.
|
|
61
|
-
*/
|
|
62
|
-
// TODO(wittjosiah): Error should come from the message stream.
|
|
63
|
-
readonly error = Rx.make<Option.Option<Error>>(Option.none());
|
|
64
|
-
|
|
65
|
-
/** Rx registry. */
|
|
66
|
-
private readonly _observableRegistry: Registry.Registry;
|
|
67
|
-
|
|
68
|
-
/** Current session. */
|
|
69
|
-
private readonly _session = Rx.make<Option.Option<AiSession>>(Option.none());
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Current streaming message (from the AI service).
|
|
73
|
-
*/
|
|
74
|
-
private readonly _streaming: Rx.Rx<Result.Result<Option.Option<DataType.Message>, Error>> = Rx.make((get) => {
|
|
75
|
-
return pipe(
|
|
76
|
-
get(this._session),
|
|
77
|
-
Option.map((session) => Stream.fromQueue(session.blockQueue)),
|
|
78
|
-
Option.getOrElse(() => Stream.make()),
|
|
79
|
-
Stream.scan<Option.Option<DataType.Message>, Option.Option<ContentBlock.Any>>(Option.none(), (acc, blockOption) =>
|
|
80
|
-
Option.flatMap(blockOption, (block) =>
|
|
81
|
-
acc.pipe(
|
|
82
|
-
Option.match({
|
|
83
|
-
onNone: () => [block],
|
|
84
|
-
onSome: (message) => [...message.blocks.filter((b) => !b.pending), block],
|
|
85
|
-
}),
|
|
86
|
-
Option.some,
|
|
87
|
-
Option.map((blocks) =>
|
|
88
|
-
Obj.make(DataType.Message, {
|
|
89
|
-
created: new Date().toISOString(),
|
|
90
|
-
sender: { role: 'assistant' },
|
|
91
|
-
blocks,
|
|
92
|
-
}),
|
|
93
|
-
),
|
|
94
|
-
),
|
|
95
|
-
),
|
|
96
|
-
),
|
|
97
|
-
);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Streaming state.
|
|
102
|
-
*/
|
|
103
|
-
readonly streaming: Rx.Rx<boolean> = Rx.make((get) => {
|
|
104
|
-
return pipe(
|
|
105
|
-
get(this._streaming),
|
|
106
|
-
Result.map((streaming) => Option.isSome(streaming)),
|
|
107
|
-
Result.getOrElse(() => false),
|
|
108
|
-
);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Pending messages (incl. the current user request).
|
|
113
|
-
*/
|
|
114
|
-
private readonly _pending: Rx.Rx<Result.Result<DataType.Message[], Error>> = Rx.make((get) => {
|
|
115
|
-
// TODO(wittjosiah): For some reason using Option.map here loses reactivity.
|
|
116
|
-
const session = get(this._session);
|
|
117
|
-
return Option.isSome(session)
|
|
118
|
-
? pipe(
|
|
119
|
-
session.value.messageQueue,
|
|
120
|
-
Stream.fromQueue,
|
|
121
|
-
Stream.scan<DataType.Message[], DataType.Message>([], (acc, message) => [...acc, message]),
|
|
122
|
-
)
|
|
123
|
-
: Stream.make();
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Array of Messages (incl. the current message being streamed).
|
|
128
|
-
*/
|
|
129
|
-
readonly messages: Rx.Rx<Result.Result<DataType.Message[], Error>> = Rx.make((get) => {
|
|
130
|
-
const streaming = get(this._streaming);
|
|
131
|
-
return Result.map(get(this._pending), (pending) =>
|
|
132
|
-
Result.match(streaming, {
|
|
133
|
-
onInitial: () => pending,
|
|
134
|
-
onSuccess: (streaming) =>
|
|
135
|
-
Option.match(streaming.value, {
|
|
136
|
-
onNone: () => pending,
|
|
137
|
-
onSome: (message) => [...pending, message],
|
|
138
|
-
}),
|
|
139
|
-
onFailure: () => pending,
|
|
140
|
-
}),
|
|
141
|
-
);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
constructor(
|
|
145
|
-
// TODO(dmaretskyi): Replace this with effect's ManagedRuntime wrapping this layer.
|
|
146
|
-
private readonly _services: Layer.Layer<AiChatServices>,
|
|
147
|
-
private readonly _conversation: AiConversation,
|
|
148
|
-
private readonly _options: AiChatProcessorOptions = defaultOptions,
|
|
149
|
-
) {
|
|
150
|
-
// Initialize registries and defaults before using in other logic.
|
|
151
|
-
this._observableRegistry = this._options.observableRegistry ?? Registry.make();
|
|
152
|
-
if (this._options.model && !this._options.system) {
|
|
153
|
-
const capabilities = this._options.modelRegistry?.getCapabilities(this._options.model) ?? {};
|
|
154
|
-
this._options.system = createSystemPrompt(capabilities);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
get context() {
|
|
159
|
-
return this._conversation.context;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
get conversation() {
|
|
163
|
-
return this._conversation;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
get blueprintRegistry() {
|
|
167
|
-
return this._options.blueprintRegistry;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Make GPT request.
|
|
172
|
-
*/
|
|
173
|
-
async request(message: string, _options: AiRequestOptions = {}): Promise<void> {
|
|
174
|
-
await using ctx = Context.default(); // Auto-disposed at the end of this block.
|
|
175
|
-
|
|
176
|
-
const session = new AiSession();
|
|
177
|
-
this._observableRegistry.set(this._session, Option.some(session));
|
|
178
|
-
|
|
179
|
-
ctx.onDispose(() => {
|
|
180
|
-
log.info('onDispose', { session, isDisposed: ctx.disposed });
|
|
181
|
-
Option.match(this._observableRegistry.get(this._session), {
|
|
182
|
-
onSome: (s) => {
|
|
183
|
-
if (s === session) {
|
|
184
|
-
this._observableRegistry.set(this._session, Option.none());
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
onNone: () => {},
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
try {
|
|
192
|
-
const messages = await runAndForwardErrors(
|
|
193
|
-
this._conversation
|
|
194
|
-
.run({
|
|
195
|
-
session,
|
|
196
|
-
prompt: message,
|
|
197
|
-
system: this._options.system,
|
|
198
|
-
})
|
|
199
|
-
.pipe(
|
|
200
|
-
Effect.provide(AiService.model(this._options.model ?? DEFAULT_EDGE_MODEL)),
|
|
201
|
-
// TODO(dmaretskyi): Move ArtifactDiffResolver upstream.
|
|
202
|
-
Effect.provideService(ArtifactDiffResolver, this._artifactDiffResolver),
|
|
203
|
-
Effect.provide(this._services),
|
|
204
|
-
Effect.tapErrorCause((cause) => {
|
|
205
|
-
log.error('error', { cause });
|
|
206
|
-
return Effect.void;
|
|
207
|
-
}),
|
|
208
|
-
),
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
log('completed', { messages });
|
|
212
|
-
} catch (err) {
|
|
213
|
-
log.catch(err);
|
|
214
|
-
if (err instanceof Error && err.message.includes('Overloaded')) {
|
|
215
|
-
this._observableRegistry.set(
|
|
216
|
-
this.error,
|
|
217
|
-
Option.some(new AiServiceOverloadedError('AI service overloaded', { cause: err })),
|
|
218
|
-
);
|
|
219
|
-
} else {
|
|
220
|
-
this._observableRegistry.set(this.error, Option.some(new Error('AI service error', { cause: err })));
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Cancel pending requests.
|
|
227
|
-
*/
|
|
228
|
-
async cancel(): Promise<void> {
|
|
229
|
-
log.info('cancelling...');
|
|
230
|
-
|
|
231
|
-
// TODO(dmaretskyi): Abort using Fiber.interrupt.
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
private _artifactDiffResolver: ArtifactDiffResolver.Service = {
|
|
235
|
-
resolve: async (artifacts) => {
|
|
236
|
-
const space = this._options.extensions?.space;
|
|
237
|
-
if (!space) {
|
|
238
|
-
return new Map();
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
const versions = new Map();
|
|
242
|
-
await Promise.all(
|
|
243
|
-
artifacts.map(async (artifact) => {
|
|
244
|
-
const {
|
|
245
|
-
objects: [object],
|
|
246
|
-
} = await space.db.query(Filter.ids(artifact.id)).run();
|
|
247
|
-
if (!object) {
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
versions.set(artifact.id, {
|
|
252
|
-
version: getVersion(object),
|
|
253
|
-
diff: `Current state: ${JSON.stringify(object)}`,
|
|
254
|
-
});
|
|
255
|
-
}),
|
|
256
|
-
);
|
|
257
|
-
return versions;
|
|
258
|
-
},
|
|
259
|
-
};
|
|
260
|
-
}
|
package/src/hooks/errors.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useMemo, useSyncExternalStore } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Space } from '@dxos/client/echo';
|
|
8
|
-
import { type Ref } from '@dxos/echo';
|
|
9
|
-
|
|
10
|
-
// TODO(burdon): Factor out.
|
|
11
|
-
export const useResolvedRef = <T>(space: Space, ref: Ref.Ref<T>): T | undefined => {
|
|
12
|
-
const { subscribe, getSnapshot } = useMemo(() => {
|
|
13
|
-
const resolver = space.db.graph.createRefResolver({});
|
|
14
|
-
let currentCallback: (() => void) | undefined = undefined;
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
subscribe: (cb: () => void) => {
|
|
18
|
-
currentCallback = cb;
|
|
19
|
-
return () => {
|
|
20
|
-
if (currentCallback === cb) {
|
|
21
|
-
currentCallback = undefined;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
getSnapshot: () =>
|
|
26
|
-
resolver?.resolveSync(ref.dxn, true, () => {
|
|
27
|
-
currentCallback?.();
|
|
28
|
-
}) as T | undefined,
|
|
29
|
-
};
|
|
30
|
-
}, [space, ref.dxn.toString()]);
|
|
31
|
-
|
|
32
|
-
return useSyncExternalStore<T | undefined>(subscribe, getSnapshot);
|
|
33
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, test } from 'vitest';
|
|
6
|
-
|
|
7
|
-
import { Filter } from '@dxos/echo';
|
|
8
|
-
|
|
9
|
-
import { createFilter } from './filter-generator';
|
|
10
|
-
import { QueryParser } from './query-parser';
|
|
11
|
-
|
|
12
|
-
describe('FilterGenerator', () => {
|
|
13
|
-
test('simple queries', ({ expect }) => {
|
|
14
|
-
const parser = new QueryParser('type:example.com/type/Person');
|
|
15
|
-
const ast = parser.parse();
|
|
16
|
-
expect(ast).toEqual({
|
|
17
|
-
type: 'binary',
|
|
18
|
-
operator: 'EQ',
|
|
19
|
-
left: {
|
|
20
|
-
type: 'identifier',
|
|
21
|
-
name: 'type',
|
|
22
|
-
},
|
|
23
|
-
right: {
|
|
24
|
-
type: 'literal',
|
|
25
|
-
value: 'example.com/type/Person',
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const filter = createFilter(ast);
|
|
30
|
-
expect(filter).toEqual(Filter.typename('example.com/type/Person'));
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Filter } from '@dxos/echo';
|
|
6
|
-
|
|
7
|
-
import { type Expression, type Identifier, type Literal, type RelationalOperator } from './types';
|
|
8
|
-
|
|
9
|
-
const relationalOperators: Record<RelationalOperator, (value: any) => Filter<any>> = {
|
|
10
|
-
EQ: Filter.eq,
|
|
11
|
-
LT: Filter.lt,
|
|
12
|
-
GT: Filter.gt,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const specialPredicates: Record<string, (value: string) => Filter<any>> = {
|
|
16
|
-
['type' as const]: Filter.typename,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const createFilter = (ast: Expression): Filter<any> => {
|
|
20
|
-
switch (ast.type) {
|
|
21
|
-
case 'binary': {
|
|
22
|
-
const { operator, left, right } = ast;
|
|
23
|
-
|
|
24
|
-
// Handle logical operators.
|
|
25
|
-
if (operator === 'AND') {
|
|
26
|
-
return Filter.and(createFilter(left), createFilter(right));
|
|
27
|
-
}
|
|
28
|
-
if (operator === 'OR') {
|
|
29
|
-
return Filter.or(createFilter(left), createFilter(right));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Handle special predicates (e.g., "type:Person")
|
|
33
|
-
const predicateName = (left as Identifier).name;
|
|
34
|
-
const specialFilter = specialPredicates[predicateName];
|
|
35
|
-
if (specialFilter) {
|
|
36
|
-
return specialFilter((right as Literal).value);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Handle relational operators
|
|
40
|
-
const filterFn = relationalOperators[operator];
|
|
41
|
-
if (filterFn) {
|
|
42
|
-
return filterFn((right as Literal).value);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
throw new Error(`Unsupported operator: ${operator}`);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
case 'unary': {
|
|
49
|
-
const { operator, argument } = ast;
|
|
50
|
-
if (operator === 'NOT') {
|
|
51
|
-
return Filter.not(createFilter(argument));
|
|
52
|
-
}
|
|
53
|
-
throw new Error(`Unsupported unary operator: ${operator}`);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
case 'identifier': {
|
|
57
|
-
const { name } = ast;
|
|
58
|
-
return Filter._props({ [name]: true });
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
case 'literal': {
|
|
62
|
-
const { value } = ast;
|
|
63
|
-
// Handle special '*' value for empty input.
|
|
64
|
-
if (value === '*') {
|
|
65
|
-
return Filter.everything();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return Filter.eq(value);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
default:
|
|
72
|
-
throw new Error(`Unsupported expression type: ${(ast as any).type}`);
|
|
73
|
-
}
|
|
74
|
-
};
|