@solidxai/core-ui 0.1.20-beta.0 → 0.1.20
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/components/common/Link.d.ts.map +1 -1
- package/dist/components/common/Link.js +2 -1
- package/dist/components/common/Link.js.map +1 -1
- package/dist/components/common/Link.tsx +2 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts +1 -0
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts.map +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js +109 -23
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js.map +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.tsx +155 -34
- package/dist/components/core/chatter/SolidChatter.js +2 -2
- package/dist/components/core/chatter/SolidChatter.js.map +1 -1
- package/dist/components/core/chatter/SolidChatter.tsx +2 -2
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js +20 -19
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js.map +1 -1
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +16 -16
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js +36 -9
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.tsx +78 -7
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.tsx +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.d.ts +4 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.js +131 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.tsx +151 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.d.ts +4 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.js +13 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.tsx +20 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +4 -0
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +4 -0
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +50 -15
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +22 -3
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +16 -3
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +16 -2
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +4 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +4 -1
- package/dist/components/core/module/ModulePackageDialog.css +102 -0
- package/dist/components/core/module/ModulePackageDialog.d.ts +2 -1
- package/dist/components/core/module/ModulePackageDialog.d.ts.map +1 -1
- package/dist/components/core/module/ModulePackageDialog.js +216 -68
- package/dist/components/core/module/ModulePackageDialog.js.map +1 -1
- package/dist/components/core/module/ModulePackageDialog.tsx +356 -76
- package/dist/components/core/solid-agent/SolidAgentChat.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.js +9 -3
- package/dist/components/core/solid-agent/SolidAgentChat.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentChat.tsx +9 -4
- package/dist/components/core/solid-agent/SolidAgentMarkdown.d.ts.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentMarkdown.js +25 -6
- package/dist/components/core/solid-agent/SolidAgentMarkdown.js.map +1 -1
- package/dist/components/core/solid-agent/SolidAgentMarkdown.tsx +15 -1
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts +5 -0
- package/dist/components/core/solid-agent/client/agentRuntime.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.js +77 -20
- package/dist/components/core/solid-agent/client/agentRuntime.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentRuntime.ts +29 -1
- package/dist/components/core/solid-agent/client/agentSocket.d.ts +5 -1
- package/dist/components/core/solid-agent/client/agentSocket.d.ts.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.js +27 -4
- package/dist/components/core/solid-agent/client/agentSocket.js.map +1 -1
- package/dist/components/core/solid-agent/client/agentSocket.ts +14 -3
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js +2 -2
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js.map +1 -1
- package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.tsx +5 -5
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts +2 -0
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js +2 -2
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js.map +1 -1
- package/dist/components/core/solid-agent/embed/agentEmbedProtocol.ts +4 -4
- package/dist/components/core/solid-agent/thread/AgentThread.d.ts.map +1 -1
- package/dist/components/core/solid-agent/thread/AgentThread.js +61 -26
- package/dist/components/core/solid-agent/thread/AgentThread.js.map +1 -1
- package/dist/components/core/solid-agent/thread/AgentThread.tsx +74 -40
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts +2 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts.map +1 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js +2 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js.map +1 -1
- package/dist/components/core/solid-agent/thread/SolidAgentChatItem.tsx +3 -1
- package/dist/components/core/solid-agent/types.d.ts +3 -0
- package/dist/components/core/solid-agent/types.d.ts.map +1 -1
- package/dist/components/core/solid-agent/types.js +0 -9
- package/dist/components/core/solid-agent/types.js.map +1 -1
- package/dist/components/core/solid-agent/types.ts +4 -2
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.d.ts +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.js +5 -2
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.tsx +11 -5
- package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.js +19 -0
- package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.tsx +20 -0
- package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js +3 -0
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx +4 -0
- package/dist/components/core/solid-agent/widgets/solidChatWidgets.module.css +9 -1
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +23 -8
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +10 -6
- package/dist/components/layout/AdminTopHeader.js +2 -2
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +2 -2
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +21 -5
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/AppSidebar.tsx +24 -6
- package/dist/components/layout/SolidAiStudioLayout.d.ts.map +1 -1
- package/dist/components/layout/SolidAiStudioLayout.js +3 -4
- package/dist/components/layout/SolidAiStudioLayout.js.map +1 -1
- package/dist/components/layout/SolidAiStudioLayout.tsx +3 -4
- package/dist/components/layout/user-profile-menu.js +10 -10
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.tsx +3 -3
- package/dist/components/shad-cn-ui/SolidLightbox.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidLightbox.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidLightbox.js +11 -4
- package/dist/components/shad-cn-ui/SolidLightbox.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidLightbox.tsx +14 -1
- package/dist/helpers/modelViewPersistence.d.ts +2 -0
- package/dist/helpers/modelViewPersistence.d.ts.map +1 -1
- package/dist/helpers/modelViewPersistence.js +72 -0
- package/dist/helpers/modelViewPersistence.js.map +1 -1
- package/dist/helpers/modelViewPersistence.ts +79 -0
- package/dist/helpers/registry.d.ts +6 -2
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +68 -3
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +62 -4
- package/dist/hooks/useModelsDevModels.d.ts +43 -0
- package/dist/hooks/useModelsDevModels.d.ts.map +1 -0
- package/dist/hooks/useModelsDevModels.js +81 -0
- package/dist/hooks/useModelsDevModels.js.map +1 -0
- package/dist/hooks/useModelsDevModels.ts +106 -0
- package/dist/hooks/useRouter.d.ts.map +1 -1
- package/dist/hooks/useRouter.js +3 -2
- package/dist/hooks/useRouter.js.map +1 -1
- package/dist/hooks/useRouter.ts +3 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.ts +4 -1
- package/dist/modules/solidUiModule.d.ts +3 -2
- package/dist/modules/solidUiModule.d.ts.map +1 -1
- package/dist/modules/solidUiModule.js +1 -1
- package/dist/modules/solidUiModule.js.map +1 -1
- package/dist/modules/solidUiModule.ts +5 -1
- package/dist/redux/api/moduleApi.d.ts +12 -2
- package/dist/redux/api/moduleApi.d.ts.map +1 -1
- package/dist/redux/api/moduleApi.js +33 -3
- package/dist/redux/api/moduleApi.js.map +1 -1
- package/dist/redux/api/moduleApi.ts +17 -2
- package/dist/redux/api/solidChatterMessageApi.d.ts +3 -1
- package/dist/redux/api/solidChatterMessageApi.d.ts.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.js +9 -1
- package/dist/redux/api/solidChatterMessageApi.js.map +1 -1
- package/dist/redux/api/solidChatterMessageApi.ts +9 -1
- package/dist/redux/store/defaultStoreConfig.d.ts +9 -1
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/resources/globals.css +30 -0
- package/dist/resources/solid-custom.css +10 -6
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/AppEventListener.js +1 -1
- package/dist/routes/AppEventListener.js.map +1 -1
- package/dist/routes/AppEventListener.tsx +1 -1
- package/dist/routes/pages/admin/core/AgentPersonaHistory.css +130 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.d.ts +7 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.js +228 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.js.map +1 -0
- package/dist/routes/pages/admin/core/AgentPersonaHistory.tsx +234 -0
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +6 -14
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +186 -146
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +170 -118
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.d.ts +2 -0
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js +108 -0
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js.map +1 -0
- package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.tsx +96 -0
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +2 -0
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +2 -0
- package/dist/types/extension-registry.d.ts +12 -0
- package/dist/types/extension-registry.d.ts.map +1 -1
- package/dist/types/extension-registry.js.map +1 -1
- package/dist/types/extension-registry.ts +15 -0
- package/dist/types/solid-core.d.ts +2 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidChecklistChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidChecklistChatWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK/D;;;GAGG;AACH,MAAM,CAAC,IAAM,wBAA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AK,IAAI,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,YAAG,IAAI,CAAC,KAAK,GAAO,EAClE,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,YAC1B,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,CACjB,iBAAqB,SAAS,EAAE,MAAM,CAAC,QAAQ,aAC3C,gBAAO,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAM,OAAA,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAf,CAAe,GAAI,EAC3G,2BACK,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,WAAW,IAAI,eAAM,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAG,IAAI,CAAC,WAAW,GAAQ,IACzH,KALC,IAAI,CAAC,EAAE,CAMX,CACX,EARoB,CAQpB,CAAC,GACA,EACL,CAAC,MAAM,IAAI,CACR,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,YAC3B,iBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,UAAG,MAAM,CAAC,GAAG,cAAI,MAAM,CAAC,UAAU,CAAE,EAC/C,OAAO,EAAE;wBACL,OAAO,CAAC,IAAI,CAAC,CAAC;wBACd,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;oBAC/B,CAAC,YAEA,MAAA,IAAI,CAAC,WAAW,mCAAI,UAAU,GAC1B,GACP,CACT,IACC,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useState } from \"react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype ChecklistItem = { id?: string; label: string; checked?: boolean; description?: string };\ntype ChecklistData = { title?: string; items?: ChecklistItem[]; submitLabel?: string };\n\n/**\n * `event_data: { widget: \"checklist\", title?, items: [{ id, label, checked?, description? }], submitLabel? }`.\n * Replies with the ids of the ticked items.\n */\nexport const SolidChecklistChatWidget = ({ eventData, final, reply }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<ChecklistData>(eventData);\n const items = asArray<ChecklistItem>(data.items).map((item, index) => ({ ...item, id: item.id ?? String(index) }));\n const [checked, setChecked] = useState<Set<string>>(() => new Set(items.filter((item) => item.checked).map((item) => item.id)));\n const [sent, setSent] = useState(false);\n const locked = final || sent;\n\n const toggle = (id: string) =>\n setChecked((prev) => {\n const next = new Set(prev);\n next.has(id) ? next.delete(id) : next.add(id);\n return next;\n });\n\n return (\n <div className={styles.card}>\n {data.title && <div className={styles.cardHead}>{data.title}</div>}\n <div className={styles.cardBody}>\n {items.map((item) => (\n <label key={item.id} className={styles.checkRow}>\n <input type=\"checkbox\" checked={checked.has(item.id)} disabled={locked} onChange={() => toggle(item.id)} />\n <span>\n {item.label}\n {item.description && <span style={{ display: \"block\", fontSize: 12, color: \"var(--agent-muted)\" }}>{item.description}</span>}\n </span>\n </label>\n ))}\n </div>\n {!locked && (\n <div className={styles.cardFoot}>\n <button\n type=\"button\"\n className={`${styles.btn} ${styles.btnPrimary}`}\n onClick={() => {\n setSent(true);\n reply(Array.from(checked));\n }}\n >\n {data.submitLabel ?? \"Continue\"}\n </button>\n </div>\n )}\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidChecklistChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidChecklistChatWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC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E,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,qDAAqD,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE;KACla,CAAC,EAFoE,CAEpE,EAAE,CAAC,CAAC","sourcesContent":["import { useState } from \"react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype ChecklistItem = { id?: string; label: string; checked?: boolean; description?: string };\ntype ChecklistData = { title?: string; items?: ChecklistItem[]; submitLabel?: string };\n\n/**\n * `event_data: { widget: \"checklist\", title?, items: [{ id, label, checked?, description? }], submitLabel? }`.\n * Replies with the ids of the ticked items.\n */\nexport const SolidChecklistChatWidget = ({ eventData, final, reply }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<ChecklistData>(eventData);\n const items = asArray<ChecklistItem>(data.items).map((item, index) => ({ ...item, id: item.id ?? String(index) }));\n const [checked, setChecked] = useState<Set<string>>(() => new Set(items.filter((item) => item.checked).map((item) => item.id)));\n const [sent, setSent] = useState(false);\n const locked = final || sent;\n\n const toggle = (id: string) =>\n setChecked((prev) => {\n const next = new Set(prev);\n next.has(id) ? next.delete(id) : next.add(id);\n return next;\n });\n\n return (\n <div className={styles.card}>\n {data.title && <div className={styles.cardHead}>{data.title}</div>}\n <div className={styles.cardBody}>\n {items.map((item) => (\n <label key={item.id} className={styles.checkRow}>\n <input type=\"checkbox\" checked={checked.has(item.id)} disabled={locked} onChange={() => toggle(item.id)} />\n <span>\n {item.label}\n {item.description && <span style={{ display: \"block\", fontSize: 12, color: \"var(--agent-muted)\" }}>{item.description}</span>}\n </span>\n </label>\n ))}\n </div>\n {!locked && (\n <div className={styles.cardFoot}>\n <button\n type=\"button\"\n className={`${styles.btn} ${styles.btnPrimary}`}\n onClick={() => {\n setSent(true);\n reply(Array.from(checked));\n }}\n >\n {data.submitLabel ?? \"Continue\"}\n </button>\n </div>\n )}\n </div>\n );\n};\n\nObject.assign(SolidChecklistChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"checklist\", description: \"Present several items the user can tick or confirm.\", propsSchema: { type: \"object\", properties: { title: { type: \"string\" }, items: { type: \"array\", items: { type: \"object\", properties: { id: { type: \"string\" }, label: { type: \"string\" }, checked: { type: \"boolean\" }, description: { type: \"string\" } }, required: [\"label\"] } }, submitLabel: { type: \"string\" } } } },\n}) });\n"]}
|
|
@@ -55,3 +55,7 @@ export const SolidChecklistChatWidget = ({ eventData, final, reply }: SolidChatW
|
|
|
55
55
|
</div>
|
|
56
56
|
);
|
|
57
57
|
};
|
|
58
|
+
|
|
59
|
+
Object.assign(SolidChecklistChatWidget, { getExtensionMetadata: () => ({
|
|
60
|
+
agentWidget: { name: "checklist", description: "Present several items the user can tick or confirm.", propsSchema: { type: "object", properties: { title: { type: "string" }, items: { type: "array", items: { type: "object", properties: { id: { type: "string" }, label: { type: "string" }, checked: { type: "boolean" }, description: { type: "string" } }, required: ["label"] } }, submitLabel: { type: "string" } } } },
|
|
61
|
+
}) });
|
|
@@ -10,4 +10,7 @@ export var SolidCodeChatWidget = function (_a) {
|
|
|
10
10
|
var code = String((_b = data.code) !== null && _b !== void 0 ? _b : "");
|
|
11
11
|
return (_jsxs("div", { className: styles.card, children: [_jsxs("div", { className: styles.cardHead, children: [_jsx("span", { className: styles.mono, style: { flex: 1 }, children: (_d = (_c = data.filename) !== null && _c !== void 0 ? _c : data.language) !== null && _d !== void 0 ? _d : "code" }), _jsx(SolidAgentCopyButton, { text: code, label: "Copy code" })] }), _jsx("pre", { className: styles.pre, style: { borderRadius: 0 }, children: code })] }));
|
|
12
12
|
};
|
|
13
|
+
Object.assign(SolidCodeChatWidget, { getExtensionMetadata: function () { return ({
|
|
14
|
+
agentWidget: { name: "code", description: "Show a syntax highlighted code file or snippet.", propsSchema: { type: "object", properties: { code: { type: "string" }, language: { type: "string" }, filename: { type: "string" } }, required: ["code"] } },
|
|
15
|
+
}); } });
|
|
13
16
|
//# sourceMappingURL=SolidCodeChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidCodeChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidCodeChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,6FAA6F;AAC7F,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,EAAmC;;QAAjC,SAAS,eAAA;IAC3C,IAAM,IAAI,GAAG,iBAAiB,CAA0D,SAAS,CAAC,CAAC;IACnG,IAAM,IAAI,GAAG,MAAM,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC;IACrC,OAAO,CACH,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACvB,eAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,aAC3B,eAAM,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAAG,MAAA,MAAA,IAAI,CAAC,QAAQ,mCAAI,IAAI,CAAC,QAAQ,mCAAI,MAAM,GAAQ,EACnG,KAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,WAAW,GAAG,IACpD,EACN,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,YAAG,IAAI,GAAO,IAClE,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { SolidAgentCopyButton } from \"../SolidAgentMarkdown\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\n/** `event_data: { widget: \"code\", code, language?, filename? }` — a code block with copy. */\nexport const SolidCodeChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ code?: string; language?: string; filename?: string }>(eventData);\n const code = String(data.code ?? \"\");\n return (\n <div className={styles.card}>\n <div className={styles.cardHead}>\n <span className={styles.mono} style={{ flex: 1 }}>{data.filename ?? data.language ?? \"code\"}</span>\n <SolidAgentCopyButton text={code} label=\"Copy code\" />\n </div>\n <pre className={styles.pre} style={{ borderRadius: 0 }}>{code}</pre>\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidCodeChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidCodeChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,6FAA6F;AAC7F,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,EAAmC;;QAAjC,SAAS,eAAA;IAC3C,IAAM,IAAI,GAAG,iBAAiB,CAA0D,SAAS,CAAC,CAAC;IACnG,IAAM,IAAI,GAAG,MAAM,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC;IACrC,OAAO,CACH,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACvB,eAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,aAC3B,eAAM,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAAG,MAAA,MAAA,IAAI,CAAC,QAAQ,mCAAI,IAAI,CAAC,QAAQ,mCAAI,MAAM,GAAQ,EACnG,KAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,WAAW,GAAG,IACpD,EACN,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,YAAG,IAAI,GAAO,IAClE,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,oBAAoB,EAAE,cAAM,OAAA,CAAC;QAC9D,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,iDAAiD,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;KAC3P,CAAC,EAF+D,CAE/D,EAAE,CAAC,CAAC","sourcesContent":["import styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { SolidAgentCopyButton } from \"../SolidAgentMarkdown\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\n/** `event_data: { widget: \"code\", code, language?, filename? }` — a code block with copy. */\nexport const SolidCodeChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ code?: string; language?: string; filename?: string }>(eventData);\n const code = String(data.code ?? \"\");\n return (\n <div className={styles.card}>\n <div className={styles.cardHead}>\n <span className={styles.mono} style={{ flex: 1 }}>{data.filename ?? data.language ?? \"code\"}</span>\n <SolidAgentCopyButton text={code} label=\"Copy code\" />\n </div>\n <pre className={styles.pre} style={{ borderRadius: 0 }}>{code}</pre>\n </div>\n );\n};\n\nObject.assign(SolidCodeChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"code\", description: \"Show a syntax highlighted code file or snippet.\", propsSchema: { type: \"object\", properties: { code: { type: \"string\" }, language: { type: \"string\" }, filename: { type: \"string\" } }, required: [\"code\"] } },\n}) });\n"]}
|
|
@@ -17,3 +17,7 @@ export const SolidCodeChatWidget = ({ eventData }: SolidChatWidgetProps) => {
|
|
|
17
17
|
</div>
|
|
18
18
|
);
|
|
19
19
|
};
|
|
20
|
+
|
|
21
|
+
Object.assign(SolidCodeChatWidget, { getExtensionMetadata: () => ({
|
|
22
|
+
agentWidget: { name: "code", description: "Show a syntax highlighted code file or snippet.", propsSchema: { type: "object", properties: { code: { type: "string" }, language: { type: "string" }, filename: { type: "string" } }, required: ["code"] } },
|
|
23
|
+
}) });
|
|
@@ -52,4 +52,7 @@ export var SolidDiffListChatWidget = function (_a) {
|
|
|
52
52
|
return (_jsxs("div", { children: [_jsxs("button", { type: "button", className: styles.fileRow, "aria-expanded": expanded, onClick: function () { return toggle(index); }, children: [expanded ? _jsx(ChevronDown, { size: 14 }) : _jsx(ChevronRight, { size: 14 }), _jsx("span", { className: styles.fileName, children: file.path }), _jsxs("span", { className: styles.diffAdd, children: ["+", counts.additions] }), _jsxs("span", { className: styles.diffDel, children: ["\u2212", counts.deletions] })] }), expanded && (_jsxs("div", { style: { position: "relative" }, children: [_jsx("div", { style: { position: "absolute", right: 6, top: 4 }, children: _jsx(SolidAgentCopyButton, { text: (_c = file.diff) !== null && _c !== void 0 ? _c : "", label: "Copy ".concat(file.path) }) }), _jsx("pre", { className: styles.diff, children: ((_d = file.diff) !== null && _d !== void 0 ? _d : "").split("\n").map(function (line, i) { return (_jsx("span", { className: "".concat(styles.diffLine, " ").concat(diffLineClass(line)), children: line || " " }, i)); }) })] }))] }, "".concat(file.path, "-").concat(index)));
|
|
53
53
|
})] }));
|
|
54
54
|
};
|
|
55
|
+
Object.assign(SolidDiffListChatWidget, { getExtensionMetadata: function () { return ({
|
|
56
|
+
agentWidget: { name: "diff-list", description: "Show file diffs, collapsible by file.", propsSchema: { type: "object", properties: { title: { type: "string" }, files: { type: "array", items: { type: "object", properties: { path: { type: "string" }, diff: { type: "string" }, additions: { type: "number" }, deletions: { type: "number" } }, required: ["path"] } } } } },
|
|
57
|
+
}); } });
|
|
55
58
|
//# sourceMappingURL=SolidDiffListChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidDiffListChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidDiffListChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK/D,SAAS,YAAY,CAAC,IAAS;IAAT,qBAAA,EAAA,SAAS;IAC3B,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI;QAC1B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC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,IAAI,EAAE,EAAE,GAAI,CAAC,CAAC,CAAC,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,EAClE,eAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,YAAG,IAAI,CAAC,IAAI,GAAQ,EACpD,gBAAM,SAAS,EAAE,MAAM,CAAC,OAAO,kBAAI,MAAM,CAAC,SAAS,IAAQ,EAC3D,gBAAM,SAAS,EAAE,MAAM,CAAC,OAAO,uBAAI,MAAM,CAAC,SAAS,IAAQ,IACtD,EACR,QAAQ,IAAI,CACT,eAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,aAChC,cAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,YAClD,KAAC,oBAAoB,IAAC,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,EAAE,KAAK,EAAE,eAAQ,IAAI,CAAC,IAAI,CAAE,GAAI,GACzE,EACN,cAAK,SAAS,EAAE,MAAM,CAAC,IAAI,YACtB,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,CAAC,IAAK,OAAA,CAC5C,eAAc,SAAS,EAAE,UAAG,MAAM,CAAC,QAAQ,cAAI,aAAa,CAAC,IAAI,CAAC,CAAE,YAAG,IAAI,IAAI,GAAG,IAAvE,CAAC,CAA8E,CAC7F,EAF+C,CAE/C,CAAC,GACA,IACJ,CACT,KAlBK,UAAG,IAAI,CAAC,IAAI,cAAI,KAAK,CAAE,CAmB3B,CACT,CAAC;YACN,CAAC,CAAC,IACA,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useState } from \"react\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { SolidAgentCopyButton } from \"../SolidAgentMarkdown\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype DiffFile = { path: string; diff?: string; additions?: number; deletions?: number };\ntype DiffListData = { title?: string; files?: DiffFile[] };\n\nfunction countChanges(diff = \"\") {\n let additions = 0;\n let deletions = 0;\n diff.split(\"\\n\").forEach((line) => {\n if (line.startsWith(\"+\") && !line.startsWith(\"+++\")) additions++;\n else if (line.startsWith(\"-\") && !line.startsWith(\"---\")) deletions++;\n });\n return { additions, deletions };\n}\n\nfunction diffLineClass(line: string) {\n if (line.startsWith(\"@@\")) return styles.diffLineHunk;\n if (line.startsWith(\"+\")) return styles.diffLineAdd;\n if (line.startsWith(\"-\")) return styles.diffLineDel;\n return \"\";\n}\n\n/**\n * `event_data: { widget: \"diff-list\", title?, files: [{ path, diff, additions?, deletions? }] }`.\n * Codex-style file list, collapsed by default, with copy per file and for all files.\n */\nexport const SolidDiffListChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<DiffListData>(eventData);\n const files = asArray<DiffFile>(data.files);\n const [open, setOpen] = useState<Set<number>>(new Set());\n const allDiffs = files.map((file) => `--- ${file.path}\\n${file.diff ?? \"\"}`).join(\"\\n\\n\");\n\n const toggle = (index: number) =>\n setOpen((prev) => {\n const next = new Set(prev);\n next.has(index) ? next.delete(index) : next.add(index);\n return next;\n });\n\n return (\n <div className={styles.card}>\n <div className={styles.cardHead}>\n <span style={{ flex: 1 }}>{data.title ?? `${files.length} file${files.length === 1 ? \"\" : \"s\"} changed`}</span>\n <SolidAgentCopyButton text={allDiffs} label=\"Copy all diffs\" />\n </div>\n {files.map((file, index) => {\n const counts = file.additions != null || file.deletions != null\n ? { additions: file.additions ?? 0, deletions: file.deletions ?? 0 }\n : countChanges(file.diff);\n const expanded = open.has(index);\n return (\n <div key={`${file.path}-${index}`}>\n <button type=\"button\" className={styles.fileRow} aria-expanded={expanded} onClick={() => toggle(index)}>\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n <span className={styles.fileName}>{file.path}</span>\n <span className={styles.diffAdd}>+{counts.additions}</span>\n <span className={styles.diffDel}>−{counts.deletions}</span>\n </button>\n {expanded && (\n <div style={{ position: \"relative\" }}>\n <div style={{ position: \"absolute\", right: 6, top: 4 }}>\n <SolidAgentCopyButton text={file.diff ?? \"\"} label={`Copy ${file.path}`} />\n </div>\n <pre className={styles.diff}>\n {(file.diff ?? \"\").split(\"\\n\").map((line, i) => (\n <span key={i} className={`${styles.diffLine} ${diffLineClass(line)}`}>{line || \" \"}</span>\n ))}\n </pre>\n </div>\n )}\n </div>\n );\n })}\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidDiffListChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidDiffListChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK/D,SAAS,YAAY,CAAC,IAAS;IAAT,qBAAA,EAAA,SAAS;IAC3B,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI;QAC1B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;YAAE,SAAS,EAAE,CAAC;aAC5D,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;YAAE,S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AAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;KAClX,CAAC,EAFmE,CAEnE,EAAE,CAAC,CAAC","sourcesContent":["import { useState } from \"react\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { SolidAgentCopyButton } from \"../SolidAgentMarkdown\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype DiffFile = { path: string; diff?: string; additions?: number; deletions?: number };\ntype DiffListData = { title?: string; files?: DiffFile[] };\n\nfunction countChanges(diff = \"\") {\n let additions = 0;\n let deletions = 0;\n diff.split(\"\\n\").forEach((line) => {\n if (line.startsWith(\"+\") && !line.startsWith(\"+++\")) additions++;\n else if (line.startsWith(\"-\") && !line.startsWith(\"---\")) deletions++;\n });\n return { additions, deletions };\n}\n\nfunction diffLineClass(line: string) {\n if (line.startsWith(\"@@\")) return styles.diffLineHunk;\n if (line.startsWith(\"+\")) return styles.diffLineAdd;\n if (line.startsWith(\"-\")) return styles.diffLineDel;\n return \"\";\n}\n\n/**\n * `event_data: { widget: \"diff-list\", title?, files: [{ path, diff, additions?, deletions? }] }`.\n * Codex-style file list, collapsed by default, with copy per file and for all files.\n */\nexport const SolidDiffListChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<DiffListData>(eventData);\n const files = asArray<DiffFile>(data.files);\n const [open, setOpen] = useState<Set<number>>(new Set());\n const allDiffs = files.map((file) => `--- ${file.path}\\n${file.diff ?? \"\"}`).join(\"\\n\\n\");\n\n const toggle = (index: number) =>\n setOpen((prev) => {\n const next = new Set(prev);\n next.has(index) ? next.delete(index) : next.add(index);\n return next;\n });\n\n return (\n <div className={styles.card}>\n <div className={styles.cardHead}>\n <span style={{ flex: 1 }}>{data.title ?? `${files.length} file${files.length === 1 ? \"\" : \"s\"} changed`}</span>\n <SolidAgentCopyButton text={allDiffs} label=\"Copy all diffs\" />\n </div>\n {files.map((file, index) => {\n const counts = file.additions != null || file.deletions != null\n ? { additions: file.additions ?? 0, deletions: file.deletions ?? 0 }\n : countChanges(file.diff);\n const expanded = open.has(index);\n return (\n <div key={`${file.path}-${index}`}>\n <button type=\"button\" className={styles.fileRow} aria-expanded={expanded} onClick={() => toggle(index)}>\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n <span className={styles.fileName}>{file.path}</span>\n <span className={styles.diffAdd}>+{counts.additions}</span>\n <span className={styles.diffDel}>−{counts.deletions}</span>\n </button>\n {expanded && (\n <div style={{ position: \"relative\" }}>\n <div style={{ position: \"absolute\", right: 6, top: 4 }}>\n <SolidAgentCopyButton text={file.diff ?? \"\"} label={`Copy ${file.path}`} />\n </div>\n <pre className={styles.diff}>\n {(file.diff ?? \"\").split(\"\\n\").map((line, i) => (\n <span key={i} className={`${styles.diffLine} ${diffLineClass(line)}`}>{line || \" \"}</span>\n ))}\n </pre>\n </div>\n )}\n </div>\n );\n })}\n </div>\n );\n};\n\nObject.assign(SolidDiffListChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"diff-list\", description: \"Show file diffs, collapsible by file.\", propsSchema: { type: \"object\", properties: { title: { type: \"string\" }, files: { type: \"array\", items: { type: \"object\", properties: { path: { type: \"string\" }, diff: { type: \"string\" }, additions: { type: \"number\" }, deletions: { type: \"number\" } }, required: [\"path\"] } } } } },\n}) });\n"]}
|
|
@@ -79,3 +79,7 @@ export const SolidDiffListChatWidget = ({ eventData }: SolidChatWidgetProps) =>
|
|
|
79
79
|
</div>
|
|
80
80
|
);
|
|
81
81
|
};
|
|
82
|
+
|
|
83
|
+
Object.assign(SolidDiffListChatWidget, { getExtensionMetadata: () => ({
|
|
84
|
+
agentWidget: { name: "diff-list", description: "Show file diffs, collapsible by file.", propsSchema: { type: "object", properties: { title: { type: "string" }, files: { type: "array", items: { type: "object", properties: { path: { type: "string" }, diff: { type: "string" }, additions: { type: "number" }, deletions: { type: "number" } }, required: ["path"] } } } } },
|
|
85
|
+
}) });
|
|
@@ -12,4 +12,23 @@ export var SolidGalleryChatWidget = function (_a) {
|
|
|
12
12
|
var _b = useState(null), zoom = _b[0], setZoom = _b[1];
|
|
13
13
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.gallery, children: images.map(function (image, index) { return (_jsx("img", { src: image.src, alt: image.alt, onClick: function () { return setZoom(image.src); } }, index)); }) }), zoom && (_jsx("div", { className: styles.lightbox, role: "dialog", "aria-label": "Image preview", onClick: function () { return setZoom(null); }, children: _jsx("img", { src: zoom, alt: "" }) }))] }));
|
|
14
14
|
};
|
|
15
|
+
Object.assign(SolidGalleryChatWidget, { getExtensionMetadata: function () { return ({
|
|
16
|
+
agentWidget: {
|
|
17
|
+
name: "gallery",
|
|
18
|
+
description: "Show a grid of images with captions.",
|
|
19
|
+
propsSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
images: {
|
|
23
|
+
type: "array",
|
|
24
|
+
items: { anyOf: [
|
|
25
|
+
{ type: "string" },
|
|
26
|
+
{ type: "object", properties: { src: { type: "string" }, alt: { type: "string" } }, required: ["src"] },
|
|
27
|
+
] },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
required: ["images"],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}); } });
|
|
15
34
|
//# sourceMappingURL=SolidGalleryChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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lB,CAAkB,IAAxE,KAAK,CAAuE,CACzF,EAF6B,CAE7B,CAAC,GACA,EACL,IAAI,IAAI,CACL,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAC,QAAQ,gBAAY,eAAe,EAAC,OAAO,EAAE,cAAM,OAAA,OAAO,CAAC,IAAI,CAAC,EAAb,CAAa,YAClG,cAAK,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,EAAE,GAAG,GACvB,CACT,IACF,CACN,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useState } from \"react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype GalleryImage = string | { src: string; alt?: string };\n\n/** `event_data: { widget: \"gallery\", images: [src | { src, alt }] }` — image grid with a lightbox. */\nexport const SolidGalleryChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ images?: GalleryImage[] }>(eventData);\n const images = asArray<GalleryImage>(data.images)\n .map((image) => (typeof image === \"string\" ? { src: image, alt: \"\" } : { src: image.src, alt: image.alt ?? \"\" }))\n .filter((image) => /^(https?:|data:image\\/|\\/)/i.test(image.src));\n const [zoom, setZoom] = useState<string | null>(null);\n\n return (\n <>\n <div className={styles.gallery}>\n {images.map((image, index) => (\n <img key={index} src={image.src} alt={image.alt} onClick={() => setZoom(image.src)} />\n ))}\n </div>\n {zoom && (\n <div className={styles.lightbox} role=\"dialog\" aria-label=\"Image preview\" onClick={() => setZoom(null)}>\n <img src={zoom} alt=\"\" />\n </div>\n )}\n </>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidGalleryChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidGalleryChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,0BAA0B,CAA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AAA,OAAO,CAAC,IAAI,CAAC,EAAb,CAAa,YAClG,cAAK,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,EAAE,GAAG,GACvB,CACT,IACF,CACN,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,EAAE,oBAAoB,EAAE,cAAM,OAAA,CAAC;QACjE,WAAW,EAAE;YACT,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,sCAAsC;YACnD,WAAW,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,MAAM,EAAE;wBACJ,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,EAAE,KAAK,EAAE;gCACZ,EAAE,IAAI,EAAE,QAAQ,EAAE;gCAClB,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE;6BAC1G,EAAE;qBACN;iBACJ;gBACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;aACvB;SACJ;KACJ,CAAC,EAlBkE,CAkBlE,EAAE,CAAC,CAAC","sourcesContent":["import { useState } from \"react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype GalleryImage = string | { src: string; alt?: string };\n\n/** `event_data: { widget: \"gallery\", images: [src | { src, alt }] }` — image grid with a lightbox. */\nexport const SolidGalleryChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ images?: GalleryImage[] }>(eventData);\n const images = asArray<GalleryImage>(data.images)\n .map((image) => (typeof image === \"string\" ? { src: image, alt: \"\" } : { src: image.src, alt: image.alt ?? \"\" }))\n .filter((image) => /^(https?:|data:image\\/|\\/)/i.test(image.src));\n const [zoom, setZoom] = useState<string | null>(null);\n\n return (\n <>\n <div className={styles.gallery}>\n {images.map((image, index) => (\n <img key={index} src={image.src} alt={image.alt} onClick={() => setZoom(image.src)} />\n ))}\n </div>\n {zoom && (\n <div className={styles.lightbox} role=\"dialog\" aria-label=\"Image preview\" onClick={() => setZoom(null)}>\n <img src={zoom} alt=\"\" />\n </div>\n )}\n </>\n );\n};\n\nObject.assign(SolidGalleryChatWidget, { getExtensionMetadata: () => ({\n agentWidget: {\n name: \"gallery\",\n description: \"Show a grid of images with captions.\",\n propsSchema: {\n type: \"object\",\n properties: {\n images: {\n type: \"array\",\n items: { anyOf: [\n { type: \"string\" },\n { type: \"object\", properties: { src: { type: \"string\" }, alt: { type: \"string\" } }, required: [\"src\"] },\n ] },\n },\n },\n required: [\"images\"],\n },\n },\n}) });\n"]}
|
|
@@ -28,3 +28,23 @@ export const SolidGalleryChatWidget = ({ eventData }: SolidChatWidgetProps) => {
|
|
|
28
28
|
</>
|
|
29
29
|
);
|
|
30
30
|
};
|
|
31
|
+
|
|
32
|
+
Object.assign(SolidGalleryChatWidget, { getExtensionMetadata: () => ({
|
|
33
|
+
agentWidget: {
|
|
34
|
+
name: "gallery",
|
|
35
|
+
description: "Show a grid of images with captions.",
|
|
36
|
+
propsSchema: {
|
|
37
|
+
type: "object",
|
|
38
|
+
properties: {
|
|
39
|
+
images: {
|
|
40
|
+
type: "array",
|
|
41
|
+
items: { anyOf: [
|
|
42
|
+
{ type: "string" },
|
|
43
|
+
{ type: "object", properties: { src: { type: "string" }, alt: { type: "string" } }, required: ["src"] },
|
|
44
|
+
] },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
required: ["images"],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
}) });
|
|
@@ -12,4 +12,7 @@ export var SolidJsonChatWidget = function (_a) {
|
|
|
12
12
|
var text = useMemo(function () { var _a; return JSON.stringify((_a = data.data) !== null && _a !== void 0 ? _a : data, null, 2); }, [data]);
|
|
13
13
|
return (_jsxs("div", { className: styles.card, children: [_jsxs("button", { type: "button", className: styles.fileRow, "aria-expanded": open, onClick: function () { return setOpen(function (value) { return !value; }); }, children: [open ? _jsx(ChevronDown, { size: 14 }) : _jsx(ChevronRight, { size: 14 }), _jsx("span", { style: { flex: 1 }, children: (_b = data.title) !== null && _b !== void 0 ? _b : "JSON" })] }), open && _jsx("pre", { className: styles.pre, style: { borderRadius: 0, maxHeight: 320 }, children: text })] }));
|
|
14
14
|
};
|
|
15
|
+
Object.assign(SolidJsonChatWidget, { getExtensionMetadata: function () { return ({
|
|
16
|
+
agentWidget: { name: "json", description: "Show a raw JSON value in a collapsible, copyable viewer.", propsSchema: { type: "object", properties: { title: { type: "string" }, data: {} }, required: ["data"] } },
|
|
17
|
+
}); } });
|
|
15
18
|
//# sourceMappingURL=SolidJsonChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidJsonChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidJsonChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,gFAAgF;AAChF,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,EAAmC;;QAAjC,SAAS,eAAA;IAC3C,IAAM,IAAI,GAAG,iBAAiB,CAAqC,SAAS,CAAC,CAAC;IACxE,IAAA,KAAkB,QAAQ,CAAC,KAAK,CAAC,EAAhC,IAAI,QAAA,EAAE,OAAO,QAAmB,CAAC;IACxC,IAAM,IAAI,GAAG,OAAO,CAAC,sBAAM,OAAA,IAAI,CAAC,SAAS,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA,EAAA,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/E,OAAO,CACH,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACvB,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,OAAO,mBAAiB,IAAI,EAAE,OAAO,EAAE,cAAM,OAAA,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,EAAN,CAAM,CAAC,EAA1B,CAA0B,aAC1G,IAAI,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,IAAI,EAAE,EAAE,GAAI,CAAC,CAAC,CAAC,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,EAC9D,eAAM,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAAG,MAAA,IAAI,CAAC,KAAK,mCAAI,MAAM,GAAQ,IAClD,EACR,IAAI,IAAI,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,YAAG,IAAI,GAAO,IAC3F,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useMemo, useState } from \"react\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\n/** `event_data: { widget: \"json\", title?, data }` — collapsible JSON viewer. */\nexport const SolidJsonChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ title?: string; data?: unknown }>(eventData);\n const [open, setOpen] = useState(false);\n const text = useMemo(() => JSON.stringify(data.data ?? data, null, 2), [data]);\n return (\n <div className={styles.card}>\n <button type=\"button\" className={styles.fileRow} aria-expanded={open} onClick={() => setOpen((value) => !value)}>\n {open ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n <span style={{ flex: 1 }}>{data.title ?? \"JSON\"}</span>\n </button>\n {open && <pre className={styles.pre} style={{ borderRadius: 0, maxHeight: 320 }}>{text}</pre>}\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidJsonChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidJsonChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,gFAAgF;AAChF,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,EAAmC;;QAAjC,SAAS,eAAA;IAC3C,IAAM,IAAI,GAAG,iBAAiB,CAAqC,SAAS,CAAC,CAAC;IACxE,IAAA,KAAkB,QAAQ,CAAC,KAAK,CAAC,EAAhC,IAAI,QAAA,EAAE,OAAO,QAAmB,CAAC;IACxC,IAAM,IAAI,GAAG,OAAO,CAAC,sBAAM,OAAA,IAAI,CAAC,SAAS,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA,EAAA,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/E,OAAO,CACH,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACvB,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,OAAO,mBAAiB,IAAI,EAAE,OAAO,EAAE,cAAM,OAAA,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,EAAN,CAAM,CAAC,EAA1B,CAA0B,aAC1G,IAAI,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,IAAI,EAAE,EAAE,GAAI,CAAC,CAAC,CAAC,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,EAC9D,eAAM,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAAG,MAAA,IAAI,CAAC,KAAK,mCAAI,MAAM,GAAQ,IAClD,EACR,IAAI,IAAI,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,YAAG,IAAI,GAAO,IAC3F,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,oBAAoB,EAAE,cAAM,OAAA,CAAC;QAC9D,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0DAA0D,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;KACnN,CAAC,EAF+D,CAE/D,EAAE,CAAC,CAAC","sourcesContent":["import { useMemo, useState } from \"react\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\n/** `event_data: { widget: \"json\", title?, data }` — collapsible JSON viewer. */\nexport const SolidJsonChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ title?: string; data?: unknown }>(eventData);\n const [open, setOpen] = useState(false);\n const text = useMemo(() => JSON.stringify(data.data ?? data, null, 2), [data]);\n return (\n <div className={styles.card}>\n <button type=\"button\" className={styles.fileRow} aria-expanded={open} onClick={() => setOpen((value) => !value)}>\n {open ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n <span style={{ flex: 1 }}>{data.title ?? \"JSON\"}</span>\n </button>\n {open && <pre className={styles.pre} style={{ borderRadius: 0, maxHeight: 320 }}>{text}</pre>}\n </div>\n );\n};\n\nObject.assign(SolidJsonChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"json\", description: \"Show a raw JSON value in a collapsible, copyable viewer.\", propsSchema: { type: \"object\", properties: { title: { type: \"string\" }, data: {} }, required: [\"data\"] } },\n}) });\n"]}
|
|
@@ -19,3 +19,7 @@ export const SolidJsonChatWidget = ({ eventData }: SolidChatWidgetProps) => {
|
|
|
19
19
|
</div>
|
|
20
20
|
);
|
|
21
21
|
};
|
|
22
|
+
|
|
23
|
+
Object.assign(SolidJsonChatWidget, { getExtensionMetadata: () => ({
|
|
24
|
+
agentWidget: { name: "json", description: "Show a raw JSON value in a collapsible, copyable viewer.", propsSchema: { type: "object", properties: { title: { type: "string" }, data: {} }, required: ["data"] } },
|
|
25
|
+
}) });
|
|
@@ -18,4 +18,7 @@ export var SolidLinkCardChatWidget = function (_a) {
|
|
|
18
18
|
return null;
|
|
19
19
|
return (_jsxs("button", { type: "button", className: styles.linkCard, onClick: function () { return (external ? window.open(external, "_blank", "noopener,noreferrer") : navigate(route)); }, children: [_jsxs("span", { style: { flex: 1, display: "flex", flexDirection: "column", gap: 2 }, children: [_jsx("strong", { children: (_c = (_b = data.title) !== null && _b !== void 0 ? _b : route) !== null && _c !== void 0 ? _c : external }), data.subtitle && _jsx("span", { style: { fontSize: 12, color: "var(--agent-muted)" }, children: data.subtitle })] }), _jsx(ExternalLink, { size: 14 })] }));
|
|
20
20
|
};
|
|
21
|
+
Object.assign(SolidLinkCardChatWidget, { getExtensionMetadata: function () { return ({
|
|
22
|
+
agentWidget: { name: "link-card", description: "Show a link with a title and description.", propsSchema: { type: "object", properties: { title: { type: "string" }, subtitle: { type: "string" }, route: { type: "string" }, url: { type: "string" } } } },
|
|
23
|
+
}); } });
|
|
21
24
|
//# sourceMappingURL=SolidLinkCardChatWidget.js.map
|
|
@@ -1 +1 @@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EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aACtE,2BAAS,MAAA,MAAA,IAAI,CAAC,KAAK,mCAAI,KAAK,mCAAI,QAAQ,GAAU,EACjD,IAAI,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAG,IAAI,CAAC,QAAQ,GAAQ,IACjG,EACP,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,IACrB,CACZ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { ExternalLink } from \"lucide-react\";\nimport { useNavigate } from \"react-router-dom\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype LinkCardData = { title?: string; subtitle?: string; route?: string; url?: string };\n\n/**\n * `event_data: { widget: \"link-card\", title, subtitle?, route | url }`.\n * `route` (starting with \"/\") navigates inside the app; `url` (http/https) opens a new tab.\n */\nexport const SolidLinkCardChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const navigate = useNavigate();\n const data = getChatWidgetData<LinkCardData>(eventData);\n const external = data.url && /^https?:/i.test(data.url) ? data.url : null;\n const route = data.route && data.route.startsWith(\"/\") ? data.route : null;\n if (!external && !route) return null;\n\n return (\n <button\n type=\"button\"\n className={styles.linkCard}\n onClick={() => (external ? window.open(external, \"_blank\", \"noopener,noreferrer\") : navigate(route!))}\n >\n <span style={{ flex: 1, display: \"flex\", flexDirection: \"column\", gap: 2 }}>\n <strong>{data.title ?? route ?? external}</strong>\n {data.subtitle && <span style={{ fontSize: 12, color: \"var(--agent-muted)\" }}>{data.subtitle}</span>}\n </span>\n <ExternalLink size={14} />\n </button>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidLinkCardChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidLin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AAI,CAAC,KAAK,mCAAI,KAAK,mCAAI,QAAQ,GAAU,EACjD,IAAI,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAG,IAAI,CAAC,QAAQ,GAAQ,IACjG,EACP,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,IACrB,CACZ,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,EAAE,oBAAoB,EAAE,cAAM,OAAA,CAAC;QAClE,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,2CAA2C,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE;KAC7P,CAAC,EAFmE,CAEnE,EAAE,CAAC,CAAC","sourcesContent":["import { ExternalLink } from \"lucide-react\";\nimport { useNavigate } from \"react-router-dom\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype LinkCardData = { title?: string; subtitle?: string; route?: string; url?: string };\n\n/**\n * `event_data: { widget: \"link-card\", title, subtitle?, route | url }`.\n * `route` (starting with \"/\") navigates inside the app; `url` (http/https) opens a new tab.\n */\nexport const SolidLinkCardChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const navigate = useNavigate();\n const data = getChatWidgetData<LinkCardData>(eventData);\n const external = data.url && /^https?:/i.test(data.url) ? data.url : null;\n const route = data.route && data.route.startsWith(\"/\") ? data.route : null;\n if (!external && !route) return null;\n\n return (\n <button\n type=\"button\"\n className={styles.linkCard}\n onClick={() => (external ? window.open(external, \"_blank\", \"noopener,noreferrer\") : navigate(route!))}\n >\n <span style={{ flex: 1, display: \"flex\", flexDirection: \"column\", gap: 2 }}>\n <strong>{data.title ?? route ?? external}</strong>\n {data.subtitle && <span style={{ fontSize: 12, color: \"var(--agent-muted)\" }}>{data.subtitle}</span>}\n </span>\n <ExternalLink size={14} />\n </button>\n );\n};\n\nObject.assign(SolidLinkCardChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"link-card\", description: \"Show a link with a title and description.\", propsSchema: { type: \"object\", properties: { title: { type: \"string\" }, subtitle: { type: \"string\" }, route: { type: \"string\" }, url: { type: \"string\" } } } },\n}) });\n"]}
|
|
@@ -31,3 +31,7 @@ export const SolidLinkCardChatWidget = ({ eventData }: SolidChatWidgetProps) =>
|
|
|
31
31
|
</button>
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
Object.assign(SolidLinkCardChatWidget, { getExtensionMetadata: () => ({
|
|
36
|
+
agentWidget: { name: "link-card", description: "Show a link with a title and description.", propsSchema: { type: "object", properties: { title: { type: "string" }, subtitle: { type: "string" }, route: { type: "string" }, url: { type: "string" } } } },
|
|
37
|
+
}) });
|
|
@@ -8,4 +8,7 @@ export var SolidMarkdownChatWidget = function (_a) {
|
|
|
8
8
|
var data = getChatWidgetData(eventData);
|
|
9
9
|
return _jsx(SolidAgentMarkdown, { text: String((_c = (_b = data.text) !== null && _b !== void 0 ? _b : data.content) !== null && _c !== void 0 ? _c : "") });
|
|
10
10
|
};
|
|
11
|
+
Object.assign(SolidMarkdownChatWidget, { getExtensionMetadata: function () { return ({
|
|
12
|
+
agentWidget: { name: "markdown", description: "Rich formatted text for a self-contained note or report section.", propsSchema: { type: "object", properties: { text: { type: "string" } }, required: ["text"] } },
|
|
13
|
+
}); } });
|
|
11
14
|
//# sourceMappingURL=SolidMarkdownChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidMarkdownChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidMarkdownChatWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,mGAAmG;AACnG,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,EAAmC;;QAAjC,SAAS,eAAA;IAC/C,IAAM,IAAI,GAAG,iBAAiB,CAAsC,SAAS,CAAC,CAAC;IAC/E,OAAO,KAAC,kBAAkB,IAAC,IAAI,EAAE,MAAM,CAAC,MAAA,MAAA,IAAI,CAAC,IAAI,mCAAI,IAAI,CAAC,OAAO,mCAAI,EAAE,CAAC,GAAI,CAAC;AACjF,CAAC,CAAC","sourcesContent":["import { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { SolidAgentMarkdown } from \"../SolidAgentMarkdown\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\n/** `event_data: { widget: \"markdown\", text }` — formatted text (tables, lists, code with copy). */\nexport const SolidMarkdownChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ text?: string; content?: string }>(eventData);\n return <SolidAgentMarkdown text={String(data.text ?? data.content ?? \"\")} />;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidMarkdownChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidMarkdownChatWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,mGAAmG;AACnG,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,EAAmC;;QAAjC,SAAS,eAAA;IAC/C,IAAM,IAAI,GAAG,iBAAiB,CAAsC,SAAS,CAAC,CAAC;IAC/E,OAAO,KAAC,kBAAkB,IAAC,IAAI,EAAE,MAAM,CAAC,MAAA,MAAA,IAAI,CAAC,IAAI,mCAAI,IAAI,CAAC,OAAO,mCAAI,EAAE,CAAC,GAAI,CAAC;AACjF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,EAAE,oBAAoB,EAAE,cAAM,OAAA,CAAC;QAClE,WAAW,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,kEAAkE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;KACpN,CAAC,EAFmE,CAEnE,EAAE,CAAC,CAAC","sourcesContent":["import { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { SolidAgentMarkdown } from \"../SolidAgentMarkdown\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\n/** `event_data: { widget: \"markdown\", text }` — formatted text (tables, lists, code with copy). */\nexport const SolidMarkdownChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ text?: string; content?: string }>(eventData);\n return <SolidAgentMarkdown text={String(data.text ?? data.content ?? \"\")} />;\n};\n\nObject.assign(SolidMarkdownChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"markdown\", description: \"Rich formatted text for a self-contained note or report section.\", propsSchema: { type: \"object\", properties: { text: { type: \"string\" } }, required: [\"text\"] } },\n}) });\n"]}
|
|
@@ -7,3 +7,7 @@ export const SolidMarkdownChatWidget = ({ eventData }: SolidChatWidgetProps) =>
|
|
|
7
7
|
const data = getChatWidgetData<{ text?: string; content?: string }>(eventData);
|
|
8
8
|
return <SolidAgentMarkdown text={String(data.text ?? data.content ?? "")} />;
|
|
9
9
|
};
|
|
10
|
+
|
|
11
|
+
Object.assign(SolidMarkdownChatWidget, { getExtensionMetadata: () => ({
|
|
12
|
+
agentWidget: { name: "markdown", description: "Rich formatted text for a self-contained note or report section.", propsSchema: { type: "object", properties: { text: { type: "string" } }, required: ["text"] } },
|
|
13
|
+
}) });
|
|
@@ -23,4 +23,7 @@ export var SolidProgressChatWidget = function (_a) {
|
|
|
23
23
|
var percent = typeof data.percent === "number" ? Math.max(0, Math.min(100, data.percent)) : null;
|
|
24
24
|
return (_jsxs("div", { className: styles.card, children: [data.title && _jsx("div", { className: styles.cardHead, children: data.title }), _jsxs("div", { className: styles.cardBody, children: [percent != null && (_jsx("div", { className: styles.progressBar, role: "progressbar", "aria-valuenow": percent, "aria-valuemin": 0, "aria-valuemax": 100, children: _jsx("div", { className: styles.progressFill, style: { width: "".concat(percent, "%") } }) })), steps.map(function (step, index) { return (_jsxs("div", { className: styles.stepRow, children: [_jsx(SolidProgressStepIcon, { status: step.status }), _jsx("span", { children: step.label })] }, index)); })] })] }));
|
|
25
25
|
};
|
|
26
|
+
Object.assign(SolidProgressChatWidget, { getExtensionMetadata: function () { return ({
|
|
27
|
+
agentWidget: { name: "progress", description: "Show steps and their status for multi-step work.", propsSchema: { type: "object", properties: { title: { type: "string" }, percent: { type: "number" }, steps: { type: "array", items: { type: "object", properties: { label: { type: "string" }, status: { type: "string", enum: ["pending", "running", "done", "error"] } }, required: ["label"] } } } } },
|
|
28
|
+
}); } });
|
|
26
29
|
//# sourceMappingURL=SolidProgressChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidProgressChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidProgressChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK/D,MAAM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CAAC,QAAQ,aAC1B,OAAO,IAAI,IAAI,IAAI,CAChB,cAAK,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,IAAI,EAAC,aAAa,mBAAgB,OAAO,mBAAiB,CAAC,mBAAiB,GAAG,YAC/G,cAAK,SAAS,EAAE,MAAM,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAG,OAAO,MAAG,EAAE,GAAI,GACtE,CACT,EACA,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,OAAA,CACxB,eAAiB,SAAS,EAAE,MAAM,CAAC,OAAO,aACtC,KAAC,qBAAqB,IAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,EAC9C,yBAAO,IAAI,CAAC,KAAK,GAAQ,KAFnB,KAAK,CAGT,CACT,EAL2B,CAK3B,CAAC,IACA,IACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { CheckCircle2, CircleX, Loader2 } from \"lucide-react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype ProgressStep = { label: string; status?: \"pending\" | \"running\" | \"done\" | \"error\" };\ntype ProgressData = { title?: string; percent?: number; steps?: ProgressStep[] };\n\nexport const SolidProgressStepIcon = ({ status }: { status?: ProgressStep[\"status\"] }) => {\n if (status === \"done\") return <CheckCircle2 size={14} className={styles.okIcon} />;\n if (status === \"error\") return <CircleX size={14} className={styles.errIcon} />;\n if (status === \"running\") return <Loader2 size={14} className={styles.spinIcon} />;\n return <span style={{ width: 14, height: 14, borderRadius: 999, border: \"2px dashed var(--agent-border)\", display: \"inline-block\" }} />;\n};\n\n/**\n * `event_data: { widget: \"progress\", widgetId, title?, percent?, steps?: [{ label, status }] }`.\n * Send later events with the same widgetId to update it in place.\n */\nexport const SolidProgressChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<ProgressData>(eventData);\n const steps = asArray<ProgressStep>(data.steps);\n const percent = typeof data.percent === \"number\" ? Math.max(0, Math.min(100, data.percent)) : null;\n return (\n <div className={styles.card}>\n {data.title && <div className={styles.cardHead}>{data.title}</div>}\n <div className={styles.cardBody}>\n {percent != null && (\n <div className={styles.progressBar} role=\"progressbar\" aria-valuenow={percent} aria-valuemin={0} aria-valuemax={100}>\n <div className={styles.progressFill} style={{ width: `${percent}%` }} />\n </div>\n )}\n {steps.map((step, index) => (\n <div key={index} className={styles.stepRow}>\n <SolidProgressStepIcon status={step.status} />\n <span>{step.label}</span>\n </div>\n ))}\n </div>\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidProgressChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidProgressChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK/D,MAAM,CAAC,IAAM,qBAAqB,GAAG,UAAC,EAA+C;QAA7C,MAAM,YAAA;IAC1C,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,GAAI,CAAC;IACnF,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,KAAC,OAAO,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI,CAAC;IAChF,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,KAAC,OAAO,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,QAAQ,GAAI,CAAC;IACnF,OAAO,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,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3B,CAAC,IACA,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,EAAE,oBAAoB,EAAE,cAAM,OAAA,CAAC;QAClE,WAAW,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,kDAAkD,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;KAC9Y,CAAC,EAFmE,CAEnE,EAAE,CAAC,CAAC","sourcesContent":["import { CheckCircle2, CircleX, Loader2 } from \"lucide-react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype ProgressStep = { label: string; status?: \"pending\" | \"running\" | \"done\" | \"error\" };\ntype ProgressData = { title?: string; percent?: number; steps?: ProgressStep[] };\n\nexport const SolidProgressStepIcon = ({ status }: { status?: ProgressStep[\"status\"] }) => {\n if (status === \"done\") return <CheckCircle2 size={14} className={styles.okIcon} />;\n if (status === \"error\") return <CircleX size={14} className={styles.errIcon} />;\n if (status === \"running\") return <Loader2 size={14} className={styles.spinIcon} />;\n return <span style={{ width: 14, height: 14, borderRadius: 999, border: \"2px dashed var(--agent-border)\", display: \"inline-block\" }} />;\n};\n\n/**\n * `event_data: { widget: \"progress\", widgetId, title?, percent?, steps?: [{ label, status }] }`.\n * Send later events with the same widgetId to update it in place.\n */\nexport const SolidProgressChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<ProgressData>(eventData);\n const steps = asArray<ProgressStep>(data.steps);\n const percent = typeof data.percent === \"number\" ? Math.max(0, Math.min(100, data.percent)) : null;\n return (\n <div className={styles.card}>\n {data.title && <div className={styles.cardHead}>{data.title}</div>}\n <div className={styles.cardBody}>\n {percent != null && (\n <div className={styles.progressBar} role=\"progressbar\" aria-valuenow={percent} aria-valuemin={0} aria-valuemax={100}>\n <div className={styles.progressFill} style={{ width: `${percent}%` }} />\n </div>\n )}\n {steps.map((step, index) => (\n <div key={index} className={styles.stepRow}>\n <SolidProgressStepIcon status={step.status} />\n <span>{step.label}</span>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nObject.assign(SolidProgressChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"progress\", description: \"Show steps and their status for multi-step work.\", propsSchema: { type: \"object\", properties: { title: { type: \"string\" }, percent: { type: \"number\" }, steps: { type: \"array\", items: { type: \"object\", properties: { label: { type: \"string\" }, status: { type: \"string\", enum: [\"pending\", \"running\", \"done\", \"error\"] } }, required: [\"label\"] } } } } },\n}) });\n"]}
|
|
@@ -40,3 +40,7 @@ export const SolidProgressChatWidget = ({ eventData }: SolidChatWidgetProps) =>
|
|
|
40
40
|
</div>
|
|
41
41
|
);
|
|
42
42
|
};
|
|
43
|
+
|
|
44
|
+
Object.assign(SolidProgressChatWidget, { getExtensionMetadata: () => ({
|
|
45
|
+
agentWidget: { name: "progress", description: "Show steps and their status for multi-step work.", propsSchema: { type: "object", properties: { title: { type: "string" }, percent: { type: "number" }, steps: { type: "array", items: { type: "object", properties: { label: { type: "string" }, status: { type: "string", enum: ["pending", "running", "done", "error"] } }, required: ["label"] } } } } },
|
|
46
|
+
}) });
|
|
@@ -38,4 +38,7 @@ export var SolidQuestionChatWidget = function (_a) {
|
|
|
38
38
|
reply(picked.map(function (i) { return options[i].value; }));
|
|
39
39
|
}, children: "Submit" }) }))] }));
|
|
40
40
|
};
|
|
41
|
+
Object.assign(SolidQuestionChatWidget, { getExtensionMetadata: function () { return ({
|
|
42
|
+
agentWidget: { name: "question", description: "Ask the user a single or multiple choice question.", propsSchema: { type: "object", properties: { question: { type: "string" }, hint: { type: "string" }, options: { type: "array", items: { anyOf: [{ type: "string" }, { type: "object", properties: { label: { type: "string" }, value: {} }, required: ["label"] }] } }, multiple: { type: "boolean" } } } },
|
|
43
|
+
}); } });
|
|
41
44
|
//# sourceMappingURL=SolidQuestionChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidQuestionChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidQuestionChatWidget.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK/D;;;GAGG;AACH,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,EAAiD;QAA/C,SAAS,eAAA,EAAE,KAAK,WAAA,EAAE,KAAK,WAAA;IAC7D,IAAM,IAAI,GAAG,iBAAiB,CAAe,SAAS,CAAC,CAAC;IACxD,IAAM,OAAO,GAAG,OAAO,CAAiB,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAC,MAAM,YAC7D,OAAA,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAA,MAAM,CAAC,KAAK,m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AC,QAAQ,EACb,SAAS,EAAE,UAAG,MAAM,CAAC,GAAG,cAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAE,EAC3E,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAC5B,QAAQ,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,kBAC7B,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpC,OAAO,EAAE,cAAM,OAAA,MAAM,CAAC,KAAK,CAAC,EAAb,CAAa,YAE3B,MAAM,CAAC,KAAK,IARR,KAAK,CASL,CACZ,EAZ+B,CAY/B,CAAC,IACA,EACL,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,IAAI,CACzB,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,YAC3B,iBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,UAAG,MAAM,CAAC,GAAG,cAAI,MAAM,CAAC,UAAU,CAAE,EAC/C,QAAQ,EAAE,CAAC,MAAM,CAAC,MAAM,EACxB,OAAO,EAAE;wBACL,WAAW,CAAC,IAAI,CAAC,CAAC;wBAClB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,EAAhB,CAAgB,CAAC,CAAC,CAAC;oBAC/C,CAAC,uBAGI,GACP,CACT,IACC,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useState } from \"react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype QuestionOption = string | { label: string; value?: unknown };\ntype QuestionData = { question?: string; hint?: string; options?: QuestionOption[]; multiple?: boolean };\n\n/**\n * `event_data: { widget: \"question\", question, hint?, options: [...], multiple? }`.\n * A single-choice answer is sent on click; multiple choice waits for Submit.\n */\nexport const SolidQuestionChatWidget = ({ eventData, final, reply }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<QuestionData>(eventData);\n const options = asArray<QuestionOption>(data.options).map((option) =>\n typeof option === \"string\" ? { label: option, value: option as unknown } : { label: option.label, value: option.value ?? option.label },\n );\n const [picked, setPicked] = useState<number[]>([]);\n const [answered, setAnswered] = useState(false);\n const locked = final || answered;\n\n const choose = (index: number) => {\n if (locked) return;\n if (!data.multiple) {\n setPicked([index]);\n setAnswered(true);\n reply(options[index].value);\n return;\n }\n setPicked((prev) => (prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]));\n };\n\n return (\n <div className={styles.card}>\n <div className={styles.cardBody}>\n {data.question && <strong>{data.question}</strong>}\n {data.hint && <span style={{ color: \"var(--agent-muted)\", fontSize: 12.5 }}>{data.hint}</span>}\n {options.map((option, index) => (\n <button\n key={index}\n type=\"button\"\n className={`${styles.btn} ${picked.includes(index) ? styles.optionOn : \"\"}`}\n style={{ textAlign: \"left\" }}\n disabled={locked && !picked.includes(index)}\n aria-pressed={picked.includes(index)}\n onClick={() => choose(index)}\n >\n {option.label}\n </button>\n ))}\n </div>\n {data.multiple && !locked && (\n <div className={styles.cardFoot}>\n <button\n type=\"button\"\n className={`${styles.btn} ${styles.btnPrimary}`}\n disabled={!picked.length}\n onClick={() => {\n setAnswered(true);\n reply(picked.map((i) => options[i].value));\n }}\n >\n Submit\n </button>\n </div>\n )}\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidQuestionChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidQuestionChatWidget.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK/D;;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CAAC;wBAClB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,EAAhB,CAAgB,CAAC,CAAC,CAAC;oBAC/C,CAAC,uBAGI,GACP,CACT,IACC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,EAAE,oBAAoB,EAAE,cAAM,OAAA,CAAC;QAClE,WAAW,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oDAAoD,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE;KAClZ,CAAC,EAFmE,CAEnE,EAAE,CAAC,CAAC","sourcesContent":["import { useState } from \"react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype QuestionOption = string | { label: string; value?: unknown };\ntype QuestionData = { question?: string; hint?: string; options?: QuestionOption[]; multiple?: boolean };\n\n/**\n * `event_data: { widget: \"question\", question, hint?, options: [...], multiple? }`.\n * A single-choice answer is sent on click; multiple choice waits for Submit.\n */\nexport const SolidQuestionChatWidget = ({ eventData, final, reply }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<QuestionData>(eventData);\n const options = asArray<QuestionOption>(data.options).map((option) =>\n typeof option === \"string\" ? { label: option, value: option as unknown } : { label: option.label, value: option.value ?? option.label },\n );\n const [picked, setPicked] = useState<number[]>([]);\n const [answered, setAnswered] = useState(false);\n const locked = final || answered;\n\n const choose = (index: number) => {\n if (locked) return;\n if (!data.multiple) {\n setPicked([index]);\n setAnswered(true);\n reply(options[index].value);\n return;\n }\n setPicked((prev) => (prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]));\n };\n\n return (\n <div className={styles.card}>\n <div className={styles.cardBody}>\n {data.question && <strong>{data.question}</strong>}\n {data.hint && <span style={{ color: \"var(--agent-muted)\", fontSize: 12.5 }}>{data.hint}</span>}\n {options.map((option, index) => (\n <button\n key={index}\n type=\"button\"\n className={`${styles.btn} ${picked.includes(index) ? styles.optionOn : \"\"}`}\n style={{ textAlign: \"left\" }}\n disabled={locked && !picked.includes(index)}\n aria-pressed={picked.includes(index)}\n onClick={() => choose(index)}\n >\n {option.label}\n </button>\n ))}\n </div>\n {data.multiple && !locked && (\n <div className={styles.cardFoot}>\n <button\n type=\"button\"\n className={`${styles.btn} ${styles.btnPrimary}`}\n disabled={!picked.length}\n onClick={() => {\n setAnswered(true);\n reply(picked.map((i) => options[i].value));\n }}\n >\n Submit\n </button>\n </div>\n )}\n </div>\n );\n};\n\nObject.assign(SolidQuestionChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"question\", description: \"Ask the user a single or multiple choice question.\", propsSchema: { type: \"object\", properties: { question: { type: \"string\" }, hint: { type: \"string\" }, options: { type: \"array\", items: { anyOf: [{ type: \"string\" }, { type: \"object\", properties: { label: { type: \"string\" }, value: {} }, required: [\"label\"] }] } }, multiple: { type: \"boolean\" } } } },\n}) });\n"]}
|
|
@@ -67,3 +67,7 @@ export const SolidQuestionChatWidget = ({ eventData, final, reply }: SolidChatWi
|
|
|
67
67
|
</div>
|
|
68
68
|
);
|
|
69
69
|
};
|
|
70
|
+
|
|
71
|
+
Object.assign(SolidQuestionChatWidget, { getExtensionMetadata: () => ({
|
|
72
|
+
agentWidget: { name: "question", description: "Ask the user a single or multiple choice question.", propsSchema: { type: "object", properties: { question: { type: "string" }, hint: { type: "string" }, options: { type: "array", items: { anyOf: [{ type: "string" }, { type: "object", properties: { label: { type: "string" }, value: {} }, required: ["label"] }] } }, multiple: { type: "boolean" } } } },
|
|
73
|
+
}) });
|
|
@@ -20,4 +20,7 @@ export var SolidStatusChatWidget = function (_a) {
|
|
|
20
20
|
var Icon = TONE_ICON[tone];
|
|
21
21
|
return (_jsxs("div", { className: "".concat(styles.status, " ").concat(TONE_CLASS[tone]), role: tone === "error" ? "alert" : "status", children: [_jsx(Icon, { size: 16, style: { flex: "0 0 auto", marginTop: 2 } }), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [data.title && _jsx("strong", { children: data.title }), data.message && _jsx("span", { children: data.message }), data.action && (_jsx("button", { type: "button", className: styles.btn, style: { alignSelf: "flex-start" }, onClick: function () { return sendPrompt(data.action.prompt); }, children: data.action.label }))] })] }));
|
|
22
22
|
};
|
|
23
|
+
Object.assign(SolidStatusChatWidget, { getExtensionMetadata: function () { return ({
|
|
24
|
+
agentWidget: { name: "status", description: "Show the outcome of one operation with a status, title, and detail.", propsSchema: { type: "object", properties: { tone: { type: "string", enum: ["success", "warning", "error", "info"] }, title: { type: "string" }, message: { type: "string" }, action: { type: "object", properties: { label: { type: "string" }, prompt: { type: "string" } }, required: ["label", "prompt"] } } } },
|
|
25
|
+
}); } });
|
|
23
26
|
//# sourceMappingURL=SolidStatusChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidStatusChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidStatusChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,E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C,EAAE,aAC3D,IAAI,CAAC,KAAK,IAAI,2BAAS,IAAI,CAAC,KAAK,GAAU,EAC3C,IAAI,CAAC,OAAO,IAAI,yBAAO,IAAI,CAAC,OAAO,GAAQ,EAC3C,IAAI,CAAC,MAAM,IAAI,CACZ,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,cAAM,OAAA,UAAU,CAAC,IAAI,CAAC,MAAO,CAAC,MAAM,CAAC,EAA/B,CAA+B,YAC1H,IAAI,CAAC,MAAM,CAAC,KAAK,GACb,CACZ,IACC,IACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { AlertTriangle, CheckCircle2, CircleX, Info } from \"lucide-react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype Tone = \"success\" | \"warning\" | \"error\" | \"info\";\ntype StatusData = { tone?: Tone; title?: string; message?: string; action?: { label: string; prompt: string } };\n\nconst TONE_CLASS: Record<Tone, string> = {\n success: styles.statusSuccess,\n warning: styles.statusWarning,\n error: styles.statusError,\n info: styles.statusInfo,\n};\n\nconst TONE_ICON = { success: CheckCircle2, warning: AlertTriangle, error: CircleX, info: Info };\n\n/**\n * `event_data: { widget: \"status\", tone, title?, message?, action?: { label, prompt } }`.\n * The optional action posts `prompt` as a new user message.\n */\nexport const SolidStatusChatWidget = ({ eventData, sendPrompt }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<StatusData>(eventData);\n const tone: Tone = data.tone && data.tone in TONE_CLASS ? data.tone : \"info\";\n const Icon = TONE_ICON[tone];\n return (\n <div className={`${styles.status} ${TONE_CLASS[tone]}`} role={tone === \"error\" ? \"alert\" : \"status\"}>\n <Icon size={16} style={{ flex: \"0 0 auto\", marginTop: 2 }} />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n {data.title && <strong>{data.title}</strong>}\n {data.message && <span>{data.message}</span>}\n {data.action && (\n <button type=\"button\" className={styles.btn} style={{ alignSelf: \"flex-start\" }} onClick={() => sendPrompt(data.action!.prompt)}>\n {data.action.label}\n </button>\n )}\n </div>\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidStatusChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidStatusChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAKtD,IAAM,UAAU,GAAyB;IACrC,OAAO,EAAE,MAAM,CAAC,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC,WAAW;IACzB,IAAI,EAAE,MAAM,CAAC,UAAU;CAC1B,CAAC;AAEF,IAAM,SAAS,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAEhG;;;GAGG;AACH,MAAM,CAAC,IAAM,qBAAqB,GAAG,UAAC,EAA+C;QAA7C,SAAS,eAAA,EAAE,UAAU,gBAAA;IACzD,IAAM,IAAI,GAAG,iBAAiB,CAAa,SAAS,CAAC,CAAC;IACtD,IAAM,IAAI,GAAS,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IAC7E,IAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,CACH,eAAK,SAAS,EAAE,UAAG,MAAM,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AE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE;KAC1a,CAAC,EAFiE,CAEjE,EAAE,CAAC,CAAC","sourcesContent":["import { AlertTriangle, CheckCircle2, CircleX, Info } from \"lucide-react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype Tone = \"success\" | \"warning\" | \"error\" | \"info\";\ntype StatusData = { tone?: Tone; title?: string; message?: string; action?: { label: string; prompt: string } };\n\nconst TONE_CLASS: Record<Tone, string> = {\n success: styles.statusSuccess,\n warning: styles.statusWarning,\n error: styles.statusError,\n info: styles.statusInfo,\n};\n\nconst TONE_ICON = { success: CheckCircle2, warning: AlertTriangle, error: CircleX, info: Info };\n\n/**\n * `event_data: { widget: \"status\", tone, title?, message?, action?: { label, prompt } }`.\n * The optional action posts `prompt` as a new user message.\n */\nexport const SolidStatusChatWidget = ({ eventData, sendPrompt }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<StatusData>(eventData);\n const tone: Tone = data.tone && data.tone in TONE_CLASS ? data.tone : \"info\";\n const Icon = TONE_ICON[tone];\n return (\n <div className={`${styles.status} ${TONE_CLASS[tone]}`} role={tone === \"error\" ? \"alert\" : \"status\"}>\n <Icon size={16} style={{ flex: \"0 0 auto\", marginTop: 2 }} />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n {data.title && <strong>{data.title}</strong>}\n {data.message && <span>{data.message}</span>}\n {data.action && (\n <button type=\"button\" className={styles.btn} style={{ alignSelf: \"flex-start\" }} onClick={() => sendPrompt(data.action!.prompt)}>\n {data.action.label}\n </button>\n )}\n </div>\n </div>\n );\n};\n\nObject.assign(SolidStatusChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"status\", description: \"Show the outcome of one operation with a status, title, and detail.\", propsSchema: { type: \"object\", properties: { tone: { type: \"string\", enum: [\"success\", \"warning\", \"error\", \"info\"] }, title: { type: \"string\" }, message: { type: \"string\" }, action: { type: \"object\", properties: { label: { type: \"string\" }, prompt: { type: \"string\" } }, required: [\"label\", \"prompt\"] } } } },\n}) });\n"]}
|
|
@@ -38,3 +38,7 @@ export const SolidStatusChatWidget = ({ eventData, sendPrompt }: SolidChatWidget
|
|
|
38
38
|
</div>
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
|
+
|
|
42
|
+
Object.assign(SolidStatusChatWidget, { getExtensionMetadata: () => ({
|
|
43
|
+
agentWidget: { name: "status", description: "Show the outcome of one operation with a status, title, and detail.", propsSchema: { type: "object", properties: { tone: { type: "string", enum: ["success", "warning", "error", "info"] }, title: { type: "string" }, message: { type: "string" }, action: { type: "object", properties: { label: { type: "string" }, prompt: { type: "string" } }, required: ["label", "prompt"] } } } },
|
|
44
|
+
}) });
|
|
@@ -29,4 +29,7 @@ export var SolidTableChatWidget = function (_a) {
|
|
|
29
29
|
return (_jsx("td", { children: typeof row[column.key] === "object" ? JSON.stringify(row[column.key]) : String((_a = row[column.key]) !== null && _a !== void 0 ? _a : "") }, column.key));
|
|
30
30
|
}) }, rowIndex)); }) })] }) })] }));
|
|
31
31
|
};
|
|
32
|
+
Object.assign(SolidTableChatWidget, { getExtensionMetadata: function () { return ({
|
|
33
|
+
agentWidget: { name: "table", description: "Show rows and columns for records, query results, or comparisons.", propsSchema: { type: "object", properties: { title: { type: "string" }, columns: { type: "array", items: { anyOf: [{ type: "string" }, { type: "object", properties: { key: { type: "string" }, label: { type: "string" } }, required: ["key"] }] } }, rows: { type: "array", items: { type: "object", additionalProperties: true } } } } },
|
|
34
|
+
}); } });
|
|
32
35
|
//# sourceMappingURL=SolidTableChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidTableChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidTableChatWidget.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK/D,wFAAwF;AACxF,MAAM,CAAC,IAAM,oBAAoB,GAAG,UAAC,EAAmC;;QAAjC,SAAS,eAAA;IAC5C,IAAM,IAAI,GAAG,iBAAiB,CAAY,SAAS,CAAC,CAAC;IACrD,IAAM,IAAI,GAAG,OAAO,CAA0B,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,IAAM,OAAO,GAAG,CAAC,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,EAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAA,IAAI,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,UAAC,MAAM,YAC1F,OAAA,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,MAAA,MAAM,CAAC,KAAK,mCAAI,MAAM,CAAC,GAAG,EAAE,CAAA,EAAA,CACvH,CAAC;IACI,IAAA,KAAkB,QAAQ,CAAsC,IAAI,CAAC,EAApE,IAAI,QAAA,EAAE,OAAO,QAAuD,CAAC;IAC5E,IAAM,MAAM,GAAG,OAAO,CAAC;QACnB,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,OAAO,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A/E,CAA+E,CAAC,EAAlG,CAAkG,YAEhH,MAAM,CAAC,KAAK,IAJR,MAAM,CAAC,GAAG,CAKd,CACR,EARwB,CAQxB,CAAC,GACD,GACD,EACR,0BACK,MAAM,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,QAAQ,IAAK,OAAA,CAC3B,uBACK,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM;;oCAAK,OAAA,CACrB,uBACK,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAA,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,mCAAI,EAAE,CAAC,IADjG,MAAM,CAAC,GAAG,CAEd,CACR,CAAA;iCAAA,CAAC,IALG,QAAQ,CAMZ,CACR,EAR8B,CAQ9B,CAAC,GACE,IACJ,GACN,IACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useMemo, useState } from \"react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype Column = string | { key: string; label?: string };\ntype TableData = { title?: string; columns?: Column[]; rows?: Record<string, unknown>[] };\n\n/** `event_data: { widget: \"table\", title?, columns?, rows }` — small sortable table. */\nexport const SolidTableChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<TableData>(eventData);\n const rows = asArray<Record<string, unknown>>(data.rows);\n const columns = (data.columns?.length ? data.columns : Object.keys(rows[0] ?? {})).map((column) =>\n typeof column === \"string\" ? { key: column, label: column } : { key: column.key, label: column.label ?? column.key },\n );\n const [sort, setSort] = useState<{ key: string; dir: 1 | -1 } | null>(null);\n const sorted = useMemo(() => {\n if (!sort) return rows;\n return [...rows].sort((a, b) => String(a[sort.key] ?? \"\").localeCompare(String(b[sort.key] ?? \"\"), undefined, { numeric: true }) * sort.dir);\n }, [rows, sort]);\n\n return (\n <div className={styles.card}>\n {data.title && <div className={styles.cardHead}>{data.title}</div>}\n <div className={styles.tableWrap}>\n <table className={styles.dataTable}>\n <thead>\n <tr>\n {columns.map((column) => (\n <th\n key={column.key}\n aria-sort={sort?.key === column.key ? (sort.dir === 1 ? \"ascending\" : \"descending\") : \"none\"}\n onClick={() => setSort((prev) => ({ key: column.key, dir: prev?.key === column.key && prev.dir === 1 ? -1 : 1 }))}\n >\n {column.label}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {sorted.map((row, rowIndex) => (\n <tr key={rowIndex}>\n {columns.map((column) => (\n <td key={column.key}>\n {typeof row[column.key] === \"object\" ? JSON.stringify(row[column.key]) : String(row[column.key] ?? \"\")}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidTableChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidTableChatWidget.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK/D,wFAAwF;AACxF,MAAM,CAAC,IAAM,oBAAoB,GAAG,UAAC,EAAmC;;QAAjC,SAAS,eAAA;IAC5C,IAAM,IAAI,GAAG,iBAAiB,CAAY,SAAS,CAAC,CAAC;IACrD,IAAM,IAAI,GAAG,OAAO,CAA0B,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,IAAM,OAAO,GAAG,CAAC,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,EAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAA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AE,oBAAoB,EAAE,cAAM,OAAA,CAAC;QAC/D,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,mEAAmE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE;KAC9b,CAAC,EAFgE,CAEhE,EAAE,CAAC,CAAC","sourcesContent":["import { useMemo, useState } from \"react\";\nimport styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\n\ntype Column = string | { key: string; label?: string };\ntype TableData = { title?: string; columns?: Column[]; rows?: Record<string, unknown>[] };\n\n/** `event_data: { widget: \"table\", title?, columns?, rows }` — small sortable table. */\nexport const SolidTableChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<TableData>(eventData);\n const rows = asArray<Record<string, unknown>>(data.rows);\n const columns = (data.columns?.length ? data.columns : Object.keys(rows[0] ?? {})).map((column) =>\n typeof column === \"string\" ? { key: column, label: column } : { key: column.key, label: column.label ?? column.key },\n );\n const [sort, setSort] = useState<{ key: string; dir: 1 | -1 } | null>(null);\n const sorted = useMemo(() => {\n if (!sort) return rows;\n return [...rows].sort((a, b) => String(a[sort.key] ?? \"\").localeCompare(String(b[sort.key] ?? \"\"), undefined, { numeric: true }) * sort.dir);\n }, [rows, sort]);\n\n return (\n <div className={styles.card}>\n {data.title && <div className={styles.cardHead}>{data.title}</div>}\n <div className={styles.tableWrap}>\n <table className={styles.dataTable}>\n <thead>\n <tr>\n {columns.map((column) => (\n <th\n key={column.key}\n aria-sort={sort?.key === column.key ? (sort.dir === 1 ? \"ascending\" : \"descending\") : \"none\"}\n onClick={() => setSort((prev) => ({ key: column.key, dir: prev?.key === column.key && prev.dir === 1 ? -1 : 1 }))}\n >\n {column.label}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {sorted.map((row, rowIndex) => (\n <tr key={rowIndex}>\n {columns.map((column) => (\n <td key={column.key}>\n {typeof row[column.key] === \"object\" ? JSON.stringify(row[column.key]) : String(row[column.key] ?? \"\")}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n};\n\nObject.assign(SolidTableChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"table\", description: \"Show rows and columns for records, query results, or comparisons.\", propsSchema: { type: \"object\", properties: { title: { type: \"string\" }, columns: { type: \"array\", items: { anyOf: [{ type: \"string\" }, { type: \"object\", properties: { key: { type: \"string\" }, label: { type: \"string\" } }, required: [\"key\"] }] } }, rows: { type: \"array\", items: { type: \"object\", additionalProperties: true } } } } },\n}) });\n"]}
|
|
@@ -53,3 +53,7 @@ export const SolidTableChatWidget = ({ eventData }: SolidChatWidgetProps) => {
|
|
|
53
53
|
</div>
|
|
54
54
|
);
|
|
55
55
|
};
|
|
56
|
+
|
|
57
|
+
Object.assign(SolidTableChatWidget, { getExtensionMetadata: () => ({
|
|
58
|
+
agentWidget: { name: "table", description: "Show rows and columns for records, query results, or comparisons.", propsSchema: { type: "object", properties: { title: { type: "string" }, columns: { type: "array", items: { anyOf: [{ type: "string" }, { type: "object", properties: { key: { type: "string" }, label: { type: "string" } }, required: ["key"] }] } }, rows: { type: "array", items: { type: "object", additionalProperties: true } } } } },
|
|
59
|
+
}) });
|
|
@@ -14,4 +14,7 @@ export var SolidToolActivityChatWidget = function (_a) {
|
|
|
14
14
|
var tools = asArray(data.tools);
|
|
15
15
|
return (_jsxs("div", { className: styles.card, children: [_jsx("div", { className: styles.cardHead, children: (_b = data.title) !== null && _b !== void 0 ? _b : "Used ".concat(tools.length, " tool").concat(tools.length === 1 ? "" : "s") }), _jsx("div", { className: styles.cardBody, children: tools.map(function (tool, index) { return (_jsxs("div", { className: styles.stepRow, children: [_jsx(SolidProgressStepIcon, { status: tool.status === "running" ? "running" : tool.status === "error" ? "error" : "done" }), _jsx("span", { style: { fontWeight: 600 }, children: tool.name }), _jsx("span", { className: styles.toolSummary, children: tool.summary }), _jsx("span", { className: styles.toolMeta, children: formatDuration(tool.duration_ms) })] }, index)); }) })] }));
|
|
16
16
|
};
|
|
17
|
+
Object.assign(SolidToolActivityChatWidget, { getExtensionMetadata: function () { return ({
|
|
18
|
+
agentWidget: { name: "tool-activity", description: "Summarize tool calls and their results.", propsSchema: { type: "object", properties: { title: { type: "string" }, tools: { type: "array", items: { type: "object", properties: { name: { type: "string" }, summary: { type: "string" }, status: { type: "string", enum: ["running", "done", "error"] }, duration_ms: { type: "number" } }, required: ["name"] } } } } },
|
|
19
|
+
}); } });
|
|
17
20
|
//# sourceMappingURL=SolidToolActivityChatWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidToolActivityChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAA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import { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { formatDuration } from \"../agentFormat\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\nimport { SolidProgressStepIcon } from \"./SolidProgressChatWidget\";\n\ntype ToolLine = { name: string; summary?: string; status?: \"running\" | \"done\" | \"error\"; duration_ms?: number };\n\n/**\n * `event_data: { widget: \"tool-activity\", title?, tools: [{ name, summary?, status?, duration_ms? }] }`.\n * A summary of several tool calls in one card (individual calls use DefaultToolCallChatWidget).\n */\nexport const SolidToolActivityChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ title?: string; tools?: ToolLine[] }>(eventData);\n const tools = asArray<ToolLine>(data.tools);\n return (\n <div className={styles.card}>\n <div className={styles.cardHead}>{data.title ?? `Used ${tools.length} tool${tools.length === 1 ? \"\" : \"s\"}`}</div>\n <div className={styles.cardBody}>\n {tools.map((tool, index) => (\n <div key={index} className={styles.stepRow}>\n <SolidProgressStepIcon status={tool.status === \"running\" ? \"running\" : tool.status === \"error\" ? \"error\" : \"done\"} />\n <span style={{ fontWeight: 600 }}>{tool.name}</span>\n <span className={styles.toolSummary}>{tool.summary}</span>\n <span className={styles.toolMeta}>{formatDuration(tool.duration_ms)}</span>\n </div>\n ))}\n </div>\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidToolActivityChatWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIlE;;;GAGG;AACH,MAAM,CAAC,IAAM,2BAA2B,GAAG,UAAC,EAAmC;;QAAjC,SAAS,eAAA;IAC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E,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;KAC9Z,CAAC,EAFuE,CAEvE,EAAE,CAAC,CAAC","sourcesContent":["import styles from \"../SolidAgent.module.css\";\nimport { SolidChatWidgetProps } from \"../../../../types/solid-core\";\nimport { formatDuration } from \"../agentFormat\";\nimport { asArray, getChatWidgetData } from \"./chatWidgetUtils\";\nimport { SolidProgressStepIcon } from \"./SolidProgressChatWidget\";\n\ntype ToolLine = { name: string; summary?: string; status?: \"running\" | \"done\" | \"error\"; duration_ms?: number };\n\n/**\n * `event_data: { widget: \"tool-activity\", title?, tools: [{ name, summary?, status?, duration_ms? }] }`.\n * A summary of several tool calls in one card (individual calls use DefaultToolCallChatWidget).\n */\nexport const SolidToolActivityChatWidget = ({ eventData }: SolidChatWidgetProps) => {\n const data = getChatWidgetData<{ title?: string; tools?: ToolLine[] }>(eventData);\n const tools = asArray<ToolLine>(data.tools);\n return (\n <div className={styles.card}>\n <div className={styles.cardHead}>{data.title ?? `Used ${tools.length} tool${tools.length === 1 ? \"\" : \"s\"}`}</div>\n <div className={styles.cardBody}>\n {tools.map((tool, index) => (\n <div key={index} className={styles.stepRow}>\n <SolidProgressStepIcon status={tool.status === \"running\" ? \"running\" : tool.status === \"error\" ? \"error\" : \"done\"} />\n <span style={{ fontWeight: 600 }}>{tool.name}</span>\n <span className={styles.toolSummary}>{tool.summary}</span>\n <span className={styles.toolMeta}>{formatDuration(tool.duration_ms)}</span>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nObject.assign(SolidToolActivityChatWidget, { getExtensionMetadata: () => ({\n agentWidget: { name: \"tool-activity\", description: \"Summarize tool calls and their results.\", propsSchema: { type: \"object\", properties: { title: { type: \"string\" }, tools: { type: \"array\", items: { type: \"object\", properties: { name: { type: \"string\" }, summary: { type: \"string\" }, status: { type: \"string\", enum: [\"running\", \"done\", \"error\"] }, duration_ms: { type: \"number\" } }, required: [\"name\"] } } } } },\n}) });\n"]}
|
|
@@ -29,3 +29,7 @@ export const SolidToolActivityChatWidget = ({ eventData }: SolidChatWidgetProps)
|
|
|
29
29
|
</div>
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
|
+
|
|
33
|
+
Object.assign(SolidToolActivityChatWidget, { getExtensionMetadata: () => ({
|
|
34
|
+
agentWidget: { name: "tool-activity", description: "Summarize tool calls and their results.", propsSchema: { type: "object", properties: { title: { type: "string" }, tools: { type: "array", items: { type: "object", properties: { name: { type: "string" }, summary: { type: "string" }, status: { type: "string", enum: ["running", "done", "error"] }, duration_ms: { type: "number" } }, required: ["name"] } } } } },
|
|
35
|
+
}) });
|