agim-cli 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -28,85 +28,64 @@ All notable changes to this project will be documented in this file.
28
28
 
29
29
  详见各 1.2.15x 段。
30
30
 
31
- ## [1.2.159] - 2026-06-21
32
-
33
- ### Added — 模型成本/窗口元数据(复用 pi-ai 目录)
31
+ ## Native engine (pi-native) overview
34
32
 
35
- agim 自家 provider(anthropic / openai-compat)只带 `(providerType, model)` 字符串,
36
- 上游 API 常不回 cost `costUsd` 经常是空。新增 `src/core/llm/model-catalog.ts`
37
- 封装已依赖的 `@earendil-works/pi-ai` MODELS 全表:
33
+ > Consolidated from historical pi-native migration notes.
34
+ > Default native engine since `1.2.155`; legacy escape hatch: `IMHUB_NATIVE_ENGINE=legacy`.
38
35
 
39
- - `findCatalogModel` / `lookupModelMeta`(contextWindow / maxTokens)
40
- - `estimateCostUsd`(用 token 数走 `calculateCost`,含 Anthropic 1h cache 计费特例)
36
+ ### Shipped (1.2.155 1.2.159)
41
37
 
42
- `LlmProvider.enrichUsage()` API 不回成本时按目录回填 `costUsd`——所有 legacy
43
- provider(以及 v1.2.158 TUI token/cost 状态栏)无需自建价格表即可显示真实 $。
44
- 模型未收录或已计价则不动。
38
+ - **1.2.155**: switched native engine to pi-native (`AgentHarness` + durable JSONL session), added tool bridge, resolver, approval integration, runaway/stuck-loop guards.
39
+ - **1.2.156**: added pre-turn compaction (`IMHUB_NATIVE_COMPACTION`), provider retry/cache tuning (`IMHUB_NATIVE_*`).
40
+ - **1.2.157**: added A2A result compression (`IMHUB_A2A_MAX_RESULT_CHARS`) with overflow to artifact files.
41
+ - **1.2.158**: improved TUI interaction (`/agent` completion + token/cost status visibility).
42
+ - **1.2.159**: added model catalog-based usage enrichment for cost/window metadata backfill.
45
43
 
46
- ## [1.2.158] - 2026-06-21
44
+ ### Backlog (transport/UI dependent)
47
45
 
48
- ### Added TUI 体验(借鉴 pi CLI)
46
+ | ID | Capability | Blocker |
47
+ |---|---|---|
48
+ | B1 | token-level streaming | no incremental consumer path in IM/web transport |
49
+ | B2 | steering / follow-up queue | router is still one-message-per-turn |
50
+ | B3 | branch/time-travel navigation | no session-tree navigation in web chat |
49
51
 
50
- - **`/agent` 参数补全**:`/agent ` 后从 `registry.listAgents()` 实时补全 agent 名
51
- (Tab/↑↓ 选,Enter 先补全再回车切换)。原先 slash popup 只补命令名、遇空格即关;
52
- 这是首个命令参数补全。
53
- - **实时 token/cost 状态栏**:底部状态栏显示本会话累计用量(⇅ in/out tokens ·
54
- $cost),由 `sendPrompt` 的 `onUsage` 馈送。pi-native 三项全发,只发 cost 的
55
- adapter 也能显示。与本轮 compaction 搭配——上下文花费可见。
52
+ ### Ops note
56
53
 
57
- ## [1.2.157] - 2026-06-21
54
+ Avoid running full `bun test` / full build in low-memory production hosts managed by agim itself; prefer focused verification + CI for heavy suites.
58
55
 
59
- ### Added A2A 子输出压缩
56
+ ## [1.2.159] - 2026-06-21
60
57
 
61
- `call_agent`/A2A 子代理的 final-text 原先**全量**注入父代理的 LLM 上下文,一份长报告
62
- 会白烧父的上下文窗口。`callAgentByName` 现在按 `IMHUB_A2A_MAX_RESULT_CHARS`
63
- (默认 8000,`0` 关闭)截断父可见结果,完整内容溢出到
64
- `_agim-output/__a2a_result_full.md`,父可用 read 工具按需取全文。思路借鉴
65
- nicobailon/pi-subagents 的 `outputMode:file-only`。
58
+ ### Added
66
59
 
67
- - `artifacts.writeOutput()`(与 `readOutput` 对称)
68
- - `a2a.getA2AMaxResultChars / compressA2AResult`,在 `listOutputs` 前执行,溢出文件
69
- 自然出现在 `outputs[]`
60
+ - Added model catalog lookup and usage enrichment so missing provider-side cost metadata can be backfilled consistently.
70
61
 
71
- ## [1.2.156] - 2026-06-21
62
+ ## [1.2.158] - 2026-06-21
72
63
 
73
- ### Added — pi-native 引擎稳定性/成本(从 pi 续接的能力点)
64
+ ### Added
74
65
 
75
- - **上下文压缩**:每轮 prompt 前按 token 阈值主动 `harness.compact()` 摘要旧历史
76
- (pi 从不自动压缩)。修复长会话 JSONL 无限增长 → 上下文溢出。best-effort,失败不
77
- 阻塞本轮。`IMHUB_NATIVE_COMPACTION=off` 可关。
78
- - **provider 韧性 + prompt 缓存**:透传 `streamOptions`(maxRetries /
79
- maxRetryDelayMs / timeoutMs 扛 LLM 429/5xx + cacheRetention 开 provider prompt
80
- 缓存,省系统提示+历史的重复 token)。全 `IMHUB_NATIVE_*` 可覆盖,默认 2 / 20s /
81
- 120s / short。
66
+ - Improved TUI usability: `/agent` argument completion and cumulative token/cost status line.
82
67
 
83
- ### Docs
84
-
85
- - `PROJECTS/pi-native-migration.md`:记录已落地能力 + 3 项待 agim 传输/UI 改造的
86
- backlog(token 流式 / steering 队列 / branch 时间旅行)。
68
+ ## [1.2.157] - 2026-06-21
87
69
 
88
- ## [1.2.155] - 2026-06-21
70
+ ### Added
89
71
 
90
- ### Added pi-native 引擎
72
+ - Added A2A result compression with configurable max visible chars and artifact overflow output.
91
73
 
92
- pi-agent-core 接成 agim 原生 agent 引擎,并**设为默认 native engine**(legacy 引擎降级为逃生通道,`IMHUB_NATIVE_ENGINE=legacy` 可回退)。
74
+ ## [1.2.156] - 2026-06-21
93
75
 
94
- - 新增 `src/plugins/agents/pi-native/`:factory / tool-bridge(agim `ToolDef[]`+Dispatcher → pi `AgentTool`)/ provider-resolver(agim backend → pi-ai model resolver)/ approval(policy 审批门接入 `beforeToolCall`)/ tools
95
- - 护栏:max-iteration runaway guard(对齐 `IMHUB_NATIVE_AGENT_MAX_ITER`)、stuck-loop guard(同 tool+args 连错 3 次中断)、turn 错误不再静默吞掉、注入"真实身份 + role + skills"的 native system prompt
96
- - 继承 legacy native 别名(`na` / `llm` / `native-llm`)
76
+ ### Added
97
77
 
98
- ### Fixed A2A job 串联
78
+ - Added native pre-turn compaction and provider resilience/cache tuning knobs.
99
79
 
100
- - 每个 agent turn 在所有通道都建父 inline job;`parentJobId` 穿透到 native `call_agent`,web 端 A2A 视图可见子任务
80
+ ## [1.2.155] - 2026-06-21
101
81
 
102
- ### Changed — web-chat
82
+ ### Added
103
83
 
104
- - 助手消息「复制为 markdown」按钮;从 picker 切换 agent 前确认;命令切换(`/na` `/cc` 等)后同步 agent picker
105
- - 修复 search chain editor 的 `noUncheckedIndexedAccess` TS 报错
84
+ - Introduced pi-native as default native engine with durable session model and tool/policy integration.
106
85
 
107
- ### Tests
86
+ ### Fixed
108
87
 
109
- - pi-native 单测 14 pass(含 never-fail-silently 错误路径);后端 `typecheck` PASS
88
+ - Improved A2A parent-child job linkage and web visibility.
110
89
 
111
90
  ## [1.2.153] - 2026-06-19
112
91