@dxos/plugin-assistant 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
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-2LFAG5OQ.mjs +93 -0
- package/dist/lib/browser/AssistantSettings-2LFAG5OQ.mjs.map +7 -0
- package/dist/lib/browser/BlueprintArticle-CCS25MNW.mjs +36 -0
- package/dist/lib/browser/BlueprintArticle-CCS25MNW.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-UGD4V34A.mjs +202 -0
- package/dist/lib/browser/ChatCompanion-UGD4V34A.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-ZGRSZ5EU.mjs +12 -0
- package/dist/lib/browser/ChatDialog-AET7GVIB.mjs +85 -0
- package/dist/lib/browser/ChatDialog-AET7GVIB.mjs.map +7 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs +91 -0
- package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs.map +7 -0
- package/dist/lib/browser/ProjectSettings-R6RRARLO.mjs +194 -0
- package/dist/lib/browser/ProjectSettings-R6RRARLO.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-USQO4WX6.mjs +71 -0
- package/dist/lib/browser/PromptArticle-USQO4WX6.mjs.map +7 -0
- package/dist/lib/browser/TriggerStatus-65X3EUSN.mjs +122 -0
- package/dist/lib/browser/TriggerStatus-65X3EUSN.mjs.map +7 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs +22 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-SFYYUKTT.mjs +234 -0
- package/dist/lib/browser/app-graph-builder-SFYYUKTT.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-RB5RHZZM.mjs +34 -0
- package/dist/lib/browser/blueprint-definition-RB5RHZZM.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +8 -0
- package/dist/lib/browser/chunk-7DXYAXLZ.mjs +230 -0
- package/dist/lib/browser/chunk-7DXYAXLZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-EXVT7D4B.mjs +23 -0
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
- package/dist/lib/browser/chunk-JYY5AD65.mjs +286 -0
- package/dist/lib/browser/chunk-JYY5AD65.mjs.map +7 -0
- package/dist/lib/browser/chunk-LEXIQDXZ.mjs +26 -0
- package/dist/lib/browser/chunk-LEXIQDXZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-RU4G5NY4.mjs +69 -0
- package/dist/lib/browser/chunk-RU4G5NY4.mjs.map +7 -0
- package/dist/lib/browser/chunk-UUA6GNGG.mjs +2125 -0
- package/dist/lib/browser/chunk-UUA6GNGG.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs +21 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +271 -226
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs +20 -0
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-ELXDQZEG.mjs +136 -0
- package/dist/lib/browser/operation-resolver-ELXDQZEG.mjs.map +7 -0
- package/dist/lib/browser/react-surface-KYQSZO2I.mjs +144 -0
- package/dist/lib/browser/react-surface-KYQSZO2I.mjs.map +7 -0
- package/dist/lib/browser/repair-ZFZWZALX.mjs +52 -0
- package/dist/lib/browser/repair-ZFZWZALX.mjs.map +7 -0
- package/dist/lib/browser/settings-YREVQAZ5.mjs +33 -0
- package/dist/lib/browser/settings-YREVQAZ5.mjs.map +7 -0
- package/dist/lib/browser/state-MPG42ZO4.mjs +26 -0
- package/dist/lib/browser/state-MPG42ZO4.mjs.map +7 -0
- package/dist/lib/browser/toolkit-XRSBBB3L.mjs +16 -0
- package/dist/lib/browser/toolkit-XRSBBB3L.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -4
- package/dist/lib/node-esm/AssistantSettings-QWFEMJG7.mjs +94 -0
- package/dist/lib/node-esm/AssistantSettings-QWFEMJG7.mjs.map +7 -0
- package/dist/lib/node-esm/BlueprintArticle-SNEN6LOY.mjs +37 -0
- package/dist/lib/node-esm/BlueprintArticle-SNEN6LOY.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-NP4R5BFE.mjs +203 -0
- package/dist/lib/node-esm/ChatCompanion-NP4R5BFE.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-IFHDIFJH.mjs +13 -0
- package/dist/lib/node-esm/ChatContainer-IFHDIFJH.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-UZNQBTKZ.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-UZNQBTKZ.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs +92 -0
- package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectSettings-Q5QY6BYS.mjs +195 -0
- package/dist/lib/node-esm/ProjectSettings-Q5QY6BYS.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-PGMJMQK7.mjs +72 -0
- package/dist/lib/node-esm/PromptArticle-PGMJMQK7.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerStatus-UR5S7PXJ.mjs +123 -0
- package/dist/lib/node-esm/TriggerStatus-UR5S7PXJ.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs +23 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-E25JXI34.mjs +235 -0
- package/dist/lib/node-esm/app-graph-builder-E25JXI34.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-L7XKRYIW.mjs +35 -0
- package/dist/lib/node-esm/blueprint-definition-L7XKRYIW.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +9 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3QBVFAYO.mjs +28 -0
- package/dist/lib/node-esm/chunk-3QBVFAYO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6NCLKQCL.mjs +70 -0
- package/dist/lib/node-esm/chunk-6NCLKQCL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GZ4ERNT2.mjs +2126 -0
- package/dist/lib/node-esm/chunk-GZ4ERNT2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JMBYVUD6.mjs +288 -0
- package/dist/lib/node-esm/chunk-JMBYVUD6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MWYYLALM.mjs +231 -0
- package/dist/lib/node-esm/chunk-MWYYLALM.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-73ABYRYX.mjs → chunk-POWB2BPC.mjs} +7 -2
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs +22 -0
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +271 -226
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs +21 -0
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-Q5GNP2GH.mjs +137 -0
- package/dist/lib/node-esm/operation-resolver-Q5GNP2GH.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-JJRGVGKD.mjs +145 -0
- package/dist/lib/node-esm/react-surface-JJRGVGKD.mjs.map +7 -0
- package/dist/lib/node-esm/repair-LXFVOK4B.mjs +53 -0
- package/dist/lib/node-esm/repair-LXFVOK4B.mjs.map +7 -0
- package/dist/lib/node-esm/settings-N452OW6Y.mjs +34 -0
- package/dist/lib/node-esm/settings-N452OW6Y.mjs.map +7 -0
- package/dist/lib/node-esm/state-WHZFKIEL.mjs +27 -0
- package/dist/lib/node-esm/state-WHZFKIEL.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs +17 -0
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -4
- 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/ai-service.d.ts +6 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +7 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -11
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +13 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +15 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +18 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +11 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +13 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +6 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +28 -14
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +2 -2
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +7 -8
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +250 -76
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +12 -6
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +234 -65
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +235 -66
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- 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 +10 -8
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +6 -7
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +234 -64
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/index.d.ts +2 -0
- package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -11
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AssistantSettings/AssistantSettings.d.ts +8 -0
- package/dist/types/src/containers/AssistantSettings/AssistantSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AssistantSettings/index.d.ts +3 -0
- package/dist/types/src/containers/AssistantSettings/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 +3 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +12 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts +3 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +18 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +3 -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 +3 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts +7 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts +6 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/Project/index.d.ts +7 -0
- package/dist/types/src/containers/Project/index.d.ts.map +1 -0
- package/dist/types/src/containers/Project/triggers.d.ts +6 -0
- package/dist/types/src/containers/Project/triggers.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +6 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts +3 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +4 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +5 -2
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -5
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- 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/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +1 -0
- package/dist/types/src/processor/index.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +24 -19
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts +10 -0
- package/dist/types/src/processor/update-name.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +0 -2
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +5 -4
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +2 -2
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +359 -27
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +7 -29
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +86 -100
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +33 -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 +4 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +13 -215
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +120 -112
- package/src/AssistantPlugin.tsx +117 -112
- package/src/blueprints/assistant/blueprint.conversations.json +1 -0
- package/src/blueprints/assistant/blueprint.test.ts +48 -0
- package/src/blueprints/assistant/blueprint.ts +27 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/{components/Toolbar → blueprints}/index.ts +1 -1
- package/src/capabilities/ai-service/ai-service.ts +30 -0
- package/src/capabilities/ai-service/index.ts +7 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +198 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +48 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +33 -0
- package/src/capabilities/edge-model-resolver/index.ts +7 -0
- package/src/capabilities/index.ts +10 -14
- package/src/capabilities/local-model-resolver/index.ts +7 -0
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +38 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +121 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +121 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/repair/repair.ts +69 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +27 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/toolkit/toolkit.ts +15 -0
- package/src/components/Chat/Chat.tsx +229 -153
- package/src/components/Chat/events.ts +7 -1
- package/src/components/ChatProgress/ChatProgress.tsx +6 -20
- package/src/components/ChatPrompt/ChatActions.tsx +12 -6
- package/src/components/ChatPrompt/ChatOptions.tsx +119 -86
- package/src/components/ChatPrompt/ChatReferences.tsx +19 -10
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +59 -38
- package/src/components/ChatThread/ChatThread.tsx +40 -37
- package/src/components/ChatThread/Link.tsx +4 -4
- package/src/components/ChatThread/registry.tsx +72 -49
- package/src/components/ChatThread/sync.test.ts +35 -17
- package/src/components/ChatThread/sync.ts +61 -14
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +17 -7
- package/src/components/TemplateEditor/TemplateEditor.tsx +25 -13
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +17 -9
- package/src/components/TemplateEditor/TemplateForm.tsx +80 -34
- 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 +39 -48
- package/src/components/Toolbox/Toolbox.stories.tsx +11 -12
- package/src/components/Toolbox/Toolbox.tsx +52 -54
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +86 -0
- package/src/components/Typewriter/Typewriter.tsx +54 -0
- package/src/components/Typewriter/assistant-extension.tsx +142 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/components/index.ts +0 -12
- package/src/{components → containers}/AssistantSettings/AssistantSettings.tsx +28 -20
- package/src/containers/AssistantSettings/index.ts +7 -0
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +30 -0
- package/src/containers/BlueprintArticle/index.ts +7 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +225 -0
- package/src/containers/ChatCompanion/index.ts +7 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +69 -0
- package/src/containers/ChatContainer/index.ts +7 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +18 -14
- package/src/containers/ChatDialog/index.ts +7 -0
- package/src/containers/Project/ProjectArticle.tsx +117 -0
- package/src/containers/Project/ProjectSettings.tsx +118 -0
- package/src/containers/Project/index.ts +16 -0
- package/src/containers/Project/triggers.ts +131 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +150 -0
- package/src/containers/TriggerStatus/index.ts +7 -0
- package/src/containers/index.ts +15 -0
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useBlueprintRegistry.ts +35 -21
- package/src/hooks/useChatProcessor.ts +26 -14
- package/src/hooks/useChatServices.ts +16 -18
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +21 -7
- package/src/hooks/useContextObjects.ts +13 -25
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/useReferencesProvider.ts +5 -8
- package/src/index.ts +3 -1
- package/src/meta.ts +8 -3
- package/src/processor/index.ts +1 -0
- package/src/processor/presets.ts +1 -1
- package/src/processor/processor.test.ts +19 -27
- package/src/processor/processor.ts +83 -90
- package/src/processor/update-name.ts +58 -0
- package/src/queue-logger.ts +8 -9
- package/src/testing/index.ts +0 -2
- package/src/testing/test-generator.ts +14 -13
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +10 -14
- package/src/translations.ts +52 -19
- package/src/types/Assistant.ts +4 -37
- package/src/types/AssistantAction.ts +67 -53
- package/src/types/capabilities.ts +27 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +6 -1
- package/src/types/service.ts +26 -15
- package/dist/lib/browser/BlueprintContainer-TO35YXHT.mjs +0 -29
- package/dist/lib/browser/BlueprintContainer-TO35YXHT.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-ZIKNUUSU.mjs +0 -127
- package/dist/lib/browser/ChatCompanion-ZIKNUUSU.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-MA5BVDGH.mjs +0 -73
- package/dist/lib/browser/ChatContainer-MA5BVDGH.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-7OXLIWZI.mjs +0 -86
- package/dist/lib/browser/ChatDialog-7OXLIWZI.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs +0 -150
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-VKFRYY2N.mjs +0 -154
- package/dist/lib/browser/app-graph-builder-VKFRYY2N.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs +0 -12
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs +0 -175
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-43I2LR6O.mjs +0 -216
- package/dist/lib/browser/chunk-43I2LR6O.mjs.map +0 -7
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs +0 -16
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-5RICKAMN.mjs +0 -18
- package/dist/lib/browser/chunk-5RICKAMN.mjs.map +0 -7
- package/dist/lib/browser/chunk-B2RCJXEO.mjs +0 -202
- package/dist/lib/browser/chunk-B2RCJXEO.mjs.map +0 -7
- package/dist/lib/browser/chunk-BRJMNZOS.mjs +0 -169
- package/dist/lib/browser/chunk-BRJMNZOS.mjs.map +0 -7
- package/dist/lib/browser/chunk-P5P7QXBS.mjs +0 -296
- package/dist/lib/browser/chunk-P5P7QXBS.mjs.map +0 -7
- package/dist/lib/browser/chunk-UDH4MR7H.mjs +0 -1744
- package/dist/lib/browser/chunk-UDH4MR7H.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5LB25ZRN.mjs +0 -112
- package/dist/lib/browser/intent-resolver-5LB25ZRN.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-WQZXU624.mjs +0 -107
- package/dist/lib/browser/react-surface-WQZXU624.mjs.map +0 -7
- package/dist/lib/browser/settings-4B2NA4CE.mjs +0 -23
- package/dist/lib/browser/settings-4B2NA4CE.mjs.map +0 -7
- package/dist/lib/browser/state-LXTS54DI.mjs +0 -21
- package/dist/lib/browser/state-LXTS54DI.mjs.map +0 -7
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs +0 -199
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-J664LTU3.mjs +0 -30
- package/dist/lib/node-esm/BlueprintContainer-J664LTU3.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-YDXJIVCF.mjs +0 -128
- package/dist/lib/node-esm/ChatCompanion-YDXJIVCF.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-WLTOQLHH.mjs +0 -74
- package/dist/lib/node-esm/ChatContainer-WLTOQLHH.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-ADKF62SY.mjs +0 -87
- package/dist/lib/node-esm/ChatDialog-ADKF62SY.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs +0 -151
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-K6AYO4YM.mjs +0 -155
- package/dist/lib/node-esm/app-graph-builder-K6AYO4YM.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs +0 -13
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DBDKOC3I.mjs +0 -203
- package/dist/lib/node-esm/chunk-DBDKOC3I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs +0 -217
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-I7BZMIAG.mjs +0 -170
- package/dist/lib/node-esm/chunk-I7BZMIAG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TBQOICXZ.mjs +0 -297
- package/dist/lib/node-esm/chunk-TBQOICXZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs +0 -177
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UPPSDTOJ.mjs +0 -1745
- package/dist/lib/node-esm/chunk-UPPSDTOJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs +0 -17
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-I64MNI4C.mjs +0 -113
- package/dist/lib/node-esm/intent-resolver-I64MNI4C.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-TVVVRIR3.mjs +0 -108
- package/dist/lib/node-esm/react-surface-TVVVRIR3.mjs.map +0 -7
- package/dist/lib/node-esm/settings-7Y3CRASE.mjs +0 -24
- package/dist/lib/node-esm/settings-7Y3CRASE.mjs.map +0 -7
- package/dist/lib/node-esm/state-BO6GUFLB.mjs +0 -22
- package/dist/lib/node-esm/state-BO6GUFLB.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs +0 -200
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-service.d.ts +0 -4
- package/dist/types/src/capabilities/ai-service.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- 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/edge-model-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/edge-model-resolver.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/capabilities/local-model-resolver.d.ts +0 -10
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -4
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -4
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +0 -6
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +0 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts +0 -2
- package/dist/types/src/components/AssistantSettings/index.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/ChatCompanion.d.ts +0 -13
- package/dist/types/src/components/ChatCompanion.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -11
- 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/reducers.d.ts +0 -40
- package/dist/types/src/components/ChatThread/reducers.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 -269
- 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/TemplateEditor/handlebars-extension.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -5
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/index.d.ts +0 -2
- package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +0 -11
- package/dist/types/src/components/Toolbar/useChatToolbarActions.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/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/useItemTypes.d.ts +0 -4
- package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
- package/dist/types/src/stories/Chat.stories.d.ts +0 -32
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/stories/QueryEditor.stories.d.ts +0 -7
- package/dist/types/src/stories/QueryEditor.stories.d.ts.map +0 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +0 -4
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ChatContainer.d.ts +0 -4
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ChessContainer.d.ts +0 -4
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/CommentsContainer.d.ts +0 -4
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/DebugCard.d.ts +0 -8
- package/dist/types/src/stories/components/DebugCard.d.ts.map +0 -1
- package/dist/types/src/stories/components/ExecutionGraphContainer.d.ts +0 -7
- package/dist/types/src/stories/components/ExecutionGraphContainer.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/InvocationsContainer.d.ts +0 -4
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/MessageContainer.d.ts +0 -4
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ProjectContainer.d.ts +0 -4
- package/dist/types/src/stories/components/ProjectContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/PromptContainer.d.ts +0 -6
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +0 -4
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +0 -1
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +0 -4
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +0 -1
- package/dist/types/src/stories/components/ScriptContainer.d.ts +0 -4
- package/dist/types/src/stories/components/ScriptContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/TasksContainer.d.ts +0 -4
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +0 -3
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/TriggersContainer.d.ts +0 -3
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +0 -1
- package/dist/types/src/stories/components/index.d.ts +0 -18
- 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/testing/data.d.ts +0 -9
- 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/schema.d.ts +0 -7
- package/dist/types/src/stories/testing/schema.d.ts.map +0 -1
- package/dist/types/src/stories/testing/testing.d.ts +0 -51
- package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-data.d.ts +0 -14
- package/dist/types/src/testing/test-data.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/src/capabilities/ai-service.ts +0 -27
- package/src/capabilities/app-graph-builder.ts +0 -163
- package/src/capabilities/blueprint-definition.ts +0 -64
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/edge-model-resolver.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -94
- package/src/capabilities/local-model-resolver.ts +0 -30
- package/src/capabilities/react-surface.tsx +0 -91
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -20
- package/src/capabilities/toolkit.ts +0 -168
- package/src/components/AssistantSettings/index.ts +0 -5
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/ChatCompanion.tsx +0 -114
- package/src/components/ChatContainer.tsx +0 -51
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/PromptSettings.tsx +0 -90
- package/src/components/SequenceContainer.tsx +0 -131
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -35
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/components/SequenceEditor/index.ts +0 -5
- package/src/components/TemplateEditor/handlebars-extension.ts +0 -165
- package/src/components/Toolbar/Toolbar.tsx +0 -21
- package/src/components/Toolbar/useChatToolbarActions.ts +0 -126
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- package/src/functions/index.ts +0 -7
- package/src/functions/list.ts +0 -48
- package/src/functions/load.ts +0 -46
- package/src/hooks/useItemTypes.ts +0 -37
- package/src/stories/Chat.stories.tsx +0 -882
- package/src/stories/QueryEditor.stories.tsx +0 -114
- package/src/stories/components/BlueprintContainer.tsx +0 -34
- package/src/stories/components/ChatContainer.tsx +0 -74
- package/src/stories/components/ChessContainer.tsx +0 -17
- package/src/stories/components/CommentsContainer.tsx +0 -25
- package/src/stories/components/DebugCard.tsx +0 -61
- package/src/stories/components/ExecutionGraphContainer.tsx +0 -30
- package/src/stories/components/GraphContainer.tsx +0 -106
- package/src/stories/components/InvocationsContainer.tsx +0 -17
- package/src/stories/components/MessageContainer.tsx +0 -22
- package/src/stories/components/ProjectContainer.tsx +0 -17
- package/src/stories/components/PromptContainer.tsx +0 -52
- package/src/stories/components/ResearchInputStack.tsx +0 -30
- package/src/stories/components/ResearchOutputStack.tsx +0 -29
- package/src/stories/components/ScriptContainer.tsx +0 -28
- package/src/stories/components/TasksContainer.tsx +0 -47
- package/src/stories/components/TokenManagerContainer.tsx +0 -14
- package/src/stories/components/TriggersContainer.tsx +0 -12
- package/src/stories/components/index.ts +0 -22
- package/src/stories/components/types.ts +0 -11
- package/src/stories/testing/data.ts +0 -135
- package/src/stories/testing/index.ts +0 -6
- package/src/stories/testing/schema.ts +0 -17
- package/src/stories/testing/testing.tsx +0 -291
- package/src/testing/test-data.ts +0 -248
- package/src/testing/test-functions.ts +0 -16
- /package/dist/lib/browser/{blueprint-definition-NSJARW5U.mjs.map → ChatContainer-ZGRSZ5EU.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-WD2IVMAI.mjs.map → browser/blueprints/index.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
|
@@ -9,26 +9,36 @@ import { createSystemPrompt } from '@dxos/assistant';
|
|
|
9
9
|
import { Blueprint, Template } from '@dxos/blueprints';
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
13
13
|
import { trim } from '@dxos/util';
|
|
14
14
|
|
|
15
15
|
import { translations } from '../../translations';
|
|
16
16
|
|
|
17
17
|
import { TemplateEditor, type TemplateEditorProps } from './TemplateEditor';
|
|
18
18
|
|
|
19
|
+
const FENCE = '```';
|
|
20
|
+
|
|
19
21
|
const TEMPLATE = trim`
|
|
20
22
|
{{! System Prompt }}
|
|
21
23
|
|
|
22
|
-
You are
|
|
24
|
+
You are an expert chess player.
|
|
23
25
|
The move history of the current game is: {{history}}.
|
|
24
26
|
If asked to suggest a move explain why it is a good move.
|
|
25
27
|
|
|
26
28
|
{{#each artifacts}}
|
|
27
|
-
|
|
29
|
+
{{this}}
|
|
28
30
|
{{/each}}
|
|
29
31
|
|
|
32
|
+
Reponse in the format: <suggestion>SUGGESTION</suggestion>
|
|
33
|
+
|
|
34
|
+
@dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M
|
|
35
|
+
|
|
30
36
|
---
|
|
31
37
|
|
|
38
|
+
${FENCE}ts
|
|
39
|
+
const x = 100;
|
|
40
|
+
${FENCE}
|
|
41
|
+
|
|
32
42
|
{{input}}
|
|
33
43
|
`;
|
|
34
44
|
|
|
@@ -47,7 +57,7 @@ const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
|
|
|
47
57
|
|
|
48
58
|
return (
|
|
49
59
|
<TemplateEditor
|
|
50
|
-
classNames='bg-
|
|
60
|
+
classNames='bg-base-surface w-full max-w-prose-max-width'
|
|
51
61
|
id={blueprint.id}
|
|
52
62
|
template={blueprint.instructions}
|
|
53
63
|
/>
|
|
@@ -55,11 +65,12 @@ const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
|
|
|
55
65
|
};
|
|
56
66
|
|
|
57
67
|
const meta = {
|
|
58
|
-
title: 'plugins/plugin-assistant/TemplateEditor',
|
|
68
|
+
title: 'plugins/plugin-assistant/components/TemplateEditor',
|
|
59
69
|
component: TemplateEditor as any,
|
|
60
70
|
render: DefaultStory,
|
|
61
71
|
decorators: [
|
|
62
|
-
withTheme,
|
|
72
|
+
withTheme(),
|
|
73
|
+
withLayout({ layout: 'column' }),
|
|
63
74
|
withClientProvider({
|
|
64
75
|
types: [Blueprint.Blueprint],
|
|
65
76
|
createIdentity: true,
|
|
@@ -67,7 +78,6 @@ const meta = {
|
|
|
67
78
|
}),
|
|
68
79
|
],
|
|
69
80
|
parameters: {
|
|
70
|
-
layout: 'column',
|
|
71
81
|
translations,
|
|
72
82
|
},
|
|
73
83
|
} satisfies Meta<typeof DefaultStory>;
|
|
@@ -2,32 +2,34 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
8
|
import { type Template } from '@dxos/blueprints';
|
|
8
|
-
import { createDocAccessor } from '@dxos/
|
|
9
|
+
import { createDocAccessor } from '@dxos/echo-db';
|
|
9
10
|
import { type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
10
12
|
import {
|
|
11
13
|
createBasicExtensions,
|
|
12
14
|
createDataExtensions,
|
|
13
15
|
createMarkdownExtensions,
|
|
14
16
|
createThemeExtensions,
|
|
15
17
|
decorateMarkdown,
|
|
16
|
-
|
|
17
|
-
} from '@dxos/
|
|
18
|
-
import {
|
|
19
|
-
import { isTruthy } from '@dxos/util';
|
|
18
|
+
} from '@dxos/ui-editor';
|
|
19
|
+
import { mx } from '@dxos/ui-theme';
|
|
20
|
+
import { isNonNullable } from '@dxos/util';
|
|
20
21
|
|
|
21
22
|
import { meta } from '../../meta';
|
|
22
23
|
|
|
23
|
-
import { handlebars } from './
|
|
24
|
+
import { handlebars, xmlDecorator } from './extensions';
|
|
24
25
|
|
|
25
26
|
export type TemplateEditorProps = ThemedClassName<{
|
|
26
27
|
id: string;
|
|
27
28
|
template: Template.Template;
|
|
29
|
+
lineNumbers?: boolean;
|
|
28
30
|
}>;
|
|
29
31
|
|
|
30
|
-
export const TemplateEditor = ({ id, classNames, template }: TemplateEditorProps) => {
|
|
32
|
+
export const TemplateEditor = ({ id, classNames, template, lineNumbers = true }: TemplateEditorProps) => {
|
|
31
33
|
const { t } = useTranslation(meta.id);
|
|
32
34
|
const { themeMode } = useThemeContext();
|
|
33
35
|
const { parentRef } = useTextEditor(() => {
|
|
@@ -39,20 +41,30 @@ export const TemplateEditor = ({ id, classNames, template }: TemplateEditorProps
|
|
|
39
41
|
return {
|
|
40
42
|
initialValue: text.content ?? '',
|
|
41
43
|
extensions: [
|
|
42
|
-
createDataExtensions({
|
|
44
|
+
createDataExtensions({
|
|
45
|
+
id,
|
|
46
|
+
text: createDocAccessor(text, ['content']),
|
|
47
|
+
}),
|
|
43
48
|
createBasicExtensions({
|
|
44
49
|
bracketMatching: false,
|
|
45
|
-
lineNumbers
|
|
50
|
+
lineNumbers,
|
|
46
51
|
lineWrapping: true,
|
|
47
52
|
placeholder: t('template placeholder'),
|
|
48
53
|
}),
|
|
49
|
-
createThemeExtensions({
|
|
54
|
+
createThemeExtensions({
|
|
55
|
+
themeMode,
|
|
56
|
+
slots: { content: { className: '!pe-4' } },
|
|
57
|
+
}),
|
|
50
58
|
createMarkdownExtensions(),
|
|
51
59
|
decorateMarkdown(),
|
|
52
60
|
handlebars(),
|
|
53
|
-
|
|
61
|
+
// xml(),
|
|
62
|
+
// NOTE: Since we're using markdown only HTML nodes are parsed.
|
|
63
|
+
xmlDecorator(),
|
|
64
|
+
syntaxHighlighting(defaultHighlightStyle),
|
|
65
|
+
].filter(isNonNullable),
|
|
54
66
|
};
|
|
55
|
-
}, [themeMode, template.source?.target]);
|
|
67
|
+
}, [themeMode, template.source?.target, lineNumbers]);
|
|
56
68
|
|
|
57
|
-
return <div ref={parentRef} className={mx('
|
|
69
|
+
return <div ref={parentRef} className={mx('h-full overflow-hidden', classNames)} />;
|
|
58
70
|
};
|
|
@@ -3,25 +3,26 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta } from '@storybook/react-vite';
|
|
6
|
-
import React, { useState } from 'react';
|
|
6
|
+
import React, { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Blueprint, Template } from '@dxos/blueprints';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { useClient } from '@dxos/react-client';
|
|
10
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
11
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
12
13
|
import { trim } from '@dxos/util';
|
|
13
14
|
|
|
14
15
|
import { translations } from '../../translations';
|
|
15
16
|
|
|
16
|
-
import { TemplateForm } from './TemplateForm';
|
|
17
|
+
import { type TemplateChangeCallback, TemplateForm } from './TemplateForm';
|
|
17
18
|
|
|
18
19
|
const TEMPLATE = trim`
|
|
19
20
|
You are a machine that is an expert chess player.
|
|
20
21
|
The move history of the current game is: {{history}}
|
|
21
22
|
If asked to suggest a move explain why it is a good move.
|
|
22
|
-
|
|
23
|
+
|
|
23
24
|
---
|
|
24
|
-
|
|
25
|
+
|
|
25
26
|
{{input}},
|
|
26
27
|
`;
|
|
27
28
|
|
|
@@ -38,19 +39,27 @@ const DefaultStory = () => {
|
|
|
38
39
|
);
|
|
39
40
|
});
|
|
40
41
|
|
|
42
|
+
const handleChange: TemplateChangeCallback = useCallback(
|
|
43
|
+
(mutate) => {
|
|
44
|
+
Obj.change(blueprint, (b) => mutate(b.instructions));
|
|
45
|
+
},
|
|
46
|
+
[blueprint],
|
|
47
|
+
);
|
|
48
|
+
|
|
41
49
|
return (
|
|
42
50
|
<div role='none' className='flex w-[40rem] border border-separator overflow-hidden'>
|
|
43
|
-
<TemplateForm id={blueprint.id} template={blueprint.instructions} />
|
|
51
|
+
<TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />
|
|
44
52
|
</div>
|
|
45
53
|
);
|
|
46
54
|
};
|
|
47
55
|
|
|
48
56
|
const meta = {
|
|
49
|
-
title: 'plugins/plugin-assistant/TemplateForm',
|
|
57
|
+
title: 'plugins/plugin-assistant/components/TemplateForm',
|
|
50
58
|
component: TemplateForm,
|
|
51
59
|
render: DefaultStory,
|
|
52
60
|
decorators: [
|
|
53
|
-
withTheme,
|
|
61
|
+
withTheme(),
|
|
62
|
+
withLayout({ layout: 'column' }),
|
|
54
63
|
withClientProvider({
|
|
55
64
|
types: [Blueprint.Blueprint],
|
|
56
65
|
createIdentity: true,
|
|
@@ -58,7 +67,6 @@ const meta = {
|
|
|
58
67
|
}),
|
|
59
68
|
],
|
|
60
69
|
parameters: {
|
|
61
|
-
layout: 'column',
|
|
62
70
|
translations,
|
|
63
71
|
},
|
|
64
72
|
} satisfies Meta<typeof TemplateForm>;
|
|
@@ -3,62 +3,96 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import type * as Schema from 'effect/Schema';
|
|
6
|
-
import React, { Fragment, useEffect } from 'react';
|
|
6
|
+
import React, { Fragment, useCallback, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type Template } from '@dxos/blueprints';
|
|
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
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.change 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.change.
|
|
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
69
|
placeholder={t('command placeholder')}
|
|
36
|
-
classNames='
|
|
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>
|
|
@@ -80,11 +114,9 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
80
114
|
<Input.Root>
|
|
81
115
|
<Input.TextInput
|
|
82
116
|
placeholder={t('command placeholder')}
|
|
83
|
-
classNames='
|
|
117
|
+
classNames='w-full bg-transparent'
|
|
84
118
|
value={input.default ?? ''}
|
|
85
|
-
onChange={(event) =>
|
|
86
|
-
input.default = event.target.value;
|
|
87
|
-
}}
|
|
119
|
+
onChange={(event) => handleInputDefaultChange(input.name, event.target.value)}
|
|
88
120
|
/>
|
|
89
121
|
</Input.Root>
|
|
90
122
|
</div>
|
|
@@ -136,13 +168,14 @@ const inputs: { kind: Template.InputKind; label: string }[] = [
|
|
|
136
168
|
|
|
137
169
|
export const NAME_REGEXP = /\{\{([\w-]+)\}\}/;
|
|
138
170
|
|
|
139
|
-
const usePromptInputs = (template: Template.Template) => {
|
|
171
|
+
const usePromptInputs = (template: Template.Template, onChange?: TemplateChangeCallback) => {
|
|
140
172
|
useEffect(() => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
template.inputs = []; // TODO(burdon): Required?
|
|
173
|
+
if (!onChange) {
|
|
174
|
+
return;
|
|
144
175
|
}
|
|
145
176
|
|
|
177
|
+
const text = template.source ?? '';
|
|
178
|
+
|
|
146
179
|
const regex = new RegExp(NAME_REGEXP, 'g');
|
|
147
180
|
const variables = new Set<string>([...(text.target?.content.matchAll(regex) ?? [])].map((m) => m[1]));
|
|
148
181
|
|
|
@@ -161,19 +194,32 @@ const usePromptInputs = (template: Template.Template) => {
|
|
|
161
194
|
|
|
162
195
|
// Match or create new inputs.
|
|
163
196
|
const values = unclaimed.values();
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
next.name = name;
|
|
168
|
-
} else {
|
|
169
|
-
template.inputs?.push({ name });
|
|
197
|
+
onChange((t) => {
|
|
198
|
+
if (!t.inputs) {
|
|
199
|
+
t.inputs = [];
|
|
170
200
|
}
|
|
171
|
-
});
|
|
172
201
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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]);
|
|
179
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
|
+
// dxos.org/type/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
|
+
}
|