@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.fd6878d
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-H7H4BQ2C.mjs} +11 -9
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs → ChatContainer-OUVSX5V5.mjs} +35 -13
- package/dist/lib/browser/ChatContainer-OUVSX5V5.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs → ChatDialog-P4FLEOHG.mjs} +21 -7
- package/dist/lib/browser/ChatDialog-P4FLEOHG.mjs.map +7 -0
- package/dist/lib/browser/{SequenceContainer-3UDVKWPA.mjs → SequenceContainer-627OQ557.mjs} +3 -2
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs.map +7 -0
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs +22 -0
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-JTXBKE7O.mjs → app-graph-builder-AVHHQ3KV.mjs} +17 -74
- package/dist/lib/browser/app-graph-builder-AVHHQ3KV.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs +146 -0
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs.map +7 -0
- package/dist/lib/browser/chunk-BRLHDHOF.mjs +244 -0
- package/dist/lib/browser/chunk-BRLHDHOF.mjs.map +7 -0
- package/dist/lib/browser/chunk-HRLMD35M.mjs +191 -0
- package/dist/lib/browser/chunk-HRLMD35M.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-LKP65RPA.mjs +20 -0
- package/dist/lib/browser/{chunk-FDCJSQYF.mjs.map → chunk-LKP65RPA.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-AEAEKWOC.mjs → chunk-NZDCKQ6W.mjs} +12 -21
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs.map +7 -0
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs +16 -0
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OWY4CUQY.mjs → chunk-VEBVAHNM.mjs} +799 -813
- package/dist/lib/browser/chunk-VEBVAHNM.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs +24 -0
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +96 -51
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-5RMMCMXG.mjs → intent-resolver-MVOIEJXZ.mjs} +33 -12
- package/dist/lib/browser/intent-resolver-MVOIEJXZ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-66VY37YQ.mjs → react-surface-4HXS3YLT.mjs} +45 -32
- package/dist/lib/browser/react-surface-4HXS3YLT.mjs.map +7 -0
- package/dist/lib/browser/{settings-2DGP3UTS.mjs → settings-G2EZXMWT.mjs} +6 -5
- package/dist/lib/{node-esm/settings-47RYZOU4.mjs.map → browser/settings-G2EZXMWT.mjs.map} +1 -1
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs +105 -0
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -4
- package/dist/lib/node-esm/{TemplateContainer-A3NAQCZE.mjs → BlueprintContainer-VH4EE4CM.mjs} +11 -9
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs → ChatContainer-D5FABDNE.mjs} +35 -13
- package/dist/lib/node-esm/ChatContainer-D5FABDNE.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs → ChatDialog-NKWVXHJP.mjs} +21 -7
- package/dist/lib/node-esm/ChatDialog-NKWVXHJP.mjs.map +7 -0
- package/dist/lib/node-esm/{SequenceContainer-RQQH5XOC.mjs → SequenceContainer-EQ5NP2PG.mjs} +3 -2
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-LDD32477.mjs +23 -0
- package/dist/lib/node-esm/ai-service-LDD32477.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-OWSOXFTD.mjs → app-graph-builder-RMOUJMMG.mjs} +17 -74
- package/dist/lib/node-esm/app-graph-builder-RMOUJMMG.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs +147 -0
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SENTQAEO.mjs → chunk-3SOC5GOP.mjs} +799 -813
- package/dist/lib/node-esm/chunk-3SOC5GOP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-F7RXCX5Y.mjs +192 -0
- package/dist/lib/node-esm/chunk-F7RXCX5Y.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2XL6MNPE.mjs → chunk-GAWXJ7K5.mjs} +12 -21
- package/dist/lib/node-esm/chunk-GAWXJ7K5.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-KOC6ESG7.mjs +22 -0
- package/dist/lib/node-esm/{chunk-QN2H2EHV.mjs.map → chunk-KOC6ESG7.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-RD755HN3.mjs +245 -0
- package/dist/lib/node-esm/chunk-RD755HN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs +17 -0
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs +25 -0
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +96 -51
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-YPPYELY3.mjs → intent-resolver-DTDNCX3C.mjs} +33 -12
- package/dist/lib/node-esm/intent-resolver-DTDNCX3C.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-RJMRBR2M.mjs → react-surface-V6JNEZVO.mjs} +45 -32
- package/dist/lib/node-esm/react-surface-V6JNEZVO.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-47RYZOU4.mjs → settings-AIP5FOJG.mjs} +6 -5
- package/dist/lib/{browser/settings-2DGP3UTS.mjs.map → node-esm/settings-AIP5FOJG.mjs.map} +1 -1
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs +106 -0
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -4
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +3 -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 +5 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +5 -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 +6 -8
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +5 -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/ChatPrompt/ChatOptions.d.ts +13 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.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/ChatMessage.d.ts +4 -3
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +2 -2
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +33 -48
- 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/ToolBlock.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.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/Timeline/Timeline.d.ts +24 -0
- package/dist/types/src/components/Timeline/Timeline.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts +9 -0
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/index.d.ts +2 -0
- package/dist/types/src/components/Timeline/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -7
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -2
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -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/chat-processor.d.ts +28 -42
- package/dist/types/src/hooks/chat-processor.d.ts.map +1 -1
- package/dist/types/src/hooks/errors.d.ts +4 -0
- package/dist/types/src/hooks/errors.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/presets.d.ts +2 -2
- package/dist/types/src/hooks/presets.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +21 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +7 -14
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +3 -4
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- 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/hooks/useResolveRef.d.ts +4 -0
- package/dist/types/src/hooks/useResolveRef.d.ts.map +1 -0
- package/dist/types/src/parser/filter-generator.d.ts.map +1 -1
- package/dist/types/src/parser/query-parser.d.ts.map +1 -1
- package/dist/types/src/stories/Chat.stories.d.ts +68 -49
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +5 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +5 -0
- package/dist/types/src/stories/components/ChatContainer.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/LoggingContainer.d.ts +5 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/SurfaceContainer.d.ts +8 -0
- package/dist/types/src/stories/components/SurfaceContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +5 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +8 -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/hooks/index.d.ts +3 -0
- package/dist/types/src/stories/hooks/index.d.ts.map +1 -0
- package/dist/types/src/stories/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/stories/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts +3 -0
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +142 -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/testing.d.ts +26 -0
- package/dist/types/src/stories/testing/testing.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-sequence.d.ts.map +1 -1
- package/dist/types/src/tools/function.d.ts.map +1 -1
- package/dist/types/src/tools/openapi.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +6 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +40 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +90 -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 +6 -6
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +81 -75
- package/src/AssistantPlugin.tsx +59 -12
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +9 -93
- package/src/capabilities/blueprint-definition.ts +32 -0
- package/src/capabilities/capabilities.ts +22 -0
- package/src/capabilities/edge-model-resolver.ts +29 -0
- package/src/capabilities/index.ts +6 -0
- package/src/capabilities/intent-resolver.ts +24 -9
- package/src/capabilities/react-surface.tsx +29 -22
- package/src/capabilities/toolkit.ts +106 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +1 -1
- package/src/components/BlueprintContainer.tsx +24 -0
- package/src/components/Chat/Chat.tsx +77 -64
- package/src/components/ChatContainer.tsx +37 -13
- package/src/components/ChatDialog.tsx +9 -5
- package/src/components/ChatPrompt/ChatOptions.tsx +59 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +11 -9
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatMessage.tsx +132 -118
- package/src/components/ChatThread/ChatThread.stories.tsx +220 -103
- package/src/components/ChatThread/ChatThread.tsx +2 -2
- package/src/components/ChatThread/Link.tsx +39 -0
- package/src/components/ChatThread/ToolBlock.tsx +20 -16
- package/src/components/SequenceContainer.tsx +2 -1
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +3 -2
- package/src/components/SequenceEditor/SequenceEditor.tsx +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +12 -5
- package/src/components/TemplateEditor/TemplateEditor.tsx +15 -12
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +12 -5
- package/src/components/TemplateEditor/TemplateForm.tsx +5 -3
- package/src/components/Timeline/Timeline.stories.tsx +53 -0
- package/src/components/Timeline/Timeline.tsx +159 -0
- package/src/components/Timeline/index.ts +5 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +6 -12
- package/src/components/Toolbox/Toolbox.tsx +16 -40
- package/src/components/index.ts +2 -5
- package/src/events.ts +2 -2
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +42 -0
- package/src/functions/load.ts +43 -0
- package/src/hooks/chat-processor.ts +123 -177
- package/src/hooks/errors.ts +8 -0
- package/src/hooks/index.ts +5 -1
- package/src/hooks/presets.ts +6 -5
- package/src/hooks/useBlueprintRegistry.ts +79 -0
- package/src/hooks/useChatProcessor.ts +21 -83
- package/src/hooks/useChatServices.ts +35 -54
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +45 -0
- package/src/hooks/useReferencesProvider.ts +11 -9
- package/src/hooks/useResolveRef.ts +33 -0
- package/src/parser/filter-generator.ts +6 -13
- package/src/parser/query-parser.ts +1 -1
- package/src/queue-logger.ts +5 -5
- package/src/stories/Chat.stories.tsx +238 -299
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +80 -0
- package/src/stories/components/GraphContainer.tsx +118 -0
- package/src/stories/components/LoggingContainer.tsx +22 -0
- package/src/stories/components/SurfaceContainer.tsx +62 -0
- package/src/stories/components/TasksContainer.tsx +51 -0
- package/src/stories/components/index.ts +12 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/hooks/index.ts +6 -0
- package/src/stories/hooks/useFlush.ts +35 -0
- package/src/stories/hooks/useMatcherExtension.ts +45 -0
- package/src/stories/testing/data.ts +130 -0
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/testing.tsx +162 -0
- package/src/testing/test-functions.ts +8 -3
- package/src/testing/test-sequence.ts +1 -1
- package/src/tools/function.ts +4 -1
- package/src/tools/openapi.test.ts +7 -5
- package/src/tools/openapi.ts +4 -1
- package/src/translations.ts +8 -10
- package/src/types/Assistant.ts +59 -0
- package/src/types/AssistantAction.ts +54 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -1
- 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.map +0 -7
- 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-JQBVLTM5.mjs +0 -158
- package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
- package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
- 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.map +0 -7
- 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-SENTQAEO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
- 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/TemplateContainer.d.ts +0 -8
- package/dist/types/src/components/TemplateContainer.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/useBlueprints.d.ts +0 -9
- package/dist/types/src/hooks/useBlueprints.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/TemplateContainer.tsx +0 -24
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/types/schema.ts +0 -95
|
@@ -7,15 +7,16 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { Template } from '@dxos/blueprints';
|
|
10
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
13
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
14
|
import { trim } from '@dxos/util';
|
|
15
15
|
|
|
16
|
-
import { TemplateForm } from './TemplateForm';
|
|
17
16
|
import { translations } from '../../translations';
|
|
18
17
|
|
|
18
|
+
import { TemplateForm } from './TemplateForm';
|
|
19
|
+
|
|
19
20
|
const TEMPLATE = trim`
|
|
20
21
|
You are a machine that is an expert chess player.
|
|
21
22
|
The move history of the current game is: {{history}}
|
|
@@ -28,14 +29,20 @@ const TEMPLATE = trim`
|
|
|
28
29
|
|
|
29
30
|
const DefaultStory = () => {
|
|
30
31
|
const client = useClient();
|
|
31
|
-
const [
|
|
32
|
+
const [blueprint] = useState(() => {
|
|
32
33
|
const space = client.spaces.default;
|
|
33
|
-
return space.db.add(
|
|
34
|
+
return space.db.add(
|
|
35
|
+
Blueprint.make({
|
|
36
|
+
key: 'example.com/blueprint/test',
|
|
37
|
+
name: 'Test',
|
|
38
|
+
instructions: Template.make({ source: TEMPLATE }),
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
34
41
|
});
|
|
35
42
|
|
|
36
43
|
return (
|
|
37
44
|
<div role='none' className='flex w-[40rem] border border-separator overflow-hidden'>
|
|
38
|
-
<TemplateForm template={
|
|
45
|
+
<TemplateForm id={blueprint.id} template={blueprint.instructions} />
|
|
39
46
|
</div>
|
|
40
47
|
);
|
|
41
48
|
};
|
|
@@ -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'>
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
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
|
+
];
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import { IntentPlugin,
|
|
10
|
+
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
12
|
import { capabilities } from '@dxos/assistant-testing';
|
|
13
13
|
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
@@ -17,18 +17,12 @@ import { SpacePlugin } from '@dxos/plugin-space';
|
|
|
17
17
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
18
18
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
19
19
|
|
|
20
|
-
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
21
20
|
import { translations } from '../../translations';
|
|
22
21
|
|
|
22
|
+
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
23
|
+
|
|
23
24
|
const DefaultStory = (props: ToolboxProps) => {
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<Toolbox
|
|
27
|
-
{...props}
|
|
28
|
-
artifacts={artifactDefinitions}
|
|
29
|
-
classNames='w-[30rem] h-[15rem] rounded-sm border border-separator py-1'
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
25
|
+
return <Toolbox {...props} classNames='w-[30rem] h-[15rem] rounded-sm border border-separator py-1' />;
|
|
32
26
|
};
|
|
33
27
|
|
|
34
28
|
const meta: Meta<typeof Toolbox> = {
|
|
@@ -39,7 +33,7 @@ const meta: Meta<typeof Toolbox> = {
|
|
|
39
33
|
withPluginManager({
|
|
40
34
|
plugins: [
|
|
41
35
|
ClientPlugin({
|
|
42
|
-
onClientInitialized: async (
|
|
36
|
+
onClientInitialized: async ({ client }) => {
|
|
43
37
|
await client.halo.createIdentity();
|
|
44
38
|
},
|
|
45
39
|
}),
|
|
@@ -65,4 +59,4 @@ export default meta;
|
|
|
65
59
|
|
|
66
60
|
type Story = Meta<typeof Toolbox>;
|
|
67
61
|
|
|
68
|
-
export const Default
|
|
62
|
+
export const Default = {} satisfies Story;
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { type FC, Fragment, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
9
|
-
import { type ArtifactDefinition } from '@dxos/blueprints';
|
|
7
|
+
import { type Tool } from '@dxos/ai';
|
|
10
8
|
import { type Blueprint } from '@dxos/blueprints';
|
|
11
9
|
import { type Ref } from '@dxos/echo';
|
|
12
10
|
import { FunctionType } from '@dxos/functions';
|
|
@@ -16,29 +14,20 @@ import { type ThemedClassName } from '@dxos/react-ui';
|
|
|
16
14
|
import { useTranslation } from '@dxos/react-ui';
|
|
17
15
|
import { mx } from '@dxos/react-ui-theme';
|
|
18
16
|
|
|
19
|
-
import { type
|
|
17
|
+
import { type AiChatProcessor } from '../../hooks';
|
|
20
18
|
import { meta } from '../../meta';
|
|
21
19
|
import { createToolsFromService } from '../../tools';
|
|
22
20
|
import { ServiceType } from '../../types';
|
|
23
21
|
|
|
24
22
|
export type ToolboxProps = ThemedClassName<{
|
|
25
|
-
blueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
26
|
-
artifacts?: ArtifactDefinition[];
|
|
27
23
|
services?: { service: ServiceType; tools: Tool[] }[];
|
|
28
24
|
functions?: FunctionType[];
|
|
25
|
+
// TODO(burdon): Combine into single array.
|
|
26
|
+
blueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
29
27
|
activeBlueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
30
|
-
striped?: boolean;
|
|
31
28
|
}>;
|
|
32
29
|
|
|
33
|
-
export const Toolbox = ({
|
|
34
|
-
classNames,
|
|
35
|
-
artifacts,
|
|
36
|
-
functions,
|
|
37
|
-
services,
|
|
38
|
-
blueprints,
|
|
39
|
-
activeBlueprints,
|
|
40
|
-
striped,
|
|
41
|
-
}: ToolboxProps) => {
|
|
30
|
+
export const Toolbox = ({ classNames, functions, services, blueprints, activeBlueprints }: ToolboxProps) => {
|
|
42
31
|
const { t } = useTranslation(meta.id);
|
|
43
32
|
|
|
44
33
|
return (
|
|
@@ -49,7 +38,7 @@ export const Toolbox = ({
|
|
|
49
38
|
items={blueprints.map(({ target }) => ({
|
|
50
39
|
name: target?.name ?? '',
|
|
51
40
|
description: target?.description ?? '',
|
|
52
|
-
subitems: target?.tools.map((toolId) => ({ name: `∙ ${
|
|
41
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
53
42
|
}))}
|
|
54
43
|
/>
|
|
55
44
|
)}
|
|
@@ -60,18 +49,7 @@ export const Toolbox = ({
|
|
|
60
49
|
items={activeBlueprints.map(({ target }) => ({
|
|
61
50
|
name: target?.name ?? '',
|
|
62
51
|
description: target?.description ?? '',
|
|
63
|
-
subitems: target?.tools.map((toolId) => ({ name: `∙ ${
|
|
64
|
-
}))}
|
|
65
|
-
/>
|
|
66
|
-
)}
|
|
67
|
-
|
|
68
|
-
{artifacts && artifacts.length > 0 && (
|
|
69
|
-
<Section
|
|
70
|
-
title='Artifacts'
|
|
71
|
-
items={artifacts.map(({ name, description, tools }) => ({
|
|
72
|
-
name,
|
|
73
|
-
description,
|
|
74
|
-
subitems: tools.map(({ name, description }) => ({ name: `∙ ${parseToolName(name)}`, description })),
|
|
52
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
75
53
|
}))}
|
|
76
54
|
/>
|
|
77
55
|
)}
|
|
@@ -91,11 +69,9 @@ export const Toolbox = ({
|
|
|
91
69
|
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
92
70
|
)}
|
|
93
71
|
|
|
94
|
-
{!blueprints?.length &&
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
!services?.length &&
|
|
98
|
-
!functions?.length && <div>{t('no tools')}</div>}
|
|
72
|
+
{!blueprints?.length && !activeBlueprints?.length && !services?.length && !functions?.length && (
|
|
73
|
+
<div>{t('no tools')}</div>
|
|
74
|
+
)}
|
|
99
75
|
</div>
|
|
100
76
|
);
|
|
101
77
|
};
|
|
@@ -136,13 +112,10 @@ const Section: FC<{
|
|
|
136
112
|
|
|
137
113
|
export type ToolboxContainerProps = ThemedClassName<{
|
|
138
114
|
space?: Space;
|
|
139
|
-
processor?:
|
|
115
|
+
processor?: AiChatProcessor;
|
|
140
116
|
}>;
|
|
141
117
|
|
|
142
118
|
export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContainerProps) => {
|
|
143
|
-
// Plugin artifacts.
|
|
144
|
-
const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
|
|
145
|
-
|
|
146
119
|
// Registered services.
|
|
147
120
|
const services = useQuery(space, Filter.type(ServiceType));
|
|
148
121
|
const [serviceTools, setServiceTools] = useState<{ service: ServiceType; tools: Tool[] }[]>([]);
|
|
@@ -164,9 +137,12 @@ export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContai
|
|
|
164
137
|
<Toolbox
|
|
165
138
|
classNames={classNames}
|
|
166
139
|
blueprints={processor?.context.blueprints.value}
|
|
167
|
-
artifacts={artifactDefinitions}
|
|
168
140
|
services={serviceTools}
|
|
169
141
|
functions={functions}
|
|
170
142
|
/>
|
|
171
143
|
);
|
|
172
144
|
};
|
|
145
|
+
|
|
146
|
+
const safeToolId = (name: string) => {
|
|
147
|
+
return name.split('_').pop();
|
|
148
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -8,13 +8,10 @@ export * from './AssistantSettings';
|
|
|
8
8
|
export * from './Chat';
|
|
9
9
|
export * from './PromptSettings';
|
|
10
10
|
export * from './TemplateEditor';
|
|
11
|
+
export * from './Timeline';
|
|
11
12
|
export * from './Toolbox';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
// Repro: open assistant dialog then close.
|
|
15
|
-
// https://github.com/microsoft/fluentui/issues/34020
|
|
16
|
-
|
|
14
|
+
export const BlueprintContainer = lazy(() => import('./BlueprintContainer'));
|
|
17
15
|
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
|
18
16
|
export const ChatDialog = lazy(() => import('./ChatDialog'));
|
|
19
17
|
export const SequenceContainer = lazy(() => import('./SequenceContainer'));
|
|
20
|
-
export const TemplateContainer = lazy(() => import('./TemplateContainer'));
|
package/src/events.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { defineEvent } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import { meta } from './meta';
|
|
8
8
|
|
|
9
9
|
export namespace AssistantEvents {
|
|
10
|
-
export const
|
|
10
|
+
export const SetupAiServiceProviders = defineEvent(`${meta.id}/event/setup-ai-service-providers`);
|
|
11
11
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Effect, Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { defineFunction } from '@dxos/functions';
|
|
8
|
+
import { log } from '@dxos/log';
|
|
9
|
+
|
|
10
|
+
export default defineFunction({
|
|
11
|
+
name: 'dxos.org/function/assistant-analysis',
|
|
12
|
+
description: 'Enter analysis analysis mode.',
|
|
13
|
+
inputSchema: Schema.Struct({
|
|
14
|
+
enable: Schema.Boolean.annotations({ description: 'Enable or disable analysis mode.' }),
|
|
15
|
+
}),
|
|
16
|
+
outputSchema: Schema.Void,
|
|
17
|
+
handler: Effect.fn(function* ({ data: { enable } }) {
|
|
18
|
+
log.info('analysis mode', { enable });
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Effect, Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
8
|
+
import { DatabaseService, defineFunction } from '@dxos/functions';
|
|
9
|
+
import { trim } from '@dxos/util';
|
|
10
|
+
|
|
11
|
+
// TODO(burdon): Factor out to space plugin.
|
|
12
|
+
export default defineFunction({
|
|
13
|
+
name: 'dxos.org/function/assistant/list',
|
|
14
|
+
description:
|
|
15
|
+
// TODO(wittjosiah): Find a better way to prompt for looking up typenames before querying with them.
|
|
16
|
+
trim`
|
|
17
|
+
Lists the objects of the given type.
|
|
18
|
+
Check the list-schemas tool for available types before calling this function.
|
|
19
|
+
`,
|
|
20
|
+
inputSchema: Schema.Struct({
|
|
21
|
+
typename: Schema.String.annotations({
|
|
22
|
+
description: 'The typename of the objects to list.',
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
outputSchema: Schema.Struct({
|
|
26
|
+
results: Schema.Array(
|
|
27
|
+
Schema.Struct({
|
|
28
|
+
dxn: Schema.String.annotations({ description: 'The DXN of the object.' }),
|
|
29
|
+
label: Schema.optional(Schema.String.annotations({ description: 'The label of the object.' })),
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
}),
|
|
33
|
+
handler: Effect.fn(function* ({ data: { typename } }) {
|
|
34
|
+
const { objects } = yield* DatabaseService.runQuery(Query.select(Filter.typename(typename)));
|
|
35
|
+
const results = objects.map((object) => ({
|
|
36
|
+
dxn: Obj.getDXN(object).toString(),
|
|
37
|
+
label: Obj.getLabel(object),
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
return { results };
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Effect, Option, Schema, pipe } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { ArtifactId } from '@dxos/assistant';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { DatabaseService, defineFunction } from '@dxos/functions';
|
|
10
|
+
import { log } from '@dxos/log';
|
|
11
|
+
|
|
12
|
+
// TODO(burdon): Common error handling.
|
|
13
|
+
// TODO(burdon): Factor out to space plugin.
|
|
14
|
+
export default defineFunction({
|
|
15
|
+
name: 'dxos.org/function/assistant/load',
|
|
16
|
+
description: 'Loads the object.',
|
|
17
|
+
inputSchema: Schema.Struct({
|
|
18
|
+
id: ArtifactId.annotations({
|
|
19
|
+
description: 'The ID of the object.',
|
|
20
|
+
}),
|
|
21
|
+
typename: Schema.String.annotations({
|
|
22
|
+
description: 'The typename of the object.',
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
outputSchema: Schema.Struct({
|
|
26
|
+
// TODO(wittjosiah): Type.Obj.Any | Type.Relation.Any
|
|
27
|
+
object: Schema.Any,
|
|
28
|
+
}),
|
|
29
|
+
handler: Effect.fn(function* ({ data: { id, typename } }) {
|
|
30
|
+
const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id));
|
|
31
|
+
return yield* pipe(
|
|
32
|
+
Option.fromNullable(object),
|
|
33
|
+
Option.flatMap((object) => (Obj.getTypename(object) === typename ? Option.some(object) : Option.none())),
|
|
34
|
+
Option.match({
|
|
35
|
+
onNone: () => Effect.fail('Object not found.'),
|
|
36
|
+
onSome: (object) => {
|
|
37
|
+
log.info('object', { object });
|
|
38
|
+
return Effect.succeed({ object });
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
}),
|
|
43
|
+
});
|