WIP: scaffold consumer products (desktop / pwa / cloud) on consumer-p… - #1
Open
HenryZ838978 wants to merge 9 commits into
Open
WIP: scaffold consumer products (desktop / pwa / cloud) on consumer-p…#1HenryZ838978 wants to merge 9 commits into
HenryZ838978 wants to merge 9 commits into
Conversation
…roducts branch
Adds three consumer-facing wrappers around the existing deepseek-harness
protocol layer, all driven by a new dsh-server runtime:
packages/server - Node HTTP+SSE server. Wraps @anthropic-ai/claude-code,
routes to DeepSeek V4 via ANTHROPIC_BASE_URL. Pure Node
stdlib (no Express). Multi-tenant: bearer JWT mode for
cloud, none mode for desktop. File-backed store under
DSH_DATA_DIR. Verified end-to-end: real /v1/run streamed
"好" from deepseek-v4-flash in 2.4s, cost $0.123.
packages/server/src/buddy.js
Buddy Layer system prompt + wrapBuddyPrompt + postProcess.
Banned-jargon Chinese system prompt + device snapshot
+ recent-files injection. Verified live: DS V4 Flash
given a buddy context produces "小李下午好!... 您最近
动过的文件有这几个: 《年度报告2026.docx》..." — no path,
no jargon, uses 书名号, suggests next actions.
packages/desktop - SwiftUI menubar .app for non-technical Mac users. SPM
project, builds CLT-only (no full Xcode required tonight).
swift build passes. swift run launches menubar app,
embedded server fallback works, .app bundle ad-hoc signed.
Buddy layer wired: BootScan.swift (CPU/RAM/disk/Chrome
tabs/battery), FileIndex.swift (scans WeChat/Feishu/WPS/
DingTalk container dirs + Documents/Desktop/Downloads),
Permissions.swift (TCC checks for AppleScript + Full Disk
Access). ChatViewModel sends mode:"buddy" + full context
on every /v1/run. Proactive greeting on launch.
packages/mobile-pwa - Zero-build PWA (~17 KB gzipped). Vanilla HTML + ES
modules. Manifest + SW for add-to-homescreen. SSE parser
over fetch+ReadableStream. Chinese-first UI. Login screen
with mock OTP 123456 fallback works without backend.
deploy/mdou - Multi-stage Dockerfile (node:22-alpine, ~250 MB final).
NPM_REGISTRY defaults to npmmirror for Aliyun cloud speed.
Bakes claude + git + ripgrep + python3 in. README walks
through one-time mdou app creation + "部署 <APP_ID>"
deploy flow via Cursor's mdou-deploy skill.
docs/consumer/API.md
v1 API contract (SSE event types, auth modes, storage
layout, error codes). All clients code against this spec.
Tonight's blockers (resolved tomorrow with user):
- swift bundle needs full Xcode + Apple Developer signing → .dmg pipeline
- PWA needs real icon-192/512.png generation
- mdou cloud deploy needs APP_ID created in mdou web UI
- iOS/Android native left as PWA-only for v1 (covers both via add-to-home)
Wire bundle-node.sh up to the real packages/server (with the
@anthropic-ai/claude-code single-binary CLI) so the production .app is
fully self-contained on a clean Mac:
Resources/runtime/
node (portable Node 20.18.0 darwin-arm64)
serverEntry.js (CJS shim: prepends server/.bin to PATH, then
dynamic-imports the ESM bin/dsh-server.js)
server/ (rsync of packages/server, sans tests/.npm)
make-app.sh now ad-hoc signs with Hardened Runtime + a minimal
Entitlements.plist (allow-jit, disable-library-validation,
allow-dyld-environment-variables) so the bundled unsigned node binary
can run as a child process without an Apple Developer cert. The bundled
node Mach-O is signed first so codesign --deep doesn't choke on it.
dist/README.md documents the hdiutil-based dmg → install → first-launch
(right-click → 打开) flow plus the optional Developer-ID upgrade path.
Adjusts .gitignore so the generic Python dist/ rule is anchored to the
repo root only (otherwise it swallowed packages/desktop/dist/), then
ignores Resources/runtime/ and packages/desktop/dist/* with a carve-out
for the README.
Verified end-to-end on MacBook-Pro.local: /Applications/DeepSeekHarness.app
launches the bundled embedded server, /health returns ok, and a buddy
/v1/run returns a streaming SSE reply ('好' for '用一个字回答:你好').
… image
Pre-bake the agent's typical Linux toolchain in the runtime stage so the
cloudagent loop can write + run code on first request without suffering
an apk / pip install storm:
apk: git curl wget ripgrep jq fd bash less openssh-client
make build-base linux-headers (for source-built wheels)
pip: uv (fast resolver),
requests httpx,
anthropic openai,
pydantic pyyaml rich tqdm ipython
Homebrew is intentionally skipped — it does not run on Alpine/musl. The
README explains the substitution: "agent's typical CLI toolchain
pre-baked" is the spirit of the original brief, satisfied by the apk +
uv + pip layers above. If a future task genuinely needs glibc Homebrew
we should switch the base image, not bolt brew onto Alpine.
Other operator-facing tweaks in deploy/mdou/README.md:
- target app renamed to dsh-cloudagent
- operator env table updated for DSH_BEARER_TOKEN + DEEPSEEK_API_KEY
(the API key now goes both as DEEPSEEK_API_KEY and as the legacy
ANTHROPIC_AUTH_TOKEN that claude-code reads)
The image is intentionally NOT built locally — mdou's deploy flow is
cloud-build (Rainbond); the image size will be reported back on first
build-and-deploy. Static review only at this stage.
…s unchanged)
The Chinese persona/product name is awkward — 'qiú' (求) carries the wrong
connotation in Chinese — so the user-facing brand becomes:
Chinese persona/product: 鲸伴 (was 深求)
English brand: WhaleBuddy
Only the persona string changes. Strictly preserved:
- Library / npm package name: deepseek-harness (kebab-case, technical)
- Model name: DeepSeek V4 / V4-Pro / V4-Flash
- Lab name in self-intro: 深度求索 (我是…由深度求索的 V4-Pro 模型驱动)
Affected surfaces (zero 深求 left after this commit):
- packages/server/src/buddy.js system prompt + self-intro
- packages/server/src/store.js ~/Documents/鲸伴小助手/ workspace path
- packages/desktop/Info.plist.template CFBundleDisplayName 鲸伴
- packages/desktop/Sources/**/*.swift menubar tooltip, popover, FirstRunFlow,
ChatView greeting + sender labels,
SettingsView title, Preferences workspace
- packages/desktop/{README,Package,Scripts/make-app}.*
- packages/mobile-pwa/{README,public/{index.html,manifest.json,sw.js},src/{ui-chat.js,styles.css}}
- deploy/mdou/README.md cn-name in 新建应用 walkthrough
Desktop .dmg v0.1.0 already installed and validated stays as-is — this rebrand
will land in the next desktop build (v0.2.0). The mdou cloud deploy following
this commit picks up the new persona from source.
…ploy time mdou-deploy uploads the build context tar from the repo root, so the Dockerfile must be discoverable at the top level. We symlink deploy/mdou/Dockerfile -> /Dockerfile (and the .dockerignore counterpart) right before each deploy; the symlinks should not appear in commits.
mdou's cloud builder runs inside Aliyun and the first build attempt (record id 339) failed at stage 2 of FROM with: #3 ERROR: failed to do request: Head registry-1.docker.io/v2/library/... dial tcp 54.89.135.129:443: connect: connection refused i.e. the builder cannot reach docker.io / pypi.org / dl-cdn.alpinelinux.org directly. Wire mirrors in via build-args so the build works in mdou's network and can still be overridden when running locally / outside Aliyun: DOCKER_MIRROR=docker.m.daocloud.io/library (Docker Hub mirror) APK_MIRROR=https://mirrors.aliyun.com/alpine (Alpine pkg mirror) PYPI_INDEX=https://mirrors.aliyun.com/pypi/simple/ (pip index) NPM_REGISTRY=https://registry.npmmirror.com (already configured) Both FROM lines pull from the global ARG DOCKER_MIRROR; the apk repo file is rewritten in-place; pip is set globally via 'pip config set global.index-url'. README updated with the mirror table.
…clash Build #2 on mdou (record id 340) made it past the FROM mirrors and through apk + pip install (all 14+ python deps landed cleanly), then exited 1 at: 333.5 addgroup: gid '1000' in use node:22-alpine ships a 'node' user at uid=1000 gid=1000, so our 'addgroup -g 1000 dsh' clashes. Bump to 1500 / 1500.
- Rebuild installs CFBundleDisplayName 鲸伴; sync bundled server buddy prompt - Collapsible Thinking / Todos / Tools panels (auto-expand/collapse like LarksorTC) - Agent console strip in workbench mode; open via menu or 打开工作台 - agent.js emits todo SSE for todoWriteToolCall; richer tool labels
- SessionDatabase (SQLite3): conversations + messages, draft per tab - NavigationSplitView sidebar (Seedance-style) with +/delete/context menu - Workbench window freely resizable; sidebar width in Settings - Sync session list from GET /v1/sessions; persist UI state locally
HenryZ838978
added a commit
that referenced
this pull request
Aug 18, 2026
… #2802 reversal / doctor v0) - Discussions crawl (112 pages, 2773 entries) + zero-reply/suspect breakdown - First-round leads: 6 probes across issues #1–#6 with pass/fail matrix - Second round on numbered upstream entries (#2802/#2798/#2573/#2755/#2725/#2674) - Third round: end-to-end live-stream against DS reverses #2802 (static hole, not user-triggerable under current upstream frame protocol). Draft #2802 upstream note kept in docs/upstream/ for provenance, marked stale. - Notes methodology: hand-crafted delta probes != end-to-end; N-shot sampling mandatory for wire-side probes. - Adds npm (frozen) screenshots as evidence the 2026-05-11 0.2.0 npm publish predates the official Node harness (2026-08-13).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…roducts branch
Adds three consumer-facing wrappers around the existing deepseek-harness protocol layer, all driven by a new dsh-server runtime:
packages/server - Node HTTP+SSE server. Wraps @anthropic-ai/claude-code,
routes to DeepSeek V4 via ANTHROPIC_BASE_URL. Pure Node
stdlib (no Express). Multi-tenant: bearer JWT mode for
cloud, none mode for desktop. File-backed store under
DSH_DATA_DIR. Verified end-to-end: real /v1/run streamed
"好" from deepseek-v4-flash in 2.4s, cost $0.123.
packages/server/src/buddy.js
Buddy Layer system prompt + wrapBuddyPrompt + postProcess.
Banned-jargon Chinese system prompt + device snapshot
+ recent-files injection. Verified live: DS V4 Flash
given a buddy context produces "小李下午好!... 您最近
动过的文件有这几个: 《年度报告2026.docx》..." — no path,
no jargon, uses 书名号, suggests next actions.
packages/desktop - SwiftUI menubar .app for non-technical Mac users. SPM
project, builds CLT-only (no full Xcode required tonight).
swift build passes. swift run launches menubar app,
embedded server fallback works, .app bundle ad-hoc signed.
Buddy layer wired: BootScan.swift (CPU/RAM/disk/Chrome
tabs/battery), FileIndex.swift (scans WeChat/Feishu/WPS/
DingTalk container dirs + Documents/Desktop/Downloads),
Permissions.swift (TCC checks for AppleScript + Full Disk
Access). ChatViewModel sends mode:"buddy" + full context
on every /v1/run. Proactive greeting on launch.
packages/mobile-pwa - Zero-build PWA (~17 KB gzipped). Vanilla HTML + ES
modules. Manifest + SW for add-to-homescreen. SSE parser
over fetch+ReadableStream. Chinese-first UI. Login screen
with mock OTP 123456 fallback works without backend.
deploy/mdou - Multi-stage Dockerfile (node:22-alpine, ~250 MB final).
NPM_REGISTRY defaults to npmmirror for Aliyun cloud speed.
Bakes claude + git + ripgrep + python3 in. README walks
through one-time mdou app creation + "部署 <APP_ID>"
deploy flow via Cursor's mdou-deploy skill.
docs/consumer/API.md
v1 API contract (SSE event types, auth modes, storage
layout, error codes). All clients code against this spec.
Tonight's blockers (resolved tomorrow with user):