@dxos/plugin-assistant 0.8.3 → 0.8.4-main.1f223c7
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-QQHVOTSI.mjs → BlueprintContainer-BFNN6K46.mjs} +11 -10
- package/dist/lib/browser/BlueprintContainer-BFNN6K46.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-DOVN34C7.mjs +126 -0
- package/dist/lib/browser/ChatCompanion-DOVN34C7.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-XIVJTCC2.mjs +75 -0
- package/dist/lib/browser/ChatContainer-XIVJTCC2.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-EJJMK3WL.mjs +88 -0
- package/dist/lib/browser/ChatDialog-EJJMK3WL.mjs.map +7 -0
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs +150 -0
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs.map +7 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs +22 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-3C43MLCD.mjs +153 -0
- package/dist/lib/browser/app-graph-builder-3C43MLCD.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-C4Q2RYQM.mjs +1974 -0
- package/dist/lib/browser/chunk-C4Q2RYQM.mjs.map +7 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs +19 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs.map +7 -0
- package/dist/lib/browser/chunk-GLWD66TA.mjs +161 -0
- package/dist/lib/browser/chunk-GLWD66TA.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-XOZ7YMO3.mjs → chunk-O4LUJEDV.mjs} +3 -3
- package/dist/lib/browser/{chunk-XOZ7YMO3.mjs.map → chunk-O4LUJEDV.mjs.map} +1 -1
- package/dist/lib/browser/chunk-PQI3MGDN.mjs +169 -0
- package/dist/lib/browser/chunk-PQI3MGDN.mjs.map +7 -0
- package/dist/lib/browser/chunk-QD4UUISH.mjs +299 -0
- package/dist/lib/browser/chunk-QD4UUISH.mjs.map +7 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs +216 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs.map +7 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs +202 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs +155 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs +22 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +195 -128
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs +112 -0
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs +21 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-E4NAGB6R.mjs +109 -0
- package/dist/lib/browser/react-surface-E4NAGB6R.mjs.map +7 -0
- package/dist/lib/browser/{settings-XRHXVWGB.mjs → settings-36V3VUMW.mjs} +7 -6
- package/dist/lib/browser/settings-36V3VUMW.mjs.map +7 -0
- package/dist/lib/browser/state-AINRYS5W.mjs +21 -0
- package/dist/lib/browser/state-AINRYS5W.mjs.map +7 -0
- package/dist/lib/browser/toolkit-MPUS3U64.mjs +191 -0
- package/dist/lib/browser/toolkit-MPUS3U64.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -20
- package/dist/lib/node-esm/{TemplateContainer-SOEWY2ZN.mjs → BlueprintContainer-X4MRBKDR.mjs} +11 -10
- package/dist/lib/node-esm/BlueprintContainer-X4MRBKDR.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-ICWYVPRD.mjs +127 -0
- package/dist/lib/node-esm/ChatCompanion-ICWYVPRD.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-LMMMQD4K.mjs +76 -0
- package/dist/lib/node-esm/ChatContainer-LMMMQD4K.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-UUE3F7BT.mjs +89 -0
- package/dist/lib/node-esm/ChatDialog-UUE3F7BT.mjs.map +7 -0
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs +151 -0
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs +23 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-NM3JDLQ2.mjs +154 -0
- package/dist/lib/node-esm/app-graph-builder-NM3JDLQ2.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs +170 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs +203 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.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-LVTG5JTW.mjs +217 -0
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs +163 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V44ZG7CU.mjs +1975 -0
- package/dist/lib/node-esm/chunk-V44ZG7CU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BB2TAT4P.mjs → chunk-VFY2JG62.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-BB2TAT4P.mjs.map → chunk-VFY2JG62.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs +20 -0
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YU62ZWJN.mjs +300 -0
- package/dist/lib/node-esm/chunk-YU62ZWJN.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs +156 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs +23 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +195 -128
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs +113 -0
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs +22 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-5WQLRTCH.mjs +110 -0
- package/dist/lib/node-esm/react-surface-5WQLRTCH.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-5IAY6BT4.mjs → settings-7ZCZ6AS5.mjs} +7 -6
- package/dist/lib/node-esm/settings-7ZCZ6AS5.mjs.map +7 -0
- package/dist/lib/node-esm/state-EQS5KP6M.mjs +22 -0
- package/dist/lib/node-esm/state-EQS5KP6M.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-PKVYDZ4H.mjs +192 -0
- package/dist/lib/node-esm/toolkit-PKVYDZ4H.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -20
- 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 +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +7 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +29 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +12 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +4 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +2 -2
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +5 -6
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +50 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/events.d.ts +35 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +3 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- 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 +7 -7
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts +8 -0
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -0
- 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 +11 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +10 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +10 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts +6 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +22 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +282 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -0
- 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/index.d.ts +2 -0
- package/dist/types/src/components/ChatThread/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts +40 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.d.ts +2 -2
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts +8 -0
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +13 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +267 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/index.d.ts +2 -0
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +4 -8
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +261 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +5 -4
- 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 +10 -8
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +262 -4
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +9 -12
- 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/execution-graph/execution-graph.d.ts +21 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +2 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/functions/analysis.d.ts +5 -0
- package/dist/types/src/functions/analysis.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/list.d.ts +10 -0
- package/dist/types/src/functions/list.d.ts.map +1 -0
- package/dist/types/src/functions/load.d.ts +8 -0
- package/dist/types/src/functions/load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +11 -5
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +24 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +12 -13
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +13 -0
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- 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/useExecutionGraph.d.ts +6 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
- package/dist/types/src/hooks/useItemTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts +7 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -0
- 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/processor/presets.d.ts +13 -0
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +73 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts +5 -5
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/stories/Chat.stories.d.ts +30 -0
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +4 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/DebugCard.d.ts +8 -0
- package/dist/types/src/stories/components/DebugCard.d.ts.map +1 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts +6 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts +7 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts +4 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts +6 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +4 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts +14 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +16 -0
- package/dist/types/src/stories/components/index.d.ts.map +1 -0
- package/dist/types/src/stories/components/types.d.ts +7 -0
- package/dist/types/src/stories/components/types.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +9 -0
- package/dist/types/src/stories/testing/data.d.ts.map +1 -0
- package/dist/types/src/stories/testing/index.d.ts +3 -0
- package/dist/types/src/stories/testing/index.d.ts.map +1 -0
- package/dist/types/src/stories/testing/schema.d.ts +7 -0
- package/dist/types/src/stories/testing/schema.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +48 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +14 -0
- package/dist/types/src/testing/test-data.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +5 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +7 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +4 -0
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +84 -113
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +42 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +107 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +9 -6
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +111 -81
- package/src/AssistantPlugin.tsx +87 -43
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +58 -144
- package/src/capabilities/blueprint-definition.ts +58 -0
- package/src/capabilities/capabilities.ts +61 -5
- package/src/capabilities/compute-runtime.ts +124 -0
- package/src/capabilities/edge-model-resolver.ts +27 -0
- package/src/capabilities/index.ts +8 -1
- package/src/capabilities/intent-resolver.ts +67 -18
- package/src/capabilities/local-model-resolver.ts +32 -0
- package/src/capabilities/react-surface.tsx +40 -86
- package/src/capabilities/settings.ts +3 -3
- package/src/capabilities/state.ts +20 -0
- package/src/capabilities/toolkit.ts +163 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +86 -79
- package/src/components/BlueprintContainer.tsx +9 -133
- package/src/components/Chat/Chat.tsx +389 -0
- package/src/components/Chat/events.ts +57 -0
- package/src/components/Chat/index.ts +7 -0
- package/src/components/ChatCompanion.tsx +111 -0
- package/src/components/ChatContainer.tsx +33 -21
- package/src/components/ChatDialog.tsx +68 -0
- package/src/components/ChatProgress/ChatProgress.tsx +68 -0
- package/src/components/{AmbientDialog → ChatProgress}/index.ts +1 -1
- package/src/components/ChatPrompt/ChatActions.tsx +57 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +233 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +29 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +48 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +42 -0
- package/src/components/ChatPrompt/index.ts +9 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +130 -0
- package/src/components/ChatThread/ChatThread.tsx +93 -0
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/index.ts +5 -0
- package/src/components/ChatThread/reducers.ts +151 -0
- package/src/components/ChatThread/registry.tsx +189 -0
- package/src/components/ChatThread/sync.test.ts +81 -0
- package/src/components/ChatThread/sync.ts +113 -0
- package/src/components/PromptSettings.tsx +44 -45
- package/src/components/SequenceContainer.tsx +131 -0
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +33 -0
- package/src/components/{BlueprintEditor/BlueprintEditor.tsx → SequenceEditor/SequenceEditor.tsx} +8 -8
- package/src/components/SequenceEditor/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +45 -37
- package/src/components/TemplateEditor/TemplateEditor.tsx +28 -46
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +26 -19
- package/src/components/TemplateEditor/TemplateForm.tsx +52 -57
- 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/{experimental/transcription → components/Toolbar}/index.ts +2 -0
- package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +12 -19
- package/src/components/Toolbox/Toolbox.tsx +53 -27
- package/src/components/index.ts +6 -8
- package/src/events.ts +3 -3
- package/src/execution-graph/execution-graph.ts +211 -0
- package/src/execution-graph/index.ts +5 -0
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +46 -0
- package/src/functions/load.ts +42 -0
- package/src/hooks/index.ts +11 -6
- package/src/hooks/useBlueprintRegistry.ts +80 -0
- package/src/hooks/useChatProcessor.ts +66 -0
- package/src/hooks/useChatServices.ts +48 -0
- package/src/hooks/useComputeRuntimeCallback.ts +25 -0
- package/src/hooks/useContextBinder.ts +18 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useExecutionGraph.ts +20 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/{useContextProvider.ts → useReferencesProvider.ts} +22 -20
- package/src/meta.ts +1 -1
- package/src/processor/index.ts +6 -0
- package/src/processor/presets.ts +60 -0
- package/src/processor/processor.test.ts +77 -0
- package/src/processor/processor.ts +302 -0
- package/src/queue-logger.ts +16 -16
- package/src/stories/Chat.stories.tsx +657 -0
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +74 -0
- package/src/stories/components/ChessContainer.tsx +17 -0
- package/src/stories/components/CommentsContainer.tsx +25 -0
- package/src/stories/components/DebugCard.tsx +61 -0
- package/src/stories/components/GraphContainer.tsx +119 -0
- package/src/stories/components/InvocationsContainer.tsx +17 -0
- package/src/stories/components/LoggingContainer.tsx +33 -0
- package/src/stories/components/MessageContainer.tsx +22 -0
- package/src/stories/components/PromptContainer.tsx +52 -0
- package/src/stories/components/ResearchInputStack.tsx +30 -0
- package/src/stories/components/ResearchOutputStack.tsx +29 -0
- package/src/stories/components/TasksContainer.tsx +49 -0
- package/src/stories/components/TokenManagerContainer.tsx +14 -0
- package/src/stories/components/TriggersContainer.tsx +75 -0
- package/src/stories/components/index.ts +20 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/{test-data.ts → testing/data.ts} +23 -9
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/schema.ts +17 -0
- package/src/stories/testing/testing.tsx +279 -0
- package/src/testing/index.ts +3 -1
- package/src/testing/test-data.ts +245 -0
- package/src/testing/test-functions.ts +9 -4
- package/src/testing/test-generator.ts +257 -0
- package/src/testing/test-sequence.ts +26 -0
- package/src/translations.ts +58 -28
- package/src/types/Assistant.ts +61 -0
- package/src/types/AssistantAction.ts +62 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -3
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs +0 -47
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs.map +0 -7
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs +0 -321
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs +0 -40
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-QQHVOTSI.mjs.map +0 -7
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs +0 -39
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-E4H5DCOJ.mjs +0 -225
- package/dist/lib/browser/app-graph-builder-E4H5DCOJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-AAOKC2JN.mjs +0 -208
- package/dist/lib/browser/chunk-AAOKC2JN.mjs.map +0 -7
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs +0 -157
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-JO4W3MF7.mjs +0 -2101
- package/dist/lib/browser/chunk-JO4W3MF7.mjs.map +0 -7
- package/dist/lib/browser/chunk-JQFUME3B.mjs +0 -87
- package/dist/lib/browser/chunk-JQFUME3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-MEGMOFJB.mjs +0 -16
- package/dist/lib/browser/chunk-MEGMOFJB.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs +0 -96
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs.map +0 -7
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs +0 -15
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs +0 -43
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LXCNUSZN.mjs +0 -159
- package/dist/lib/browser/react-surface-LXCNUSZN.mjs.map +0 -7
- package/dist/lib/browser/settings-XRHXVWGB.mjs.map +0 -7
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs +0 -73
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs.map +0 -7
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs +0 -344
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs +0 -68
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs.map +0 -7
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs +0 -58
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs.map +0 -7
- package/dist/lib/node/ai-client-7HNSMUMT.cjs +0 -53
- package/dist/lib/node/ai-client-7HNSMUMT.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs +0 -235
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs.map +0 -7
- package/dist/lib/node/chunk-4EEWTDQK.cjs +0 -117
- package/dist/lib/node/chunk-4EEWTDQK.cjs.map +0 -7
- package/dist/lib/node/chunk-FUAGEO7Q.cjs +0 -52
- package/dist/lib/node/chunk-FUAGEO7Q.cjs.map +0 -7
- package/dist/lib/node/chunk-HRNIUYVQ.cjs +0 -128
- package/dist/lib/node/chunk-HRNIUYVQ.cjs.map +0 -7
- package/dist/lib/node/chunk-IKZBMHSW.cjs +0 -184
- package/dist/lib/node/chunk-IKZBMHSW.cjs.map +0 -7
- package/dist/lib/node/chunk-LMDJEGZ2.cjs +0 -233
- package/dist/lib/node/chunk-LMDJEGZ2.cjs.map +0 -7
- package/dist/lib/node/chunk-NIDICM57.cjs +0 -2080
- package/dist/lib/node/chunk-NIDICM57.cjs.map +0 -7
- package/dist/lib/node/chunk-P74TWGMG.cjs +0 -44
- package/dist/lib/node/chunk-P74TWGMG.cjs.map +0 -7
- package/dist/lib/node/chunk-QGPWY6GW.cjs +0 -34
- package/dist/lib/node/chunk-QGPWY6GW.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -289
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs +0 -58
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs +0 -172
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs.map +0 -7
- package/dist/lib/node/settings-2JXLKYGE.cjs +0 -36
- package/dist/lib/node/settings-2JXLKYGE.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -54
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs +0 -48
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs +0 -322
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs +0 -41
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-SOEWY2ZN.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs +0 -40
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-3SY5MBIK.mjs +0 -226
- package/dist/lib/node-esm/app-graph-builder-3SY5MBIK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs +0 -18
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3UEZLJ2V.mjs +0 -16
- package/dist/lib/node-esm/chunk-3UEZLJ2V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs +0 -98
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs +0 -209
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OD574YIU.mjs +0 -2102
- package/dist/lib/node-esm/chunk-OD574YIU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OYN6HLXZ.mjs +0 -88
- package/dist/lib/node-esm/chunk-OYN6HLXZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs +0 -158
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs +0 -44
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7HA5EDWY.mjs +0 -160
- package/dist/lib/node-esm/react-surface-7HA5EDWY.mjs.map +0 -7
- package/dist/lib/node-esm/settings-5IAY6BT4.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-client.d.ts +0 -5
- package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +0 -10
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +0 -8
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/index.d.ts +0 -2
- package/dist/types/src/components/AmbientDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/AssistantDialog.d.ts +0 -7
- package/dist/types/src/components/AssistantDialog.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts +0 -13
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts +0 -8
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/index.d.ts +0 -2
- package/dist/types/src/components/BlueprintEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +0 -23
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +0 -13
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts +0 -16
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts +0 -9
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/autocomplete.d.ts +0 -25
- package/dist/types/src/components/Prompt/autocomplete.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/index.d.ts +0 -3
- package/dist/types/src/components/Prompt/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/references.d.ts +0 -30
- package/dist/types/src/components/Prompt/references.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/components/Thread/Thread.d.ts +0 -28
- package/dist/types/src/components/Thread/Thread.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.stories.d.ts +0 -11
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +0 -13
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +0 -13
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +0 -1
- package/dist/types/src/components/Thread/index.d.ts +0 -3
- package/dist/types/src/components/Thread/index.d.ts.map +0 -1
- package/dist/types/src/components/Thread/reducer.d.ts +0 -12
- package/dist/types/src/components/Thread/reducer.d.ts.map +0 -1
- package/dist/types/src/experimental/transcription/index.d.ts +0 -1
- package/dist/types/src/experimental/transcription/index.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.d.ts +0 -72
- package/dist/types/src/hooks/processor.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/useContextProvider.d.ts +0 -17
- package/dist/types/src/hooks/useContextProvider.d.ts.map +0 -1
- package/dist/types/src/hooks/useMessageQueue.d.ts +0 -42
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +0 -1
- package/dist/types/src/hooks/useServices.d.ts +0 -7
- package/dist/types/src/hooks/useServices.d.ts.map +0 -1
- package/dist/types/src/hooks/useTextInputEvents.d.ts +0 -13
- package/dist/types/src/hooks/useTextInputEvents.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/Prompt.stories.d.ts +0 -8
- package/dist/types/src/stories/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/stories/Query.stories.d.ts +0 -19
- package/dist/types/src/stories/Query.stories.d.ts.map +0 -1
- package/dist/types/src/stories/Research.stories.d.ts +0 -15
- package/dist/types/src/stories/Research.stories.d.ts.map +0 -1
- package/dist/types/src/stories/test-data.d.ts +0 -3
- package/dist/types/src/stories/test-data.d.ts.map +0 -1
- package/dist/types/src/stories/testing.d.ts +0 -12
- package/dist/types/src/stories/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-blueprint.d.ts +0 -8
- package/dist/types/src/testing/test-blueprint.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/chat.d.ts +0 -23
- package/dist/types/src/types/chat.d.ts.map +0 -1
- package/dist/types/src/types/template.d.ts +0 -56
- package/dist/types/src/types/template.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -50
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/ai-client.ts +0 -42
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +0 -84
- package/src/components/AmbientDialog/AmbientDialog.tsx +0 -117
- package/src/components/AssistantDialog.tsx +0 -37
- package/src/components/BlueprintEditor/BlueprintEditor.stories.tsx +0 -32
- package/src/components/BlueprintEditor/index.ts +0 -5
- package/src/components/Prompt/Prompt.stories.tsx +0 -121
- package/src/components/Prompt/Prompt.tsx +0 -124
- package/src/components/Prompt/PromptBar.stories.tsx +0 -69
- package/src/components/Prompt/PromptBar.tsx +0 -105
- package/src/components/Prompt/autocomplete.ts +0 -218
- package/src/components/Prompt/index.ts +0 -6
- package/src/components/Prompt/references.ts +0 -180
- package/src/components/TemplateContainer.tsx +0 -23
- package/src/components/Thread/Thread.stories.tsx +0 -201
- package/src/components/Thread/Thread.tsx +0 -118
- package/src/components/Thread/ThreadContainer.stories.tsx +0 -283
- package/src/components/Thread/ThreadContainer.tsx +0 -105
- package/src/components/Thread/ThreadMessage.tsx +0 -234
- package/src/components/Thread/ToolInvocations.tsx +0 -106
- package/src/components/Thread/index.ts +0 -6
- package/src/components/Thread/reducer.ts +0 -52
- package/src/hooks/processor.test.ts +0 -15
- package/src/hooks/processor.ts +0 -238
- package/src/hooks/useChatProcessor.tsx +0 -97
- package/src/hooks/useMessageQueue.ts +0 -22
- package/src/hooks/useServices.ts +0 -28
- package/src/hooks/useTextInputEvents.ts +0 -49
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/stories/Prompt.stories.tsx +0 -60
- package/src/stories/Query.stories.tsx +0 -514
- package/src/stories/Research.stories.tsx +0 -482
- package/src/stories/testing.ts +0 -60
- package/src/testing/test-blueprint.ts +0 -58
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/chat.ts +0 -32
- package/src/types/template.ts +0 -66
- package/src/types/types.ts +0 -48
- package/src/typings.d.ts +0 -9
- /package/dist/types/src/{hooks → processor}/processor.test.d.ts +0 -0
|
@@ -2,72 +2,71 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import React, { type ChangeEvent, useCallback } from 'react';
|
|
5
|
+
import React from 'react';
|
|
7
6
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { type Template } from '@dxos/blueprints';
|
|
8
|
+
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
10
9
|
|
|
11
|
-
import {
|
|
12
|
-
import { TemplateKinds, type TemplateType, type TemplateKindSchema } from '../types';
|
|
10
|
+
import { meta } from '../meta';
|
|
13
11
|
|
|
14
|
-
export const PromptSettings = ({ template }: { template:
|
|
15
|
-
const { t } = useTranslation(
|
|
12
|
+
export const PromptSettings = ({ template }: { template: Template.Template }) => {
|
|
13
|
+
const { t } = useTranslation(meta.id);
|
|
16
14
|
|
|
17
|
-
const handleKindChange = useCallback(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
// const handleKindChange = useCallback(
|
|
16
|
+
// (value: string) => {
|
|
17
|
+
// const kind = Match.type<string>().pipe(
|
|
18
|
+
// Match.withReturnType<Schema.Schema.Type<typeof Template.Template>>(),
|
|
19
|
+
// Match.when('always', () => ({ include: 'always' })),
|
|
20
|
+
// Match.when('schema-matching', () => ({ include: 'schema-matching', typename: '' })),
|
|
21
|
+
// Match.when('automatically', () => ({ include: 'automatically', description: '' })),
|
|
22
|
+
// Match.orElse(() => ({ include: 'manual' })),
|
|
23
|
+
// )(value);
|
|
24
|
+
//
|
|
25
|
+
// template.kind = kind;
|
|
26
|
+
// },
|
|
27
|
+
// [template],
|
|
28
|
+
// );
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
template.kind.typename = event.target.value;
|
|
36
|
-
}
|
|
37
|
-
}, 300),
|
|
38
|
-
[template.kind.include],
|
|
39
|
-
);
|
|
30
|
+
// const handleTypenameChange = useCallback(
|
|
31
|
+
// debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
32
|
+
// if (template.kind.include === 'schema-matching') {
|
|
33
|
+
// template.kind.typename = event.target.value;
|
|
34
|
+
// }
|
|
35
|
+
// }, 300),
|
|
36
|
+
// [template.kind.include],
|
|
37
|
+
// );
|
|
40
38
|
|
|
41
|
-
const handleDescriptionChange = useCallback(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
);
|
|
39
|
+
// const handleDescriptionChange = useCallback(
|
|
40
|
+
// debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
41
|
+
// if (template.kind.include === 'automatically') {
|
|
42
|
+
// template.kind.description = event.target.value;
|
|
43
|
+
// }
|
|
44
|
+
// }, 300),
|
|
45
|
+
// [template.kind.include],
|
|
46
|
+
// );
|
|
49
47
|
|
|
50
48
|
return (
|
|
51
49
|
<div className='flex flex-col gap-4'>
|
|
52
50
|
<h2>{t('prompt rules label')}</h2>
|
|
53
51
|
<Toolbar.Root>
|
|
54
|
-
<Select.Root value={template.kind.include} onValueChange={handleKindChange}>
|
|
52
|
+
{/* <Select.Root value={template.kind.include} onValueChange={handleKindChange}>
|
|
55
53
|
<Toolbar.Button asChild>
|
|
56
54
|
<Select.TriggerButton />
|
|
57
55
|
</Toolbar.Button>
|
|
58
56
|
<Select.Portal>
|
|
59
57
|
<Select.Content>
|
|
60
58
|
<Select.Viewport>
|
|
61
|
-
{
|
|
59
|
+
{Template.Kinds.map((kind) => (
|
|
62
60
|
<Select.Option key={kind} value={kind}>
|
|
63
61
|
{kind}
|
|
64
62
|
</Select.Option>
|
|
65
63
|
))}
|
|
66
64
|
</Select.Viewport>
|
|
65
|
+
<Select.Arrow />
|
|
67
66
|
</Select.Content>
|
|
68
67
|
</Select.Portal>
|
|
69
|
-
</Select.Root>
|
|
70
|
-
{template.kind.include === 'schema-matching' && (
|
|
68
|
+
</Select.Root> */}
|
|
69
|
+
{/* {template.kind.include === 'schema-matching' && (
|
|
71
70
|
<Input.Root>
|
|
72
71
|
<Input.TextInput
|
|
73
72
|
placeholder={t('typename placeholder')}
|
|
@@ -75,8 +74,8 @@ export const PromptSettings = ({ template }: { template: TemplateType }) => {
|
|
|
75
74
|
onChange={handleTypenameChange}
|
|
76
75
|
/>
|
|
77
76
|
</Input.Root>
|
|
78
|
-
)}
|
|
79
|
-
{template.kind.include === 'automatically' && (
|
|
77
|
+
)} */}
|
|
78
|
+
{/* {template.kind.include === 'automatically' && (
|
|
80
79
|
<Input.Root>
|
|
81
80
|
<Input.TextInput
|
|
82
81
|
placeholder={t('description placeholder')}
|
|
@@ -84,7 +83,7 @@ export const PromptSettings = ({ template }: { template: TemplateType }) => {
|
|
|
84
83
|
onChange={handleDescriptionChange}
|
|
85
84
|
/>
|
|
86
85
|
</Input.Root>
|
|
87
|
-
)}
|
|
86
|
+
)} */}
|
|
88
87
|
</Toolbar.Root>
|
|
89
88
|
</div>
|
|
90
89
|
);
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type EditorView } from '@codemirror/view';
|
|
6
|
+
import JSON5 from 'json5';
|
|
7
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import { type Sequence, type SequenceDefinition } from '@dxos/conductor';
|
|
10
|
+
import { Key } from '@dxos/echo';
|
|
11
|
+
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { useSelectionManager } from '@dxos/react-ui-attention';
|
|
13
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
14
|
+
|
|
15
|
+
import { meta } from '../meta';
|
|
16
|
+
|
|
17
|
+
import { SequenceEditor } from './SequenceEditor';
|
|
18
|
+
|
|
19
|
+
// TODO(burdon): Move to config.
|
|
20
|
+
export const EXA_API_KEY = '9c7e17ff-0c85-4cd5-827a-8b489f139e03';
|
|
21
|
+
|
|
22
|
+
// TODO(burdon): Validate.
|
|
23
|
+
const parseSequence = (text: string): SequenceDefinition | undefined => {
|
|
24
|
+
try {
|
|
25
|
+
const json = JSON5.parse(text);
|
|
26
|
+
const { steps } = json;
|
|
27
|
+
return { steps };
|
|
28
|
+
} catch (error) {
|
|
29
|
+
// Ignore.
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const SequenceContainer = ({ sequence }: { sequence: Sequence }) => {
|
|
34
|
+
const { t } = useTranslation(meta.id);
|
|
35
|
+
const selectionManager = useSelectionManager();
|
|
36
|
+
const [definition, setDefinition] = useState<SequenceDefinition>();
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
setDefinition({
|
|
39
|
+
steps: sequence.steps.map(({ instructions, tools }) => ({ instructions, tools })),
|
|
40
|
+
});
|
|
41
|
+
}, [sequence]);
|
|
42
|
+
|
|
43
|
+
const editorRef = useRef<EditorView | undefined>(undefined);
|
|
44
|
+
|
|
45
|
+
// TODO(burdon): Factor out.
|
|
46
|
+
// const toolRegistry = useMemo(() => {
|
|
47
|
+
// const space = getSpace(sequence);
|
|
48
|
+
// if (!space) {
|
|
49
|
+
// return;
|
|
50
|
+
// }
|
|
51
|
+
|
|
52
|
+
// // TODO(burdon): How should the queue be created?
|
|
53
|
+
// // eslint-disable-next-line no-unused-vars
|
|
54
|
+
// const _queue = space.queues.create();
|
|
55
|
+
|
|
56
|
+
// return new ToolRegistry([
|
|
57
|
+
// // createExaTool({ apiKey: EXA_API_KEY }),
|
|
58
|
+
// // createLocalSearchTool(space.db, queue),
|
|
59
|
+
// // createGraphWriterTool({
|
|
60
|
+
// // db: space.db,
|
|
61
|
+
// // queue,
|
|
62
|
+
// // schema: [], // TODO(burdon): Get schema from client/sequence?
|
|
63
|
+
// // onDone: async (objects) => {
|
|
64
|
+
// // await queue.append(objects);
|
|
65
|
+
// // },
|
|
66
|
+
// // }),
|
|
67
|
+
// ]);
|
|
68
|
+
// }, [sequence]);
|
|
69
|
+
|
|
70
|
+
const formatAndSave = useCallback((): SequenceDefinition | undefined => {
|
|
71
|
+
if (!sequence) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const text = editorRef.current?.state.doc.toString();
|
|
76
|
+
if (!text) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const definition = parseSequence(text);
|
|
81
|
+
if (!definition) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
setDefinition(definition);
|
|
86
|
+
const formatted = JSON.stringify(definition, null, 2);
|
|
87
|
+
editorRef.current?.dispatch({
|
|
88
|
+
changes: { from: 0, to: text.length, insert: formatted },
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
sequence.steps.length = 0;
|
|
92
|
+
for (const step of definition.steps) {
|
|
93
|
+
sequence.steps.push({
|
|
94
|
+
id: Key.ObjectId.random(),
|
|
95
|
+
instructions: step.instructions,
|
|
96
|
+
tools: step.tools,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return sequence;
|
|
101
|
+
}, [sequence]);
|
|
102
|
+
|
|
103
|
+
// TODO(burdon): Save raw sequence separately from parsed sequence? (like Script).
|
|
104
|
+
const handleSave = useCallback(() => formatAndSave(), [formatAndSave]);
|
|
105
|
+
|
|
106
|
+
const handleRun = useCallback(async () => {
|
|
107
|
+
// if (!aiClient?.value || !toolRegistry) {
|
|
108
|
+
// return;
|
|
109
|
+
// }
|
|
110
|
+
// formatAndSave();
|
|
111
|
+
// // Get input from selection.
|
|
112
|
+
// const input = Array.from(getSelectionSet(selectionManager)).map((id) => DXN.fromLocalObjectId(id));
|
|
113
|
+
// if (!input.length) {
|
|
114
|
+
// return;
|
|
115
|
+
// }
|
|
116
|
+
// const machine = new SequenceMachine(toolRegistry, sequence).setLogger(new QueueLogger(sequence));
|
|
117
|
+
// await machine.runToCompletion({ aiClient: aiClient.value, input });
|
|
118
|
+
}, [sequence, formatAndSave, selectionManager]);
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<StackItem.Content toolbar>
|
|
122
|
+
<Toolbar.Root>
|
|
123
|
+
<Toolbar.Button onClick={handleSave}>{t('button save')}</Toolbar.Button>
|
|
124
|
+
<Toolbar.Button onClick={handleRun}>{t('button run')}</Toolbar.Button>
|
|
125
|
+
</Toolbar.Root>
|
|
126
|
+
{definition && <SequenceEditor ref={editorRef} sequence={definition} />}
|
|
127
|
+
</StackItem.Content>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export default SequenceContainer;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
10
|
+
|
|
11
|
+
import { RESEARCH_SEQUENCE_DEFINITION } from '../../testing';
|
|
12
|
+
import { translations } from '../../translations';
|
|
13
|
+
|
|
14
|
+
import { SequenceEditor } from './SequenceEditor';
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
title: 'plugins/plugin-assistant/SequenceEditor',
|
|
18
|
+
component: SequenceEditor,
|
|
19
|
+
decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'mli-auto max-is-[50rem] justify-center' })],
|
|
20
|
+
parameters: {
|
|
21
|
+
translations,
|
|
22
|
+
},
|
|
23
|
+
} satisfies Meta<typeof SequenceEditor>;
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
type Story = StoryObj<typeof SequenceEditor>;
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
sequence: RESEARCH_SEQUENCE_DEFINITION,
|
|
32
|
+
},
|
|
33
|
+
};
|
package/src/components/{BlueprintEditor/BlueprintEditor.tsx → SequenceEditor/SequenceEditor.tsx}
RENAMED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { SequenceDefinition } from '@dxos/conductor';
|
|
8
8
|
import { Type } from '@dxos/echo';
|
|
9
|
-
import {
|
|
9
|
+
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
10
10
|
import {
|
|
11
11
|
type EditorView,
|
|
12
12
|
createBasicExtensions,
|
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
} from '@dxos/react-ui-editor';
|
|
17
17
|
import { mx } from '@dxos/react-ui-theme';
|
|
18
18
|
|
|
19
|
-
export type
|
|
20
|
-
|
|
19
|
+
export type SequenceEditorProps = ThemedClassName<{
|
|
20
|
+
sequence: SequenceDefinition;
|
|
21
21
|
}>;
|
|
22
22
|
|
|
23
23
|
// TODO(burdon): Factor out JsonEditor.
|
|
24
|
-
export const
|
|
25
|
-
({ classNames,
|
|
24
|
+
export const SequenceEditor = forwardRef<EditorView | undefined, SequenceEditorProps>(
|
|
25
|
+
({ classNames, sequence }, forwardedRef) => {
|
|
26
26
|
const { themeMode } = useThemeContext();
|
|
27
27
|
const { parentRef, view } = useTextEditor({
|
|
28
|
-
initialValue: JSON.stringify(
|
|
28
|
+
initialValue: JSON.stringify(sequence, null, 2),
|
|
29
29
|
extensions: [
|
|
30
30
|
createBasicExtensions({
|
|
31
31
|
lineNumbers: true,
|
|
@@ -38,7 +38,7 @@ export const BlueprintEditor = forwardRef<EditorView | undefined, BlueprintEdito
|
|
|
38
38
|
syntaxHighlighting: true,
|
|
39
39
|
}),
|
|
40
40
|
createJsonExtensions({
|
|
41
|
-
schema: Type.toJsonSchema(
|
|
41
|
+
schema: Type.toJsonSchema(SequenceDefinition, { strict: true }),
|
|
42
42
|
}),
|
|
43
43
|
],
|
|
44
44
|
});
|
|
@@ -4,80 +4,88 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { createSystemPrompt } from '@dxos/
|
|
11
|
-
import {
|
|
10
|
+
import { createSystemPrompt } from '@dxos/assistant';
|
|
11
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
12
12
|
import { useClient } from '@dxos/react-client';
|
|
13
13
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
14
14
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
15
|
+
import { trim } from '@dxos/util';
|
|
16
|
+
|
|
17
|
+
import { translations } from '../../translations';
|
|
15
18
|
|
|
16
19
|
import { TemplateEditor, type TemplateEditorProps } from './TemplateEditor';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
].join('\n');
|
|
36
|
-
|
|
37
|
-
const DefaultStory = ({ text }: TemplateEditorProps & { text: string }) => {
|
|
20
|
+
|
|
21
|
+
const TEMPLATE = trim`
|
|
22
|
+
{{! System Prompt }}
|
|
23
|
+
|
|
24
|
+
You are a machine that is an expert chess player.
|
|
25
|
+
The move history of the current game is: {{history}}.
|
|
26
|
+
If asked to suggest a move explain why it is a good move.
|
|
27
|
+
|
|
28
|
+
{{#each artifacts}}
|
|
29
|
+
- {{this}}
|
|
30
|
+
{{/each}}
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
{{input}}
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
|
|
38
38
|
const client = useClient();
|
|
39
|
-
const [
|
|
39
|
+
const [blueprint] = useState(() => {
|
|
40
40
|
const space = client.spaces.default;
|
|
41
|
-
return space.db.add(
|
|
41
|
+
return space.db.add(
|
|
42
|
+
Blueprint.make({
|
|
43
|
+
key: 'example.com/blueprint/test',
|
|
44
|
+
name: 'Test',
|
|
45
|
+
instructions: Template.make({ source }),
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
42
48
|
});
|
|
43
49
|
|
|
44
50
|
return (
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
<TemplateEditor
|
|
52
|
+
classNames='bg-baseSurface max-is-prose is-full'
|
|
53
|
+
id={blueprint.id}
|
|
54
|
+
template={blueprint.instructions}
|
|
55
|
+
/>
|
|
48
56
|
);
|
|
49
57
|
};
|
|
50
58
|
|
|
51
|
-
const meta
|
|
59
|
+
const meta = {
|
|
52
60
|
title: 'plugins/plugin-assistant/TemplateEditor',
|
|
53
|
-
component: TemplateEditor,
|
|
61
|
+
component: TemplateEditor as any,
|
|
54
62
|
render: DefaultStory,
|
|
55
63
|
decorators: [
|
|
56
64
|
withClientProvider({
|
|
65
|
+
types: [Blueprint.Blueprint],
|
|
57
66
|
createIdentity: true,
|
|
58
67
|
createSpace: true,
|
|
59
|
-
types: [TemplateType],
|
|
60
68
|
}),
|
|
61
|
-
withLayout({ fullscreen: true, classNames: '
|
|
69
|
+
withLayout({ fullscreen: true, classNames: 'justify-center bg-deckSurface' }),
|
|
62
70
|
withTheme,
|
|
63
71
|
],
|
|
64
72
|
parameters: {
|
|
65
73
|
translations,
|
|
66
74
|
},
|
|
67
|
-
}
|
|
75
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
68
76
|
|
|
69
77
|
export default meta;
|
|
70
78
|
|
|
71
|
-
type Story =
|
|
79
|
+
type Story = StoryObj<typeof meta>;
|
|
72
80
|
|
|
73
81
|
export const Default: Story = {
|
|
74
82
|
args: {
|
|
75
|
-
|
|
83
|
+
source: TEMPLATE,
|
|
76
84
|
},
|
|
77
85
|
};
|
|
78
86
|
|
|
79
87
|
export const System: Story = {
|
|
80
88
|
args: {
|
|
81
|
-
|
|
89
|
+
source: createSystemPrompt({}),
|
|
82
90
|
},
|
|
83
91
|
};
|
|
@@ -2,75 +2,57 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { HighlightStyle, LanguageSupport, syntaxHighlighting } from '@codemirror/language';
|
|
6
|
-
import { styleTags, tags } from '@lezer/highlight';
|
|
7
|
-
import { handlebarsLanguage } from '@xiechao/codemirror-lang-handlebars';
|
|
8
5
|
import React from 'react';
|
|
9
6
|
|
|
7
|
+
import { type Template } from '@dxos/blueprints';
|
|
10
8
|
import { createDocAccessor } from '@dxos/react-client/echo';
|
|
11
|
-
import { useThemeContext, useTranslation
|
|
9
|
+
import { type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
12
10
|
import {
|
|
13
11
|
createBasicExtensions,
|
|
14
12
|
createDataExtensions,
|
|
13
|
+
createMarkdownExtensions,
|
|
15
14
|
createThemeExtensions,
|
|
16
15
|
useTextEditor,
|
|
17
16
|
} from '@dxos/react-ui-editor';
|
|
18
17
|
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
+
import { isNotFalsy } from '@dxos/util';
|
|
19
19
|
|
|
20
|
-
import {
|
|
21
|
-
import { type TemplateType } from '../../types';
|
|
20
|
+
import { meta } from '../../meta';
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
props: [
|
|
25
|
-
styleTags({
|
|
26
|
-
'---': tags.lineComment,
|
|
27
|
-
}),
|
|
28
|
-
],
|
|
29
|
-
});
|
|
22
|
+
import { handlebars } from './handlebars-extension';
|
|
30
23
|
|
|
31
24
|
export type TemplateEditorProps = ThemedClassName<{
|
|
32
|
-
|
|
25
|
+
id: string;
|
|
26
|
+
template: Template.Template;
|
|
33
27
|
}>;
|
|
34
28
|
|
|
35
|
-
export const TemplateEditor = ({ classNames, template }: TemplateEditorProps) => {
|
|
36
|
-
const { t } = useTranslation(
|
|
29
|
+
export const TemplateEditor = ({ id, classNames, template }: TemplateEditorProps) => {
|
|
30
|
+
const { t } = useTranslation(meta.id);
|
|
37
31
|
const { themeMode } = useThemeContext();
|
|
38
|
-
const { parentRef } = useTextEditor(
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
const { parentRef } = useTextEditor(() => {
|
|
33
|
+
const text = template.source?.target;
|
|
34
|
+
if (!text) {
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
initialValue: text.content ?? '',
|
|
41
40
|
extensions: [
|
|
42
|
-
createDataExtensions({
|
|
43
|
-
id: template.id,
|
|
44
|
-
text: template.source !== undefined ? createDocAccessor(template, ['template']) : undefined,
|
|
45
|
-
}),
|
|
41
|
+
createDataExtensions({ id, text: createDocAccessor(text, ['content']) }),
|
|
46
42
|
createBasicExtensions({
|
|
47
43
|
bracketMatching: false,
|
|
44
|
+
lineNumbers: true,
|
|
48
45
|
lineWrapping: true,
|
|
49
46
|
placeholder: t('template placeholder'),
|
|
50
47
|
}),
|
|
51
|
-
createThemeExtensions({
|
|
52
|
-
themeMode,
|
|
53
|
-
slots: {
|
|
54
|
-
content: { className: '!p-3' },
|
|
55
|
-
},
|
|
56
|
-
}),
|
|
48
|
+
createThemeExtensions({ themeMode }),
|
|
57
49
|
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
50
|
+
// Extend markdown with handlebars support.
|
|
51
|
+
createMarkdownExtensions(),
|
|
52
|
+
handlebars(),
|
|
53
|
+
].filter(isNotFalsy),
|
|
54
|
+
};
|
|
55
|
+
}, [themeMode, template.source?.target]);
|
|
64
56
|
|
|
65
|
-
return <div ref={parentRef} className={mx(classNames)} />;
|
|
57
|
+
return <div ref={parentRef} className={mx('bs-full overflow-hidden', classNames)} />;
|
|
66
58
|
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* https://github.com/xiechao/lang-handlebars/blob/direct/src/highlight.js
|
|
70
|
-
*/
|
|
71
|
-
export const handlebarsHighlightStyle = HighlightStyle.define([
|
|
72
|
-
{ tag: tags.tagName, class: 'text-redText' }, // Braces.
|
|
73
|
-
{ tag: tags.variableName, class: 'text-blueText' },
|
|
74
|
-
{ tag: tags.keyword, class: 'text-greenText' },
|
|
75
|
-
{ tag: tags.comment, class: 'text-subdued' },
|
|
76
|
-
]);
|
|
@@ -4,51 +4,58 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
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
|
+
import { trim } from '@dxos/util';
|
|
15
|
+
|
|
16
|
+
import { translations } from '../../translations';
|
|
14
17
|
|
|
15
18
|
import { TemplateForm } from './TemplateForm';
|
|
16
|
-
import translations from '../../translations';
|
|
17
|
-
import { TemplateType } from '../../types';
|
|
18
19
|
|
|
19
|
-
const TEMPLATE =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const TEMPLATE = trim`
|
|
21
|
+
You are a machine that is an expert chess player.
|
|
22
|
+
The move history of the current game is: {{history}}
|
|
23
|
+
If asked to suggest a move explain why it is a good move.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
{{input}},
|
|
28
|
+
`;
|
|
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
|
};
|
|
42
49
|
|
|
43
|
-
const meta
|
|
50
|
+
const meta = {
|
|
44
51
|
title: 'plugins/plugin-assistant/TemplateForm',
|
|
45
52
|
component: TemplateForm,
|
|
46
53
|
render: DefaultStory,
|
|
47
54
|
decorators: [
|
|
48
55
|
withClientProvider({
|
|
56
|
+
types: [Blueprint.Blueprint],
|
|
49
57
|
createIdentity: true,
|
|
50
58
|
createSpace: true,
|
|
51
|
-
types: [TemplateType],
|
|
52
59
|
}),
|
|
53
60
|
withLayout({ fullscreen: true, classNames: 'flex justify-center' }),
|
|
54
61
|
withTheme,
|
|
@@ -56,7 +63,7 @@ const meta: Meta<typeof TemplateForm> = {
|
|
|
56
63
|
parameters: {
|
|
57
64
|
translations,
|
|
58
65
|
},
|
|
59
|
-
}
|
|
66
|
+
} satisfies Meta<typeof TemplateForm>;
|
|
60
67
|
|
|
61
68
|
export default meta;
|
|
62
69
|
|