cli-jaw 1.0.0 → 1.0.3
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.ko.md +21 -6
- package/README.md +108 -56
- package/README.zh-CN.md +21 -6
- package/dist/bin/commands/serve.js +1 -0
- package/dist/bin/commands/serve.js.map +1 -1
- package/dist/lib/quota-copilot.js +22 -6
- package/dist/lib/quota-copilot.js.map +1 -1
- package/dist/server.js +11 -4
- package/dist/server.js.map +1 -1
- package/dist/src/agent/spawn.js +73 -7
- package/dist/src/agent/spawn.js.map +1 -1
- package/dist/src/browser/connection.js +3 -0
- package/dist/src/browser/connection.js.map +1 -1
- package/dist/src/cli/acp-client.js +15 -12
- package/dist/src/cli/acp-client.js.map +1 -1
- package/dist/src/cli/commands.js +2 -1
- package/dist/src/cli/commands.js.map +1 -1
- package/dist/src/cli/handlers.js +22 -0
- package/dist/src/cli/handlers.js.map +1 -1
- package/dist/src/orchestrator/distribute.js +18 -1
- package/dist/src/orchestrator/distribute.js.map +1 -1
- package/dist/src/orchestrator/pipeline.js +51 -5
- package/dist/src/orchestrator/pipeline.js.map +1 -1
- package/dist/src/telegram/bot.js +29 -3
- package/dist/src/telegram/bot.js.map +1 -1
- package/package.json +1 -1
- package/public/dist/bundle.js +30 -30
- package/public/dist/bundle.js.map +4 -4
- package/public/js/cjk-fix.ts +38 -0
- package/public/js/features/chat.ts +4 -2
- package/public/js/render.ts +3 -1
- package/public/locales/en.json +4 -0
- package/public/locales/ko.json +4 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// CJK bold fix — CommonMark 6.2 right-flanking workaround
|
|
2
|
+
// Pure function, no browser dependencies — importable from Node.js tests.
|
|
3
|
+
//
|
|
4
|
+
// Problem: When closing ** is preceded by Unicode punctuation (e.g. ) . ! ?)
|
|
5
|
+
// and followed by a non-space non-punctuation char (e.g. CJK), CommonMark
|
|
6
|
+
// rejects it as right-flanking → bold fails to render.
|
|
7
|
+
//
|
|
8
|
+
// Fix: Insert ZWSP between the punctuation and ** so the parser sees **
|
|
9
|
+
// as preceded by non-punctuation (ZWSP is Cf, not Zs/P*).
|
|
10
|
+
|
|
11
|
+
export function fixCjkPunctuationBoundary(text: string): string {
|
|
12
|
+
// 1. Preserve fenced code blocks and inline code spans
|
|
13
|
+
const preserved: string[] = [];
|
|
14
|
+
let processed = text
|
|
15
|
+
.replace(/```[\s\S]*?```/g, (m) => {
|
|
16
|
+
preserved.push(m);
|
|
17
|
+
return `\x00P${preserved.length - 1}\x00`;
|
|
18
|
+
})
|
|
19
|
+
.replace(/`[^`]+`/g, (m) => {
|
|
20
|
+
preserved.push(m);
|
|
21
|
+
return `\x00P${preserved.length - 1}\x00`;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// 2. Insert ZWSP between punctuation (excluding *) and closing **
|
|
25
|
+
// when followed by non-space non-punctuation character
|
|
26
|
+
processed = processed.replace(
|
|
27
|
+
/([\p{P}])\*\*(?=[^\s\p{P}])/gu,
|
|
28
|
+
(m, punct) => (punct === '*' ? m : punct + '\u200B**'),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// 3. Restore preserved spans
|
|
32
|
+
processed = processed.replace(
|
|
33
|
+
/\x00P(\d+)\x00/g,
|
|
34
|
+
(_, i) => preserved[Number(i)],
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return processed;
|
|
38
|
+
}
|
|
@@ -14,8 +14,10 @@ export async function sendMessage(): Promise<void> {
|
|
|
14
14
|
const btn = document.getElementById('btnSend');
|
|
15
15
|
if (!input || !btn) return;
|
|
16
16
|
|
|
17
|
-
// Stop mode:
|
|
18
|
-
|
|
17
|
+
// Stop mode: only explicit button interaction should stop the agent.
|
|
18
|
+
// Prevent accidental Enter key presses in the input from sending /api/stop.
|
|
19
|
+
const stopByExplicitButton = document.activeElement === btn;
|
|
20
|
+
if (btn.classList.contains('stop-mode') && stopByExplicitButton && !input.value.trim() && !state.attachedFiles.length) {
|
|
19
21
|
apiFire('/api/stop', 'POST');
|
|
20
22
|
return;
|
|
21
23
|
}
|
package/public/js/render.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// All libs loaded via CDN (defer), graceful fallback if unavailable
|
|
4
4
|
|
|
5
5
|
import { t } from './features/i18n.js';
|
|
6
|
+
import { fixCjkPunctuationBoundary } from './cjk-fix.js';
|
|
6
7
|
|
|
7
8
|
export function escapeHtml(str: string): string {
|
|
8
9
|
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
|
@@ -195,7 +196,8 @@ export function renderMarkdown(text: string): string {
|
|
|
195
196
|
|
|
196
197
|
let html: string;
|
|
197
198
|
if (ensureMarked()) {
|
|
198
|
-
|
|
199
|
+
const fixed = fixCjkPunctuationBoundary(cleaned);
|
|
200
|
+
html = marked.parse(fixed) as string;
|
|
199
201
|
// Wrap tables for horizontal scrolling
|
|
200
202
|
html = html.replace(/<table/g, '<div class="table-wrapper"><table').replace(/<\/table>/g, '</table></div>');
|
|
201
203
|
} else {
|
package/public/locales/en.json
CHANGED
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"cmd.prompt.desc": "View system prompt",
|
|
16
16
|
"cmd.quit.desc": "Quit process",
|
|
17
17
|
"cmd.file.desc": "Attach file",
|
|
18
|
+
"cmd.steer.desc": "Interrupt agent and redirect",
|
|
19
|
+
"cmd.steer.noPrompt": "Usage: /steer <new prompt>",
|
|
20
|
+
"cmd.steer.noAgent": "No agent is currently running.",
|
|
21
|
+
"cmd.steer.started": "🔄 Redirecting...",
|
|
18
22
|
"cmd.unknown": "Unknown command: /{name}\nUse /help to see available commands.",
|
|
19
23
|
"cmd.unsupported": "❌ /{name} is not available on {iface}.",
|
|
20
24
|
"cmd.error": "❌ /{name} execution error: {msg}",
|
package/public/locales/ko.json
CHANGED
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"cmd.prompt.desc": "시스템 프롬프트 확인",
|
|
16
16
|
"cmd.quit.desc": "프로세스 종료",
|
|
17
17
|
"cmd.file.desc": "파일 첨부",
|
|
18
|
+
"cmd.steer.desc": "에이전트를 중단하고 새 지시로 전환",
|
|
19
|
+
"cmd.steer.noPrompt": "사용법: /steer <새 지시>",
|
|
20
|
+
"cmd.steer.noAgent": "실행 중인 에이전트가 없습니다.",
|
|
21
|
+
"cmd.steer.started": "🔄 방향 전환 중...",
|
|
18
22
|
"cmd.unknown": "알 수 없는 커맨드: /{name}\n/help로 사용 가능한 커맨드를 확인하세요.",
|
|
19
23
|
"cmd.unsupported": "❌ /{name}은(는) {iface}에서 사용할 수 없습니다.",
|
|
20
24
|
"cmd.error": "❌ /{name} 실행 오류: {msg}",
|