@te-river/opencode-team-mode 1.7.3 → 1.7.5
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 +9 -9
- package/README.zh-CN.md +9 -9
- package/dist/agents.d.ts +1 -2
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +1 -8
- package/dist/agents.js.map +1 -1
- package/dist/host/v2-capabilities.d.ts +0 -1
- package/dist/host/v2-capabilities.d.ts.map +1 -1
- package/dist/host/v2-capabilities.js +0 -9
- package/dist/host/v2-capabilities.js.map +1 -1
- package/dist/host/v2-events.d.ts +8 -2
- package/dist/host/v2-events.d.ts.map +1 -1
- package/dist/host/v2-events.js +16 -2
- package/dist/host/v2-events.js.map +1 -1
- package/dist/host/v2-guard.d.ts +0 -44
- package/dist/host/v2-guard.d.ts.map +1 -1
- package/dist/host/v2-guard.js +8 -71
- package/dist/host/v2-guard.js.map +1 -1
- package/dist/host/v2-retry.d.ts +1 -1
- package/dist/host/v2-retry.js +1 -1
- package/dist/host/v2-scope.d.ts +0 -1
- package/dist/host/v2-scope.d.ts.map +1 -1
- package/dist/host/v2-scope.js +0 -1
- package/dist/host/v2-scope.js.map +1 -1
- package/dist/host/v2-session.d.ts +3 -9
- package/dist/host/v2-session.d.ts.map +1 -1
- package/dist/host/v2-session.js +5 -14
- package/dist/host/v2-session.js.map +1 -1
- package/dist/host/v2.d.ts +0 -10
- package/dist/host/v2.d.ts.map +1 -1
- package/dist/host/v2.js +6 -59
- 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 +24 -12
- 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 +16 -0
- package/dist/prompts/shared.js.map +1 -1
- package/dist/tm/config-layers.d.ts.map +1 -1
- package/dist/tm/config-layers.js +0 -2
- package/dist/tm/config-layers.js.map +1 -1
- package/dist/tm/config.d.ts +0 -4
- package/dist/tm/config.d.ts.map +1 -1
- package/dist/tm/config.js.map +1 -1
- package/dist/tm/dispatch.d.ts +0 -9
- package/dist/tm/dispatch.d.ts.map +1 -1
- package/dist/tm/dispatch.js +14 -16
- package/dist/tm/dispatch.js.map +1 -1
- package/dist/tm/index.d.ts +1 -9
- package/dist/tm/index.d.ts.map +1 -1
- package/dist/tm/index.js +2 -10
- package/dist/tm/index.js.map +1 -1
- package/dist/tm/stats.d.ts.map +1 -1
- package/dist/tm/stats.js +0 -1
- package/dist/tm/stats.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/docs/installation-v2.md +9 -2
- package/docs/v2-port-notes.md +35 -1
- package/package.json +1 -1
- package/scripts/gen-v2-config.mjs +8 -7
package/README.md
CHANGED
|
@@ -95,7 +95,10 @@ only** — the 1.18.x personality was removed in the 1.7.0 line:
|
|
|
95
95
|
(a 2.x plugin cannot create an agent, so the six roles and six `/team-*` commands come from
|
|
96
96
|
a generator step in that guide — that step is not optional.)
|
|
97
97
|
(If a URL is unreachable — common on mainland-China networks — retry with
|
|
98
|
-
the mirror prefix: https://ghproxy.net/ + the same path.
|
|
98
|
+
the mirror prefix: https://ghproxy.net/ + the same path. And if `npm` is
|
|
99
|
+
slow or blocked, point it at a registry mirror for this install:
|
|
100
|
+
`npm config set registry https://registry.npmmirror.com` — or add
|
|
101
|
+
`--registry https://registry.npmmirror.com` to the one command that needs it.)
|
|
99
102
|
Then verify the install using the checks in that guide.
|
|
100
103
|
```
|
|
101
104
|
|
|
@@ -296,7 +299,7 @@ the agent pages through with `tm_fetch` when it genuinely needs the payload.
|
|
|
296
299
|
> host's `permission.evaluate`. `tm_ledger` is the lead's list where the host gives a
|
|
297
300
|
> plugin no `todowrite`.
|
|
298
301
|
> **Nothing we change reaches outside Team.** Every v2 hook fires for every session on
|
|
299
|
-
> the host, so the tool-surface trim, the
|
|
302
|
+
> the host, so the tool-surface trim, the blackboard note, the offload
|
|
300
303
|
> of native results, the R6/address strictening and the forced-background dispatch all ask
|
|
301
304
|
> "is this one of our six roles?" first — `build`, `plan` and your own agents stay as a
|
|
302
305
|
> fresh install leaves them. Calls whose owner the host did not tell us are left alone too,
|
|
@@ -602,7 +605,7 @@ the auto-create state.
|
|
|
602
605
|
|
|
603
606
|
When the global file is **absent**, the plugin creates it at boot — atomically,
|
|
604
607
|
idempotently, and **never overwriting an existing file**. What it writes is an
|
|
605
|
-
**inert** template: all **
|
|
608
|
+
**inert** template: all **57** registry keys, each as a *comment* under a
|
|
606
609
|
one-line description, so the file parses to `{}` and sets nothing until you
|
|
607
610
|
uncomment what you want.
|
|
608
611
|
|
|
@@ -611,7 +614,7 @@ uncomment what you want.
|
|
|
611
614
|
{
|
|
612
615
|
// "offloadThreshold": 2000, // 卸载阈值(估算 token;等于阈值也卸载)。
|
|
613
616
|
// "envProtect": "strict", // R6 环境防护模式(strict/standard/off)。(红线:仅全局)
|
|
614
|
-
// …共
|
|
617
|
+
// …共 57 个键,每个都带一行说明
|
|
615
618
|
}
|
|
616
619
|
```
|
|
617
620
|
|
|
@@ -646,7 +649,6 @@ Options live on the plugin entry, not in `team-mode.jsonc`:
|
|
|
646
649
|
| `autoCreate` | `true` | Write the inert global `team-mode.jsonc` at boot when absent. |
|
|
647
650
|
| `ttlDays` (alias `blackboardTtlDays`) | `5` | Blackboard retention, valid range (0, 365]. |
|
|
648
651
|
| `envProtect` | `true` | Plugin-wide kill switch; `false` resolves the R6 mode to `off`. |
|
|
649
|
-
| `temperature` | `false` | `false` = the documented 0.2 invariant; a number overrides it. |
|
|
650
652
|
|
|
651
653
|
On 2.x a plugin entry is either a **string** or an **object** with `package` and
|
|
652
654
|
`options`. The 1.x tuple form `["@te-river/…", { … }]` is rejected
|
|
@@ -674,7 +676,7 @@ Your own agents named `team` / `architect` / … always take precedence; the
|
|
|
674
676
|
plugin never clobbers user definitions. See [Customization](#-customization)
|
|
675
677
|
for overrides, extra agents and disabling roles.
|
|
676
678
|
|
|
677
|
-
### Key reference (all
|
|
679
|
+
### Key reference (all 57)
|
|
678
680
|
|
|
679
681
|
**Offload, previews and the store**
|
|
680
682
|
|
|
@@ -723,7 +725,6 @@ for overrides, extra agents and disabling roles.
|
|
|
723
725
|
|
|
724
726
|
| Key | Type | Default | Meaning |
|
|
725
727
|
|---|---|---|---|
|
|
726
|
-
| `maxConcurrentSubagents` | number | `3` | Hard cap on concurrent `subagent` calls (`0` disables). Measured: `permission.evaluate` really fires for that action, so this is a gate and not a suggestion. |
|
|
727
728
|
| `prune` | `on`/`off` | `on` | Context pruning: replace a SETTLED message body with a self-explaining pointer (an offload handle, a child id, a note). Evidence is never destroyed — the reply skeleton, GOAL/ACCEPTANCE, provenance, system messages, a still-running child and an uncollected child id are protected whole, and the untouched messages stay byte-exact. `off` disables. |
|
|
728
729
|
| `pruneAtPercent` | number | `70` | Prune once the request reaches this share of the model's window, derived from `limit.context` — never a hard-coded token count. **Clamped to 40–90.** |
|
|
729
730
|
| `pruneKeepTailPercent` | number | `40` | Share of the window kept verbatim at the tail; the newest message is always kept. |
|
|
@@ -761,7 +762,6 @@ for overrides, extra agents and disabling roles.
|
|
|
761
762
|
| Key | Default | Status |
|
|
762
763
|
|---|---|---|
|
|
763
764
|
| `askTimeoutFloorMin` | `1` | **Orphaned.** Its only consumer was the v1 approval gate, which was deleted (a 2.x plugin cannot raise a dialog, so there was nothing to time out on). Say so rather than leaving a knob that does nothing. |
|
|
764
|
-
| `agentTemperature` | `""` | v1-only |
|
|
765
765
|
| `compactionContext` | `on` | v1-only |
|
|
766
766
|
| `shellEnv` | `""` | v1-only |
|
|
767
767
|
| `ptcWebBridge` | `on` | v1-only |
|
|
@@ -959,7 +959,7 @@ opencode-team-mode/
|
|
|
959
959
|
│ ├── envprotect.ts ← R6 facade (patterns / classifiers / gate predicates / hook)
|
|
960
960
|
│ ├── identity.ts ← Agent-name identity (case-insensitive lead match)
|
|
961
961
|
│ ├── tm/ ← Governed tools: pipelines / store / preview / guard / refs /
|
|
962
|
-
│ │ config-layers (the
|
|
962
|
+
│ │ config-layers (the 57-key registry) / config-files (the two
|
|
963
963
|
│ │ layers) / config-template (the inert auto-created file) /
|
|
964
964
|
│ │ webfetch / search / memory / board / ledger / dispatch
|
|
965
965
|
│ ├── host/ ← v2 personality (setup / guard / offload / session / events / …)
|
package/README.zh-CN.md
CHANGED
|
@@ -89,7 +89,10 @@ TeamMode 对每一个的回应:
|
|
|
89
89
|
2.x → https://raw.githubusercontent.com/Te-River/Opencode-TeamMode/main/docs/installation-v2.md
|
|
90
90
|
(2.x 的插件不能创建 agent,六个角色和六条 `/team-*` 命令要靠那份指南里的生成步骤落到
|
|
91
91
|
配置目录——这一步不是可选的。)
|
|
92
|
-
(URL 拉不到时——大陆网络常见——用镜像前缀重试:https://ghproxy.net/ +
|
|
92
|
+
(URL 拉不到时——大陆网络常见——用镜像前缀重试:https://ghproxy.net/ + 同样的路径。若 `npm`
|
|
93
|
+
慢或被墙,给这次安装指一个 registry 镜像:
|
|
94
|
+
`npm config set registry https://registry.npmmirror.com`——或在需要的那条命令上加
|
|
95
|
+
`--registry https://registry.npmmirror.com`。)
|
|
93
96
|
然后按该指南里的检查项验证。
|
|
94
97
|
```
|
|
95
98
|
|
|
@@ -288,7 +291,7 @@ HMAC 句柄,agent 真需要 payload 时用 `tm_fetch` 分页取。
|
|
|
288
291
|
> 都跑在宿主的 `permission.evaluate` 上。`tm_ledger` 是领队的清单,落在宿主不给插件
|
|
289
292
|
> `todowrite` 的地方。
|
|
290
293
|
> **我们改的一切都不会溢到 Team 之外。** v2 的每个钩子对宿主上所有会话都会触发,所以工具面
|
|
291
|
-
>
|
|
294
|
+
> 裁剪、黑板注记、原生结果卸载、R6 与地址红线的收紧、强制后台派发,全都会先问一句
|
|
292
295
|
> "这是我们六个角色吗"——`build`、`plan` 和你自己的 agent 保持刚装好时的原样。宿主没告诉我们会话
|
|
293
296
|
> 归属的调用同样不碰,并且会计数(`tm_stats` 里是 `作用域:我们 · 他人 · 未判定`)。
|
|
294
297
|
> 安装器写出的六个角色提示词,
|
|
@@ -524,7 +527,7 @@ Team Lead 自己从不删黑板,你可以随时审计任何一次运行。
|
|
|
524
527
|
### 它会自己写一份
|
|
525
528
|
|
|
526
529
|
全局文件**不存在**时,插件在启动时创建它——原子、幂等,且**绝不覆盖已存在的
|
|
527
|
-
文件**。写进去的是一份**惰性**模板:全部 **
|
|
530
|
+
文件**。写进去的是一份**惰性**模板:全部 **57** 个注册表键,每个都以*注释*
|
|
528
531
|
形式出现在一行说明下面,所以这个文件解析出来是 `{}`,在你取消注释之前什么
|
|
529
532
|
都不设置。
|
|
530
533
|
|
|
@@ -533,7 +536,7 @@ Team Lead 自己从不删黑板,你可以随时审计任何一次运行。
|
|
|
533
536
|
{
|
|
534
537
|
// "offloadThreshold": 2000, // 卸载阈值(估算 token;等于阈值也卸载)。
|
|
535
538
|
// "envProtect": "strict", // R6 环境防护模式(strict/standard/off)。(红线:仅全局)
|
|
536
|
-
// …共
|
|
539
|
+
// …共 57 个键,每个都带一行说明
|
|
537
540
|
}
|
|
538
541
|
```
|
|
539
542
|
|
|
@@ -566,7 +569,6 @@ Team Lead 自己从不删黑板,你可以随时审计任何一次运行。
|
|
|
566
569
|
| `autoCreate` | `true` | 全局 `team-mode.jsonc` 缺失时在启动时写入那份惰性模板。 |
|
|
567
570
|
| `ttlDays`(别名 `blackboardTtlDays`) | `5` | 黑板保留期,有效区间 (0, 365]。 |
|
|
568
571
|
| `envProtect` | `true` | 插件级总开关;`false` 会把 R6 模式解析成 `off`。 |
|
|
569
|
-
| `temperature` | `false` | `false` = 保持文档承诺的 0.2;给一个数字则覆盖它。 |
|
|
570
572
|
|
|
571
573
|
2.x 上插件条目要么是**字符串**,要么是带 `package` 和 `options` 的**对象**。
|
|
572
574
|
1.x 的元组形式 `["@te-river/…", { … }]` 会被拒
|
|
@@ -592,7 +594,7 @@ Team Lead 自己从不删黑板,你可以随时审计任何一次运行。
|
|
|
592
594
|
你自己叫 `team` / `architect` / … 的 agent 永远优先——插件从不覆盖用户定义。
|
|
593
595
|
覆盖、加自己的 agent、停用角色见[自定义](#-自定义)。
|
|
594
596
|
|
|
595
|
-
### 键参考(共
|
|
597
|
+
### 键参考(共 57 个)
|
|
596
598
|
|
|
597
599
|
**卸载、预览与存储**
|
|
598
600
|
|
|
@@ -641,7 +643,6 @@ Team Lead 自己从不删黑板,你可以随时审计任何一次运行。
|
|
|
641
643
|
|
|
642
644
|
| 键 | 类型 | 默认 | 含义 |
|
|
643
645
|
|---|---|---|---|
|
|
644
|
-
| `maxConcurrentSubagents` | number | `3` | 并发 `subagent` 调用的硬上限(`0` 关闭)。实测 `permission.evaluate` 对这个动作真的会触发,所以这是道闸而不是建议。 |
|
|
645
646
|
| `prune` | `on`/`off` | `on` | 上下文裁剪:把**已结算**的消息正文替换成一个自解释的指针(卸载句柄、子代理 id、说明)。证据绝不被销毁——回复骨架、GOAL/ACCEPTANCE、来源说明、系统消息、仍在跑的子代理、尚未收集的子代理 id 全部完整保留,被动的消息逐字节不变。`off` 关闭。 |
|
|
646
647
|
| `pruneAtPercent` | number | `70` | 请求达到模型窗口的这份占比时开始裁剪,由 `limit.context` 推导——绝不是写死的 token 数。**夹在 40–90。** |
|
|
647
648
|
| `pruneKeepTailPercent` | number | `40` | 尾部逐字保留的窗口占比;最新一条消息永远保留。 |
|
|
@@ -679,7 +680,6 @@ Team Lead 自己从不删黑板,你可以随时审计任何一次运行。
|
|
|
679
680
|
| 键 | 默认 | 状态 |
|
|
680
681
|
|---|---|---|
|
|
681
682
|
| `askTimeoutFloorMin` | `1` | **已孤儿。** 它唯一的消费者是 v1 审批门,而那扇门已被删除(2.x 插件弹不出对话框,根本没有可超时的对象)。如实说出来,而不是留一个什么都不干的旋钮。 |
|
|
682
|
-
| `agentTemperature` | `""` | 仅 v1 |
|
|
683
683
|
| `compactionContext` | `on` | 仅 v1 |
|
|
684
684
|
| `shellEnv` | `""` | 仅 v1 |
|
|
685
685
|
| `ptcWebBridge` | `on` | 仅 v1 |
|
|
@@ -859,7 +859,7 @@ opencode-team-mode/
|
|
|
859
859
|
│ ├── envprotect.ts ← R6 门面(patterns / 分类器 / 门禁谓词 / hook)
|
|
860
860
|
│ ├── identity.ts ← Agent 名身份(大小写不敏感的 lead 判定)
|
|
861
861
|
│ ├── tm/ ← 受治理工具:pipelines / store / preview / guard / refs /
|
|
862
|
-
│ │ config-layers(
|
|
862
|
+
│ │ config-layers(57 键注册表)/ config-files(那两层)/
|
|
863
863
|
│ │ config-template(自动创建的那份惰性文件)/
|
|
864
864
|
│ │ webfetch / search / memory / board / ledger / dispatch
|
|
865
865
|
│ ├── host/ ← v2 人格(setup / guard / offload / session / events / …)
|
package/dist/agents.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* The PROMPT STRINGS live in ./prompts/ (lead.ts, specialists.ts,
|
|
10
10
|
* shared.ts) — extracted verbatim; test-blackboard.mjs pins them. This
|
|
11
|
-
* module owns the structure: roles, modes, colors,
|
|
11
|
+
* module owns the structure: roles, modes, colors, and the
|
|
12
12
|
* tool-whitelist matrix.
|
|
13
13
|
*
|
|
14
14
|
* Prompt design principles (v1.4.7 — "subtraction" release):
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
* is explicitly banned.
|
|
26
26
|
* - Adaptive review: one reviewer by default, three dimensions only for
|
|
27
27
|
* high-risk profiles.
|
|
28
|
-
* - All agents run at temperature 0.2 for format discipline.
|
|
29
28
|
*/
|
|
30
29
|
import type { AgentConfig, AgentPermission } from "./types.js";
|
|
31
30
|
/** Grant the async COLLECT lever to the lead only (issue #6 + #7). No agent
|
package/dist/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAqI9D;;;;wCAIwC;AACxC,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAGhG;AA6KD,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAW9C,CAAA"}
|
package/dist/agents.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* The PROMPT STRINGS live in ./prompts/ (lead.ts, specialists.ts,
|
|
10
10
|
* shared.ts) — extracted verbatim; test-blackboard.mjs pins them. This
|
|
11
|
-
* module owns the structure: roles, modes, colors,
|
|
11
|
+
* module owns the structure: roles, modes, colors, and the
|
|
12
12
|
* tool-whitelist matrix.
|
|
13
13
|
*
|
|
14
14
|
* Prompt design principles (v1.4.7 — "subtraction" release):
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
* is explicitly banned.
|
|
26
26
|
* - Adaptive review: one reviewer by default, three dimensions only for
|
|
27
27
|
* high-risk profiles.
|
|
28
|
-
* - All agents run at temperature 0.2 for format discipline.
|
|
29
28
|
*/
|
|
30
29
|
import { TEAM_LEAD_PROMPT } from "./prompts/lead.js";
|
|
31
30
|
import { ARCHITECT_PROMPT, IMPLEMENTER_PROMPT, RESEARCHER_PROMPT, REVIEWER_PROMPT, TESTER_PROMPT, } from "./prompts/specialists.js";
|
|
@@ -201,7 +200,6 @@ const teamLead = {
|
|
|
201
200
|
// prompt mandates — they need their tools). The ledger itself is
|
|
202
201
|
// `tm_ledger`, allowed for this role by name in the permission layer.
|
|
203
202
|
permission: whitelist("task", "edit", "write", "bash", "question"),
|
|
204
|
-
temperature: 0.2,
|
|
205
203
|
};
|
|
206
204
|
const architect = {
|
|
207
205
|
mode: "subagent",
|
|
@@ -219,7 +217,6 @@ const architect = {
|
|
|
219
217
|
// the lead inline (see Blackboard rules).
|
|
220
218
|
// No bash — unchanged from the pre-T2.1 architect bash:deny posture.
|
|
221
219
|
permission: whitelist(),
|
|
222
|
-
temperature: 0.2,
|
|
223
220
|
};
|
|
224
221
|
const implementer = {
|
|
225
222
|
mode: "subagent",
|
|
@@ -232,7 +229,6 @@ const implementer = {
|
|
|
232
229
|
// verification for the fix: build / typecheck / failing test);
|
|
233
230
|
// tm_webfetch DENIED (not a network role).
|
|
234
231
|
permission: whitelist("edit", "write", "bash"),
|
|
235
|
-
temperature: 0.2,
|
|
236
232
|
};
|
|
237
233
|
const reviewer = {
|
|
238
234
|
mode: "subagent",
|
|
@@ -250,7 +246,6 @@ const reviewer = {
|
|
|
250
246
|
// inline fallback (see Blackboard rules). bash backs the evidence
|
|
251
247
|
// standard — the reviewer must be able to run npm test / tsc itself.
|
|
252
248
|
permission: whitelist("bash"),
|
|
253
|
-
temperature: 0.2,
|
|
254
249
|
};
|
|
255
250
|
const tester = {
|
|
256
251
|
mode: "subagent",
|
|
@@ -267,7 +262,6 @@ const tester = {
|
|
|
267
262
|
// The host's native browser catalog is granted for governed UI verification;
|
|
268
263
|
// tm_webfetch / tm_search DENIED (open web lookups stay with the lead + researcher).
|
|
269
264
|
permission: whitelist("edit", "write", "bash"),
|
|
270
|
-
temperature: 0.2,
|
|
271
265
|
};
|
|
272
266
|
const researcher = {
|
|
273
267
|
mode: "subagent",
|
|
@@ -289,7 +283,6 @@ const researcher = {
|
|
|
289
283
|
// not tool-less: it keeps the governed tm_* set, and on v2 the host's own
|
|
290
284
|
// read/grep/glob + Code Mode `execute`, which our matrix never denies.
|
|
291
285
|
permission: whitelist(),
|
|
292
|
-
temperature: 0.2,
|
|
293
286
|
};
|
|
294
287
|
/* Append the reply contract and shared rules to every specialist prompt. */
|
|
295
288
|
for (const a of [architect, implementer, reviewer, tester, researcher]) {
|
package/dist/agents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,aAAa,GACd,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,wEAAwE;AACxE,sEAAsE;AACtE,wEAAwE;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,aAAa,GAAG;IACpB,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,aAAa;IACb,UAAU;IACV,WAAW;IACX,KAAK;IACL,OAAO;IACP,UAAU;CACF,CAAA;AAEV;;;;;;;;;;;;;;;oCAeoC;AACpC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAU,CAAA;AAE9E;;;;;;;;;;;4BAW4B;AAC5B;;;;;;;mFAOmF;AACnF,MAAM,QAAQ,GAAG;IACf,UAAU;IACV,WAAW;IACX,UAAU;IACV,gBAAgB;CACjB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;AAE5C,MAAM,SAAS,GAAG,CAChB,GAAG,OAAgD,EAClC,EAAE;IACnB,MAAM,UAAU,GAAoB,EAAE,CAAA;IACtC,KAAK,MAAM,IAAI,IAAI,aAAa;QAAE,UAAU,CAAC,IAAI,CAAC,GAAG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AE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9F;AAID,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,CAwL3D"}
|
|
@@ -171,15 +171,6 @@ export function v2CapabilityRows(i) {
|
|
|
171
171
|
? `已测 ${i.prune.checked} 次请求装配 · 裁掉 ${i.prune.prunedMessages} 条消息(省 ${i.prune.prunedTokens} token,估算)· 未到阈值 ${i.prune.below} · 读不到上限 ${i.prune.noLimit} · 非本会话跳过 ${i.prune.foreignSkipped} · 抛错 ${i.prune.threw}`
|
|
172
172
|
: "层已装(v2.ts 注册了 prune 的 context 钩子),但本进程没有把它的计数交给能力矩阵——这一格只能读 declared",
|
|
173
173
|
});
|
|
174
|
-
if (typeof i.temperature === "number") {
|
|
175
|
-
rows.push({
|
|
176
|
-
seam: "options.temperature",
|
|
177
|
-
feature: "所有角色 0.2(v2 上 agent 配置里的 temperature 是 legacy 字段、runner 不发,所以只能走请求层)",
|
|
178
|
-
state: i.probe.report.agentsSeen.length ? "ok" : "declared",
|
|
179
|
-
evidence: "runtime",
|
|
180
|
-
note: `本进程请求里带的温度:${i.temperature}`,
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
174
|
if (!i.hasTodoSeam) {
|
|
184
175
|
rows.push({
|
|
185
176
|
seam: "GET /session/{id}/todo",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-capabilities.js","sourceRoot":"","sources":["../../src/host/v2-capabilities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"v2-capabilities.js","sourceRoot":"","sources":["../../src/host/v2-capabilities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAoElD,MAAM,GAAG,GAAG,CAAC,IAAuB,EAAE,IAA4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ACtE,IAAI,EAAE,CAAC,YAAY;YACjB,CAAC,CAAC,6BAA6B;YAC/B,CAAC,CAAC,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC,KAAK,CAAC,cAAc,UAAU,CAAC,CAAC,KAAK,CAAC,YAAY,oBAAoB,CAAC,CAAC,KAAK,CAAC,KAAK,YAAY,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC,KAAK,CAAC,cAAc,SAAS,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE;gBACjN,CAAC,CAAC,sEAAsE;KAC7E,CAAC,CAAA;IACF,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"}
|
package/dist/host/v2-events.d.ts
CHANGED
|
@@ -31,8 +31,14 @@
|
|
|
31
31
|
import type { HostEvent } from "../types.js";
|
|
32
32
|
import type { V2Registration } from "./v2-types.js";
|
|
33
33
|
/** The types the dispatcher understands, plus the v2 spellings we have observed.
|
|
34
|
-
* Anything else is counted, not forwarded.
|
|
35
|
-
|
|
34
|
+
* Anything else is counted, not forwarded.
|
|
35
|
+
*
|
|
36
|
+
* The `session.execution.*` entries are the 2.0.28 spellings, read off a live
|
|
37
|
+
* `v2-surface` row's `event_unknown_types` (measured, not guessed): the host
|
|
38
|
+
* publishes `session.execution.succeeded` / `.failed` / `.interrupted` where
|
|
39
|
+
* older generations said `session.idle` / `session.error`. They are listed
|
|
40
|
+
* because they were observed; a name we have not seen still stays counted. */
|
|
41
|
+
export declare const FEED_TYPES: readonly ["session.idle", "session.error", "session.status", "session.statused", "session.updated", "session.execution.succeeded", "session.execution.failed", "session.execution.interrupted"];
|
|
36
42
|
export interface V2EventFeedReport {
|
|
37
43
|
/** subscribe() existed and returned something iterable */
|
|
38
44
|
active: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-events.d.ts","sourceRoot":"","sources":["../../src/host/v2-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD
|
|
1
|
+
{"version":3,"file":"v2-events.d.ts","sourceRoot":"","sources":["../../src/host/v2-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD;;;;;;;+EAO+E;AAC/E,eAAO,MAAM,UAAU,iMASb,CAAA;AAEV,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B;iCAC6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,aAAa,EAAE,cAAc,EAAE,CAAA;IAC/B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B;AAeD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE;IAAE,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,GAC1G,OAAO,CAAC,WAAW,CAAC,CAwHtB"}
|
package/dist/host/v2-events.js
CHANGED
|
@@ -29,13 +29,22 @@
|
|
|
29
29
|
* of an exception in the host's event loop.
|
|
30
30
|
*/
|
|
31
31
|
/** The types the dispatcher understands, plus the v2 spellings we have observed.
|
|
32
|
-
* Anything else is counted, not forwarded.
|
|
32
|
+
* Anything else is counted, not forwarded.
|
|
33
|
+
*
|
|
34
|
+
* The `session.execution.*` entries are the 2.0.28 spellings, read off a live
|
|
35
|
+
* `v2-surface` row's `event_unknown_types` (measured, not guessed): the host
|
|
36
|
+
* publishes `session.execution.succeeded` / `.failed` / `.interrupted` where
|
|
37
|
+
* older generations said `session.idle` / `session.error`. They are listed
|
|
38
|
+
* because they were observed; a name we have not seen still stays counted. */
|
|
33
39
|
export const FEED_TYPES = [
|
|
34
40
|
"session.idle",
|
|
35
41
|
"session.error",
|
|
36
42
|
"session.status",
|
|
37
43
|
"session.statused",
|
|
38
44
|
"session.updated",
|
|
45
|
+
"session.execution.succeeded",
|
|
46
|
+
"session.execution.failed",
|
|
47
|
+
"session.execution.interrupted",
|
|
39
48
|
];
|
|
40
49
|
/** Event shapes the host has used across generations; read defensively because
|
|
41
50
|
* none of them is a promised interface. */
|
|
@@ -102,7 +111,12 @@ export async function applyV2EventFeed(ctx, opts) {
|
|
|
102
111
|
// tap with the same never-throw discipline as the usage tap. The payload
|
|
103
112
|
// never reaches the trajectory; only the classification count does (R6 binds
|
|
104
113
|
// a diagnostic).
|
|
105
|
-
|
|
114
|
+
//
|
|
115
|
+
// 2.0.28 renamed the failure event: a live `v2-surface` row shows
|
|
116
|
+
// `session.execution.failed` where older hosts said `session.error`, so the
|
|
117
|
+
// tap matches BOTH spellings. The governor's own `errorTextOf` does the
|
|
118
|
+
// extraction; this only routes the event to it.
|
|
119
|
+
if ((type === "session.error" || type === "session.execution.failed") && typeof opts.onError === "function") {
|
|
106
120
|
try {
|
|
107
121
|
opts.onError(ev);
|
|
108
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-events.js","sourceRoot":"","sources":["../../src/host/v2-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH
|
|
1
|
+
{"version":3,"file":"v2-events.js","sourceRoot":"","sources":["../../src/host/v2-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH;;;;;;;+EAO+E;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,6BAA6B;IAC7B,0BAA0B;IAC1B,+BAA+B;CACvB,CAAA;AAoBV;4CAC4C;AAC5C,SAAS,OAAO,CAAC,GAAY;IAC3B,MAAM,CAAC,GAAG,GAAiD,CAAA;IAC3D,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAA;IAC1C,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAA;IACvC,MAAM,KAAK,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,CAAA;IACjD,OAAO;QACL,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,GAAG,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAgC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChG,CAA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,EAAE,EAAE,CAAA;IAC7C,KAAK,CAAC,KAAK,IAAI,EAAE;QACf,IAAI,CAAC;YACH,IAAI,CAAC,IAAI;gBAAE,OAAM;YACjB,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAA4B,EAAE,CAAC;gBACzF,IAAI,MAAM;oBAAE,MAAK;gBACjB,MAAM,CAAC,GAAG,CAAC,CAAA;YACb,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,GAAG,iBAAiB,MAAM,CAAE,GAAa,EAAE,OAAO,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAA;QAC1F,CAAC;IACH,CAAC,CAAC,EAAE,CAAA;IAEJ,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/host/v2-guard.d.ts
CHANGED
|
@@ -73,27 +73,6 @@ export declare function webGuard(resources: readonly string[]): GuardDecision |
|
|
|
73
73
|
export declare function pathGuard(action: string, resources: readonly string[], mode: EnvProtectMode): GuardDecision | null;
|
|
74
74
|
/** R6's env face and R2's danger face, per command line. */
|
|
75
75
|
export declare function shellGuard(command: string | undefined, mode: EnvProtectMode): GuardDecision | null;
|
|
76
|
-
/** One running child, as the concurrency refusal renders it. */
|
|
77
|
-
export interface RunningChild {
|
|
78
|
-
sessionID: string;
|
|
79
|
-
agent?: string;
|
|
80
|
-
elapsedMs?: number;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* The concurrency cap (#49 feature 2). `permission.evaluate` fires for
|
|
84
|
-
* `subagent` (measured live: `guard_actions: … subagent=16 …`), so the cap is a
|
|
85
|
-
* HARD gate on the same seam as the env-file / address red lines — not a prompt
|
|
86
|
-
* hint a model can talk itself past.
|
|
87
|
-
*
|
|
88
|
-
* When the caller's OWN running children reach the cap, the next dispatch is
|
|
89
|
-
* denied with a Chinese, actionable refusal that names the running ids and the
|
|
90
|
-
* two ways out (collect with `tm_join`, or stop with `tm_join {cancel:true}`).
|
|
91
|
-
*
|
|
92
|
-
* Pure and total: `cap <= 0` disables it (never denies), an empty running list
|
|
93
|
-
* never denies, and it never throws. Only ever stricter — the caller applies it
|
|
94
|
-
* through the same `rank` floor as every other guard.
|
|
95
|
-
*/
|
|
96
|
-
export declare function concurrencyGuard(action: string, running: readonly RunningChild[], cap: number): GuardDecision | null;
|
|
97
76
|
export interface GuardReport {
|
|
98
77
|
seen: number;
|
|
99
78
|
byAction: Record<string, number>;
|
|
@@ -122,15 +101,6 @@ export interface GuardReport {
|
|
|
122
101
|
envFileInputForeignSkipped: number;
|
|
123
102
|
/** …where the guard itself threw and the call was allowed through. */
|
|
124
103
|
envFileInputThrew: number;
|
|
125
|
-
/** #49 feature 2: `subagent` evaluations the concurrency cap looked at. */
|
|
126
|
-
concurrencySeen: number;
|
|
127
|
-
/** …where the cap fired and the dispatch was denied. */
|
|
128
|
-
concurrencyDenied: number;
|
|
129
|
-
/** The largest number of the caller's running children seen at one evaluation
|
|
130
|
-
* — the peak the cap is measured against, so "we never hit it" is a number. */
|
|
131
|
-
concurrencyRunningMax: number;
|
|
132
|
-
/** …where the running-children read threw and the call was allowed through. */
|
|
133
|
-
concurrencyThrew: number;
|
|
134
104
|
}
|
|
135
105
|
export interface BackgroundForceReport {
|
|
136
106
|
seen: number;
|
|
@@ -161,20 +131,6 @@ export declare function applyV2BackgroundForce(ctx: V2Context, opts?: {
|
|
|
161
131
|
export declare function applyV2PermissionGuards(ctx: V2Context, opts: {
|
|
162
132
|
envProtectMode: EnvProtectMode;
|
|
163
133
|
scope?: TeamScope;
|
|
164
|
-
/** #49 feature 2: the caller's own running children, read from the plugin's
|
|
165
|
-
* ONE children registry. Absent = the cap is not enforced (a host with no
|
|
166
|
-
* registry to read must not be denied on a guess). */
|
|
167
|
-
runningChildren?: (callerSessionID: string) => RunningChild[];
|
|
168
|
-
/** The cap. `<= 0` disables it. Defaults to 0 (off) so a caller that does
|
|
169
|
-
* not opt in keeps the pre-#49 behaviour byte-exactly. */
|
|
170
|
-
maxConcurrent?: number;
|
|
171
|
-
/** Fired once per denial so the personality can write the `v2-concurrency`
|
|
172
|
-
* trajectory line — the guard owns no store. */
|
|
173
|
-
onConcurrencyDenied?: (info: {
|
|
174
|
-
caller: string;
|
|
175
|
-
running: RunningChild[];
|
|
176
|
-
cap: number;
|
|
177
|
-
}) => void;
|
|
178
134
|
}): Promise<{
|
|
179
135
|
registrations: V2Registration[];
|
|
180
136
|
report: GuardReport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-guard.d.ts","sourceRoot":"","sources":["../../src/host/v2-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAA;CACZ;AAqBD,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,aAAa,GAAG,IAAI,CAyB3E;AAOD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,GAAG,aAAa,GAAG,IAAI,CAWlH;AAED,4DAA4D;AAC5D,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAA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A,OAAO,CAAC;IAAE,aAAa,EAAE,cAAc,EAAE,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC,CA8C1E"}
|
package/dist/host/v2-guard.js
CHANGED
|
@@ -142,39 +142,6 @@ export function shellGuard(command, mode) {
|
|
|
142
142
|
}
|
|
143
143
|
return null;
|
|
144
144
|
}
|
|
145
|
-
/**
|
|
146
|
-
* The concurrency cap (#49 feature 2). `permission.evaluate` fires for
|
|
147
|
-
* `subagent` (measured live: `guard_actions: … subagent=16 …`), so the cap is a
|
|
148
|
-
* HARD gate on the same seam as the env-file / address red lines — not a prompt
|
|
149
|
-
* hint a model can talk itself past.
|
|
150
|
-
*
|
|
151
|
-
* When the caller's OWN running children reach the cap, the next dispatch is
|
|
152
|
-
* denied with a Chinese, actionable refusal that names the running ids and the
|
|
153
|
-
* two ways out (collect with `tm_join`, or stop with `tm_join {cancel:true}`).
|
|
154
|
-
*
|
|
155
|
-
* Pure and total: `cap <= 0` disables it (never denies), an empty running list
|
|
156
|
-
* never denies, and it never throws. Only ever stricter — the caller applies it
|
|
157
|
-
* through the same `rank` floor as every other guard.
|
|
158
|
-
*/
|
|
159
|
-
export function concurrencyGuard(action, running, cap) {
|
|
160
|
-
if (action !== "subagent")
|
|
161
|
-
return null;
|
|
162
|
-
if (!Number.isFinite(cap) || cap <= 0)
|
|
163
|
-
return null;
|
|
164
|
-
if (running.length < cap)
|
|
165
|
-
return null;
|
|
166
|
-
const list = running
|
|
167
|
-
.map((c) => {
|
|
168
|
-
const secs = typeof c.elapsedMs === "number" && c.elapsedMs >= 0 ? ` 运行中 ${Math.round(c.elapsedMs / 1000)}s` : "";
|
|
169
|
-
return `${c.sessionID}${secs}`;
|
|
170
|
-
})
|
|
171
|
-
.join("、");
|
|
172
|
-
return {
|
|
173
|
-
effect: "deny",
|
|
174
|
-
why: "concurrency-cap",
|
|
175
|
-
message: `本会话已有 ${running.length} 个子代理在跑(上限 ${cap}):${list}。先 tm_join 收取已结算的,或 tm_join {cancel:true} 停掉不需要的,再派新的。`,
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
145
|
/**
|
|
179
146
|
* Every sub-agent dispatch runs in the background.
|
|
180
147
|
*
|
|
@@ -218,7 +185,7 @@ export async function applyV2BackgroundForce(ctx, opts = {}) {
|
|
|
218
185
|
return { registrations, report };
|
|
219
186
|
}
|
|
220
187
|
export async function applyV2PermissionGuards(ctx, opts) {
|
|
221
|
-
const report = { seen: 0, byAction: {}, strictened: 0, denied: 0, shellMatched: 0, foreignSkipped: 0, envFileDenied: 0, envFileDeniedByInput: 0, envFileInputSeen: 0, envFileInputForeignSkipped: 0, envFileInputThrew: 0
|
|
188
|
+
const report = { seen: 0, byAction: {}, strictened: 0, denied: 0, shellMatched: 0, foreignSkipped: 0, envFileDenied: 0, envFileDeniedByInput: 0, envFileInputSeen: 0, envFileInputForeignSkipped: 0, envFileInputThrew: 0 };
|
|
222
189
|
const permission = ctx.permission;
|
|
223
190
|
if (!permission || typeof permission.hook !== "function") {
|
|
224
191
|
return { registrations: [], report, installed: false };
|
|
@@ -242,50 +209,20 @@ export async function applyV2PermissionGuards(ctx, opts) {
|
|
|
242
209
|
: action === "shell"
|
|
243
210
|
? shellGuard(resources[0], opts.envProtectMode)
|
|
244
211
|
: pathGuard(action, resources, opts.envProtectMode);
|
|
245
|
-
|
|
246
|
-
// `subagent` (measured live), so this is a hard gate on the same seam as the
|
|
247
|
-
// red lines. A read that throws is swallowed and counted — a throughput cap
|
|
248
|
-
// that fails OPEN is the honest failure mode, and it never loosens a host
|
|
249
|
-
// decision (the `rank` floor below still applies).
|
|
250
|
-
let concurrency = null;
|
|
251
|
-
if (action === "subagent") {
|
|
252
|
-
report.concurrencySeen++;
|
|
253
|
-
try {
|
|
254
|
-
const caller = String(event?.sessionID ?? "");
|
|
255
|
-
const running = opts.runningChildren ? opts.runningChildren(caller) : [];
|
|
256
|
-
if (running.length > report.concurrencyRunningMax)
|
|
257
|
-
report.concurrencyRunningMax = running.length;
|
|
258
|
-
concurrency = concurrencyGuard(action, running, opts.maxConcurrent ?? 0);
|
|
259
|
-
if (concurrency) {
|
|
260
|
-
report.concurrencyDenied++;
|
|
261
|
-
try {
|
|
262
|
-
opts.onConcurrencyDenied?.({ caller, running, cap: opts.maxConcurrent ?? 0 });
|
|
263
|
-
}
|
|
264
|
-
catch {
|
|
265
|
-
/* the trajectory line is an extra, never a reason to fail the call */
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
catch {
|
|
270
|
-
report.concurrencyThrew++;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
// The stricter of the two wins; a null on either side is not a decision.
|
|
274
|
-
const chosen = !decision ? concurrency : !concurrency ? decision : rank[concurrency.effect] > rank[decision.effect] ? concurrency : decision;
|
|
275
|
-
if (!chosen)
|
|
212
|
+
if (!decision)
|
|
276
213
|
return;
|
|
277
214
|
if (action === "shell")
|
|
278
215
|
report.shellMatched++;
|
|
279
|
-
if (
|
|
216
|
+
if (decision.why === "env-file-path")
|
|
280
217
|
report.envFileDenied++;
|
|
281
218
|
// Only ever stricter. A host that already decided to ask or deny keeps
|
|
282
219
|
// that decision — our classifier is a floor, not an override of the user.
|
|
283
|
-
if (rank[
|
|
220
|
+
if (rank[decision.effect] <= rank[event.effect ?? "allow"])
|
|
284
221
|
return;
|
|
285
|
-
event.effect =
|
|
286
|
-
if (
|
|
287
|
-
event.message =
|
|
288
|
-
if (
|
|
222
|
+
event.effect = decision.effect;
|
|
223
|
+
if (decision.message)
|
|
224
|
+
event.message = decision.message;
|
|
225
|
+
if (decision.effect === "deny")
|
|
289
226
|
report.denied++;
|
|
290
227
|
else
|
|
291
228
|
report.strictened++;
|