deel-local-cli 1.12.0 → 1.13.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.
Files changed (51) hide show
  1. package/README.ko.md +6 -5
  2. package/README.md +6 -5
  3. package/package.json +60 -60
  4. package/src/acp/map.js +30 -25
  5. package/src/acp/serve.js +810 -810
  6. package/src/agent/budget.js +156 -156
  7. package/src/agent/commit.js +32 -9
  8. package/src/agent/compact.js +441 -420
  9. package/src/agent/effort.js +308 -308
  10. package/src/agent/evolve.js +263 -263
  11. package/src/agent/loop.js +1728 -1707
  12. package/src/agent/memory.js +156 -156
  13. package/src/agent/mention.js +210 -210
  14. package/src/agent/recall.js +22 -9
  15. package/src/agent/session.js +1056 -1049
  16. package/src/backend/adapter.js +1355 -1159
  17. package/src/backend/cachemark.js +223 -150
  18. package/src/backend/detect.js +327 -327
  19. package/src/backend/http.js +3 -1
  20. package/src/backend/mcp.js +15 -3
  21. package/src/backend/price.js +69 -6
  22. package/src/backend/probe.js +17 -3
  23. package/src/backend/quota.js +274 -250
  24. package/src/backend/tokens.js +25 -3
  25. package/src/backend/toolfit.js +352 -352
  26. package/src/backend/wire.js +715 -600
  27. package/src/commands.js +3184 -3135
  28. package/src/config.js +39 -0
  29. package/src/i18n/en.js +545 -544
  30. package/src/i18n/ja.js +498 -497
  31. package/src/i18n/ko.js +592 -591
  32. package/src/i18n/zh.js +498 -497
  33. package/src/oneshot.js +625 -620
  34. package/src/pack/tar.js +23 -1
  35. package/src/pack/zip.js +19 -1
  36. package/src/plugins/manage.js +85 -5
  37. package/src/repl.js +2616 -2602
  38. package/src/safety/audit.js +22 -3
  39. package/src/safety/guard.js +124 -9
  40. package/src/safety/network.js +43 -0
  41. package/src/tools/fastgrep.js +15 -0
  42. package/src/tools/fsutil.js +291 -265
  43. package/src/tools/index.js +40 -3
  44. package/src/tools/jobs.js +87 -6
  45. package/src/tools/label.js +52 -0
  46. package/src/tools/spawn.js +114 -0
  47. package/src/tools/verify.js +358 -358
  48. package/src/tools/webfetch.js +28 -3
  49. package/src/ui/export.js +26 -10
  50. package/src/ui/pick.js +115 -115
  51. package/src/ui/status.js +617 -613
package/README.ko.md CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  [![Node.js CI](https://img.shields.io/github/actions/workflow/status/jysvai/deel-local-cli/test.yml?branch=main&logo=github&logoColor=white&label=Node.js%20CI)](https://github.com/jysvai/deel-local-cli/actions/workflows/test.yml)
22
22
  [![CodeQL](https://img.shields.io/github/actions/workflow/status/jysvai/deel-local-cli/codeql.yml?branch=main&logo=github&logoColor=white&label=CodeQL)](https://github.com/jysvai/deel-local-cli/actions/workflows/codeql.yml)
23
- [![tests](https://img.shields.io/badge/tests-5%2C899%20passing-1a7f37?logo=checkmarx&logoColor=white)](docs/ko/develop.md)
23
+ [![tests](https://img.shields.io/badge/tests-7%2C046%20passing-1a7f37?logo=checkmarx&logoColor=white)](docs/ko/develop.md)
24
24
 
25
25
  [![dependencies](https://img.shields.io/badge/dependencies-0-1a7f37)](https://www.npmjs.com/package/deel-local-cli?activeTab=dependencies)
26
26
  [![ESM](https://img.shields.io/badge/ESM-Node%2020%2B-5FA04E?logo=javascript&logoColor=white)](package.json)
@@ -94,7 +94,7 @@
94
94
  | [속도와 씀씀이](docs/ko/tuning.md) | 단계별 추론 강도 · 프리픽스 캐시 · 컨텍스트 길이 |
95
95
  | [안전망과 사내 반입](docs/ko/safety.md) | 되돌리기 · 작업 범위 · 감사기록 · 심사 서류 |
96
96
  | [설정](docs/ko/config.md) · [개발](docs/ko/develop.md) | 환경변수 · 실행 옵션 · 검사 돌리기 · 폴더 구조 |
97
- | [릴리스 노트](docs/ko/releases.md) | [1.10.x](docs/ko/releases/1.10.md) · [1.9.x](docs/ko/releases/1.9.md) · [1.8.x](docs/ko/releases/1.8.md) · [1.7.x](docs/ko/releases/1.7.md) · [그 앞](docs/ko/releases.md) |
97
+ | [릴리스 노트](docs/ko/releases.md) | [1.13.x](docs/ko/releases/1.13.md) · [1.12.x](docs/ko/releases/1.12.md) · [1.10.x](docs/ko/releases/1.10.md) · [1.9.x](docs/ko/releases/1.9.md) · [그 앞](docs/ko/releases.md) |
98
98
 
99
99
  ---
100
100
 
@@ -267,7 +267,7 @@ deel --offline
267
267
  무엇이 어디로 갈 수 있는지는 켤 때 화면 맨 위에 늘 적혀 있습니다.
268
268
 
269
269
  ```
270
- deel 1.10.0 ⌂ 이 안
270
+ deel 1.13.1 ⌂ 이 안
271
271
  보냄 이 컴퓨터 안 127.0.0.1:11434 ← 여기 말고는 어디로도 안 갑니다
272
272
  ```
273
273
 
@@ -1152,11 +1152,12 @@ zip 은 진짜 `unzip` 으로, tar 는 진짜 `tar` 가 만든 것을 읽혀 교
1152
1152
 
1153
1153
  | 판 | 무엇이 바뀌었나 |
1154
1154
  |---|---|
1155
+ | [1.13.1](docs/ko/releases/1.13.md#1131) | 올라간 물건이 소스와 달랐습니다 — 148개 중 47개가 CRLF 로 나갔습니다 |
1156
+ | **[1.13.0](docs/ko/releases/1.13.md#1130)** | 바깥 창구와 붙는 자리를 전부 다시 봤습니다 — 서로 못 보는 검수자 셋, 셋이 같이 짚은 것 넷 |
1157
+ | **[1.12.0](docs/ko/releases/1.12.md#1120)** | 같은 앞머리를 걸음마다 다시 보내고 있었습니다 |
1155
1158
  | **[1.10.0](docs/ko/releases/1.10.md#1100)** | ESC 가 진짜로 멈춥니다 · 자리가 다 차도 그 턴 안에서 이어 갑니다 · 회사별 창구를 여덟 자리 전부 쟀습니다 |
1156
1159
  | [1.9.2](docs/ko/releases/1.9.md#192) | 막고 있다고 적어 둔 것이 실제로는 안 막고 있던 자리들 · 접히면 시킨 말과 남은 할 일이 사라지던 것 |
1157
- | [1.9.1](docs/ko/releases/1.9.md#191) | 한글 이름을 쓴 MCP 도구가 모델 눈에 전부 같아 보이던 것 — 서로 다르고 판마다 같은 이름으로 |
1158
1160
  | **[1.9.0](docs/ko/releases/1.9.md#190)** | 표를 표로 그린다 · Claude·Bedrock 에 추론 강도가 실제로 걸린다 · 회사별 도구 규격 · 바뀐 자리만 다시 싣기 |
1159
- | **[1.8.0](docs/ko/releases/1.8.md#180)** | 한 시간짜리 토큰을 쓰는 사내 게이트웨이에서 하루를 — 열쇠를 받아 오기 · `deel reset` · 영어 화면이 진짜 영어 |
1160
1161
 
1161
1162
  가까운 다섯 판만 적었습니다. 나머지 전부와 무엇이 왜 바뀌었는지는 **[릴리스 노트](docs/ko/releases.md)** 에 있습니다.
1162
1163
 
package/README.md CHANGED
@@ -20,7 +20,7 @@ Vendor APIs connect too — **only when you say so**
20
20
 
21
21
  [![Node.js CI](https://img.shields.io/github/actions/workflow/status/jysvai/deel-local-cli/test.yml?branch=main&logo=github&logoColor=white&label=Node.js%20CI)](https://github.com/jysvai/deel-local-cli/actions/workflows/test.yml)
22
22
  [![CodeQL](https://img.shields.io/github/actions/workflow/status/jysvai/deel-local-cli/codeql.yml?branch=main&logo=github&logoColor=white&label=CodeQL)](https://github.com/jysvai/deel-local-cli/actions/workflows/codeql.yml)
23
- [![tests](https://img.shields.io/badge/tests-5%2C899%20passing-1a7f37?logo=checkmarx&logoColor=white)](docs/en/develop.md)
23
+ [![tests](https://img.shields.io/badge/tests-7%2C046%20passing-1a7f37?logo=checkmarx&logoColor=white)](docs/en/develop.md)
24
24
 
25
25
  [![dependencies](https://img.shields.io/badge/dependencies-0-1a7f37)](https://www.npmjs.com/package/deel-local-cli?activeTab=dependencies)
26
26
  [![ESM](https://img.shields.io/badge/ESM-Node%2020%2B-5FA04E?logo=javascript&logoColor=white)](package.json)
@@ -119,7 +119,7 @@ This page is the **summary**. Each section links to the detail behind it.
119
119
  | [Speed and spend](docs/en/tuning.md) | Per-stage effort · the prefix cache · context length |
120
120
  | [Safety and corporate review](docs/en/safety.md) | Undo · working scope · audit log · the review package |
121
121
  | [Configuration](docs/en/config.md) · [Development](docs/en/develop.md) | Env vars · run flags · running the tests · folder layout |
122
- | [Release notes](docs/en/releases.md) | [1.10.x](docs/en/releases/1.10.md) · [1.9.x](docs/en/releases/1.9.md) · [1.8.x](docs/en/releases/1.8.md) · [1.7.x](docs/en/releases/1.7.md) · [older](docs/en/releases.md) |
122
+ | [Release notes](docs/en/releases.md) | [1.13.x](docs/en/releases/1.13.md) · [1.12.x](docs/en/releases/1.12.md) · [1.10.x](docs/en/releases/1.10.md) · [1.9.x](docs/en/releases/1.9.md) · [older](docs/en/releases.md) |
123
123
 
124
124
  ---
125
125
 
@@ -337,7 +337,7 @@ deel --offline
337
337
  The destination is printed at the top of every session:
338
338
 
339
339
  ```
340
- deel 1.10.0 ⌂ inside
340
+ deel 1.13.1 ⌂ inside
341
341
  Sends to this machine 127.0.0.1:11434 ← nowhere else
342
342
  ```
343
343
 
@@ -1209,11 +1209,12 @@ so one run tells you everything.
1209
1209
 
1210
1210
  | Version | What changed |
1211
1211
  |---|---|
1212
+ | [1.13.1](docs/en/releases/1.13.md#1131) | What shipped was not what the source said — 47 of 148 files went out with CRLF line endings |
1213
+ | **[1.13.0](docs/en/releases/1.13.md#1130)** | Every place deel touches someone else's endpoint, re-examined — three independent reviewers, four findings they shared |
1214
+ | **[1.12.0](docs/en/releases/1.12.md#1120)** | The same prefix was being sent again on every step |
1212
1215
  | **[1.10.0](docs/en/releases/1.10.md#1100)** | ESC actually stops · a full context carries on inside the same turn · every vendor endpoint measured |
1213
1216
  | [1.9.2](docs/en/releases/1.9.md#192) | Guards that said they were blocking were not blocking · folding lost the request and the outstanding work |
1214
- | [1.9.1](docs/en/releases/1.9.md#191) | MCP tools with Korean names all looked the same to the model — names are now distinct and stable |
1215
1217
  | **[1.9.0](docs/en/releases/1.9.md#190)** | Tables are drawn as tables · reasoning effort reaches Claude and Bedrock · tool schemas shaped per vendor · only the changed part of a file is re-sent |
1216
- | **[1.8.0](docs/en/releases/1.8.md#180)** | A full day against a gateway that hands out one-hour tokens — fetch the key instead of storing it · `deel reset` · an English screen that is actually English |
1217
1218
 
1218
1219
  The five most recent are listed here. Every version, and why each thing changed, is in the **[release notes](docs/en/releases.md)**.
1219
1220
 
package/package.json CHANGED
@@ -1,60 +1,60 @@
1
- {
2
- "name": "deel-local-cli",
3
- "version": "1.12.0",
4
- "description": "A coding-agent CLI that runs on local models and private gateways. Zero dependencies, Node 20+.",
5
- "type": "module",
6
- "license": "MIT",
7
- "bin": {
8
- "deel": "bin/deel.js"
9
- },
10
- "engines": {
11
- "node": ">=20"
12
- },
13
- "files": [
14
- "bin",
15
- "src",
16
- "README.md",
17
- "README.ko.md",
18
- "LICENSE"
19
- ],
20
- "keywords": [
21
- "cli",
22
- "coding-agent",
23
- "local-llm",
24
- "ollama",
25
- "lm-studio",
26
- "openai-compatible",
27
- "offline",
28
- "air-gapped",
29
- "zero-dependency",
30
- "agent",
31
- "acp",
32
- "agent-client-protocol",
33
- "zed",
34
- "korean"
35
- ],
36
- "repository": {
37
- "type": "git",
38
- "url": "git+https://github.com/jysvai/deel-local-cli.git"
39
- },
40
- "bugs": {
41
- "url": "https://github.com/jysvai/deel-local-cli/issues"
42
- },
43
- "homepage": "https://github.com/jysvai/deel-local-cli#readme",
44
- "scripts": {
45
- "start": "node bin/deel.js",
46
- "setup": "node bin/deel.js setup",
47
- "diagnose": "node bin/deel.js diagnose",
48
- "chat": "node bin/deel.js",
49
- "test": "node test/run.mjs",
50
- "docs": "node tools/check-docs.mjs",
51
- "verify": "node test/no-bundle.test.js && node test/network.test.js && node test/web.test.js",
52
- "bench": "node test/edit-bench.js",
53
- "demo": "node test/demo.js",
54
- "check": "node --check bin/deel.js && node --check src/repl.js && node --check src/oneshot.js && node --check src/commands.js && node --check src/agent/loop.js && node --check src/agent/session.js && node --check src/agent/effort.js && node --check src/agent/modes.js && node --check src/agent/route.js && node --check src/agent/askcheck.js && node --check src/agent/asks.js && node --check src/agent/models.js && node --check src/agent/grade.js && node --check src/agent/mention.js && node --check src/agent/project.js && node --check src/tools/encoding.js && node --check src/tools/excel-com.js && node --check src/tools/excel.js && node --check src/tools/xlsx.js && node --check src/tools/docs.js && node --check src/tools/convert.js && node --check src/tools/pdf.js && node --check src/tools/clipboard.js && node --check src/agent/compact.js && node --check src/agent/store.js && node --check src/agent/sessionui.js && node --check src/backend/adapter.js && node --check src/backend/toolfit.js && node --check src/backend/ctxsize.js && node --check src/backend/probe.js && node --check src/backend/detect.js && node --check src/backend/http.js && node --check src/backend/retry.js && node --check src/backend/proxy.js && node --check src/backend/azure.js && node --check src/backend/vision.js && node --check src/backend/quota.js && node --check src/backend/wire.js && node --check src/backend/tokens.js && node --check src/backend/cachemark.js && node --check src/backend/price.js && node --check src/backend/scan.js && node --check src/backend/scanui.js && node --check src/tools/index.js && node --check src/tools/desc.en.js && node --check src/tools/lsp.js && node --check src/lsp/rpc.js && node --check src/lsp/servers.js && node --check src/lsp/client.js && node --check src/lsp/diag.js && node --check src/tools/fsutil.js && node --check src/tools/ignore.js && node --check src/tools/spawn.js && node --check src/tools/fastgrep.js && node --check src/tools/edit-match.js && node --check src/tools/webfetch.js && node --check src/tools/todo.js && node --check src/tools/jobs.js && node --check src/tools/shell.js && node --check src/skills/discover.js && node --check src/plugins/manage.js && node --check src/pack/zip.js && node --check src/pack/tar.js && node --check src/pack/selfpack.js && node --check src/safety/guard.js && node --check src/safety/undo.js && node --check src/safety/audit.js && node --check src/safety/keystore.js && node --check src/safety/authcmd.js && node --check src/safety/policy.js && node --check src/safety/network.js && node --check src/safety/runmode.js && node --check src/providers/index.js && node --check src/providers/openai.js && node --check src/providers/anthropic.js && node --check src/providers/gemini.js && node --check src/providers/bedrock.js && node --check src/providers/custom.js && node --check src/setup.js && node --check src/report.js && node --check src/config.js && node --check src/completion.js && node --check src/ui/diff.js && node --check src/ui/ansi.js && node --check src/ui/status.js && node --check src/ui/level.js && node --check src/ui/prompt.js && node --check src/ui/spinner.js && node --check src/ui/motion.js && node --check src/ui/office.js && node --check src/ui/notify.js && node --check src/ui/intro.js && node --check src/ui/banner.js && node --check src/ui/export.js && node --check src/i18n/index.js && node --check src/i18n/ko.js && node --check src/i18n/en.js && node --check src/i18n/ja.js && node --check src/i18n/zh.js && node --check src/preview/serve.js && node --check src/ui/working.js && node --check src/ui/inputbox.js && node --check src/ui/wrap.js && node --check src/ui/pastechip.js && node --check src/ui/pick.js && node --check src/ui/histline.js && node --check src/ui/md.js && node --check src/agent/threads.js && node --check src/agent/evolve.js && node --check src/agent/pins.js && node --check src/agent/card.js && node --check src/agent/preset.js && node --check src/agent/evidence.js && node --check src/agent/commit.js && node --check src/agent/review.js && node --check src/acp/jsonrpc.js && node --check src/acp/map.js && node --check src/acp/serve.js && node --check src/pack/sbom.js && node --check src/pack/sheet.en.js && node --check src/safety/secrets.js && node --check src/version.js && node --check src/agent/budget.js && node --check src/agent/filemem.js && node --check src/agent/memory.js && node --check src/agent/recall.js && node --check src/agent/salvage.js && node --check src/backend/learn.js && node --check src/backend/mcp.js && node --check src/tools/task.js && node --check src/tools/outline.js && node --check src/tools/verify.js && node --check src/ui/approve.js && node --check src/ui/complete.js && node --check src/ui/screen.js && node --check src/reset.js && echo OK",
55
- "coverage": "node test/coverage.mjs",
56
- "prepublishOnly": "npm run check && npm test"
57
- },
58
- "dependencies": {},
59
- "devDependencies": {}
60
- }
1
+ {
2
+ "name": "deel-local-cli",
3
+ "version": "1.13.1",
4
+ "description": "A coding-agent CLI that runs on local models and private gateways. Zero dependencies, Node 20+.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "bin": {
8
+ "deel": "bin/deel.js"
9
+ },
10
+ "engines": {
11
+ "node": ">=20"
12
+ },
13
+ "files": [
14
+ "bin",
15
+ "src",
16
+ "README.md",
17
+ "README.ko.md",
18
+ "LICENSE"
19
+ ],
20
+ "keywords": [
21
+ "cli",
22
+ "coding-agent",
23
+ "local-llm",
24
+ "ollama",
25
+ "lm-studio",
26
+ "openai-compatible",
27
+ "offline",
28
+ "air-gapped",
29
+ "zero-dependency",
30
+ "agent",
31
+ "acp",
32
+ "agent-client-protocol",
33
+ "zed",
34
+ "korean"
35
+ ],
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/jysvai/deel-local-cli.git"
39
+ },
40
+ "bugs": {
41
+ "url": "https://github.com/jysvai/deel-local-cli/issues"
42
+ },
43
+ "homepage": "https://github.com/jysvai/deel-local-cli#readme",
44
+ "scripts": {
45
+ "start": "node bin/deel.js",
46
+ "setup": "node bin/deel.js setup",
47
+ "diagnose": "node bin/deel.js diagnose",
48
+ "chat": "node bin/deel.js",
49
+ "test": "node test/run.mjs",
50
+ "docs": "node tools/check-docs.mjs",
51
+ "verify": "node test/no-bundle.test.js && node test/network.test.js && node test/web.test.js",
52
+ "bench": "node test/edit-bench.js",
53
+ "demo": "node test/demo.js",
54
+ "check": "node tools/check-src.mjs",
55
+ "coverage": "node test/coverage.mjs",
56
+ "prepublishOnly": "npm run check && npm test"
57
+ },
58
+ "dependencies": {},
59
+ "devDependencies": {}
60
+ }
package/src/acp/map.js CHANGED
@@ -14,9 +14,19 @@
14
14
  //
15
15
  // ── 순수하게 둔다 ───────────────────────────────────────────────────────
16
16
  //
17
- // 이 파일은 아무것도 부르고 아무 데도 쓴다. 값을 넣으면 값이 나온다.
18
- // 그래야 진짜 에디터 없이 검사할 수 있다 — 붙인 것이 맞는지 확인하려고
19
- // Zed 를 띄워야 한다면 아무도 확인 안 하게 된다.
17
+ // 이 파일은 **아무것도 건드리지 않는다** 파일도, 그물도, 화면도. 값을
18
+ // 넣으면 값이 나온다. 그래야 진짜 에디터 없이 검사할 수 있다 — 붙인 것이
19
+ // 맞는지 확인하려고 Zed 를 띄워야 한다면 아무도 확인 안 하게 된다.
20
+ //
21
+ // 「아무것도 안 부른다」 로 적어 뒀던 적이 있고, 그 말 때문에 도구 부름을
22
+ // 읽는 규칙을 여기에 **한 벌 더** 적었다. 그 벌은 OpenAI 꼴만 알았고,
23
+ // Anthropic 으로 대화하면 되살린 화면에서 도구가 통째로 사라졌다. 아무 말도
24
+ // 없이 — 「도구를 안 썼구나」 와 구별이 안 된다.
25
+ //
26
+ // 읽기만 하는 순수 함수를 들여오는 것은 순수함을 안 깬다. 규격을 읽는 규칙은
27
+ // backend/adapter.js 한 곳에만 있어야 한다 (집안 규칙: 자는 한 벌).
28
+ import { 부른것들, 결과들, 본문글 } from '../backend/adapter.js';
29
+ import { 첫이름 } from '../tools/label.js';
20
30
 
21
31
  /**
22
32
  * 도구 이름 → ACP 갈래.
@@ -55,7 +65,9 @@ export function 도구갈래(이름) {
55
65
  */
56
66
  export function 도구이름표(이름, 인자) {
57
67
  const a = 인자 ?? {};
58
- const = a.file_path ?? a.pattern ?? a.path ?? a.url ?? a.name ?? a.purpose ?? a.목적
68
+ // 어느 이름을 먼저 보는지는 tools/label.js 곳에 있다. 여기에 적으면,
69
+ // 새 인자 이름이 생겼을 때 다섯 자리 중 몇 곳만 고쳐진다.
70
+ const 첫 = 첫이름(a)
59
71
  ?? (a.command ? String(a.command).replace(/\s+/g, ' ') : null)
60
72
  ?? (Array.isArray(a.files) && a.files.length
61
73
  ? `${a.files[0]?.file_path ?? '?'}${a.files.length > 1 ? ` 외 ${a.files.length - 1}개` : ''}`
@@ -184,18 +196,10 @@ export function 멈춘까닭(까닭) {
184
196
  */
185
197
  function 글만(m) {
186
198
  const c = m?.content;
187
- let 글 = '';
188
199
  let 장수 = Array.isArray(m?.images) ? m.images.length : 0; // ollama 규격
189
- if (typeof c === 'string') = c;
190
- else if (Array.isArray(c)) {
191
- const 조각 = [];
192
- for (const p of c) {
193
- if (p?.type === 'text' && typeof p.text === 'string') 조각.push(p.text);
194
- else if (p?.type === 'image_url') 장수++;
195
- }
196
- 글 = 조각.join('\n');
197
- }
198
- 글 = 글.trim();
200
+ if (Array.isArray(c)) for (const p of c) if (p?.type === 'image_url' || p?.type === 'image') 장수++;
201
+ // 글을 뽑는 규칙은 규격마다 다르다 — 그 규칙은 adapter.js 한 곳에 있다.
202
+ let = 본문글(m).trim();
199
203
  if (장수) 글 = 글 ? `${글}\n\n_(그림 ${장수}장)_` : `_(그림 ${장수}장)_`;
200
204
  return 글;
201
205
  }
@@ -236,12 +240,14 @@ export function 되살린것(messages, { 최대내용 = 2000 } = {}) {
236
240
  const id로 = new Map();
237
241
  const 이름으로 = new Map();
238
242
  for (const m of 줄) {
239
- if (m?.role !== 'tool') continue;
240
- if (m.tool_call_id != null) id로.set(m.tool_call_id, m.content);
241
- else if (m.tool_name) {
242
- const q = 이름으로.get(m.tool_name) ?? [];
243
- q.push(m.content);
244
- 이름으로.set(m.tool_name, q);
243
+ // Anthropic 꼴 결과는 role 'user' 다. role 로 고르면 통째로 놓친다.
244
+ for (const r of 결과들(m)) {
245
+ if (r.id != null) id로.set(r.id, r.글);
246
+ else if (r.name) {
247
+ const q = 이름으로.get(r.name) ?? [];
248
+ q.push(r.글);
249
+ 이름으로.set(r.name, q);
250
+ }
245
251
  }
246
252
  }
247
253
 
@@ -280,10 +286,9 @@ export function 되살린것(messages, { 최대내용 = 2000 } = {}) {
280
286
  });
281
287
  }
282
288
 
283
- for (const tc of Array.isArray(m.tool_calls) ? m.tool_calls : []) {
284
- const fn = tc?.function ?? tc ?? {};
285
- const 이름 = String(fn.name ?? tc?.name ?? '도구');
286
- const 인자 = 인자풀기(fn.arguments ?? fn.args ?? tc?.args);
289
+ for (const tc of 부른것들(m)) {
290
+ const 이름 = String(tc.name ?? '도구');
291
+ const 인자 = 인자풀기(tc.args);
287
292
 
288
293
  let 답;
289
294
  if (tc?.id != null && id로.has(tc.id)) 답 = id로.get(tc.id);