scream-code 0.19.6 → 0.19.8
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 +24 -3
- package/dist/{app-CE9aji1S.mjs → app-BK_bW4ee.mjs} +124 -80
- package/dist/{dispatch-DNYdiEo4.mjs → dispatch-DD8Vu4Qc.mjs} +1 -1
- package/dist/{dispatch-XPKo0cQR.mjs → dispatch-DMntc47e.mjs} +1336 -348
- package/dist/main.mjs +1 -1
- package/dist/{text-input-dialog-CbYhsAbz.mjs → text-input-dialog-BLUlZjUL.mjs} +1 -1
- package/dist/{text-input-dialog-BqMy3ifH.mjs → text-input-dialog-Ce2AEFU9.mjs} +2 -0
- package/docs/plugins.md +16 -1
- package/docs/sessions.md +10 -1
- package/docs/skills.md +4 -1
- package/package.json +2 -2
package/dist/main.mjs
CHANGED
|
@@ -6,7 +6,7 @@ const __dirname = __cjsShimDirname(__filename);
|
|
|
6
6
|
import "./suppress-sqlite-warning-C2VB0doZ.mjs";
|
|
7
7
|
//#region src/main.ts
|
|
8
8
|
try {
|
|
9
|
-
(await import("./app-
|
|
9
|
+
(await import("./app-BK_bW4ee.mjs")).main();
|
|
10
10
|
} catch (error) {
|
|
11
11
|
process.stderr.write(`${error instanceof Error ? error.stack ?? error.message : String(error)}\n`);
|
|
12
12
|
process.exit(1);
|
|
@@ -3,5 +3,5 @@ import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
|
|
|
3
3
|
import { dirname as __cjsShimDirname } from 'node:path';
|
|
4
4
|
const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = __cjsShimDirname(__filename);
|
|
6
|
-
import { t as TextInputDialogComponent } from "./text-input-dialog-
|
|
6
|
+
import { t as TextInputDialogComponent } from "./text-input-dialog-Ce2AEFU9.mjs";
|
|
7
7
|
export { TextInputDialogComponent };
|
|
@@ -973,6 +973,7 @@ const dictionaries = {
|
|
|
973
973
|
"usage.subagent_title": "子 Agent 用量",
|
|
974
974
|
"usage.panel_title": " 用量 ",
|
|
975
975
|
"usage.session_total": "会话总计",
|
|
976
|
+
"usage.cost": "花费",
|
|
976
977
|
"usage.cache_rw": "缓存",
|
|
977
978
|
"usage.main_agent": "主 Agent",
|
|
978
979
|
"usage.sub_agent": "子 Agent",
|
|
@@ -2355,6 +2356,7 @@ const dictionaries = {
|
|
|
2355
2356
|
"usage.subagent_title": "Sub-Agent Usage",
|
|
2356
2357
|
"usage.panel_title": " Usage ",
|
|
2357
2358
|
"usage.session_total": "Session Total",
|
|
2359
|
+
"usage.cost": "Cost",
|
|
2358
2360
|
"usage.cache_rw": "cache",
|
|
2359
2361
|
"usage.main_agent": "Main Agent",
|
|
2360
2362
|
"usage.sub_agent": "Sub-Agent",
|
package/docs/plugins.md
CHANGED
|
@@ -74,7 +74,8 @@ export async function deactivate() {}
|
|
|
74
74
|
- 必须是 ESM。也接受 `export default { activate, deactivate }` 的写法(运行时统一经 `normalizeExtensionModule` 归一化)。
|
|
75
75
|
- `activate(context)` 必须导出;`deactivate()` 可选,且不接收参数——需要清理的东西在 `activate` 里捕获到模块作用域。
|
|
76
76
|
- `activate` 抛错时,本次激活完成一半的 hooks 与事件订阅会被回滚,错误写入插件记录并返回 `activation_failed`。
|
|
77
|
-
-
|
|
77
|
+
- 激活是**按会话**的:同一个插件可以在 A、B 两个会话里各跑一份(各自的 hooks、事件订阅、工具互不相干),但**同一会话内**不能重复激活;停用一个会话不影响另一个。
|
|
78
|
+
- 会话关闭时,它激活过的插件会被自动 `deactivate`,不会残留。
|
|
78
79
|
|
|
79
80
|
## context API
|
|
80
81
|
|
|
@@ -87,6 +88,9 @@ export async function deactivate() {}
|
|
|
87
88
|
| `services.tools.unregisterToolsByOwner(id)` | 按 owner 批量注销;宿主在停用时也会自动执行 |
|
|
88
89
|
| `events.subscribe(type \| '*', handler)` | 订阅 agent 事件,返回 `unsubscribe`;`deactivate` 时宿主也会统一释放 |
|
|
89
90
|
| `services` | agent 的子系统清单;只应调用这里列出的工具相关成员 |
|
|
91
|
+
| `ui.notify(level, message)` | 向用户报一句:`info` / `warn` / `error`。作为状态区消息显示,不打断 |
|
|
92
|
+
| `ui.confirm({ title, body?, confirmLabel?, cancelLabel? })` | 问用户是/否,返回 `Promise<boolean>`;无界面宿主一律返回 `false` 并说明原因 |
|
|
93
|
+
| `ui.progress(title)` | 返回 `{ update(label), done(message?), fail(message?) }`;文本进度,`update` 限流约 5 次/秒 |
|
|
90
94
|
|
|
91
95
|
`registerUserTool` 的入参:
|
|
92
96
|
|
|
@@ -99,6 +103,17 @@ export async function deactivate() {}
|
|
|
99
103
|
|
|
100
104
|
运行时会给注册自动打上 `ownerPluginId`,因此停用、移除、熔断都能精确回收该插件的工具;插件自己声明的 owner 优先。`execute` 抛错会被转成工具错误,不会打断 agent loop,但会计入熔断计数。
|
|
101
105
|
|
|
106
|
+
## 界面交互(ui)
|
|
107
|
+
|
|
108
|
+
三个原语,全部**降级而不抛错**:
|
|
109
|
+
|
|
110
|
+
| 宿主 | `notify` | `confirm` | `progress` |
|
|
111
|
+
|---|---|---|---|
|
|
112
|
+
| TUI | 状态区一行 | 弹出选择框,选「确认」为 `true` | 状态区文本逐步更新 |
|
|
113
|
+
| `/line`、SDK、print | 事件日志 | 直接 `false` + 一条 warn | 状态区文本(若宿主有) |
|
|
114
|
+
|
|
115
|
+
`confirm` 走的是和 `AskUserQuestion` 同一条提问通道,所以不需要插件自己画界面;`notify` 复用宿主的警示事件(`code: "plugin:<level>"`),宿主可据此区分级别。**插件不能阻塞会话**:任何等待都有结果,宿主不在就按「否」处理。
|
|
116
|
+
|
|
102
117
|
## 迭代
|
|
103
118
|
|
|
104
119
|
改完入口文件后执行 `/extension reload <id>`(等价于 `deactivate` + `activate`),或者在会话里用 `ManagePlugin` 先 `deactivate` 再 `activate`。
|
package/docs/sessions.md
CHANGED
|
@@ -33,7 +33,7 @@ append-only record stream.
|
|
|
33
33
|
|
|
34
34
|
## Compaction
|
|
35
35
|
|
|
36
|
-
Three layers, all automatic:
|
|
36
|
+
Three layers, all automatic (unless `loopControl.compactionMode = "off"`):
|
|
37
37
|
|
|
38
38
|
- **Micro** — keeps the most recent 20 messages (bounded to 40k tokens) and
|
|
39
39
|
truncates older ones.
|
|
@@ -47,6 +47,15 @@ Three layers, all automatic:
|
|
|
47
47
|
The summary is marked unverified: re-check anything it asserts before acting on
|
|
48
48
|
it. Configurable via `loopControl.compactionTriggerRatio` (0.5–0.99).
|
|
49
49
|
|
|
50
|
+
**Off mode** — `loopControl.compactionMode = "off"` for unattended and IM
|
|
51
|
+
sessions that must not stall on a compaction LLM call: micro and auto
|
|
52
|
+
compaction are disabled entirely (the context read paths never advance the
|
|
53
|
+
micro cutoff behind the caller's back, and a context-overflow error surfaces
|
|
54
|
+
instead of triggering recovery). At the 90% blocking threshold the model gets
|
|
55
|
+
a one-time wrap-up reminder per episode instead of being blocked; the
|
|
56
|
+
provider's own context limit remains the hard backstop. `/compact` still works
|
|
57
|
+
manually.
|
|
58
|
+
|
|
50
59
|
## Switching and concurrency
|
|
51
60
|
|
|
52
61
|
- One session is live at a time; its turns are serialised.
|
package/docs/skills.md
CHANGED
|
@@ -60,8 +60,11 @@ in `config.toml` merges every discovered skill instead of the project-scoped set
|
|
|
60
60
|
## Authoring a new skill
|
|
61
61
|
|
|
62
62
|
1. Run `/make-skill` and answer the prompts, or write the `SKILL.md` yourself.
|
|
63
|
-
2. `MakeSkillPlan` drafts a package (name, description, body, supporting files).
|
|
63
|
+
2. `MakeSkillPlan` drafts a package (name, description, body, supporting files, and a trigger test).
|
|
64
64
|
3. `MakeSkillApply` writes it into the plugin center, where `/plugin` manages it.
|
|
65
|
+
4. Run the plan's trigger test once it is installed: `verification.instructions` names
|
|
66
|
+
requests that should fire the skill and a near miss that should not. A skill that
|
|
67
|
+
fires on the near miss is over-broad; one that ignores its own triggers is invisible.
|
|
65
68
|
|
|
66
69
|
Skills are listed in the system prompt when the session starts, so a skill added
|
|
67
70
|
mid-session needs a new session (or `/skill` refresh) to appear.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scream-code",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.8",
|
|
4
4
|
"description": "A terminal-native AI agent for builders",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ScreamCli",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@earendil-works/pi-codemode": "^1.1.0",
|
|
59
59
|
"@huggingface/tokenizers": "^0.2.0",
|
|
60
60
|
"@larksuiteoapi/node-sdk": "^1.76.0",
|
|
61
|
-
"@liutod-scream/pi-tui": "^1.1
|
|
61
|
+
"@liutod-scream/pi-tui": "^1.5.1",
|
|
62
62
|
"@mariozechner/clipboard": "^0.3.2",
|
|
63
63
|
"chalk": "^5.4.1",
|
|
64
64
|
"cli-highlight": "^2.1.11",
|