@deepwhale/coding-agent 1.0.10 → 1.0.12

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.
Files changed (151) hide show
  1. package/LICENSE +21 -21
  2. package/package.json +1 -1
  3. package/dist/agent/agent-compaction.d.ts +0 -74
  4. package/dist/agent/agent-compaction.d.ts.map +0 -1
  5. package/dist/agent/agent-compaction.js +0 -145
  6. package/dist/agent/agent-compaction.js.map +0 -1
  7. package/dist/agent/index.d.ts +0 -16
  8. package/dist/agent/index.d.ts.map +0 -1
  9. package/dist/agent/index.js +0 -17
  10. package/dist/agent/index.js.map +0 -1
  11. package/dist/agent/session-adapter.d.ts +0 -177
  12. package/dist/agent/session-adapter.d.ts.map +0 -1
  13. package/dist/agent/session-adapter.js +0 -365
  14. package/dist/agent/session-adapter.js.map +0 -1
  15. package/dist/agent/tool-loop.d.ts +0 -123
  16. package/dist/agent/tool-loop.d.ts.map +0 -1
  17. package/dist/agent/tool-loop.js +0 -436
  18. package/dist/agent/tool-loop.js.map +0 -1
  19. package/dist/env/load-project-env.d.ts +0 -40
  20. package/dist/env/load-project-env.d.ts.map +0 -1
  21. package/dist/env/load-project-env.js +0 -80
  22. package/dist/env/load-project-env.js.map +0 -1
  23. package/dist/index.d.ts +0 -31
  24. package/dist/index.d.ts.map +0 -1
  25. package/dist/index.js +0 -30
  26. package/dist/index.js.map +0 -1
  27. package/dist/llm-factory.d.ts +0 -50
  28. package/dist/llm-factory.d.ts.map +0 -1
  29. package/dist/llm-factory.js +0 -110
  30. package/dist/llm-factory.js.map +0 -1
  31. package/dist/modes/index.d.ts +0 -14
  32. package/dist/modes/index.d.ts.map +0 -1
  33. package/dist/modes/index.js +0 -14
  34. package/dist/modes/index.js.map +0 -1
  35. package/dist/modes/print.d.ts +0 -50
  36. package/dist/modes/print.d.ts.map +0 -1
  37. package/dist/modes/print.js +0 -236
  38. package/dist/modes/print.js.map +0 -1
  39. package/dist/modes/rpc.d.ts +0 -52
  40. package/dist/modes/rpc.d.ts.map +0 -1
  41. package/dist/modes/rpc.js +0 -316
  42. package/dist/modes/rpc.js.map +0 -1
  43. package/dist/modes/tui.d.ts +0 -112
  44. package/dist/modes/tui.d.ts.map +0 -1
  45. package/dist/modes/tui.js +0 -733
  46. package/dist/modes/tui.js.map +0 -1
  47. package/dist/policy/args-digest.d.ts +0 -13
  48. package/dist/policy/args-digest.d.ts.map +0 -1
  49. package/dist/policy/args-digest.js +0 -29
  50. package/dist/policy/args-digest.js.map +0 -1
  51. package/dist/policy/chain.d.ts +0 -19
  52. package/dist/policy/chain.d.ts.map +0 -1
  53. package/dist/policy/chain.js +0 -24
  54. package/dist/policy/chain.js.map +0 -1
  55. package/dist/policy/index.d.ts +0 -17
  56. package/dist/policy/index.d.ts.map +0 -1
  57. package/dist/policy/index.js +0 -16
  58. package/dist/policy/index.js.map +0 -1
  59. package/dist/policy/sanitize-reason.d.ts +0 -11
  60. package/dist/policy/sanitize-reason.d.ts.map +0 -1
  61. package/dist/policy/sanitize-reason.js +0 -24
  62. package/dist/policy/sanitize-reason.js.map +0 -1
  63. package/dist/policy/static-rules.d.ts +0 -32
  64. package/dist/policy/static-rules.d.ts.map +0 -1
  65. package/dist/policy/static-rules.js +0 -106
  66. package/dist/policy/static-rules.js.map +0 -1
  67. package/dist/policy/types.d.ts +0 -56
  68. package/dist/policy/types.d.ts.map +0 -1
  69. package/dist/policy/types.js +0 -13
  70. package/dist/policy/types.js.map +0 -1
  71. package/dist/repl/repl-confirm.d.ts +0 -49
  72. package/dist/repl/repl-confirm.d.ts.map +0 -1
  73. package/dist/repl/repl-confirm.js +0 -88
  74. package/dist/repl/repl-confirm.js.map +0 -1
  75. package/dist/repl.d.ts +0 -154
  76. package/dist/repl.d.ts.map +0 -1
  77. package/dist/repl.js +0 -780
  78. package/dist/repl.js.map +0 -1
  79. package/dist/sandbox/docker-runner.d.ts +0 -147
  80. package/dist/sandbox/docker-runner.d.ts.map +0 -1
  81. package/dist/sandbox/docker-runner.js +0 -426
  82. package/dist/sandbox/docker-runner.js.map +0 -1
  83. package/dist/sandbox/env-gate.d.ts +0 -28
  84. package/dist/sandbox/env-gate.d.ts.map +0 -1
  85. package/dist/sandbox/env-gate.js +0 -65
  86. package/dist/sandbox/env-gate.js.map +0 -1
  87. package/dist/sandbox/local-runner.d.ts +0 -29
  88. package/dist/sandbox/local-runner.d.ts.map +0 -1
  89. package/dist/sandbox/local-runner.js +0 -79
  90. package/dist/sandbox/local-runner.js.map +0 -1
  91. package/dist/sandbox/types.d.ts +0 -80
  92. package/dist/sandbox/types.d.ts.map +0 -1
  93. package/dist/sandbox/types.js +0 -25
  94. package/dist/sandbox/types.js.map +0 -1
  95. package/dist/tools/bash.d.ts +0 -35
  96. package/dist/tools/bash.d.ts.map +0 -1
  97. package/dist/tools/bash.js +0 -233
  98. package/dist/tools/bash.js.map +0 -1
  99. package/dist/tools/edit-file.d.ts +0 -22
  100. package/dist/tools/edit-file.d.ts.map +0 -1
  101. package/dist/tools/edit-file.js +0 -79
  102. package/dist/tools/edit-file.js.map +0 -1
  103. package/dist/tools/find.d.ts +0 -21
  104. package/dist/tools/find.d.ts.map +0 -1
  105. package/dist/tools/find.js +0 -168
  106. package/dist/tools/find.js.map +0 -1
  107. package/dist/tools/grep.d.ts +0 -19
  108. package/dist/tools/grep.d.ts.map +0 -1
  109. package/dist/tools/grep.js +0 -170
  110. package/dist/tools/grep.js.map +0 -1
  111. package/dist/tools/index.d.ts +0 -10
  112. package/dist/tools/index.d.ts.map +0 -1
  113. package/dist/tools/index.js +0 -10
  114. package/dist/tools/index.js.map +0 -1
  115. package/dist/tools/read-file.d.ts +0 -18
  116. package/dist/tools/read-file.d.ts.map +0 -1
  117. package/dist/tools/read-file.js +0 -52
  118. package/dist/tools/read-file.js.map +0 -1
  119. package/dist/tools/registry.d.ts +0 -39
  120. package/dist/tools/registry.d.ts.map +0 -1
  121. package/dist/tools/registry.js +0 -67
  122. package/dist/tools/registry.js.map +0 -1
  123. package/dist/tools/write-file.d.ts +0 -18
  124. package/dist/tools/write-file.d.ts.map +0 -1
  125. package/dist/tools/write-file.js +0 -47
  126. package/dist/tools/write-file.js.map +0 -1
  127. package/dist/tui-ink-bundle.js +0 -38587
  128. package/dist/types.d.ts +0 -89
  129. package/dist/types.d.ts.map +0 -1
  130. package/dist/types.js +0 -5
  131. package/dist/types.js.map +0 -1
  132. package/dist/util/index.d.ts +0 -16
  133. package/dist/util/index.d.ts.map +0 -1
  134. package/dist/util/index.js +0 -16
  135. package/dist/util/index.js.map +0 -1
  136. package/dist/util/tui-history.d.ts +0 -37
  137. package/dist/util/tui-history.d.ts.map +0 -1
  138. package/dist/util/tui-history.js +0 -93
  139. package/dist/util/tui-history.js.map +0 -1
  140. package/dist/verify/format-report.d.ts +0 -57
  141. package/dist/verify/format-report.d.ts.map +0 -1
  142. package/dist/verify/format-report.js +0 -128
  143. package/dist/verify/format-report.js.map +0 -1
  144. package/dist/verify/index.d.ts +0 -8
  145. package/dist/verify/index.d.ts.map +0 -1
  146. package/dist/verify/index.js +0 -8
  147. package/dist/verify/index.js.map +0 -1
  148. package/dist/verify/verify-runner.d.ts +0 -186
  149. package/dist/verify/verify-runner.d.ts.map +0 -1
  150. package/dist/verify/verify-runner.js +0 -707
  151. package/dist/verify/verify-runner.js.map +0 -1
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 yysf1949
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 yysf1949
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepwhale/coding-agent",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "DeepWhale CLI: DeepSeek-first AI coding agent. Linear sessions, 6 tools, Docker sandbox.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,74 +0,0 @@
1
- /**
2
- * Tool Loop + Compaction 集成 (Sprint 1c-revive-2-D-5 + D-5-2)
3
- *
4
- * 拍板 (跟 P21 / P27 跨协议 6 cell 一致):
5
- * - runToolLoop 每次 LLM call 前, 测 messages token 数
6
- * - 触发 (>= window * compactRatio) → 调 summaryFn (LLM 走同 client 拍板)
7
- * - 成功 → 替换 working messages, 写 1 条 'compaction' event 到 SessionWriter
8
- * - 失败 → CompactionState 累计; latch → 写 1 条 'compaction_paused' event
9
- * - paused → 跳过 compaction (不浪费 LLM token 调 summaryFn, 防 death loop)
10
- *
11
- * 协议集成 (P38 拍板 + D-5-2 拍板):
12
- * - protocol: 'openai' | 'anthropic' (用于 summaryFn, 不同协议 system prompt 不同)
13
- * - 集成在 runToolLoop 入口, 跟 tool-loop.ts P21 6 cell 拍板一致:
14
- * DeepSeek + Anthropic 协议都走同一 hook
15
- *
16
- * 不变量:
17
- * - compaction 永不 throw 给 runToolLoop (防 LLM 续聊死锁)
18
- * - 失败 event 总能写盘 (即使 writer.append 抛错, 也只 warn 不 throw)
19
- * - paused 后仍跑 runToolLoop 正常 (不阻塞用户任务, 仅不再 compact)
20
- *
21
- * @module @deepwhale/coding-agent/agent-compaction
22
- */
23
- import { type ChatMessage, type LLMClient } from '@deepwhale/llm';
24
- import { type CompactionConfig, type SummarizeFn, CompactionState } from '@deepwhale/core';
25
- import type { SessionWriter } from '@deepwhale/core';
26
- import type { ToolLoopOptions, ToolLoopResult } from './tool-loop.js';
27
- /**
28
- * Compaction 集成配置 (runToolLoop 包装层用).
29
- *
30
- * 跟 core CompactionConfig 区别:
31
- * - client 来自 coding-agent 包 (P21 拍板: 协议从 LLMClient 推断)
32
- * - state 由集成层管 (caller 用 new CompactionState(...) 注入)
33
- * - protocol 拍板: 'openai' (DeepSeek) | 'anthropic' — summaryFn 的 system prompt 不同
34
- */
35
- export interface AgentCompactionConfig extends CompactionConfig {
36
- /** 协议拍板 — 跟 P21 6 cell 一致. summaryFn 内部用此拍 system prompt 模板. */
37
- readonly protocol: 'openai' | 'anthropic';
38
- /** SessionWriter — 写 'compaction' / 'compaction_paused' event 用 */
39
- readonly writer: SessionWriter;
40
- /** CompactionState — caller 管, 跨 runToolLoop 调用持久化 */
41
- readonly state: CompactionState;
42
- }
43
- /**
44
- * 跑 runToolLoop 集成 compaction 触发.
45
- *
46
- * 拍板行为 (跟 P21 6 cell 一致):
47
- * 1. 入口测 token → 触发则 compact → 替换 working
48
- * 2. runToolLoop 内部每个 LLM call 前不重复触发 (避免 per-step 开销)
49
- * 3. 失败 latch → 写 paused event, runToolLoop 继续跑 (不阻塞)
50
- *
51
- * Sprint 1c-revive-2-D-6 (review P1 修复, 2026-06-04): caller-side system prefix
52
- * handling. 拍板: REPL/caller 可能把系统提示拼到 messages 最前面 (e.g. integration
53
- * test fixture, 或未来 system prompt 注入). 传 compact() 之前先 **剥掉** 连续
54
- * system 前缀, 让 compact 看到的 index 跟 session-adapter 累积 messages
55
- * (user/assistant/tool + compaction summary) 同 index 空间, replaced_range
56
- * 切 reload replay 同步. compact 后把 system 前缀 **原样 prepend 回** 替换后
57
- * 的 messages, LLM 看到的 context 跟 caller 拼的一致.
58
- *
59
- * @param client LLM client
60
- * @param messages 入口 messages (不变, 内部 copy)
61
- * @param options runToolLoop 原生 options
62
- * @param compaction 集成配置
63
- * @param summaryFn 生成 summary text 的 callback (caller 决定 LLM 协议)
64
- * @returns ToolLoopResult
65
- */
66
- export declare function runToolLoopWithCompaction(client: LLMClient, messages: ReadonlyArray<ChatMessage>, options: ToolLoopOptions | undefined, compaction: AgentCompactionConfig, summaryFn: SummarizeFn): Promise<ToolLoopResult>;
67
- /**
68
- * 便捷工具: 估算当前 messages 的 token 数 (供 REPL / footer 拍板显示用).
69
- *
70
- * 跟 compaction.ts 的 estimateTokens 拍板一致 (char/4 粗估).
71
- * 集成在 coding-agent 包, 供 REPL 端零成本 import core.
72
- */
73
- export declare function estimateContextTokens(messages: ReadonlyArray<ChatMessage>): number;
74
- //# sourceMappingURL=agent-compaction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-compaction.d.ts","sourceRoot":"","sources":["../../src/agent/agent-compaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAEhB,eAAe,EAGhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGtE;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IAC1C,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,EACpC,OAAO,EAAE,eAAe,YAAK,EAC7B,UAAU,EAAE,qBAAqB,EACjC,SAAS,EAAE,WAAW,GACrB,OAAO,CAAC,cAAc,CAAC,CAUzB;AAyFD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,CAElF"}
@@ -1,145 +0,0 @@
1
- /**
2
- * Tool Loop + Compaction 集成 (Sprint 1c-revive-2-D-5 + D-5-2)
3
- *
4
- * 拍板 (跟 P21 / P27 跨协议 6 cell 一致):
5
- * - runToolLoop 每次 LLM call 前, 测 messages token 数
6
- * - 触发 (>= window * compactRatio) → 调 summaryFn (LLM 走同 client 拍板)
7
- * - 成功 → 替换 working messages, 写 1 条 'compaction' event 到 SessionWriter
8
- * - 失败 → CompactionState 累计; latch → 写 1 条 'compaction_paused' event
9
- * - paused → 跳过 compaction (不浪费 LLM token 调 summaryFn, 防 death loop)
10
- *
11
- * 协议集成 (P38 拍板 + D-5-2 拍板):
12
- * - protocol: 'openai' | 'anthropic' (用于 summaryFn, 不同协议 system prompt 不同)
13
- * - 集成在 runToolLoop 入口, 跟 tool-loop.ts P21 6 cell 拍板一致:
14
- * DeepSeek + Anthropic 协议都走同一 hook
15
- *
16
- * 不变量:
17
- * - compaction 永不 throw 给 runToolLoop (防 LLM 续聊死锁)
18
- * - 失败 event 总能写盘 (即使 writer.append 抛错, 也只 warn 不 throw)
19
- * - paused 后仍跑 runToolLoop 正常 (不阻塞用户任务, 仅不再 compact)
20
- *
21
- * @module @deepwhale/coding-agent/agent-compaction
22
- */
23
- import { runCompactionWithLatch, estimateTokens, } from '@deepwhale/core';
24
- import { runToolLoop } from './tool-loop.js';
25
- /**
26
- * 跑 runToolLoop 集成 compaction 触发.
27
- *
28
- * 拍板行为 (跟 P21 6 cell 一致):
29
- * 1. 入口测 token → 触发则 compact → 替换 working
30
- * 2. runToolLoop 内部每个 LLM call 前不重复触发 (避免 per-step 开销)
31
- * 3. 失败 latch → 写 paused event, runToolLoop 继续跑 (不阻塞)
32
- *
33
- * Sprint 1c-revive-2-D-6 (review P1 修复, 2026-06-04): caller-side system prefix
34
- * handling. 拍板: REPL/caller 可能把系统提示拼到 messages 最前面 (e.g. integration
35
- * test fixture, 或未来 system prompt 注入). 传 compact() 之前先 **剥掉** 连续
36
- * system 前缀, 让 compact 看到的 index 跟 session-adapter 累积 messages
37
- * (user/assistant/tool + compaction summary) 同 index 空间, replaced_range
38
- * 切 reload replay 同步. compact 后把 system 前缀 **原样 prepend 回** 替换后
39
- * 的 messages, LLM 看到的 context 跟 caller 拼的一致.
40
- *
41
- * @param client LLM client
42
- * @param messages 入口 messages (不变, 内部 copy)
43
- * @param options runToolLoop 原生 options
44
- * @param compaction 集成配置
45
- * @param summaryFn 生成 summary text 的 callback (caller 决定 LLM 协议)
46
- * @returns ToolLoopResult
47
- */
48
- export async function runToolLoopWithCompaction(client, messages, options = {}, compaction, summaryFn) {
49
- // 1) 剥掉 caller 拼的连续 system prefix, 保持 replaced_range 跟 JSONL 累积同空间
50
- const headSystem = splitSystemPrefix(messages);
51
- // 2) 入口测 token, 触发则 compact 替换 messages (在剥掉 system 的子集上跑)
52
- const compactedTail = await maybeCompactBeforeLoop(headSystem.tail, compaction, summaryFn);
53
- // 3) 拼回 system prefix → 跑原生 runToolLoop
54
- const compactedMessages = [...headSystem.prefix, ...compactedTail];
55
- return runToolLoop(client, compactedMessages, options);
56
- }
57
- /**
58
- * 把 messages 切分为 "caller 自带的连续 system prefix" + "其余".
59
- *
60
- * 拍板 (D-6 review P1 修复, 2026-06-04):
61
- * - prefix = messages[0..n), n = 头连续 system message 数量
62
- * - tail = messages[n..)
63
- * - 没 system prefix → prefix=[], tail=messages
64
- * - 全 system (只有 1 条 system 也算) → tail=[] (compaction 看到空, 不触发)
65
- *
66
- * 用途: caller 把 system prompt 拼前面时, 传给 compact() 前先剥掉, 让
67
- * replaced_range 的 index 空间 跟 session-adapter replay JSONL 时累积的
68
- * messages (user/assistant/tool + 之前 reload 注入的 summary) 同空间,
69
- * reload replay 不会 off-by-one.
70
- *
71
- * **不动** 中间或末尾的 system message (罕见, 但保留 — 不归 compaction 管).
72
- * **不动** tool_call_id 关联, 因为 prefix 是 system role, 不会拖 tool pair.
73
- */
74
- function splitSystemPrefix(messages) {
75
- let n = 0;
76
- while (n < messages.length && messages[n].role === 'system') {
77
- n++;
78
- }
79
- return {
80
- prefix: messages.slice(0, n),
81
- tail: messages.slice(n),
82
- };
83
- }
84
- /**
85
- * 入口 compaction 触发 (one-shot, 不重入 runToolLoop 内部).
86
- *
87
- * 行为契约:
88
- * - paused → 返 messages 原样, 不调 summaryFn, 不写 event (latched 拍板)
89
- * - 不该 compact → 返 messages 原样, 不调 summaryFn, 不写 event
90
- * - compact 成功 → 替换 messages, 写 'compaction' event
91
- * - compact 失败 (未 latch) → 返 messages 原样, 不写 event (caller 该 retry)
92
- * - compact latched → 写 'compaction_paused' event, 返 messages 原样
93
- */
94
- async function maybeCompactBeforeLoop(messages, compaction, summaryFn) {
95
- const { state, writer, protocol, contextWindow } = compaction;
96
- // protocol 显式使用一次, 拍板留位 (跟 P21 6 cell summaryFn 拍 system prompt 模板用)
97
- void protocol;
98
- if (contextWindow <= 0)
99
- return messages;
100
- if (messages.length === 0)
101
- return messages;
102
- if (!state.shouldAttempt())
103
- return messages;
104
- let result;
105
- try {
106
- result = await runCompactionWithLatch(messages, compaction, summaryFn, state);
107
- }
108
- catch {
109
- // 未触发 latch 的失败: caller 决定怎么处理 (e.g. 用户改配置), 这里不抛
110
- // 拍板不阻塞 runToolLoop
111
- return messages;
112
- }
113
- if (result === null) {
114
- // 不该 compact 或 paused
115
- return messages;
116
- }
117
- if (result.kind === 'ok') {
118
- // 写 'compaction' event — writer.append 抛错只 warn, 不 throw
119
- try {
120
- await writer.append(result.event);
121
- }
122
- catch {
123
- // 写盘失败不阻塞 loop
124
- }
125
- return result.result.messages;
126
- }
127
- // kind === 'latched'
128
- try {
129
- await writer.append(result.pausedEvent);
130
- }
131
- catch {
132
- // 写盘失败不阻塞 loop
133
- }
134
- return messages;
135
- }
136
- /**
137
- * 便捷工具: 估算当前 messages 的 token 数 (供 REPL / footer 拍板显示用).
138
- *
139
- * 跟 compaction.ts 的 estimateTokens 拍板一致 (char/4 粗估).
140
- * 集成在 coding-agent 包, 供 REPL 端零成本 import core.
141
- */
142
- export function estimateContextTokens(messages) {
143
- return estimateTokens(messages);
144
- }
145
- //# sourceMappingURL=agent-compaction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-compaction.js","sourceRoot":"","sources":["../../src/agent/agent-compaction.ts"],"names":[],"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 落地:
5
- * - runToolLoop: 最小 agent loop(LLM ↔ tool_calls ↔ LLM)
6
- * - ToolLoopLimitError: maxSteps 触顶时抛
7
- * - session-adapter: tool loop step ↔ JSONL SessionEvent 转换
8
- *
9
- * Sprint 1b 再加:plan mode、schema 校验、budget cap、onStep 实时回调。
10
- * Sprint 2+ 再加:并行 tool_call、recovery 3-way、断点续传。
11
- */
12
- export { runToolLoop, isToolLoopError, TOOL_LOOP_DEFAULT_MAX_STEPS, type ToolLoopOptions, type ToolLoopResult, type ToolLoopStep, ToolLoopLimitError, } from './tool-loop.js';
13
- export { toolLoopStepToSessionEvent, sessionEventsToMessages, appendUserEvent, appendCompactionEvent, appendCompactionPausedEvent, appendVerificationEvent, persistToolLoopSteps, loadSession, } from './session-adapter.js';
14
- export { runToolLoopWithCompaction, estimateContextTokens, type AgentCompactionConfig, } from './agent-compaction.js';
15
- export { CompactionState, type CompactionConfig } from '@deepwhale/core';
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,WAAW,EACX,eAAe,EACf,2BAA2B,EAC3B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * @deepwhale/coding-agent/agent — Tool Loop & 调度
3
- *
4
- * Sprint 1a 落地:
5
- * - runToolLoop: 最小 agent loop(LLM ↔ tool_calls ↔ LLM)
6
- * - ToolLoopLimitError: maxSteps 触顶时抛
7
- * - session-adapter: tool loop step ↔ JSONL SessionEvent 转换
8
- *
9
- * Sprint 1b 再加:plan mode、schema 校验、budget cap、onStep 实时回调。
10
- * Sprint 2+ 再加:并行 tool_call、recovery 3-way、断点续传。
11
- */
12
- export { runToolLoop, isToolLoopError, TOOL_LOOP_DEFAULT_MAX_STEPS, ToolLoopLimitError, } from './tool-loop.js';
13
- export { toolLoopStepToSessionEvent, sessionEventsToMessages, appendUserEvent, appendCompactionEvent, appendCompactionPausedEvent, appendVerificationEvent, persistToolLoopSteps, loadSession, } from './session-adapter.js';
14
- export { runToolLoopWithCompaction, estimateContextTokens, } from './agent-compaction.js';
15
- // Re-export core compaction types for caller convenience
16
- export { CompactionState } from '@deepwhale/core';
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,WAAW,EACX,eAAe,EACf,2BAA2B,EAI3B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;AAC/B,yDAAyD;AACzD,OAAO,EAAE,eAAe,EAAyB,MAAM,iBAAiB,CAAC"}
@@ -1,177 +0,0 @@
1
- /**
2
- * Session ↔ Tool Loop 适配器(Sprint 1a)
3
- *
4
- * 把 tool loop 的 ToolLoopStep 事件 → SessionEvent JSONL 持久化,
5
- * 同时支持从已有 JSONL 重建 messages 列表(让 LLM 看到"上次聊到哪")。
6
- *
7
- * Sprint 1a 范围(极简):
8
- * - assistant step → 'assistant' event(保留 tool_calls)
9
- * - tool step → 'tool' event(保留 tool_call_id + name + result)
10
- * - 不持久化 user 消息(REPL 层自己 append 'user')
11
- * - 不持久化 limit/error 事件(runtime 状态,不进 LLM context)
12
- * - 不做 compaction、加密、压缩、分片(v1.5+)
13
- *
14
- * 重建 messages 规则(让 LLM 续聊):
15
- * - 遍历 events,遇到 user/assistant/tool 都 push 成 ChatMessage
16
- * - tool 消息需保留 tool_call_id
17
- * - assistant 消息需保留 tool_calls
18
- * - 系统提示由 caller 单独组装(repl.ts 拼),不存 JSONL
19
- *
20
- * @module @deepwhale/coding-agent/session-adapter
21
- */
22
- import type { ChatMessage } from '@deepwhale/llm';
23
- import type { SessionEvent, SessionWriter, SessionReader } from '@deepwhale/core';
24
- import type { ToolLoopStep } from './tool-loop.js';
25
- /**
26
- * 把 tool loop step 翻译成 SessionEvent。
27
- *
28
- * 只翻译能放进 LLM context 的 step:
29
- * - 'assistant' → { kind: 'assistant', ts, content, tool_calls }
30
- * - 'tool' → { kind: 'tool', ts, tool_call_id, name, result }
31
- *
32
- * limit/error 是 runtime 状态,**不**持久化(避免重启时把它们当 LLM context 喂回)。
33
- */
34
- export declare function toolLoopStepToSessionEvent(step: ToolLoopStep): SessionEvent | null;
35
- /**
36
- * 把 SessionEvent 列表重建为 LLM 的 ChatMessage 列表(用于 LLM 续聊)。
37
- *
38
- * Sprint 1c P2 修复: 过滤 dangling tool_call transcript.
39
- *
40
- * 背景: 二次启动恢复时, JSONL 里可能存在 "assistant(tool_calls=[c2]) 但
41
- * tool(c2) 没落盘" 的孤立 assistant (crash 写完 assistant 还没写 tool result
42
- * 就被杀). 旧实现直接 push 这个 assistant → LLM continuation 看到无对应
43
- * tool result 的 tool_call, 形成非法 transcript, OpenAI API 拒收.
44
- *
45
- * 修复规则 (按 user 拍板 2026-06-04):
46
- * 1. assistant(tool_calls): 只有在下一个 user/assistant 前, 所有
47
- * tool_call_id 都有对应 tool event, 才保留 (整个 assistant message)
48
- * 2. tool: 只有它的 tool_call_id 属于"当前未结算的 assistant tool_calls",
49
- * 才保留; 否则丢 (孤儿)
50
- * 3. 普通 assistant(content) / user 不受影响
51
- * 4. **不改写 JSONL events**, 只在重建 messages 时过滤 — 后续补 tool
52
- * result 后完整 tool_call 组自然重新合法化 (Sprint 1c P2 spec)
53
- *
54
- * 实现: 延迟 push 模式 — assistant(tool_calls) 进入 buffer, tool events
55
- * 配对删除 pending. user/assistant 边界触发 buffer 结算: pending 非空
56
- * → 整体 roll back (不 push); pending 空 → push buffer.
57
- *
58
- * Sprint 1c-revive-2-D-5+ reload 修复 (review P1, 2026-06-04):
59
- * - JSONL 中的 'compaction' event 必须 **replay** 到 LLM context, 否则
60
- * reload 后 messages 会从原始 user/assistant/tool events 重建, 旧
61
- * compacted head 重新出现, 上下文不被压缩 (内存压缩成功但 reload
62
- * 失效 = P1).
63
- * - replay 协议: 见到 'compaction' event 时, 把当前累积 messages 的
64
- * `replaced_range[0..replaced_range[1])` 段 (按 JSONL 累积 index)
65
- * 替换为 1 条 system summary.
66
- * - index 空间 (拍板 2026-06-04 review): compact() 入参 messages 来自
67
- * caller 的 working 列表. REPL 路径下 working = loadSession() 返回
68
- * 的 JSONL 累积 (纯 user/assistant/tool) + REPL startup 拼的 system
69
- * prompt. 拍板 compact() 只对 working[0..end] 操作, 不含外部 system
70
- * prompt, 所以 replaced_range 索引的就是 "JSONL 累积 messages" 的
71
- * index. reload 时 messages 仍按 JSONL 累积重建, replaced_range 同
72
- * index 空间, 不偏移. (多个 'compaction' event 串行: 第 1 次 applied
73
- * 后累积 messages = 1 summary + N tail, 第 2 次 compact 入参就是
74
- * reload 后的累积, index 重新从 0 计 — protocol 自洽.)
75
- * - 'compaction_paused' event: 不入 messages. caller 决定是否 reset
76
- * latch; UI/footer 可读 paused event 显式提示.
77
- */
78
- export declare function sessionEventsToMessages(events: ReadonlyArray<SessionEvent>): ChatMessage[];
79
- /**
80
- * 写一个 user event 到 session。
81
- * Sprint 1a 简化:user 消息也走 SessionWriter(统一审计)。
82
- */
83
- export declare function appendUserEvent(writer: SessionWriter, content: string, ts?: number): Promise<void>;
84
- /**
85
- * 写一条 'compaction' event 到 session (Sprint 1c-revive-2-D-5-1 拍板).
86
- *
87
- * 用途: agent-compaction.ts 在 runCompactionWithLatch 返 kind='ok' 时调,
88
- * 把 summary 拍板落盘 (供 reload 重建 messages 时知道哪段被总结过).
89
- *
90
- * 拍板: SessionReader 读到 kind='compaction' 时**不**重放进 LLM context
91
- * (跟 sessionEventsToMessages L132 'system' 跳过 一致 — compaction event 是 metadata,
92
- * 不是 LLM 看到的对话轮次).
93
- */
94
- export declare function appendCompactionEvent(writer: SessionWriter, summary: string, replacedRange: readonly [number, number], meta?: Record<string, unknown>, ts?: number): Promise<void>;
95
- /**
96
- * 写一条 'compaction_paused' event 到 session (Sprint 1c-revive-2-D-5-2 拍板).
97
- *
98
- * 用途: agent-compaction.ts 在 CompactionState latch 触发时调,
99
- * 记录"自动暂停, 防 death loop" 拍板 (供 reload 时 caller 知道状态).
100
- *
101
- * 拍板: SessionReader 读到 kind='compaction_paused' 时**不**重放进 LLM context
102
- * (caller 该决定是否 reset CompactionState / 改 summaryFn / 改 config).
103
- */
104
- export declare function appendCompactionPausedEvent(writer: SessionWriter, consecutiveFailures: number, reason: string, lastError: string, meta?: Record<string, unknown>, ts?: number): Promise<void>;
105
- /**
106
- * 把 tool loop 跑完后产出的 steps 全部落盘(assistant + tool)。
107
- * limit/error 跳过(toSessionEvent 返回 null 时不 append)。
108
- */
109
- export declare function persistToolLoopSteps(writer: SessionWriter, steps: ReadonlyArray<ToolLoopStep>): Promise<void>;
110
- /**
111
- * 加载已有 session 并重建 messages。
112
- *
113
- * Sprint 1b: 内部自动调 reader.truncate() 把 partial last line 清掉。
114
- * 之前 caller 必须自己记得调, Sprint 1a 全部漏调 → partial line 累积,
115
- * 下次 append 拼坏 JSON。Sprint 1b 闭环在 adapter 里, 3 个 mode (repl/print/rpc) 自动受益。
116
- *
117
- * 行为契约:
118
- * - 加载完整 events + 重建 messages
119
- * - 若文件末尾有 partial line(崩溃恢复), 自动 truncate
120
- * - truncate 失败不抛(不阻塞 agent 启动, 跟 Sprint 1a 容错语义一致)
121
- *
122
- * Sprint 1a 简化:返回 (events, messages) 两份数据, caller 决定要不要 ignore events。
123
- */
124
- export declare function loadSession(reader: SessionReader): Promise<{
125
- events: ReadonlyArray<SessionEvent>;
126
- messages: ChatMessage[];
127
- }>;
128
- /**
129
- * 写一个 'verification' event 到 session (Sprint 1c-revive-2-D-11-3, 2026-06-04).
130
- *
131
- * 调用场景: `deepwhale --verify` 或 REPL `/verify` 跑完, 把 VerificationReport
132
- * 摘要写 1 条到 session JSONL. 跟 `appendUserEvent` / `appendCompactionEvent` 模式一致.
133
- *
134
- * 字段 (跟 core/src/session/jsonl.ts 'verification' union 一致):
135
- * - status: 整体结果 passed / failed
136
- * - durationMs: 整体耗时
137
- * - command_count: 跑的 step 数
138
- * - failed_count: 失败 step 数
139
- * - summary: 人类可读 summary (来自 formatter.buildSummaryAndNext)
140
- * - meta: 可选扩展 (e.g. log file path, git sha)
141
- *
142
- * 不变量 (跟其它 event 写入一致):
143
- * - ts 默认 Date.now(), 单测可注入
144
- * - 走 SessionWriter.append → fsync 串行化, 顺序保证
145
- * - 'verification' 是 metadata, reload session 时 sessionEventsToMessages 跳过
146
- * (跟 compaction_paused 同语义), 不污染 LLM 看到的 messages
147
- */
148
- export declare function appendVerificationEvent(writer: SessionWriter, args: {
149
- status: 'passed' | 'failed';
150
- durationMs: number;
151
- commandCount: number;
152
- failedCount: number;
153
- summary: string;
154
- meta?: Record<string, unknown>;
155
- ts?: number;
156
- }): Promise<void>;
157
- /**
158
- * 写一条 'policy_decision' event (Sprint 1c-revive-3-D-13, 2026-06-05).
159
- * 拍板 (用户 2026-06-05): 'allow' 不调本函数 (避免 JSONL 刷爆). 只对
160
- * 'deny' / 'require_confirmation' / 'user_approved' / 'user_denied' 4 个
161
- * 终态落盘.
162
- *
163
- * 字段拍板:
164
- * - tool_call_id: 跟后续 'tool' event 配对 (reload 时 audit trace 完整)
165
- * - argsDigest: sha256:<12hex>, 不存原始 args
166
- * - reason: 已过 sanitize (长度 / 换行 / NUL, 拍板红线: 不存 secret)
167
- */
168
- export declare function appendPolicyDecisionEvent(writer: SessionWriter, args: {
169
- tool_call_id: string;
170
- name: string;
171
- decision: 'deny' | 'require_confirmation' | 'user_approved' | 'user_denied';
172
- argsDigest: string;
173
- reason?: string;
174
- meta?: Record<string, unknown>;
175
- ts?: number;
176
- }): Promise<void>;
177
- //# sourceMappingURL=session-adapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-adapter.d.ts","sourceRoot":"","sources":["../../src/agent/session-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,IAAI,CAmClF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,WAAW,EAAE,CAgH1F;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,EACf,EAAE,GAAE,MAAmB,GACtB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,M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