Commit Graph

9 Commits

Author SHA1 Message Date
Dash
e405db1be9 docs(dev-rules): 协议兼容拆成必读规则页与每项能力一份记录
protocol-compatibility.md 已长到 555 KB、194 节:文档抬头落在第 1290 行,
§1 的规则被挤到无关小节下面,Review 清单在第 3967 行。每个协议改动都要求
先读它,但没有 Agent 能读完;新记录又都往同一处插,近 30 天 453 次提交改这
一个文件,彼此反复冲突。

- 原页只留对所有跨端改动都成立的规则(事实来源、§1–§3、自建中转同步维护、
  Review 清单),10 KB;新增一节说明检索与新增记录的做法。
- 205 项能力记录各占 protocol-compatibility/ 下一个文件,正文逐行保留,只
  提升标题层级并修正相对链接;11 个挂在无关章节下的小节独立成篇。
- 7 处「上一节/见下文」改为指向具体文件;其他文档里 29 处按章节名或锚点
  的引用改指新文件。
- dev-docs 契约新增一条:规则页不超过 16 KB、记录一文件一标题,防止再次堆回。

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
2026-11-11 00:33:32 +13:00
Lizi
fd3b9dd354 fix(provider-sharing): 受邀者的 WebFetch 改在受邀者电脑上抓取
上一版为防止受邀者经分享者的网络访问分享者内网,对受邀者关掉了 Claude Code
自带的 WebFetch。这一版由受邀者电脑上的执行器(cindy_exec)提供同名的
WebFetch,用受邀者自己的网络抓取,受邀者的 Claude Code 任务重新有网页抓取。

- 受邀者电脑:任务的 Agent 位置是 share: 且是 Claude Code 时,执行器多提供
  WebFetch;同账号远程任务、Codex 与 Pi 不变(工具清单仍是原来 7 个)。
- 抓取走 guardedOutboundFetch:系统代理、单跳、按 DNS 结果挡内网;本机、内网与
  云 metadata 地址与本机任务同一判定(reviewAction),须受邀者在确认卡上批准,
  批准用一次即失效;批准过的地址抓取时放开内网(公司内网域名也会解析到内网)。
  跳到其他网站时交回 Agent 重新调用。
- HTML 转成保留标题、链接、列表和代码块的纯文本,长页面按 start_index 分段;
  只返回文本类内容。
- 分享者一侧把 mcp__cindy_exec__WebFetch 按自带 WebFetch 判定权限;给模型的说明
  里不提它(受邀者电脑上的 Cindy 较旧时没有)。
- 分享 Claude 订阅登录时,审批弹窗告知分享者「受邀者使用时 Agent 能看到你登录
  Claude 用的邮箱」。
- 同步产品规则、实现计划与协议兼容说明:tools/list 只追加项,新旧版本任意组合
  都不报错,不改 wire。

Signed-off-by: Lizi <jiali@magiclizi.com>
2026-10-10 18:40:30 +08:00
Lizi
f24156e527 fix(provider-sharing): 受邀者会话的 Agent 自带工具改为白名单
受邀者(供应商分享的另一个账号)的 Agent 在分享者电脑上以分享者的系统用户运行。
此前只按黑名单关掉文件与命令工具,其余自带工具(给本机其他会话发消息、用分享者的
claude.ai 账号发布或读取、在本机读文件、WebFetch 走分享者网络等)仍可用,Agent
升级新增的工具也会自动开放给受邀者。

- Claude Code:经 SDK `tools` 只开放白名单内的自带工具;子代理不能带隔离选项;
  关闭 claude.ai 连接器、Remote Control 与技能内联 shell。
- Codex:启动时取 app-server 的完整功能清单,白名单之外的功能在线程配置里逐个
  关闭;清单取不到就不启动受邀者会话。
- Pi:只放行 Cindy 扩展注册的工具,Pi 自带的 powershell、codemode 等一律拦下且
  不交给模型。
- 补单测与三种 Agent 的真机测试(受邀者会话发给模型的工具不超出白名单)。
- 产品规则 §9 第 5 条改为「Agent 自带工具按白名单开放」,取代 2026-10-07「联网
  工具不单独处理」:WebFetch 对受邀者关闭,WebSearch 保留。

同账号远程供应商不受影响。

Signed-off-by: Lizi <jiali@magiclizi.com>
2026-10-10 17:08:22 +08:00
MagicLizi
e9ffa7485a fix(provider-share): open the background link before reading a share
Invitees saw "couldn't read the models (DEVICE_LINK_DEVICE_OFFLINE)" on
an active share whose owner was online. The relay enrolls an invitee's
computer into the share only on link-open; the settings detail and the
model picker read the owner's catalog with a bare invoke, so a computer
that had never opened the link (a fresh install, or a dev build with
its own device id) was refused with "providerShare peer unavailable".

Renderer share reads now take the same path as the remote Agent and the
phone's proxied read: open the background link to the owner's computer
if it isn't ready, then invoke.

Signed-off-by: MagicLizi <jiali@magiclizi.com>
2026-10-08 22:53:32 +08:00
MagicLizi
a5a7ba35b6 feat(mobile): pick remote and shared providers when creating a task
The new-task model sheet on the phone now lists the providers that the
user's other computers open for remote use and the providers shared
with the controlled computer, in the same sections as the in-task
model sheet. Picking one creates the task with agentDeviceId (the same
create-session parameter Desktop uses), so the Agent runs there while
the task and files stay on the controlled computer.

- The pick is kept apart from the draft: the draft's model and source
  keep following the controlled computer's catalog, and the pick is
  folded in at creation (ordinary and goal) for that computer and Agent
  only. Saved drafts restored for editing split it back out.
- The controlled computer's catalog guard and sign-in gate don't apply
  to a remote pick; the computer that runs the Agent checks it on the
  first message.
- Offered only when the controlled computer's provider list carries the
  remoteInvocationEnabled flag (added with remote Agent support), not
  for shared-task guests, and not together with a collaboration draft
  (its first Worker model comes from the controlled computer).
- The model pill shows the remote catalog's model name with the remote
  badge; the accessible name includes the computer name. The optimistic
  session row carries agentDeviceId.

JS only; no native fingerprint inputs change.

Signed-off-by: MagicLizi <jiali@magiclizi.com>
2026-10-08 22:01:07 +08:00
MagicLizi
90b66756b9 fix(settings): keep the computer name of remote providers in the tip
Remote provider rows now use the same single-line layout as local providers (name, model count, status dot) with the remote badge; the computer name appears only in the hover tip and the accessible name.

Signed-off-by: MagicLizi <jiali@magiclizi.com>
2026-10-08 21:05:44 +08:00
MagicLizi
efee0eb680 feat(provider-share): own remote providers in settings; share link entry top right
Settings → Providers, following hands-on feedback:

- "Enter Share Link…" moves to the top right of the page and opens the
  link dialog; the paste row and empty-state note at the end of the
  shared group are gone.
- "Providers shared with me" stays its own group and is hidden when
  nothing is shared.
- Providers usable on my other computers (online, remote control on,
  "allow remote use" on, connected) are listed after my own providers
  with the remote badge and the computer name; selecting one shows a
  read-only detail with the models it offers. The share detail and this
  detail share one read-only model list.
- Model picker: when the sharer's Cindy is too old to answer the agent
  capability read, say so ("ask them to update Cindy") instead of a
  generic load failure, which left invitees with no models and no reason.

useControllableDevices now tolerates a window without the device-link
bridge instead of throwing.

The join page's fallback hint (server) still names the old "Paste Share
Link" entry and needs the new name.

Signed-off-by: MagicLizi <jiali@magiclizi.com>
2026-10-08 20:50:38 +08:00
Lizi
2734d64d3e fix(provider-share): let invitees pick shared models; list shares with providers
Invitees could see a shared provider but not select it: their model
picker and send gate also read the owner's agent capabilities, available
agents and agent readiness, and the owner's computer refused everything
but the provider list.

- Owner: provider-share guests may now read maker:get-capabilities,
  maker:list-available-agents and maker:agent:status. Each answer is
  narrowed to the shared provider: capabilities keep only its models,
  available agents only the agents it serves, readiness only
  binaryReady/authReady (no local path or login identity).
- Invitee: the renderer's share:<id> reads pass these channels through.
- Settings: "Providers shared with me" moves from the bottom of the page
  into the provider list as its own group; selecting one shows its
  source, status, the models it offers (read-only) and Leave. "Paste
  share link" sits at the end of the group. The manage-sharing entry
  uses a share icon.

Signed-off-by: Lizi <jiali@magiclizi.com>
2026-10-08 18:47:57 +08:00
Lizi
2656f84618 feat(provider-share): share remote providers with other Cindy users
A user can share any provider that already allows remote use with
users of other Cindy accounts. The Agent keeps running on the sharer's
computer with the sharer's login; the invitee's files and commands stay
on the invitee's computer. Product rules: docs/product-rules/
provider-sharing.md; cross-repo contract: docs/provider-sharing-
contract.md (server side lands in cindy-server).

Sharer (Desktop main):
- one-time 5-minute links, approval with a 4-digit pairing code,
  pause/resume/remove, notifications without the pairing code;
- invitees (provider-share peers) may only use maker:remote-agent:v1
  and a provider list filtered to the shared provider; subscriptions
  and every other channel are refused, late results after revocation
  are rewritten to ACCESS_REVOKED;
- guest isolation for Claude Code, Codex and Pi: open payloads are
  allowlisted (no hooks/env/apiKeyHelper, neutralized out-of-tree @
  imports and ! commands), no host personal config, managed skills,
  roster or contacts rules, guest-only resume, Codex in a separate
  CODEX_HOME with read-only token access, Pi without host context;
- per-invitee, per-model usage in userData/remote-agent (no schema
  change); pausing ends tasks at once, removal also deletes the
  invitee's shadow workspace, attachments and Agent transcripts.

Invitee (Desktop):
- apply dialog from deep links or a pasted link, waiting state with
  the pairing code, withdraw, leave;
- shared providers appear in the model list as
  "{provider} · {device} · 来自 {owner} 的分享"; tasks bind with
  agent_device_id = share:<shareId>;
- cross-region shares (server switch, default off) use identity cards
  and an in-memory share credential on a second relay connection.

Mobile: reads the controlled computer's received shares for the model
list, localizes the new errors, and only says "open on a computer" for
share links (JS only, runtime fingerprint unchanged).

Protocol: Envelope.providerShare scope with capability
provider-share-v1 (append-only; old relays and clients keep same-account
routing), new same-account channel
maker:provider-share:received-catalogs.

Signed-off-by: Lizi <jiali@magiclizi.com>
2026-10-08 14:31:04 +08:00