@te-river/opencode-team-mode 1.6.1 → 1.6.2
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 +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/host/note.d.ts.map +1 -1
- package/dist/host/note.js +8 -5
- package/dist/host/note.js.map +1 -1
- package/dist/host/v2-capabilities.d.ts +10 -0
- package/dist/host/v2-capabilities.d.ts.map +1 -1
- package/dist/host/v2-capabilities.js +27 -0
- package/dist/host/v2-capabilities.js.map +1 -1
- package/dist/host/v2-session-client.d.ts +38 -7
- package/dist/host/v2-session-client.d.ts.map +1 -1
- package/dist/host/v2-session-client.js +245 -26
- package/dist/host/v2-session-client.js.map +1 -1
- package/dist/host/v2.d.ts.map +1 -1
- package/dist/host/v2.js +150 -3
- package/dist/host/v2.js.map +1 -1
- package/dist/prompts/lead.d.ts +1 -1
- package/dist/prompts/lead.d.ts.map +1 -1
- package/dist/prompts/lead.js +6 -2
- package/dist/prompts/lead.js.map +1 -1
- package/dist/prompts/shared.d.ts +1 -1
- package/dist/prompts/shared.d.ts.map +1 -1
- package/dist/prompts/shared.js +8 -1
- package/dist/prompts/shared.js.map +1 -1
- package/dist/tm/dispatch.d.ts +39 -1
- package/dist/tm/dispatch.d.ts.map +1 -1
- package/dist/tm/dispatch.js +135 -13
- package/dist/tm/dispatch.js.map +1 -1
- package/dist/tm/stats.d.ts +19 -0
- package/dist/tm/stats.d.ts.map +1 -1
- package/dist/tm/stats.js +128 -14
- package/dist/tm/stats.js.map +1 -1
- package/docs/installation-v2.md +17 -8
- package/docs/v2-port-notes.md +413 -315
- package/package.json +1 -1
- package/scripts/lib/fake-ctx.mjs +169 -146
package/README.md
CHANGED
|
@@ -280,7 +280,7 @@ through with `tm_fetch` when it genuinely needs the payload.
|
|
|
280
280
|
| `tm_search` | Multi-engine web search with extracted, deduplicated, RRF-fused hit lists | Lead + Researcher |
|
|
281
281
|
| `tm_webfetch` | Single governed GET of an allowlisted page (search pages auto-extracted). Manual redirects, re-checked per hop, and a refusal names the WHOLE chain (`跳转链: a → b(停在第 2 跳)`) — an allowlisted shortener that bounces off-site used to report only the off-site host, which read as "that site will not fetch" and sent the agent back to retry the entry URL it had just watched fail. A 429/503 carries its own `Retry-After` when the server sends delta-seconds (an HTTP-date is deliberately not laundered into a countdown), so "come back later" never looks like "no content here". The page GET also asks for Markdown first (`Accept: text/markdown,…`) — measured on `learn.microsoft.com`: 60,778 B of HTML becomes 11,449 B of Markdown, and every other host tried returns the same document either way, so the preference is free where it is ignored | Lead + Researcher |
|
|
282
282
|
| `tm_ledger` | **The lead's task ledger** (`add` / `doing` / `done` / `blocked` / `list`), stored in the host's own `ctx.storage` per session — the landing spot for the LEDGER rule on OpenCode 2.x, which gives a plugin no `todowrite`. A repeated ask is ONE item, an id that matches two is refused with both printed, `blocked` carries the reason, and a write that did not reach storage is reported as a failure rather than as recorded. **v2 only** — v1 keeps the host's `todowrite` | Lead only |
|
|
283
|
-
| `tm_join` | **Sub-agent collection** — there is no plugin-side dispatcher any more (`tm_dispatch` is removed: a child a plugin creates is a session the user can neither open nor stop from the interface). Delegation goes through the host's own `task` / `task { background: true }`, and `tm_join` is the read side: a status snapshot, a bounded `waitMs`, `cancel:true` to
|
|
283
|
+
| `tm_join` | **Sub-agent collection** — there is no plugin-side dispatcher any more (`tm_dispatch` is removed: a child a plugin creates is a session the user can neither open nor stop from the interface). Delegation goes through the host's own `task` / `task { background: true }`, and `tm_join` is the read side: a status snapshot, a bounded `waitMs`, `cancel:true` to stop a runaway, and `claimNamedChild` so `tm_join { ids: ["ses_…"] }` pulls one child's WHOLE reply back through the offload pipeline (handle + ≤80-token preview) instead of kilotokens inline. It also rebuilds its registry from the host session tree after a restart, so leftover children are 接管 rather than lost. **On 2.x it also registers the children the host's own `subagent` tool created** (the ack's `metadata.sessionID` is the seam), so a background dispatch is never reported as "nothing to collect" while the user watches it run — and such a row says where its reply actually arrives (the host's injected message) and whether it settled by event or by inference. **Stopping one is a real call on both hosts:** `cancel: true` goes to `client.session.abort` on 1.18.x and to the host's `POST /api/session/{id}/interrupt` on 2.x (`tm_join { ids: ["ses_…"], cancel: true }` stops ONE named child; without `ids` it stops every still-running one). The host's own contract is `interrupted=true` for an active execution and `false` for the idle no-op, so the answer comes back as **five distinct verdicts** — 已由宿主中断 / 空闲未中断(it wasn't running: our row was stale, not failed)/ 未确认(the call worked, no boolean came back)/ 无中断缝 / 被宿主拒绝(with the host's reason) — counted in the reply and written to the trajectory (`stop_tried` / `stop_confirmed` / `stop_refused` / `stop_unknown`, readable via `tm_stats`). It will not summarise five different facts as one "已取消", and `resume` is never sent, because resuming pending steering is the opposite of cancelling. *(On `main` only — the published 1.6.1 still answers 宿主无 abort 接口 on 2.x.)* | Lead only |
|
|
284
284
|
| `tm_pty` (**v1 only** — v2 registers nothing: the plugin ctx has no pty domain) | **Non-blocking command execution** on the host's own terminal sessions (`start`/`status`/`list`/`kill`) — independent builds and test suites overlap instead of queueing behind one 120 s bash call. Captures no output (the command tees its own log; read it with `tm_read`), and every start passes the R6 classifier, the R2 danger-face globs **and** the official confirmation dialog before a process exists | Lead only |
|
|
285
285
|
| `tm_stats` | **The plugin reads its own trajectory back**: tokens kept out of the context window by offloading (net of the preview that arrived), seconds saved by dispatch overlap (serial cost minus the wall window the children actually used), PTC internals, governance counts (blocked subresources, refused `tm_pty` starts, clamped bash timeouts, cache hits, redactions) — plus the **host capability matrix** (`已验证/存在未用/待观察/缺失/需人眼` per host surface). Read-only over files this plugin wrote; run it first after an OpenCode upgrade. `{ recent: 20 }` appends a call-by-call recap — handle + payload path for every offloaded result, which is how you see what a governed tool actually returned (the host gives plugin tools no expandable card) | All agents |
|
|
286
286
|
| `tm_browser` | Interactive browser session (**your default browser**): 18 Playwright verbs (snapshot-first `take_snapshot` → uid-addressed `click`/`fill`/`drag`/…, **including multi-tab `new_page` / `close_page`** so you can hold two pages at once) + 5 legacy compat verbs (open/navigate/read/screenshot/close); Playwright engine needs Node ≥ 20, below that (or on any import failure) it auto-degrades to the legacy CDP engine. It drives YOUR default browser channel (an Edge Beta default opens Edge Beta), stays headful unless the operator sets `TM_BROWSER_HEADLESS`, loads a page's own images/CSS/JS via the `same-site` subresource policy, and `take_screenshot { image:true }` attaches a JPEG so the model can actually see the screen. **One browser per agent**: `open` returns an id (`b1`) and every reply is tagged with it — that window, its uid numbering and its dialog-approved hosts belong to YOUR session; another agent's id is refused with the owner named (an id is a name, not a key), and `close { id:"all" }` closes only your own. `click` reports what the PAGE did, not merely that a mouse event was sent: it reads the target's observable state before and after (`aria-expanded`, URL, DOM node count) and answers `已点击 … · aria-expanded: false → true`, retries once if the page had not finished loading — the measured cause of a click that lands on a node with no handler — and says 页面没有任何可观测变化 rather than implying success. `close` will not say 已确认关闭 until the browser's OS process is gone — it waits on the pid, terminates it once if it lingers, and prints the pid either way, because a dropped connection is not a closed browser; when no pid could be resolved it says 进程未核验 rather than borrowing that sentence. A browser this process launched but could not reap is recorded in a per-workspace ledger (pid, owner pid, executable) and reclaimed by the next boot — only entries whose owner process is dead *and* whose pid still is that executable, terminated as a whole tree (`taskkill /T` on Windows), never another window's live tab. **A blank page now explains itself**: `same-site` cannot know that a site's own bundle lives on a brand-unrelated CDN (Baidu serves its scripts from `bdimg.com`), so when a page comes back with `0 个可寻址节点` while a script host was blocked, the reply says the blankness is **our gate**, names the host, and offers `allow_host { host }` — one official dialog for one bare domain, for your browser only, for this session, nothing written to config (re-navigate afterwards, the gate decides per request). A page that is really a human-verification wall (百度安全验证 / Cloudflare / access denied) is reported as a wall, because the move there is another source, not another retry | Lead + Researcher + Tester (UI verification) |
|
package/README.zh-CN.md
CHANGED
|
@@ -268,7 +268,7 @@ HMAC 句柄,agent 真需要 payload 时用 `tm_fetch` 分页取。
|
|
|
268
268
|
| `tm_search` | 多引擎网络搜索,返回提取、去重、RRF 融合后的命中列表 | Lead + Researcher |
|
|
269
269
|
| `tm_webfetch` | 白名单页面的单次受治理 GET(搜索页自动提取)。重定向逐跳手动过检,被拒时会把**整条链**报出来(`跳转链: a → b(停在第 2 跳)`)——以前只会报最后一个主机,一个在白名单内的短链跳到站外时,读起来像"这个站点抓不到",于是 agent 又回去重试它刚眼睁睁失败的入口 URL。429/503 若带 delta-seconds 的 `Retry-After` 会一并报出(HTTP-date 形式刻意不折算成倒计时),所以"待会儿再来"不会被当成"这里没东西"。读页面时还会优先要 Markdown(`Accept: text/markdown,…`)——实测 `learn.microsoft.com`:60 778 B 的 HTML 变成 11 449 B 的 Markdown,其余站点两种请求返回同一份文档,所以在不支待的地方这个偏好是零成本的 | Lead + Researcher |
|
|
270
270
|
| `tm_ledger` | **领队的任务清单**(`add` / `doing` / `done` / `blocked` / `list`),存在宿主自己的 `ctx.storage` 里、按会话分开——OpenCode 2.x 不给插件 `todowrite`,LEDGER 规则从此有了落点。同一个要求重复提出只算一条;编号撞上两条会拒绝并把两条都列出来;`blocked` 带上卡住的原因;写不进存储就报失败,不会说成「已记录」。**仅 v2**——v1 继续用宿主的 `todowrite` | 仅领队 |
|
|
271
|
-
| `tm_join` | **子代理回收**——插件侧的派发器已经没有了(`tm_dispatch` 被移除:插件创建的子会话,用户既打不开也停不掉)。派活统一走宿主自己的 `task` / `task { background: true }`,`tm_join` 是它的读端:不带参数=状态快照,`waitMs`=有界等待,`cancel:true` 取消跑飞的子任务,`tm_join { ids: ["ses_…"] }` 则把某个子代理的**整篇**回复经卸载管线取回(句柄 + ≤80 token 预览),而不是几千 token 直接压进上下文。插件重启后它还会从宿主会话树重建登记,遗留的子代理被"接管"而不是丢失。**2.x 上它还会登记宿主自己的 `subagent` 工具派出去的子会话**(凭据就是那句确认里的 `metadata.sessionID`),所以用户明明在屏幕上看着子代理跑、`tm_join` 却说"没有待收集的派发"
|
|
271
|
+
| `tm_join` | **子代理回收**——插件侧的派发器已经没有了(`tm_dispatch` 被移除:插件创建的子会话,用户既打不开也停不掉)。派活统一走宿主自己的 `task` / `task { background: true }`,`tm_join` 是它的读端:不带参数=状态快照,`waitMs`=有界等待,`cancel:true` 取消跑飞的子任务,`tm_join { ids: ["ses_…"] }` 则把某个子代理的**整篇**回复经卸载管线取回(句柄 + ≤80 token 预览),而不是几千 token 直接压进上下文。插件重启后它还会从宿主会话树重建登记,遗留的子代理被"接管"而不是丢失。**2.x 上它还会登记宿主自己的 `subagent` 工具派出去的子会话**(凭据就是那句确认里的 `metadata.sessionID`),所以用户明明在屏幕上看着子代理跑、`tm_join` 却说"没有待收集的派发"这种事不会再发生;这类行同时说清自己的正文是从哪儿到的(宿主的注入消息),以及它是靠事件结算的还是靠推断结算的。**停掉一个也是真调用**:1.18.x 走 `client.session.abort`,2.x 走宿主自己的 `POST /api/session/{id}/interrupt`(`tm_join { ids: ["ses_…"], cancel: true }` 停指定的那一个,不带 `ids` 就停所有还在跑的)。宿主给这个端点写下的契约是"活动执行被中断返回 interrupted=true,空闲时是 no-op 返回 false",所以回话刻意分成**五种裁决**:已由宿主中断 / 空闲未中断(它当时没在跑——是我们的登记行过时了,不是失败)/ 未确认(调用成功了但宿主没回布尔)/ 无中断缝 / 被宿主拒绝(带上宿主自己的原因),既在回复里计数,也写进轨迹(`stop_tried` / `stop_confirmed` / `stop_refused` / `stop_unknown`,可用 `tm_stats` 读回)。五个不同的事实不会被压成一句"已取消";`resume` 也刻意从不发送,因为"中断后继续消化排队的引导输入"和"取消"正好相反。*(这项能力目前只在 `main` 上:已发布的 1.6.1 在 2.x 上仍然回一句"宿主无 abort 接口,未取消"。)* | 仅 Lead |
|
|
272
272
|
| `tm_pty`(**仅 v1**——v2 不注册:插件上下文没有 pty 域)| 在宿主自己的终端会话上**非阻塞执行命令**(`start`/`status`/`list`/`kill`):独立的构建与测试各自一个会话并行跑,不再串成一条 120 秒的 bash 调用。它不抓输出(命令自己 tee 日志,用 `tm_read` 读),且每次启动都先过 R6 分类器、R2 危险面 glob,再走官方确认窗,才真的建进程 | 仅 Lead |
|
|
273
273
|
| `tm_stats` | **插件把自己的 trajectory 读回来**:卸载挡在上下文之外的 token(扣掉确实回来的预览)、派发重叠省下的秒数(串行代价减去子代理实际占用的墙钟)、PTC 内部量、治理计数(被拦子资源、`tm_pty` 拒绝、bash 超时夹顶、缓存命中、脱敏次数)——外加**宿主能力矩阵**(每个宿主接口标 `已验证/存在未用/待观察/缺失/需人眼`)。只读本插件自己写的文件;OpenCode 升级后第一个跑它。`{ recent: 20 }` 追加一份逐条调用清单——每次卸载结果的句柄和落盘路径都在里面,这就是"看看刚才那个工具到底返回了什么"的办法(宿主不给插件工具卡片留展开位) | 全角色 |
|
|
274
274
|
| `tm_browser` | 交互式浏览器会话(**驱动你的默认浏览器**):18 个 Playwright 动词(快照优先:`take_snapshot` → 按 uid 寻址的 `click`/`fill`/`drag`…,**并新增多标签页 `new_page` / `close_page`**,可同时持有两个页面)+ 5 个旧版兼容动词(open/navigate/read/screenshot/close);Playwright 引擎需 Node ≥ 20,不满足或导入失败时自动降级到旧版 CDP 引擎。它开的是**你自己的默认浏览器渠道**(默认装 Edge Beta 就开 Beta),除操作者设 `TM_BROWSER_HEADLESS` 外保持有头;页面自家图片/CSS/JS 靠 `same-site` 子资源策略正常加载;`take_screenshot { image:true }` 会附一张 JPEG,让模型真能看见画面。**一个 agent 一个浏览器**:`open` 返回一个 id(`b1`),之后每条回复都带着它——那个窗口、它的 uid 编号、它经对话框批准过的主机,都属于**你的**会话;用别人的 id 会被拒绝并点名属主(id 是名字,不是钥匙),`close { id:"all" }` 只关你自己的。`click` 报的是**页面做了什么**,而不只是"我发出了鼠标事件":它点击前后各读一次目标的可观测状态(`aria-expanded`、URL、DOM 节点数),回答形如 `已点击 … · aria-expanded: false → true`;页面还没加载完时会有界重试一次——这正是实测中"点击落在没有 handler 的节点上"的成因;仍然没有变化就说"页面没有任何可观测变化",而不是暗示成功。`close` 在浏览器的操作系统进程真正退出之前不会说“已确认关闭”——它等 pid、必要时补一次终止,两种结果都会把 pid 写在回复里,因为连接断开不等于浏览器关了;万一拿不到 pid,它会说“进程未核验”,而不是借用那句已确认。本进程启动过却没能收掉的浏览器会记进按工作区隔离的账本(pid、属主 pid、可执行文件),由下一次启动回收——只回收属主进程已死**且**该 pid 现在仍是那个可执行文件的条目,并按整棵进程树终止(Windows 上 `taskkill /T`),绝不动另一个窗口的活标签。**空白页现在会自己解释原因**:`same-site` 无从知道一个站点把自己的脚本包放在与品牌无关的 CDN 上(百度把脚本发在 `bdimg.com`),所以当一页返回 `0 个可寻址节点` 而同时有脚本域名被拦时,回复会直接说明这片空白是**我们的门禁**造成的、点名该域名,并给出 `allow_host { host }`——一个域名一次官方确认窗,只对你的浏览器、只在本次会话,不写任何配置文件(批准后要重新导航,门禁在请求时判定)。而真的需要人工验证的页面(百度安全验证 / Cloudflare / access denied)会被说成一道验证墙,因为对它的正确动作是换来源,不是再试一次 | Lead + Researcher + Tester(仅 UI 验证) |
|
package/dist/host/note.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../src/host/note.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../src/host/note.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwBpE"}
|
package/dist/host/note.js
CHANGED
|
@@ -13,14 +13,17 @@ export function blackboardNote(root, ttlDays) {
|
|
|
13
13
|
` skeleton) are the PRIMARY transport — normal work needs no files at all.`,
|
|
14
14
|
`- Board files exist ONLY for oversized deliverables (>~50 lines), and they`,
|
|
15
15
|
` go through \`tm_board_write { task, topic, content, session? }\` — the board's`,
|
|
16
|
-
` write side, carried by every role including the ones with no file
|
|
17
|
-
`
|
|
18
|
-
`
|
|
16
|
+
` write side, carried by every role including the ones with no write-capable file`,
|
|
17
|
+
` tool. Where your tool list does not name it, the Code Mode catalog holds it:`,
|
|
18
|
+
` \`execute\` → \`tools.tm_board_write({ task, topic, content })\`. Never hand-write`,
|
|
19
|
+
` the file — the writer is what places`,
|
|
20
|
+
` \`<root>/<session-key>/<task-slug>/NN-<role>-<topic>[-rN].md\`, never overwrites,`,
|
|
21
|
+
` and answers with the PATH (never the content).`,
|
|
19
22
|
` On the FIRST board write of this conversation pass a session folder made from`,
|
|
20
23
|
` a compact clock timestamp (PowerShell: \`Get-Date -Format yyyyMMdd-HHmmss\`;`,
|
|
21
24
|
` POSIX: \`date +%Y%m%d-%H%M%S\`) and reuse it for every later task; omit it and`,
|
|
22
|
-
` the tool stamps one — that is how a role with no
|
|
23
|
-
` all. Never write into another conversation's session folder.`,
|
|
25
|
+
` the tool stamps one — that is how a role with no command shell reaches the`,
|
|
26
|
+
` board at all. Never write into another conversation's session folder.`,
|
|
24
27
|
`- Auto-cleanup: the plugin sweeps task directories idle for more than ${ttlDays} days (at startup and hourly).`,
|
|
25
28
|
` This is the ONLY cleanup path — never delete task or session directories yourself.`,
|
|
26
29
|
].join("\n");
|
package/dist/host/note.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../src/host/note.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,OAAe;IAC1D,OAAO;QACL,EAAE;QACF,EAAE;QACF,kDAAkD;QAClD,qBAAqB,IAAI,IAAI;QAC7B,oFAAoF;QACpF,4EAA4E;QAC5E,4EAA4E;QAC5E,kFAAkF;QAClF
|
|
1
|
+
{"version":3,"file":"note.js","sourceRoot":"","sources":["../../src/host/note.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,OAAe;IAC1D,OAAO;QACL,EAAE;QACF,EAAE;QACF,kDAAkD;QAClD,qBAAqB,IAAI,IAAI;QAC7B,oFAAoF;QACpF,4EAA4E;QAC5E,4EAA4E;QAC5E,kFAAkF;QAClF,mFAAmF;QACnF,iFAAiF;QACjF,uFAAuF;QACvF,wCAAwC;QACxC,qFAAqF;QACrF,kDAAkD;QAClD,iFAAiF;QACjF,gFAAgF;QAChF,kFAAkF;QAClF,8EAA8E;QAC9E,0EAA0E;QAC1E,yEAAyE,OAAO,gCAAgC;QAChH,sFAAsF;KACvF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
|
|
@@ -62,6 +62,16 @@ interface Inputs {
|
|
|
62
62
|
unknown: Record<string, number>;
|
|
63
63
|
stopped?: string;
|
|
64
64
|
};
|
|
65
|
+
/** #33 — what `tm_join { cancel: true }` actually got from `ctx.session.interrupt`.
|
|
66
|
+
* Absent means the bridge never wrapped the seam, which is itself the row's story:
|
|
67
|
+
* for a whole release v2 had no stop path at all, and nothing printed that fact. */
|
|
68
|
+
stop?: {
|
|
69
|
+
tried: number;
|
|
70
|
+
confirmed: number;
|
|
71
|
+
refused: number;
|
|
72
|
+
unknown: number;
|
|
73
|
+
error?: string;
|
|
74
|
+
};
|
|
65
75
|
}
|
|
66
76
|
export declare function v2CapabilityRows(i: Inputs): CapabilityRow[];
|
|
67
77
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-capabilities.d.ts","sourceRoot":"","sources":["../../src/host/v2-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;;;;;;;;;;;;;;GAeG;AAEH,UAAU,MAAM;IACd,GAAG,EAAE,OAAO,CAAA;IACZ,KAAK,EAAE;QACL,MAAM,EAAE;YACN,UAAU,EAAE,MAAM,EAAE,CAAA;YACpB,YAAY,EAAE,MAAM,EAAE,CAAA;YACtB,QAAQ,EAAE,MAAM,EAAE,CAAA;YAClB,aAAa,EAAE,MAAM,EAAE,CAAA;YACvB,OAAO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OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9F;AAID,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,CA6K3D"}
|
|
@@ -123,6 +123,33 @@ export function v2CapabilityRows(i) {
|
|
|
123
123
|
: ""),
|
|
124
124
|
},
|
|
125
125
|
];
|
|
126
|
+
// #33 — can the lead STOP a background child at all? Before this the answer was "no",
|
|
127
|
+
// and no row said so: tm_join's cancel:true fell through to 宿主无 abort 接口 in a tool
|
|
128
|
+
// reply only the model sees, so a user asking "kill it" got silence from the panel and
|
|
129
|
+
// the plugin's own capability table claimed nothing about it.
|
|
130
|
+
rows.push({
|
|
131
|
+
seam: "ctx.session.interrupt",
|
|
132
|
+
feature: "tm_join { cancel: true } 停掉跑飞的后台子代理",
|
|
133
|
+
// `ok` requires the host to have confirmed a stop with interrupted=true. attempted-but-
|
|
134
|
+
// never-confirmed is `declared`: the seam is wired, nobody has exercised it. An absent
|
|
135
|
+
// interrupt domain is `missing`, which is the honest row for "this host gave no stop
|
|
136
|
+
// path" and the only way a future upgrade that drops it becomes a line rather than a
|
|
137
|
+
// rumour.
|
|
138
|
+
state: !i.stop
|
|
139
|
+
? "declared"
|
|
140
|
+
: i.stop.confirmed > 0
|
|
141
|
+
? "ok"
|
|
142
|
+
: i.stop.tried > 0
|
|
143
|
+
? "declared"
|
|
144
|
+
: domains.includes("session")
|
|
145
|
+
? "declared"
|
|
146
|
+
: "missing",
|
|
147
|
+
evidence: i.stop && i.stop.confirmed > 0 ? "runtime" : "static",
|
|
148
|
+
note: i.stop && i.stop.tried
|
|
149
|
+
? `已试 ${i.stop.tried} 次:宿主确认中断 ${i.stop.confirmed} · idle no-op ${i.stop.refused} · 未回布尔 ${i.stop.unknown}` +
|
|
150
|
+
(i.stop.error ? `(最后一次宿主错误:${i.stop.error})` : "")
|
|
151
|
+
: "缝已接上(POST /api/session/{id}/interrupt 的契约是 interrupted=true / false=idle no-op),本进程还没被 cancel:true 用过",
|
|
152
|
+
});
|
|
126
153
|
if (typeof i.temperature === "number") {
|
|
127
154
|
rows.push({
|
|
128
155
|
seam: "options.temperature",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-capabilities.js","sourceRoot":"","sources":["../../src/host/v2-capabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"v2-capabilities.js","sourceRoot":"","sources":["../../src/host/v2-capabilities.ts"],"names":[],"mappings":"AAqDA,MAAM,GAAG,GAAG,CAAC,IAAuB,EAAE,IAA4B,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEtF,MAAM,UAAU,gBAAgB,CAAC,CAAS;IACxC,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAA;IACzC,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAA;IAC3C,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;IACtE,MAAM,IAAI,GAAoB;QAC5B;YACE,IAAI,EAAE,yBAAyB;YAC/B,OAAO,EAAE,gDAAgD;YACzD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;YACxF,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM;gBACpC,CAAC,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CA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AQ,EAAE,SAAS;YACnB,IAAI,EAAE,cAAc,CAAC,CAAC,WAAW,EAAE;SACpC,CAAC,CAAA;IACJ,CAAC;IACD,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,IAAI,CAAC;YACR,IAAI,EAAE,wBAAwB;YAC9B,OAAO,EAAE,yBAAyB;YAClC,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,sDAAsD;SAC7D,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -56,19 +56,50 @@ export interface V2SessionReaderReport {
|
|
|
56
56
|
contextError?: string;
|
|
57
57
|
/** the KEY NAMES the context call returned (names only, never values) */
|
|
58
58
|
contextKeys: string[];
|
|
59
|
+
/** `ctx.session.interrupt` calls made by `tm_join { cancel: true }` (#33) */
|
|
60
|
+
interruptTried: number;
|
|
61
|
+
/** the host confirmed an active execution was interrupted (`interrupted: true`) */
|
|
62
|
+
interruptConfirmed: number;
|
|
63
|
+
/** the host answered `interrupted: false` — the documented idle no-op, i.e. NOT a stop */
|
|
64
|
+
interruptRefused: number;
|
|
65
|
+
/** the call succeeded and carried no `interrupted` boolean at all */
|
|
66
|
+
interruptUnknown: number;
|
|
67
|
+
interruptError?: string;
|
|
68
|
+
/** the KEY NAMES the interrupt call returned (names only, never values) */
|
|
69
|
+
interruptKeys: string[];
|
|
70
|
+
/** the SHAPE of the last list the seam answered with — names and counts only, and the
|
|
71
|
+
* reason a `child_body_missing` row can be checked later (`contextShapeEvidence`). */
|
|
72
|
+
contextShape?: string;
|
|
59
73
|
}
|
|
60
74
|
export interface V2SessionReader {
|
|
61
75
|
/** a `{session:{get,messages}}` object safe to hand to code written for the v1 client */
|
|
62
76
|
client: unknown;
|
|
63
77
|
report: V2SessionReaderReport;
|
|
64
78
|
}
|
|
65
|
-
/** Turn the host's
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
79
|
+
/** Turn the host's context items into the `{info,parts}` shape the collect path already
|
|
80
|
+
* understands — HERE, at the seam that knows the shape, so nothing downstream has to guess.
|
|
81
|
+
* Three shapes are in the wild and all three are measurements, not version numbers:
|
|
82
|
+
* · 2.0.18 `[L]`: a FLAT item per message, `{id, time:{created}, text, type}`.
|
|
83
|
+
* · 2.0.20 `[L][D]`: a MESSAGE whose body is `content: (Text|Reasoning|Tool)[]` and whose
|
|
84
|
+
* kind is on `role` — the name-level probe recorded `{keys:["content","id","metadata",
|
|
85
|
+
* "role"]}`. The previous version of this function passed that item through untouched
|
|
86
|
+
* ("already message-shaped"), `lastAssistantMessage` found no `parts` and no `text` on
|
|
87
|
+
* it, and the seam answered while the body was dropped AGAIN — which is why 正文来源=
|
|
88
|
+
* never printed on 2.0.20 (A1).
|
|
89
|
+
* · v1's `[{info,parts[]}]`: passed through untouched, so a host that changes back needs
|
|
90
|
+
* no change here.
|
|
91
|
+
* Only the bag is renamed and the envelope added: the elements are already v1 part shapes
|
|
92
|
+
* (`{type:"text", text}`), and reasoning/tool parts stay exactly as the host wrote them.
|
|
93
|
+
* An empty `content` normalises to empty parts — this function MOVES text, it never
|
|
94
|
+
* manufactures any. */
|
|
72
95
|
export declare function normaliseContextMessages(list: unknown): unknown;
|
|
96
|
+
/** WHY a body came back empty, in names and counts only — never a value, a path, or a
|
|
97
|
+
* snippet of text (the R6 口径 binds a diagnostic). tm_join writes this onto the
|
|
98
|
+
* `child_body_missing` trajectory line so the three conclusions stay distinguishable:
|
|
99
|
+
* a real body (`child_body`), a seam that answered with nothing readable in it
|
|
100
|
+
* (`items=2 keys=[content+id+metadata+role] content=1 kinds=[tool] text=0`), and a seam
|
|
101
|
+
* that did not answer at all (`no-context-method`). Without it, "we read it" and "we could
|
|
102
|
+
* not read it" print the same row — goal #6's failure shape. */
|
|
103
|
+
export declare function contextShapeEvidence(list: unknown): string;
|
|
73
104
|
export declare function createV2SessionReader(ctx: unknown): V2SessionReader;
|
|
74
105
|
//# sourceMappingURL=v2-session-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-session-client.d.ts","sourceRoot":"","sources":["../../src/host/v2-session-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAA;IAChB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,yEAAyE;IACzE,WAAW,EAAE,MAAM,EAAE,CAAA;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,yFAAyF;IACzF,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,qBAAqB,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"v2-session-client.d.ts","sourceRoot":"","sources":["../../src/host/v2-session-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAA;IAChB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,yEAAyE;IACzE,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,6EAA6E;IAC7E,cAAc,EAAE,MAAM,CAAA;IACtB,mFAAmF;IACnF,kBAAkB,EAAE,MAAM,CAAA;IAC1B,0FAA0F;IAC1F,gBAAgB,EAAE,MAAM,CAAA;IACxB,qEAAqE;IACrE,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,2EAA2E;IAC3E,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB;2FACuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,yFAAyF;IACzF,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,qBAAqB,CAAA;CAC9B;AAuGD;;;;;;;;;;;;;;;wBAewB;AACxB,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CA2B/D;AAED;;;;;;iEAMiE;AACjE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAyB1D;AAMD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CA4JnE"}
|
|
@@ -64,13 +64,90 @@ function unwrap(value) {
|
|
|
64
64
|
}
|
|
65
65
|
return rec;
|
|
66
66
|
}
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
*
|
|
67
|
+
/** The message-kind values the host writes on its discriminator field — the members of the
|
|
68
|
+
* published union `Session.Message.Info`. Anything else on `type` is a PART kind and must
|
|
69
|
+
* never be read as a message kind. */
|
|
70
|
+
const MESSAGE_KINDS = ["user", "assistant", "system", "synthetic", "skill", "shell", "compaction", "idle"];
|
|
71
|
+
/** The PART kinds the host writes inside a message's `content` bag. A TOP-LEVEL item
|
|
72
|
+
* carrying one of these on `type` with no `role` is a part, not a message (the shape
|
|
73
|
+
* `{type:"tool", content:[{type:"text",…}]}` exists): renaming its bag to `parts` would
|
|
74
|
+
* hand a tool output to the collect path as an unroled assistant candidate. */
|
|
75
|
+
const PART_KINDS = ["text", "reasoning", "tool"];
|
|
76
|
+
/** The discriminator field's own value, lower-cased — "" only when the field is ABSENT
|
|
77
|
+
* (or not a string). "Present but unknown" and "absent" are two different facts, and
|
|
78
|
+
* downstream can only tell them apart if the seam keeps them apart. */
|
|
79
|
+
function rawKind(value) {
|
|
80
|
+
return typeof value === "string" ? value.trim().toLowerCase() : "";
|
|
81
|
+
}
|
|
82
|
+
function messageKind(value) {
|
|
83
|
+
const s = rawKind(value);
|
|
84
|
+
return MESSAGE_KINDS.includes(s) ? s : "";
|
|
85
|
+
}
|
|
86
|
+
/** Which kind of message an item is. The OpenAPI contract puts the discriminator on `type`;
|
|
87
|
+
* the plugin ctx measured on 2.0.20 puts it on `role` — so BOTH are read, a recognised
|
|
88
|
+
* kind first (`role` before `type`), exactly as before.
|
|
89
|
+
*
|
|
90
|
+
* A value that is PRESENT but not a known message kind is carried through verbatim
|
|
91
|
+
* (lower-cased) instead of dropped to "". This INVERTS the previous rule — "an
|
|
92
|
+
* unrecognised value yields "" and the caller leaves the role OFF instead of guessing
|
|
93
|
+
* one" — because that rule was false where it mattered: `lastAssistantMessage` skips on
|
|
94
|
+
* `if (role && role !== "assistant")`, so an EMPTY role IS an assistant candidate,
|
|
95
|
+
* exactly equivalent to guessing "assistant". A host that spelled the discriminator a
|
|
96
|
+
* value outside MESSAGE_KINDS would have had its item delivered as the child's report
|
|
97
|
+
* while the comment claimed the opposite (and while AGENTS.md's "keeps an EMPTY role …
|
|
98
|
+
* rather than guessing" described downstream semantics under which leaving it empty was
|
|
99
|
+
* the guess). Carrying the raw value makes the skip real: unknown kind ⇒ not delivered.
|
|
100
|
+
* Only when BOTH fields are absent — a bare Part[] item — does the role stay unset,
|
|
101
|
+
* which is the shape the collect path reads by the item's own `type:"text"`. */
|
|
102
|
+
function roleOfMessage(rec) {
|
|
103
|
+
const roleRaw = rawKind(rec.role);
|
|
104
|
+
const typeRaw = rawKind(rec.type);
|
|
105
|
+
return messageKind(roleRaw) || messageKind(typeRaw) || roleRaw || typeRaw;
|
|
106
|
+
}
|
|
107
|
+
/** Copy the host's own timestamps, and ONLY those. `time.completed` IS the settle verdict
|
|
108
|
+
* (AGENTS.md), so it is never invented: 2.0.20's plugin ctx carries no `time` field at all,
|
|
109
|
+
* and tm_join then settles from `event` / `injection` / 推定 — which is what it prints. */
|
|
110
|
+
function timeOfMessage(rec) {
|
|
111
|
+
const t = rec.time;
|
|
112
|
+
if (!t || typeof t !== "object")
|
|
113
|
+
return undefined;
|
|
114
|
+
const src = t;
|
|
115
|
+
const out = {};
|
|
116
|
+
const created = Number(src.created);
|
|
117
|
+
if (Number.isFinite(created))
|
|
118
|
+
out.created = created;
|
|
119
|
+
const completed = Number(src.completed);
|
|
120
|
+
if (Number.isFinite(completed))
|
|
121
|
+
out.completed = completed;
|
|
122
|
+
return Object.keys(out).length ? out : undefined;
|
|
123
|
+
}
|
|
124
|
+
/** The `{info,…}` envelope for a message item, carrying ONLY what the host actually wrote. */
|
|
125
|
+
function infoOfMessage(rec, role) {
|
|
126
|
+
const time = timeOfMessage(rec);
|
|
127
|
+
return {
|
|
128
|
+
...(role ? { role } : {}),
|
|
129
|
+
...(time ? { time } : {}),
|
|
130
|
+
// an errored assistant turn carries its reason on the item itself in these shapes;
|
|
131
|
+
// without the copy, "no reply" reads as "the agent had nothing to say"
|
|
132
|
+
...(rec.error == null ? {} : { error: rec.error }),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** Turn the host's context items into the `{info,parts}` shape the collect path already
|
|
136
|
+
* understands — HERE, at the seam that knows the shape, so nothing downstream has to guess.
|
|
137
|
+
* Three shapes are in the wild and all three are measurements, not version numbers:
|
|
138
|
+
* · 2.0.18 `[L]`: a FLAT item per message, `{id, time:{created}, text, type}`.
|
|
139
|
+
* · 2.0.20 `[L][D]`: a MESSAGE whose body is `content: (Text|Reasoning|Tool)[]` and whose
|
|
140
|
+
* kind is on `role` — the name-level probe recorded `{keys:["content","id","metadata",
|
|
141
|
+
* "role"]}`. The previous version of this function passed that item through untouched
|
|
142
|
+
* ("already message-shaped"), `lastAssistantMessage` found no `parts` and no `text` on
|
|
143
|
+
* it, and the seam answered while the body was dropped AGAIN — which is why 正文来源=
|
|
144
|
+
* never printed on 2.0.20 (A1).
|
|
145
|
+
* · v1's `[{info,parts[]}]`: passed through untouched, so a host that changes back needs
|
|
146
|
+
* no change here.
|
|
147
|
+
* Only the bag is renamed and the envelope added: the elements are already v1 part shapes
|
|
148
|
+
* (`{type:"text", text}`), and reasoning/tool parts stay exactly as the host wrote them.
|
|
149
|
+
* An empty `content` normalises to empty parts — this function MOVES text, it never
|
|
150
|
+
* manufactures any. */
|
|
74
151
|
export function normaliseContextMessages(list) {
|
|
75
152
|
if (!Array.isArray(list))
|
|
76
153
|
return list;
|
|
@@ -78,23 +155,76 @@ export function normaliseContextMessages(list) {
|
|
|
78
155
|
if (!item || typeof item !== "object")
|
|
79
156
|
return item;
|
|
80
157
|
const rec = item;
|
|
81
|
-
if (rec.info || Array.isArray(rec.parts)
|
|
158
|
+
if (rec.info || Array.isArray(rec.parts))
|
|
82
159
|
return item;
|
|
160
|
+
if (Array.isArray(rec.content)) {
|
|
161
|
+
// A PART item (no `role`, `type` a part kind) is not a message: renaming its bag to
|
|
162
|
+
// `parts` would make it an unroled assistant candidate downstream, i.e. a TOOL OUTPUT
|
|
163
|
+
// delivered as the child's report — while passing it through untouched was the SAFE
|
|
164
|
+
// case, because the collect path reads a part's own `type` and skips `tool`.
|
|
165
|
+
if (!rawKind(rec.role) && PART_KINDS.includes(rawKind(rec.type)))
|
|
166
|
+
return item;
|
|
167
|
+
return { info: infoOfMessage(rec, roleOfMessage(rec)), parts: rec.content };
|
|
168
|
+
}
|
|
83
169
|
const text = rec.text;
|
|
84
170
|
if (typeof text !== "string" || !text.trim())
|
|
85
171
|
return item;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
172
|
+
// 2.0.18's flat item: a recognised role word is read from either field; anything else
|
|
173
|
+
// (the measured answer items carry `type:"text"`, a PART kind) falls to "assistant",
|
|
174
|
+
// which is the behaviour that shipped and that the 2.0.18 probe pinned. This branch
|
|
175
|
+
// deliberately keeps the fallback the content[] branch above no longer needs: a flat
|
|
176
|
+
// item's `type` is the PART kind of its own body, not a message discriminator, so
|
|
177
|
+
// carrying the raw value here would skip the real 2.0.18 replies.
|
|
89
178
|
return {
|
|
90
|
-
info:
|
|
179
|
+
info: infoOfMessage(rec, messageKind(rec.role) || messageKind(rec.type) || "assistant"),
|
|
91
180
|
parts: [{ type: "text", text }],
|
|
92
181
|
};
|
|
93
182
|
});
|
|
94
183
|
}
|
|
184
|
+
/** WHY a body came back empty, in names and counts only — never a value, a path, or a
|
|
185
|
+
* snippet of text (the R6 口径 binds a diagnostic). tm_join writes this onto the
|
|
186
|
+
* `child_body_missing` trajectory line so the three conclusions stay distinguishable:
|
|
187
|
+
* a real body (`child_body`), a seam that answered with nothing readable in it
|
|
188
|
+
* (`items=2 keys=[content+id+metadata+role] content=1 kinds=[tool] text=0`), and a seam
|
|
189
|
+
* that did not answer at all (`no-context-method`). Without it, "we read it" and "we could
|
|
190
|
+
* not read it" print the same row — goal #6's failure shape. */
|
|
191
|
+
export function contextShapeEvidence(list) {
|
|
192
|
+
if (list === undefined || list === null)
|
|
193
|
+
return "no-list";
|
|
194
|
+
if (!Array.isArray(list))
|
|
195
|
+
return `not-array(${typeof list})`;
|
|
196
|
+
if (list.length === 0)
|
|
197
|
+
return "items=0";
|
|
198
|
+
const last = list[list.length - 1];
|
|
199
|
+
if (!last || typeof last !== "object")
|
|
200
|
+
return `items=${list.length} last=${last === null ? "null" : typeof last}`;
|
|
201
|
+
const rec = last;
|
|
202
|
+
const keys = Object.keys(rec).slice(0, 12).join("+");
|
|
203
|
+
const bag = Array.isArray(rec.content) ? "content" : Array.isArray(rec.parts) ? "parts" : "";
|
|
204
|
+
if (bag) {
|
|
205
|
+
const arr = rec[bag];
|
|
206
|
+
const kinds = Array.from(new Set(arr.map((p) => (p && typeof p === "object" ? String(p.type ?? "?") : typeof p))))
|
|
207
|
+
.slice(0, 6)
|
|
208
|
+
.join("+");
|
|
209
|
+
let withText = 0;
|
|
210
|
+
for (const p of arr) {
|
|
211
|
+
const t = p?.text;
|
|
212
|
+
if (typeof t === "string" && t.trim())
|
|
213
|
+
withText++;
|
|
214
|
+
}
|
|
215
|
+
return `items=${list.length} keys=[${keys}] ${bag}=${arr.length} kinds=[${kinds}] text=${withText}`;
|
|
216
|
+
}
|
|
217
|
+
if (typeof rec.text === "string")
|
|
218
|
+
return `items=${list.length} keys=[${keys}] textlen=${rec.text.length}`;
|
|
219
|
+
return `items=${list.length} keys=[${keys}] nobag`;
|
|
220
|
+
}
|
|
221
|
+
/** The one name this bridge has for itself, so a reply credits the seam that answered and a
|
|
222
|
+
* refusal names the seam that did not — never the v1 endpoint this host does not have. */
|
|
223
|
+
const SEAM = "ctx.session.context";
|
|
95
224
|
export function createV2SessionReader(ctx) {
|
|
96
225
|
const report = {
|
|
97
226
|
attempted: 0, resolved: 0, failedShapes: [], contextTried: 0, contextOk: 0, contextKeys: [],
|
|
227
|
+
interruptTried: 0, interruptConfirmed: 0, interruptRefused: 0, interruptUnknown: 0, interruptKeys: [],
|
|
98
228
|
};
|
|
99
229
|
const domain = ctx?.session;
|
|
100
230
|
const call = async (method, arg) => {
|
|
@@ -135,33 +265,122 @@ export function createV2SessionReader(ctx) {
|
|
|
135
265
|
return { data: undefined };
|
|
136
266
|
},
|
|
137
267
|
/** The reply path: `ctx.session.context({sessionID})` is the in-process seam that
|
|
138
|
-
* answers for a child's messages
|
|
139
|
-
* `{id, time:{created}, text, type}
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* the
|
|
268
|
+
* answers for a child's messages. Measured on 2.0.18 it returns an ARRAY of flat
|
|
269
|
+
* `{id, time:{created}, text, type}` items; measured on 2.0.20 it returns items of
|
|
270
|
+
* `{id, role, metadata, content:[…]}` — the shape the published
|
|
271
|
+
* `Session.Message.Info` contract describes, with the kind on `role` instead of the
|
|
272
|
+
* documented `type`. Neither is v1's `[{info:{role},parts:[…]}]`, and both were the
|
|
273
|
+
* reason `tm_join` said it could not read a reply that was sitting right there:
|
|
274
|
+
* `lastAssistantMessage` tolerates an unknown shape by returning NO text, so the call
|
|
275
|
+
* succeeded and the body was silently dropped. Both shapes are therefore NORMALISED
|
|
276
|
+
* here, at the seam that knows them, so the collect path stays single-shaped — and
|
|
277
|
+
* every answer carries WHICH seam it came from plus the SHAPE it saw, because a reply
|
|
278
|
+
* that credits "session.messages" (a v1 endpoint this host does not have) is a claim
|
|
279
|
+
* about the host nobody measured, and a missing body with no shape on it is the same
|
|
280
|
+
* claim in the other direction. */
|
|
147
281
|
messages: async (opts) => {
|
|
148
282
|
const id = idOf(opts);
|
|
149
|
-
if (!id
|
|
150
|
-
return { data: undefined };
|
|
283
|
+
if (!id)
|
|
284
|
+
return { data: undefined, via: SEAM, shape: "no-id" };
|
|
285
|
+
if (typeof domain?.context !== "function") {
|
|
286
|
+
// The seam is ABSENT, which is a different fact from "it answered with nothing".
|
|
287
|
+
report.contextError = domain ? "ctx.session has no context method" : "ctx has no session domain";
|
|
288
|
+
return { data: undefined, via: SEAM, shape: domain ? "no-context-method" : "no-session-domain" };
|
|
289
|
+
}
|
|
151
290
|
report.contextTried++;
|
|
152
291
|
try {
|
|
153
292
|
const raw = await call("context", { sessionID: id });
|
|
154
293
|
const rec = unwrap(raw);
|
|
155
294
|
if (!rec)
|
|
156
|
-
return { data: undefined };
|
|
295
|
+
return { data: undefined, via: SEAM, shape: `seam-answered-${raw === null ? "null" : typeof raw}` };
|
|
157
296
|
report.contextOk++;
|
|
158
297
|
report.contextKeys = Array.isArray(rec) ? ["array"] : Object.keys(rec).slice(0, 24);
|
|
159
298
|
const list = Array.isArray(rec) ? rec : (rec.messages ?? rec.data ?? rec);
|
|
160
|
-
|
|
299
|
+
const seen = contextShapeEvidence(list);
|
|
300
|
+
report.contextShape = seen;
|
|
301
|
+
return { data: normaliseContextMessages(list), via: SEAM, shape: seen };
|
|
161
302
|
}
|
|
162
303
|
catch (err) {
|
|
163
304
|
report.contextError = String(err?.message ?? err).slice(0, 160);
|
|
164
|
-
return { data: undefined };
|
|
305
|
+
return { data: undefined, via: SEAM, shape: "context-threw" };
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
/** #33 — the STOP path. `tm_join { cancel: true }` was written against v1's
|
|
309
|
+
* `client.session.abort`, and this bridge never wrapped it, so on 2.x every
|
|
310
|
+
* background child was un-stoppable by the lead (the host gives no dialog and
|
|
311
|
+
* no card for a child the plugin observed rather than created).
|
|
312
|
+
*
|
|
313
|
+
* What the host DOES give a plugin is `ctx.session.interrupt`, and its contract
|
|
314
|
+
* is quoted from the v2 API page rather than inferred:
|
|
315
|
+
*
|
|
316
|
+
* POST /api/session/{sessionID}/interrupt
|
|
317
|
+
* "Returns interrupted=true when an active execution was interrupted and
|
|
318
|
+
* false for the idle no-op."
|
|
319
|
+
*
|
|
320
|
+
* That one sentence is why this seam must not collapse into a boolean: `false`
|
|
321
|
+
* is a real answer meaning "nothing was running", not "the stop failed", and a
|
|
322
|
+
* reply that called it 已停止 would be goal #6's overstated claim. Three
|
|
323
|
+
* outcomes therefore survive to the caller, plus the two failure cases (no
|
|
324
|
+
* seam, host threw):
|
|
325
|
+
* stopped — `interrupted === true`, the host stopped an active execution
|
|
326
|
+
* idle — `interrupted === false`, documented no-op
|
|
327
|
+
* unknown — the call answered but carried no `interrupted` boolean
|
|
328
|
+
* no-seam — this host's ctx has no `interrupt`
|
|
329
|
+
* threw — the host refused; its own message rides back
|
|
330
|
+
*
|
|
331
|
+
* The shape is `session.interrupt({sessionID})` — the same flat object `get` and
|
|
332
|
+
* `context` take (the rule AGENTS.md records for every `te`-wrapped method), and
|
|
333
|
+
* the v1 `{path:{id}}` spellings are NOT retried here because a wrong key on THIS
|
|
334
|
+
* method is not a decode failure but an interrupt of the wrong session.
|
|
335
|
+
*
|
|
336
|
+
* `resume` is deliberately never sent: `resume=true` continues pending steering
|
|
337
|
+
* input after the interrupt, which is the opposite of what a caller who asked to
|
|
338
|
+
* cancel a runaway child wants.
|
|
339
|
+
*
|
|
340
|
+
* Privacy: the key NAMES the host returned are recorded; the value text is not
|
|
341
|
+
* (R6 binds a diagnostic). */
|
|
342
|
+
interrupt: async (opts) => {
|
|
343
|
+
const id = idOf(opts);
|
|
344
|
+
report.interruptTried++;
|
|
345
|
+
if (!id || typeof domain?.interrupt !== "function")
|
|
346
|
+
return { data: { outcome: "no-seam" } };
|
|
347
|
+
// Property access on the domain, never a captured reference (see `call`).
|
|
348
|
+
const fn = domain.interrupt;
|
|
349
|
+
try {
|
|
350
|
+
const raw = await fn.call(domain, { sessionID: id });
|
|
351
|
+
const rec = unwrap(raw);
|
|
352
|
+
report.interruptKeys = rec ? Object.keys(rec).slice(0, 16) : ["(non-object)"];
|
|
353
|
+
// `interrupted` can ride the returned object or one of the envelopes `unwrap`
|
|
354
|
+
// recognises (`{data}` / `{result}` / `{session}`) — reading only the outer one
|
|
355
|
+
// turns a real stop into `unknown`, and `unknown` reads as "we could not tell".
|
|
356
|
+
const carriers = [rec, raw?.data, raw?.result];
|
|
357
|
+
let flag;
|
|
358
|
+
for (const cand of carriers) {
|
|
359
|
+
const v = cand?.interrupted;
|
|
360
|
+
if (typeof v === "boolean") {
|
|
361
|
+
flag = v;
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (flag === true)
|
|
366
|
+
report.interruptConfirmed++;
|
|
367
|
+
else if (flag === false)
|
|
368
|
+
report.interruptRefused++;
|
|
369
|
+
else
|
|
370
|
+
report.interruptUnknown++;
|
|
371
|
+
const note = carriers
|
|
372
|
+
.map((c) => c?.message)
|
|
373
|
+
.find((m) => typeof m === "string");
|
|
374
|
+
return {
|
|
375
|
+
data: {
|
|
376
|
+
outcome: flag === true ? "stopped" : flag === false ? "idle" : "unknown",
|
|
377
|
+
...(note ? { message: note } : {}),
|
|
378
|
+
},
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
catch (err) {
|
|
382
|
+
report.interruptError = String(err?.message ?? err).slice(0, 160);
|
|
383
|
+
return { data: { outcome: "threw", message: report.interruptError } };
|
|
165
384
|
}
|
|
166
385
|
},
|
|
167
386
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-session-client.js","sourceRoot":"","sources":["../../src/host/v2-session-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AA6BH;;gEAEgE;AAChE,MAAM,MAAM,GAA6C;IACvD,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1C,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;CAC3B,CAAA;AAED,SAAS,IAAI,CAAC,IAAa;IACzB,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAA6F,CAAA;IAClH,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;AACvE,CAAC;A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