@dxos/plugin-assistant 0.8.4-main.f5c0578 → 0.8.4-main.fcc0d83b33
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/AssistantSettings-GG52BLKS.mjs +40 -0
- package/dist/lib/browser/AssistantSettings-GG52BLKS.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +31 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-RIJNPAYC.mjs +176 -0
- package/dist/lib/browser/chunk-RIJNPAYC.mjs.map +7 -0
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs +195 -0
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +73 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/create-chat-FZJASOQS.mjs +74 -0
- package/dist/lib/browser/create-chat-FZJASOQS.mjs.map +7 -0
- package/dist/lib/browser/ensure-companion-chat-PHUWWFVY.mjs +65 -0
- package/dist/lib/browser/ensure-companion-chat-PHUWWFVY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3347 -272
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/on-create-space-OQNCM7NC.mjs +22 -0
- package/dist/lib/browser/on-create-space-OQNCM7NC.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/resolve-navigation-targets-PMNR7D3P.mjs +22 -0
- package/dist/lib/browser/resolve-navigation-targets-PMNR7D3P.mjs.map +7 -0
- package/dist/lib/browser/run-prompt-in-new-chat-4XDYFKCV.mjs +107 -0
- package/dist/lib/browser/run-prompt-in-new-chat-4XDYFKCV.mjs.map +7 -0
- package/dist/lib/browser/set-current-chat-7V4DA66I.mjs +54 -0
- package/dist/lib/browser/set-current-chat-7V4DA66I.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +171 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +5 -6
- package/dist/lib/browser/update-chat-name-ZGMU2UGN.mjs +56 -0
- package/dist/lib/browser/update-chat-name-ZGMU2UGN.mjs.map +7 -0
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs +41 -0
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +32 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NCIZY5ZV.mjs +177 -0
- package/dist/lib/node-esm/chunk-NCIZY5ZV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs +196 -0
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +74 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/create-chat-RY6A4WUV.mjs +75 -0
- package/dist/lib/node-esm/create-chat-RY6A4WUV.mjs.map +7 -0
- package/dist/lib/node-esm/ensure-companion-chat-BTDU5TS2.mjs +66 -0
- package/dist/lib/node-esm/ensure-companion-chat-BTDU5TS2.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3347 -272
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/on-create-space-4LWCYT3H.mjs +23 -0
- package/dist/lib/node-esm/on-create-space-4LWCYT3H.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/resolve-navigation-targets-GHS3XPVP.mjs +23 -0
- package/dist/lib/node-esm/resolve-navigation-targets-GHS3XPVP.mjs.map +7 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-UF54E34O.mjs +108 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-UF54E34O.mjs.map +7 -0
- package/dist/lib/node-esm/set-current-chat-SWPAOLZL.mjs +55 -0
- package/dist/lib/node-esm/set-current-chat-SWPAOLZL.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +172 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +5 -6
- package/dist/lib/node-esm/update-chat-name-CW6K5M37.mjs +57 -0
- package/dist/lib/node-esm/update-chat-name-CW6K5M37.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts +2 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service.d.ts +4 -3
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +4 -2
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts +9 -0
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +6 -4
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +29 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +16 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/migrations.d.ts +5 -0
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +4 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +21 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +4 -3
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +10 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -4
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +15 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/index.d.ts +1 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +40 -31
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/context.d.ts +29 -0
- package/dist/types/src/components/Chat/context.d.ts.map +1 -0
- package/dist/types/src/components/Chat/events.d.ts +10 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +2 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +16 -5
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +19 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +28 -0
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -4
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +2 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts +14 -0
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +16 -11
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +25 -215
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +42 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +29 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +69 -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/ChatThread/tool-widget-state.d.ts +18 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +8 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts +25 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts +18 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts +14 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts +12 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +25 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts +11 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts +15 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/defaults.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/defaults.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts +10 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +11 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +7 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
- package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +7 -10
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +13 -7
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +13 -3
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +10 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +12 -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/Toolbox/Toolbox.d.ts +15 -16
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +15 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +6 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +21 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/AgentArticle/index.d.ts +2 -0
- package/dist/types/src/containers/AgentArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +6 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts +16 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/index.d.ts +2 -0
- package/dist/types/src/containers/AgentProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts +2 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +18 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts +2 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +12 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts +2 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +6 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts +6 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts +21 -0
- package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineList/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts +8 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +13 -0
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +19 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts +97 -0
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts +4 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/index.d.ts +3 -0
- package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +14 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +12 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +5 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +2 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +12 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +7 -5
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +9 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatKeymap.d.ts +12 -0
- package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -11
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -10
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +5 -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/useDebug.d.ts +10 -0
- package/dist/types/src/hooks/useDebug.d.ts.map +1 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- package/dist/types/src/{stories/hooks → hooks}/useFlush.d.ts +1 -1
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +3 -3
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +5 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +5 -0
- package/dist/types/src/operations/create-chat.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +140 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- package/dist/types/src/operations/prompt.test.d.ts +2 -0
- package/dist/types/src/operations/prompt.test.d.ts.map +1 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +15 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
- package/dist/types/src/operations/set-current-chat.d.ts +5 -0
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
- package/dist/types/src/operations/update-chat-name.d.ts +5 -0
- package/dist/types/src/operations/update-chat-name.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/{hooks → processor}/presets.d.ts +2 -2
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +80 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +8 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-generator.test.d.ts +2 -0
- package/dist/types/src/testing/test-generator.test.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +2 -2
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/testing/test-trace.d.ts +5 -0
- package/dist/types/src/testing/test-trace.d.ts.map +1 -0
- package/dist/types/src/testing/trace-timeline.test.d.ts +2 -0
- package/dist/types/src/testing/trace-timeline.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -76
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +33 -39
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +26 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +32 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +14 -213
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +151 -109
- package/src/AssistantPlugin.tsx +220 -129
- package/src/blueprints/assistant/blueprint.test.ts +46 -0
- package/src/blueprints/assistant/blueprint.ts +31 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/{components/Timeline → blueprints}/index.ts +1 -1
- package/src/capabilities/ai-service.ts +22 -20
- package/src/capabilities/app-graph-builder.ts +141 -148
- package/src/capabilities/blueprint-definition.ts +47 -25
- package/src/capabilities/companion-chat-provisioner.ts +164 -0
- package/src/capabilities/edge-model-resolver.ts +17 -13
- package/src/capabilities/index.ts +21 -11
- package/src/capabilities/local-model-resolver.ts +48 -0
- package/src/capabilities/markdown.ts +40 -0
- package/src/capabilities/migrations.ts +28 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +150 -128
- package/src/capabilities/settings.ts +24 -12
- package/src/capabilities/state.ts +35 -0
- package/src/capabilities/toolkit.ts +7 -100
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +83 -0
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +35 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +29 -91
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +169 -300
- package/src/components/Chat/context.ts +39 -0
- package/src/components/Chat/events.ts +14 -1
- package/src/components/ChatPrompt/ChatActions.tsx +35 -31
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +136 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +410 -36
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatPrompt.tsx +179 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +40 -38
- package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +2 -0
- package/src/components/ChatThread/Anchor.stories.tsx +95 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +88 -220
- package/src/components/ChatThread/ChatThread.tsx +92 -36
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/Link.tsx +11 -8
- package/src/components/ChatThread/MarkdownStream.stories.tsx +281 -0
- package/src/components/ChatThread/registry.tsx +286 -0
- package/src/components/ChatThread/sync.test.ts +259 -0
- package/src/components/ChatThread/sync.ts +150 -0
- package/src/components/ChatThread/testing/reasoning.md +25 -0
- package/src/components/ChatThread/testing/thinking.md +21 -0
- package/src/components/ChatThread/testing/thread-1.md +30 -0
- package/src/components/ChatThread/testing/thread-2.md +56 -0
- package/src/components/ChatThread/testing/thread-widgets.md +79 -0
- package/src/components/ChatThread/tool-widget-state.test.ts +34 -0
- package/src/components/ChatThread/tool-widget-state.ts +48 -0
- package/src/components/ChatThread/widgets/FallbackWidget.tsx +26 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +68 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +133 -0
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +33 -0
- package/src/components/ChatThread/widgets/SelectWidget.ts +39 -0
- package/src/components/ChatThread/widgets/StatsWidget.ts +31 -0
- package/src/components/ChatThread/widgets/StatusWidget.ts +133 -0
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +29 -0
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +55 -0
- package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
- package/src/components/ChatThread/widgets/defaults.ts +8 -0
- package/src/components/ChatThread/widgets/index.ts +13 -0
- package/src/components/ProcessTree/ProcessTree.stories.tsx +83 -0
- package/src/components/ProcessTree/ProcessTree.tsx +118 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +29 -19
- package/src/components/TemplateEditor/TemplateEditor.tsx +57 -71
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +25 -17
- package/src/components/TemplateEditor/TemplateForm.tsx +86 -39
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
- package/src/components/TemplateEditor/extensions/index.ts +6 -0
- package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
- package/src/components/ToolBlock/ToolBlock.tsx +144 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +18 -23
- package/src/components/Toolbox/Toolbox.tsx +81 -82
- package/src/components/index.ts +3 -8
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
- package/src/containers/AgentArticle/AgentArticle.tsx +200 -0
- package/src/containers/AgentArticle/index.ts +5 -0
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +101 -0
- package/src/containers/AgentProperties/AgentProperties.tsx +127 -0
- package/src/containers/AgentProperties/index.ts +5 -0
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +5 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +142 -0
- package/src/containers/ChatCompanion/index.ts +5 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +105 -0
- package/src/containers/ChatContainer/index.ts +5 -0
- package/src/containers/ChatDialog/ChatDialog.tsx +66 -0
- package/src/containers/ChatDialog/index.ts +5 -0
- package/src/containers/RoutineArticle/RoutineArticle.tsx +59 -0
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/RoutineList/RoutineList.stories.tsx +130 -0
- package/src/containers/RoutineList/RoutineList.tsx +50 -0
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +278 -0
- package/src/containers/TracePanel/TracePanel.tsx +138 -0
- package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/containers/TracePanel/dxn-extractor.ts +178 -0
- package/src/containers/TracePanel/execution-graph.test.ts +382 -0
- package/src/containers/TracePanel/execution-graph.ts +579 -0
- package/src/containers/TracePanel/index.ts +9 -0
- package/src/containers/TracePanel/testing/index.ts +6 -0
- package/src/containers/TracePanel/testing/simulated-agent.ts +114 -0
- package/src/containers/TracePanel/testing/snapshot-playback.ts +45 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +129 -0
- package/src/containers/TriggerStatus/index.ts +5 -0
- package/src/containers/index.ts +16 -0
- package/src/extensions/index.ts +5 -0
- package/src/extensions/prompt-extension.ts +111 -0
- package/src/hooks/index.ts +7 -6
- package/src/hooks/useBlueprintRegistry.ts +53 -23
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +48 -39
- package/src/hooks/useChatServices.ts +12 -60
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +43 -0
- package/src/hooks/useContextObjects.ts +50 -0
- package/src/hooks/useDebug.ts +38 -0
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/usePresets.ts +5 -5
- package/src/hooks/useReferencesProvider.ts +5 -8
- package/src/index.ts +1 -3
- package/src/meta.ts +15 -9
- package/src/operations/create-chat.ts +80 -0
- package/src/operations/definitions.ts +127 -0
- package/src/operations/ensure-companion-chat.ts +61 -0
- package/src/operations/index.ts +17 -0
- package/src/operations/on-create-space.ts +24 -0
- package/src/operations/prompt.test.ts +78 -0
- package/src/operations/resolve-navigation-targets.ts +26 -0
- package/src/operations/run-prompt-in-new-chat.ts +113 -0
- package/src/operations/set-current-chat.ts +50 -0
- package/src/operations/update-chat-name.ts +61 -0
- package/src/processor/index.ts +6 -0
- package/src/{hooks → processor}/presets.ts +21 -6
- package/src/processor/processor.test.ts +40 -0
- package/src/processor/processor.ts +321 -0
- package/src/queue-logger.ts +29 -19
- package/src/testing/data/trace-timeline.dx.json +4657 -0
- package/src/testing/index.ts +2 -1
- package/src/testing/test-generator.test.ts +81 -0
- package/src/testing/test-generator.ts +299 -0
- package/src/testing/test-sequence.ts +4 -29
- package/src/testing/test-services.ts +10 -14
- package/src/testing/test-trace.ts +20 -0
- package/src/testing/trace-timeline.conversations.json +1 -0
- package/src/testing/trace-timeline.test.ts +250 -0
- package/src/translations.ts +157 -68
- package/src/types/Assistant.ts +16 -53
- package/src/types/Settings.ts +76 -0
- package/src/types/capabilities.ts +35 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +5 -2
- package/src/types/service.ts +27 -16
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs +0 -29
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-SB7YC2XP.mjs +0 -77
- package/dist/lib/browser/ChatContainer-SB7YC2XP.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-X6PFOQSQ.mjs +0 -87
- package/dist/lib/browser/ChatDialog-X6PFOQSQ.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs +0 -163
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs.map +0 -7
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs +0 -22
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-ERU5XY2S.mjs +0 -166
- package/dist/lib/browser/app-graph-builder-ERU5XY2S.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs +0 -146
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs.map +0 -7
- package/dist/lib/browser/chunk-BVH6VK6Q.mjs +0 -2254
- package/dist/lib/browser/chunk-BVH6VK6Q.mjs.map +0 -7
- package/dist/lib/browser/chunk-JBFDQMUJ.mjs +0 -193
- package/dist/lib/browser/chunk-JBFDQMUJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-LKP65RPA.mjs +0 -20
- package/dist/lib/browser/chunk-LKP65RPA.mjs.map +0 -7
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs +0 -89
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs.map +0 -7
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs +0 -16
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-Y66UJUHV.mjs +0 -280
- package/dist/lib/browser/chunk-Y66UJUHV.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs +0 -24
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-DGRO2XSG.mjs +0 -81
- package/dist/lib/browser/intent-resolver-DGRO2XSG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LPSIBHEJ.mjs +0 -163
- package/dist/lib/browser/react-surface-LPSIBHEJ.mjs.map +0 -7
- package/dist/lib/browser/settings-ZFNQYSYP.mjs +0 -23
- package/dist/lib/browser/settings-ZFNQYSYP.mjs.map +0 -7
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs +0 -105
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs +0 -30
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-7JLMWHMX.mjs +0 -78
- package/dist/lib/node-esm/ChatContainer-7JLMWHMX.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QDD722F2.mjs +0 -88
- package/dist/lib/node-esm/ChatDialog-QDD722F2.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs +0 -164
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-LDD32477.mjs +0 -23
- package/dist/lib/node-esm/ai-service-LDD32477.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-RCT4ANP2.mjs +0 -167
- package/dist/lib/node-esm/app-graph-builder-RCT4ANP2.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs +0 -147
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ETS2CIDF.mjs +0 -2255
- package/dist/lib/node-esm/chunk-ETS2CIDF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs +0 -90
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GENVBE3B.mjs +0 -194
- package/dist/lib/node-esm/chunk-GENVBE3B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs +0 -22
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QS6GWTVA.mjs +0 -281
- package/dist/lib/node-esm/chunk-QS6GWTVA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs +0 -17
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs +0 -25
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-7CKWG7TZ.mjs +0 -82
- package/dist/lib/node-esm/intent-resolver-7CKWG7TZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-3EPAE4I4.mjs +0 -164
- package/dist/lib/node-esm/react-surface-3EPAE4I4.mjs.map +0 -7
- package/dist/lib/node-esm/settings-UI4VQCWW.mjs +0 -24
- package/dist/lib/node-esm/settings-UI4VQCWW.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs +0 -106
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -11
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +0 -8
- package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -12
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -18
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/PromptSettings.d.ts +0 -6
- package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
- package/dist/types/src/components/SequenceContainer.d.ts +0 -8
- package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -8
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/Timeline/Timeline.d.ts +0 -42
- package/dist/types/src/components/Timeline/Timeline.d.ts.map +0 -1
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts +0 -11
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +0 -1
- package/dist/types/src/components/Timeline/index.d.ts +0 -2
- package/dist/types/src/components/Timeline/index.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/execution-graph/execution-graph.d.ts +0 -21
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +0 -1
- package/dist/types/src/execution-graph/index.d.ts +0 -2
- package/dist/types/src/execution-graph/index.d.ts.map +0 -1
- package/dist/types/src/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/list.d.ts +0 -10
- package/dist/types/src/functions/list.d.ts.map +0 -1
- package/dist/types/src/functions/load.d.ts +0 -8
- package/dist/types/src/functions/load.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -72
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/errors.d.ts +0 -4
- package/dist/types/src/hooks/errors.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useExecutionGraph.d.ts +0 -7
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +0 -1
- package/dist/types/src/hooks/useResolveRef.d.ts +0 -4
- package/dist/types/src/hooks/useResolveRef.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/stories/Chat.stories.d.ts +0 -268
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +0 -5
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ChatContainer.d.ts +0 -5
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/GraphContainer.d.ts +0 -6
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/LoggingContainer.d.ts +0 -5
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/SurfaceContainer.d.ts +0 -8
- package/dist/types/src/stories/components/SurfaceContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/TasksContainer.d.ts +0 -5
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/index.d.ts +0 -8
- package/dist/types/src/stories/components/index.d.ts.map +0 -1
- package/dist/types/src/stories/components/types.d.ts +0 -7
- package/dist/types/src/stories/components/types.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/index.d.ts +0 -3
- package/dist/types/src/stories/hooks/index.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/useFlush.d.ts.map +0 -1
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts +0 -3
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts.map +0 -1
- package/dist/types/src/stories/testing/data.d.ts +0 -142
- package/dist/types/src/stories/testing/data.d.ts.map +0 -1
- package/dist/types/src/stories/testing/index.d.ts +0 -3
- package/dist/types/src/stories/testing/index.d.ts.map +0 -1
- package/dist/types/src/stories/testing/testing.d.ts +0 -26
- package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -6
- package/dist/types/src/testing/test-functions.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/AssistantAction.d.ts +0 -91
- package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
- package/dist/types/src/types/defs.d.ts +0 -2
- package/dist/types/src/types/defs.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -22
- package/src/capabilities/intent-resolver.ts +0 -73
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/ChatContainer.tsx +0 -69
- package/src/components/ChatDialog.tsx +0 -68
- package/src/components/ChatThread/ChatMessage.tsx +0 -291
- package/src/components/ChatThread/ToolBlock.tsx +0 -125
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/PromptSettings.tsx +0 -89
- package/src/components/SequenceContainer.tsx +0 -133
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -33
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/components/SequenceEditor/index.ts +0 -5
- package/src/components/Timeline/Timeline.stories.tsx +0 -144
- package/src/components/Timeline/Timeline.tsx +0 -202
- package/src/events.ts +0 -11
- package/src/execution-graph/execution-graph.ts +0 -184
- package/src/execution-graph/index.ts +0 -5
- package/src/functions/analysis.ts +0 -20
- package/src/functions/index.ts +0 -7
- package/src/functions/list.ts +0 -42
- package/src/functions/load.ts +0 -43
- package/src/hooks/chat-processor.ts +0 -260
- package/src/hooks/errors.ts +0 -8
- package/src/hooks/useExecutionGraph.ts +0 -16
- package/src/hooks/useResolveRef.ts +0 -33
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -74
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/stories/Chat.stories.tsx +0 -317
- package/src/stories/components/BlueprintContainer.tsx +0 -34
- package/src/stories/components/ChatContainer.tsx +0 -80
- package/src/stories/components/GraphContainer.tsx +0 -118
- package/src/stories/components/LoggingContainer.tsx +0 -29
- package/src/stories/components/SurfaceContainer.tsx +0 -62
- package/src/stories/components/TasksContainer.tsx +0 -51
- package/src/stories/components/index.ts +0 -12
- package/src/stories/components/types.ts +0 -11
- package/src/stories/hooks/index.ts +0 -6
- package/src/stories/hooks/useMatcherExtension.ts +0 -45
- package/src/stories/testing/data.ts +0 -130
- package/src/stories/testing/index.ts +0 -6
- package/src/stories/testing/testing.tsx +0 -163
- package/src/testing/test-functions.ts +0 -16
- package/src/tools/function.ts +0 -49
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -219
- package/src/tools/openapi.ts +0 -341
- package/src/types/AssistantAction.ts +0 -54
- package/src/types/defs.ts +0 -5
- package/src/typings.d.ts +0 -9
- /package/src/{stories/hooks → hooks}/useFlush.ts +0 -0
|
@@ -2,35 +2,36 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta } from '@storybook/react-vite';
|
|
8
|
-
import React, { useState } from 'react';
|
|
6
|
+
import React, { useCallback, useState } from 'react';
|
|
9
7
|
|
|
10
|
-
import { Blueprint, Template } from '@dxos/
|
|
8
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
|
-
import { withLayout, withTheme } from '@dxos/
|
|
13
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
14
|
import { trim } from '@dxos/util';
|
|
15
15
|
|
|
16
|
-
import { translations } from '
|
|
16
|
+
import { translations } from '#translations';
|
|
17
17
|
|
|
18
|
-
import { TemplateForm } from './TemplateForm';
|
|
18
|
+
import { type TemplateChangeCallback, TemplateForm } from './TemplateForm';
|
|
19
19
|
|
|
20
20
|
const TEMPLATE = trim`
|
|
21
21
|
You are a machine that is an expert chess player.
|
|
22
22
|
The move history of the current game is: {{history}}
|
|
23
23
|
If asked to suggest a move explain why it is a good move.
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
---
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
{{input}},
|
|
28
28
|
`;
|
|
29
29
|
|
|
30
30
|
const DefaultStory = () => {
|
|
31
31
|
const client = useClient();
|
|
32
32
|
const [blueprint] = useState(() => {
|
|
33
|
-
const space = client.spaces.
|
|
33
|
+
const space = client.spaces.get()[0];
|
|
34
|
+
invariant(space, 'TemplateForm story requires at least one space');
|
|
34
35
|
return space.db.add(
|
|
35
36
|
Blueprint.make({
|
|
36
37
|
key: 'example.com/blueprint/test',
|
|
@@ -40,30 +41,37 @@ const DefaultStory = () => {
|
|
|
40
41
|
);
|
|
41
42
|
});
|
|
42
43
|
|
|
44
|
+
const handleChange: TemplateChangeCallback = useCallback(
|
|
45
|
+
(mutate) => {
|
|
46
|
+
Obj.update(blueprint, (blueprint) => mutate(blueprint.instructions));
|
|
47
|
+
},
|
|
48
|
+
[blueprint],
|
|
49
|
+
);
|
|
50
|
+
|
|
43
51
|
return (
|
|
44
52
|
<div role='none' className='flex w-[40rem] border border-separator overflow-hidden'>
|
|
45
|
-
<TemplateForm id={blueprint.id} template={blueprint.instructions} />
|
|
53
|
+
<TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />
|
|
46
54
|
</div>
|
|
47
55
|
);
|
|
48
56
|
};
|
|
49
57
|
|
|
50
|
-
const meta
|
|
51
|
-
title: 'plugins/plugin-assistant/TemplateForm',
|
|
58
|
+
const meta = {
|
|
59
|
+
title: 'plugins/plugin-assistant/components/TemplateForm',
|
|
52
60
|
component: TemplateForm,
|
|
53
61
|
render: DefaultStory,
|
|
54
62
|
decorators: [
|
|
63
|
+
withTheme(),
|
|
64
|
+
withLayout({ layout: 'column' }),
|
|
55
65
|
withClientProvider({
|
|
66
|
+
types: [Blueprint.Blueprint],
|
|
56
67
|
createIdentity: true,
|
|
57
68
|
createSpace: true,
|
|
58
|
-
types: [Template.Template],
|
|
59
69
|
}),
|
|
60
|
-
withLayout({ fullscreen: true, classNames: 'flex justify-center' }),
|
|
61
|
-
withTheme,
|
|
62
70
|
],
|
|
63
71
|
parameters: {
|
|
64
72
|
translations,
|
|
65
73
|
},
|
|
66
|
-
}
|
|
74
|
+
} satisfies Meta<typeof TemplateForm>;
|
|
67
75
|
|
|
68
76
|
export default meta;
|
|
69
77
|
|
|
@@ -2,63 +2,97 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import React, { Fragment, useEffect } from 'react';
|
|
5
|
+
import type * as Schema from 'effect/Schema';
|
|
6
|
+
import React, { Fragment, useCallback, useEffect } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type Template } from '@dxos/
|
|
8
|
+
import { type Template } from '@dxos/compute';
|
|
9
|
+
import { type Obj } from '@dxos/echo';
|
|
9
10
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { attentionSurface, groupBorder, mx } from '@dxos/react-ui-theme';
|
|
11
11
|
import { isNonNullable } from '@dxos/util';
|
|
12
12
|
|
|
13
|
-
import { meta } from '
|
|
13
|
+
import { meta } from '#meta';
|
|
14
14
|
|
|
15
15
|
import { TemplateEditor } from './TemplateEditor';
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Callback type for mutating template within a parent object's Obj.update context.
|
|
19
|
+
*/
|
|
20
|
+
export type TemplateChangeCallback = (mutate: (template: Obj.Mutable<Template.Template>) => void) => void;
|
|
21
|
+
|
|
17
22
|
export type TemplateFormProps = {
|
|
18
23
|
id: string;
|
|
19
24
|
template: Template.Template;
|
|
20
25
|
schema?: Schema.Schema<any, any, any>;
|
|
21
26
|
commandEditable?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Callback to mutate the template. Should wrap mutations in parent's Obj.update.
|
|
29
|
+
* If not provided, the component is read-only.
|
|
30
|
+
*/
|
|
31
|
+
onChange?: TemplateChangeCallback;
|
|
22
32
|
};
|
|
23
33
|
|
|
24
|
-
export const TemplateForm = ({ id, template, commandEditable = true }: TemplateFormProps) => {
|
|
34
|
+
export const TemplateForm = ({ id, template, commandEditable = true, onChange }: TemplateFormProps) => {
|
|
25
35
|
const { t } = useTranslation(meta.id);
|
|
26
|
-
usePromptInputs(template);
|
|
36
|
+
usePromptInputs(template, onChange);
|
|
37
|
+
|
|
38
|
+
const handleInputKindChange = useCallback(
|
|
39
|
+
(inputName: string, kind: Template.InputKind) => {
|
|
40
|
+
onChange?.((t) => {
|
|
41
|
+
const input = t.inputs?.find((i) => i?.name === inputName);
|
|
42
|
+
if (input) {
|
|
43
|
+
input.kind = kind;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
[onChange],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const handleInputDefaultChange = useCallback(
|
|
51
|
+
(inputName: string, value: string) => {
|
|
52
|
+
onChange?.((t) => {
|
|
53
|
+
const input = t.inputs?.find((i) => i?.name === inputName);
|
|
54
|
+
if (input) {
|
|
55
|
+
input.default = value;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
[onChange],
|
|
60
|
+
);
|
|
27
61
|
|
|
28
62
|
return (
|
|
29
|
-
<div className=
|
|
63
|
+
<div className='flex flex-col w-full overflow-hidden gap-4'>
|
|
30
64
|
{/* {commandEditable && (
|
|
31
65
|
<div className='flex items-center pl-4'>
|
|
32
66
|
<span className='text-neutral-500'>/</span>
|
|
33
67
|
<Input.Root>
|
|
34
68
|
<Input.TextInput
|
|
35
|
-
placeholder={t('command
|
|
36
|
-
classNames='
|
|
69
|
+
placeholder={t('command.placeholder')}
|
|
70
|
+
classNames='w-full bg-transparent m-2'
|
|
37
71
|
value={template.command ?? ''}
|
|
38
72
|
onChange={(event) => {
|
|
39
|
-
|
|
73
|
+
onChange?.((t) => {
|
|
74
|
+
t.command = event.target.value.replace(/\w/g, '');
|
|
75
|
+
});
|
|
40
76
|
}}
|
|
41
77
|
/>
|
|
42
78
|
</Input.Root>
|
|
43
79
|
</div>
|
|
44
80
|
)} */}
|
|
45
81
|
|
|
46
|
-
<TemplateEditor id={id} template={template} classNames=
|
|
82
|
+
<TemplateEditor id={id} template={template} classNames='bg-base-surface min-h-[120px]' />
|
|
47
83
|
|
|
48
84
|
{(template.inputs?.length ?? 0) > 0 && (
|
|
49
85
|
<div className='grid grid-cols-[10rem_10rem_1fr] gap-1 items-center'>
|
|
50
86
|
{template.inputs?.filter(isNonNullable).map((input) => (
|
|
51
87
|
<Fragment key={input.name}>
|
|
52
|
-
<div className='
|
|
88
|
+
<div className='ps-3 text-blue-text'>{input.name}</div>
|
|
53
89
|
|
|
54
90
|
<Input.Root>
|
|
55
91
|
<Select.Root
|
|
56
92
|
value={input.kind}
|
|
57
|
-
onValueChange={(kind) =>
|
|
58
|
-
input.kind = kind as Template.InputKind;
|
|
59
|
-
}}
|
|
93
|
+
onValueChange={(kind) => handleInputKindChange(input.name, kind as Template.InputKind)}
|
|
60
94
|
>
|
|
61
|
-
<Select.TriggerButton placeholder='Type' classNames='
|
|
95
|
+
<Select.TriggerButton placeholder='Type' classNames='w-full' />
|
|
62
96
|
<Select.Portal>
|
|
63
97
|
<Select.Content>
|
|
64
98
|
<Select.Viewport>
|
|
@@ -68,6 +102,7 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
68
102
|
</Select.Option>
|
|
69
103
|
))}
|
|
70
104
|
</Select.Viewport>
|
|
105
|
+
<Select.Arrow />
|
|
71
106
|
</Select.Content>
|
|
72
107
|
</Select.Portal>
|
|
73
108
|
</Select.Root>
|
|
@@ -78,12 +113,10 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
78
113
|
<div>
|
|
79
114
|
<Input.Root>
|
|
80
115
|
<Input.TextInput
|
|
81
|
-
placeholder={t('command
|
|
82
|
-
classNames='
|
|
116
|
+
placeholder={t('command.placeholder')}
|
|
117
|
+
classNames='w-full bg-transparent'
|
|
83
118
|
value={input.default ?? ''}
|
|
84
|
-
onChange={(event) =>
|
|
85
|
-
input.default = event.target.value;
|
|
86
|
-
}}
|
|
119
|
+
onChange={(event) => handleInputDefaultChange(input.name, event.target.value)}
|
|
87
120
|
/>
|
|
88
121
|
</Input.Root>
|
|
89
122
|
</div>
|
|
@@ -135,13 +168,14 @@ const inputs: { kind: Template.InputKind; label: string }[] = [
|
|
|
135
168
|
|
|
136
169
|
export const NAME_REGEXP = /\{\{([\w-]+)\}\}/;
|
|
137
170
|
|
|
138
|
-
const usePromptInputs = (template: Template.Template) => {
|
|
171
|
+
const usePromptInputs = (template: Template.Template, onChange?: TemplateChangeCallback) => {
|
|
139
172
|
useEffect(() => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
template.inputs = []; // TODO(burdon): Required?
|
|
173
|
+
if (!onChange) {
|
|
174
|
+
return;
|
|
143
175
|
}
|
|
144
176
|
|
|
177
|
+
const text = template.source ?? '';
|
|
178
|
+
|
|
145
179
|
const regex = new RegExp(NAME_REGEXP, 'g');
|
|
146
180
|
const variables = new Set<string>([...(text.target?.content.matchAll(regex) ?? [])].map((m) => m[1]));
|
|
147
181
|
|
|
@@ -160,19 +194,32 @@ const usePromptInputs = (template: Template.Template) => {
|
|
|
160
194
|
|
|
161
195
|
// Match or create new inputs.
|
|
162
196
|
const values = unclaimed.values();
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
next.name = name;
|
|
167
|
-
} else {
|
|
168
|
-
template.inputs?.push({ name });
|
|
197
|
+
onChange((t) => {
|
|
198
|
+
if (!t.inputs) {
|
|
199
|
+
t.inputs = [];
|
|
169
200
|
}
|
|
170
|
-
});
|
|
171
201
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
202
|
+
missing.forEach((name) => {
|
|
203
|
+
const next = values.next().value;
|
|
204
|
+
if (next) {
|
|
205
|
+
// Find the input in the mutable draft and update it.
|
|
206
|
+
const inputIndex = t.inputs!.findIndex((i) => i?.name === next.name);
|
|
207
|
+
if (inputIndex !== -1) {
|
|
208
|
+
t.inputs![inputIndex].name = name;
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
t.inputs!.push({ name });
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// Remove unclaimed (deleted) inputs.
|
|
216
|
+
// TODO(burdon): If user types incorrect name value, it will be deleted. Garbage collect?
|
|
217
|
+
for (const input of values) {
|
|
218
|
+
const inputIndex = t.inputs!.findIndex((i) => i?.name === input.name);
|
|
219
|
+
if (inputIndex !== -1) {
|
|
220
|
+
t.inputs!.splice(inputIndex, 1);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}, [template.source, onChange]);
|
|
178
225
|
};
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
type CompletionContext,
|
|
7
|
+
type CompletionResult,
|
|
8
|
+
autocompletion,
|
|
9
|
+
completionKeymap,
|
|
10
|
+
} from '@codemirror/autocomplete';
|
|
11
|
+
import { type Extension, RangeSetBuilder } from '@codemirror/state';
|
|
12
|
+
import {
|
|
13
|
+
Decoration,
|
|
14
|
+
type DecorationSet,
|
|
15
|
+
type EditorView,
|
|
16
|
+
ViewPlugin,
|
|
17
|
+
type ViewUpdate,
|
|
18
|
+
WidgetType,
|
|
19
|
+
keymap,
|
|
20
|
+
} from '@codemirror/view';
|
|
21
|
+
|
|
22
|
+
import { Domino, mx } from '@dxos/ui';
|
|
23
|
+
|
|
24
|
+
export type HandlebarsOptions = {};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Simple Handlebars plugin for CodeMirror.
|
|
28
|
+
* Supports:
|
|
29
|
+
* - Comments: {{! comment }}
|
|
30
|
+
* - Commands: {{#command}} {{/command}}
|
|
31
|
+
* - Variables: {{var}}
|
|
32
|
+
* - Commands with variables: {{#each items}} {{/each}}
|
|
33
|
+
*/
|
|
34
|
+
export const handlebars = (_: HandlebarsOptions = {}): Extension => {
|
|
35
|
+
return [
|
|
36
|
+
handlebarsHighlightPlugin,
|
|
37
|
+
autocompletion({
|
|
38
|
+
activateOnTyping: true,
|
|
39
|
+
aboveCursor: true,
|
|
40
|
+
closeOnBlur: true,
|
|
41
|
+
override: [handlebarsCompletions],
|
|
42
|
+
}),
|
|
43
|
+
keymap.of(completionKeymap),
|
|
44
|
+
];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const regex = {
|
|
48
|
+
// {{! comment }}
|
|
49
|
+
comment: /\{\{!\s*[^}]*\}\}/g,
|
|
50
|
+
|
|
51
|
+
// {{var}}
|
|
52
|
+
brackets: /\{\{[^}]*\}\}/g,
|
|
53
|
+
|
|
54
|
+
// {{#command}} {{/command}}
|
|
55
|
+
command: /\{\{[#/]([^}]+)\}\}/g,
|
|
56
|
+
|
|
57
|
+
// {{var}}
|
|
58
|
+
var: /\{\{(?!\s*!)(\w[^}]*)\}\}/g,
|
|
59
|
+
|
|
60
|
+
// @dxn:queue:data:xxx
|
|
61
|
+
dxn: /@?dxn:[\w@:]+/g,
|
|
62
|
+
|
|
63
|
+
// example.com/path/xxx
|
|
64
|
+
url: /[\w.-]+\.[\w.-]+\/[\w/]+/g,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const tagPadding = 'mx-0.5 px-1 rounded-xs';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* ViewPlugin that decorates Handlebars syntax.
|
|
71
|
+
*/
|
|
72
|
+
const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
73
|
+
class {
|
|
74
|
+
decorations: DecorationSet;
|
|
75
|
+
|
|
76
|
+
constructor(view: EditorView) {
|
|
77
|
+
this.decorations = this.buildDecorations(view);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
update(update: ViewUpdate) {
|
|
81
|
+
if (update.docChanged || update.viewportChanged || update.selectionSet) {
|
|
82
|
+
this.decorations = this.buildDecorations(update.view);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// NOTE: Decorations may clash with other extensions (e.g., markdown).
|
|
87
|
+
buildDecorations(view: EditorView) {
|
|
88
|
+
const selection = view.state.selection.main;
|
|
89
|
+
const decorations: Array<{
|
|
90
|
+
from: number;
|
|
91
|
+
to: number;
|
|
92
|
+
decoration: Decoration;
|
|
93
|
+
}> = [];
|
|
94
|
+
|
|
95
|
+
for (const { from, to } of view.visibleRanges) {
|
|
96
|
+
const text = view.state.doc.sliceString(from, to);
|
|
97
|
+
|
|
98
|
+
// Match DXN.
|
|
99
|
+
{
|
|
100
|
+
let match;
|
|
101
|
+
while ((match = regex.dxn.exec(text)) !== null) {
|
|
102
|
+
const start = from + match.index;
|
|
103
|
+
const end = start + match[0].length;
|
|
104
|
+
// Only show widget if selection doesn't overlap with the match range.
|
|
105
|
+
const overlaps = selection.to > start && selection.from <= end;
|
|
106
|
+
if (!overlaps) {
|
|
107
|
+
decorations.push({
|
|
108
|
+
from: start,
|
|
109
|
+
to: end,
|
|
110
|
+
decoration: Decoration.widget({
|
|
111
|
+
widget: new DXNWidget(match[0]),
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Match URLs.
|
|
119
|
+
{
|
|
120
|
+
let match;
|
|
121
|
+
while ((match = regex.url.exec(text)) !== null) {
|
|
122
|
+
const start = from + match.index;
|
|
123
|
+
const end = start + match[0].length;
|
|
124
|
+
decorations.push({
|
|
125
|
+
from: start,
|
|
126
|
+
to: end,
|
|
127
|
+
decoration: Decoration.mark({
|
|
128
|
+
class: mx('dx-tag--blue', tagPadding),
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Match brackets: {{ and }}.
|
|
135
|
+
{
|
|
136
|
+
let match;
|
|
137
|
+
while ((match = regex.brackets.exec(text)) !== null) {
|
|
138
|
+
const start = from + match.index;
|
|
139
|
+
const end = start + match[0].length;
|
|
140
|
+
decorations.push({
|
|
141
|
+
from: start,
|
|
142
|
+
to: end,
|
|
143
|
+
decoration: Decoration.mark({ class: 'text-subdued' }),
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Match commands: {{#command}} and {{/command}}.
|
|
149
|
+
{
|
|
150
|
+
let match;
|
|
151
|
+
while ((match = regex.command.exec(text)) !== null) {
|
|
152
|
+
const start = from + match.index + 2;
|
|
153
|
+
let end = start + match[0].length - 4;
|
|
154
|
+
const text = view.state.doc.sliceString(start, end);
|
|
155
|
+
const parts = text.split(/\s+/);
|
|
156
|
+
if (parts.length > 1) {
|
|
157
|
+
const idx = start + parts[0].length;
|
|
158
|
+
decorations.push({
|
|
159
|
+
from: idx,
|
|
160
|
+
to: end,
|
|
161
|
+
decoration: Decoration.mark({ class: 'text-green-text' }),
|
|
162
|
+
});
|
|
163
|
+
end = idx;
|
|
164
|
+
}
|
|
165
|
+
decorations.push({
|
|
166
|
+
from: start,
|
|
167
|
+
to: end,
|
|
168
|
+
decoration: Decoration.mark({ class: 'text-blue-text' }),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Match variables: {{var}}.
|
|
174
|
+
{
|
|
175
|
+
let match;
|
|
176
|
+
while ((match = regex.var.exec(text)) !== null) {
|
|
177
|
+
const start = from + match.index + 2;
|
|
178
|
+
const end = start + match[0].length - 4;
|
|
179
|
+
decorations.push({
|
|
180
|
+
from: start,
|
|
181
|
+
to: end,
|
|
182
|
+
decoration: Decoration.mark({ class: 'text-green-text' }),
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Sort decorations by position to satisfy RangeSetBuilder requirements.
|
|
189
|
+
decorations.sort((a, b) => a.from - b.from || a.to - b.to);
|
|
190
|
+
|
|
191
|
+
// Add sorted decorations to builder.
|
|
192
|
+
const builder = new RangeSetBuilder<Decoration>();
|
|
193
|
+
for (const { from, to, decoration } of decorations) {
|
|
194
|
+
builder.add(from, to, decoration);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return builder.finish();
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
decorations: (v) => v.decorations,
|
|
202
|
+
},
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
class DXNWidget extends WidgetType {
|
|
206
|
+
constructor(private readonly _identifier: string) {
|
|
207
|
+
super();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
override ignoreEvent() {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
override eq(other: this) {
|
|
215
|
+
return this._identifier === other._identifier;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
override toDOM() {
|
|
219
|
+
const text = this._identifier
|
|
220
|
+
.split(':')
|
|
221
|
+
.map((part) => {
|
|
222
|
+
const len = 16;
|
|
223
|
+
const plen = 4;
|
|
224
|
+
if (part.length > len) {
|
|
225
|
+
return `[${part.slice(0, plen)}…${part.slice(-plen)}]`;
|
|
226
|
+
}
|
|
227
|
+
return part;
|
|
228
|
+
})
|
|
229
|
+
.join(':');
|
|
230
|
+
return Domino.of('span').classNames(mx('font-mono dx-tag--blue', tagPadding)).text(text).root;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// TODO(burdon): Pass in variables.
|
|
235
|
+
const variables = ['this'];
|
|
236
|
+
const commands = ['this', 'each', 'if', 'unless', 'with'];
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Provides completions for Handlebars variables.
|
|
240
|
+
*/
|
|
241
|
+
function handlebarsCompletions(context: CompletionContext): CompletionResult | null {
|
|
242
|
+
const match = context.matchBefore(/\{\{[^}]*/);
|
|
243
|
+
if (!match || match.from === match.to) {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
let type = 'variable';
|
|
248
|
+
let text = match.text.slice(2);
|
|
249
|
+
let from = match.from + 2;
|
|
250
|
+
let matches = [];
|
|
251
|
+
if (text.startsWith('#') || text.startsWith('/')) {
|
|
252
|
+
const idx = text.lastIndexOf(' ');
|
|
253
|
+
if (idx !== -1) {
|
|
254
|
+
type = 'variable';
|
|
255
|
+
matches = variables;
|
|
256
|
+
text = text.slice(idx + 1);
|
|
257
|
+
from += idx + 1;
|
|
258
|
+
} else {
|
|
259
|
+
type = 'command';
|
|
260
|
+
text = text.slice(1);
|
|
261
|
+
matches = commands;
|
|
262
|
+
from += 1;
|
|
263
|
+
}
|
|
264
|
+
} else {
|
|
265
|
+
type = 'variable';
|
|
266
|
+
matches = variables;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const options = matches.filter((name) => name.startsWith(text)).map((name) => ({ type, label: name }));
|
|
270
|
+
return {
|
|
271
|
+
from,
|
|
272
|
+
options,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { syntaxTree } from '@codemirror/language';
|
|
6
|
+
import { type Extension, RangeSetBuilder } from '@codemirror/state';
|
|
7
|
+
import { Decoration, type DecorationSet, type EditorView, ViewPlugin, type ViewUpdate } from '@codemirror/view';
|
|
8
|
+
|
|
9
|
+
export type XmlOptions = {};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* XML decorator plugin for CodeMirror.
|
|
13
|
+
* Decorates XML tags with monospace font using the XML language grammar.
|
|
14
|
+
*/
|
|
15
|
+
export const xmlDecorator = (_: XmlOptions = {}): Extension => {
|
|
16
|
+
return [xmlDecoratorPlugin];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* ViewPlugin that decorates XML tags using syntax tree.
|
|
21
|
+
*/
|
|
22
|
+
const xmlDecoratorPlugin = ViewPlugin.fromClass(
|
|
23
|
+
class {
|
|
24
|
+
decorations: DecorationSet;
|
|
25
|
+
|
|
26
|
+
constructor(view: EditorView) {
|
|
27
|
+
this.decorations = this.buildDecorations(view);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
update(update: ViewUpdate) {
|
|
31
|
+
if (update.docChanged || update.viewportChanged) {
|
|
32
|
+
this.decorations = this.buildDecorations(update.view);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
buildDecorations(view: EditorView) {
|
|
37
|
+
const builder = new RangeSetBuilder<Decoration>();
|
|
38
|
+
|
|
39
|
+
for (const { from, to } of view.visibleRanges) {
|
|
40
|
+
syntaxTree(view.state).iterate({
|
|
41
|
+
from,
|
|
42
|
+
to,
|
|
43
|
+
enter: (node) => {
|
|
44
|
+
// Decorate XML elements (opening tags, closing tags, self-closing tags).
|
|
45
|
+
if (
|
|
46
|
+
node.name === 'HTMLTag' ||
|
|
47
|
+
node.name === 'OpenTag' ||
|
|
48
|
+
node.name === 'CloseTag' ||
|
|
49
|
+
node.name === 'SelfClosingTag' ||
|
|
50
|
+
node.name === 'Element'
|
|
51
|
+
) {
|
|
52
|
+
builder.add(node.from, node.to, Decoration.mark({ class: 'font-mono text-subdued' }));
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return builder.finish();
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
decorations: (v) => v.decorations,
|
|
63
|
+
},
|
|
64
|
+
);
|