jinzd-ai-cli 0.4.136 → 0.4.137
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/dist/{batch-PLWYBV75.js → batch-S546KMT3.js} +2 -2
- package/dist/{chunk-QCFTOP3R.js → chunk-64ZV6EIF.js} +1 -1
- package/dist/{chunk-DPT5HN3D.js → chunk-EBOCXEMG.js} +1 -1
- package/dist/{chunk-UGNMM6TM.js → chunk-FFOF5X3A.js} +2 -2
- package/dist/{chunk-STUFQVOX.js → chunk-OAX25W3S.js} +1 -1
- package/dist/{chunk-2S27S4DO.js → chunk-OGQSPINV.js} +1 -1
- package/dist/{chunk-U5YSA4XD.js → chunk-PC63O6KH.js} +1 -1
- package/dist/{chunk-RZFAK5XL.js → chunk-RES5PFFV.js} +1 -1
- package/dist/{chunk-UGKFU3I5.js → chunk-SAHPM6XW.js} +1 -1
- package/dist/{chunk-6N5IWWPQ.js → chunk-YHPTGPSG.js} +104 -16
- package/dist/{constants-T5DUKPIU.js → constants-IDR4PDK4.js} +1 -1
- package/dist/{doctor-cli-WGUJO6LJ.js → doctor-cli-4SBDC25U.js} +5 -5
- package/dist/electron-server.js +103 -15
- package/dist/{hub-YJFLXIG4.js → hub-RDZGFPF3.js} +1 -1
- package/dist/index.js +15 -15
- package/dist/{run-tests-V3HUOGWE.js → run-tests-QBZH44CO.js} +2 -2
- package/dist/{run-tests-AUBA7PAV.js → run-tests-R4T6GRZL.js} +1 -1
- package/dist/{server-BSCDYGH7.js → server-DGFNLTX2.js} +8 -8
- package/dist/{server-STXQEXTU.js → server-ZX6LJKTB.js} +4 -4
- package/dist/{task-orchestrator-PHHK3KWD.js → task-orchestrator-4WIXJWI2.js} +4 -4
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OGQSPINV.js";
|
|
5
5
|
import "./chunk-2ZD3YTVM.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-EBOCXEMG.js";
|
|
7
7
|
import "./chunk-PDX44BCA.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/batch.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YHPTGPSG.js";
|
|
5
5
|
import {
|
|
6
6
|
APP_NAME,
|
|
7
7
|
CONFIG_DIR_NAME,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
MCP_PROTOCOL_VERSION,
|
|
12
12
|
MCP_TOOL_PREFIX,
|
|
13
13
|
VERSION
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EBOCXEMG.js";
|
|
15
15
|
import {
|
|
16
16
|
redactJson
|
|
17
17
|
} from "./chunk-7ZJN4KLV.js";
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
} from "./chunk-3BICTI5M.js";
|
|
6
6
|
import {
|
|
7
7
|
runTestsTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PC63O6KH.js";
|
|
9
9
|
import {
|
|
10
10
|
getDangerLevel,
|
|
11
11
|
isFileWriteTool,
|
|
12
12
|
runTool
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OAX25W3S.js";
|
|
14
14
|
import {
|
|
15
15
|
EnvLoader,
|
|
16
16
|
NetworkError,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
SUBAGENT_ALLOWED_TOOLS,
|
|
24
24
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
25
25
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EBOCXEMG.js";
|
|
27
27
|
import {
|
|
28
28
|
fileCheckpoints
|
|
29
29
|
} from "./chunk-4BKXL7SM.js";
|
|
@@ -3427,6 +3427,8 @@ var webSearchTool = {
|
|
|
3427
3427
|
}
|
|
3428
3428
|
const order = engine === "auto" ? ["bing", "google"] : engine === "bing" ? ["bing"] : ["google"];
|
|
3429
3429
|
const errors = [];
|
|
3430
|
+
let weakBingFallback = null;
|
|
3431
|
+
let weakBingReason = null;
|
|
3430
3432
|
for (let i = 0; i < order.length; i++) {
|
|
3431
3433
|
const eng = order[i];
|
|
3432
3434
|
const isLastEngine = i === order.length - 1;
|
|
@@ -3436,15 +3438,25 @@ var webSearchTool = {
|
|
|
3436
3438
|
errors.push(`${eng}: 0 results`);
|
|
3437
3439
|
continue;
|
|
3438
3440
|
}
|
|
3439
|
-
if (eng === "bing" && !isLastEngine
|
|
3440
|
-
|
|
3441
|
-
|
|
3441
|
+
if (eng === "bing" && !isLastEngine) {
|
|
3442
|
+
const verdict = classifyBingWeakness(query, results);
|
|
3443
|
+
if (verdict !== null) {
|
|
3444
|
+
errors.push(`bing: ${verdict}, trying ${order[i + 1]}`);
|
|
3445
|
+
weakBingFallback = results;
|
|
3446
|
+
weakBingReason = verdict;
|
|
3447
|
+
continue;
|
|
3448
|
+
}
|
|
3442
3449
|
}
|
|
3443
3450
|
return formatResults(query, eng, results);
|
|
3444
3451
|
} catch (err) {
|
|
3445
3452
|
errors.push(`${eng}: ${err instanceof Error ? err.message : String(err)}`);
|
|
3446
3453
|
}
|
|
3447
3454
|
}
|
|
3455
|
+
if (weakBingFallback) {
|
|
3456
|
+
return formatResults(query, "bing", weakBingFallback, {
|
|
3457
|
+
warning: `engine signaled weak relevance (${weakBingReason}). These results may be Bing's "popular sites" fallback rather than real matches. Consider rephrasing the query (shorter, fewer constraints), or use web_fetch against a known authoritative URL (e.g. baike.baidu.com, mfa.gov.cn, news.cctv.com).`
|
|
3458
|
+
});
|
|
3459
|
+
}
|
|
3448
3460
|
throw new NetworkError(
|
|
3449
3461
|
`web_search failed across all engines.
|
|
3450
3462
|
${errors.map((e) => " - " + e).join("\n")}
|
|
@@ -3452,8 +3464,11 @@ Tip: a CAPTCHA wall or a result-page redesign can cause this. Try web_fetch with
|
|
|
3452
3464
|
);
|
|
3453
3465
|
}
|
|
3454
3466
|
};
|
|
3455
|
-
function
|
|
3456
|
-
if (results.length < 3) return
|
|
3467
|
+
function classifyBingWeakness(query, results) {
|
|
3468
|
+
if (results.length < 3) return null;
|
|
3469
|
+
if (hasZeroKeywordOverlap(query, results)) {
|
|
3470
|
+
return "zero query-keyword overlap (no result mentions any query term)";
|
|
3471
|
+
}
|
|
3457
3472
|
const hostCounts = /* @__PURE__ */ new Map();
|
|
3458
3473
|
for (const r of results) {
|
|
3459
3474
|
try {
|
|
@@ -3463,11 +3478,79 @@ function isWeakBingResult(results) {
|
|
|
3463
3478
|
}
|
|
3464
3479
|
}
|
|
3465
3480
|
const maxSameHost = Math.max(0, ...hostCounts.values());
|
|
3466
|
-
if (maxSameHost / results.length >= 0.6)
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3481
|
+
if (maxSameHost / results.length >= 0.6) {
|
|
3482
|
+
return `domain monoculture (${maxSameHost}/${results.length} same host)`;
|
|
3483
|
+
}
|
|
3484
|
+
const noiseRe = NOISE_DOMAIN_RE;
|
|
3485
|
+
const noiseCount = results.filter((r) => noiseRe.test(r.url) || noiseRe.test(r.title)).length;
|
|
3486
|
+
if (noiseCount / results.length >= 0.4) {
|
|
3487
|
+
return `${noiseCount}/${results.length} results from known-noise domains`;
|
|
3488
|
+
}
|
|
3489
|
+
return null;
|
|
3490
|
+
}
|
|
3491
|
+
var NOISE_DOMAIN_RE = new RegExp(
|
|
3492
|
+
"\\b(" + [
|
|
3493
|
+
// Network/CDN noise tests
|
|
3494
|
+
"speedtest\\.net",
|
|
3495
|
+
"fast\\.com",
|
|
3496
|
+
"ookla\\.com",
|
|
3497
|
+
// Adult content sites observed in v0.4.135/136 traces
|
|
3498
|
+
"samh130",
|
|
3499
|
+
"91secomic",
|
|
3500
|
+
"cnshaik",
|
|
3501
|
+
"suishenpu",
|
|
3502
|
+
// CN entertainment / video portals Bing uses as "popular sites" filler
|
|
3503
|
+
"youku\\.(com|tv)",
|
|
3504
|
+
"iqiyi\\.com",
|
|
3505
|
+
"world-iqiyi\\.com",
|
|
3506
|
+
"4gtv\\.tv",
|
|
3507
|
+
"doubao\\.com",
|
|
3508
|
+
"doubao\\.zube\\.cn",
|
|
3509
|
+
"gamersky\\.com",
|
|
3510
|
+
// CN academic noise (when query is news-y, not academic)
|
|
3511
|
+
"cnki\\.(net|com\\.cn)",
|
|
3512
|
+
// Non-news health spam
|
|
3513
|
+
"encompasshealth",
|
|
3514
|
+
// Baidu Baike "single digit / single character" entries
|
|
3515
|
+
"baike\\.baidu\\.com\\/item\\/5\\b",
|
|
3516
|
+
"baike\\.baidu\\.com\\/item\\/[^/]*\\d{4,}",
|
|
3517
|
+
// Generic baidu redirect / 知道 / 经验 / 健康 when off-topic — caught via TITLE match
|
|
3518
|
+
"baidu\\.com\\/s\\?",
|
|
3519
|
+
// Kansas Rehab Hospital pattern (observed v0.4.135 dev)
|
|
3520
|
+
"kansas",
|
|
3521
|
+
// 麻豆 entertainment (TW/CN content site)
|
|
3522
|
+
"\u9EBB\u8C46",
|
|
3523
|
+
// 抖音 / Steam tutorials (Baidu Jingyan) — common popular noise
|
|
3524
|
+
"\u6296\u97F3",
|
|
3525
|
+
"17c\u5F71\u89C6"
|
|
3526
|
+
].join("|") + ")",
|
|
3527
|
+
"i"
|
|
3528
|
+
);
|
|
3529
|
+
function extractQueryTokens(query) {
|
|
3530
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
3531
|
+
const cjkRuns = query.match(/[一-鿿]+/g) ?? [];
|
|
3532
|
+
for (const run of cjkRuns) {
|
|
3533
|
+
if (run.length < 2) continue;
|
|
3534
|
+
for (let i = 0; i < run.length - 1; i++) {
|
|
3535
|
+
tokens.add(run.slice(i, i + 2));
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
const ascii = query.match(/[a-zA-Z]{3,}/g) ?? [];
|
|
3539
|
+
for (const w of ascii) tokens.add(w.toLowerCase());
|
|
3540
|
+
const digits = query.match(/\d{2,}/g) ?? [];
|
|
3541
|
+
for (const d of digits) tokens.add(d);
|
|
3542
|
+
return tokens;
|
|
3543
|
+
}
|
|
3544
|
+
function hasZeroKeywordOverlap(query, results) {
|
|
3545
|
+
const tokens = extractQueryTokens(query);
|
|
3546
|
+
if (tokens.size === 0) return false;
|
|
3547
|
+
for (const r of results) {
|
|
3548
|
+
const haystack = (r.title + " " + r.snippet).toLowerCase();
|
|
3549
|
+
for (const t of tokens) {
|
|
3550
|
+
if (haystack.includes(t.toLowerCase())) return false;
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3553
|
+
return true;
|
|
3471
3554
|
}
|
|
3472
3555
|
async function searchBing(query, num) {
|
|
3473
3556
|
const url = new URL("https://cn.bing.com/search");
|
|
@@ -3556,13 +3639,18 @@ function stripTags2(html) {
|
|
|
3556
3639
|
function decodeHtmlEntities(s) {
|
|
3557
3640
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(///g, "/").replace(/ /g, " ");
|
|
3558
3641
|
}
|
|
3559
|
-
function formatResults(query, engine, results) {
|
|
3560
|
-
|
|
3642
|
+
function formatResults(query, engine, results, opts) {
|
|
3643
|
+
let preamble = `Search results for "${query}" via ${engine} (${results.length} results):
|
|
3561
3644
|
`;
|
|
3645
|
+
if (opts?.warning) {
|
|
3646
|
+
preamble = `\u26A0\uFE0F WEAK RESULTS WARNING: ${opts.warning}
|
|
3647
|
+
|
|
3648
|
+
${preamble}`;
|
|
3649
|
+
}
|
|
3562
3650
|
const body = results.map((r, i) => `${i + 1}. **${r.title}**
|
|
3563
3651
|
URL: ${r.url}
|
|
3564
3652
|
${decodeHtmlEntities(r.snippet) || "(no snippet extracted)"}`).join("\n\n");
|
|
3565
|
-
return
|
|
3653
|
+
return preamble + "\n" + body;
|
|
3566
3654
|
}
|
|
3567
3655
|
|
|
3568
3656
|
// src/tools/builtin/save-last-response.ts
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getConfigDirUsage,
|
|
4
4
|
listRecentCrashes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RES5PFFV.js";
|
|
6
6
|
import {
|
|
7
7
|
ProviderRegistry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SAHPM6XW.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OGQSPINV.js";
|
|
12
12
|
import {
|
|
13
13
|
getStatsSnapshot,
|
|
14
14
|
getTopFailingTools,
|
|
15
15
|
getTopUsedTools,
|
|
16
16
|
resetStats
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OAX25W3S.js";
|
|
18
18
|
import "./chunk-2ZD3YTVM.js";
|
|
19
19
|
import {
|
|
20
20
|
DEV_STATE_FILE_NAME,
|
|
21
21
|
MEMORY_FILE_NAME,
|
|
22
22
|
VERSION
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-EBOCXEMG.js";
|
|
24
24
|
import "./chunk-PDX44BCA.js";
|
|
25
25
|
|
|
26
26
|
// src/diagnostics/doctor-cli.ts
|
package/dist/electron-server.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
VERSION,
|
|
37
37
|
buildUserIdentityPrompt,
|
|
38
38
|
runTestsTool
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-64ZV6EIF.js";
|
|
40
40
|
import {
|
|
41
41
|
hasSemanticIndex,
|
|
42
42
|
semanticSearch
|
|
@@ -7123,6 +7123,8 @@ var webSearchTool = {
|
|
|
7123
7123
|
}
|
|
7124
7124
|
const order = engine === "auto" ? ["bing", "google"] : engine === "bing" ? ["bing"] : ["google"];
|
|
7125
7125
|
const errors = [];
|
|
7126
|
+
let weakBingFallback = null;
|
|
7127
|
+
let weakBingReason = null;
|
|
7126
7128
|
for (let i = 0; i < order.length; i++) {
|
|
7127
7129
|
const eng = order[i];
|
|
7128
7130
|
const isLastEngine = i === order.length - 1;
|
|
@@ -7132,15 +7134,25 @@ var webSearchTool = {
|
|
|
7132
7134
|
errors.push(`${eng}: 0 results`);
|
|
7133
7135
|
continue;
|
|
7134
7136
|
}
|
|
7135
|
-
if (eng === "bing" && !isLastEngine
|
|
7136
|
-
|
|
7137
|
-
|
|
7137
|
+
if (eng === "bing" && !isLastEngine) {
|
|
7138
|
+
const verdict = classifyBingWeakness(query, results);
|
|
7139
|
+
if (verdict !== null) {
|
|
7140
|
+
errors.push(`bing: ${verdict}, trying ${order[i + 1]}`);
|
|
7141
|
+
weakBingFallback = results;
|
|
7142
|
+
weakBingReason = verdict;
|
|
7143
|
+
continue;
|
|
7144
|
+
}
|
|
7138
7145
|
}
|
|
7139
7146
|
return formatResults(query, eng, results);
|
|
7140
7147
|
} catch (err) {
|
|
7141
7148
|
errors.push(`${eng}: ${err instanceof Error ? err.message : String(err)}`);
|
|
7142
7149
|
}
|
|
7143
7150
|
}
|
|
7151
|
+
if (weakBingFallback) {
|
|
7152
|
+
return formatResults(query, "bing", weakBingFallback, {
|
|
7153
|
+
warning: `engine signaled weak relevance (${weakBingReason}). These results may be Bing's "popular sites" fallback rather than real matches. Consider rephrasing the query (shorter, fewer constraints), or use web_fetch against a known authoritative URL (e.g. baike.baidu.com, mfa.gov.cn, news.cctv.com).`
|
|
7154
|
+
});
|
|
7155
|
+
}
|
|
7144
7156
|
throw new NetworkError(
|
|
7145
7157
|
`web_search failed across all engines.
|
|
7146
7158
|
${errors.map((e) => " - " + e).join("\n")}
|
|
@@ -7148,8 +7160,11 @@ Tip: a CAPTCHA wall or a result-page redesign can cause this. Try web_fetch with
|
|
|
7148
7160
|
);
|
|
7149
7161
|
}
|
|
7150
7162
|
};
|
|
7151
|
-
function
|
|
7152
|
-
if (results.length < 3) return
|
|
7163
|
+
function classifyBingWeakness(query, results) {
|
|
7164
|
+
if (results.length < 3) return null;
|
|
7165
|
+
if (hasZeroKeywordOverlap(query, results)) {
|
|
7166
|
+
return "zero query-keyword overlap (no result mentions any query term)";
|
|
7167
|
+
}
|
|
7153
7168
|
const hostCounts = /* @__PURE__ */ new Map();
|
|
7154
7169
|
for (const r of results) {
|
|
7155
7170
|
try {
|
|
@@ -7159,11 +7174,79 @@ function isWeakBingResult(results) {
|
|
|
7159
7174
|
}
|
|
7160
7175
|
}
|
|
7161
7176
|
const maxSameHost = Math.max(0, ...hostCounts.values());
|
|
7162
|
-
if (maxSameHost / results.length >= 0.6)
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7177
|
+
if (maxSameHost / results.length >= 0.6) {
|
|
7178
|
+
return `domain monoculture (${maxSameHost}/${results.length} same host)`;
|
|
7179
|
+
}
|
|
7180
|
+
const noiseRe = NOISE_DOMAIN_RE;
|
|
7181
|
+
const noiseCount = results.filter((r) => noiseRe.test(r.url) || noiseRe.test(r.title)).length;
|
|
7182
|
+
if (noiseCount / results.length >= 0.4) {
|
|
7183
|
+
return `${noiseCount}/${results.length} results from known-noise domains`;
|
|
7184
|
+
}
|
|
7185
|
+
return null;
|
|
7186
|
+
}
|
|
7187
|
+
var NOISE_DOMAIN_RE = new RegExp(
|
|
7188
|
+
"\\b(" + [
|
|
7189
|
+
// Network/CDN noise tests
|
|
7190
|
+
"speedtest\\.net",
|
|
7191
|
+
"fast\\.com",
|
|
7192
|
+
"ookla\\.com",
|
|
7193
|
+
// Adult content sites observed in v0.4.135/136 traces
|
|
7194
|
+
"samh130",
|
|
7195
|
+
"91secomic",
|
|
7196
|
+
"cnshaik",
|
|
7197
|
+
"suishenpu",
|
|
7198
|
+
// CN entertainment / video portals Bing uses as "popular sites" filler
|
|
7199
|
+
"youku\\.(com|tv)",
|
|
7200
|
+
"iqiyi\\.com",
|
|
7201
|
+
"world-iqiyi\\.com",
|
|
7202
|
+
"4gtv\\.tv",
|
|
7203
|
+
"doubao\\.com",
|
|
7204
|
+
"doubao\\.zube\\.cn",
|
|
7205
|
+
"gamersky\\.com",
|
|
7206
|
+
// CN academic noise (when query is news-y, not academic)
|
|
7207
|
+
"cnki\\.(net|com\\.cn)",
|
|
7208
|
+
// Non-news health spam
|
|
7209
|
+
"encompasshealth",
|
|
7210
|
+
// Baidu Baike "single digit / single character" entries
|
|
7211
|
+
"baike\\.baidu\\.com\\/item\\/5\\b",
|
|
7212
|
+
"baike\\.baidu\\.com\\/item\\/[^/]*\\d{4,}",
|
|
7213
|
+
// Generic baidu redirect / 知道 / 经验 / 健康 when off-topic — caught via TITLE match
|
|
7214
|
+
"baidu\\.com\\/s\\?",
|
|
7215
|
+
// Kansas Rehab Hospital pattern (observed v0.4.135 dev)
|
|
7216
|
+
"kansas",
|
|
7217
|
+
// 麻豆 entertainment (TW/CN content site)
|
|
7218
|
+
"\u9EBB\u8C46",
|
|
7219
|
+
// 抖音 / Steam tutorials (Baidu Jingyan) — common popular noise
|
|
7220
|
+
"\u6296\u97F3",
|
|
7221
|
+
"17c\u5F71\u89C6"
|
|
7222
|
+
].join("|") + ")",
|
|
7223
|
+
"i"
|
|
7224
|
+
);
|
|
7225
|
+
function extractQueryTokens(query) {
|
|
7226
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
7227
|
+
const cjkRuns = query.match(/[一-鿿]+/g) ?? [];
|
|
7228
|
+
for (const run of cjkRuns) {
|
|
7229
|
+
if (run.length < 2) continue;
|
|
7230
|
+
for (let i = 0; i < run.length - 1; i++) {
|
|
7231
|
+
tokens.add(run.slice(i, i + 2));
|
|
7232
|
+
}
|
|
7233
|
+
}
|
|
7234
|
+
const ascii = query.match(/[a-zA-Z]{3,}/g) ?? [];
|
|
7235
|
+
for (const w of ascii) tokens.add(w.toLowerCase());
|
|
7236
|
+
const digits = query.match(/\d{2,}/g) ?? [];
|
|
7237
|
+
for (const d of digits) tokens.add(d);
|
|
7238
|
+
return tokens;
|
|
7239
|
+
}
|
|
7240
|
+
function hasZeroKeywordOverlap(query, results) {
|
|
7241
|
+
const tokens = extractQueryTokens(query);
|
|
7242
|
+
if (tokens.size === 0) return false;
|
|
7243
|
+
for (const r of results) {
|
|
7244
|
+
const haystack = (r.title + " " + r.snippet).toLowerCase();
|
|
7245
|
+
for (const t of tokens) {
|
|
7246
|
+
if (haystack.includes(t.toLowerCase())) return false;
|
|
7247
|
+
}
|
|
7248
|
+
}
|
|
7249
|
+
return true;
|
|
7167
7250
|
}
|
|
7168
7251
|
async function searchBing(query, num) {
|
|
7169
7252
|
const url = new URL("https://cn.bing.com/search");
|
|
@@ -7252,13 +7335,18 @@ function stripTags2(html) {
|
|
|
7252
7335
|
function decodeHtmlEntities(s) {
|
|
7253
7336
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(///g, "/").replace(/ /g, " ");
|
|
7254
7337
|
}
|
|
7255
|
-
function formatResults(query, engine, results) {
|
|
7256
|
-
|
|
7338
|
+
function formatResults(query, engine, results, opts) {
|
|
7339
|
+
let preamble = `Search results for "${query}" via ${engine} (${results.length} results):
|
|
7257
7340
|
`;
|
|
7341
|
+
if (opts?.warning) {
|
|
7342
|
+
preamble = `\u26A0\uFE0F WEAK RESULTS WARNING: ${opts.warning}
|
|
7343
|
+
|
|
7344
|
+
${preamble}`;
|
|
7345
|
+
}
|
|
7258
7346
|
const body = results.map((r, i) => `${i + 1}. **${r.title}**
|
|
7259
7347
|
URL: ${r.url}
|
|
7260
7348
|
${decodeHtmlEntities(r.snippet) || "(no snippet extracted)"}`).join("\n\n");
|
|
7261
|
-
return
|
|
7349
|
+
return preamble + "\n" + body;
|
|
7262
7350
|
}
|
|
7263
7351
|
|
|
7264
7352
|
// src/tools/builtin/save-last-response.ts
|
|
@@ -12418,7 +12506,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
12418
12506
|
case "test": {
|
|
12419
12507
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
12420
12508
|
try {
|
|
12421
|
-
const { executeTests } = await import("./run-tests-
|
|
12509
|
+
const { executeTests } = await import("./run-tests-R4T6GRZL.js");
|
|
12422
12510
|
const argStr = args.join(" ").trim();
|
|
12423
12511
|
let testArgs = {};
|
|
12424
12512
|
if (argStr) {
|
|
@@ -386,7 +386,7 @@ ${content}`);
|
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
389
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
389
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-4WIXJWI2.js");
|
|
390
390
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
391
391
|
let interrupted = false;
|
|
392
392
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
saveDevState,
|
|
17
17
|
sessionHasMeaningfulContent,
|
|
18
18
|
setupProxy
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-FFOF5X3A.js";
|
|
20
20
|
import {
|
|
21
21
|
getConfigDirUsage,
|
|
22
22
|
listRecentCrashes,
|
|
23
23
|
writeCrashLog
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-RES5PFFV.js";
|
|
25
25
|
import {
|
|
26
26
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
27
27
|
HALLUCINATION_CORRECTION_MESSAGE,
|
|
@@ -39,10 +39,10 @@ import {
|
|
|
39
39
|
looksLikeDocumentBody,
|
|
40
40
|
stripPseudoToolCalls,
|
|
41
41
|
stripToolCallReminder
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-SAHPM6XW.js";
|
|
43
43
|
import {
|
|
44
44
|
ConfigManager
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-OGQSPINV.js";
|
|
46
46
|
import {
|
|
47
47
|
ToolExecutor,
|
|
48
48
|
ToolRegistry,
|
|
@@ -61,16 +61,16 @@ import {
|
|
|
61
61
|
spawnAgentContext,
|
|
62
62
|
theme,
|
|
63
63
|
undoStack
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-YHPTGPSG.js";
|
|
65
65
|
import "./chunk-3BICTI5M.js";
|
|
66
66
|
import "./chunk-2DXY7UGF.js";
|
|
67
|
-
import "./chunk-
|
|
67
|
+
import "./chunk-PC63O6KH.js";
|
|
68
68
|
import {
|
|
69
69
|
getStatsSnapshot,
|
|
70
70
|
getTopFailingTools,
|
|
71
71
|
getTopUsedTools,
|
|
72
72
|
installFlushOnExit
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-OAX25W3S.js";
|
|
74
74
|
import "./chunk-2ZD3YTVM.js";
|
|
75
75
|
import {
|
|
76
76
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
SKILLS_DIR_NAME,
|
|
94
94
|
VERSION,
|
|
95
95
|
buildUserIdentityPrompt
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-EBOCXEMG.js";
|
|
97
97
|
import {
|
|
98
98
|
formatGitContextForPrompt,
|
|
99
99
|
getGitContext,
|
|
@@ -1812,7 +1812,7 @@ No tools match "${filter}".
|
|
|
1812
1812
|
const { join: join6 } = await import("path");
|
|
1813
1813
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1814
1814
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-7KIP4X2V.js");
|
|
1815
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1815
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-IDR4PDK4.js");
|
|
1816
1816
|
const { approveProject, hashMcpFile } = await import("./project-trust-IFM7FXEV.js");
|
|
1817
1817
|
const cwd = process.cwd();
|
|
1818
1818
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2873,7 +2873,7 @@ ${hint}` : "")
|
|
|
2873
2873
|
usage: "/test [command|filter]",
|
|
2874
2874
|
async execute(args, ctx) {
|
|
2875
2875
|
try {
|
|
2876
|
-
const { executeTests } = await import("./run-tests-
|
|
2876
|
+
const { executeTests } = await import("./run-tests-QBZH44CO.js");
|
|
2877
2877
|
const argStr = args.join(" ").trim();
|
|
2878
2878
|
let testArgs = {};
|
|
2879
2879
|
if (argStr) {
|
|
@@ -7327,7 +7327,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7327
7327
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7328
7328
|
process.exit(1);
|
|
7329
7329
|
}
|
|
7330
|
-
const { startWebServer } = await import("./server-
|
|
7330
|
+
const { startWebServer } = await import("./server-DGFNLTX2.js");
|
|
7331
7331
|
await startWebServer({ port, host: options.host });
|
|
7332
7332
|
});
|
|
7333
7333
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | logout-all <name> | migrate <name>)").action(async (action, username) => {
|
|
@@ -7494,12 +7494,12 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7494
7494
|
console.log(footer + "\n");
|
|
7495
7495
|
});
|
|
7496
7496
|
program.command("doctor").description("Health check: API keys, config, MCP, recent crashes, tool usage, disk usage").option("--json", "Output as JSON (for scripting)").option("--reset-stats", "Reset accumulated tool usage statistics").action(async (options) => {
|
|
7497
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7497
|
+
const { runDoctorCli } = await import("./doctor-cli-4SBDC25U.js");
|
|
7498
7498
|
await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
|
|
7499
7499
|
});
|
|
7500
7500
|
program.command("batch <action> [arg] [arg2]").description("Anthropic Message Batches: submit | list | status <id> | results <id> [out] | cancel <id>").option("--dry-run", "Parse and validate input without submitting (submit only)").action(async (action, arg, arg2, options) => {
|
|
7501
7501
|
try {
|
|
7502
|
-
const batch = await import("./batch-
|
|
7502
|
+
const batch = await import("./batch-S546KMT3.js");
|
|
7503
7503
|
switch (action) {
|
|
7504
7504
|
case "submit":
|
|
7505
7505
|
if (!arg) {
|
|
@@ -7542,7 +7542,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7542
7542
|
}
|
|
7543
7543
|
});
|
|
7544
7544
|
program.command("mcp-serve").description("Start an MCP server over STDIO, exposing aicli's built-in tools to Claude Desktop / Cursor / other MCP clients").option("--allow-destructive", "Allow bash / run_interactive / task_create (always destructive in MCP mode)").option("--allow-outside-cwd", "Allow tool path arguments to escape the sandbox root \u2014 disabled by default").option("--tools <list>", "Comma-separated whitelist of tools to expose (default: all eligible tools)").option("--cwd <path>", "Working directory AND sandbox root (default: current directory)").action(async (options) => {
|
|
7545
|
-
const { startMcpServer } = await import("./server-
|
|
7545
|
+
const { startMcpServer } = await import("./server-ZX6LJKTB.js");
|
|
7546
7546
|
await startMcpServer({
|
|
7547
7547
|
allowDestructive: !!options.allowDestructive,
|
|
7548
7548
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7669,7 +7669,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7669
7669
|
}),
|
|
7670
7670
|
config.get("customProviders")
|
|
7671
7671
|
);
|
|
7672
|
-
const { startHub } = await import("./hub-
|
|
7672
|
+
const { startHub } = await import("./hub-RDZGFPF3.js");
|
|
7673
7673
|
await startHub(
|
|
7674
7674
|
{
|
|
7675
7675
|
topic: topic ?? "",
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
loadDevState,
|
|
15
15
|
persistToolRound,
|
|
16
16
|
setupProxy
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FFOF5X3A.js";
|
|
18
18
|
import {
|
|
19
19
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
20
20
|
HALLUCINATION_CORRECTION_MESSAGE,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
looksLikeDocumentBody,
|
|
29
29
|
stripPseudoToolCalls,
|
|
30
30
|
stripToolCallReminder
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-SAHPM6XW.js";
|
|
32
32
|
import {
|
|
33
33
|
ConfigManager
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-OGQSPINV.js";
|
|
35
35
|
import {
|
|
36
36
|
ToolExecutor,
|
|
37
37
|
ToolRegistry,
|
|
@@ -49,14 +49,14 @@ import {
|
|
|
49
49
|
spawnAgentContext,
|
|
50
50
|
truncateOutput,
|
|
51
51
|
undoStack
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-YHPTGPSG.js";
|
|
53
53
|
import "./chunk-3BICTI5M.js";
|
|
54
54
|
import "./chunk-2DXY7UGF.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-PC63O6KH.js";
|
|
56
56
|
import {
|
|
57
57
|
getDangerLevel,
|
|
58
58
|
runTool
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-OAX25W3S.js";
|
|
60
60
|
import "./chunk-2ZD3YTVM.js";
|
|
61
61
|
import {
|
|
62
62
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
SKILLS_DIR_NAME,
|
|
77
77
|
VERSION,
|
|
78
78
|
buildUserIdentityPrompt
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-EBOCXEMG.js";
|
|
80
80
|
import {
|
|
81
81
|
formatGitContextForPrompt,
|
|
82
82
|
getGitContext,
|
|
@@ -2460,7 +2460,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
2460
2460
|
case "test": {
|
|
2461
2461
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
2462
2462
|
try {
|
|
2463
|
-
const { executeTests } = await import("./run-tests-
|
|
2463
|
+
const { executeTests } = await import("./run-tests-QBZH44CO.js");
|
|
2464
2464
|
const argStr = args.join(" ").trim();
|
|
2465
2465
|
let testArgs = {};
|
|
2466
2466
|
if (argStr) {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YHPTGPSG.js";
|
|
5
5
|
import "./chunk-3BICTI5M.js";
|
|
6
6
|
import "./chunk-2DXY7UGF.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-PC63O6KH.js";
|
|
8
8
|
import {
|
|
9
9
|
getDangerLevel,
|
|
10
10
|
runTool,
|
|
11
11
|
schemaToJsonSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OAX25W3S.js";
|
|
13
13
|
import "./chunk-2ZD3YTVM.js";
|
|
14
14
|
import {
|
|
15
15
|
VERSION
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EBOCXEMG.js";
|
|
17
17
|
import "./chunk-4BKXL7SM.js";
|
|
18
18
|
import "./chunk-7ZJN4KLV.js";
|
|
19
19
|
import "./chunk-KHYD3WXE.js";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YHPTGPSG.js";
|
|
7
7
|
import "./chunk-3BICTI5M.js";
|
|
8
8
|
import "./chunk-2DXY7UGF.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-PC63O6KH.js";
|
|
10
10
|
import {
|
|
11
11
|
getDangerLevel,
|
|
12
12
|
runTool
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OAX25W3S.js";
|
|
14
14
|
import "./chunk-2ZD3YTVM.js";
|
|
15
15
|
import {
|
|
16
16
|
SUBAGENT_ALLOWED_TOOLS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EBOCXEMG.js";
|
|
18
18
|
import "./chunk-4BKXL7SM.js";
|
|
19
19
|
import "./chunk-7ZJN4KLV.js";
|
|
20
20
|
import "./chunk-KHYD3WXE.js";
|