@anycon/sdk 0.3.1 → 0.4.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/README.md CHANGED
@@ -156,6 +156,83 @@ if (acceptsAttachment(agent, doc.mime)) {
156
156
 
157
157
  A node without `file_attachments` (older daemons) turns away anything but what the agent takes natively with `RpcError` (`unsupported`). More than 8 concurrent uploads from this device → `RpcError` (`busy`, no `reason`). `uploadImage` with a non-image `mime`, or with no `mime` and an unrecognized file header → `AnyconError('unsupported_image')`; `uploadFile` with a malformed `mime` → `AnyconError('invalid_mime')`. In both cases nothing is sent.
158
158
 
159
+ ## To-do list (ADR-54)
160
+
161
+ Each node keeps a personal to-do list (see [docs/spec/daemon.md § 21](../../docs/spec/daemon.md#21-清单)). `node.todos` is a thin wrapper over `todo.*`; a node reports support in `(await node.info()).capabilities.todo`, and an older node answers with `RpcError('unsupported')`. The SDK keeps no offline cache and replays nothing: when the node is offline these calls fail like any other request.
162
+
163
+ ```ts
164
+ const todo = await node.todos.add({ title: 'Review the release notes', project: 'app' }) // an id (a lowercase hyphenated UUID) is generated for you; an id you pass yourself must have that form too
165
+ const { todos, has_more } = await node.todos.list() // open items, newest change first; { include_closed?, project?, limit?, before? }
166
+ await node.todos.update({ id: todo.id, state: 'done' }) // only the fields you pass change; `clear: ['project', 'due_ms', 'repeat']` empties optional fields
167
+ await node.todos.delete(todo.id)
168
+ node.on('todo_changed', (c) => console.log(c.id, c.deleted ? 'deleted' : c.todo)) // every client gets these, the caller too
169
+ ```
170
+
171
+ - `add` is idempotent on `id`: after a timeout, retry with the same `id` and the node returns the existing item instead of creating a second one. The node fills in `source` and `unreviewed`; pass `agent: true` if the call is made on behalf of an agent (the item is then marked as added by an agent and unreviewed until a person reviews it, and the node keeps at most 100 such items).
172
+ - `repeat: { kind: 'daily' | 'weekdays' | 'weekly', at: 'HH:MM', weekday?: 1-7 }` (Monday = 1, node-local time) makes an item a repeating template that the node copies at each time (docs/spec/daemon.md § 26.9; check `capabilities.todo_repeat`). Only a person sets it: a connection that reports as `mcp`, or a write with `agent: true`, gets `forbidden`. The returned `repeat.next_ms` is computed by the node.
173
+ - `list` pages by `(updated_ms, id)`: while `has_more` is true, pass the last item's `{ updated_ms, id }` as `before`. A page can be shorter than `limit` (1 MiB budget per page). Items changed while you page can show up twice (de-duplicate by `id`) or be skipped (`todo_changed` tells you).
174
+ - Errors: `invalid` (`field`: the parameter; `reason` `too_many` / `too_many_unreviewed` when the list is full) and `not_found`, as `RpcError`.
175
+
176
+ ## Twin (ADR-54)
177
+
178
+ `node.twin` is an online wrapper over `twin.*`, available when `(await node.info()).capabilities.twin === true`. It keeps no cache and replays nothing. Hide entry points on older nodes; direct calls receive `RpcError` (`unsupported`). Twin cannot approve permissions. Questions and reasons are model output: display them as untrusted plain text.
179
+
180
+ ```ts
181
+ node.on('twin_changed', (change) => console.log(change.state, change.run))
182
+ node.on('twin_question', (notice) => console.log(notice.question))
183
+ const status = await node.twin.get()
184
+ await node.twin.set({ projects: ['app'], paused: true, max_sessions: 1, daily_dispatches: 5 })
185
+ const { run } = await node.twin.dryRun()
186
+ const { runs } = await node.twin.runs({ limit: 20 })
187
+ const { questions } = await node.twin.questions({ open_only: true })
188
+ if (questions[0]) await node.twin.answer({ id: questions[0].id, answer: 'app' })
189
+ await node.twin.set({ paused: false })
190
+ await node.twin.wake()
191
+ const todo = await node.todos.add({ title: 'Fix login', project: 'app', handler: 'twin' })
192
+ await node.todos.update({ id: todo.id, handler: 'me' })
193
+ ```
194
+
195
+ `set` merges fields; `clear` resets agent / model / mode to node defaults. `dryRun()` waits up to 16 minutes by default, covering the maximum 15-minute judgment backend timeout; standard `RequestOptions` (`timeoutMs` / `signal`) can override it. A dry run consumes a judgment call and leaves a run record, executing no plan. Decisions preserve optional `note`, `question`, and `options`: supplementary agent instructions, questions, and answer choices. Render this model output as plain text. `wake()` returns `void`; execution still follows daemon coalescing, pause and budget limits. `runs` / `questions` preserve protocol result shapes and default to `{}`; paginate runs with `before_ms`. `twin_changed` delivers `{ state, run? }` and `twin_question` delivers `{ question }`, including answers and voided questions; subscribe before initiating operations. `todos.add` / `update` accept `handler: me | twin`. In a UI, let the person read and accept an agent item first with `update({ id, reviewed: true })`, then offer `update({ id, handler: 'twin' })`. The daemon also accepts explicitly requested atomic acceptance and handover; the SDK never accepts items automatically.
196
+
197
+ Twin runs can be triggered by `pr` (a pull request of a session the twin dispatched changed), and a to-do's history can contain `pr_event { session_id, event: checks_failed | merged | closed | reviewed, url? }` entries; the types follow the protocol, and clients must tolerate unknown values. `pr_event` carries no review text.
198
+
199
+ ### Twin connections (ADR-56)
200
+
201
+ A node's twin can be paired with another node as a restricted `twin` device, so it can add to-dos there and have agents work on them inside the projects that node opens to the connection. A person sets this up from a client that is paired with both nodes: ask the node to use for a one-time code, then hand it to the node that will use it. The code is a secret: pass the result of `twinLinkCode()` straight to `twin.link`; the SDK does not cache or log it, and your code should not display or store it.
202
+
203
+ ```ts
204
+ const { code } = await used.twinLinkCode() // on the node to be used (B): `node.twin_link_code`
205
+ const link = await using.twin.link({ code, node_id: (await used.info()).node_id }) // on the node that uses it (A)
206
+ const { links } = await using.twin.links() // name, group, online, last `peer_status`
207
+ await using.twin.unlink({ node_id: link.node_id }) // A forgets it; revoke the twin device on B to finish
208
+ // on B: what a connection may do (requester = the twin device's id), nothing is open by default
209
+ await used.twin.set({ requester: deviceId, projects: ['app'], max_sessions: 1, daily_dispatches: 5 })
210
+ const status = await used.twin.get({ requester: deviceId })
211
+ ```
212
+
213
+ `twin.peerStatus()` is what a twin device itself calls on B (name, open projects, what is left); other callers get `forbidden`. A refused link carries `data.reason`: `accept_links_off`, `different_hub`, `code_expired` or `node_mismatch`. A node reports `node.info.twin_accept_links`; clients should only offer a node as a target when it has `capabilities.twin` and that is `true`. To-do history may contain `remote_dispatched` and `remote_result`, and decisions `node` and the skip reasons `remote_unavailable` / `remote_refused`; treat unknown values as unknown.
214
+
215
+ ## Rules (ADR-54)
216
+
217
+ Each node keeps a list of your rules, short instructions such as "write the failing test first". The active ones are written into the system prompt of the sessions a to-do is dispatched to (see [docs/spec/daemon.md § 23](../../docs/spec/daemon.md#23-决策档案)). Rules never change permissions. `node.rules` is a thin wrapper over `rule.*`; a node reports support in `(await node.info()).capabilities.rules`, and an older node answers with `RpcError('unsupported')`. The SDK does no offline caching or replay.
218
+
219
+ ```ts
220
+ const rule = await node.rules.add({ text: 'Write the failing test first.', project: 'app' }) // active at once; `id` is generated for you; `status: 'pending'` waits for confirmation
221
+ const { rules, budget } = await node.rules.list() // oldest first; { status?, project? }; budget = { cap, node_bytes, projects }
222
+ await node.rules.update({ id: rule.id, status: 'disabled', if_updated_ms: rule.updated_ms }) // only the fields you pass change; `clear: ['project']`
223
+ const { text, rule_ids, bytes } = await node.rules.preview({ project: 'app' }) // what a new session of that project would get
224
+ await node.rules.delete(rule.id, { ifUpdatedMs: rule.updated_ms })
225
+ node.on('rule_changed', (c) => console.log(c.id, c.deleted ? 'deleted' : c.rule)) // every client gets these, the caller too
226
+ ```
227
+
228
+ Extraction requires `capabilities.rule_extract` and a configured `node.info.judge.extract`. `node.rules.extract(sessionId)` returns `{ run?, points }`: zero points means no backend call or run. Otherwise match the `rule_extract_done` event's `run.id` to the returned run (subscribe before calling; a fast backend can finish before the response). The event carries `{ run }` and is broadcast to all online clients. Successful rules are pending review. `node.rules.extractRuns({ sessionId?, limit? })` returns `{ runs, usedToday, dailyCalls }`, newest first (default 20, maximum 100); fields within each run keep their protocol names. Rejections are `RpcError` with code `invalid` and reason `budget`, `busy`, or `not_configured`. A running extraction survives client disconnection; query the history after reconnecting.
229
+
230
+ - `add` is idempotent on `id`. `agent: true` says the call is made on behalf of an agent: the rule is stored as `pending` with source `agent` (pass `origin_session` to record the session it came from) and does nothing until a person confirms it with `update({ status: 'active' })`.
231
+ - A rule is at most 600 characters (line breaks allowed). The rules that are active for one session take at most 4096 bytes in all, template included; an `add` or `update` that would go over is refused with `RpcError` `invalid`, `reason` `over_budget` (`bytes` and `cap` say how far). At most 300 rules not counting rejected ones (`reason` `too_many`; rejected ones have a cap of their own and the oldest is deleted when it is full), and at most 50 agent-proposed rules waiting for review (`too_many_pending`). Bidirectional controls and zero-width characters are refused (`reason` `invisible`).
232
+ - A rule that is active but unused for 60 days is marked `stale: true` by the daemon. A stale rule is not injected and does not count toward the 4096 bytes; it stays `active`. Only a person restores it: `update({ id, stale: false })` (the same byte check as activating; `over_budget` if it does not fit). `stale: true` is refused (`invalid`, `field` `stale`).
233
+ - `if_updated_ms` (`ifUpdatedMs` for `delete`) refuses the change when the rule was changed since you read it: `invalid`, `reason` `changed`, `updatedMs` is the current value.
234
+ - `todos.dispatchPreview` also returns `rules_text`: the rules text the dispatch will put into the session's system prompt.
235
+
159
236
  ## API overview
160
237
 
161
238
  - `pair(hubUrl, { code, name, storage?, profile?, headers?, ackTimeoutMs? })`: the joiner. `code` can be a 16-character (default) or 8-character (`anycon pair --short`) pairing code (case and hyphens don't matter), or a pairing link `https://hub/pair#code=…` / just `#code=…` (the code is in the URL fragment, which is not sent to the hub). The flow:
@@ -167,7 +244,7 @@ if (acceptsAttachment(agent, doc.mime)) {
167
244
  - `forgetNode(hubUrl, nodeNameOrIdPrefix, { storage?, profile? })`: forgets a locally stored node. Use it after `NodeKeyChanged`, once you've confirmed the new public key can be trusted, then `pair()` again.
168
245
  - `connect(hubUrl, { node?, storage?, onPermission?, headers?, … })` → `Node`. Every time the WebSocket connects, or `peer_online` arrives (or `auth_ok.peers_online` includes the node), it does a new IK handshake. After a disconnect it reconnects with exponential backoff (1 s → 30 s; a hub restart, close code `4002`, uses 1–3 s with jitter).
169
246
  - Several nodes at once: `const client = await Client.open(hubUrl)` plus `client.node('name')` for each node (the hub allows only one connection per device, so the nodes share one `Client`).
170
- - `Node`: `info()`, `agents.list({ refresh? })` (cached by etag), `projects.list/create/clone/link/unlink/browse/branches/rename/trash/trashList/restore/purge` (`create` and `clone` take an optional `root`: one of the paths in `info().workspace_roots`, the primary root by default), `sessions.list/get/create/search` (`create` accepts `workspace`, `prompt`, `attachments`, `messageId`), `worktrees.list/remove`, `uploadImage(bytes, { name, mime?, signal?, onProgress?, requestTimeoutMs? })` / `uploadFile(bytes, { name, mime?, signal?, onProgress?, requestTimeoutMs? })` / `downloadAttachment(refOrBlobId)` / `discardAttachment(refOrBlobId)` (see [Attachments](#attachments-adr-35-adr-44) above), `permissions.list`, `online` / `waitOnline()`, the events `online` / `offline` / `permission` / `permission_error` / `error` (non-fatal channel problems) / `session_changed` …, `call(method, params)` (typed), and `rpc(method, params)` (raw).
247
+ - `Node`: `info()`, `agents.list({ refresh? })` (cached by etag), `projects.list/create/clone/link/unlink/browse/branches/rename/trash/trashList/restore/purge` (`create` and `clone` take an optional `root`: one of the paths in `info().workspace_roots`, the primary root by default), `sessions.list/get/create/search` (`create` accepts `workspace`, `prompt`, `attachments`, `messageId`), `worktrees.list/remove`, `uploadImage(bytes, { name, mime?, signal?, onProgress?, requestTimeoutMs? })` / `uploadFile(bytes, { name, mime?, signal?, onProgress?, requestTimeoutMs? })` / `downloadAttachment(refOrBlobId)` / `discardAttachment(refOrBlobId)` (see [Attachments](#attachments-adr-35-adr-44) above), `todos.list/add/update/delete` (see [To-do list](#to-do-list-adr-54) below), `permissions.list`, `online` / `waitOnline()`, the events `online` / `offline` / `permission` / `permission_error` / `error` (non-fatal channel problems) / `session_changed` / `todo_changed` …, `call(method, params)` (typed), and `rpc(method, params)` (raw).
171
248
  - `projects.link(path, { name? })` registers an existing directory on the daemon's machine as a project, without moving or copying it. The path must be inside the daemon's `workspace.link_roots`. `unlink(name)` only removes the link and leaves the directory alone. `browse({ path?, showHidden? })` lists the subdirectories inside `link_roots` to choose from. Linked projects have `kind` `linked`, and `missing` is true when the directory is gone.
172
249
  - `Session`: `send(text, { attachments?, messageId?, signal? })` → an iterable event stream (**sent immediately**; iteration runs until this turn's `turn_done` or an unrecoverable `error`; a `break` midway doesn't cancel the turn), `run(text)`, `respond(requestId, optionId | { answers }, message?)`, `setSettings(settings, { clear? })`, `cancel`, `history`, `events()`, `rename/archive/unarchive/delete/restart` (`archive({ worktree? })`, `delete({ worktree?, deleteBranch? })`), `worktree` (getter), `gitStatus({ includePr? })`, `diff({ against?, path? })`, `syncBase({ abort? })`. `watch` / `unwatch` and catching up on events after a disconnect (`session.history`) are handled internally.
173
250
  - Permissions: the `permission` event has `allow()` / `allowSession()` / `deny(message?)` / `respond(optionId)` / `answer(answers)`. An `onPermission` policy returns `'allow' | 'allow_session' | 'deny' | { option, message? } | { deny } | { answers } | undefined`. **Policies answer only for sessions the SDK itself is using (with an active `send()` / `events()`)**, and never decide for sessions the user opened in the Web UI. The SDK denies requests that nobody answers after `permissionTimeoutMs` (10 minutes by default).
@@ -250,6 +327,10 @@ The hub limits the size of a single envelope (256 KiB by default), and a page of
250
327
  - The hub's `dropped { seq, reason }` arrives at most once per connection per second. It signals that something wrong was sent and is not a per-envelope receipt, so the SDK **doesn't resend on it**: `node.on('error', …)` receives an `AnyconError` (`envelope_too_large` means still over the limit after fragmenting, i.e. the hub's `ANYCON_MAX_ENVELOPE_BYTES` is smaller than one fragment; `not_paired` becomes `NodeRejected`), in-flight requests fail, and the channel handshakes again.
251
328
  - The hub's `rate_limited { retry_after_ms }` is a "how long to pause" hint for the **whole hub connection** (all nodes, resends included). It comes with `backpressure`, is capped at 30 s, resets on reconnect, and **doesn't mean an envelope was dropped**. Until it expires, new envelopes for every node are queued, and bounced seqs also wait until then to be resent. It doesn't fail requests, start a new handshake, or emit an `error` event, and the SDK doesn't treat the transport as desynchronized just because data was sent within the last second.
252
329
 
330
+ ## Rule sync scope
331
+
332
+ `node.rules.add({ text, sync: 'group' })` and `node.rules.update({ id, sync: 'group' })` write only to that node. New rules default to `node`; project rules and pending rules cannot use `group`. The SDK does not synchronize across nodes or keep a group outbox. Web copies confirmed group rules to paired nodes in the same nonempty group, retries offline targets, and offers group alignment for differences and refusals. Switching a rule back to `node` leaves other nodes’ copies unchanged.
333
+
253
334
  ## Development
254
335
 
255
336
  ```bash
package/README.zh-CN.md CHANGED
@@ -128,13 +128,91 @@ if (acceptsAttachment(agent, doc.mime)) { // agent:node.age
128
128
 
129
129
  没有 `file_attachments` 的 daemon(旧版本)收到 agent 原生收的类型以外的文件 → `RpcError`(`unsupported`);这台设备同时进行的上传超过 8 个 → `RpcError`(`busy`,没有 `reason`);`uploadImage` 给了非图片 `mime`、或 `mime` 缺省而文件头认不出 → `AnyconError('unsupported_image')`;`uploadFile` 给了不成形的 `mime` → `AnyconError('invalid_mime')`。这两种情况什么都不发。
130
130
 
131
+ ## 清单(ADR-54)
132
+
133
+ 每个节点有一份个人清单(见 [docs/spec/daemon.md § 21](../../docs/spec/daemon.md#21-清单))。`node.todos` 是 `todo.*` 的薄封装;节点是否支持看 `(await node.info()).capabilities.todo`,旧节点回 `RpcError('unsupported')`。SDK 不做离线缓存、也不重放:节点离线时这些调用和别的请求一样失败。
134
+
135
+ ```ts
136
+ const todo = await node.todos.add({ title: '看发布说明', project: 'app' }) // id(小写带连字符的 UUID)缺省由 SDK 生成,自己传的 id 也必须是这个写法
137
+ const { todos, has_more } = await node.todos.list() // 没关闭的项,最近修改的在前;{ include_closed?, project?, limit?, before? }
138
+ await node.todos.update({ id: todo.id, state: 'done' }) // 只改传了的字段;`clear: ['project', 'due_ms', 'repeat']` 清空可选字段
139
+ await node.todos.delete(todo.id)
140
+ node.on('todo_changed', (c) => console.log(c.id, c.deleted ? 'deleted' : c.todo)) // 所有客户端都会收到,包括发起的这一个
141
+ ```
142
+
143
+ - `add` 按 `id` 幂等:超时后用同一个 `id` 重试,节点返回已有的那一项,不会出现第二项。`source` 和 `unreviewed` 由节点填;替 agent 调用时传 `agent: true`(这一项会标成 agent 加的、在有人收下之前是「未收下」,节点上这类项最多 100 个)。
144
+ - `repeat: { kind: 'daily' | 'weekdays' | 'weekly', at: 'HH:MM', weekday?: 1-7 }`(周一 = 1,按节点的本地时间)让一项成为周期模板,节点到点复制一项新的(docs/spec/daemon.md § 26.9;先看 `capabilities.todo_repeat`)。只由人设置:自报 `mcp` 的连接或带 `agent: true` 的写入得到 `forbidden`。返回里的 `repeat.next_ms` 由节点算出。
145
+ - `list` 按 `(updated_ms, id)` 翻页:`has_more` 为 true 时,把最后一项的 `{ updated_ms, id }` 作为 `before` 取下一页。一页可能少于 `limit`(每页 1 MiB 的字节预算)。翻页期间被改过的项可能出现两次(按 `id` 去重)或被跳过(`todo_changed` 会补上)。
146
+ - 错误:`invalid`(`field` 是出问题的参数;清单满了时 `reason` 是 `too_many` / `too_many_unreviewed`)和 `not_found`,都是 `RpcError`。
147
+
148
+ ## Twin(ADR-54)
149
+
150
+ `node.twin` 是 `twin.*` 的在线薄封装,需要 `(await node.info()).capabilities.twin === true`。不缓存、不重放;未知节点能力或旧 daemon 由调用方隐藏入口,直接调用旧节点会得到 `RpcError`(`unsupported`)。Twin 不批准权限。问题和理由由模型写成,只作为不可信的纯文字显示。
151
+
152
+ ```ts
153
+ node.on('twin_changed', (change) => console.log(change.state, change.run))
154
+ node.on('twin_question', (notice) => console.log(notice.question))
155
+ const status = await node.twin.get()
156
+ await node.twin.set({ projects: ['app'], paused: true, max_sessions: 1, daily_dispatches: 5 })
157
+ const { run } = await node.twin.dryRun()
158
+ const { runs } = await node.twin.runs({ limit: 20 })
159
+ const { questions } = await node.twin.questions({ open_only: true })
160
+ if (questions[0]) await node.twin.answer({ id: questions[0].id, answer: 'app' })
161
+ await node.twin.set({ paused: false })
162
+ await node.twin.wake()
163
+ const todo = await node.todos.add({ title: 'Fix login', project: 'app', handler: 'twin' })
164
+ await node.todos.update({ id: todo.id, handler: 'me' })
165
+ ```
166
+
167
+ `set` 合并字段;`clear` 清空 agent / model / mode,恢复节点缺省。`dryRun()` 默认等待最多 16 分钟,覆盖最长 15 分钟的判断后端调用;可以传标准 `RequestOptions`(`timeoutMs` / `signal`)覆盖。试跑会消耗一次判断调用并留记录,不执行计划;`run.decisions` 原样保留可选的 `note` / `question` / `options`(给 agent 的补充说明、问题和选项),这些模型文字只按纯文字展示;`wake()` 返回 `void`,实际唤醒仍受合并、暂停和预算约束。`runs` / `questions` 保留协议形状,缺省参数 `{}`,`before_ms` 翻运行记录页。`twin_changed` 收到 `{ state, run? }`,`twin_question` 收到 `{ question }`,包含回答和作废;先订阅再发起操作。`todos.add` / `update` 接受 `handler: me | twin`;界面应先让人读过并收下 agent 项(`update({ id, reviewed: true })`),再提供移交操作(`update({ id, handler: 'twin' })`)。daemon 也接受明确请求的原子收下并移交,SDK 不自动收下。
168
+
169
+ Twin 的运行可以由 `pr` 触发(Twin 派出的会话的 PR 有了变化),清单项的「经过」里会出现 `pr_event { session_id, event: checks_failed | merged | closed | reviewed, url? }`;类型跟着协议走,客户端要容忍不认识的值。`pr_event` 不含评审正文。
170
+
171
+ ### Twin 连接(ADR-56)
172
+
173
+ 一个节点的 Twin 可以作为受限的 `twin` 设备和另一个节点配对,在那里记项并让 agent 在那个节点对这条连接开放的项目里干活。由人在同时和两个节点配过对的客户端上建立:先向要使用的节点要一个一次性短码,再交给使用它的节点。短码是秘密:把 `twinLinkCode()` 的结果直接交给 `twin.link`,SDK 不缓存、不写日志,你的代码也不要显示或存下它。
174
+
175
+ ```ts
176
+ const { code } = await used.twinLinkCode() // 在被使用的节点(B)上:`node.twin_link_code`
177
+ const link = await using.twin.link({ code, node_id: (await used.info()).node_id }) // 在使用它的节点(A)上
178
+ const { links } = await using.twin.links() // 名称、分组、在不在线、上一次的 `peer_status`
179
+ await using.twin.unlink({ node_id: link.node_id }) // A 忘掉这一条;要在 B 上吊销那台 Twin 设备才算断开
180
+ // 在 B 上:一条连接能做什么(requester = Twin 设备的 id),缺省什么都不开放
181
+ await used.twin.set({ requester: deviceId, projects: ['app'], max_sessions: 1, daily_dispatches: 5 })
182
+ const status = await used.twin.get({ requester: deviceId })
183
+ ```
184
+
185
+ `twin.peerStatus()` 由 Twin 设备自己在 B 上调用(名称、开放的项目、剩余名额),别的调用方得到 `forbidden`。建立失败时 `data.reason` 是 `accept_links_off`、`different_hub`、`code_expired` 或 `node_mismatch`。节点用 `node.info.twin_accept_links` 报告是否接受;客户端只在节点有 `capabilities.twin` 并且它为 `true` 时把它列为可用的目标。清单的「经过」里可能出现 `remote_dispatched` 和 `remote_result`,分拣的决定带 `node` 和新的跳过原因 `remote_unavailable` / `remote_refused`;不认识的值按未知处理。
186
+
187
+ ## 规则(ADR-54)
188
+
189
+ 每个节点有一份你的规则,一两句话的做法,比如「先写失败的测试再改实现」。生效的规则会写进清单派发出去的会话的系统提示(见 [docs/spec/daemon.md § 23](../../docs/spec/daemon.md#23-决策档案))。规则不改任何权限。`node.rules` 是 `rule.*` 的薄封装;节点是否支持看 `(await node.info()).capabilities.rules`,旧节点回 `RpcError('unsupported')`。SDK 不做离线缓存,也不重放。
190
+
191
+ ```ts
192
+ const rule = await node.rules.add({ text: '先写失败的测试再改实现。', project: 'app' }) // 直接生效;`id` 缺省由 SDK 生成;`status: 'pending'` 等人确认
193
+ const { rules, budget } = await node.rules.list() // 最早的在前;{ status?, project? };budget = { cap, node_bytes, projects }
194
+ await node.rules.update({ id: rule.id, status: 'disabled', if_updated_ms: rule.updated_ms }) // 只改传了的字段;`clear: ['project']`
195
+ const { text, rule_ids, bytes } = await node.rules.preview({ project: 'app' }) // 现在开一个这个项目的会话会拿到什么
196
+ await node.rules.delete(rule.id, { ifUpdatedMs: rule.updated_ms })
197
+ node.on('rule_changed', (c) => console.log(c.id, c.deleted ? 'deleted' : c.rule)) // 所有客户端都会收到,包括发起的这一个
198
+ ```
199
+
200
+ 生效的规则 60 天没被注入也没被引用,daemon 会标成 `stale: true`:过期的不注入、不占 4096 字节的字数预算,状态仍是 `active`。只有人能恢复:`update({ id, stale: false })`(和变成生效一样检查字数,放不下是 `over_budget`);`stale: true` 会被拒(`invalid`,`field` 为 `stale`)。
201
+
202
+ 提炼要求 `capabilities.rule_extract`,并配置 `node.info.judge.extract`。`node.rules.extract(sessionId)` 返回 `{ run?, points }`:0 个决策点时不调用后端、没有 run;否则按返回的 `run.id` 匹配 `rule_extract_done` 的 `{ run }`(先订阅再调用,快的后端可能在响应之前结束)。事件发给所有在线客户端,提炼出的规则都待确认。`node.rules.extractRuns({ sessionId?, limit? })` 返回 `{ runs, usedToday, dailyCalls }`,最新的在前,默认 20 次、最多 100 次;每条 run 的字段保持协议命名。请求被拒是 `RpcError`,code 为 `invalid`,reason 为 `budget`、`busy` 或 `not_configured`。断线不取消节点上的提炼,重连后可以读记录。
203
+
204
+ - `add` 按 `id` 幂等。`agent: true` 表示这次调用是替 agent 发的:规则记成 `pending`、来源是 `agent`,在人用 `update({ status: 'active' })` 确认之前不起作用。
205
+ - 一条规则最多 600 个字符(可以换行)。一个会话拿到的生效规则合计(含模板)最多 4096 字节;会超出的 `add` / `update` 被拒绝,`RpcError` 是 `invalid`、`reason` 为 `over_budget`(`bytes` 和 `cap` 说明超了多少)。最多 300 条(不含已否决的,`reason` 为 `too_many`;已否决的另有一个 300 的上限,满了删最早的),agent 提的待确认规则最多 50 条(`too_many_pending`)。双向控制符和零宽字符会被拒绝(`reason` 为 `invisible`)。
206
+ - `if_updated_ms`(`delete` 里是 `ifUpdatedMs`):这条规则在你读到之后被改过就拒绝:`invalid`、`reason` 为 `changed`,`updatedMs` 是现在的值。
207
+ - `todos.dispatchPreview` 也返回 `rules_text`:派发会写进会话系统提示的规则文字。
208
+
131
209
  ## API 速览
132
210
 
133
211
  - `pair(hubUrl, { code, name, storage?, profile?, headers?, ackTimeoutMs? })` — joiner。`code` 可以是 16 位(默认)或 8 位(`anycon pair --short`)短码(大小写、连字符随意),也可以是配对链接 `https://hub/pair#code=…` / 只有 `#code=…`(短码在 fragment 里,不会发给 hub)。流程:先在本地做**一次** `derivePairSecrets(code)`(Argon2id,64 MiB × 3 轮,Node 约 0.1–0.3 s、浏览器 wasm 约 0.1–1 s,同步占用线程;`match_id` 和 PSK 同出一次计算,用完 PSK 清零;所以配对测试里每次 `pair()` 要多算这么久,超时别设在 1 s 以下)→ 连 hub → `PairJoin { match_id }`(**hub 从头到尾看不到短码**)→ Noise XXpsk3(initiator,PSK 来自上面那次派生)→ `PairConfirm` → `PairDone`,然后**等 daemon 经新建立的 Noise 传输发来 `pair.ack`**(最多 `ackTimeoutMs`,默认 30 秒),校验 `peer_id` 是本设备的正式 id、`node_id == PairDone.peer`、`fingerprint` 等于握手得到的节点公钥的指纹,**全部通过才落盘**(设备身份 + 节点公钥);超时 / 不符 → `PairingFailed`,什么都不留。节点名取自 `pair.ack`(已认证,控制字符被去掉)。握手第 3 条的 payload 带本设备的 `{ name, kind, platform, version }`,daemon 用它显示设备名。节点以 `PairDone.peer`(正式设备 id)为键。已有同 id 节点但公钥不同 → 抛 `NodeKeyChanged`,不覆盖(见下)。本地身份被 hub 作废(`auth_fail invalid | revoked` / close 4004)时 `pair()` 会清掉它并用全新身份重试。`headers` 见下面「账号归属」。
134
212
  - `forgetNode(hubUrl, nodeNameOrIdPrefix, { storage?, profile? })` — 忘掉本地记录的某个节点;`NodeKeyChanged` 之后确认新公钥可信时用它,再 `pair()` 一次。
135
213
  - `connect(hubUrl, { node?, storage?, onPermission?, headers?, … })` → `Node`。每次 WS 连上、收到 `peer_online`(或 `auth_ok.peers_online` 含该节点)都重新做 IK 握手;掉线指数退避重连(1s → 30s,hub 重启 `4002` 用 1–3 s 抖动)。
136
214
  - 同时连多个节点:`const client = await Client.open(hubUrl)` + 多次 `client.node('name')`(hub 对单设备只允许一条连接,所以多节点共用一个 `Client`)。
137
- - `Node`:`info()`、`agents.list({ refresh? })`(带 etag 缓存)、`projects.list/create/clone/link/unlink/browse/branches/rename/trash/trashList/restore/purge`(`create` / `clone` 可带 `root`:`info().workspace_roots` 里的某个 `path`,缺省是主根;`link(path, { name? })` 把 daemon 所在机器上的已有目录关联为项目——不移动、不复制,路径要在 daemon 的 `workspace.link_roots` 之内;`unlink(name)` 只解除关联、不动目录;`browse({ path?, showHidden? })` 列 `link_roots` 之内的子目录供选择;关联项目的 `kind` 为 `linked`,目录没了时 `missing` 为 true)、`sessions.list/get/create/search`(`create` 接受 `workspace`、`prompt`、`attachments`、`messageId`)、`worktrees.list/remove`、`uploadImage(bytes, { name, mime?, signal?, onProgress?, requestTimeoutMs? })` / `uploadFile(bytes, { name, mime?, signal?, onProgress?, requestTimeoutMs? })` / `downloadAttachment(refOrBlobId)` / `discardAttachment(refOrBlobId)`(见上面「附件」)、`permissions.list`、`online` / `waitOnline()`、事件 `online` / `offline` / `permission` / `permission_error` / `error`(非致命的通道问题)/ `session_changed` …、`call(method, params)`(类型化)和 `rpc(method, params)`(原始)。
215
+ - `Node`:`info()`、`agents.list({ refresh? })`(带 etag 缓存)、`projects.list/create/clone/link/unlink/browse/branches/rename/trash/trashList/restore/purge`(`create` / `clone` 可带 `root`:`info().workspace_roots` 里的某个 `path`,缺省是主根;`link(path, { name? })` 把 daemon 所在机器上的已有目录关联为项目——不移动、不复制,路径要在 daemon 的 `workspace.link_roots` 之内;`unlink(name)` 只解除关联、不动目录;`browse({ path?, showHidden? })` 列 `link_roots` 之内的子目录供选择;关联项目的 `kind` 为 `linked`,目录没了时 `missing` 为 true)、`sessions.list/get/create/search`(`create` 接受 `workspace`、`prompt`、`attachments`、`messageId`)、`worktrees.list/remove`、`uploadImage(bytes, { name, mime?, signal?, onProgress?, requestTimeoutMs? })` / `uploadFile(bytes, { name, mime?, signal?, onProgress?, requestTimeoutMs? })` / `downloadAttachment(refOrBlobId)` / `discardAttachment(refOrBlobId)`(见上面「附件」)、`todos.list/add/update/delete`(见下面的[清单](#清单adr-54))、`permissions.list`、`online` / `waitOnline()`、事件 `online` / `offline` / `permission` / `permission_error` / `error`(非致命的通道问题)/ `session_changed` …、`call(method, params)`(类型化)和 `rpc(method, params)`(原始)。
138
216
  - `Session`:`send(text, { attachments?, messageId?, signal? })` → 可迭代事件流(**立即发送**,迭代到本 turn 的 `turn_done` 或不可恢复的 `error`;中途 `break` 不取消 turn)、`run(text)`、`respond(requestId, optionId | { answers }, message?)`、`setSettings(settings, { clear? })`、`cancel`、`history`、`events()`、`rename/archive/delete/restart`(`archive({ worktree? })`、`delete({ worktree?, deleteBranch? })`)、`worktree`(getter)、`gitStatus({ includePr? })`、`diff({ against?, path? })`、`syncBase({ abort? })`。`watch` / `unwatch` 和掉线后的补事件(`session.history`)是内部的。
139
217
  - 权限:`permission` 事件上有 `allow()` / `allowSession()` / `deny(message?)` / `respond(optionId)` / `answer(answers)`;`onPermission` 策略返回 `'allow' | 'allow_session' | 'deny' | { option, message } | { answers } | undefined`。**只对 SDK 自己正在用的会话(有进行中的 `send()` / `events()`)代答**,不会替用户在 Web 上开的会话做决定;没人答复的请求 `permissionTimeoutMs`(默认 10 分钟)后由 SDK deny。
140
218
  - **不会悄悄升级成 `allow_always`**:`allow()` / `'allow'` 只选 `allow_once`;请求里没有 `allow_once` 时 `allow()` 报错 `no_matching_option`,策略的 `'allow'` 则发 `node.on('permission_error', (error, request) => …)` 并照常走超时 deny。要「本会话都允许」显式用 `allowSession()` / `'allow_session'`(没有 `allow_always` 选项时退回 `allow_once`,只会收窄)。
@@ -208,6 +286,10 @@ hub 对单个信封有大小上限(默认 256 KiB),而一页 `session.hist
208
286
  - hub 的 `dropped { seq, reason }` 每连接每秒至多一条,是「发错东西」的信号而不是逐条回执,**不据此重发**:`node.on('error', …)` 收到 `AnyconError`(`envelope_too_large` = 分片之后仍超限,说明 hub 的 `ANYCON_MAX_ENVELOPE_BYTES` 比一片还小;`not_paired` 则是 `NodeRejected`),进行中的请求失败,通道重新握手;
209
287
  - hub 的 `rate_limited { retry_after_ms }` 是**整条 hub 连接**(所有节点、含重发)的「暂停多久」提示(伴随 `backpressure` 出现,封顶 30 s,重连后清零),**不再意味着有信封被丢**:到点之前所有节点新的信封排队,被退回的 seq 也等到那之后才重发;不失败请求、不重新握手、不发 `error` 事件,也不会因为 1 秒内刚发过数据就把传输当作失步。
210
288
 
289
+ ## 规则同步范围
290
+
291
+ `node.rules.add({ text, sync: 'group' })` 和 `node.rules.update({ id, sync: 'group' })` 只写当前连接的节点。新建缺省 `node`;项目规则和待确认规则不能是 `group`。SDK 不跨节点同步,也没有同组 outbox;Web 在用户写入成功后向已配对、同一非空分组的节点复制最后期望,重连后重放,并提供「对齐」处理差异和拒绝。改回 `node` 时其他节点上的副本保留。
292
+
211
293
  ## 开发
212
294
 
213
295
  ```bash
package/dist/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export { defaultStorage } from './default-storage.js';
30
30
  export { toWsUrl, type WebSocketFactory, type WebSocketInit, type WebSocketLike } from './ws.js';
31
31
  export { SDK_VERSION } from './version.js';
32
32
  export { PROTOCOL_VERSION, METHODS, CLOSE_CODE } from '@anycon/protocol';
33
- export type { AgentCapabilities, AgentInfo, AttachmentRef, BrowseEntry, ClearableSetting, DiffAgainst, DiffFile, DiffFileStatus, Event, GitAction, LinkBlock, ModelInfo, ModeInfo, NodeInfo, PairFailReason, PermissionOption, PermissionRequest, PermissionResolved, Project, ProjectKind, PullRequestInfo, PullRequestState, SessionChanged, SessionDiffResult, SessionEvent, SessionGitStatus, SessionSettings, SessionSummary, SessionSyncBaseResult, SessionWorkspace, SessionWorktree, SyncOutcome, TurnDoneReason, Usage, WorkspaceBranchesResult, WorkspaceBrowseResult, WorktreeDisposal, WorktreeInfo, WorktreeState, } from '@anycon/protocol';
33
+ export type { AgentCapabilities, AgentInfo, AttachmentRef, BrowseEntry, ClearableSetting, ExtractRun, RuleExtractDone, RuleExtractResult, DiffAgainst, DiffFile, DiffFileStatus, Event, GitAction, LinkBlock, ModelInfo, ModeInfo, NodeInfo, NodeTwinLinkCodeResult, PairFailReason, PermissionOption, PermissionRequest, PermissionResolved, Project, ProjectKind, PullRequestInfo, PullRequestState, SessionChanged, SessionDiffResult, SessionEvent, SessionGitStatus, SessionSettings, SessionSummary, SessionSyncBaseResult, SessionWorkspace, SessionWorktree, SyncOutcome, TodoHandler, TwinAction, TwinAnswerParams, TwinChanged, TwinDecision, TwinDecisionOutcome, TwinDryRunResult, TwinGetParams, TwinGetResult, TwinLink, TwinLinkParams, TwinLinksResult, TwinPeerAgent, TwinPeerStatus, TwinQuestion, TwinQuestionNotice, TwinQuestionStatus, TwinQuestionsParams, TwinQuestionsResult, TwinRun, TwinRunResult, TwinRunsParams, TwinRunsResult, TwinStatsParams, TwinStatsResult, TwinScope, TwinSetParams, TwinSkipReason, TwinState, TwinToday, TwinTrigger, TwinUnlinkParams, TurnDoneReason, Usage, WorkspaceBranchesResult, WorkspaceBrowseResult, WorktreeDisposal, WorktreeInfo, WorktreeState, } from '@anycon/protocol';
34
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EACL,MAAM,EACN,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,IAAI,EACJ,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,IAAI,EACJ,KAAK,mBAAmB,EACxB,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,OAAO,EACP,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,iBAAiB,EACj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,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,cAAc,EACd,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,cAAc,EACd,KAAK,EACL,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,aAAa,GACd,MAAM,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EACL,MAAM,EACN,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,IAAI,EACJ,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,IAAI,EACJ,KAAK,mBAAmB,EACxB,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,OAAO,EACP,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf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UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxE,YAAY,EACV,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,cAAc,EACd,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,EACP,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,SAAS,EACT,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,aAAa,GACd,MAAM,kBAAkB,CAAA"}
package/dist/node.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * 一个节点(daemon)的客户端视图:`info()` / `agents` / `projects` / `sessions`,
3
3
  * 以及 daemon → 客户端的通知分发(`session.event`、`permission.request`、`job.*` ……)。
4
4
  */
5
- import { type AgentInfo, type AttachmentRef, type AgentListResult, type JobDone, type JobProgress, type NodeInfo, type PermissionRequest, type PermissionResolved, type Project, type RequestMethodName, type RequestMethods, type RequestOptions, type SessionChanged, type SessionListParams, type SessionSettings, type SessionSummary, type SessionWorkspace, type WorkspaceBranchesResult, type WorkspaceBrowseResult, type WorkspaceChanged, type SearchHit, type TrashEntry, type WorktreeInfo } from '@anycon/protocol';
5
+ import { type AgentInfo, type AttachmentRef, type AgentListResult, type JobDone, type JobProgress, type NodeInfo, type NodeTwinLinkCodeResult, type PermissionRequest, type PermissionResolved, type Project, type RequestMethodName, type RequestMethods, type RequestOptions, type SessionChanged, type SessionListParams, type SessionSettings, type SessionSummary, type SessionWorkspace, type Rule, type RuleAddParams, type RuleChanged, type RuleExtractDone, type RuleExtractResult, type ExtractRun, type RuleListParams, type RuleListResult, type RulePreviewParams, type RulePreviewResult, type RuleUpdateParams, type TwinAnswerParams, type TwinChanged, type TwinDryRunResult, type TwinGetParams, type TwinGetResult, type TwinLink, type TwinLinkParams, type TwinLinksResult, type TwinPeerStatus, type TwinQuestion, type TwinQuestionNotice, type TwinQuestionsParams, type TwinQuestionsResult, type TwinRunsParams, type TwinRunsResult, type TwinStatsParams, type TwinStatsResult, type TwinSetParams, type TwinUnlinkParams, type Todo, type TodoAddParams, type TodoChanged, type TodoDispatchParams, type TodoDispatchPreviewParams, type TodoDispatchPreviewResult, type TodoDispatchResult, type TodoEventNotice, type TodoHistoryParams, type TodoHistoryResult, type TodoListParams, type TodoListResult, type TodoRepeatPreviewParams, type TodoRepeatPreviewResult, type TodoUpdateParams, type RepeatStateChanged, type RepeatStateClearResult, type RepeatStateDeleteResult, type RepeatStateGetResult, type RepeatStateListParams, type RepeatStateListResult, type RepeatStateSetResult, type RepeatStateUnseenResult, type WorkspaceBranchesResult, type WorkspaceBrowseResult, type WorkspaceChanged, type SearchHit, type TrashEntry, type WorktreeInfo } from '@anycon/protocol';
6
6
  import { type DownloadOptions, type DownloadedAttachment, type UploadFileOptions, type UploadImageOptions } from './attachments.js';
7
7
  import type { Client } from './client.js';
8
8
  import { Emitter } from './emitter.js';
@@ -33,6 +33,21 @@ export interface NodeEvents {
33
33
  permission_error: [error: unknown, request: PermissionRequest];
34
34
  agent_changed: [AgentListResult];
35
35
  workspace_changed: [WorkspaceChanged];
36
+ /** 清单有项被新建、修改或删除(`todo.changed`,发给所有在线客户端,包括发起的那一个)。 */
37
+ todo_changed: [TodoChanged];
38
+ /** 清单项的「经过」多了一条(`todo.event`,docs/spec/daemon.md § 22;发给所有在线客户端)。`text` 是 agent 写的,按不可信内容渲染。 */
39
+ todo_event: [TodoEventNotice];
40
+ /**
41
+ * 一个周期项(模板)的跨次状态被写、删或清空(`todo.state_changed`,docs/spec/daemon.md § 26.11):只有模板 id 和条数,
42
+ * 不带键和值;要看内容用 `node.todos.stateList`。
43
+ */
44
+ todo_state_changed: [RepeatStateChanged];
45
+ /** 规则有一条被新建、修改或删除(`rule.changed`,docs/spec/daemon.md § 23;发给所有在线客户端,包括发起的那一个)。`last_injected_ms` 和 `last_referenced_ms` 的变化不通知;daemon 标过期、人恢复时通知。 */
46
+ rule_changed: [RuleChanged];
47
+ /** 一次提炼结束,按 run.id 对应发起的调用;所有在线客户端都会收到。 */
48
+ rule_extract_done: [RuleExtractDone];
49
+ twin_changed: [TwinChanged];
50
+ twin_question: [TwinQuestionNotice];
36
51
  }
37
52
  export interface NodeOptions {
38
53
  onPermission?: PermissionPolicy;
@@ -215,6 +230,151 @@ export declare class Node extends Emitter<NodeEvents> {
215
230
  * `AttachmentError`(`invalid`,`reason = 'in_use'`):它随会话删除。
216
231
  */
217
232
  discardAttachment(attachment: AttachmentRef | string): Promise<void>;
233
+ /**
234
+ * 节点上的清单(`todo.*`,节点 `capabilities.todo` 为 true 才有;旧节点 → `RpcError`,`unsupported`)。薄封装:不做离线缓存,
235
+ * 也不重放;节点离线时这些调用和别的请求一样失败。
236
+ */
237
+ readonly todos: {
238
+ /**
239
+ * `todo.list`:缺省只给没关闭的项,按 `(updated_ms, id)` 从新到旧;一页最多 `limit`(缺省 200、上限 1000)项,
240
+ * 并受 1 MiB 的字节预算限制,所以可能更少。`has_more` 时用最后一项的 `{ updated_ms, id }` 作为 `before` 取下一页,
241
+ * 翻页期间被改过的项可能出现两次(按 `id` 去重)或被跳过(`todo_changed` 会补上)。
242
+ */
243
+ list: (params?: TodoListParams) => Promise<TodoListResult>;
244
+ /** `todo.get`:读一项(只读,不审计、不通知)。项不存在 → `RpcError`(`not_found`),`id` 不是小写 UUID → `invalid`(`data.field = 'id'`)。 */
245
+ get: (id: string) => Promise<Todo>;
246
+ /**
247
+ * `todo.add`。`id` 缺省时 SDK 生成一个 UUID(小写带连字符;自己给的 id 必须是这个写法,daemon 不做规范化,别的写法 → `invalid`,`data.field = 'id'`);超时后要重试就传同一个:`id` 已经存在时 daemon 原样返回已有的那一项,
248
+ * 不会出现第二项。标题为空 / 超长、正文超长、`id` 不是 UUID、清单已满 → `RpcError`(`invalid`,见 `data.field` /
249
+ * `data.reason`:`too_many` / `too_many_unreviewed`)。`source` 由 daemon 填;`agent: true` 表示这是 agent 加的。
250
+ */
251
+ add: (params: Omit<TodoAddParams, "id"> & {
252
+ id?: string;
253
+ }) => Promise<Todo>;
254
+ /** `todo.update`:只带要改的字段;`clear` 列出要清空的可选字段(`project` / `due_ms` / `repeat`)。`repeat` 是周期规则(docs/spec/daemon.md § 26.9,节点 `capabilities.todo_repeat` 为 true 才有;只由人设置,自报 `mcp` 或 `agent: true` → `forbidden`)。项不存在 → `RpcError`(`not_found`)。 */
255
+ update: (params: TodoUpdateParams) => Promise<Todo>;
256
+ /**
257
+ * `todo.delete`:物理删除。项不存在 → `RpcError`(`not_found`)。给了 `ifUpdatedMs`,而这一项现在的 `updated_ms` 不是它:
258
+ * 什么都不删,`RpcError`(`invalid`,`reason = 'changed'`,`updatedMs` 是现在的值)。同一项的 `updated_ms` 每次修改都严格递增,
259
+ * 所以「读到之后没被改过」可以用它来判断。
260
+ */
261
+ delete: (id: string, opts?: {
262
+ ifUpdatedMs?: number;
263
+ }) => Promise<void>;
264
+ /**
265
+ * `todo.dispatch`(docs/spec/daemon.md § 22):从一项开一个会话,关联、记「经过」、算 `activity`,全部由 daemon 做,不要自己拼
266
+ * `session.create`。成功得到更新后的项(`state: 'working'`、`sessions` 多一个)和会话。第一条消息由 daemon 生成,调用方不能另给。
267
+ * `no_push` 缺省 `true`(「不 push、不开 PR」):所选 agent 没有声明这个选项而它为 `true` → `RpcError`(`unsupported`,
268
+ * `data.reason = 'no_push'`),要派给这样的 agent 必须明确传 `false`。别的错误:项已关闭 → `invalid`(`data.reason = 'closed'`);
269
+ * 没有项目 → `invalid`(`data.field = 'project'`);`message_id` 缺省时 SDK 生成一个:超时后重试传同一个,daemon 返回第一次的结果、不开第二个会话;已派发 20 次 → `invalid`(`data.reason = 'too_many_sessions'`);
270
+ * 项目不存在 / 项不存在 → `not_found`;自报了 `mcp` 的本机连接 → `forbidden`;会话建不起来时这一项原样不变。
271
+ * `workspace` 缺省时能开 worktree 的项目用新的 worktree,否则在项目目录里(没有隔离)。
272
+ */
273
+ dispatch: (params: Omit<TodoDispatchParams, "message_id"> & {
274
+ message_id?: string;
275
+ }) => Promise<TodoDispatchResult>;
276
+ /**
277
+ * `todo.dispatch_preview`:此刻 `dispatch` 会发出的第一条消息,一字不差(不开会话、不审计、不发推送通知;唯一的副作用是先把排着的结果记进「经过」,和 `dispatch` 之前的那一步一样)。
278
+ * `no_push` 缺省 `true`。项不存在 → `not_found`,已关闭 → `invalid`(`data.reason = 'closed'`),自报了 `mcp` 的本机连接 → `forbidden`。
279
+ */
280
+ dispatchPreview: (params: TodoDispatchPreviewParams) => Promise<TodoDispatchPreviewResult>;
281
+ /**
282
+ * `todo.repeat_now`(docs/spec/daemon.md § 26.9):现在执行一次周期项,得到新复制出的一项;不动周期项的下一次时间。节点 `capabilities.todo_repeat_interval` 为 true 才有。
283
+ * 项不存在 → `not_found`;不是周期项 / 已关闭 / 未收下 / 上一份还没关闭 → `invalid`(`data.reason` = `not_template` / `closed` / `unreviewed` / `previous_open`,最后一种带 `data.todo_id`);
284
+ * 清单满了 → `invalid`(`data.reason = 'too_many'`);自报了 `mcp` 的本机连接 → `forbidden`。
285
+ */
286
+ repeatNow: (id: string) => Promise<Todo>;
287
+ /**
288
+ * `todo.repeat_preview`(docs/spec/daemon.md § 26.11):周期项(模板)复制出来的下一项交给 Twin 时会发出的第一条消息,`segments`
289
+ * 按来源分段(`title` / `body` 是人写的,其余是 daemon 加的);和真正派发同一个组装函数。`keep_state` / `state_hint_off` 给了就代替
290
+ * 模板上存着的值(还没保存的开关);`no_push` 缺省 `true`。`state_usage_text` 是用模板 id 写的「抄进正文」版本。
291
+ * 节点 `capabilities.todo_repeat_state` 为 true 才有。不是周期项 → `invalid`(`data.reason = 'not_template'`);自报了 `mcp` 的连接 → `forbidden`。
292
+ */
293
+ repeatPreview: (params: TodoRepeatPreviewParams) => Promise<TodoRepeatPreviewResult>;
294
+ /**
295
+ * 周期项的跨次状态(`todo.state_*`,docs/spec/daemon.md § 26.11;节点 `capabilities.todo_repeat_state` 为 true 才有)。`id` 是模板或它复制出来的
296
+ * 某一项,两者读写模板的同一份。键:非空、≤ 200 字节、不含控制字符;值:≤ 1 KiB。错误:不是周期项也不是它的复制 → `invalid`
297
+ * (`data.reason = 'not_repeating'`);模板已删除 → `'template_gone'`;模板没开 `keep_state` → `'state_off'`;`origin_session`
298
+ * 不是这个模板的某次复制派出的会话 → `forbidden`(`'origin_session'`)。键和值是用户内容,按不可信内容显示。
299
+ */
300
+ stateGet: (id: string, key: string) => Promise<RepeatStateGetResult>;
301
+ /** `todo.state_set`:写一个键(已有就覆盖);满 2 000 条时淘汰最久没被写过的(`evicted`)。`value` 缺省空串。 */
302
+ stateSet: (id: string, key: string, value?: string) => Promise<RepeatStateSetResult>;
303
+ /** `todo.state_delete`:删一个键;没存着时 `deleted = false`,不是错误。 */
304
+ stateDelete: (id: string, key: string) => Promise<RepeatStateDeleteResult>;
305
+ /** `todo.state_list`:按键从小到大翻页(`after` 填上一页最后一条的 `key`;`limit` 缺省 200、上限 1000),`prefix` 过滤;`total` 是总条数,`matched` 是匹配前缀的条数。 */
306
+ stateList: (params: RepeatStateListParams) => Promise<RepeatStateListResult>;
307
+ /** `todo.state_unseen`:给一组键(≤ 2 000 个),返回其中没存着的(按给的顺序、去重)。 */
308
+ stateUnseen: (id: string, keys: string[]) => Promise<RepeatStateUnseenResult>;
309
+ /** `todo.state_clear`:清空这个模板的全部状态(开关关着时也能清)。只由人调用:自报 `mcp` 的连接 → `forbidden`。 */
310
+ stateClear: (id: string) => Promise<RepeatStateClearResult>;
311
+ /** `todo.history`:这一项的「经过」,按 `seq` 从新到旧;`has_more` 时用最后一条的 `seq` 作为 `before_seq` 取下一页(`limit` 缺省 50、上限 200)。 */
312
+ history: (params: TodoHistoryParams) => Promise<TodoHistoryResult>;
313
+ };
314
+ /**
315
+ * 节点上的决策档案(`rule.*`,docs/spec/daemon.md § 23;节点 `capabilities.rules` 为 true 才有,旧节点 → `RpcError`,`unsupported`):
316
+ * 用户自己的做法,生效的规则注入派发出去的会话的系统提示。规则只影响 agent 怎么判断,不影响任何权限。薄封装:不做离线缓存,也不重放。
317
+ * 规则的文字是用户内容,经过 `rule.add` 进来的、agent 写的文字会进之后每个会话的系统提示:生效之前要人确认。
318
+ */
319
+ readonly rules: {
320
+ /** 提炼会话里新的决策点;points 为 0 时没有 run,否则按 run.id 等 rule_extract_done。 */
321
+ extract: (sessionId: string) => Promise<RuleExtractResult>;
322
+ /** 最近的提炼记录与今天所有判断位置合计的调用次数;省略 limit 时为 20。 */
323
+ extractRuns: (options?: {
324
+ sessionId?: string;
325
+ limit?: number;
326
+ }) => Promise<{
327
+ runs: ExtractRun[];
328
+ usedToday: number;
329
+ dailyCalls: number;
330
+ }>;
331
+ /**
332
+ * `rule.list`:全部规则(总数上限 300,不翻页),按创建时间从早到晚;`status` / `project` 过滤(`project` 不含全节点规则)。
333
+ * `budget` 是注入的字数预算(只算生效的规则,不随过滤条件变):一个这个项目的会话拿到的规则文字是 `node_bytes + projects[项目]`,上限 `cap`。
334
+ */
335
+ list: (params?: RuleListParams) => Promise<RuleListResult>;
336
+ /**
337
+ * `rule.add`。`id` 缺省时 SDK 生成一个 UUID(小写带连字符);超时后要重试就传同一个:`id` 已经存在时 daemon 原样返回已有的那一条。
338
+ * `sync` 缺省 `node`;`group` 仅允许非待确认的全节点规则。SDK 只写当前节点,不负责跨节点同步。
339
+ * `status` 缺省 `active`;`agent: true`(调用方自报是 agent)或来自自报了 `mcp` 的本机连接时,状态强制为 `pending`、来源强制为 `agent`。
340
+ * 文字为空 / 超过 600 个码点 / 含换行以外的控制字符、总数已满 300(`reason = 'too_many'`)、
341
+ * 生效后会超出注入的字数上限(`reason = 'over_budget'`,`bytes` 和 `cap` 是这次改动之后的字节数和上限)→ `RpcError`(`invalid`)。
342
+ */
343
+ add: (params: Omit<RuleAddParams, "id"> & {
344
+ id?: string;
345
+ }) => Promise<Rule>;
346
+ /**
347
+ * `rule.update`:只带要改的字段;`clear` 列出要清空的可选字段(`project`)。没有任何字段真的变了就是空操作。
348
+ * `if_updated_ms` 给了而和现在的不同 → `RpcError`(`invalid`,`reason = 'changed'`,`updatedMs` 是现在的值)。
349
+ * 变成生效、或者改了生效的规则的文字 / 项目而超出字数上限 → `over_budget`。规则不存在 → `not_found`;
350
+ * 自报了 `mcp` 的本机连接 → `forbidden`。
351
+ * `stale: false` 恢复一条过期的规则(`Rule.stale`:生效的规则 60 天没被用到,daemon 标上它;过期的不注入、不计字数预算),
352
+ * 和变成生效一样过字数检查,超出 → `over_budget`;`stale: true` → `invalid`(`field = 'stale'`),过期只由 daemon 标。
353
+ */
354
+ update: (params: RuleUpdateParams) => Promise<Rule>;
355
+ /** `rule.delete`:物理删除;`ifUpdatedMs` 的语义同 `update`。规则不存在 → `not_found`;自报了 `mcp` 的本机连接 → `forbidden`。 */
356
+ delete: (id: string, opts?: {
357
+ ifUpdatedMs?: number;
358
+ }) => Promise<void>;
359
+ /** `rule.preview`:现在开一个这个项目的会话(缺省:不属于任何项目的会话)会注入的那段文字、用到的规则和它的字节数。只读。 */
360
+ preview: (params?: RulePreviewParams) => Promise<RulePreviewResult>;
361
+ };
362
+ readonly twin: {
363
+ get: (params?: TwinGetParams) => Promise<TwinGetResult>;
364
+ set: (params: TwinSetParams) => Promise<TwinGetResult>;
365
+ wake: () => Promise<void>;
366
+ dryRun: (options?: RequestOptions) => Promise<TwinDryRunResult>;
367
+ runs: (params?: TwinRunsParams) => Promise<TwinRunsResult>;
368
+ stats: (params?: TwinStatsParams) => Promise<TwinStatsResult>;
369
+ questions: (params?: TwinQuestionsParams) => Promise<TwinQuestionsResult>;
370
+ answer: (params: TwinAnswerParams) => Promise<TwinQuestion>;
371
+ link: (params: TwinLinkParams) => Promise<TwinLink>;
372
+ links: () => Promise<TwinLinksResult>;
373
+ unlink: (params: TwinUnlinkParams) => Promise<void>;
374
+ peerStatus: () => Promise<TwinPeerStatus>;
375
+ };
376
+ /** `node.twin_link_code`:在被使用的节点上开一次只接受 Twin 设备的短码配对(10 分钟);短码是秘密,只交给 `twin.link`。 */
377
+ twinLinkCode(): Promise<NodeTwinLinkCodeResult>;
218
378
  readonly permissions: {
219
379
  /** 未决的权限请求(重连后先拉一次)。 */
220
380
  list: (sessionId?: string) => Promise<PermissionRequest[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EAEnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,qBA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