chivgent 0.10.0 → 0.12.0
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 +142 -2
- package/README.zh-CN.md +126 -2
- package/dist/cli-options.d.ts +12 -0
- package/dist/cli-options.d.ts.map +1 -1
- package/dist/cli-options.js +51 -1
- package/dist/cli-options.js.map +1 -1
- package/dist/cli.js +267 -5
- package/dist/cli.js.map +1 -1
- package/dist/extensions/api.d.ts +38 -0
- package/dist/extensions/api.d.ts.map +1 -0
- package/dist/extensions/api.js +2 -0
- package/dist/extensions/api.js.map +1 -0
- package/dist/extensions/decide-trust.d.ts +28 -0
- package/dist/extensions/decide-trust.d.ts.map +1 -0
- package/dist/extensions/decide-trust.js +96 -0
- package/dist/extensions/decide-trust.js.map +1 -0
- package/dist/extensions/discover.d.ts +19 -0
- package/dist/extensions/discover.d.ts.map +1 -0
- package/dist/extensions/discover.js +61 -0
- package/dist/extensions/discover.js.map +1 -0
- package/dist/extensions/loader.d.ts +28 -0
- package/dist/extensions/loader.d.ts.map +1 -0
- package/dist/extensions/loader.js +60 -0
- package/dist/extensions/loader.js.map +1 -0
- package/dist/extensions/registry.d.ts +36 -0
- package/dist/extensions/registry.d.ts.map +1 -0
- package/dist/extensions/registry.js +115 -0
- package/dist/extensions/registry.js.map +1 -0
- package/dist/extensions/trust.d.ts +44 -0
- package/dist/extensions/trust.d.ts.map +1 -0
- package/dist/extensions/trust.js +129 -0
- package/dist/extensions/trust.js.map +1 -0
- package/dist/remote/client.d.ts +42 -0
- package/dist/remote/client.d.ts.map +1 -0
- package/dist/remote/client.js +173 -0
- package/dist/remote/client.js.map +1 -0
- package/dist/remote/framing.d.ts +33 -0
- package/dist/remote/framing.d.ts.map +1 -0
- package/dist/remote/framing.js +68 -0
- package/dist/remote/framing.js.map +1 -0
- package/dist/remote/protocol.d.ts +81 -0
- package/dist/remote/protocol.d.ts.map +1 -0
- package/dist/remote/protocol.js +79 -0
- package/dist/remote/protocol.js.map +1 -0
- package/dist/remote/repl.d.ts +18 -0
- package/dist/remote/repl.d.ts.map +1 -0
- package/dist/remote/repl.js +100 -0
- package/dist/remote/repl.js.map +1 -0
- package/dist/remote/server.d.ts +41 -0
- package/dist/remote/server.d.ts.map +1 -0
- package/dist/remote/server.js +214 -0
- package/dist/remote/server.js.map +1 -0
- package/dist/remote/socket-path.d.ts +33 -0
- package/dist/remote/socket-path.d.ts.map +1 -0
- package/dist/remote/socket-path.js +108 -0
- package/dist/remote/socket-path.js.map +1 -0
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +11 -1
- package/dist/render.js.map +1 -1
- package/dist/repl.d.ts +12 -1
- package/dist/repl.d.ts.map +1 -1
- package/dist/repl.js +47 -2
- package/dist/repl.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,11 @@ to study before adding production-harness complexity.
|
|
|
40
40
|
- Ranged `read_file` output with continuation hints and bounded tool results.
|
|
41
41
|
- Read-only by default; `--allow-writes` adds `write_file` and `edit_file`.
|
|
42
42
|
- An opt-in `bash` tool behind `--allow-shell`, with streamed output.
|
|
43
|
+
- Remote sessions: one process holds a session, others attach over a local socket.
|
|
44
|
+
- Several clients can watch one session; any of them can interrupt the run.
|
|
45
|
+
- Extensions that add tools, slash commands, event handlers and prompt text.
|
|
46
|
+
- Project extensions gated by a per-directory trust decision, taken before any
|
|
47
|
+
module is imported and refused outright when there is no terminal to ask.
|
|
43
48
|
- Commands run in their own process group, so cancelling kills the whole tree.
|
|
44
49
|
- Command output is truncated from the tail; the full text goes to a temp file.
|
|
45
50
|
- Exact-match `edit_file` that refuses missing or ambiguous edits.
|
|
@@ -144,6 +149,12 @@ Options:
|
|
|
144
149
|
--allow-writes Let the agent create and change files (default: read-only)
|
|
145
150
|
--allow-shell Let the agent run shell commands. This implies write access:
|
|
146
151
|
a shell is not bound by the workspace. Unix only.
|
|
152
|
+
--serve Expose this session on a local socket and keep running
|
|
153
|
+
--connect TARGET Attach to a served session, by id or socket path
|
|
154
|
+
--servers List the servers still answering, then exit
|
|
155
|
+
--no-extensions Do not load any extension, and do not ask about trust
|
|
156
|
+
--extensions List loaded extensions and what they register, then exit
|
|
157
|
+
--forget-trust Forget the trust decision covering this workspace, then exit
|
|
147
158
|
--context-window N Token budget for the context (default: 128000)
|
|
148
159
|
--no-compaction Send the whole transcript instead of summarising old turns
|
|
149
160
|
--no-session Do not record this run
|
|
@@ -379,6 +390,20 @@ src/
|
|
|
379
390
|
write-file.ts Whole-file create and replace
|
|
380
391
|
edit-file.ts Exact unique-match edit
|
|
381
392
|
bash.ts Shell command execution
|
|
393
|
+
remote/
|
|
394
|
+
protocol.ts Message shapes and version negotiation
|
|
395
|
+
framing.ts JSON Lines framing with a bounded buffer
|
|
396
|
+
server.ts Serves one session on a Unix socket
|
|
397
|
+
client.ts Attaches to a served session
|
|
398
|
+
repl.ts The interactive loop for an attached client
|
|
399
|
+
socket-path.ts Socket paths, staleness, and discovery
|
|
400
|
+
extensions/
|
|
401
|
+
trust.ts Per-directory trust store
|
|
402
|
+
decide-trust.ts The prompt, and the refusal when nobody can answer
|
|
403
|
+
discover.ts Where extensions live and which files count
|
|
404
|
+
api.ts What an extension may register
|
|
405
|
+
registry.ts Collects registrations, rejects conflicts
|
|
406
|
+
loader.ts Imports modules and contains their failures
|
|
382
407
|
shell/
|
|
383
408
|
types.ts Execution contract and shell error types
|
|
384
409
|
config.ts Shell resolution and the Windows guard
|
|
@@ -416,6 +441,104 @@ npm install -g ./chivgent-0.6.0.tgz
|
|
|
416
441
|
Tests use scripted or mocked LLM clients. A real API smoke test is deliberately
|
|
417
442
|
manual so the default test suite never consumes credits.
|
|
418
443
|
|
|
444
|
+
## Remote sessions
|
|
445
|
+
|
|
446
|
+
A session normally lives and dies with the terminal that started it. `--serve`
|
|
447
|
+
keeps it in one process and lets others attach:
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
# One terminal
|
|
451
|
+
chivgent --serve --allow-writes
|
|
452
|
+
# chivgent 0.12.0 serving session 2026-09-06T...
|
|
453
|
+
# socket: ~/.chivgent/sockets/2026-09-06T....sock
|
|
454
|
+
# capabilities: --allow-writes
|
|
455
|
+
|
|
456
|
+
# Another terminal
|
|
457
|
+
chivgent --servers # list what is running
|
|
458
|
+
chivgent --connect <id> # attach interactively
|
|
459
|
+
chivgent --connect <id> "question" # ask once and leave
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
A client holds no state: it sends prompts and renders the event stream the
|
|
463
|
+
server broadcasts. Several clients can attach at once — the extra ones watch the
|
|
464
|
+
same run as it happens, and any of them can interrupt it, because the run
|
|
465
|
+
belongs to the session rather than to whoever started it. A prompt sent while
|
|
466
|
+
another is running is refused rather than queued, and a client that disconnects
|
|
467
|
+
mid-run does not cancel it.
|
|
468
|
+
|
|
469
|
+
Attaching does not replay history; the session log already holds that. The
|
|
470
|
+
protocol is JSON Lines over a Unix socket, one object per line, the same shape
|
|
471
|
+
`--json` writes.
|
|
472
|
+
|
|
473
|
+
**Whoever can reach the socket has everything the server was started with.** If
|
|
474
|
+
it was started with `--allow-shell`, anyone who can connect can make the model
|
|
475
|
+
run commands, which is why the server prints its capabilities on startup: the
|
|
476
|
+
person attaching cannot see the flags you typed. The boundary is filesystem
|
|
477
|
+
permissions — sockets live in an owner-only directory under `CHIVGENT_HOME` —
|
|
478
|
+
and there is no TCP listener. For another machine, forward the socket over SSH
|
|
479
|
+
so that authentication is SSH's job.
|
|
480
|
+
|
|
481
|
+
## Extensions
|
|
482
|
+
|
|
483
|
+
An extension is an ES module that default-exports a function. It is called once
|
|
484
|
+
at startup with an API that can add a tool, add a slash command, subscribe to
|
|
485
|
+
runtime events, and append to the system prompt.
|
|
486
|
+
|
|
487
|
+
```js
|
|
488
|
+
// .chivgent/extensions/word-count.js
|
|
489
|
+
export default function (api) {
|
|
490
|
+
api.registerTool({
|
|
491
|
+
name: "word_count",
|
|
492
|
+
description: "Count the words in a workspace file.",
|
|
493
|
+
inputSchema: {
|
|
494
|
+
type: "object",
|
|
495
|
+
properties: { path: { type: "string" } },
|
|
496
|
+
required: ["path"],
|
|
497
|
+
additionalProperties: false,
|
|
498
|
+
},
|
|
499
|
+
async execute(args, context) {
|
|
500
|
+
const file = await context.workspace.readTextFile(args.path);
|
|
501
|
+
return {
|
|
502
|
+
content: `${file.content.split(/\s+/).filter(Boolean).length} words`,
|
|
503
|
+
isError: false,
|
|
504
|
+
};
|
|
505
|
+
},
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
api.contributeSystemPrompt("Use word_count instead of reading a file to count words.");
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Extensions are loaded from two places:
|
|
513
|
+
|
|
514
|
+
| Location | Loaded |
|
|
515
|
+
| --- | --- |
|
|
516
|
+
| `<CHIVGENT_HOME>/extensions/` | Always: it is your own machine's configuration |
|
|
517
|
+
| `<workspace>/.chivgent/extensions/` | Only after you trust the project |
|
|
518
|
+
|
|
519
|
+
Both accept `name.js` and `name/index.js`; nesting stops there. Plain JavaScript
|
|
520
|
+
only — compiling TypeScript yourself is cheaper than making chivgent carry a
|
|
521
|
+
TypeScript loader. A name already taken by a built-in tool or command is refused,
|
|
522
|
+
so an extension cannot shadow `read_file` or `/clear`, and a broken extension is
|
|
523
|
+
reported and skipped rather than taking chivgent down with it.
|
|
524
|
+
|
|
525
|
+
`chivgent --extensions` lists what loaded and what each one registered.
|
|
526
|
+
|
|
527
|
+
### Project trust
|
|
528
|
+
|
|
529
|
+
The first time you run chivgent in a project that ships extensions, it describes
|
|
530
|
+
what they are and asks once. The answer is stored in `<CHIVGENT_HOME>/trust.json`
|
|
531
|
+
against the resolved directory path, and matched by nearest ancestor, so trusting
|
|
532
|
+
`~/work` covers every repository under it. `--forget-trust` removes the decision
|
|
533
|
+
covering the current workspace.
|
|
534
|
+
|
|
535
|
+
**Trusting a project means letting its authors run code as you.** An extension
|
|
536
|
+
executes inside the chivgent process: it is not bound by the workspace, it does
|
|
537
|
+
not need `--allow-shell` to run a command, and it can read your environment
|
|
538
|
+
including the API key. That is why the question is asked before anything is
|
|
539
|
+
imported, and why the answer is no whenever there is nobody to ask — a CI job or
|
|
540
|
+
a piped run never loads a checkout's extensions on its own.
|
|
541
|
+
|
|
419
542
|
## Security model
|
|
420
543
|
|
|
421
544
|
- API keys come from `--api-key`, an environment variable, or an optional
|
|
@@ -444,6 +567,20 @@ manual so the default test suite never consumes credits.
|
|
|
444
567
|
work.
|
|
445
568
|
- Session logs record command output as well as file excerpts once
|
|
446
569
|
`--allow-shell` is on.
|
|
570
|
+
- Project extensions are loaded only after an explicit, recorded trust decision,
|
|
571
|
+
and never without a terminal to ask at. An extension runs in-process with your
|
|
572
|
+
permissions and is bound by none of the workspace limits above, so trusting a
|
|
573
|
+
project is the same order of authority as `--allow-shell`, reached by cloning
|
|
574
|
+
a repository rather than by typing a flag.
|
|
575
|
+
- User extensions under `<CHIVGENT_HOME>/extensions/` are always loaded; that
|
|
576
|
+
directory is your own configuration.
|
|
577
|
+
- Extensions cannot take the name of a built-in tool or command.
|
|
578
|
+
- `trust.json`, like the session log and the auth file, is written owner-only.
|
|
579
|
+
- A served session is reachable by anyone who can open its socket, and they get
|
|
580
|
+
every capability the server was started with. Sockets live in an owner-only
|
|
581
|
+
directory; the directory is the real gate, because a socket file exists
|
|
582
|
+
briefly with default permissions before it can be restricted.
|
|
583
|
+
- chivgent never listens on TCP. Use SSH forwarding to reach another machine.
|
|
447
584
|
- Writes resolve the deepest existing ancestor and reject a symlink at any
|
|
448
585
|
segment, so a planted link cannot redirect a write out of the workspace.
|
|
449
586
|
- Writes are staged in a sibling temp file and renamed into place, so an
|
|
@@ -489,8 +626,9 @@ project.
|
|
|
489
626
|
- [x] Opt-in `write_file` and `edit_file` behind `--allow-writes`
|
|
490
627
|
- [x] Provider registry and credential resolution chain
|
|
491
628
|
- [x] `bash` tool with streaming output, behind `--allow-shell`
|
|
492
|
-
- [
|
|
493
|
-
- [
|
|
629
|
+
- [x] Extensions and project trust
|
|
630
|
+
- [x] Remote sessions over a local socket
|
|
631
|
+
- [ ] TUI, telemetry, and evals
|
|
494
632
|
|
|
495
633
|
Per-command confirmation prompts and command allowlists are deliberately not
|
|
496
634
|
planned. Once a shell tool exists, `bash` can do anything `write_file` can and
|
|
@@ -509,6 +647,8 @@ session-level switches; the real boundary is a container.
|
|
|
509
647
|
- [Stage 6: Provider registry and credential chain](docs/stage-6-provider-registry.md)
|
|
510
648
|
- [Stage 7: Context budget and compaction](docs/stage-7-context-management.md)
|
|
511
649
|
- [Stage 8: Shell tool and streaming subprocesses](docs/stage-8-shell-tool.md)
|
|
650
|
+
- [Stage 9: Extensions and project trust](docs/stage-9-extensions.md)
|
|
651
|
+
- [Stage 10: Remote sessions](docs/stage-10-remote-sessions.md)
|
|
512
652
|
- [Release process](docs/releasing.md)
|
|
513
653
|
|
|
514
654
|
## Contributing
|
package/README.zh-CN.md
CHANGED
|
@@ -37,6 +37,11 @@
|
|
|
37
37
|
- 支持带续读提示的分段 `read_file`,所有工具结果都有容量上限。
|
|
38
38
|
- 默认只读;`--allow-writes` 才会启用 `write_file` 和 `edit_file`。
|
|
39
39
|
- 通过 `--allow-shell` 选择性开启的 `bash` 工具,输出边跑边显示。
|
|
40
|
+
- 远程会话:一个进程持有会话,其他进程通过本地 socket 接上来。
|
|
41
|
+
- 多个客户端可以同时观察同一个会话,其中任何一个都能中断当前运行。
|
|
42
|
+
- 扩展系统:可以添加工具、斜杠命令、事件订阅和 system prompt 片段。
|
|
43
|
+
- 项目扩展受按目录记录的信任决定门控;判定发生在任何模块被 import 之前,
|
|
44
|
+
没有终端可问时一律拒绝。
|
|
40
45
|
- 命令运行在独立进程组中,取消一次运行会杀掉整棵进程树。
|
|
41
46
|
- 命令输出从尾部截断,完整内容写入临时文件供按需读取。
|
|
42
47
|
- 精确匹配的 `edit_file`,命中缺失或不唯一时拒绝执行。
|
|
@@ -140,6 +145,12 @@ chivgent [选项] 进入交互式会话
|
|
|
140
145
|
--allow-writes 允许 Agent 创建和修改文件(默认只读)
|
|
141
146
|
--allow-shell 允许 Agent 执行 Shell 命令。它蕴含写权限:Shell 不受工作区
|
|
142
147
|
边界约束。仅支持 Unix。
|
|
148
|
+
--serve 把当前会话暴露在本地 socket 上并常驻
|
|
149
|
+
--connect TARGET 接上一个已服务的会话,可用 id 或 socket 路径
|
|
150
|
+
--servers 列出仍在响应的服务端后退出
|
|
151
|
+
--no-extensions 不加载任何扩展,也不询问信任
|
|
152
|
+
--extensions 列出已加载的扩展及其注册内容后退出
|
|
153
|
+
--forget-trust 忘记覆盖当前工作区的信任决定后退出
|
|
143
154
|
--context-window N 上下文的 Token 预算(默认:128000)
|
|
144
155
|
--no-compaction 发送完整 transcript,不压缩较早的轮次
|
|
145
156
|
--no-session 不记录本次运行
|
|
@@ -362,6 +373,20 @@ src/
|
|
|
362
373
|
write-file.ts 整文件创建与替换
|
|
363
374
|
edit-file.ts 精确唯一匹配编辑
|
|
364
375
|
bash.ts Shell 命令执行
|
|
376
|
+
remote/
|
|
377
|
+
protocol.ts 消息形状与版本协商
|
|
378
|
+
framing.ts 有界缓冲的 JSON Lines 分帧
|
|
379
|
+
server.ts 在 Unix socket 上服务一个会话
|
|
380
|
+
client.ts 接入一个已服务的会话
|
|
381
|
+
repl.ts 接入端的交互循环
|
|
382
|
+
socket-path.ts socket 路径、陈旧检测与发现
|
|
383
|
+
extensions/
|
|
384
|
+
trust.ts 按目录记录的信任存储
|
|
385
|
+
decide-trust.ts 询问流程,以及无人可问时的拒绝
|
|
386
|
+
discover.ts 扩展的位置与文件识别规则
|
|
387
|
+
api.ts 扩展可以注册什么
|
|
388
|
+
registry.ts 收集注册项并拒绝冲突
|
|
389
|
+
loader.ts import 模块并隔离其失败
|
|
365
390
|
shell/
|
|
366
391
|
types.ts 执行契约与 Shell 错误类型
|
|
367
392
|
config.ts Shell 解析与 Windows 拦截
|
|
@@ -399,6 +424,91 @@ npm install -g ./chivgent-0.6.0.tgz
|
|
|
399
424
|
测试使用脚本化或 Mock LLM Client。真实 API Smoke Test 需要手工执行,因此默认
|
|
400
425
|
测试不会消耗 API 额度。
|
|
401
426
|
|
|
427
|
+
## 远程会话
|
|
428
|
+
|
|
429
|
+
会话通常和启动它的那个终端同生共死。`--serve` 让它留在一个进程里,其他进程可以接上来:
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
# 终端 A
|
|
433
|
+
chivgent --serve --allow-writes
|
|
434
|
+
# chivgent 0.12.0 serving session 2026-09-06T...
|
|
435
|
+
# socket: ~/.chivgent/sockets/2026-09-06T....sock
|
|
436
|
+
# capabilities: --allow-writes
|
|
437
|
+
|
|
438
|
+
# 终端 B
|
|
439
|
+
chivgent --servers # 列出正在运行的服务端
|
|
440
|
+
chivgent --connect <id> # 交互式接入
|
|
441
|
+
chivgent --connect <id> "问题" # 问一次就走
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
客户端不持有任何状态:它只负责发 prompt、渲染服务端广播的事件流。可以同时接入多个
|
|
445
|
+
客户端——多出来的那些实时观察同一次运行,并且**任何一个都能中断它**,因为运行属于会话,
|
|
446
|
+
不属于"谁发起的"。运行期间再来一个 prompt 会被拒绝而不是排队;客户端中途断开也不会
|
|
447
|
+
取消正在跑的运行。
|
|
448
|
+
|
|
449
|
+
接入时**不重放历史**——那是会话日志的职责。协议是 Unix socket 上的 JSON Lines,
|
|
450
|
+
一行一个对象,和 `--json` 输出同一种形状。
|
|
451
|
+
|
|
452
|
+
**能连上这个 socket 的人,拥有服务端启动时的全部能力。** 如果它是带 `--allow-shell`
|
|
453
|
+
起来的,那么任何能连上的人都能让模型执行命令——这正是服务端启动时会打印本次能力的原因:
|
|
454
|
+
接入的人看不到你敲了什么参数。边界是文件系统权限(socket 位于 `CHIVGENT_HOME` 下仅
|
|
455
|
+
所有者可访问的目录),并且**不监听 TCP**。要跨机器访问请用 SSH 转发,让认证由 SSH 负责。
|
|
456
|
+
|
|
457
|
+
## 扩展系统
|
|
458
|
+
|
|
459
|
+
一个扩展就是默认导出一个函数的 ES 模块。启动时它会被调用一次,拿到的 API 可以注册
|
|
460
|
+
工具、注册斜杠命令、订阅运行时事件、追加 system prompt。
|
|
461
|
+
|
|
462
|
+
```js
|
|
463
|
+
// .chivgent/extensions/word-count.js
|
|
464
|
+
export default function (api) {
|
|
465
|
+
api.registerTool({
|
|
466
|
+
name: "word_count",
|
|
467
|
+
description: "统计工作区某个文件的词数。",
|
|
468
|
+
inputSchema: {
|
|
469
|
+
type: "object",
|
|
470
|
+
properties: { path: { type: "string" } },
|
|
471
|
+
required: ["path"],
|
|
472
|
+
additionalProperties: false,
|
|
473
|
+
},
|
|
474
|
+
async execute(args, context) {
|
|
475
|
+
const file = await context.workspace.readTextFile(args.path);
|
|
476
|
+
return {
|
|
477
|
+
content: `${file.content.split(/\s+/).filter(Boolean).length} words`,
|
|
478
|
+
isError: false,
|
|
479
|
+
};
|
|
480
|
+
},
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
api.contributeSystemPrompt("需要数词数时用 word_count,不要整篇读文件。");
|
|
484
|
+
}
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
扩展从两个位置加载:
|
|
488
|
+
|
|
489
|
+
| 位置 | 何时加载 |
|
|
490
|
+
| --- | --- |
|
|
491
|
+
| `<CHIVGENT_HOME>/extensions/` | 始终加载——那是你自己机器上的配置 |
|
|
492
|
+
| `<工作区>/.chivgent/extensions/` | 只有在你信任该项目之后 |
|
|
493
|
+
|
|
494
|
+
两处都接受 `name.js` 和 `name/index.js`,不再往下递归。**只支持纯 JavaScript**:
|
|
495
|
+
用 TypeScript 写的话自己编译成 `.js` 即可,为此让 chivgent 背上一个 TS 运行时加载器
|
|
496
|
+
不划算。与内置工具或命令重名的注册会被拒绝,所以扩展无法顶替 `read_file` 或
|
|
497
|
+
`/clear`;某个扩展坏掉只会被报告并跳过,不会把 chivgent 一起带走。
|
|
498
|
+
|
|
499
|
+
`chivgent --extensions` 可以列出加载了哪些扩展、各自注册了什么。
|
|
500
|
+
|
|
501
|
+
### Project Trust
|
|
502
|
+
|
|
503
|
+
第一次在带扩展的项目里运行 chivgent 时,它会说明这些扩展是什么并询问一次。答案记在
|
|
504
|
+
`<CHIVGENT_HOME>/trust.json` 里,键是解析后的目录路径,**按最近祖先匹配**——信任
|
|
505
|
+
`~/work` 就覆盖它下面所有仓库。`--forget-trust` 可以删掉覆盖当前工作区的那条决定。
|
|
506
|
+
|
|
507
|
+
**信任一个项目,等于允许这个仓库的作者以你的身份执行代码。** 扩展在 chivgent 进程内
|
|
508
|
+
运行:不受工作区边界约束,不需要 `--allow-shell` 就能执行命令,也能读到你环境变量里的
|
|
509
|
+
API Key。这正是询问必须发生在 import 之前的原因,也是"没人可问时一律拒绝"的原因——
|
|
510
|
+
CI 任务或管道运行永远不会自作主张去执行一个 clone 里的代码。
|
|
511
|
+
|
|
402
512
|
## 安全模型
|
|
403
513
|
|
|
404
514
|
- API Key 依次从 `--api-key`、环境变量、可选的 `auth.json` 解析,绝不能提交到仓库。
|
|
@@ -417,6 +527,17 @@ npm install -g ./chivgent-0.6.0.tgz
|
|
|
417
527
|
- 被截断的命令输出会写入临时文件供模型按需读取。该文件仅所有者可读,但运行结束后
|
|
418
528
|
**不会自动删除**,其中可能包含命令打印的任何内容。处理敏感数据后请清理临时目录。
|
|
419
529
|
- 开启 `--allow-shell` 后,会话日志除文件片段外还会记录命令输出。
|
|
530
|
+
- 项目扩展只有在存在明确的、已记录的信任决定之后才会加载,且没有终端可问时绝不加载。
|
|
531
|
+
扩展以你的权限在进程内运行,上面那些工作区限制对它一概不适用——因此"信任一个项目"
|
|
532
|
+
与 `--allow-shell` 是同一量级的授权,区别只在于前者由 clone 一个仓库触发,
|
|
533
|
+
后者要你亲手敲一个参数。
|
|
534
|
+
- `<CHIVGENT_HOME>/extensions/` 下的用户级扩展始终加载,那是你自己的配置。
|
|
535
|
+
- 扩展无法占用内置工具或内置命令的名字。
|
|
536
|
+
- `trust.json` 与会话日志、认证文件一样,以仅所有者可读的权限写入。
|
|
537
|
+
- 被服务的会话对任何能打开其 socket 的人可达,且他们获得服务端启动时的全部能力。
|
|
538
|
+
socket 位于仅所有者可访问的目录中;**真正起作用的是目录权限**,因为 socket 文件在
|
|
539
|
+
能被收紧权限之前会短暂地以默认权限存在。
|
|
540
|
+
- chivgent 从不监听 TCP。跨机器访问请使用 SSH 转发。
|
|
420
541
|
- 写入会解析到最深层已存在的祖先目录,路径上任何一段是符号链接都会被拒绝,
|
|
421
542
|
因此预先植入的链接无法把写入重定向到工作区之外。
|
|
422
543
|
- 写入先落到同目录的临时文件再 rename 就位,中断的写入不会截断已有文件。
|
|
@@ -455,8 +576,9 @@ npm install -g ./chivgent-0.6.0.tgz
|
|
|
455
576
|
- [x] 通过 `--allow-writes` 选择性开启的 `write_file` 和 `edit_file`
|
|
456
577
|
- [x] Provider Registry 与凭据解析链
|
|
457
578
|
- [x] 通过 `--allow-shell` 开启的 `bash` 工具,带流式输出
|
|
458
|
-
- [
|
|
459
|
-
- [
|
|
579
|
+
- [x] 扩展系统与 Project Trust
|
|
580
|
+
- [x] 基于本地 socket 的远程会话
|
|
581
|
+
- [ ] TUI、Telemetry 和 Evals
|
|
460
582
|
|
|
461
583
|
逐条命令确认和命令白名单是**主动放弃**的方向。有了 Shell 工具之后,`bash` 能做的
|
|
462
584
|
事是 `write_file` 的超集,任何白名单都能被一行 `sh -c` 绕开,而逐条弹确认只会训练
|
|
@@ -473,6 +595,8 @@ npm install -g ./chivgent-0.6.0.tgz
|
|
|
473
595
|
- [Stage 6:Provider Registry 与凭证解析链](docs/stage-6-provider-registry.md)
|
|
474
596
|
- [Stage 7:上下文预算与压缩](docs/stage-7-context-management.md)
|
|
475
597
|
- [Stage 8:Shell 工具与流式子进程](docs/stage-8-shell-tool.md)
|
|
598
|
+
- [Stage 9:扩展系统与 Project Trust](docs/stage-9-extensions.md)
|
|
599
|
+
- [Stage 10:远程会话](docs/stage-10-remote-sessions.md)
|
|
476
600
|
- [发布流程](docs/releasing.md)
|
|
477
601
|
|
|
478
602
|
## 参与贡献
|
package/dist/cli-options.d.ts
CHANGED
|
@@ -39,6 +39,18 @@ export interface CliOptions {
|
|
|
39
39
|
* can do everything the write tools can and is not bound by the workspace.
|
|
40
40
|
*/
|
|
41
41
|
readonly allowShell: boolean;
|
|
42
|
+
/** Load extensions from the user and (once trusted) the project directory. */
|
|
43
|
+
readonly extensions: boolean;
|
|
44
|
+
/** List loaded extensions and what they registered, then exit. */
|
|
45
|
+
readonly listExtensions: boolean;
|
|
46
|
+
/** Forget the trust decision covering this workspace and exit. */
|
|
47
|
+
readonly forgetTrust: boolean;
|
|
48
|
+
/** Expose this session on a local socket and stay running. */
|
|
49
|
+
readonly serve: boolean;
|
|
50
|
+
/** Attach to a session served elsewhere; a session id or a socket path. */
|
|
51
|
+
readonly connect?: string;
|
|
52
|
+
/** List the servers that are still answering, then exit. */
|
|
53
|
+
readonly listServers: boolean;
|
|
42
54
|
/** API key supplied for this run only, overriding every other source. */
|
|
43
55
|
readonly apiKey?: string;
|
|
44
56
|
/** Token budget the context is kept inside. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-options.d.ts","sourceRoot":"","sources":["../src/cli-options.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,QAC6D,CAAC;AAElF,OAAO,EAEL,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAGjC,2CAA2C;AAC3C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAI1C;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ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CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,yEAAyE;IACzE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,WAAW,EAAE,cAAc,EAC3B,QAAQ,GAAE,gBAA0C,GACnD,UAAU,CAoIZ;AAED,wBAAgB,QAAQ,CACtB,QAAQ,GAAE,gBAA0C,GACnD,MAAM,CAuDR"}
|
package/dist/cli-options.js
CHANGED
|
@@ -29,6 +29,12 @@ export function parseCliArgs(argv, environment, registry = defaultProviderRegist
|
|
|
29
29
|
let listSessions = false;
|
|
30
30
|
let allowWrites = false;
|
|
31
31
|
let allowShell = false;
|
|
32
|
+
let extensions = true;
|
|
33
|
+
let serve = false;
|
|
34
|
+
let connect;
|
|
35
|
+
let listServers = false;
|
|
36
|
+
let listExtensions = false;
|
|
37
|
+
let forgetTrust = false;
|
|
32
38
|
let maxTurnsExplicit = false;
|
|
33
39
|
let help = false;
|
|
34
40
|
let version = false;
|
|
@@ -87,6 +93,25 @@ export function parseCliArgs(argv, environment, registry = defaultProviderRegist
|
|
|
87
93
|
else if (argument === "--allow-shell") {
|
|
88
94
|
allowShell = true;
|
|
89
95
|
}
|
|
96
|
+
else if (argument === "--serve") {
|
|
97
|
+
serve = true;
|
|
98
|
+
}
|
|
99
|
+
else if (argument === "--connect") {
|
|
100
|
+
connect = readOptionValue(argv, index, "--connect");
|
|
101
|
+
index += 1;
|
|
102
|
+
}
|
|
103
|
+
else if (argument === "--servers") {
|
|
104
|
+
listServers = true;
|
|
105
|
+
}
|
|
106
|
+
else if (argument === "--no-extensions") {
|
|
107
|
+
extensions = false;
|
|
108
|
+
}
|
|
109
|
+
else if (argument === "--extensions") {
|
|
110
|
+
listExtensions = true;
|
|
111
|
+
}
|
|
112
|
+
else if (argument === "--forget-trust") {
|
|
113
|
+
forgetTrust = true;
|
|
114
|
+
}
|
|
90
115
|
else if (argument === "--context-window") {
|
|
91
116
|
contextWindow = parseContextWindow(readOptionValue(argv, index, "--context-window"));
|
|
92
117
|
index += 1;
|
|
@@ -124,6 +149,12 @@ export function parseCliArgs(argv, environment, registry = defaultProviderRegist
|
|
|
124
149
|
listSessions,
|
|
125
150
|
allowWrites,
|
|
126
151
|
allowShell,
|
|
152
|
+
extensions,
|
|
153
|
+
serve,
|
|
154
|
+
...(connect === undefined ? {} : { connect }),
|
|
155
|
+
listServers,
|
|
156
|
+
listExtensions,
|
|
157
|
+
forgetTrust,
|
|
127
158
|
...(apiKey === undefined ? {} : { apiKey }),
|
|
128
159
|
contextWindow,
|
|
129
160
|
compaction,
|
|
@@ -152,6 +183,12 @@ Options:
|
|
|
152
183
|
--allow-writes Let the agent create and change files (default: read-only)
|
|
153
184
|
--allow-shell Let the agent run shell commands. This implies write access:
|
|
154
185
|
a shell is not bound by the workspace. Unix only.
|
|
186
|
+
--serve Expose this session on a local socket and keep running
|
|
187
|
+
--connect TARGET Attach to a served session, by id or socket path
|
|
188
|
+
--servers List the servers still answering, then exit
|
|
189
|
+
--no-extensions Do not load any extension, and do not ask about trust
|
|
190
|
+
--extensions List loaded extensions and what they register, then exit
|
|
191
|
+
--forget-trust Forget the trust decision covering this workspace, then exit
|
|
155
192
|
--context-window N Token budget for the context (default: ${DEFAULT_CONTEXT_WINDOW})
|
|
156
193
|
--no-compaction Send the whole transcript instead of summarising old turns
|
|
157
194
|
--no-session Do not record this run
|
|
@@ -163,9 +200,22 @@ API keys are resolved in this order, first match wins:
|
|
|
163
200
|
|
|
164
201
|
Providers:
|
|
165
202
|
${describeProviders(registry)}
|
|
203
|
+
Extensions:
|
|
204
|
+
<CHIVGENT_HOME>/extensions/*.js Always loaded
|
|
205
|
+
<workspace>/.chivgent/extensions/*.js
|
|
206
|
+
Loaded only after you trust the project. An extension runs
|
|
207
|
+
as code inside chivgent, with your permissions, and is not
|
|
208
|
+
limited by the workspace.
|
|
209
|
+
|
|
210
|
+
Remote sessions:
|
|
211
|
+
chivgent --serve Hold a session and expose it locally
|
|
212
|
+
chivgent --connect ID Attach from another terminal
|
|
213
|
+
Anyone who can reach the socket gets everything the server was started with.
|
|
214
|
+
Sockets live in <CHIVGENT_HOME>/sockets, an owner-only directory.
|
|
215
|
+
|
|
166
216
|
Environment:
|
|
167
217
|
OPENAI_BASE_URL Required when --provider openai-compatible
|
|
168
|
-
CHIVGENT_HOME Session and
|
|
218
|
+
CHIVGENT_HOME Session, auth, trust and extension directory (default: ~/.chivgent)
|
|
169
219
|
`;
|
|
170
220
|
}
|
|
171
221
|
function describeProviders(registry) {
|
package/dist/cli-options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-options.js","sourceRoot":"","sources":["../src/cli-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAmC,CAAC;AAErF,MAAM,CAAC,MAAM,OAAO,GAClB,OAAO,eAAe,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AAElF,OAAO,EACL,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAKtE,MAAM,CAAC,MAAM,iBAAiB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