@drscrewdriver/dsh-better-display 0.3.3-fork.1
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/CHANGELOG.md +259 -0
- package/DESIGN.md +72 -0
- package/LICENSE +24 -0
- package/README.en.md +55 -0
- package/README.md +55 -0
- package/THIRD_PARTY_NOTICES.md +65 -0
- package/compat/harness-rc2.json +99 -0
- package/cordis.patch.yml +5 -0
- package/cordis.yml +4 -0
- package/docs/official-rendering-bridge.md +65 -0
- package/dshx.yml +5 -0
- package/lib/client.js +49292 -0
- package/lib/client.js.map +1 -0
- package/lib/dsh-better-display.js +101 -0
- package/lib/types/client/Blocks.d.ts +49 -0
- package/lib/types/client/Blocks.d.ts.map +1 -0
- package/lib/types/client/Blocks.js +143 -0
- package/lib/types/client/Blocks.js.map +1 -0
- package/lib/types/client/ChoreographedFlow.d.ts +22 -0
- package/lib/types/client/ChoreographedFlow.d.ts.map +1 -0
- package/lib/types/client/ChoreographedFlow.js +218 -0
- package/lib/types/client/ChoreographedFlow.js.map +1 -0
- package/lib/types/client/ClosedProcessSummary.d.ts +9 -0
- package/lib/types/client/ClosedProcessSummary.d.ts.map +1 -0
- package/lib/types/client/ClosedProcessSummary.js +16 -0
- package/lib/types/client/ClosedProcessSummary.js.map +1 -0
- package/lib/types/client/DiffPanel.d.ts +13 -0
- package/lib/types/client/DiffPanel.d.ts.map +1 -0
- package/lib/types/client/DiffPanel.js +115 -0
- package/lib/types/client/DiffPanel.js.map +1 -0
- package/lib/types/client/LiveFold.d.ts +10 -0
- package/lib/types/client/LiveFold.d.ts.map +1 -0
- package/lib/types/client/LiveFold.js +39 -0
- package/lib/types/client/LiveFold.js.map +1 -0
- package/lib/types/client/McpAppFrame.d.ts +32 -0
- package/lib/types/client/McpAppFrame.d.ts.map +1 -0
- package/lib/types/client/McpAppFrame.js +193 -0
- package/lib/types/client/McpAppFrame.js.map +1 -0
- package/lib/types/client/OfficialContent.d.ts +25 -0
- package/lib/types/client/OfficialContent.d.ts.map +1 -0
- package/lib/types/client/OfficialContent.js +53 -0
- package/lib/types/client/OfficialContent.js.map +1 -0
- package/lib/types/client/Reader.d.ts +3 -0
- package/lib/types/client/Reader.d.ts.map +1 -0
- package/lib/types/client/Reader.js +603 -0
- package/lib/types/client/Reader.js.map +1 -0
- package/lib/types/client/ReasoningCard.d.ts +11 -0
- package/lib/types/client/ReasoningCard.d.ts.map +1 -0
- package/lib/types/client/ReasoningCard.js +322 -0
- package/lib/types/client/ReasoningCard.js.map +1 -0
- package/lib/types/client/SettingsSection.d.ts +37 -0
- package/lib/types/client/SettingsSection.d.ts.map +1 -0
- package/lib/types/client/SettingsSection.js +63 -0
- package/lib/types/client/SettingsSection.js.map +1 -0
- package/lib/types/client/StickyLane.d.ts +8 -0
- package/lib/types/client/StickyLane.d.ts.map +1 -0
- package/lib/types/client/StickyLane.js +39 -0
- package/lib/types/client/StickyLane.js.map +1 -0
- package/lib/types/client/TimelineRail.d.ts +10 -0
- package/lib/types/client/TimelineRail.d.ts.map +1 -0
- package/lib/types/client/TimelineRail.js +168 -0
- package/lib/types/client/TimelineRail.js.map +1 -0
- package/lib/types/client/ToolActivity.d.ts +17 -0
- package/lib/types/client/ToolActivity.d.ts.map +1 -0
- package/lib/types/client/ToolActivity.js +244 -0
- package/lib/types/client/ToolActivity.js.map +1 -0
- package/lib/types/client/TurnMetrics.d.ts +11 -0
- package/lib/types/client/TurnMetrics.d.ts.map +1 -0
- package/lib/types/client/TurnMetrics.js +44 -0
- package/lib/types/client/TurnMetrics.js.map +1 -0
- package/lib/types/client/WaitClock.d.ts +16 -0
- package/lib/types/client/WaitClock.d.ts.map +1 -0
- package/lib/types/client/WaitClock.js +29 -0
- package/lib/types/client/WaitClock.js.map +1 -0
- package/lib/types/client/WaitingClock.d.ts +15 -0
- package/lib/types/client/WaitingClock.d.ts.map +1 -0
- package/lib/types/client/WaitingClock.js +30 -0
- package/lib/types/client/WaitingClock.js.map +1 -0
- package/lib/types/client/WaitingStatus.d.ts +6 -0
- package/lib/types/client/WaitingStatus.d.ts.map +1 -0
- package/lib/types/client/WaitingStatus.js +9 -0
- package/lib/types/client/WaitingStatus.js.map +1 -0
- package/lib/types/client/conversation-scroll.d.ts +19 -0
- package/lib/types/client/conversation-scroll.d.ts.map +1 -0
- package/lib/types/client/conversation-scroll.js +25 -0
- package/lib/types/client/conversation-scroll.js.map +1 -0
- package/lib/types/client/deliverables.d.ts +24 -0
- package/lib/types/client/deliverables.d.ts.map +1 -0
- package/lib/types/client/deliverables.js +104 -0
- package/lib/types/client/deliverables.js.map +1 -0
- package/lib/types/client/entry-policy.d.ts +10 -0
- package/lib/types/client/entry-policy.d.ts.map +1 -0
- package/lib/types/client/entry-policy.js +24 -0
- package/lib/types/client/entry-policy.js.map +1 -0
- package/lib/types/client/entry.d.ts +4 -0
- package/lib/types/client/entry.d.ts.map +1 -0
- package/lib/types/client/entry.js +34 -0
- package/lib/types/client/entry.js.map +1 -0
- package/lib/types/client/fold-choreography.d.ts +40 -0
- package/lib/types/client/fold-choreography.d.ts.map +1 -0
- package/lib/types/client/fold-choreography.js +48 -0
- package/lib/types/client/fold-choreography.js.map +1 -0
- package/lib/types/client/fold-intensity.d.ts +11 -0
- package/lib/types/client/fold-intensity.d.ts.map +1 -0
- package/lib/types/client/fold-intensity.js +32 -0
- package/lib/types/client/fold-intensity.js.map +1 -0
- package/lib/types/client/index.d.ts +7 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/index.js +195 -0
- package/lib/types/client/index.js.map +1 -0
- package/lib/types/client/live-turn.d.ts +58 -0
- package/lib/types/client/live-turn.d.ts.map +1 -0
- package/lib/types/client/live-turn.js +190 -0
- package/lib/types/client/live-turn.js.map +1 -0
- package/lib/types/client/markdown/MarkdownText.d.ts +41 -0
- package/lib/types/client/markdown/MarkdownText.d.ts.map +1 -0
- package/lib/types/client/markdown/MarkdownText.js +178 -0
- package/lib/types/client/markdown/MarkdownText.js.map +1 -0
- package/lib/types/client/markdown/cjkFriendlyStrong.d.ts +9 -0
- package/lib/types/client/markdown/cjkFriendlyStrong.d.ts.map +1 -0
- package/lib/types/client/markdown/cjkFriendlyStrong.js +73 -0
- package/lib/types/client/markdown/cjkFriendlyStrong.js.map +1 -0
- package/lib/types/client/markdown/incremental.d.ts +69 -0
- package/lib/types/client/markdown/incremental.d.ts.map +1 -0
- package/lib/types/client/markdown/incremental.js +108 -0
- package/lib/types/client/markdown/incremental.js.map +1 -0
- package/lib/types/client/markdown/katex.d.ts +27 -0
- package/lib/types/client/markdown/katex.d.ts.map +1 -0
- package/lib/types/client/markdown/katex.js +88 -0
- package/lib/types/client/markdown/katex.js.map +1 -0
- package/lib/types/client/markdown/mathCompatibility.d.ts +11 -0
- package/lib/types/client/markdown/mathCompatibility.d.ts.map +1 -0
- package/lib/types/client/markdown/mathCompatibility.js +293 -0
- package/lib/types/client/markdown/mathCompatibility.js.map +1 -0
- package/lib/types/client/markdown/parse.d.ts +25 -0
- package/lib/types/client/markdown/parse.d.ts.map +1 -0
- package/lib/types/client/markdown/parse.js +42 -0
- package/lib/types/client/markdown/parse.js.map +1 -0
- package/lib/types/client/markdown/render.d.ts +121 -0
- package/lib/types/client/markdown/render.d.ts.map +1 -0
- package/lib/types/client/markdown/render.js +452 -0
- package/lib/types/client/markdown/render.js.map +1 -0
- package/lib/types/client/mcp-app.d.ts +50 -0
- package/lib/types/client/mcp-app.d.ts.map +1 -0
- package/lib/types/client/mcp-app.js +328 -0
- package/lib/types/client/mcp-app.js.map +1 -0
- package/lib/types/client/message-chrome.d.ts +19 -0
- package/lib/types/client/message-chrome.d.ts.map +1 -0
- package/lib/types/client/message-chrome.js +42 -0
- package/lib/types/client/message-chrome.js.map +1 -0
- package/lib/types/client/motion.d.ts +38 -0
- package/lib/types/client/motion.d.ts.map +1 -0
- package/lib/types/client/motion.js +453 -0
- package/lib/types/client/motion.js.map +1 -0
- package/lib/types/client/native/ContextBody.d.ts +130 -0
- package/lib/types/client/native/ContextBody.d.ts.map +1 -0
- package/lib/types/client/native/ContextBody.js +398 -0
- package/lib/types/client/native/ContextBody.js.map +1 -0
- package/lib/types/client/native/ContextInjectionRow.d.ts +35 -0
- package/lib/types/client/native/ContextInjectionRow.d.ts.map +1 -0
- package/lib/types/client/native/ContextInjectionRow.js +42 -0
- package/lib/types/client/native/ContextInjectionRow.js.map +1 -0
- package/lib/types/client/native/ReferenceIcon.d.ts +16 -0
- package/lib/types/client/native/ReferenceIcon.d.ts.map +1 -0
- package/lib/types/client/native/ReferenceIcon.js +16 -0
- package/lib/types/client/native/ReferenceIcon.js.map +1 -0
- package/lib/types/client/native/tool-call-model.d.ts +58 -0
- package/lib/types/client/native/tool-call-model.d.ts.map +1 -0
- package/lib/types/client/native/tool-call-model.js +219 -0
- package/lib/types/client/native/tool-call-model.js.map +1 -0
- package/lib/types/client/native/tool-update.d.ts +23 -0
- package/lib/types/client/native/tool-update.d.ts.map +1 -0
- package/lib/types/client/native/tool-update.js +22 -0
- package/lib/types/client/native/tool-update.js.map +1 -0
- package/lib/types/client/official-slots.d.ts +71 -0
- package/lib/types/client/official-slots.d.ts.map +1 -0
- package/lib/types/client/official-slots.js +183 -0
- package/lib/types/client/official-slots.js.map +1 -0
- package/lib/types/client/open-file.d.ts +29 -0
- package/lib/types/client/open-file.d.ts.map +1 -0
- package/lib/types/client/open-file.js +71 -0
- package/lib/types/client/open-file.js.map +1 -0
- package/lib/types/client/pending-submission.d.ts +28 -0
- package/lib/types/client/pending-submission.d.ts.map +1 -0
- package/lib/types/client/pending-submission.js +28 -0
- package/lib/types/client/pending-submission.js.map +1 -0
- package/lib/types/client/platform-media.d.ts +6 -0
- package/lib/types/client/platform-media.d.ts.map +1 -0
- package/lib/types/client/platform-media.js +18 -0
- package/lib/types/client/platform-media.js.map +1 -0
- package/lib/types/client/primitive-labels.d.ts +10 -0
- package/lib/types/client/primitive-labels.d.ts.map +1 -0
- package/lib/types/client/primitive-labels.js +38 -0
- package/lib/types/client/primitive-labels.js.map +1 -0
- package/lib/types/client/projection.d.ts +41 -0
- package/lib/types/client/projection.d.ts.map +1 -0
- package/lib/types/client/projection.js +112 -0
- package/lib/types/client/projection.js.map +1 -0
- package/lib/types/client/reasoning-follow.d.ts +10 -0
- package/lib/types/client/reasoning-follow.d.ts.map +1 -0
- package/lib/types/client/reasoning-follow.js +21 -0
- package/lib/types/client/reasoning-follow.js.map +1 -0
- package/lib/types/client/resource-address.d.ts +3 -0
- package/lib/types/client/resource-address.d.ts.map +1 -0
- package/lib/types/client/resource-address.js +33 -0
- package/lib/types/client/resource-address.js.map +1 -0
- package/lib/types/client/settings-copy.d.ts +7 -0
- package/lib/types/client/settings-copy.d.ts.map +1 -0
- package/lib/types/client/settings-copy.js +53 -0
- package/lib/types/client/settings-copy.js.map +1 -0
- package/lib/types/client/settings-slots.d.ts +23 -0
- package/lib/types/client/settings-slots.d.ts.map +1 -0
- package/lib/types/client/settings-slots.js +2 -0
- package/lib/types/client/settings-slots.js.map +1 -0
- package/lib/types/client/settings.d.ts +4 -0
- package/lib/types/client/settings.d.ts.map +1 -0
- package/lib/types/client/settings.js +60 -0
- package/lib/types/client/settings.js.map +1 -0
- package/lib/types/client/skill-status.d.ts +25 -0
- package/lib/types/client/skill-status.d.ts.map +1 -0
- package/lib/types/client/skill-status.js +44 -0
- package/lib/types/client/skill-status.js.map +1 -0
- package/lib/types/client/store.d.ts +35 -0
- package/lib/types/client/store.d.ts.map +1 -0
- package/lib/types/client/store.js +37 -0
- package/lib/types/client/store.js.map +1 -0
- package/lib/types/client/stream-buffer.d.ts +37 -0
- package/lib/types/client/stream-buffer.d.ts.map +1 -0
- package/lib/types/client/stream-buffer.js +150 -0
- package/lib/types/client/stream-buffer.js.map +1 -0
- package/lib/types/client/streaming.d.ts +18 -0
- package/lib/types/client/streaming.d.ts.map +1 -0
- package/lib/types/client/streaming.js +84 -0
- package/lib/types/client/streaming.js.map +1 -0
- package/lib/types/client/timeline.d.ts +26 -0
- package/lib/types/client/timeline.d.ts.map +1 -0
- package/lib/types/client/timeline.js +48 -0
- package/lib/types/client/timeline.js.map +1 -0
- package/lib/types/client/tool-activity.d.ts +98 -0
- package/lib/types/client/tool-activity.d.ts.map +1 -0
- package/lib/types/client/tool-activity.js +301 -0
- package/lib/types/client/tool-activity.js.map +1 -0
- package/lib/types/client/types.d.ts +91 -0
- package/lib/types/client/types.d.ts.map +1 -0
- package/lib/types/client/types.js +2 -0
- package/lib/types/client/types.js.map +1 -0
- package/lib/types/client/waiting-clock.d.ts +49 -0
- package/lib/types/client/waiting-clock.d.ts.map +1 -0
- package/lib/types/client/waiting-clock.js +80 -0
- package/lib/types/client/waiting-clock.js.map +1 -0
- package/lib/types/client/word-motion.d.ts +16 -0
- package/lib/types/client/word-motion.d.ts.map +1 -0
- package/lib/types/client/word-motion.js +90 -0
- package/lib/types/client/word-motion.js.map +1 -0
- package/lib/types/client/word-timeline.d.ts +32 -0
- package/lib/types/client/word-timeline.d.ts.map +1 -0
- package/lib/types/client/word-timeline.js +119 -0
- package/lib/types/client/word-timeline.js.map +1 -0
- package/lib/types/dsh-better-display.d.ts +17 -0
- package/lib/types/dsh-better-display.d.ts.map +1 -0
- package/lib/types/dsh-better-display.js +93 -0
- package/lib/types/dsh-better-display.js.map +1 -0
- package/lib/types/skill-roots.d.ts +22 -0
- package/lib/types/skill-roots.d.ts.map +1 -0
- package/lib/types/skill-roots.js +126 -0
- package/lib/types/skill-roots.js.map +1 -0
- package/lib/types/skill-status.d.ts +36 -0
- package/lib/types/skill-status.d.ts.map +1 -0
- package/lib/types/skill-status.js +51 -0
- package/lib/types/skill-status.js.map +1 -0
- package/package.json +133 -0
- package/scripts/build-motion-fixture.mjs +26 -0
- package/scripts/check-harness-compat.mjs +71 -0
- package/scripts/link-harness-dependencies.mjs +54 -0
- package/scripts/verify-auto-fold.mjs +114 -0
- package/scripts/verify-official-bridge.mjs +121 -0
- package/scripts/verify-tool-shimmer.mjs +62 -0
- package/skills/generative-mcpapps/SKILL.md +47 -0
- package/skills/generative-mcpapps/examples/interactive_quiz.html +153 -0
- package/skills/generative-mcpapps/references/html_boilerplate.md +122 -0
- package/skills/generative-mcpapps/references/sep1865_protocol.md +54 -0
- package/src/client/Blocks.tsx +213 -0
- package/src/client/ChoreographedFlow.tsx +232 -0
- package/src/client/ClosedProcessSummary.tsx +23 -0
- package/src/client/DiffPanel.tsx +124 -0
- package/src/client/LiveFold.tsx +43 -0
- package/src/client/McpAppFrame.module.css +210 -0
- package/src/client/McpAppFrame.tsx +317 -0
- package/src/client/OfficialContent.tsx +69 -0
- package/src/client/Reader.module.css +692 -0
- package/src/client/Reader.tsx +878 -0
- package/src/client/ReasoningCard.tsx +306 -0
- package/src/client/SettingsSection.module.css +184 -0
- package/src/client/SettingsSection.tsx +194 -0
- package/src/client/StickyLane.tsx +34 -0
- package/src/client/TimelineRail.module.css +170 -0
- package/src/client/TimelineRail.tsx +262 -0
- package/src/client/ToolActivity.tsx +274 -0
- package/src/client/TurnMetrics.module.css +139 -0
- package/src/client/TurnMetrics.tsx +160 -0
- package/src/client/WaitClock.tsx +33 -0
- package/src/client/WaitingStatus.tsx +13 -0
- package/src/client/conversation-scroll.ts +28 -0
- package/src/client/deliverables.ts +122 -0
- package/src/client/entry-policy.ts +20 -0
- package/src/client/entry.tsx +40 -0
- package/src/client/fold-choreography.ts +55 -0
- package/src/client/fold-intensity.ts +36 -0
- package/src/client/index.tsx +222 -0
- package/src/client/live-turn.ts +198 -0
- package/src/client/markdown/MarkdownText.module.css +304 -0
- package/src/client/markdown/MarkdownText.tsx +195 -0
- package/src/client/markdown/cjkFriendlyStrong.ts +84 -0
- package/src/client/markdown/incremental.ts +131 -0
- package/src/client/markdown/katex.tsx +91 -0
- package/src/client/markdown/mathCompatibility.ts +350 -0
- package/src/client/markdown/parse.ts +45 -0
- package/src/client/markdown/render.tsx +647 -0
- package/src/client/markdown/upstream.json +14 -0
- package/src/client/mcp-app.ts +323 -0
- package/src/client/message-chrome.ts +47 -0
- package/src/client/motion.tsx +410 -0
- package/src/client/native/ContextBody.module.css +161 -0
- package/src/client/native/ContextBody.tsx +591 -0
- package/src/client/native/ContextInjectionRow.module.css +66 -0
- package/src/client/native/ContextInjectionRow.tsx +106 -0
- package/src/client/native/ReferenceIcon.tsx +35 -0
- package/src/client/native/tool-call-model.ts +248 -0
- package/src/client/native/tool-update.ts +32 -0
- package/src/client/native/upstream.json +41 -0
- package/src/client/official-slots.tsx +211 -0
- package/src/client/open-file.ts +94 -0
- package/src/client/pending-submission.ts +49 -0
- package/src/client/platform-media.ts +17 -0
- package/src/client/primitive-labels.ts +54 -0
- package/src/client/projection.ts +118 -0
- package/src/client/reasoning-follow.ts +28 -0
- package/src/client/settings-copy.ts +80 -0
- package/src/client/settings-slots.ts +20 -0
- package/src/client/settings.tsx +73 -0
- package/src/client/skill-status.ts +78 -0
- package/src/client/store.ts +75 -0
- package/src/client/stream-buffer.ts +136 -0
- package/src/client/streaming.tsx +70 -0
- package/src/client/style.d.ts +4 -0
- package/src/client/timeline.ts +77 -0
- package/src/client/tool-activity.ts +298 -0
- package/src/client/types.ts +89 -0
- package/src/client/waiting-clock.ts +83 -0
- package/src/client/word-motion.tsx +92 -0
- package/src/client/word-timeline.ts +113 -0
- package/src/dsh-better-display.ts +108 -0
- package/src/skill-roots.ts +138 -0
- package/src/skill-status.ts +81 -0
- package/tests/browser-auto-fold.tsx +64 -0
- package/tests/browser-closed-gap.tsx +20 -0
- package/tests/browser-motion.tsx +65 -0
- package/tests/browser-official-bridge.tsx +152 -0
- package/tests/browser-sticky-lanes.tsx +22 -0
- package/tests/browser-waiting-clock.tsx +14 -0
- package/tests/chat-flow-hook.test.ts +66 -0
- package/tests/cloud-gate.test.ts +34 -0
- package/tests/context-tool-update.test.ts +33 -0
- package/tests/conversation-scroll.test.ts +47 -0
- package/tests/deliverables.test.ts +128 -0
- package/tests/entry.test.ts +42 -0
- package/tests/fixtures/maid-composer-hide.html +31 -0
- package/tests/fold-choreography.test.ts +54 -0
- package/tests/fold-intensity.test.ts +94 -0
- package/tests/footer-precedence.test.ts +129 -0
- package/tests/history-word-regression.test.ts +16 -0
- package/tests/live-turn.test.ts +218 -0
- package/tests/mcp-apps.test.ts +157 -0
- package/tests/message-chrome.test.ts +29 -0
- package/tests/official-slots.test.ts +112 -0
- package/tests/open-file.test.ts +114 -0
- package/tests/pending-submission.test.ts +45 -0
- package/tests/platform-media.test.ts +23 -0
- package/tests/projection.test.ts +184 -0
- package/tests/reasoning-follow.test.ts +34 -0
- package/tests/settings-copy.test.ts +63 -0
- package/tests/skill-status.test.ts +137 -0
- package/tests/stock-install.test.ts +58 -0
- package/tests/stream-buffer.test.ts +102 -0
- package/tests/timeline.test.ts +59 -0
- package/tests/tool-diff.test.ts +57 -0
- package/tests/waiting-clock.test.ts +83 -0
- package/tests/word-timeline.test.ts +146 -0
- package/tsconfig.json +11 -0
- package/tsdown.config.ts +51 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { JsonBlock } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
import css from './ContextBody.module.css';
|
|
4
|
+
/** Model-facing text stays bounded at the disclosure, not at the producer. */
|
|
5
|
+
const MAX_CHARS = 20_000;
|
|
6
|
+
/** Rows a list body materializes before summarizing the remainder. */
|
|
7
|
+
const MAX_ENTRIES = 200;
|
|
8
|
+
/** One durable source narrowed to the readable-record shape; null for anything else. */
|
|
9
|
+
function asRecord(value) {
|
|
10
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
11
|
+
? value
|
|
12
|
+
: null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The content blocks as runs, IN THE ORDER the model received them.
|
|
16
|
+
*
|
|
17
|
+
* Adjacent text blocks join with no separator, matching how provider adapters
|
|
18
|
+
* flatten them — inserting a line break would show the reader a line the model
|
|
19
|
+
* never saw. An unknown block breaks the run and keeps its own fallback rather
|
|
20
|
+
* than being hoisted past the text around it or vanishing; the block union is
|
|
21
|
+
* merge-extensible, so a foreign log may interleave shapes this build does not
|
|
22
|
+
* know.
|
|
23
|
+
*/
|
|
24
|
+
function contentRuns(content) {
|
|
25
|
+
const runs = [];
|
|
26
|
+
for (const block of content) {
|
|
27
|
+
if (block.type !== 'text') {
|
|
28
|
+
runs.push({ block });
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const last = runs[runs.length - 1];
|
|
32
|
+
if (last !== undefined && 'text' in last)
|
|
33
|
+
last.text += block.text;
|
|
34
|
+
else
|
|
35
|
+
runs.push({ text: block.text });
|
|
36
|
+
}
|
|
37
|
+
return runs;
|
|
38
|
+
}
|
|
39
|
+
/** Only the blocks this UI version does not know, for bodies that replace the text. */
|
|
40
|
+
function unknownBlocks(content) {
|
|
41
|
+
return contentRuns(content).flatMap(run => 'block' in run ? [run.block] : []);
|
|
42
|
+
}
|
|
43
|
+
/** The model-facing text, truncated to the display bound. */
|
|
44
|
+
function boundedText(text, t) {
|
|
45
|
+
return text.length > MAX_CHARS
|
|
46
|
+
? `${text.slice(0, MAX_CHARS)}\n${t('json.truncated', { total: text.length })}`
|
|
47
|
+
: text;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* One source field rendered as a value row; nested shapes stay compact JSON.
|
|
51
|
+
* Bounded on its own, because source fields are as unbounded as the text: an unknown
|
|
52
|
+
* producer may record an arbitrarily large string or array.
|
|
53
|
+
*/
|
|
54
|
+
function fieldValue(value, t) {
|
|
55
|
+
const text = typeof value === 'string'
|
|
56
|
+
? value
|
|
57
|
+
: typeof value === 'number' || typeof value === 'boolean' ? String(value) : JSON.stringify(value);
|
|
58
|
+
return boundedText(text, t);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Source fields as a key/value list. `kind` is always omitted because the
|
|
62
|
+
* row header already names the producer. `form` is omitted only when a
|
|
63
|
+
* dedicated body rendered for it — then the presentation the reader is looking
|
|
64
|
+
* at IS that value. On the opaque fallback the declaration is kept, because
|
|
65
|
+
* that is the one place a form this version cannot present would otherwise
|
|
66
|
+
* disappear from the UI entirely.
|
|
67
|
+
*/
|
|
68
|
+
function SourceFields({ source, formRendered, t }) {
|
|
69
|
+
const record = asRecord(source);
|
|
70
|
+
if (record === null)
|
|
71
|
+
return null;
|
|
72
|
+
const hidden = formRendered ? ['kind', 'form'] : ['kind'];
|
|
73
|
+
const rows = Object.entries(record).filter(([key]) => !hidden.includes(key));
|
|
74
|
+
if (rows.length === 0)
|
|
75
|
+
return null;
|
|
76
|
+
return (_jsx("dl", { className: css.fields, "data-context-fields": true, children: rows.map(([key, value]) => (_jsxs("div", { className: css.field, children: [_jsx("dt", { className: css.fieldKey, children: key }), _jsx("dd", { className: css.fieldValue, children: fieldValue(value, t) })] }, key))) }));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Content blocks this UI version does not know, kept visible rather than
|
|
80
|
+
* dropped: the block union is merge-extensible, so a newer or foreign log may
|
|
81
|
+
* carry a shape this build has no presentation for.
|
|
82
|
+
* @param props - The unrecognized blocks and the locale seat.
|
|
83
|
+
* @returns One generic JSON block per unknown entry.
|
|
84
|
+
*/
|
|
85
|
+
function UnknownBlocks({ blocks, t }) {
|
|
86
|
+
return (_jsx(_Fragment, { children: blocks.map((block, index) => (_jsx(JsonBlock, { label: t('message.unknownBlock'), payload: block, truncatedLabel: total => t('json.truncated', { total }) }, index))) }));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The model-facing content of one context, shared by every form that shows it:
|
|
90
|
+
* the text with its real line breaks, then any block this UI version does not
|
|
91
|
+
* know, which keeps its own fallback rather than vanishing.
|
|
92
|
+
* @param props - Durable content and the locale seat.
|
|
93
|
+
* @returns The content blocks as the model received them.
|
|
94
|
+
*/
|
|
95
|
+
function ModelFacingContent({ content, t }) {
|
|
96
|
+
return (_jsx(_Fragment, { children: contentRuns(content).map((run, index) => ('text' in run
|
|
97
|
+
? run.text !== '' && (_jsx("pre", { className: css.text, "data-context-text": true, children: boundedText(run.text, t) }, index))
|
|
98
|
+
: (_jsx(JsonBlock, { label: t('message.unknownBlock'), payload: run.block, truncatedLabel: total => t('json.truncated', { total }) }, index)))) }));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Default presentation: the model-facing text as text, with its real line
|
|
102
|
+
* breaks, and the remaining source fields beneath it. This is what every form
|
|
103
|
+
* this UI version does not recognize renders as.
|
|
104
|
+
* @param props - Durable content, its source, and the locale seat.
|
|
105
|
+
* @returns The opaque context body.
|
|
106
|
+
*/
|
|
107
|
+
export function OpaqueBody({ content, source, t }) {
|
|
108
|
+
return (_jsxs(_Fragment, { children: [_jsx(ModelFacingContent, { content: content, t: t }), _jsx(SourceFields, { source: source, formRendered: false, t: t })] }));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Instruction changes read off the source, or null when the record is not a
|
|
112
|
+
* usable instruction list.
|
|
113
|
+
*
|
|
114
|
+
* The read is all-or-nothing: silently dropping one unreadable entry would show
|
|
115
|
+
* a confident, incomplete file list for a log this version cannot fully read.
|
|
116
|
+
* Paths are deduplicated in first-seen order, matching how the header label is
|
|
117
|
+
* derived from the same array.
|
|
118
|
+
*/
|
|
119
|
+
function instructionChanges(source) {
|
|
120
|
+
const record = asRecord(source);
|
|
121
|
+
const list = record === null ? undefined : record['changes'];
|
|
122
|
+
if (!Array.isArray(list))
|
|
123
|
+
return null;
|
|
124
|
+
const changes = [];
|
|
125
|
+
const seen = new Set();
|
|
126
|
+
for (const entry of list) {
|
|
127
|
+
const change = asRecord(entry);
|
|
128
|
+
if (change === null)
|
|
129
|
+
return null;
|
|
130
|
+
const path = change['path'];
|
|
131
|
+
if (typeof path !== 'string' || path === '')
|
|
132
|
+
return null;
|
|
133
|
+
const action = change['action'];
|
|
134
|
+
// The action decides which word the row shows, so an unrecognized one is
|
|
135
|
+
// not a readable change — it would be presented as loaded or updated.
|
|
136
|
+
if (action !== 'set' && action !== 'replace' && action !== 'remove')
|
|
137
|
+
return null;
|
|
138
|
+
const digest = change['digest'];
|
|
139
|
+
if (seen.has(path))
|
|
140
|
+
continue;
|
|
141
|
+
seen.add(path);
|
|
142
|
+
changes.push({ action, path, ...typeof digest === 'string' ? { digest } : {} });
|
|
143
|
+
}
|
|
144
|
+
return changes.length === 0 ? null : changes;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Locale key for one reconciled file. The baseline loads a file; a later delta
|
|
148
|
+
* distinguishes a newly reconciled path from a rewritten one, which `set` and
|
|
149
|
+
* `replace` already separate at the producer.
|
|
150
|
+
* @param action - the durable change action.
|
|
151
|
+
* @param baseline - whether this context is the startup/resume baseline.
|
|
152
|
+
* @returns the key naming what happened to that file.
|
|
153
|
+
*/
|
|
154
|
+
function instructionAction(action, baseline) {
|
|
155
|
+
if (action === 'remove')
|
|
156
|
+
return 'message.context.instructions.removed';
|
|
157
|
+
if (baseline)
|
|
158
|
+
return 'message.context.instructions.loaded';
|
|
159
|
+
return action === 'set' ? 'message.context.instructions.added' : 'message.context.instructions.updated';
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* `instructions` form: the files this context reconciled, then their text.
|
|
163
|
+
*
|
|
164
|
+
* The text keeps its `<system-reminder>` framing verbatim — the framing is part
|
|
165
|
+
* of what the model read, so hiding it would misreport the request.
|
|
166
|
+
* @param props - Durable content, its source, and the locale seat.
|
|
167
|
+
* @returns The instructions context body, or the opaque body when the change
|
|
168
|
+
* list is unreadable.
|
|
169
|
+
*/
|
|
170
|
+
export function InstructionsBody({ content, source, t }) {
|
|
171
|
+
const changes = instructionChanges(source);
|
|
172
|
+
if (changes === null)
|
|
173
|
+
return _jsx(OpaqueBody, { content: content, source: source, t: t });
|
|
174
|
+
const baseline = asRecord(source)?.['baseline'] === true;
|
|
175
|
+
return (_jsxs(_Fragment, { children: [_jsx("ul", { className: css.files, "data-context-files": true, children: changes.map(change => (_jsxs("li", { className: css.file, title: change.digest, children: [_jsx("span", { className: css.filePath, children: change.path }), _jsx("span", { className: css.fileAction, children: t(instructionAction(change.action, baseline)) })] }, change.path))) }), _jsx(ModelFacingContent, { content: content, t: t })] }));
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Catalog entries read off the source, or null when the record is not a usable
|
|
179
|
+
* catalog. All-or-nothing for the same reason as the instruction list: this body
|
|
180
|
+
* replaces the model-facing text, so a partial list would hide the only complete
|
|
181
|
+
* account of what the model read.
|
|
182
|
+
*/
|
|
183
|
+
function catalogEntries(source) {
|
|
184
|
+
const record = asRecord(source);
|
|
185
|
+
const list = record === null ? undefined : record['entries'];
|
|
186
|
+
if (!Array.isArray(list))
|
|
187
|
+
return null;
|
|
188
|
+
const entries = [];
|
|
189
|
+
for (const item of list) {
|
|
190
|
+
const entry = asRecord(item);
|
|
191
|
+
if (entry === null)
|
|
192
|
+
return null;
|
|
193
|
+
const name = entry['name'];
|
|
194
|
+
const description = entry['description'];
|
|
195
|
+
if (typeof name !== 'string' || name === '' || typeof description !== 'string')
|
|
196
|
+
return null;
|
|
197
|
+
entries.push({ name, description });
|
|
198
|
+
}
|
|
199
|
+
// An empty list is a real catalog: a replacement with no entries retires
|
|
200
|
+
// every earlier name. Only an unreadable shape falls back.
|
|
201
|
+
return entries;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* `catalog` form: the published entries as a list, read from the source rather
|
|
205
|
+
* than re-parsed out of the model-facing prose.
|
|
206
|
+
*
|
|
207
|
+
* A catalog whose source carries no usable entries falls through to the opaque
|
|
208
|
+
* body, so an older or hand-edited log still shows its text.
|
|
209
|
+
* @param props - Durable content, its source, and the locale seat.
|
|
210
|
+
* @returns The catalog context body, or the opaque body when the entry list is
|
|
211
|
+
* unreadable.
|
|
212
|
+
*/
|
|
213
|
+
export function CatalogBody({ content, source, t }) {
|
|
214
|
+
const entries = catalogEntries(source);
|
|
215
|
+
if (entries === null)
|
|
216
|
+
return _jsx(OpaqueBody, { content: content, source: source, t: t });
|
|
217
|
+
const update = asRecord(source)?.['update'] === true;
|
|
218
|
+
// Entry count is unbounded (a provider may publish any number of skills), and
|
|
219
|
+
// the scrollport bounds height, not node count — so the list bounds itself.
|
|
220
|
+
const shown = entries.slice(0, MAX_ENTRIES);
|
|
221
|
+
const rest = unknownBlocks(content);
|
|
222
|
+
return (_jsxs(_Fragment, { children: [update && _jsx("p", { className: css.catalogNotice, "data-context-catalog-update": true, children: t('message.context.catalog.replaced') }), _jsx("ul", { className: css.entries, "data-context-entries": true, children: shown.map((entry, index) => (_jsxs("li", { className: css.entry, children: [_jsx("code", { className: css.entryName, children: entry.name }), _jsx("span", { className: css.entryDescription, children: entry.description })] }, index))) }), shown.length < entries.length && (_jsx("p", { className: css.catalogNotice, "data-context-entries-truncated": true, children: t('message.context.catalog.more', { count: entries.length - shown.length }) })), _jsx(UnknownBlocks, { blocks: rest, t: t })] }));
|
|
223
|
+
}
|
|
224
|
+
/** Snapshot sections read off the source, or null when the record is unusable. */
|
|
225
|
+
function snapshotSections(source) {
|
|
226
|
+
const record = asRecord(source);
|
|
227
|
+
const list = record === null ? undefined : record['sections'];
|
|
228
|
+
if (!Array.isArray(list))
|
|
229
|
+
return null;
|
|
230
|
+
const sections = [];
|
|
231
|
+
for (const item of list) {
|
|
232
|
+
const section = asRecord(item);
|
|
233
|
+
if (section === null)
|
|
234
|
+
return null;
|
|
235
|
+
const name = section['name'];
|
|
236
|
+
const text = section['text'];
|
|
237
|
+
if (typeof name !== 'string' || name === '' || typeof text !== 'string')
|
|
238
|
+
return null;
|
|
239
|
+
sections.push({ name, text });
|
|
240
|
+
}
|
|
241
|
+
return sections.length === 0 ? null : sections;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* `snapshot` form: the named contributions this snapshot assembled, in order.
|
|
245
|
+
*
|
|
246
|
+
* The sections are the same bytes the model read, split at the boundaries the
|
|
247
|
+
* producer assembled them on, so a reader sees which subsystem contributed
|
|
248
|
+
* which state instead of one undifferentiated wall.
|
|
249
|
+
*
|
|
250
|
+
* One sentence of the model-facing text is NOT in any section: the producer's
|
|
251
|
+
* framing line declaring that this snapshot supersedes earlier ones. Unlike the
|
|
252
|
+
* `<system-reminder>` wrapper an instruction context carries — which wraps
|
|
253
|
+
* content and cannot be separated from it — that line states the form's own
|
|
254
|
+
* semantics, so the body states them as a caption instead of reprinting the
|
|
255
|
+
* joined prose beside the sections it was split from.
|
|
256
|
+
* @param props - Durable content, its source, and the locale seat.
|
|
257
|
+
* @returns The snapshot context body, or the opaque body when unreadable.
|
|
258
|
+
*/
|
|
259
|
+
export function SnapshotBody({ content, source, t }) {
|
|
260
|
+
const sections = snapshotSections(source);
|
|
261
|
+
/* v8 ignore next -- contextBody reads the sections before choosing this body. */
|
|
262
|
+
if (sections === null)
|
|
263
|
+
return _jsx(OpaqueBody, { content: content, source: source, t: t });
|
|
264
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: css.catalogNotice, "data-context-snapshot-supersedes": true, children: t('message.context.snapshot.supersedes') }), _jsx("dl", { className: css.sections, "data-context-sections": true, children: sections.map((section, index) => (_jsxs("div", { className: css.section, children: [_jsx("dt", { className: css.sectionName, children: section.name }), _jsx("dd", { className: css.sectionText, children: boundedText(section.text, t) })] }, index))) })] }));
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* `notice` form: what just happened, with the model-facing text beneath it.
|
|
268
|
+
*
|
|
269
|
+
* The one-line account also rides the collapsed row ({@link contextBody}), so a
|
|
270
|
+
* notice is usually readable without expanding at all.
|
|
271
|
+
* @param props - Durable content, its source, and the locale seat.
|
|
272
|
+
* @returns The notice context body.
|
|
273
|
+
*/
|
|
274
|
+
export function NoticeBody({ content, t }) {
|
|
275
|
+
return _jsx(ModelFacingContent, { content: content, t: t });
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* `relay` form: which agent sent this, then what it said.
|
|
279
|
+
*
|
|
280
|
+
* The sender is an opaque session id; it is shown as a field rather than a
|
|
281
|
+
* label, because this client cannot resolve it to a title.
|
|
282
|
+
* @param props - Durable content, its source, and the locale seat.
|
|
283
|
+
* @returns The relay context body.
|
|
284
|
+
*/
|
|
285
|
+
export function RelayBody({ content, source, t }) {
|
|
286
|
+
const sender = relaySender(source);
|
|
287
|
+
/* v8 ignore next -- contextBody resolves the sender before choosing this body. */
|
|
288
|
+
if (sender === null)
|
|
289
|
+
return _jsx(OpaqueBody, { content: content, source: source, t: t });
|
|
290
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: css.relaySender, "data-context-relay-sender": true, children: t('message.context.relay.from', { session: sender }) }), _jsx(ModelFacingContent, { content: content, t: t })] }));
|
|
291
|
+
}
|
|
292
|
+
/** The sending agent's session id, or null when the record does not name one. */
|
|
293
|
+
function relaySender(source) {
|
|
294
|
+
const sender = asRecord(source)?.['senderSessionId'];
|
|
295
|
+
return typeof sender === 'string' && sender !== '' ? sender : null;
|
|
296
|
+
}
|
|
297
|
+
/** Recalled sessions read off the source, or null when the record is unusable. */
|
|
298
|
+
function recalledSessions(source) {
|
|
299
|
+
const record = asRecord(source);
|
|
300
|
+
const list = record === null ? undefined : record['references'];
|
|
301
|
+
if (!Array.isArray(list))
|
|
302
|
+
return null;
|
|
303
|
+
const sessions = [];
|
|
304
|
+
for (const item of list) {
|
|
305
|
+
const reference = asRecord(item);
|
|
306
|
+
if (reference === null)
|
|
307
|
+
return null;
|
|
308
|
+
const label = reference['label'];
|
|
309
|
+
const retained = reference['retainedMessages'];
|
|
310
|
+
const omitted = reference['omittedMessages'];
|
|
311
|
+
const truncated = reference['truncated'];
|
|
312
|
+
// Completeness is the fact this card exists to report, so a reference that
|
|
313
|
+
// cannot state it is not a readable recall — showing the label alone would
|
|
314
|
+
// present a confident card over unknown loss.
|
|
315
|
+
if (typeof label !== 'string' || label === ''
|
|
316
|
+
|| typeof retained !== 'number' || typeof omitted !== 'number'
|
|
317
|
+
|| typeof truncated !== 'boolean')
|
|
318
|
+
return null;
|
|
319
|
+
sessions.push({ label, retained, omitted, truncated });
|
|
320
|
+
}
|
|
321
|
+
return sessions.length === 0 ? null : sessions;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* `recall` form: which sessions this material came from and how much of each
|
|
325
|
+
* survived the read, then the material itself.
|
|
326
|
+
*
|
|
327
|
+
* Completeness is the fact a reader needs first: recalled context is bounded on
|
|
328
|
+
* the way in, so a card that hid the omitted count would overstate what the
|
|
329
|
+
* model received.
|
|
330
|
+
* @param props - Durable content, its source, and the locale seat.
|
|
331
|
+
* @returns The recall context body, or the opaque body when unreadable.
|
|
332
|
+
*/
|
|
333
|
+
export function RecallBody({ content, source, t }) {
|
|
334
|
+
const sessions = recalledSessions(source);
|
|
335
|
+
if (sessions === null)
|
|
336
|
+
return _jsx(OpaqueBody, { content: content, source: source, t: t });
|
|
337
|
+
return (_jsxs(_Fragment, { children: [_jsx("ul", { className: css.recalls, "data-context-recalls": true, children: sessions.map((session, index) => (_jsxs("li", { className: css.recall, children: [_jsx("span", { className: css.recallLabel, children: session.label }), _jsx("span", { className: css.recallCounts, children: t('message.context.recall.counts', {
|
|
338
|
+
retained: session.retained,
|
|
339
|
+
omitted: session.omitted,
|
|
340
|
+
}) }), session.truncated && (_jsx("span", { className: css.recallCounts, children: t('message.context.recall.truncated') }))] }, index))) }), _jsx(ModelFacingContent, { content: content, t: t })] }));
|
|
341
|
+
}
|
|
342
|
+
/** The one-line account a `notice` puts on its collapsed row, when it records one. */
|
|
343
|
+
function noticeSummary(source) {
|
|
344
|
+
const summary = asRecord(source)?.['summary'];
|
|
345
|
+
return typeof summary === 'string' && summary !== '' ? summary : null;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Choose the body for one context node.
|
|
349
|
+
*
|
|
350
|
+
* Returns the form the body actually rendered as, which is not always the
|
|
351
|
+
* declared one: a declared form whose fields are unreadable falls back to
|
|
352
|
+
* opaque, and the caller labels the row with what it really shows.
|
|
353
|
+
* `summary` is the collapsed row's one-line account, which only a `notice`
|
|
354
|
+
* records: its whole point is being readable without expanding.
|
|
355
|
+
* @param form - the producer-declared form projected onto the node.
|
|
356
|
+
* @param props - durable content, its source, and the locale seat.
|
|
357
|
+
* @returns the rendered form (null for opaque), its collapsed summary, and its body.
|
|
358
|
+
*/
|
|
359
|
+
export function contextBody(form, props) {
|
|
360
|
+
const opaque = { rendered: null, summary: null, body: _jsx(OpaqueBody, { ...props }) };
|
|
361
|
+
switch (form) {
|
|
362
|
+
case 'instructions':
|
|
363
|
+
return instructionChanges(props.source) === null
|
|
364
|
+
? opaque
|
|
365
|
+
: { rendered: 'instructions', summary: null, body: _jsx(InstructionsBody, { ...props }) };
|
|
366
|
+
case 'catalog':
|
|
367
|
+
return catalogEntries(props.source) === null
|
|
368
|
+
? opaque
|
|
369
|
+
: { rendered: 'catalog', summary: null, body: _jsx(CatalogBody, { ...props }) };
|
|
370
|
+
case 'snapshot':
|
|
371
|
+
return snapshotSections(props.source) === null
|
|
372
|
+
? opaque
|
|
373
|
+
: { rendered: 'snapshot', summary: null, body: _jsx(SnapshotBody, { ...props }) };
|
|
374
|
+
case 'notice': {
|
|
375
|
+
const summary = noticeSummary(props.source);
|
|
376
|
+
return summary === null
|
|
377
|
+
? opaque
|
|
378
|
+
: { rendered: 'notice', summary, body: _jsx(NoticeBody, { ...props }) };
|
|
379
|
+
}
|
|
380
|
+
case 'relay':
|
|
381
|
+
return relaySender(props.source) === null
|
|
382
|
+
? opaque
|
|
383
|
+
: { rendered: 'relay', summary: null, body: _jsx(RelayBody, { ...props }) };
|
|
384
|
+
case 'recall':
|
|
385
|
+
return recalledSessions(props.source) === null
|
|
386
|
+
? opaque
|
|
387
|
+
: { rendered: 'recall', summary: null, body: _jsx(RecallBody, { ...props }) };
|
|
388
|
+
case null:
|
|
389
|
+
return opaque;
|
|
390
|
+
/* v8 ignore next 4 -- closed-union backstop; the compiler rejects a new
|
|
391
|
+
KnownContextForm here rather than letting it degrade to opaque silently. */
|
|
392
|
+
default: {
|
|
393
|
+
const unreachable = form;
|
|
394
|
+
throw new Error(`unreachable context form: ${String(unreachable)}`);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
//# sourceMappingURL=ContextBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextBody.js","sourceRoot":"","sources":["../../../../src/client/native/ContextBody.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AAEjE,OAAO,GAAG,MAAM,0BAA0B,CAAA;AAE1C,8EAA8E;AAC9E,MAAM,SAAS,GAAG,MAAM,CAAA;AAExB,sEAAsE;AACtE,MAAM,WAAW,GAAG,GAAG,CAAA;AAIvB,wFAAwF;AACxF,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAC,KAAgC;QAClC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAKD;;;;;;;;;GASG;AACH,SAAS,WAAW,CAAC,OAAsC;IACzD,MAAM,IAAI,GAAiB,EAAE,CAAA;IAC7B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;YACpB,SAAQ;QACV,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAClC,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAA;;YAC5D,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAA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AO,MAAM,CAAA;QACf;mFAC2E;QAC3E,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,WAAW,GAAU,IAAI,CAAA;YAC/B,MAAM,IAAI,KAAK,CAAC,6BAA6B,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QACrE,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ContextMessageNode } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
2
|
+
import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
/** Props for the logged non-user message presentation. */
|
|
4
|
+
export interface ContextInjectionRowProps {
|
|
5
|
+
content: ContextMessageNode['content'];
|
|
6
|
+
source: ContextMessageNode['source'];
|
|
7
|
+
/**
|
|
8
|
+
* Role and producer name projected from the durable source.
|
|
9
|
+
*
|
|
10
|
+
* Host generations disagree on the field name: newer builds project
|
|
11
|
+
* `provenance`, the 0.1.6-alpha generations project `producer`. Both are
|
|
12
|
+
* optional here and resolved below, so the row renders on either host instead
|
|
13
|
+
* of throwing on `undefined.role` and degrading its whole block boundary.
|
|
14
|
+
*/
|
|
15
|
+
provenance?: ContextMessageNode['producer'] | null;
|
|
16
|
+
/** Alpha-generation spelling of {@link provenance}. */
|
|
17
|
+
producer?: ContextMessageNode['producer'] | null;
|
|
18
|
+
/** Producer-declared information form; null renders the opaque body. */
|
|
19
|
+
form: ContextMessageNode['form'];
|
|
20
|
+
/** The owning view's locale seat, passed down as a plain prop. */
|
|
21
|
+
t: TranslateNS<'chat'>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Render logged context with the Tool calls disclosure chrome from Figma.
|
|
25
|
+
*
|
|
26
|
+
* The header names the role the context plays and, beside it, the producer the
|
|
27
|
+
* durable source identifies, so a reader can tell an injected skill catalog
|
|
28
|
+
* from a workspace instruction file or a recalled session without expanding.
|
|
29
|
+
* The expanded body follows the producer-declared form; an absent or unknown
|
|
30
|
+
* form renders the opaque body.
|
|
31
|
+
* @param props - Durable content, its projected producer role/name and form, and the locale seat.
|
|
32
|
+
* @returns A collapsed context row with a bounded, form-specific body.
|
|
33
|
+
*/
|
|
34
|
+
export declare function ContextInjectionRow({ content, source, provenance, producer, form, t }: ContextInjectionRowProps): import("react").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=ContextInjectionRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextInjectionRow.d.ts","sourceRoot":"","sources":["../../../../src/client/native/ContextInjectionRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAA;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAOnE,0DAA0D;AAC1D,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAA;IACtC,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACpC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAG,IAAI,CAAA;IAClD,uDAAuD;IACvD,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAG,IAAI,CAAA;IAChD,wEAAwE;IACxE,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAChC,kEAAkE;IAClE,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,wBAAwB,+BAgE/G"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { DisclosureRow, IconBrowseOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
4
|
+
import { ReferenceIcon } from './ReferenceIcon.js';
|
|
5
|
+
import { contextBody } from './ContextBody.js';
|
|
6
|
+
import { toolUpdateRows } from './tool-update.js';
|
|
7
|
+
import css from './ContextInjectionRow.module.css';
|
|
8
|
+
/**
|
|
9
|
+
* Render logged context with the Tool calls disclosure chrome from Figma.
|
|
10
|
+
*
|
|
11
|
+
* The header names the role the context plays and, beside it, the producer the
|
|
12
|
+
* durable source identifies, so a reader can tell an injected skill catalog
|
|
13
|
+
* from a workspace instruction file or a recalled session without expanding.
|
|
14
|
+
* The expanded body follows the producer-declared form; an absent or unknown
|
|
15
|
+
* form renders the opaque body.
|
|
16
|
+
* @param props - Durable content, its projected producer role/name and form, and the locale seat.
|
|
17
|
+
* @returns A collapsed context row with a bounded, form-specific body.
|
|
18
|
+
*/
|
|
19
|
+
export function ContextInjectionRow({ content, source, provenance, producer, form, t }) {
|
|
20
|
+
const [open, setOpen] = useState(false);
|
|
21
|
+
// Two host generations, one component. A row whose projection is absent
|
|
22
|
+
// entirely still renders: the marker falls back to a plain injection.
|
|
23
|
+
const view = provenance ?? producer ?? { role: 'inject', label: null };
|
|
24
|
+
// Resolved rather than declared: a form whose fields are unreadable renders
|
|
25
|
+
// the opaque body, and the marker must say what the row actually shows.
|
|
26
|
+
const { rendered, summary, body } = contextBody(form, { content, source, t });
|
|
27
|
+
const tools = toolUpdateRows(content);
|
|
28
|
+
const toolSummary = tools === null || tools.single !== null ? null
|
|
29
|
+
: tools.added.length > 0 && tools.removed.length > 0
|
|
30
|
+
? t('message.toolsChanged', { added: tools.added.length, removed: tools.removed.length })
|
|
31
|
+
: tools.added.length > 0
|
|
32
|
+
? t('message.toolsAddedCount', { count: tools.added.length })
|
|
33
|
+
: t('message.toolsRemovedCount', { count: tools.removed.length });
|
|
34
|
+
return (_jsx(DisclosureRow, { className: css.root, icon: view.role === 'recall' && tools === null
|
|
35
|
+
? _jsx("span", { "data-context-recall-icon": true, children: _jsx(ReferenceIcon, { kind: "session" }) })
|
|
36
|
+
: _jsx(IconBrowseOutlineRegular, { size: 14 }), chevronClassName: css.chevron, title: tools?.single !== undefined && tools.single !== null
|
|
37
|
+
? t(tools.single.type === 'tool-addition' ? 'message.toolAdded' : 'message.toolRemoved', { name: tools.single.toolName })
|
|
38
|
+
: tools !== null
|
|
39
|
+
? t('message.toolsUpdated')
|
|
40
|
+
: t(view.role === 'recall' ? 'message.contextRecall' : 'message.contextInjection'), collapsedContent: toolSummary !== null ? (_jsxs(_Fragment, { children: [_jsx("span", { className: css.sep, "aria-hidden": true }), _jsx("span", { className: css.summary, children: toolSummary })] })) : tools !== null || view.label === null ? undefined : (_jsxs(_Fragment, { children: [_jsx("span", { className: css.sep, "aria-hidden": true }), _jsx("span", { className: css.source, "data-context-source": true, children: view.label }), summary !== null && (_jsxs(_Fragment, { children: [_jsx("span", { className: css.sep, "aria-hidden": true }), _jsx("span", { className: css.summary, "data-context-summary": true, children: summary })] }))] })), keepContentWhenOpen: true, open: open && tools?.single == null, expandable: tools?.single == null, expandOnRowClick: true, onToggle: () => { setOpen(value => !value); }, children: _jsx("div", { className: css.body, "data-context-injection-body": true, "data-context-form": rendered ?? undefined, children: tools === null ? body : (_jsxs("div", { className: css.toolChanges, children: [tools.added.length > 0 && _jsx("div", { children: t('message.toolsAdded', { names: tools.added.join(', ') }) }), tools.removed.length > 0 && _jsx("div", { children: t('message.toolsRemoved', { names: tools.removed.join(', ') }) })] })) }) }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=ContextInjectionRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextInjectionRow.js","sourceRoot":"","sources":["../../../../src/client/native/ContextInjectionRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGhC,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA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react';
|
|
2
|
+
/** Reference domains with distinct composer and transcript glyphs. */
|
|
3
|
+
export type ReferenceIconKind = 'session' | 'file' | 'folder';
|
|
4
|
+
/** Props shared by inline reference glyphs. */
|
|
5
|
+
export interface ReferenceIconProps {
|
|
6
|
+
kind: ReferenceIconKind;
|
|
7
|
+
size?: number;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Render the icon that identifies one inline reference domain.
|
|
12
|
+
* @param props - Reference kind, optional size, and optional CSS class.
|
|
13
|
+
* @returns The corresponding current-color SVG glyph.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ReferenceIcon({ kind, size, className }: ReferenceIconProps): ReactNode;
|
|
16
|
+
//# sourceMappingURL=ReferenceIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferenceIcon.d.ts","sourceRoot":"","sources":["../../../../src/client/native/ReferenceIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,sEAAsE;AACtE,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE7D,+CAA+C;AAC/C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,iBAAiB,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,SAAS,EAAE,EAAE,kBAAkB,GAAG,SAAS,CAc3F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IconBrowseOutlineRegular, IconFolderCloseRegular, } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
/**
|
|
4
|
+
* Render the icon that identifies one inline reference domain.
|
|
5
|
+
* @param props - Reference kind, optional size, and optional CSS class.
|
|
6
|
+
* @returns The corresponding current-color SVG glyph.
|
|
7
|
+
*/
|
|
8
|
+
export function ReferenceIcon({ kind, size = 16, className }) {
|
|
9
|
+
switch (kind) {
|
|
10
|
+
case 'session':
|
|
11
|
+
return (_jsx("svg", { width: size, height: size, className: className, viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: _jsx("path", { d: "M8 0.597656C3.91296 0.597656 0.599716 3.91103 0.599609 7.99805C0.599609 9.13171 0.854567 10.2079 1.31152 11.1699L1.59277 11.7607L2.77441 11.1992L2.49414 10.6084L2.36035 10.3076C2.06865 9.59612 1.90723 8.81645 1.90723 7.99805C1.90733 4.63362 4.63554 1.90625 8 1.90625C11.3644 1.90635 14.0917 4.63368 14.0918 7.99805C14.0918 11.3625 11.3644 14.0907 8 14.0908C7.311 14.0908 6.80642 14.0414 6.35938 13.918C5.919 13.7963 5.50105 13.5929 5.00098 13.2441C4.26805 12.7329 3.21756 12.5526 2.35156 13.0996L2.33789 13.1084L2.32422 13.1182L1.74805 13.5234L2.18164 14.8184L3.05957 14.2002C3.37505 14.0068 3.84248 14.0319 4.25195 14.3174C4.84447 14.7307 5.39718 15.009 6.01172 15.1787C6.61963 15.3465 7.25579 15.3984 8 15.3984C12.087 15.3983 15.4004 12.0851 15.4004 7.99805C15.4003 3.9111 12.087 0.59776 8 0.597656ZM4.56836 8.50977V9.80371H8.12402V8.50977H4.56836ZM4.56836 7.30078H11.4619V6.00684H4.56836V7.30078Z", fill: "currentColor" }) }));
|
|
12
|
+
case 'file': return _jsx(IconBrowseOutlineRegular, { size: size, className: className });
|
|
13
|
+
case 'folder': return _jsx(IconFolderCloseRegular, { size: size, className: className });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ReferenceIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferenceIcon.js","sourceRoot":"","sources":["../../../../src/client/native/ReferenceIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,wBAAwB,EAAE,sBAAsB,GACjD,MAAM,uCAAuC,CAAA;AAY9C;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,EAAsB;IAC9E,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,CACL,cAAK,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iCACnF,eACE,CAAC,EAAC,q4BAAq4B,EACv4B,IAAI,EAAC,cAAc,GACnB,GACE,CACP,CAAA;QACH,KAAK,MAAM,CAAC,CAAC,OAAO,KAAC,wBAAwB,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,CAAA;QAClF,KAAK,QAAQ,CAAC,CAAC,OAAO,KAAC,sBAAsB,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,CAAA;IACpF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ToolCallBlock, ToolResultNode } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
2
|
+
export type { ToolCallBlock } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
|
+
/** Tool-call row variants selected by the generic atomic renderer. */
|
|
4
|
+
export type ToolRowVariant = 'search' | 'read' | 'bash' | 'write' | 'edit' | 'code' | 'others';
|
|
5
|
+
/** Row state semantic; colors self-supplied via StateDot (design gives none). */
|
|
6
|
+
export type ToolRowState = 'running' | 'ok' | 'error' | 'stopped';
|
|
7
|
+
/** Figma row titles per variant (design literals, not translatable copy). */
|
|
8
|
+
export declare const VARIANT_TITLES: Record<ToolRowVariant, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Classify a tool name into its row variant.
|
|
11
|
+
* @param toolName - wire tool name.
|
|
12
|
+
* @returns matching variant, others when unknown.
|
|
13
|
+
*/
|
|
14
|
+
export declare function classifyTool(toolName: string): ToolRowVariant;
|
|
15
|
+
/** Everything ToolRow needs, derived once from the frozen slice. */
|
|
16
|
+
export interface ToolRowModel {
|
|
17
|
+
variant: ToolRowVariant;
|
|
18
|
+
title: string;
|
|
19
|
+
summary: string;
|
|
20
|
+
/**
|
|
21
|
+
* Filesystem path from args (`path` / `file_path`) when the row is a file
|
|
22
|
+
* tool; absent for URL reads and non-file tools. The chat view resolves
|
|
23
|
+
* relative values against the session cwd before opening.
|
|
24
|
+
*/
|
|
25
|
+
filePath: string | undefined;
|
|
26
|
+
/** Expanded-body input text (pretty args); null = no input section. */
|
|
27
|
+
body: string | null;
|
|
28
|
+
/** Flattened result text ({@link resultText}); null while running or when the result carries no text. */
|
|
29
|
+
output: string | null;
|
|
30
|
+
/** First line of the result text on an error row; null for every other state. */
|
|
31
|
+
errorSummary: string | null;
|
|
32
|
+
state: ToolRowState;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Flatten a settled result's content blocks to display text: text blocks
|
|
36
|
+
* verbatim, other block shapes as pretty JSON. Empty content on a failed call
|
|
37
|
+
* falls back to the structured error's `name: code` line.
|
|
38
|
+
* @param node - the settled result node.
|
|
39
|
+
* @returns the flattened result text (may be empty).
|
|
40
|
+
*/
|
|
41
|
+
export declare function resultText(node: ToolResultNode): string;
|
|
42
|
+
/**
|
|
43
|
+
* Strip the workspace root from a workspace-rooted absolute path (display only).
|
|
44
|
+
* @param text - the path to shorten.
|
|
45
|
+
* @param cwd - session workspace root; absent or empty leaves the path unchanged.
|
|
46
|
+
* @returns the path relative to the workspace root, or unchanged when it is not rooted there.
|
|
47
|
+
*/
|
|
48
|
+
export declare function relativizeToCwd(text: string, cwd: string | undefined): string;
|
|
49
|
+
/**
|
|
50
|
+
* Derive the full row model from a frozen call slice.
|
|
51
|
+
* @param toolName - wire tool name (dispatch-supplied; survives windowless results).
|
|
52
|
+
* @param block - RunningToolCall or ToolResultNode off the snapshot caches.
|
|
53
|
+
* @param cwd - session workspace root; workspace-rooted path summaries display relative to it.
|
|
54
|
+
* @param home - host account home; a leftover POSIX home path displays as `~`.
|
|
55
|
+
* @returns the row model.
|
|
56
|
+
*/
|
|
57
|
+
export declare function toolRowModel(toolName: string, block: ToolCallBlock, cwd?: string, home?: string): ToolRowModel;
|
|
58
|
+
//# sourceMappingURL=tool-call-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-call-model.d.ts","sourceRoot":"","sources":["../../../../src/client/native/tool-call-model.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAA;AAEnG,YAAY,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAA;AAEnF,sEAAsE;AACtE,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE9F,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,CAAA;AAEjE,6EAA6E;AAC7E,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAGzD,CAAA;AA6CD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAE7D;AAED,oEAAoE;AACpE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,uEAAuE;IACvE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,yGAAyG;IACzG,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,iFAAi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