deel-local-cli 1.5.8 → 1.6.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/README.en.md +30 -14
- package/README.md +28 -12
- package/bin/deel.js +10 -0
- package/package.json +2 -2
- package/src/acp/map.js +143 -0
- package/src/acp/serve.js +166 -13
- package/src/agent/commit.js +511 -0
- package/src/agent/compact.js +269 -226
- package/src/agent/loop.js +196 -12
- package/src/agent/mention.js +56 -10
- package/src/agent/review.js +192 -0
- package/src/agent/session.js +22 -2
- package/src/agent/threads.js +1 -1
- package/src/backend/adapter.js +342 -280
- package/src/backend/azure.js +151 -0
- package/src/backend/ctxsize.js +19 -0
- package/src/backend/detect.js +106 -0
- package/src/backend/http.js +350 -30
- package/src/backend/probe.js +48 -1
- package/src/backend/proxy.js +151 -0
- package/src/backend/quota.js +133 -0
- package/src/backend/retry.js +132 -0
- package/src/backend/vision.js +185 -0
- package/src/commands.js +341 -8
- package/src/completion.js +264 -0
- package/src/config.js +117 -1
- package/src/i18n/en.js +13 -1
- package/src/i18n/index.js +22 -3
- package/src/i18n/ja.js +266 -0
- package/src/i18n/ko.js +12 -0
- package/src/i18n/zh.js +266 -0
- package/src/oneshot.js +28 -3
- package/src/pack/sbom.js +25 -0
- package/src/pack/selfpack.js +9 -3
- package/src/plugins/manage.js +34 -7
- package/src/repl.js +92 -6
- package/src/report.js +26 -2
- package/src/safety/guard.js +74 -2
- package/src/safety/keystore.js +237 -0
- package/src/safety/network.js +76 -14
- package/src/safety/policy.js +209 -0
- package/src/safety/secrets.js +32 -0
- package/src/setup.js +40 -7
- package/src/tools/clipboard.js +178 -0
- package/src/tools/convert.js +287 -0
- package/src/tools/docs.js +72 -1
- package/src/tools/fastgrep.js +217 -0
- package/src/tools/fsutil.js +55 -12
- package/src/tools/ignore.js +192 -0
- package/src/tools/index.js +391 -41
- package/src/tools/jobs.js +4 -12
- package/src/tools/outline.js +3 -1
- package/src/tools/pdf.js +1368 -0
- package/src/tools/shell.js +123 -0
- package/src/tools/verify.js +20 -4
- package/src/tools/webfetch.js +18 -5
- package/src/ui/inputbox.js +2 -2
- package/src/ui/screen.js +4 -1
- package/src/ui/status.js +22 -0
package/src/agent/session.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// 대화 상태와 컨텍스트 셈. /context 가 보여주는 숫자가 여기서 나온다.
|
|
2
2
|
import { readFileSync, existsSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
+
import { 그림장수, 글만, 그림한장토큰 } from '../backend/vision.js';
|
|
4
5
|
import { get as workMode, 말 as 모드말, DEFAULT as WORK_DEFAULT } from './modes.js';
|
|
5
6
|
import { toolSchemas } from '../tools/index.js';
|
|
6
7
|
import { normalize as normLevel, DEFAULT as LEVEL_DEFAULT } from '../ui/level.js';
|
|
@@ -9,6 +10,7 @@ import { 지문 } from './project.js';
|
|
|
9
10
|
import { 프롬프트토막 as 기억토막 } from './memory.js';
|
|
10
11
|
import { 못박기 } from './pins.js';
|
|
11
12
|
import { 언어, 지시말 } from '../i18n/index.js';
|
|
13
|
+
import { 셸안내 } from '../tools/shell.js';
|
|
12
14
|
|
|
13
15
|
// 토큰 추정 — 정확한 토크나이저 없이 대략만 센다.
|
|
14
16
|
// 한글은 글자당 약 1토큰, 영문·코드는 약 4글자당 1토큰으로 본다.
|
|
@@ -48,6 +50,7 @@ const BASE_RULES = `너는 deel 다. 사용자의 작업 폴더 안에서 코드
|
|
|
48
50
|
- 같은 도구를 같은 인자로 다시 부르지 않는다. 결과는 같다. 본 것은 기억하고 다음으로 넘어간다.
|
|
49
51
|
- 사용자가 볼 범위를 못 박아 말하면 그 범위를 지킨다. 안 그러면 필요한 만큼 찾아본다.
|
|
50
52
|
- 명령 실행이 필요하면 Bash 를 쓴다. 되돌릴 수 없는 명령은 막히니 다른 방법을 찾는다.
|
|
53
|
+
- 중간 파일이 필요하면 /tmp 말고 .deel/tmp/ 에 쓴다. 작업 폴더 밖은 막힌다.
|
|
51
54
|
- 사용자에게 답할 때는 한국어로, 짧게. 코드를 통째로 붙여넣지 말고 무엇이 달라졌는지 말한다.
|
|
52
55
|
|
|
53
56
|
다음에도 쓸 것은 남긴다:
|
|
@@ -128,6 +131,7 @@ Rules:
|
|
|
128
131
|
- Do not call the same tool with the same arguments twice. The result will be the same. Remember what you saw and move on.
|
|
129
132
|
- If the user names the scope to look at, stay inside it. Otherwise look as far as you need.
|
|
130
133
|
- Use Bash when you need to run a command. Commands that cannot be undone are blocked, so find another way.
|
|
134
|
+
- If you need a scratch file, write it under .deel/tmp/, not /tmp. Outside the working folder is blocked.
|
|
131
135
|
- Answer the user in English, briefly. Do not paste whole files back — say what changed.
|
|
132
136
|
|
|
133
137
|
Keep what will be needed again:
|
|
@@ -252,7 +256,7 @@ export class Session {
|
|
|
252
256
|
this.plugins = [];
|
|
253
257
|
this.maxSkillsListed = 40; // 프롬프트에 올릴 최대 개수
|
|
254
258
|
this.maxSkillDesc = 140; // 설명 한 줄 최대 길이
|
|
255
|
-
this.usage = { in: 0, out: 0, calls: 0, ms: 0 };
|
|
259
|
+
this.usage = { in: 0, out: 0, calls: 0, ms: 0, retries: 0 };
|
|
256
260
|
/*
|
|
257
261
|
* 지금 붙은 모델이 얼마나 하는가 (agent/grade.js).
|
|
258
262
|
*
|
|
@@ -319,6 +323,10 @@ export class Session {
|
|
|
319
323
|
parts.push(영
|
|
320
324
|
? `\nWorking folder: ${this.root}\nYou can neither read nor write files outside this folder.`
|
|
321
325
|
: `\n작업 폴더: ${this.root}\n이 폴더 밖의 파일은 읽지도 쓰지도 못한다.`);
|
|
326
|
+
// 어느 셸에서 명령이 도는지 한 줄 (tools/shell.js). 모델이 ls 를 칠지 dir 를 칠지가
|
|
327
|
+
// 여기서 갈린다 — cmd 에서 유닉스 명령을 치면 한 번에 20~40초짜리 헛걸음이다.
|
|
328
|
+
// 세션 안에서는 안 변하는 줄이라 앞머리(캐시되는 자리)에 둔다.
|
|
329
|
+
parts.push(셸안내(영));
|
|
322
330
|
|
|
323
331
|
/*
|
|
324
332
|
* 모델 급에 맞춘 한 문단 (grade.js).
|
|
@@ -598,7 +606,18 @@ export class Session {
|
|
|
598
606
|
let history = 0;
|
|
599
607
|
let files = 0;
|
|
600
608
|
for (const m of this.messages) {
|
|
601
|
-
|
|
609
|
+
/*
|
|
610
|
+
* 그림은 글자 수로 세지 않는다.
|
|
611
|
+
*
|
|
612
|
+
* 그림은 base64 로 실려 있어서 글로 세면 4MB 짜리 한 장이 150만 토큰으로
|
|
613
|
+
* 잡힌다. 그러면 창이 다 찬 줄 알고 대화를 통째로 접는다 — 화면 사진 한 장
|
|
614
|
+
* 보여 준 값으로 하던 일을 잃는 셈이다. 한 장에 얼마인지는 서버가 정하는
|
|
615
|
+
* 것이라 우리는 모르므로, 정해 둔 값으로 세고 서버가 알려주는 실제 값으로
|
|
616
|
+
* 고쳐 나간다 (backend/vision.js 의 그림한장토큰 머리말).
|
|
617
|
+
*/
|
|
618
|
+
const 장수 = 그림장수(m);
|
|
619
|
+
const t = estimateTokens(장수 ? 글만(m) : (typeof m.content === 'string' ? m.content : JSON.stringify(m.content ?? '')))
|
|
620
|
+
+ 장수 * 그림한장토큰
|
|
602
621
|
+ estimateTokens(JSON.stringify(m.tool_calls ?? ''));
|
|
603
622
|
if (m.role === 'tool') files += t; else history += t;
|
|
604
623
|
}
|
|
@@ -673,6 +692,7 @@ export class Session {
|
|
|
673
692
|
// 재게 되고, 그러면 /context 가 실제보다 크게 말한다 — 그 값으로
|
|
674
693
|
// effort.js 가 출력 상한을 잡으므로 답이 이유 없이 짧아진다.
|
|
675
694
|
ctx: this.conn?.ctx ?? null,
|
|
695
|
+
vision: this.conn?.vision === true,
|
|
676
696
|
});
|
|
677
697
|
n = estimateTokens(JSON.stringify(list));
|
|
678
698
|
} catch { n = 0; }
|
package/src/agent/threads.js
CHANGED