dsh-tidy-display 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/CHANGELOG.md +270 -0
- package/DESIGN.md +72 -0
- package/LICENSE +24 -0
- package/README.en.md +118 -0
- package/README.md +118 -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/docs/plans/2026-09-28-merge/checklist.md +21 -0
- package/docs/plans/2026-09-28-merge/findings.md +24 -0
- package/docs/plans/2026-09-28-merge/spec.md +61 -0
- package/docs/plans/2026-09-28-merge/tasks.md +34 -0
- package/dshx.yml +5 -0
- package/lib/client.js +50207 -0
- package/lib/client.js.map +1 -0
- package/lib/dsh-tidy-display.js +254 -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 +508 -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 +59 -0
- package/lib/types/client/SettingsSection.d.ts.map +1 -0
- package/lib/types/client/SettingsSection.js +93 -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 +234 -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 +144 -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 +295 -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/rail/RailView.d.ts +24 -0
- package/lib/types/client/rail/RailView.d.ts.map +1 -0
- package/lib/types/client/rail/RailView.js +540 -0
- package/lib/types/client/rail/RailView.js.map +1 -0
- package/lib/types/client/rail/colors.d.ts +43 -0
- package/lib/types/client/rail/colors.d.ts.map +1 -0
- package/lib/types/client/rail/colors.js +223 -0
- package/lib/types/client/rail/colors.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 +85 -0
- package/lib/types/client/settings-copy.js.map +1 -0
- package/lib/types/client/settings-slots.d.ts +34 -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 +66 -0
- package/lib/types/client/store.d.ts.map +1 -0
- package/lib/types/client/store.js +61 -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-tidy-display.d.ts +17 -0
- package/lib/types/dsh-tidy-display.d.ts.map +1 -0
- package/lib/types/dsh-tidy-display.js +97 -0
- package/lib/types/dsh-tidy-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 +141 -0
- package/scripts/build-motion-fixture.mjs +26 -0
- package/scripts/check-harness-compat.mjs +75 -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 +714 -0
- package/src/client/Reader.tsx +783 -0
- package/src/client/ReasoningCard.tsx +306 -0
- package/src/client/SettingsSection.module.css +184 -0
- package/src/client/SettingsSection.tsx +391 -0
- package/src/client/StickyLane.tsx +34 -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 +268 -0
- package/src/client/live-turn.ts +155 -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 +352 -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/rail/RailView.tsx +508 -0
- package/src/client/rail/colors.ts +212 -0
- package/src/client/reasoning-follow.ts +28 -0
- package/src/client/settings-copy.ts +128 -0
- package/src/client/settings-slots.ts +27 -0
- package/src/client/settings.tsx +73 -0
- package/src/client/skill-status.ts +78 -0
- package/src/client/store.ts +130 -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 +75 -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-tidy-display.ts +112 -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 +93 -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 +140 -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,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rail color chain, ported from dsh-tidychat (release/0.1.7).
|
|
3
|
+
*
|
|
4
|
+
* resolveNavColors → applyNavColors write the resolved colors into root CSS
|
|
5
|
+
* variables; the canvas redraw reads the variables instead of recomputing.
|
|
6
|
+
* Principles kept from tidychat:
|
|
7
|
+
* - auto bar color respects the theme token (label-caption), switching to a
|
|
8
|
+
* corrective gray only when contrast vs the real background is under 3:1;
|
|
9
|
+
* - auto accent follows the theme brand color;
|
|
10
|
+
* - tip contrast correction is conservative: only opaque tip backgrounds
|
|
11
|
+
* (alpha ≥ 0.85) with failing contrast get corrected; translucent/glass
|
|
12
|
+
* skins keep token following.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export interface RailColorConfig {
|
|
16
|
+
navColor: string;
|
|
17
|
+
navColorCustom: string;
|
|
18
|
+
navColorLight: string;
|
|
19
|
+
navAccent: string;
|
|
20
|
+
navAccentCustom: string;
|
|
21
|
+
navAccentLight: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const NAV_HUE_KEYS = ['gray', 'black', 'white', 'blue', 'violet', 'cyan', 'green', 'orange', 'red'] as const;
|
|
25
|
+
export const NAV_HUE_LABELS: Record<string, string> = {
|
|
26
|
+
gray: '灰', black: '黑', white: '白', blue: '蓝', violet: '紫', cyan: '青', green: '绿', orange: '橙', red: '红',
|
|
27
|
+
};
|
|
28
|
+
export const NAV_HUE_PREVIEW: Record<string, string> = {
|
|
29
|
+
gray: '#9e9e9e', black: '#111111', white: '#f5f5f5', blue: '#3b82f6', violet: '#8b5cf6', cyan: '#06b6d4', green: '#22c55e', orange: '#f97316', red: '#ef4444',
|
|
30
|
+
};
|
|
31
|
+
export const NAV_LIGHT_KEYS = ['l1', 'l2', 'l3', 'l4', 'l5'] as const;
|
|
32
|
+
export const NAV_LIGHT_LABELS: Record<string, string> = { l1: '极浅', l2: '浅', l3: '中', l4: '深', l5: '极深' };
|
|
33
|
+
|
|
34
|
+
const NAV_HUE_PALETTE: Record<string, [string, string, string, string, string]> = {
|
|
35
|
+
gray: ['rgba(225,225,225,0.9)', 'rgba(190,190,190,0.78)', 'rgba(128,128,128,0.8)', 'rgba(70,70,70,0.85)', 'rgba(20,20,20,0.92)'],
|
|
36
|
+
black: ['rgba(90,90,90,0.8)', 'rgba(60,60,60,0.85)', 'rgba(30,30,30,0.9)', 'rgba(12,12,12,0.94)', 'rgba(0,0,0,0.97)'],
|
|
37
|
+
white: ['rgba(255,255,255,0.95)', 'rgba(250,250,250,0.9)', 'rgba(240,240,240,0.85)', 'rgba(225,225,225,0.8)', 'rgba(205,205,205,0.75)'],
|
|
38
|
+
blue: ['#93c5fd', '#60a5fa', '#3b82f6', '#2563eb', '#1e40af'],
|
|
39
|
+
violet: ['#c4b5fd', '#a78bfa', '#8b5cf6', '#7c3aed', '#5b21b6'],
|
|
40
|
+
cyan: ['#67e8f9', '#22d3ee', '#06b6d4', '#0891b2', '#155e75'],
|
|
41
|
+
green: ['#86efac', '#4ade80', '#22c55e', '#16a34a', '#166534'],
|
|
42
|
+
orange: ['#fdba74', '#fb923c', '#f97316', '#ea580c', '#9a3412'],
|
|
43
|
+
red: ['#fca5a5', '#f87171', '#ef4444', '#dc2626', '#991b1b'],
|
|
44
|
+
};
|
|
45
|
+
const NAV_LIGHT_IDX: Record<string, number> = { l1: 0, l2: 1, l3: 2, l4: 3, l5: 4 };
|
|
46
|
+
|
|
47
|
+
const hueColor = (hue: unknown, light: unknown, fallback: string): string => {
|
|
48
|
+
if (typeof hue === 'string') {
|
|
49
|
+
const palette = NAV_HUE_PALETTE[hue]
|
|
50
|
+
if (palette !== undefined) return palette[NAV_LIGHT_IDX[typeof light === 'string' ? light : 'l3'] ?? 2]
|
|
51
|
+
}
|
|
52
|
+
return fallback
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const parseRgba = (s: string): [number, number, number, number] | null => {
|
|
56
|
+
const t = (s ?? '').trim().toLowerCase()
|
|
57
|
+
if (t === '') return null
|
|
58
|
+
if (t === 'transparent') return [0, 0, 0, 0]
|
|
59
|
+
const hex = /^#([0-9a-f]{3,8})$/.exec(t)
|
|
60
|
+
if (hex !== null) {
|
|
61
|
+
let h = hex[1]
|
|
62
|
+
if (h.length === 3 || h.length === 4) h = h.split('').map((c) => c + c).join('')
|
|
63
|
+
if (h.length === 6) h += 'ff'
|
|
64
|
+
const n = parseInt(h, 16)
|
|
65
|
+
return [(n >> 24) & 255, (n >> 16) & 255, (n >> 8) & 255, Math.round(((n & 255) / 255) * 1000) / 1000]
|
|
66
|
+
}
|
|
67
|
+
const num = (x: string, base: number): number | null => {
|
|
68
|
+
const v = x.trim()
|
|
69
|
+
if (v === '') return null
|
|
70
|
+
const p = v.endsWith('%') ? Number(v.slice(0, -1)) : Number(v)
|
|
71
|
+
if (Number.isNaN(p)) return null
|
|
72
|
+
if (base === 255 && v.endsWith('%')) return Math.round((p / 100) * 255)
|
|
73
|
+
if (base === 1 && v.endsWith('%')) return p / 100
|
|
74
|
+
return base === 1 ? p : Math.round(p)
|
|
75
|
+
}
|
|
76
|
+
const comma = /^rgba?\(\s*([\d.]+%?)\s*,\s*([\d.]+%?)\s*,\s*([\d.]+%?)(?:\s*,\s*([\d.]+%?))?\s*\)$/.exec(t)
|
|
77
|
+
if (comma !== null) {
|
|
78
|
+
const r = num(comma[1], 255); const g = num(comma[2], 255); const b = num(comma[3], 255)
|
|
79
|
+
const a = comma[4] !== undefined ? num(comma[4], 1) : 1
|
|
80
|
+
if (r === null || g === null || b === null || a === null) return null
|
|
81
|
+
return [r, g, b, a]
|
|
82
|
+
}
|
|
83
|
+
const space = /^rgba?\(\s*([\d.]+%?)\s+([\d.]+%?)\s+([\d.]+%?)(?:\s*\/\s*([\d.]+%?))?\s*\)$/.exec(t)
|
|
84
|
+
if (space !== null) {
|
|
85
|
+
const r = num(space[1], 255); const g = num(space[2], 255); const b = num(space[3], 255)
|
|
86
|
+
const a = space[4] !== undefined ? num(space[4], 1) : 1
|
|
87
|
+
if (r === null || g === null || b === null || a === null) return null
|
|
88
|
+
return [r, g, b, a]
|
|
89
|
+
}
|
|
90
|
+
return null
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const parseRgb = (s: string): [number, number, number] | null => {
|
|
94
|
+
const a = parseRgba(s)
|
|
95
|
+
return a === null ? null : [a[0], a[1], a[2]]
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const findBackgroundRgb = (start: Element | null): [number, number, number] | null => {
|
|
99
|
+
try {
|
|
100
|
+
let el: Element | null = start
|
|
101
|
+
while (el !== null) {
|
|
102
|
+
const rgba = parseRgba(getComputedStyle(el).backgroundColor)
|
|
103
|
+
if (rgba !== null && rgba[3] > 0) return [rgba[0], rgba[1], rgba[2]]
|
|
104
|
+
el = el.parentElement
|
|
105
|
+
}
|
|
106
|
+
} catch { /* 兜底 */ }
|
|
107
|
+
return null
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const isDarkBackground = (start: Element | null): boolean => {
|
|
111
|
+
const rgb = findBackgroundRgb(start)
|
|
112
|
+
if (rgb !== null) return 0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2] < 128
|
|
113
|
+
try {
|
|
114
|
+
if (typeof matchMedia === 'function' && matchMedia('(prefers-color-scheme: dark)').matches) return true
|
|
115
|
+
} catch { /* ignore */ }
|
|
116
|
+
return false
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const contrastRatio = (a: [number, number, number], b: [number, number, number]): number => {
|
|
120
|
+
const lum = (c: [number, number, number]): number => {
|
|
121
|
+
const f = (v: number): number => {
|
|
122
|
+
const s = v / 255
|
|
123
|
+
return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4)
|
|
124
|
+
}
|
|
125
|
+
return 0.2126 * f(c[0]) + 0.7152 * f(c[1]) + 0.0722 * f(c[2])
|
|
126
|
+
}
|
|
127
|
+
const la = lum(a)
|
|
128
|
+
const lb = lum(b)
|
|
129
|
+
const hi = Math.max(la, lb)
|
|
130
|
+
const lo = Math.min(la, lb)
|
|
131
|
+
return (hi + 0.05) / (lo + 0.05)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const validColor = (raw: unknown, fallback: string): string => {
|
|
135
|
+
if (typeof raw !== 'string') return fallback
|
|
136
|
+
const s = raw.trim()
|
|
137
|
+
if (s === '') return fallback
|
|
138
|
+
return parseRgba(s) !== null ? s : fallback
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export const resolveNavColors = (cfg: RailColorConfig, start: Element | null): { bar: string; hot: string } => {
|
|
142
|
+
const cs = getComputedStyle(document.documentElement)
|
|
143
|
+
const brand = cs.getPropertyValue('--dsw-alias-state-business-primary').trim() || '#3b82f6'
|
|
144
|
+
const caption = cs.getPropertyValue('--dsw-alias-label-caption').trim() || 'rgba(127,127,127,0.5)'
|
|
145
|
+
const autoBar = (): string => {
|
|
146
|
+
const captionRgb = parseRgb(caption)
|
|
147
|
+
const bgRgb = findBackgroundRgb(start)
|
|
148
|
+
if (captionRgb !== null && bgRgb !== null && contrastRatio(captionRgb, bgRgb) >= 3) return caption
|
|
149
|
+
return isDarkBackground(start) ? 'rgba(226,226,226,0.85)' : 'rgba(80,80,80,0.78)'
|
|
150
|
+
}
|
|
151
|
+
const colorMode = cfg.navColor ?? 'auto'
|
|
152
|
+
const bar = colorMode === 'auto' ? autoBar()
|
|
153
|
+
: colorMode === 'custom' ? validColor(cfg.navColorCustom, autoBar())
|
|
154
|
+
: hueColor(colorMode, cfg.navColorLight, caption)
|
|
155
|
+
const accentMode = cfg.navAccent ?? 'auto'
|
|
156
|
+
const hot = accentMode === 'auto' ? brand
|
|
157
|
+
: accentMode === 'custom' ? validColor(cfg.navAccentCustom, brand)
|
|
158
|
+
: hueColor(accentMode, cfg.navAccentLight, brand)
|
|
159
|
+
return { bar, hot }
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// 保守兜底(仅提示卡):只有浮层背景不透明(alpha ≥ 0.85)且对比 <3:1 时才纠偏;
|
|
163
|
+
// 玻璃/半透明浮层一律清空变量、跟随主题 token。
|
|
164
|
+
const applyTipContrast = (): void => {
|
|
165
|
+
const root = document.documentElement
|
|
166
|
+
const cs = getComputedStyle(document.body)
|
|
167
|
+
const tipBg = parseRgba(cs.getPropertyValue('--dsw-alias-bg-layer-3').trim())
|
|
168
|
+
const update = (key: string, token: string): void => {
|
|
169
|
+
if (tipBg === null || tipBg[3] < 0.85) { root.style.removeProperty(key); return }
|
|
170
|
+
const rgb = parseRgb(token)
|
|
171
|
+
const darkBg = 0.2126 * tipBg[0] + 0.7152 * tipBg[1] + 0.0722 * tipBg[2] < 128
|
|
172
|
+
const corrected = darkBg ? 'rgba(235,235,235,0.92)' : 'rgba(55,55,55,0.92)'
|
|
173
|
+
if (rgb === null || contrastRatio(rgb, [tipBg[0], tipBg[1], tipBg[2]]) >= 3) { root.style.removeProperty(key); return }
|
|
174
|
+
if (root.style.getPropertyValue(key) !== corrected) root.style.setProperty(key, corrected)
|
|
175
|
+
}
|
|
176
|
+
update('--tidychat-nav-tip-text', cs.getPropertyValue('--dsw-alias-label-primary').trim() || '#222')
|
|
177
|
+
update('--tidychat-nav-tip-head', cs.getPropertyValue('--dsw-alias-label-secondary').trim() || '#666')
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export const applyNavColors = (cfg: RailColorConfig, start: Element | null): void => {
|
|
181
|
+
const { bar, hot } = resolveNavColors(cfg, start)
|
|
182
|
+
const root = document.documentElement
|
|
183
|
+
if (root.style.getPropertyValue('--tidychat-nav-color') !== bar) root.style.setProperty('--tidychat-nav-color', bar)
|
|
184
|
+
if (root.style.getPropertyValue('--tidychat-nav-color-hot') !== hot) root.style.setProperty('--tidychat-nav-color-hot', hot)
|
|
185
|
+
applyTipContrast()
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Install the color pipeline once per client: reacts to store changes (the
|
|
190
|
+
* settings card), theme switches (:root class/style/data-theme) and a slow
|
|
191
|
+
* fallback interval (sidebar resize changes the resolved background). Writes
|
|
192
|
+
* are guarded (value-equal) so the theme observer cannot loop.
|
|
193
|
+
*/
|
|
194
|
+
export function installRailColors(
|
|
195
|
+
prefs: { subscribe: (fn: () => void) => () => void; getSnapshot: () => RailColorConfig },
|
|
196
|
+
getStart: () => Element | null,
|
|
197
|
+
): () => void {
|
|
198
|
+
const run = (): void => applyNavColors(prefs.getSnapshot(), getStart())
|
|
199
|
+
run()
|
|
200
|
+
const unsub = prefs.subscribe(() => run())
|
|
201
|
+
let themeObs: MutationObserver | null = null
|
|
202
|
+
if (typeof MutationObserver !== 'undefined') {
|
|
203
|
+
themeObs = new MutationObserver(() => run())
|
|
204
|
+
themeObs.observe(document.documentElement, { attributes: true, attributeFilter: ['class', 'style', 'data-theme'] })
|
|
205
|
+
}
|
|
206
|
+
const interval = setInterval(run, 5000)
|
|
207
|
+
return () => {
|
|
208
|
+
try { unsub() } catch { /* ignore */ }
|
|
209
|
+
themeObs?.disconnect()
|
|
210
|
+
clearInterval(interval)
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Transitions.dev Reasoning stream, adapted to appended content, never a loop. */
|
|
2
|
+
export const REASON_HOLD = 840;
|
|
3
|
+
export const REASON_STEP = 500;
|
|
4
|
+
export const REASON_LINES = 2;
|
|
5
|
+
/** Ceiling on how much text one catch-up step may cover. */
|
|
6
|
+
export const REASON_MAX_LINES = 40;
|
|
7
|
+
/** Beat between catch-up steps, while the transcript is still well behind. */
|
|
8
|
+
export const REASON_CHASE_HOLD = 40;
|
|
9
|
+
|
|
10
|
+
export function reasoningTarget(
|
|
11
|
+
top: number,
|
|
12
|
+
contentHeight: number,
|
|
13
|
+
viewportHeight: number,
|
|
14
|
+
lineHeight: number,
|
|
15
|
+
backlogLines = 0,
|
|
16
|
+
): number {
|
|
17
|
+
const end = Math.max(0, contentHeight - viewportHeight);
|
|
18
|
+
const current = Math.min(end, Math.max(0, top));
|
|
19
|
+
// `backlogLines` is how far the newest text sits below what is painted. The
|
|
20
|
+
// reference step size is a reading pace: two lines, then a hold. That pace is
|
|
21
|
+
// far slower than a fast model writes, so the viewport used to crawl behind in
|
|
22
|
+
// fixed hops no matter how quickly the text arrived. Covering the backlog in
|
|
23
|
+
// one step keeps the newest line with the text instead; a model that writes at
|
|
24
|
+
// or below the reading pace still leaves the backlog at two lines, unchanged.
|
|
25
|
+
const lines = Math.max(REASON_LINES, Math.min(REASON_MAX_LINES, Math.ceil(backlogLines)));
|
|
26
|
+
return Math.min(end, current + Math.max(1, lineHeight) * lines);
|
|
27
|
+
}
|
|
28
|
+
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export type SettingsCopyKey =
|
|
2
|
+
| 'nav'
|
|
3
|
+
| 'openTitle'
|
|
4
|
+
| 'openDescription'
|
|
5
|
+
| 'glassTitle'
|
|
6
|
+
| 'glassDescription'
|
|
7
|
+
| 'bubbleTitle'
|
|
8
|
+
| 'bubbleDescription'
|
|
9
|
+
| 'foldTitle'
|
|
10
|
+
| 'foldDescription'
|
|
11
|
+
| 'foldNone'
|
|
12
|
+
| 'foldStandard'
|
|
13
|
+
| 'foldSummary'
|
|
14
|
+
| 'railTitle'
|
|
15
|
+
| 'railDescription'
|
|
16
|
+
| 'railSide'
|
|
17
|
+
| 'railSideLeft'
|
|
18
|
+
| 'railSideRight'
|
|
19
|
+
| 'railStyle'
|
|
20
|
+
| 'railStyleBar'
|
|
21
|
+
| 'railStyleDot'
|
|
22
|
+
| 'railRingTitle'
|
|
23
|
+
| 'railRingDescription'
|
|
24
|
+
| 'takeoverTitle'
|
|
25
|
+
| 'takeoverDescription'
|
|
26
|
+
| 'colorBarTitle'
|
|
27
|
+
| 'colorAccentTitle'
|
|
28
|
+
| 'colorAuto'
|
|
29
|
+
| 'colorCustom'
|
|
30
|
+
| 'skillTitle'
|
|
31
|
+
| 'skillInstalled'
|
|
32
|
+
| 'skillMissing'
|
|
33
|
+
| 'skillPurpose'
|
|
34
|
+
| 'skillPluginNote'
|
|
35
|
+
| 'skillInstall'
|
|
36
|
+
| 'skillRecheck'
|
|
37
|
+
| 'skillChecking'
|
|
38
|
+
| 'skillUnavailable';
|
|
39
|
+
|
|
40
|
+
export type SettingsCopy = Record<SettingsCopyKey, string>;
|
|
41
|
+
|
|
42
|
+
export const en: SettingsCopy = {
|
|
43
|
+
nav: '整洁显示',
|
|
44
|
+
openTitle: 'Open deliverables in built-in panel',
|
|
45
|
+
openDescription: 'Off by default: chips and inline file mentions open in the system app. Turn this on to preview them in the right Sidebar, matching official chat. Reveal and folder actions still use the system file manager.',
|
|
46
|
+
glassTitle: 'Translucent frosted glass',
|
|
47
|
+
glassDescription: 'Off by default: reading chrome stays opaque, matching the current Host look. Turn this on to let wallpaper and skins show through the panel; path and count chips stay clear until hover or focus.',
|
|
48
|
+
bubbleTitle: 'Message bubbles',
|
|
49
|
+
bubbleDescription: 'On by default: final answers sit in a rounded bubble that separates them from the background, translucent in frosted-glass mode. Turn this off to lay answers flat on the page.',
|
|
50
|
+
foldTitle: 'Auto-fold process',
|
|
51
|
+
foldDescription: 'Default on: collapses earlier steps when new thoughts appear. Turn off to keep all thinking and tools expanded in full.',
|
|
52
|
+
foldNone: 'Off',
|
|
53
|
+
foldStandard: 'On',
|
|
54
|
+
foldSummary: 'Summary',
|
|
55
|
+
railTitle: 'Message rail',
|
|
56
|
+
railDescription: 'On by default: a canvas navigation rail at the conversation edge — fish-eye hover with summaries, click to jump, current-turn highlight.',
|
|
57
|
+
railSide: 'Rail position',
|
|
58
|
+
railSideLeft: 'Left edge',
|
|
59
|
+
railSideRight: 'Right edge (mirrored)',
|
|
60
|
+
railStyle: 'Rail style',
|
|
61
|
+
railStyleBar: 'Lines',
|
|
62
|
+
railStyleDot: 'Dots',
|
|
63
|
+
railRingTitle: 'Rail sheen',
|
|
64
|
+
railRingDescription: 'On by default (matches the store default): a soft white sheen laid beneath the current and hovered marks, keeping them readable over busy wallpapers.',
|
|
65
|
+
takeoverTitle: 'Take over the official rail',
|
|
66
|
+
takeoverDescription: 'On by default: the official right-edge TurnNavigator is hidden (hidden, not unmounted) so this rail is the only one. Turn off to see both.',
|
|
67
|
+
colorBarTitle: 'Mark color',
|
|
68
|
+
colorAccentTitle: 'Accent color',
|
|
69
|
+
colorAuto: 'Auto',
|
|
70
|
+
colorCustom: 'Custom',
|
|
71
|
+
skillTitle: 'generative-mcpapps skill',
|
|
72
|
+
skillInstalled: 'Installed',
|
|
73
|
+
skillMissing: 'Not detected',
|
|
74
|
+
skillPurpose: 'This install is for model auto-selection of MCP Apps. Reader already renders mcp-app fences when the model emits them.',
|
|
75
|
+
skillPluginNote: 'Shipping the pack inside this plugin repository does not install it into the harness skill catalog.',
|
|
76
|
+
skillInstall: 'Copy the whole generative-mcpapps folder (including references and examples) into .dsh/skills or .agents/skills — in your home or the project, you choose — then Re-check. There is no one-click install that works on every host.',
|
|
77
|
+
skillRecheck: 'Re-check',
|
|
78
|
+
skillChecking: 'Checking…',
|
|
79
|
+
skillUnavailable: 'Could not query the host skill catalog. Copy into .dsh/skills or .agents/skills (home or project), then Re-check.',
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const zh: SettingsCopy = {
|
|
83
|
+
nav: '整洁显示',
|
|
84
|
+
openTitle: '在内置面板中打开产物',
|
|
85
|
+
openDescription: '默认关闭:产物芯片和正文中的文件提及会用系统应用打开。打开后与官方对话一致,在右侧栏预览。访达 / 资源管理器中的显示与打开所在文件夹不受此开关控制。',
|
|
86
|
+
glassTitle: '半透明毛玻璃',
|
|
87
|
+
glassDescription: '默认关闭:阅读栏保持不透明,和现在的 Host 观感一致。打开后透出宿主壁纸与皮肤;路径、行数等标签静止时透明,悬停或聚焦才显出轮廓。',
|
|
88
|
+
bubbleTitle: '消息气泡',
|
|
89
|
+
bubbleDescription: '默认开启:最终回答放进圆角气泡,与页面背景区分;毛玻璃模式下呈半透明。关闭后回答平铺在页面上。',
|
|
90
|
+
foldTitle: '自动折叠过程',
|
|
91
|
+
foldDescription: '默认开启:新思考产生时自动折叠此前步骤。关闭后全程展开,完整保留原始思考与工具流。',
|
|
92
|
+
foldNone: '关闭',
|
|
93
|
+
foldStandard: '开启',
|
|
94
|
+
foldSummary: '摘要',
|
|
95
|
+
railTitle: '消息轨',
|
|
96
|
+
railDescription: '默认开启:会话区边缘的 canvas 导航轨——鱼眼悬停看摘要、点击跳转、当前轮高亮。',
|
|
97
|
+
railSide: '显示位置',
|
|
98
|
+
railSideLeft: '左缘',
|
|
99
|
+
railSideRight: '右缘(镜像)',
|
|
100
|
+
railStyle: '显示样式',
|
|
101
|
+
railStyleBar: '横线',
|
|
102
|
+
railStyleDot: '圆点',
|
|
103
|
+
railRingTitle: '外圈柔光',
|
|
104
|
+
railRingDescription: '默认开启:在当前轮与悬停轮的标记底下垫一层白色柔光,复杂壁纸上也能看清标记。',
|
|
105
|
+
takeoverTitle: '接管官方消息轨',
|
|
106
|
+
takeoverDescription: '默认开启:隐藏官方右缘 TurnNavigator(隐藏而非卸载),只保留本轨。关闭后两条轨并存。',
|
|
107
|
+
colorBarTitle: '标记色',
|
|
108
|
+
colorAccentTitle: '强调色',
|
|
109
|
+
colorAuto: '自动',
|
|
110
|
+
colorCustom: '自定义',
|
|
111
|
+
skillTitle: 'generative-mcpapps 技能',
|
|
112
|
+
skillInstalled: '已安装',
|
|
113
|
+
skillMissing: '未检测到',
|
|
114
|
+
skillPurpose: '这项安装是为了让模型自动选用 MCP Apps。阅读页在模型写出 mcp-app 代码块时已经会渲染,不依赖该技能是否装进宿主。',
|
|
115
|
+
skillPluginNote: '技能包只出现在本插件仓库里,并不等于当前 Agent 已经加载它。',
|
|
116
|
+
skillInstall: '把完整的 generative-mcpapps 文件夹(含 references 与 examples)复制到 .dsh/skills 或 .agents/skills(家目录或项目目录,由你选),然后重新检测。没有在所有宿主上都可用的一键安装。',
|
|
117
|
+
skillRecheck: '重新检测',
|
|
118
|
+
skillChecking: '正在检测…',
|
|
119
|
+
skillUnavailable: '无法查询宿主技能目录。请复制到 .dsh/skills 或 .agents/skills(家目录或项目),再重新检测。',
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export function settingsLanguage(tag: string | undefined): 'zh' | 'en' {
|
|
123
|
+
return (tag ?? '').toLowerCase().startsWith('zh') ? 'zh' : 'en';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function settingsCopyFor(tag: string | undefined): SettingsCopy {
|
|
127
|
+
return settingsLanguage(tag) === 'zh' ? zh : en;
|
|
128
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Community-plugin SlotMap merge for Settings pages.
|
|
3
|
+
* Official plugins import `@deepseek-ai/dsh-client-ui-settings/client` instead.
|
|
4
|
+
* Shape matches that package's `settings.section` (list / root / close).
|
|
5
|
+
*/
|
|
6
|
+
import type { SettingsCopyKey } from './settings-copy.js';
|
|
7
|
+
|
|
8
|
+
export interface SettingsSectionOwnerProps {
|
|
9
|
+
/** Close the settings panel (the shell owns the open state). */
|
|
10
|
+
close: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
14
|
+
interface SlotMap {
|
|
15
|
+
'settings.section': { kind: 'list'; scope: 'root'; owner: SettingsSectionOwnerProps };
|
|
16
|
+
/**
|
|
17
|
+
* 「起子插件设置」family tab ledger, declared by the dsh-session-guard
|
|
18
|
+
* family hub. Every drscrewdriver-family plugin registers one tab here
|
|
19
|
+
* (id + order for tab ordering, inject = card props) instead of owning a
|
|
20
|
+
* standalone settings.section.
|
|
21
|
+
*/
|
|
22
|
+
'dsh-family.tab': { kind: 'list'; scope: 'root'; owner: Record<string, unknown> };
|
|
23
|
+
}
|
|
24
|
+
interface LocaleNamespaceMap {
|
|
25
|
+
'tidy-display': SettingsCopyKey;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type {} from './settings-slots.js';
|
|
3
|
+
import { settingsCopyFor, zh, en } from './settings-copy.js';
|
|
4
|
+
import { SettingsSection, type BetterDisplaySettingsInjected, type OpenPrefs } from './SettingsSection.js';
|
|
5
|
+
import { firstSessionId, skillsFromListResult, type SkillStatusProbe } from './skill-status.js';
|
|
6
|
+
import type { HostSkillStatus } from '../skill-status.js';
|
|
7
|
+
|
|
8
|
+
interface LocaleFace {
|
|
9
|
+
register?: (ns: string, dicts: { zh: unknown; en: unknown }) => () => void;
|
|
10
|
+
bind?: (ns: string) => (key: string) => string;
|
|
11
|
+
getSnapshot?: () => { locale?: string; language?: string };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface RemoteSkillsFace {
|
|
15
|
+
list?: (arg: { sessionId: string }, signal?: AbortSignal) => Promise<unknown>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function languageTag(ctx: Context): string | undefined {
|
|
19
|
+
const locale = (ctx.get?.('locale') ?? (ctx as unknown as { locale?: LocaleFace }).locale) as LocaleFace | undefined;
|
|
20
|
+
const snap = locale?.getSnapshot?.();
|
|
21
|
+
return snap?.locale ?? snap?.language
|
|
22
|
+
?? (typeof document !== 'undefined' ? document.documentElement.lang : undefined)
|
|
23
|
+
?? (typeof navigator !== 'undefined' ? navigator.language : undefined);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function createSkillProbe(ctx: Context): SkillStatusProbe {
|
|
27
|
+
return {
|
|
28
|
+
fetchHostStatus: async () => {
|
|
29
|
+
const sessions = ctx.sessions as { list?: { getSnapshot?: () => { byId?: Record<string, { cwd?: string }> } } } | undefined;
|
|
30
|
+
const snap = sessions?.list?.getSnapshot?.();
|
|
31
|
+
const id = firstSessionId(snap);
|
|
32
|
+
const cwd = id && snap?.byId ? snap.byId[id]?.cwd : undefined;
|
|
33
|
+
const url = cwd
|
|
34
|
+
? `/tidy-display/skill-status?cwd=${encodeURIComponent(cwd)}`
|
|
35
|
+
: '/tidy-display/skill-status';
|
|
36
|
+
const res = await fetch(url);
|
|
37
|
+
if (!res.ok) return undefined;
|
|
38
|
+
return await res.json() as HostSkillStatus;
|
|
39
|
+
},
|
|
40
|
+
listRemoteSkills: async () => {
|
|
41
|
+
const remote = ctx.remote as unknown as { skills?: RemoteSkillsFace } | undefined;
|
|
42
|
+
const skills = remote?.skills
|
|
43
|
+
?? (ctx.get?.('remote.skills') as RemoteSkillsFace | undefined)
|
|
44
|
+
?? ((ctx.get?.('remote') as { skills?: RemoteSkillsFace } | undefined)?.skills);
|
|
45
|
+
const sessions = ctx.sessions as { list?: { getSnapshot?: () => { ids?: string[]; byId?: Record<string, unknown> } } } | undefined;
|
|
46
|
+
const sessionId = firstSessionId(sessions?.list?.getSnapshot?.());
|
|
47
|
+
if (!skills?.list || !sessionId) return undefined;
|
|
48
|
+
return skillsFromListResult(await skills.list({ sessionId }));
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function installBetterDisplaySettings(ctx: Context, prefs: OpenPrefs): void {
|
|
54
|
+
const locale = (ctx.get?.('locale') ?? (ctx as unknown as { locale?: LocaleFace }).locale) as LocaleFace | undefined;
|
|
55
|
+
if (locale?.register) {
|
|
56
|
+
ctx.effect(() => locale.register!('tidy-display', { zh, en }), 'dsh-tidy-display: settings copy');
|
|
57
|
+
}
|
|
58
|
+
const checkSkill = createSkillProbe(ctx);
|
|
59
|
+
const injected = (): BetterDisplaySettingsInjected => ({
|
|
60
|
+
prefs,
|
|
61
|
+
copy: settingsCopyFor(languageTag(ctx)),
|
|
62
|
+
languageTag: languageTag(ctx),
|
|
63
|
+
checkSkill,
|
|
64
|
+
});
|
|
65
|
+
ctx.slots.inject('dsh-family.tab', () => ctx.slots.register({
|
|
66
|
+
name: 'dsh-family.tab',
|
|
67
|
+
id: 'tidy-display',
|
|
68
|
+
order: 60,
|
|
69
|
+
label: () => locale?.bind?.('tidy-display')?.('nav') || settingsCopyFor(languageTag(ctx)).nav,
|
|
70
|
+
locale: locale?.bind ? 'tidy-display' : undefined,
|
|
71
|
+
inject: injected,
|
|
72
|
+
}, SettingsSection));
|
|
73
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONVENTIONAL_SKILL_ROOTS,
|
|
3
|
+
GENERATIVE_MCPAPPS_SKILL,
|
|
4
|
+
SKILL_PACK_RELATIVE,
|
|
5
|
+
publicSkillRoots,
|
|
6
|
+
skillListIncludes,
|
|
7
|
+
skillsFromListResult,
|
|
8
|
+
toPublicSkillStatus,
|
|
9
|
+
type HostSkillStatus,
|
|
10
|
+
} from '../skill-status.js';
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
CONVENTIONAL_SKILL_ROOTS,
|
|
14
|
+
GENERATIVE_MCPAPPS_SKILL,
|
|
15
|
+
SKILL_PACK_RELATIVE,
|
|
16
|
+
publicSkillRoots,
|
|
17
|
+
skillListIncludes,
|
|
18
|
+
skillsFromListResult,
|
|
19
|
+
toPublicSkillStatus,
|
|
20
|
+
};
|
|
21
|
+
export type { HostSkillStatus };
|
|
22
|
+
|
|
23
|
+
export interface SkillStatusSnapshot {
|
|
24
|
+
readonly name: typeof GENERATIVE_MCPAPPS_SKILL;
|
|
25
|
+
readonly installed: boolean;
|
|
26
|
+
readonly via: 'skills.list' | 'skill-root' | null;
|
|
27
|
+
readonly roots: HostSkillStatus['roots'];
|
|
28
|
+
readonly packPath?: string;
|
|
29
|
+
readonly hostReached: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface SkillStatusProbe {
|
|
33
|
+
listRemoteSkills?: () => Promise<readonly { readonly name?: string }[] | undefined>;
|
|
34
|
+
fetchHostStatus?: () => Promise<HostSkillStatus | undefined>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function detectGenerativeMcpappsSkill(probe: SkillStatusProbe): Promise<SkillStatusSnapshot> {
|
|
38
|
+
let host: HostSkillStatus | undefined;
|
|
39
|
+
if (probe.fetchHostStatus) {
|
|
40
|
+
try {
|
|
41
|
+
host = await probe.fetchHostStatus();
|
|
42
|
+
} catch {
|
|
43
|
+
host = undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let remoteHit = false;
|
|
48
|
+
if (probe.listRemoteSkills) {
|
|
49
|
+
try {
|
|
50
|
+
remoteHit = skillListIncludes(await probe.listRemoteSkills());
|
|
51
|
+
} catch {
|
|
52
|
+
remoteHit = false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const installed = Boolean(host?.installed || remoteHit);
|
|
57
|
+
const via = remoteHit ? 'skills.list' : (host?.via ?? null);
|
|
58
|
+
const publicHost = host === undefined ? undefined : toPublicSkillStatus(host);
|
|
59
|
+
return {
|
|
60
|
+
name: GENERATIVE_MCPAPPS_SKILL,
|
|
61
|
+
installed,
|
|
62
|
+
via,
|
|
63
|
+
roots: publicHost?.roots ?? publicSkillRoots(),
|
|
64
|
+
hostReached: host !== undefined,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** mkdir/cp using conventional relative roots only. Host paths are ignored. */
|
|
69
|
+
export function shortestInstallCommand(_status?: Pick<SkillStatusSnapshot, 'packPath' | 'roots'>): string {
|
|
70
|
+
const dest = CONVENTIONAL_SKILL_ROOTS[0];
|
|
71
|
+
return `mkdir -p ${dest} && cp -R ${SKILL_PACK_RELATIVE} ${dest}/`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function firstSessionId(list: { ids?: readonly string[]; byId?: Record<string, unknown> } | undefined): string | undefined {
|
|
75
|
+
if (list?.ids && list.ids.length > 0) return list.ids[0];
|
|
76
|
+
const keys = list?.byId ? Object.keys(list.byId) : [];
|
|
77
|
+
return keys[0];
|
|
78
|
+
}
|