Commit Graph

17 Commits

Author SHA1 Message Date
liugaowei
374bfeca5d merge: 同步插件公共入口与主干宿主装配
合入 209212431e,保留凭证复用和现有风险守卫;Node 平台 provider 与插件共用,Skill 迁移到记录制版本 113。

Signed-off-by: liugaowei <liugaowei@xd.com>
2026-11-12 10:29:34 +08:00
Dash
6e11d2dc35 feat(host): separate background lifecycle and desktop platform execution
Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-12 02:14:03 +13:00
liugaowei
a7f5289e84 feat(host): 接入插件公共宿主工具与客户端确认
Node Host 复用同一 helper registry、终端服务和调用授权,首次能力批准保存在既有 receipt。确认按客户端协商并绑定真实控制窗口,取消与断线不进入任务事件回放。

Signed-off-by: liugaowei <liugaowei@xd.com>
2026-11-11 18:23:29 +08:00
Dash
03e31764e7 fix(browser): 升级 playwright-core 到 1.63,navigate 不再永远不返回
页面里跨站 iframe 中的 worker(如 reCAPTCHA)随 iframe 销毁后,playwright-core
1.60–1.62 仍把它的会话留在网络管理器里。导航守卫每次 page.route / page.unroute
都会给这个已不存在的会话发命令,浏览器回的错误不带会话编号,Playwright 对不上
挂起的命令,等待永不结束,20 秒导航超时也不起作用。真实网站上在 Tailscale 文档、
react.dev 点过一次站内链接后必现,实测同一道题 3 次全部卡到被杀。

1.63.0 起修复,三处 package.json 同步升级。没有给 route / unroute 加超时绕过:
卸载等待被放弃后 Playwright 分发层仍认为拦截在位,下一次 route 不再真正装上,
导航守卫会隔一次失效一次(已实测)。

验证:
- scripts/eval-browser-tasks.mjs --check 新增本机夹具(跨站 iframe 内启动 worker
  后连续导航):1.63 通过,换回 1.60 在同一检查上失败。
- @cindy/browser-control-runtime tsc 与 202 个单测、desktop browser-backend 312 个
  单测、desktop 与 host typecheck 通过。
- Tailscale 文档与 react.dev 上「点站内链接后 navigate」连续多轮均在 2 秒内返回。

风险:依赖小版本升级;pnpm 重新解析时顺带移除了锁文件里无人引用的 mkdirp@1.0.4。

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-11 15:27:59 +13:00
Dash
d72e2a1daa test(host): preserve scheduler coverage across shared service extraction
Point existing wiring guards at the shared snapshot service and desktop
assembly. Verify accepted callback commit, cancellation rollback and discard
through observable behavior. Add a repeatable isolated scheduler command
and record the actual scope and limits of desktop and plugin verification.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 12:58:23 +13:00
Dash
2c230ea21f WIP: share headless runtime services with desktop adapters
Preserve the implemented task, Device Link, plugin and model runtime work locally before integrating main. Full multi-client, automation and platform acceptance remains incomplete.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-10 11:11:41 +13:00
Dash
cc99b6b059 fix(host): harden browser pairing, credentials and task execution for the experimental web client
Address the open review findings on the Host web client without changing how
the desktop starts: the desktop no longer auto-discovers and joins a running
Host (only an explicit CINDY_HOST_API does).

- pairing: one-time pairing exchanges for a session cookie; the home page no
  longer issues credentials or embeds the API token; Host/Origin checks,
  session expiry closes event streams, logout clears cookies.
- credentials/accounts: provider keys are scoped by account/provider/engine and
  never fall back to the gateway key; model catalog cache is isolated per
  account; logout reuses the desktop saved-account tombstone policy; macOS and
  Windows credentials go through a private Electron safeStorage helper.
- execution: input queue claims its slot before async preparation, keeps input on
  failure, stops cleanly while preserving streamed output, pauses on save
  failure, and deleting a task stops and clears it; SDK session context is
  restored after refresh and Host restart.
- web shim: unsupported actions fail instead of reporting success.
- desktop explicit Host mode: auth, interaction and input-queue events reach the
  existing channels; shared storage cores (project aliases, recent workdirs,
  ghost snapshot worker) are used by both desktop and Host.
- CI: Host regression matrix on macOS, Windows and Linux; fix the task tag
  migration test to use the new migration config.

Out of scope here: a windowless Electron helper and custom MCP storage
extraction. Simulated OS tests do not replace real keychain/DPAPI or
three-platform validation; see docs/host/pr-9246-completion.md.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-08 00:31:13 +13:00
CHEYAN
3b06a1aeb9 feat(host): connect cindy-host to Device Link relay
Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-07 09:41:17 +09:00
CHEYAN
f1ebfab643 fix(host): resolve custom providers and windowed chat history
- Load custom providers from SQLite custom_providers table in cindy-host
- Support Pi agent capabilities and models from custom providers (e.g. DEEPSEEK on magpie-debian)
- Implement windowed chat history with createHistoryViewReader, supporting backward pagination and workDetails
- Fix chat history truncation and epoch duration calculation in web client
- Add localDb.messages.workDetails in web preload shim

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-07 00:14:33 +09:00
CHEYAN
dcd45fc0d0 feat(host): persist task messages and project real history pages
Consume the agent's text events while a queued turn runs and store the user and
assistant rows in the shared messages table (partial text survives Stop), encode
content exactly as the desktop does, and answer historyView through the shared
projector so a reload restores the conversation.

Verified in the browser: a new task streams a real reply, and reloading the page
(or opening it in a fresh tab) shows both the user message and the answer.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 11:28:29 +09:00
CHEYAN
b258d92145 feat(host): run a real Claude agent and stream chat over SSE
Make the database entry Electron-free (host UI, copy and slimming are injected),
add a Node loader for maker-core's `?raw` prompt assets, build the real
Maker/ClaudeCodeAgent graph over the shared storage, and expose POST /chat that
forwards Session events as SSE.

Verified: host /health reports the claude-code agent; authenticated /chat
streams the real runtime refusal (claude-code not authenticated: not_connected)
while an unauthenticated call is 401. Desktop typecheck passes.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-04 22:00:42 +09:00
CHEYAN
0a6b1fe471 feat(host): add cindy-host login on the existing browser flow
Reuse the Desktop authorize URL builder, PKCE, hosted-callback polling helper
and session record format; only the platform facts differ (global fetch,
system browser launcher, host loopback server). Success persists the same
safeStorage record the Desktop reads, so a restart needs no re-login.

Verified: providers call reaches the real auth service and a desktop-shaped
authorize URL is produced. The post-consent code exchange still needs a real
browser session.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-04 19:16:30 +09:00
CHEYAN
d36116297e feat(host): adopt the existing Desktop login from Node
Move the safeStorage record names into an Electron-free module both processes
import, then project the stored session with the shared auth-client schema. The
host now reports the same account as the Desktop without a new login and without
opening the profile database.

Verified against the real profile: /health reports authenticated=true,
realm=global; only the non-secret projection leaves the module.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-04 19:04:20 +09:00
CHEYAN
818b8de9be feat(host): read the existing safeStorage credentials from Node
Implement Chromium OSCrypt v11 for the Desktop credential files so the host
shares one credential truth instead of a second store. Parameters were measured
against real Desktop ciphertext: keyring application Cindy, PBKDF2-SHA1
saltysalt with one round, AES-128-CBC, 16-space IV, base64 v11 payload.

Verified both directions: host decrypts a Desktop-written record, and Electron
safeStorage decrypts a record written by this module. Missing Secret Service
raises CREDENTIAL_STORE_UNAVAILABLE; writes are 0600 and atomically replaced.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-04 18:58:55 +09:00
CHEYAN
1b5259e594 feat(host): hold a single runtime lease per profile
A host must not become a second runtime for the same owner. Take the shared
SQLite exclusive lock before opening storage and report a blocked state when
another process owns it; crash release comes from the OS, not a heartbeat.

Verified: a probe process holding the lease makes a second host report
runtime.state=blocked with storage unopened.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-04 17:23:08 +09:00
CHEYAN
9860b1ed3a feat(host): open the real Desktop owner database from Node
Extract host facts (logger paths, drizzle dir, sqlite-vec path) out of the
Electron imports so cindy-host can reuse the production storage stack instead
of growing a second one. Storage startup now shares the schema lease, the
migration runner, CJK trigger installation and vector loading, and both hosts
wrap the same handle-bound DbClient and OwnerSessionStorage mapping.

Verified on a temporary profile: 145 migrations applied, 87 tables, one task
created through the shared adapter and still listed after a host restart.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-04 17:19:30 +09:00
CHEYAN
2f70be06ec feat(host): add loopback service shell and architecture map
Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-04 16:13:50 +09:00