@jini-ai/chat 0.1.0
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/LICENSE +201 -0
- package/README.md +109 -0
- package/dist/core/agentic/chat-capabilities.d.ts +19 -0
- package/dist/core/agentic/chat-capabilities.d.ts.map +1 -0
- package/dist/core/agentic/chat-capabilities.js +106 -0
- package/dist/core/agentic/chat-capabilities.js.map +1 -0
- package/dist/core/agentic/index.d.ts +22 -0
- package/dist/core/agentic/index.d.ts.map +1 -0
- package/dist/core/agentic/index.js +21 -0
- package/dist/core/agentic/index.js.map +1 -0
- package/dist/core/events.d.ts +84 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +14 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/index.d.ts +40 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +40 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/messages.d.ts +53 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +16 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/partial-json.d.ts +36 -0
- package/dist/core/partial-json.d.ts.map +1 -0
- package/dist/core/partial-json.js +119 -0
- package/dist/core/partial-json.js.map +1 -0
- package/dist/core/persistence/index.d.ts +11 -0
- package/dist/core/persistence/index.d.ts.map +1 -0
- package/dist/core/persistence/index.js +11 -0
- package/dist/core/persistence/index.js.map +1 -0
- package/dist/core/persistence/ports.d.ts +124 -0
- package/dist/core/persistence/ports.d.ts.map +1 -0
- package/dist/core/persistence/ports.js +2 -0
- package/dist/core/persistence/ports.js.map +1 -0
- package/dist/core/persistence/title.d.ts +35 -0
- package/dist/core/persistence/title.d.ts.map +1 -0
- package/dist/core/persistence/title.js +137 -0
- package/dist/core/persistence/title.js.map +1 -0
- package/dist/core/question-form/format.d.ts +27 -0
- package/dist/core/question-form/format.d.ts.map +1 -0
- package/dist/core/question-form/format.js +45 -0
- package/dist/core/question-form/format.js.map +1 -0
- package/dist/core/question-form/normalize.d.ts +30 -0
- package/dist/core/question-form/normalize.d.ts.map +1 -0
- package/dist/core/question-form/normalize.js +192 -0
- package/dist/core/question-form/normalize.js.map +1 -0
- package/dist/core/question-form/scan.d.ts +50 -0
- package/dist/core/question-form/scan.d.ts.map +1 -0
- package/dist/core/question-form/scan.js +404 -0
- package/dist/core/question-form/scan.js.map +1 -0
- package/dist/core/question-form/types.d.ts +83 -0
- package/dist/core/question-form/types.d.ts.map +1 -0
- package/dist/core/question-form/types.js +11 -0
- package/dist/core/question-form/types.js.map +1 -0
- package/dist/core/question-form.d.ts +39 -0
- package/dist/core/question-form.d.ts.map +1 -0
- package/dist/core/question-form.js +4 -0
- package/dist/core/question-form.js.map +1 -0
- package/dist/core/todos.d.ts +70 -0
- package/dist/core/todos.d.ts.map +1 -0
- package/dist/core/todos.js +175 -0
- package/dist/core/todos.js.map +1 -0
- package/dist/core/tool-events.d.ts +18 -0
- package/dist/core/tool-events.d.ts.map +1 -0
- package/dist/core/tool-events.js +36 -0
- package/dist/core/tool-events.js.map +1 -0
- package/dist/core/tools.d.ts +51 -0
- package/dist/core/tools.d.ts.map +1 -0
- package/dist/core/tools.js +41 -0
- package/dist/core/tools.js.map +1 -0
- package/dist/core/transcript.d.ts +81 -0
- package/dist/core/transcript.d.ts.map +1 -0
- package/dist/core/transcript.js +133 -0
- package/dist/core/transcript.js.map +1 -0
- package/dist/core/transport.d.ts +109 -0
- package/dist/core/transport.d.ts.map +1 -0
- package/dist/core/transport.js +2 -0
- package/dist/core/transport.js.map +1 -0
- package/dist/core/util/index.d.ts +16 -0
- package/dist/core/util/index.d.ts.map +1 -0
- package/dist/core/util/index.js +16 -0
- package/dist/core/util/index.js.map +1 -0
- package/dist/core/util/manifest.d.ts +39 -0
- package/dist/core/util/manifest.d.ts.map +1 -0
- package/dist/core/util/manifest.js +173 -0
- package/dist/core/util/manifest.js.map +1 -0
- package/dist/core/util/markdown-context.d.ts +47 -0
- package/dist/core/util/markdown-context.d.ts.map +1 -0
- package/dist/core/util/markdown-context.js +125 -0
- package/dist/core/util/markdown-context.js.map +1 -0
- package/dist/core/util/markup-attributes.d.ts +20 -0
- package/dist/core/util/markup-attributes.d.ts.map +1 -0
- package/dist/core/util/markup-attributes.js +33 -0
- package/dist/core/util/markup-attributes.js.map +1 -0
- package/dist/core/util/parser.d.ts +42 -0
- package/dist/core/util/parser.d.ts.map +1 -0
- package/dist/core/util/parser.js +238 -0
- package/dist/core/util/parser.js.map +1 -0
- package/dist/core/util/pointer.d.ts +28 -0
- package/dist/core/util/pointer.d.ts.map +1 -0
- package/dist/core/util/pointer.js +75 -0
- package/dist/core/util/pointer.js.map +1 -0
- package/dist/core/util/recover.d.ts +40 -0
- package/dist/core/util/recover.d.ts.map +1 -0
- package/dist/core/util/recover.js +117 -0
- package/dist/core/util/recover.js.map +1 -0
- package/dist/core/util/strip.d.ts +112 -0
- package/dist/core/util/strip.d.ts.map +1 -0
- package/dist/core/util/strip.js +333 -0
- package/dist/core/util/strip.js.map +1 -0
- package/dist/core/util/types.d.ts +31 -0
- package/dist/core/util/types.d.ts.map +1 -0
- package/dist/core/util/types.js +2 -0
- package/dist/core/util/types.js.map +1 -0
- package/dist/core/util/validate.d.ts +50 -0
- package/dist/core/util/validate.d.ts.map +1 -0
- package/dist/core/util/validate.js +202 -0
- package/dist/core/util/validate.js.map +1 -0
- package/dist/react/agent-bridge/frontend-session-bridge.d.ts +45 -0
- package/dist/react/agent-bridge/frontend-session-bridge.d.ts.map +1 -0
- package/dist/react/agent-bridge/frontend-session-bridge.js +214 -0
- package/dist/react/agent-bridge/frontend-session-bridge.js.map +1 -0
- package/dist/react/artifact-types.d.ts +61 -0
- package/dist/react/artifact-types.d.ts.map +1 -0
- package/dist/react/artifact-types.js +33 -0
- package/dist/react/artifact-types.js.map +1 -0
- package/dist/react/chat-pane.d.ts +21 -0
- package/dist/react/chat-pane.d.ts.map +1 -0
- package/dist/react/chat-pane.js +20 -0
- package/dist/react/chat-pane.js.map +1 -0
- package/dist/react/components/A2uiSurfaceCard.d.ts +35 -0
- package/dist/react/components/A2uiSurfaceCard.d.ts.map +1 -0
- package/dist/react/components/A2uiSurfaceCard.js +272 -0
- package/dist/react/components/A2uiSurfaceCard.js.map +1 -0
- package/dist/react/components/AttachmentTray.d.ts +6 -0
- package/dist/react/components/AttachmentTray.d.ts.map +1 -0
- package/dist/react/components/AttachmentTray.js +30 -0
- package/dist/react/components/AttachmentTray.js.map +1 -0
- package/dist/react/components/ChatFab.d.ts +8 -0
- package/dist/react/components/ChatFab.d.ts.map +1 -0
- package/dist/react/components/ChatFab.js +24 -0
- package/dist/react/components/ChatFab.js.map +1 -0
- package/dist/react/components/Composer.d.ts +34 -0
- package/dist/react/components/Composer.d.ts.map +1 -0
- package/dist/react/components/Composer.js +300 -0
- package/dist/react/components/Composer.js.map +1 -0
- package/dist/react/components/ComposerDiscovery.d.ts +46 -0
- package/dist/react/components/ComposerDiscovery.d.ts.map +1 -0
- package/dist/react/components/ComposerDiscovery.js +38 -0
- package/dist/react/components/ComposerDiscovery.js.map +1 -0
- package/dist/react/components/ConversationList.d.ts +31 -0
- package/dist/react/components/ConversationList.d.ts.map +1 -0
- package/dist/react/components/ConversationList.js +221 -0
- package/dist/react/components/ConversationList.js.map +1 -0
- package/dist/react/components/ExtEventErrorBoundary.d.ts +35 -0
- package/dist/react/components/ExtEventErrorBoundary.d.ts.map +1 -0
- package/dist/react/components/ExtEventErrorBoundary.js +38 -0
- package/dist/react/components/ExtEventErrorBoundary.js.map +1 -0
- package/dist/react/components/Icon.d.ts +17 -0
- package/dist/react/components/Icon.d.ts.map +1 -0
- package/dist/react/components/Icon.js +46 -0
- package/dist/react/components/Icon.js.map +1 -0
- package/dist/react/components/JiniChatProvider.d.ts +45 -0
- package/dist/react/components/JiniChatProvider.d.ts.map +1 -0
- package/dist/react/components/JiniChatProvider.js +44 -0
- package/dist/react/components/JiniChatProvider.js.map +1 -0
- package/dist/react/components/Markdown.d.ts +5 -0
- package/dist/react/components/Markdown.d.ts.map +1 -0
- package/dist/react/components/Markdown.js +390 -0
- package/dist/react/components/Markdown.js.map +1 -0
- package/dist/react/components/McpUiSurfaceCard.d.ts +51 -0
- package/dist/react/components/McpUiSurfaceCard.d.ts.map +1 -0
- package/dist/react/components/McpUiSurfaceCard.js +159 -0
- package/dist/react/components/McpUiSurfaceCard.js.map +1 -0
- package/dist/react/components/MessageList.d.ts +15 -0
- package/dist/react/components/MessageList.d.ts.map +1 -0
- package/dist/react/components/MessageList.js +81 -0
- package/dist/react/components/MessageList.js.map +1 -0
- package/dist/react/components/MessageRow.d.ts +60 -0
- package/dist/react/components/MessageRow.d.ts.map +1 -0
- package/dist/react/components/MessageRow.js +156 -0
- package/dist/react/components/MessageRow.js.map +1 -0
- package/dist/react/components/NextStepActions.d.ts +34 -0
- package/dist/react/components/NextStepActions.d.ts.map +1 -0
- package/dist/react/components/NextStepActions.js +9 -0
- package/dist/react/components/NextStepActions.js.map +1 -0
- package/dist/react/components/QuestionForm.d.ts +26 -0
- package/dist/react/components/QuestionForm.d.ts.map +1 -0
- package/dist/react/components/QuestionForm.js +238 -0
- package/dist/react/components/QuestionForm.js.map +1 -0
- package/dist/react/components/QuestionsPanel.d.ts +13 -0
- package/dist/react/components/QuestionsPanel.d.ts.map +1 -0
- package/dist/react/components/QuestionsPanel.js +33 -0
- package/dist/react/components/QuestionsPanel.js.map +1 -0
- package/dist/react/components/TodoCard.d.ts +8 -0
- package/dist/react/components/TodoCard.d.ts.map +1 -0
- package/dist/react/components/TodoCard.js +29 -0
- package/dist/react/components/TodoCard.js.map +1 -0
- package/dist/react/components/ToolCard.d.ts +22 -0
- package/dist/react/components/ToolCard.d.ts.map +1 -0
- package/dist/react/components/ToolCard.js +298 -0
- package/dist/react/components/ToolCard.js.map +1 -0
- package/dist/react/components/composer-discovery.d.ts +107 -0
- package/dist/react/components/composer-discovery.d.ts.map +1 -0
- package/dist/react/components/composer-discovery.js +176 -0
- package/dist/react/components/composer-discovery.js.map +1 -0
- package/dist/react/ext-event-renderer-registry.d.ts +51 -0
- package/dist/react/ext-event-renderer-registry.d.ts.map +1 -0
- package/dist/react/ext-event-renderer-registry.js +20 -0
- package/dist/react/ext-event-renderer-registry.js.map +1 -0
- package/dist/react/features/chat-pane/agent-tools.d.ts +14 -0
- package/dist/react/features/chat-pane/agent-tools.d.ts.map +1 -0
- package/dist/react/features/chat-pane/agent-tools.js +22 -0
- package/dist/react/features/chat-pane/agent-tools.js.map +1 -0
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts +12 -0
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts.map +1 -0
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.js +106 -0
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.js.map +1 -0
- package/dist/react/features/chat-pane/components/ChatPane.d.ts +10 -0
- package/dist/react/features/chat-pane/components/ChatPane.d.ts.map +1 -0
- package/dist/react/features/chat-pane/components/ChatPane.js +169 -0
- package/dist/react/features/chat-pane/components/ChatPane.js.map +1 -0
- package/dist/react/features/chat-pane/create-daemon-attachment-uploader.d.ts +21 -0
- package/dist/react/features/chat-pane/create-daemon-attachment-uploader.d.ts.map +1 -0
- package/dist/react/features/chat-pane/create-daemon-attachment-uploader.js +213 -0
- package/dist/react/features/chat-pane/create-daemon-attachment-uploader.js.map +1 -0
- package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts +70 -0
- package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts.map +1 -0
- package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.js +76 -0
- package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.d.ts +133 -0
- package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.js +258 -0
- package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts +66 -0
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js +224 -0
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.d.ts +38 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js +252 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.d.ts +16 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.js +59 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.d.ts +26 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.js +74 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.d.ts +25 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.js +88 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.d.ts +38 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.js +184 -0
- package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/index.d.ts +12 -0
- package/dist/react/features/chat-pane/index.d.ts.map +1 -0
- package/dist/react/features/chat-pane/index.js +11 -0
- package/dist/react/features/chat-pane/index.js.map +1 -0
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.d.ts +12 -0
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.js +102 -0
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.js.map +1 -0
- package/dist/react/features/chat-pane/react/components/ChatPane.d.ts +10 -0
- package/dist/react/features/chat-pane/react/components/ChatPane.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/components/ChatPane.js +137 -0
- package/dist/react/features/chat-pane/react/components/ChatPane.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.d.ts +133 -0
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.js +258 -0
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.d.ts +66 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.js +223 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.d.ts +38 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.js +252 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.d.ts +26 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.js +60 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.d.ts +25 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.js +83 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.d.ts +38 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.js +184 -0
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.js.map +1 -0
- package/dist/react/features/chat-pane/react/styles.d.ts +2 -0
- package/dist/react/features/chat-pane/react/styles.d.ts.map +1 -0
- package/dist/react/features/chat-pane/react/styles.js +863 -0
- package/dist/react/features/chat-pane/react/styles.js.map +1 -0
- package/dist/react/features/chat-pane/rules.d.ts +31 -0
- package/dist/react/features/chat-pane/rules.d.ts.map +1 -0
- package/dist/react/features/chat-pane/rules.js +81 -0
- package/dist/react/features/chat-pane/rules.js.map +1 -0
- package/dist/react/features/chat-pane/styles.d.ts +2 -0
- package/dist/react/features/chat-pane/styles.d.ts.map +1 -0
- package/dist/react/features/chat-pane/styles.js +1327 -0
- package/dist/react/features/chat-pane/styles.js.map +1 -0
- package/dist/react/features/chat-pane/types.d.ts +248 -0
- package/dist/react/features/chat-pane/types.d.ts.map +1 -0
- package/dist/react/features/chat-pane/types.js +2 -0
- package/dist/react/features/chat-pane/types.js.map +1 -0
- package/dist/react/features/model-picker/components/CredentialStatusBadge.d.ts +7 -0
- package/dist/react/features/model-picker/components/CredentialStatusBadge.d.ts.map +1 -0
- package/dist/react/features/model-picker/components/CredentialStatusBadge.js +20 -0
- package/dist/react/features/model-picker/components/CredentialStatusBadge.js.map +1 -0
- package/dist/react/features/model-picker/components/ModelPicker.d.ts +9 -0
- package/dist/react/features/model-picker/components/ModelPicker.d.ts.map +1 -0
- package/dist/react/features/model-picker/components/ModelPicker.js +34 -0
- package/dist/react/features/model-picker/components/ModelPicker.js.map +1 -0
- package/dist/react/features/model-picker/constants.d.ts +6 -0
- package/dist/react/features/model-picker/constants.d.ts.map +1 -0
- package/dist/react/features/model-picker/constants.js +9 -0
- package/dist/react/features/model-picker/constants.js.map +1 -0
- package/dist/react/features/model-picker/dependencies.d.ts +11 -0
- package/dist/react/features/model-picker/dependencies.d.ts.map +1 -0
- package/dist/react/features/model-picker/dependencies.js +10 -0
- package/dist/react/features/model-picker/dependencies.js.map +1 -0
- package/dist/react/features/model-picker/hooks/useModelPicker.hooks.d.ts +27 -0
- package/dist/react/features/model-picker/hooks/useModelPicker.hooks.d.ts.map +1 -0
- package/dist/react/features/model-picker/hooks/useModelPicker.hooks.js +62 -0
- package/dist/react/features/model-picker/hooks/useModelPicker.hooks.js.map +1 -0
- package/dist/react/features/model-picker/index.d.ts +32 -0
- package/dist/react/features/model-picker/index.d.ts.map +1 -0
- package/dist/react/features/model-picker/index.js +29 -0
- package/dist/react/features/model-picker/index.js.map +1 -0
- package/dist/react/features/model-picker/ports.d.ts +11 -0
- package/dist/react/features/model-picker/ports.d.ts.map +1 -0
- package/dist/react/features/model-picker/ports.js +2 -0
- package/dist/react/features/model-picker/ports.js.map +1 -0
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.d.ts +7 -0
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.d.ts.map +1 -0
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.js +20 -0
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.js.map +1 -0
- package/dist/react/features/model-picker/react/components/ModelPicker.d.ts +9 -0
- package/dist/react/features/model-picker/react/components/ModelPicker.d.ts.map +1 -0
- package/dist/react/features/model-picker/react/components/ModelPicker.js +34 -0
- package/dist/react/features/model-picker/react/components/ModelPicker.js.map +1 -0
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.d.ts +27 -0
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.d.ts.map +1 -0
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.js +62 -0
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.js.map +1 -0
- package/dist/react/features/model-picker/rules.d.ts +26 -0
- package/dist/react/features/model-picker/rules.d.ts.map +1 -0
- package/dist/react/features/model-picker/rules.js +84 -0
- package/dist/react/features/model-picker/rules.js.map +1 -0
- package/dist/react/features/model-picker/types.d.ts +38 -0
- package/dist/react/features/model-picker/types.d.ts.map +1 -0
- package/dist/react/features/model-picker/types.js +2 -0
- package/dist/react/features/model-picker/types.js.map +1 -0
- package/dist/react/hooks/composer-draft-cache.d.ts +65 -0
- package/dist/react/hooks/composer-draft-cache.d.ts.map +1 -0
- package/dist/react/hooks/composer-draft-cache.js +89 -0
- package/dist/react/hooks/composer-draft-cache.js.map +1 -0
- package/dist/react/hooks/context.d.ts +18 -0
- package/dist/react/hooks/context.d.ts.map +1 -0
- package/dist/react/hooks/context.js +60 -0
- package/dist/react/hooks/context.js.map +1 -0
- package/dist/react/hooks/testing/fake-transport.d.ts +34 -0
- package/dist/react/hooks/testing/fake-transport.d.ts.map +1 -0
- package/dist/react/hooks/testing/fake-transport.js +46 -0
- package/dist/react/hooks/testing/fake-transport.js.map +1 -0
- package/dist/react/hooks/useArtifactStream.d.ts +18 -0
- package/dist/react/hooks/useArtifactStream.d.ts.map +1 -0
- package/dist/react/hooks/useArtifactStream.js +55 -0
- package/dist/react/hooks/useArtifactStream.js.map +1 -0
- package/dist/react/hooks/useChatFabDrag.d.ts +25 -0
- package/dist/react/hooks/useChatFabDrag.d.ts.map +1 -0
- package/dist/react/hooks/useChatFabDrag.js +88 -0
- package/dist/react/hooks/useChatFabDrag.js.map +1 -0
- package/dist/react/hooks/useComposer.d.ts +48 -0
- package/dist/react/hooks/useComposer.d.ts.map +1 -0
- package/dist/react/hooks/useComposer.js +121 -0
- package/dist/react/hooks/useComposer.js.map +1 -0
- package/dist/react/hooks/useConversation.d.ts +34 -0
- package/dist/react/hooks/useConversation.d.ts.map +1 -0
- package/dist/react/hooks/useConversation.js +163 -0
- package/dist/react/hooks/useConversation.js.map +1 -0
- package/dist/react/hooks/useCopyToClipboard.d.ts +14 -0
- package/dist/react/hooks/useCopyToClipboard.d.ts.map +1 -0
- package/dist/react/hooks/useCopyToClipboard.js +98 -0
- package/dist/react/hooks/useCopyToClipboard.js.map +1 -0
- package/dist/react/hooks/useExtEventGroups.d.ts +7 -0
- package/dist/react/hooks/useExtEventGroups.d.ts.map +1 -0
- package/dist/react/hooks/useExtEventGroups.js +32 -0
- package/dist/react/hooks/useExtEventGroups.js.map +1 -0
- package/dist/react/hooks/useLatestOperation.d.ts +31 -0
- package/dist/react/hooks/useLatestOperation.d.ts.map +1 -0
- package/dist/react/hooks/useLatestOperation.js +74 -0
- package/dist/react/hooks/useLatestOperation.js.map +1 -0
- package/dist/react/hooks/usePinnedTodos.d.ts +15 -0
- package/dist/react/hooks/usePinnedTodos.d.ts.map +1 -0
- package/dist/react/hooks/usePinnedTodos.js +43 -0
- package/dist/react/hooks/usePinnedTodos.js.map +1 -0
- package/dist/react/hooks/useQuestionForms.d.ts +28 -0
- package/dist/react/hooks/useQuestionForms.d.ts.map +1 -0
- package/dist/react/hooks/useQuestionForms.js +113 -0
- package/dist/react/hooks/useQuestionForms.js.map +1 -0
- package/dist/react/hooks/useRunStream.d.ts +27 -0
- package/dist/react/hooks/useRunStream.d.ts.map +1 -0
- package/dist/react/hooks/useRunStream.js +180 -0
- package/dist/react/hooks/useRunStream.js.map +1 -0
- package/dist/react/hooks/useToolTimeline.d.ts +33 -0
- package/dist/react/hooks/useToolTimeline.d.ts.map +1 -0
- package/dist/react/hooks/useToolTimeline.js +47 -0
- package/dist/react/hooks/useToolTimeline.js.map +1 -0
- package/dist/react/index.d.ts +158 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +118 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/message-blocks.d.ts +86 -0
- package/dist/react/message-blocks.d.ts.map +1 -0
- package/dist/react/message-blocks.js +78 -0
- package/dist/react/message-blocks.js.map +1 -0
- package/dist/react/poc-mcp-ui-official/PocMcpUiCard.d.ts +9 -0
- package/dist/react/poc-mcp-ui-official/PocMcpUiCard.d.ts.map +1 -0
- package/dist/react/poc-mcp-ui-official/PocMcpUiCard.js +29 -0
- package/dist/react/poc-mcp-ui-official/PocMcpUiCard.js.map +1 -0
- package/dist/react/poc-mcp-ui-official/create-poc-resource.d.ts +30 -0
- package/dist/react/poc-mcp-ui-official/create-poc-resource.d.ts.map +1 -0
- package/dist/react/poc-mcp-ui-official/create-poc-resource.js +44 -0
- package/dist/react/poc-mcp-ui-official/create-poc-resource.js.map +1 -0
- package/dist/react/slots.d.ts +215 -0
- package/dist/react/slots.d.ts.map +1 -0
- package/dist/react/slots.js +2 -0
- package/dist/react/slots.js.map +1 -0
- package/dist/react/styles/reference.css +298 -0
- package/dist/react/tool-renderer-registry.d.ts +41 -0
- package/dist/react/tool-renderer-registry.d.ts.map +1 -0
- package/dist/react/tool-renderer-registry.js +22 -0
- package/dist/react/tool-renderer-registry.js.map +1 -0
- package/dist/react/util/defined-props.d.ts +31 -0
- package/dist/react/util/defined-props.d.ts.map +1 -0
- package/dist/react/util/defined-props.js +28 -0
- package/dist/react/util/defined-props.js.map +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module transport
|
|
3
|
+
*
|
|
4
|
+
* The `ChatTransport` port — the single seam a host uses to reach a real
|
|
5
|
+
* agent runtime (SSE/fetch, WebSocket, a local daemon, an in-memory fake for
|
|
6
|
+
* tests).
|
|
7
|
+
*
|
|
8
|
+
* Moved here from `@jini-ai/chat-react` on 2026-07-29. The port is pure types over
|
|
9
|
+
* `AbortSignal` — no React, no DOM, no transport implementation — so keeping it in the React
|
|
10
|
+
* adapter meant a non-React host had to depend on the React package just to name the seam it
|
|
11
|
+
* implements. `@jini-ai/chat-react` re-exports every name below, so nothing that already imported
|
|
12
|
+
* them from there needs to change; no hook or component there constructs an
|
|
13
|
+
* `EventSource`/`fetch`/`WebSocket` directly — each receives a `ChatTransport` (via
|
|
14
|
+
* `<JiniChatProvider transport={...}>` or as a direct hook argument) and calls through it.
|
|
15
|
+
*
|
|
16
|
+
* Generalizes OD's `providers/daemon.ts` `streamViaDaemon` +
|
|
17
|
+
* `DaemonStreamHandlers` (`daemon.ts:261`, `daemon.ts:594`) — verified
|
|
18
|
+
* against the real source at
|
|
19
|
+
* `apps/web/src/providers/daemon.ts` (branch `refactor/web-chat-pane-slice`,
|
|
20
|
+
* commit `58fe4358747bd08b82c36947f1ff05aa5fa6a02a`). See
|
|
21
|
+
* `ADS-memory/reports/jini-port/recon/r4b-webui-design.md` §2 for the target shape this
|
|
22
|
+
* module implements verbatim.
|
|
23
|
+
*/
|
|
24
|
+
import type { AgentEvent } from './events.js';
|
|
25
|
+
import type { ChatAttachment, ChatMessage, ChatRunStatus } from './messages.js';
|
|
26
|
+
/**
|
|
27
|
+
* Per-run event handlers a `ChatTransport` invokes as a run streams.
|
|
28
|
+
* Mirrors `DaemonStreamHandlers` (`onAgentEvent`/`onToolInputDelta`) plus the
|
|
29
|
+
* generic `StreamHandlers` `onError`/`onDone` pair the OD original composed
|
|
30
|
+
* via `extends`.
|
|
31
|
+
*/
|
|
32
|
+
export interface RunHandlers {
|
|
33
|
+
/** Fired once per renderable unit of agent output. */
|
|
34
|
+
onEvent: (ev: AgentEvent) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Live-only incremental tool-input fragment (e.g. Claude's
|
|
37
|
+
* `input_json_delta`). Ephemeral — never persisted; a consumer accumulates
|
|
38
|
+
* by tool-use `id` for a live preview and discards it once the full
|
|
39
|
+
* `tool_use` event arrives.
|
|
40
|
+
*/
|
|
41
|
+
onToolInputDelta?: (id: string, name: string, delta: string) => void;
|
|
42
|
+
onError: (err: Error) => void;
|
|
43
|
+
/** Fired once the run reaches a terminal state, with the full event log. */
|
|
44
|
+
onDone: (finalEvents: AgentEvent[]) => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Opaque per-host payload threaded through to the transport unmodified (OD:
|
|
48
|
+
* `projectId`/`skillIds`/`designSystemId`; another host: whatever its own
|
|
49
|
+
* run-scoping concept is). This package never reads its fields.
|
|
50
|
+
*/
|
|
51
|
+
export type RunContext = Record<string, unknown>;
|
|
52
|
+
export interface StartRunInput {
|
|
53
|
+
history: ChatMessage[];
|
|
54
|
+
agentId?: string;
|
|
55
|
+
conversationId?: string | null;
|
|
56
|
+
attachments?: ChatAttachment[];
|
|
57
|
+
context?: RunContext;
|
|
58
|
+
/** Stops the browser-side subscription; the run continues host-side. */
|
|
59
|
+
signal: AbortSignal;
|
|
60
|
+
/** Explicit user cancellation — distinct from `signal` (see OD's `cancelSignal`). */
|
|
61
|
+
cancelSignal?: AbortSignal;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Per-reattachment options. Separate from the positional `runId`/`handlers` pair, and optional, so
|
|
65
|
+
* an existing implementation stays type-compatible without edits.
|
|
66
|
+
*/
|
|
67
|
+
export interface ReattachRunOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Stops the browser-side subscription; the run continues host-side. Exactly what
|
|
70
|
+
* `StartRunInput.signal` is to `startRun`.
|
|
71
|
+
*
|
|
72
|
+
* `reattachRun` had no cancellation seam at all until 2026-07-29, and that was a resource leak
|
|
73
|
+
* rather than a missing convenience: a reattached SSE/WebSocket stream can outlive the component
|
|
74
|
+
* that opened it by as long as the run itself runs, and the shipped `useRunStream` hook was
|
|
75
|
+
* already creating (and aborting on unmount/reset/replacement) a controller it had no way to hand
|
|
76
|
+
* to the transport. The connection and its read loop simply kept going.
|
|
77
|
+
*/
|
|
78
|
+
readonly signal?: AbortSignal;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The transport port. A host binds exactly one implementation (a real
|
|
82
|
+
* SSE/fetch adapter, a WebSocket adapter, or a fake for tests/demos) and
|
|
83
|
+
* passes it to `<JiniChatProvider>`. Every headless hook in this package
|
|
84
|
+
* that performs I/O receives this port — none constructs its own transport.
|
|
85
|
+
*/
|
|
86
|
+
export interface ChatTransport {
|
|
87
|
+
startRun(input: StartRunInput, handlers: RunHandlers): Promise<{
|
|
88
|
+
runId: string;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Resume listening to an already-started run (reconnect/replay).
|
|
92
|
+
*
|
|
93
|
+
* An implementation that opens a long-lived stream **must** honor `options.signal` — it is the
|
|
94
|
+
* only way a caller can detach. See {@link ReattachRunOptions.signal}.
|
|
95
|
+
*/
|
|
96
|
+
reattachRun(runId: string, handlers: RunHandlers, options?: ReattachRunOptions): Promise<void>;
|
|
97
|
+
fetchRunStatus(runId: string): Promise<ChatRunStatus | null>;
|
|
98
|
+
stopRun(runId: string): Promise<void>;
|
|
99
|
+
reportFeedback?(change: FeedbackChange): Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
export interface FeedbackChange {
|
|
102
|
+
messageId: string;
|
|
103
|
+
runId?: string;
|
|
104
|
+
rating: 'positive' | 'negative';
|
|
105
|
+
reasonCode?: string;
|
|
106
|
+
note?: string;
|
|
107
|
+
}
|
|
108
|
+
export type OnFeedback = (change: FeedbackChange) => void;
|
|
109
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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Aa,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClF;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAC7D,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,cAAc,CAAC,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/core/transport.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module artifacts
|
|
3
|
+
* Barrel for the artifact parsing/validation/recovery surface. Deliberately
|
|
4
|
+
* omits `./markdown-context.js` and `./markup-attributes.js`, which are
|
|
5
|
+
* internal implementation details shared by `./parser.js` and `./strip.js`
|
|
6
|
+
* (and, for `markup-attributes.js`, `../question-form/scan.js`), not part
|
|
7
|
+
* of this package's public API.
|
|
8
|
+
*/
|
|
9
|
+
export * from './types.js';
|
|
10
|
+
export * from './parser.js';
|
|
11
|
+
export * from './strip.js';
|
|
12
|
+
export * from './validate.js';
|
|
13
|
+
export * from './manifest.js';
|
|
14
|
+
export * from './recover.js';
|
|
15
|
+
export * from './pointer.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/util/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module artifacts
|
|
3
|
+
* Barrel for the artifact parsing/validation/recovery surface. Deliberately
|
|
4
|
+
* omits `./markdown-context.js` and `./markup-attributes.js`, which are
|
|
5
|
+
* internal implementation details shared by `./parser.js` and `./strip.js`
|
|
6
|
+
* (and, for `markup-attributes.js`, `../question-form/scan.js`), not part
|
|
7
|
+
* of this package's public API.
|
|
8
|
+
*/
|
|
9
|
+
export * from './types.js';
|
|
10
|
+
export * from './parser.js';
|
|
11
|
+
export * from './strip.js';
|
|
12
|
+
export * from './validate.js';
|
|
13
|
+
export * from './manifest.js';
|
|
14
|
+
export * from './recover.js';
|
|
15
|
+
export * from './pointer.js';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/util/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module manifest
|
|
3
|
+
*
|
|
4
|
+
* Create, serialize, parse, and infer the sidecar `ArtifactManifest` a
|
|
5
|
+
* generated file carries. See `./types.js` for the manifest shape itself.
|
|
6
|
+
*/
|
|
7
|
+
import type { ArtifactManifest } from './types.js';
|
|
8
|
+
/** The manifest sidecar file name convention for a given artifact entry file name. */
|
|
9
|
+
export declare function artifactManifestNameFor(entry: string): string;
|
|
10
|
+
/** Build a fresh, complete manifest for a newly-persisted HTML artifact. */
|
|
11
|
+
export declare function createHtmlArtifactManifest(input: {
|
|
12
|
+
entry: string;
|
|
13
|
+
title: string;
|
|
14
|
+
metadata?: Record<string, unknown>;
|
|
15
|
+
sourceSkillId?: string;
|
|
16
|
+
designSystemId?: string | null;
|
|
17
|
+
}): ArtifactManifest;
|
|
18
|
+
export declare function serializeArtifactManifest(manifest: ArtifactManifest): string;
|
|
19
|
+
/**
|
|
20
|
+
* Parse and validate a manifest JSON string, rejecting anything that isn't a
|
|
21
|
+
* well-formed, currently-supported manifest (wrong version, missing
|
|
22
|
+
* required fields, or a `kind`/`renderer`/`status`/`exports` value outside
|
|
23
|
+
* the known sets).
|
|
24
|
+
*
|
|
25
|
+
* @returns The validated manifest, or `null` on any parse/shape failure.
|
|
26
|
+
* @complexity O(k) in the manifest's own field/array count — no I/O.
|
|
27
|
+
*/
|
|
28
|
+
export declare function parseArtifactManifest(raw: string): ArtifactManifest | null;
|
|
29
|
+
/**
|
|
30
|
+
* Infer a manifest for a legacy artifact file that predates manifest
|
|
31
|
+
* sidecars, from its entry file name alone (extension → kind → renderer).
|
|
32
|
+
* @returns `null` when the extension isn't a recognized artifact kind.
|
|
33
|
+
*/
|
|
34
|
+
export declare function inferLegacyManifest(input: {
|
|
35
|
+
entry: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
metadata?: Record<string, unknown>;
|
|
38
|
+
}): ArtifactManifest | null;
|
|
39
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/core/util/manifest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAoC,gBAAgB,EAAsC,MAAM,YAAY,CAAC;AA2DzH,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,4EAA4E;AAC5E,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,GAAG,gBAAgB,CAiBnB;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAE5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAoC1E;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,gBAAgB,GAAG,IAAI,CA4BzI"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
const MANIFEST_VERSION = 1;
|
|
2
|
+
const ALLOWED_KINDS = new Set([
|
|
3
|
+
'html',
|
|
4
|
+
'deck',
|
|
5
|
+
'react-component',
|
|
6
|
+
'markdown-document',
|
|
7
|
+
'svg',
|
|
8
|
+
'diagram',
|
|
9
|
+
'code-snippet',
|
|
10
|
+
'mini-app',
|
|
11
|
+
'design-system',
|
|
12
|
+
]);
|
|
13
|
+
const ALLOWED_RENDERERS = new Set([
|
|
14
|
+
'html',
|
|
15
|
+
'deck-html',
|
|
16
|
+
'react-component',
|
|
17
|
+
'markdown',
|
|
18
|
+
'svg',
|
|
19
|
+
'diagram',
|
|
20
|
+
'code',
|
|
21
|
+
'mini-app',
|
|
22
|
+
'design-system',
|
|
23
|
+
]);
|
|
24
|
+
const ALLOWED_EXPORTS = new Set(['html', 'pdf', 'zip', 'jsx', 'md', 'svg', 'txt']);
|
|
25
|
+
const ALLOWED_STATUS = new Set(['streaming', 'complete', 'error']);
|
|
26
|
+
function normalizeExt(name) {
|
|
27
|
+
const i = name.lastIndexOf('.');
|
|
28
|
+
return i >= 0 ? name.slice(i).toLowerCase() : '';
|
|
29
|
+
}
|
|
30
|
+
function inferKindFromEntry(entry) {
|
|
31
|
+
const ext = normalizeExt(entry);
|
|
32
|
+
if (['.html', '.htm'].includes(ext))
|
|
33
|
+
return 'html';
|
|
34
|
+
if (ext === '.svg')
|
|
35
|
+
return 'svg';
|
|
36
|
+
if (ext === '.md')
|
|
37
|
+
return 'markdown-document';
|
|
38
|
+
if (['.jsx', '.tsx'].includes(ext))
|
|
39
|
+
return 'react-component';
|
|
40
|
+
if (['.js', '.ts', '.json', '.css'].includes(ext))
|
|
41
|
+
return 'code-snippet';
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
function exportsForKind(kind) {
|
|
45
|
+
if (kind === 'deck')
|
|
46
|
+
return ['html', 'pdf', 'zip'];
|
|
47
|
+
if (kind === 'react-component')
|
|
48
|
+
return ['jsx', 'html', 'zip'];
|
|
49
|
+
if (kind === 'markdown-document')
|
|
50
|
+
return ['md', 'html', 'pdf', 'zip'];
|
|
51
|
+
if (kind === 'svg' || kind === 'diagram')
|
|
52
|
+
return ['svg', 'zip'];
|
|
53
|
+
if (kind === 'code-snippet')
|
|
54
|
+
return ['txt', 'zip'];
|
|
55
|
+
return ['html', 'pdf', 'zip'];
|
|
56
|
+
}
|
|
57
|
+
/** The manifest sidecar file name convention for a given artifact entry file name. */
|
|
58
|
+
export function artifactManifestNameFor(entry) {
|
|
59
|
+
return `${entry}.artifact.json`;
|
|
60
|
+
}
|
|
61
|
+
/** Build a fresh, complete manifest for a newly-persisted HTML artifact. */
|
|
62
|
+
export function createHtmlArtifactManifest(input) {
|
|
63
|
+
const now = new Date().toISOString();
|
|
64
|
+
return {
|
|
65
|
+
version: MANIFEST_VERSION,
|
|
66
|
+
kind: 'html',
|
|
67
|
+
title: input.title,
|
|
68
|
+
entry: input.entry,
|
|
69
|
+
renderer: 'html',
|
|
70
|
+
status: 'complete',
|
|
71
|
+
exports: ['html', 'pdf', 'zip'],
|
|
72
|
+
primary: true,
|
|
73
|
+
createdAt: now,
|
|
74
|
+
updatedAt: now,
|
|
75
|
+
sourceSkillId: input.sourceSkillId,
|
|
76
|
+
designSystemId: input.designSystemId,
|
|
77
|
+
metadata: input.metadata,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export function serializeArtifactManifest(manifest) {
|
|
81
|
+
return JSON.stringify(manifest, null, 2);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Parse and validate a manifest JSON string, rejecting anything that isn't a
|
|
85
|
+
* well-formed, currently-supported manifest (wrong version, missing
|
|
86
|
+
* required fields, or a `kind`/`renderer`/`status`/`exports` value outside
|
|
87
|
+
* the known sets).
|
|
88
|
+
*
|
|
89
|
+
* @returns The validated manifest, or `null` on any parse/shape failure.
|
|
90
|
+
* @complexity O(k) in the manifest's own field/array count — no I/O.
|
|
91
|
+
*/
|
|
92
|
+
export function parseArtifactManifest(raw) {
|
|
93
|
+
try {
|
|
94
|
+
const parsed = JSON.parse(raw);
|
|
95
|
+
if (parsed?.version !== MANIFEST_VERSION)
|
|
96
|
+
return null;
|
|
97
|
+
if (typeof parsed.entry !== 'string' || !parsed.entry)
|
|
98
|
+
return null;
|
|
99
|
+
if (typeof parsed.title !== 'string' || !parsed.title)
|
|
100
|
+
return null;
|
|
101
|
+
if (!Array.isArray(parsed.exports))
|
|
102
|
+
return null;
|
|
103
|
+
if (typeof parsed.kind !== 'string' || typeof parsed.renderer !== 'string') {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
if (!ALLOWED_KINDS.has(parsed.kind))
|
|
107
|
+
return null;
|
|
108
|
+
if (!ALLOWED_RENDERERS.has(parsed.renderer))
|
|
109
|
+
return null;
|
|
110
|
+
if (parsed.status !== undefined && !ALLOWED_STATUS.has(parsed.status)) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
if (parsed.exports.length === 0)
|
|
114
|
+
return null;
|
|
115
|
+
if (parsed.exports.some((value) => !ALLOWED_EXPORTS.has(value)))
|
|
116
|
+
return null;
|
|
117
|
+
return {
|
|
118
|
+
version: MANIFEST_VERSION,
|
|
119
|
+
kind: parsed.kind,
|
|
120
|
+
title: parsed.title,
|
|
121
|
+
entry: parsed.entry,
|
|
122
|
+
renderer: parsed.renderer,
|
|
123
|
+
status: ALLOWED_STATUS.has(parsed.status) ? parsed.status : 'complete',
|
|
124
|
+
exports: parsed.exports,
|
|
125
|
+
primary: parsed.primary === true || typeof parsed.primary === 'string' ? parsed.primary : undefined,
|
|
126
|
+
supportingFiles: Array.isArray(parsed.supportingFiles) ? parsed.supportingFiles.filter((x) => typeof x === 'string') : undefined,
|
|
127
|
+
createdAt: typeof parsed.createdAt === 'string' ? parsed.createdAt : undefined,
|
|
128
|
+
updatedAt: typeof parsed.updatedAt === 'string' ? parsed.updatedAt : undefined,
|
|
129
|
+
sourceSkillId: typeof parsed.sourceSkillId === 'string' ? parsed.sourceSkillId : undefined,
|
|
130
|
+
designSystemId: typeof parsed.designSystemId === 'string' || parsed.designSystemId === null ? parsed.designSystemId : undefined,
|
|
131
|
+
metadata: parsed.metadata && typeof parsed.metadata === 'object' && !Array.isArray(parsed.metadata) ? parsed.metadata : undefined,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Infer a manifest for a legacy artifact file that predates manifest
|
|
140
|
+
* sidecars, from its entry file name alone (extension → kind → renderer).
|
|
141
|
+
* @returns `null` when the extension isn't a recognized artifact kind.
|
|
142
|
+
*/
|
|
143
|
+
export function inferLegacyManifest(input) {
|
|
144
|
+
const kind = inferKindFromEntry(input.entry);
|
|
145
|
+
if (!kind)
|
|
146
|
+
return null;
|
|
147
|
+
const lowerEntry = input.entry.toLowerCase();
|
|
148
|
+
const isDeck = kind === 'html' && (lowerEntry.includes('deck') || lowerEntry.includes('slides') || lowerEntry.includes('pitch'));
|
|
149
|
+
const renderer = isDeck
|
|
150
|
+
? 'deck-html'
|
|
151
|
+
: kind === 'html'
|
|
152
|
+
? 'html'
|
|
153
|
+
: kind === 'markdown-document'
|
|
154
|
+
? 'markdown'
|
|
155
|
+
: kind === 'react-component'
|
|
156
|
+
? 'react-component'
|
|
157
|
+
: kind === 'code-snippet'
|
|
158
|
+
? 'code'
|
|
159
|
+
: kind; // only 'svg' remains — a valid ArtifactRendererId as-is
|
|
160
|
+
const resolvedKind = isDeck ? 'deck' : kind;
|
|
161
|
+
return {
|
|
162
|
+
version: MANIFEST_VERSION,
|
|
163
|
+
kind: resolvedKind,
|
|
164
|
+
title: input.title || input.entry,
|
|
165
|
+
entry: input.entry,
|
|
166
|
+
renderer,
|
|
167
|
+
status: 'complete',
|
|
168
|
+
exports: exportsForKind(resolvedKind),
|
|
169
|
+
primary: resolvedKind === 'html' || resolvedKind === 'deck' ? true : undefined,
|
|
170
|
+
metadata: input.metadata,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/core/util/manifest.ts"],"names":[],"mappings":"AAQA,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC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AAI,KAAK,cAAc;wBACvB,CAAC,CAAC,MAAM;wBACR,CAAC,CAAC,IAAI,CAAC,CAAC,wDAAwD;IAC1E,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5C,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK;QACjC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,QAAQ;QACR,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC;QACrC,OAAO,EAAE,YAAY,KAAK,MAAM,IAAI,YAAY,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAC9E,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module markdown-context
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
5
|
+
* Shared Markdown-context helpers used by both the streaming artifact parser
|
|
6
|
+
* ({@link ./parser.js}) and the post-stream `<artifact>` stripper
|
|
7
|
+
* ({@link ./strip.js}). The single source of truth for what counts as a
|
|
8
|
+
* fenced code block or an inline code span, so the parser/stripper's view of
|
|
9
|
+
* a buffer matches what a Markdown-rendering chat surface will actually
|
|
10
|
+
* render — anything that "looks like" an artifact tag inside one of these
|
|
11
|
+
* regions is literal Markdown and must not be treated as a real protocol tag.
|
|
12
|
+
*
|
|
13
|
+
* Not part of the package's public surface (no `index.ts` re-export): it is
|
|
14
|
+
* an implementation detail shared by two sibling modules, not a name a
|
|
15
|
+
* consumer should depend on directly.
|
|
16
|
+
*/
|
|
17
|
+
export declare const FENCE_OPEN_RE: RegExp;
|
|
18
|
+
export declare const FENCE_CLOSE_RE: RegExp;
|
|
19
|
+
export declare const INLINE_CODE_RE: RegExp;
|
|
20
|
+
/**
|
|
21
|
+
* `<artifact` followed by whitespace is a real protocol open tag; any other
|
|
22
|
+
* continuation (e.g. `<artifactual`) is a prefix-shared literal that must
|
|
23
|
+
* not be treated as a tag.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isRealArtifactOpenAt(content: string, idx: number): boolean;
|
|
26
|
+
export type Range = readonly [number, number];
|
|
27
|
+
/**
|
|
28
|
+
* Compute the half-open `[start, end)` ranges of `buffer` that a Markdown
|
|
29
|
+
* renderer would treat as fenced code blocks or inline code spans. The
|
|
30
|
+
* `unclosedFenceStart` is the index of an opening fence with no matching
|
|
31
|
+
* close in the buffer (or `null` if every fence is closed) — the streaming
|
|
32
|
+
* parser uses it to hold back rendering; the stripper ignores it.
|
|
33
|
+
*
|
|
34
|
+
* Lines without a terminating `\n` (a trailing partial line during
|
|
35
|
+
* streaming) are not classified as fence delimiters here; callers that care
|
|
36
|
+
* about partial-tail behavior inspect the tail themselves.
|
|
37
|
+
*
|
|
38
|
+
* @complexity O(n) in `buffer.length` — one line-by-line scan plus one
|
|
39
|
+
* backtick scan per accumulated paragraph block.
|
|
40
|
+
*/
|
|
41
|
+
export declare function computeSkipRanges(buffer: string): {
|
|
42
|
+
ranges: Range[];
|
|
43
|
+
unclosedFenceStart: number | null;
|
|
44
|
+
};
|
|
45
|
+
/** `true` when position `p` falls inside one of `ranges` (half-open intervals). */
|
|
46
|
+
export declare function rangeContains(ranges: ReadonlyArray<Range>, p: number): boolean;
|
|
47
|
+
//# sourceMappingURL=markdown-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-context.d.ts","sourceRoot":"","sources":["../../../src/core/util/markdown-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,eAAO,MAAM,aAAa,QAAyB,CAAC;AACpD,eAAO,MAAM,cAAc,QAAa,CAAC;AAGzC,eAAO,MAAM,cAAc,QAAa,CAAC;AAUzC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAG1E;AAED,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG;IACjD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAwDA;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAK9E"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module markdown-context
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
5
|
+
* Shared Markdown-context helpers used by both the streaming artifact parser
|
|
6
|
+
* ({@link ./parser.js}) and the post-stream `<artifact>` stripper
|
|
7
|
+
* ({@link ./strip.js}). The single source of truth for what counts as a
|
|
8
|
+
* fenced code block or an inline code span, so the parser/stripper's view of
|
|
9
|
+
* a buffer matches what a Markdown-rendering chat surface will actually
|
|
10
|
+
* render — anything that "looks like" an artifact tag inside one of these
|
|
11
|
+
* regions is literal Markdown and must not be treated as a real protocol tag.
|
|
12
|
+
*
|
|
13
|
+
* Not part of the package's public surface (no `index.ts` re-export): it is
|
|
14
|
+
* an implementation detail shared by two sibling modules, not a name a
|
|
15
|
+
* consumer should depend on directly.
|
|
16
|
+
*/
|
|
17
|
+
// Line-anchored fence delimiters. Deliberately asymmetric: an opening fence
|
|
18
|
+
// may carry an info string (e.g. ```html), a closing fence must be a bare
|
|
19
|
+
// triple-backtick line. Neither permits leading indentation — an indented
|
|
20
|
+
// " ```" line renders as a paragraph, not a fence.
|
|
21
|
+
export const FENCE_OPEN_RE = /^```(\w[\w+-]*)?\s*$/;
|
|
22
|
+
export const FENCE_CLOSE_RE = /^```\s*$/;
|
|
23
|
+
// Inline code span (single-backtick pair).
|
|
24
|
+
export const INLINE_CODE_RE = /`[^`]+`/g;
|
|
25
|
+
// Paragraph-break recognizers — mirror a typical Markdown paragraph-block
|
|
26
|
+
// walker's block-starter set (heading / list item / blank line). A block
|
|
27
|
+
// boundary caps how far inline-code backtick pairing can reach: backticks
|
|
28
|
+
// never pair across it in the rendered output.
|
|
29
|
+
const HEADING_RE = /^#{1,4}\s+/;
|
|
30
|
+
const UL_ITEM_RE = /^\s*[-*+]\s+/;
|
|
31
|
+
const OL_ITEM_RE = /^\s*\d+\.\s+/;
|
|
32
|
+
/**
|
|
33
|
+
* `<artifact` followed by whitespace is a real protocol open tag; any other
|
|
34
|
+
* continuation (e.g. `<artifactual`) is a prefix-shared literal that must
|
|
35
|
+
* not be treated as a tag.
|
|
36
|
+
*/
|
|
37
|
+
export function isRealArtifactOpenAt(content, idx) {
|
|
38
|
+
const next = content.charAt(idx + '<artifact'.length);
|
|
39
|
+
return next !== '' && /\s/.test(next);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Compute the half-open `[start, end)` ranges of `buffer` that a Markdown
|
|
43
|
+
* renderer would treat as fenced code blocks or inline code spans. The
|
|
44
|
+
* `unclosedFenceStart` is the index of an opening fence with no matching
|
|
45
|
+
* close in the buffer (or `null` if every fence is closed) — the streaming
|
|
46
|
+
* parser uses it to hold back rendering; the stripper ignores it.
|
|
47
|
+
*
|
|
48
|
+
* Lines without a terminating `\n` (a trailing partial line during
|
|
49
|
+
* streaming) are not classified as fence delimiters here; callers that care
|
|
50
|
+
* about partial-tail behavior inspect the tail themselves.
|
|
51
|
+
*
|
|
52
|
+
* @complexity O(n) in `buffer.length` — one line-by-line scan plus one
|
|
53
|
+
* backtick scan per accumulated paragraph block.
|
|
54
|
+
*/
|
|
55
|
+
export function computeSkipRanges(buffer) {
|
|
56
|
+
const ranges = [];
|
|
57
|
+
// Paragraph-block regions are contiguous spans of paragraph lines outside
|
|
58
|
+
// any fenced code block; inline-code scanning is restricted to one block at
|
|
59
|
+
// a time so backticks never pair across a block boundary.
|
|
60
|
+
const blockRegions = [];
|
|
61
|
+
let pos = 0;
|
|
62
|
+
let inFence = false;
|
|
63
|
+
let fenceStart = -1;
|
|
64
|
+
let blockStart = -1;
|
|
65
|
+
const closeBlockBefore = (idx) => {
|
|
66
|
+
if (blockStart !== -1 && idx > blockStart)
|
|
67
|
+
blockRegions.push([blockStart, idx]);
|
|
68
|
+
blockStart = -1;
|
|
69
|
+
};
|
|
70
|
+
while (pos < buffer.length) {
|
|
71
|
+
const eol = buffer.indexOf('\n', pos);
|
|
72
|
+
const lineEnd = eol === -1 ? buffer.length : eol;
|
|
73
|
+
const line = buffer.slice(pos, lineEnd);
|
|
74
|
+
const lineHasNewline = eol !== -1;
|
|
75
|
+
if (!inFence) {
|
|
76
|
+
if (lineHasNewline && FENCE_OPEN_RE.test(line)) {
|
|
77
|
+
closeBlockBefore(pos);
|
|
78
|
+
inFence = true;
|
|
79
|
+
fenceStart = pos;
|
|
80
|
+
}
|
|
81
|
+
else if (line.trim() === '') {
|
|
82
|
+
closeBlockBefore(pos);
|
|
83
|
+
}
|
|
84
|
+
else if (HEADING_RE.test(line) || UL_ITEM_RE.test(line) || OL_ITEM_RE.test(line)) {
|
|
85
|
+
// Each heading/list-item line is its own inline-scan region rather
|
|
86
|
+
// than joining adjacent paragraphs.
|
|
87
|
+
closeBlockBefore(pos);
|
|
88
|
+
blockRegions.push([pos, lineEnd]);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
if (blockStart === -1)
|
|
92
|
+
blockStart = pos;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else if (lineHasNewline && FENCE_CLOSE_RE.test(line)) {
|
|
96
|
+
inFence = false;
|
|
97
|
+
ranges.push([fenceStart, eol + 1]);
|
|
98
|
+
fenceStart = -1;
|
|
99
|
+
}
|
|
100
|
+
if (!lineHasNewline)
|
|
101
|
+
break; // trailing partial line — already accounted for above
|
|
102
|
+
pos = eol + 1;
|
|
103
|
+
}
|
|
104
|
+
if (!inFence)
|
|
105
|
+
closeBlockBefore(buffer.length); // flush an open paragraph region at end-of-buffer
|
|
106
|
+
for (const [s, e] of blockRegions) {
|
|
107
|
+
INLINE_CODE_RE.lastIndex = 0;
|
|
108
|
+
const segment = buffer.slice(s, e);
|
|
109
|
+
let m = INLINE_CODE_RE.exec(segment);
|
|
110
|
+
while (m !== null) {
|
|
111
|
+
ranges.push([s + m.index, s + m.index + m[0].length]);
|
|
112
|
+
m = INLINE_CODE_RE.exec(segment);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return { ranges, unclosedFenceStart: inFence ? fenceStart : null };
|
|
116
|
+
}
|
|
117
|
+
/** `true` when position `p` falls inside one of `ranges` (half-open intervals). */
|
|
118
|
+
export function rangeContains(ranges, p) {
|
|
119
|
+
for (const [s, e] of ranges) {
|
|
120
|
+
if (p >= s && p < e)
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=markdown-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-context.js","sourceRoot":"","sources":["../../../src/core/util/markdown-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,qDAAqD;AACrD,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,CAAC;AACpD,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,2CAA2C;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,0EAA0E;AAC1E,yEAAyE;AACzE,0EAA0E;AAC1E,+CAA+C;AAC/C,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,UAAU,GAAG,cAAc,CAAC;AAClC,MAAM,UAAU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;QAClC,cAAc,CAAC,SAAS,GAAG,CAAC,CAAC;QAC7B,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,GAA2B,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACtD,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACrE,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,aAAa,CAAC,MAA4B,EAAE,CAAS;IACnE,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;IACnC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module markup-attributes
|
|
3
|
+
*
|
|
4
|
+
* Shared quoted-attribute parser for this package's inline protocol tags —
|
|
5
|
+
* `<artifact …>` (`./parser.ts`, `./strip.ts`) and `<question-form …>` /
|
|
6
|
+
* `<ask-question …>` (`../question-form/scan.ts`). All three interpret
|
|
7
|
+
* model-produced markup with the exact same tolerant grammar; centralizing
|
|
8
|
+
* it means a future correction to escaping, accepted attribute names, or
|
|
9
|
+
* malformed-quote handling can't drift between streaming, post-stream, and
|
|
10
|
+
* question-form parsing.
|
|
11
|
+
*
|
|
12
|
+
* Internal only — deliberately not part of this package's public surface;
|
|
13
|
+
* see `./index.ts`'s barrel comment.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Parse `name="value"` / `name='value'` pairs out of a tag's raw attribute
|
|
17
|
+
* string (the content between the tag name and the closing `>`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseQuotedAttrs(raw: string): Record<string, string>;
|
|
20
|
+
//# sourceMappingURL=markup-attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markup-attributes.d.ts","sourceRoot":"","sources":["../../../src/core/util/markup-attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAapE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module markup-attributes
|
|
3
|
+
*
|
|
4
|
+
* Shared quoted-attribute parser for this package's inline protocol tags —
|
|
5
|
+
* `<artifact …>` (`./parser.ts`, `./strip.ts`) and `<question-form …>` /
|
|
6
|
+
* `<ask-question …>` (`../question-form/scan.ts`). All three interpret
|
|
7
|
+
* model-produced markup with the exact same tolerant grammar; centralizing
|
|
8
|
+
* it means a future correction to escaping, accepted attribute names, or
|
|
9
|
+
* malformed-quote handling can't drift between streaming, post-stream, and
|
|
10
|
+
* question-form parsing.
|
|
11
|
+
*
|
|
12
|
+
* Internal only — deliberately not part of this package's public surface;
|
|
13
|
+
* see `./index.ts`'s barrel comment.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Parse `name="value"` / `name='value'` pairs out of a tag's raw attribute
|
|
17
|
+
* string (the content between the tag name and the closing `>`).
|
|
18
|
+
*/
|
|
19
|
+
export function parseQuotedAttrs(raw) {
|
|
20
|
+
const re = /(\w+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
|
|
21
|
+
const out = {};
|
|
22
|
+
let m = re.exec(raw);
|
|
23
|
+
while (m !== null) {
|
|
24
|
+
// The pattern's quote alternation means exactly one of group 2 (double-
|
|
25
|
+
// quoted) / group 3 (single-quoted) participates in any successful match
|
|
26
|
+
// — never both, never neither — so `m[2] ?? m[3]` is always defined; the
|
|
27
|
+
// cast just satisfies `noUncheckedIndexedAccess`.
|
|
28
|
+
out[m[1]] = (m[2] ?? m[3]);
|
|
29
|
+
m = re.exec(raw);
|
|
30
|
+
}
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=markup-attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markup-attributes.js","sourceRoot":"","sources":["../../../src/core/util/markup-attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,EAAE,GAAG,sCAAsC,CAAC;IAClD,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,IAAI,CAAC,GAA2B,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;QAClB,wEAAwE;QACxE,yEAAyE;QACzE,yEAAyE;QACzE,kDAAkD;QAClD,GAAG,CAAC,CAAC,CAAC,CAAC,CAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAW,CAAC;QAC/C,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|