argo-search 2.9.7 → 2.9.9
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 +73 -150
- package/README.es.md +73 -150
- package/README.ja.md +79 -156
- package/README.ko.md +78 -155
- package/README.md +80 -159
- package/SKILL.md +3 -3
- package/assets/readme/hero.svg +2 -2
- package/backends/domain_profiles.json +48 -0
- package/backends/engine_registry.yaml +118 -4
- package/backends/quota_profiles.json +92 -12
- package/backends/source_types_cn.json +27 -1
- package/bin/argo +78 -5
- package/bin/argo.js +33 -2
- package/config.yaml +269 -63
- package/docs/ARGO_INTRO.md +5 -3
- package/docs/ENGINE_CATALOG.md +50 -39
- package/docs/MCP_SETUP.md +3 -1
- package/docs/RELEASE_NOTES_v2.9.8.md +73 -0
- package/docs/RELEASE_NOTES_v2.9.9.md +78 -0
- package/engines/specs/cfets.yaml +41 -0
- package/engines/specs/defillama.yaml +38 -0
- package/engines/specs/firecrawl.yaml +1 -1
- package/engines/specs/fxtwitter.yaml +5 -0
- package/engines/specs/gleif.yaml +55 -0
- package/engines/specs/hkex.yaml +40 -0
- package/engines/specs/keenable_free.yaml +36 -0
- package/engines/specs/shfe.yaml +39 -0
- package/engines/specs/stackexchange.yaml +2 -2
- package/engines/specs/tavily_free.yaml +56 -0
- package/engines/specs/yuanbao.yaml +93 -0
- package/mcp/clients.yaml +32 -0
- package/package.json +7 -2
- package/packages/dsh-plugin/README.md +25 -6
- package/packages/dsh-plugin/dsh/client.js +402 -47
- package/packages/dsh-plugin/dsh/diagnostics.js +97 -0
- package/packages/dsh-plugin/dsh/index.js +135 -1876
- package/packages/dsh-plugin/dsh/native-tools.mjs +7 -1
- package/packages/dsh-plugin/dsh/runner.js +666 -0
- package/packages/dsh-plugin/dsh/wide-research.js +878 -0
- package/packages/dsh-plugin/package.json +3 -3
- package/packages/dsh-plugin/scripts/sync-local.sh +70 -0
- package/packages/dsh-plugin/test/client.test.js +177 -2
- package/packages/dsh-plugin/test/diagnostics.test.js +28 -0
- package/packages/dsh-plugin/test/index.test.js +44 -0
- package/scripts/adaptive.py +126 -43
- package/scripts/article_meta.py +131 -0
- package/scripts/bench_tail_ab.py +281 -0
- package/scripts/bounded_run.py +91 -49
- package/scripts/budget.py +247 -0
- package/scripts/budget_cli.py +93 -0
- package/scripts/build_release_assets.sh +65 -0
- package/scripts/cache.py +60 -72
- package/scripts/ci_drift_gate.py +90 -0
- package/scripts/clock_bridge.py +22 -0
- package/scripts/content_boundary.py +46 -0
- package/scripts/content_security.py +119 -4
- package/scripts/content_signals.py +26 -5
- package/scripts/cross_lingual_trace.py +293 -0
- package/scripts/dispatch_result.py +105 -0
- package/scripts/engine_add.py +602 -0
- package/scripts/engine_dispatch.py +58 -86
- package/scripts/engine_env.py +5 -0
- package/scripts/engine_families.py +6 -0
- package/scripts/engine_policy.py +7 -7
- package/scripts/engines.py +21 -0
- package/scripts/engines_base.py +3 -3
- package/scripts/engines_builders.py +12 -0
- package/scripts/engines_builders_batch10.py +48 -3
- package/scripts/engines_builders_batch14.py +656 -0
- package/scripts/engines_builders_batch15.py +249 -0
- package/scripts/engines_builders_keyless.py +111 -0
- package/scripts/engines_builders_tech.py +0 -1
- package/scripts/evidence.py +31 -3
- package/scripts/evidence_loop.py +58 -22
- package/scripts/fetch_quality.py +13 -0
- package/scripts/fetch_v3.py +28 -3
- package/scripts/gen_routing_snapshot.py +11 -0
- package/scripts/http_client.py +24 -38
- package/scripts/install.ps1 +18 -0
- package/scripts/install.sh +16 -1
- package/scripts/job.py +3 -3
- package/scripts/local_seek.py +41 -5
- package/scripts/macro_countries.py +15 -0
- package/scripts/matrix_search_eval.py +192 -0
- package/scripts/mcp_compact.py +234 -0
- package/scripts/mcp_handlers.py +60 -642
- package/scripts/mcp_launch.sh +10 -8
- package/scripts/mcp_local.py +241 -0
- package/scripts/mcp_server.py +19 -14
- package/scripts/mcp_setup.py +33 -9
- package/scripts/mcp_tools.py +1 -0
- package/scripts/mcp_transport.py +1 -1
- package/scripts/mcp_warm.py +127 -0
- package/scripts/net_proxy.py +27 -0
- package/scripts/output_transparency.py +200 -0
- package/scripts/paid_policy.py +98 -0
- package/scripts/quota.py +158 -13
- package/scripts/recovery.py +7 -3
- package/scripts/recovery_runner.py +150 -0
- package/scripts/replay_eval.py +18 -0
- package/scripts/research.py +37 -21
- package/scripts/research_expand.py +24 -1
- package/scripts/retry_policy.py +76 -0
- package/scripts/route.py +6 -6
- package/scripts/route_cache.py +18 -0
- package/scripts/route_combo.py +26 -5
- package/scripts/route_domains.py +170 -31
- package/scripts/safe_conn.py +52 -0
- package/scripts/search.py +15 -27
- package/scripts/search_attribution.py +100 -3
- package/scripts/search_cli.py +24 -11
- package/scripts/search_entry.py +8 -1
- package/scripts/search_output.py +99 -15
- package/scripts/search_pipeline.py +62 -195
- package/scripts/search_rank.py +6 -0
- package/scripts/search_types.py +107 -9
- package/scripts/semantic_evidence.py +179 -3
- package/scripts/serp_guard.py +138 -7
- package/scripts/serp_kill_log.py +25 -2
- package/scripts/stats_cli.py +13 -1
- package/scripts/tail_completion.py +212 -0
- package/scripts/url_safety.py +126 -3
- package/scripts/usage_log.py +45 -0
- package/scripts/wide_research.py +45 -0
- package/scripts/zhihu_quota.py +139 -0
- package/sub-skills/local-search/bm25.py +27 -3
- package/sub-skills/local-search/cli_runner.py +331 -0
- package/sub-skills/local-search/parsers.py +328 -0
- package/sub-skills/local-search/search_v3.py +31 -674
- package/sub-skills/local-seek/scripts/seek_rank.py +7 -3
- package/assets/readme/settings-keys.png +0 -0
- package/assets/readme/settings-tools.png +0 -0
- package/sub-skills/ego-search/references/browser-runtime.md +0 -43
- package/sub-skills/ego-search/references/install.md +0 -67
- package/sub-skills/ego-search/references/original-ego-upgrade.md +0 -51
- package/sub-skills/ego-search/tests/test_query_normalize.py +0 -68
- package/sub-skills/js-run/tests/fixtures/challenge_like.js +0 -27
- package/sub-skills/js-run/tests/test_jsrun.py +0 -165
- package/sub-skills/local-seek/references/auto-behaviors.md +0 -24
- package/sub-skills/local-seek/references/fd-mdfind-recipes.md +0 -62
- package/sub-skills/local-seek/references/git-integration.md +0 -54
- package/sub-skills/local-seek/references/remote-handoff.md +0 -46
- package/sub-skills/local-seek/references/rg-recipes.md +0 -96
- package/sub-skills/local-seek/references/strategies.md +0 -52
- package/sub-skills/local-seek/references/structural-search.md +0 -59
- package/sub-skills/local-seek/tests/test_content_rank.py +0 -222
- package/sub-skills/local-seek/tests/test_determinism_20261006.py +0 -145
- package/sub-skills/local-seek/tests/test_noise_tier.py +0 -101
- package/sub-skills/local-seek/tests/test_pcre2_probe.py +0 -136
- package/sub-skills/local-seek/tests/test_rank_pinyin.py +0 -77
- package/sub-skills/local-seek/tests/test_regression_20261003.py +0 -169
- package/sub-skills/local-seek/tests/test_regression_20261006.py +0 -146
- package/sub-skills/local-seek/tests/test_seek_degradation.py +0 -111
- package/sub-skills/local-seek/tests/test_seek_fts.py +0 -313
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* diagnostics.js — argo-dsh 运行时监控与连接池只读诊断
|
|
3
|
+
*
|
|
4
|
+
* 为设置面板、外部插件或排查脚本提供只读状态自省能力,
|
|
5
|
+
* 避免状态探查逻辑与核心检索逻辑耦合。
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
9
|
+
import { homedir } from 'node:os'
|
|
10
|
+
import { join } from 'node:path'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 读 argo 的本地使用日志,汇总成「路由观测」卡片数据。
|
|
14
|
+
*
|
|
15
|
+
* 数据来源与 stats_cli.py / usage_log.py 同一处(<state>/usage_log/*.jsonl),
|
|
16
|
+
* 只读、不写、不出本机。argo 未运行过(无日志)时返回 { samples: [] },
|
|
17
|
+
* 面板据此显示终端命令提示——不假装有数据。
|
|
18
|
+
*
|
|
19
|
+
* @param {string} [stateDir] - argo 状态目录;缺省用 ARGO_STATE_DIR 或平台惯例
|
|
20
|
+
* @param {number} [limit] - 最近几条
|
|
21
|
+
*/
|
|
22
|
+
export function getRouteHealth(stateDir, limit = 10) {
|
|
23
|
+
const dir = stateDir
|
|
24
|
+
|| process.env.ARGO_STATE_DIR
|
|
25
|
+
|| join(homedir(), '.cache', 'unified-search')
|
|
26
|
+
const samples = []
|
|
27
|
+
try {
|
|
28
|
+
const routePath = join(dir, 'usage_log', 'route.jsonl')
|
|
29
|
+
if (existsSync(routePath)) {
|
|
30
|
+
const lines = readFileSync(routePath, 'utf8').split('\n').filter(Boolean)
|
|
31
|
+
for (const line of lines.slice(-limit)) {
|
|
32
|
+
try {
|
|
33
|
+
const row = JSON.parse(line)
|
|
34
|
+
if (row && typeof row === 'object') {
|
|
35
|
+
samples.push({
|
|
36
|
+
query: row.query || row.original_query || '',
|
|
37
|
+
engine: row.engine || (row.decision && row.decision.engine) || '',
|
|
38
|
+
domain: row.domain || (row.decision && row.decision.domain) || '',
|
|
39
|
+
confidence: row.confidence || (row.decision && row.decision.confidence) || '',
|
|
40
|
+
reason: row.reason || (row.decision && row.decision.reason) || '',
|
|
41
|
+
ts: row.ts || row.timestamp || '',
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
} catch { /* 单行坏数据不影响其余 */ }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
} catch { /* 读不到就空 */ }
|
|
48
|
+
return { samples, source: 'usage_log/route.jsonl', stateDir: dir }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 获取当前常驻 MCP 连接池的运行时指标。
|
|
53
|
+
*
|
|
54
|
+
* @param {Array} pool - MCP 连接池实例数组
|
|
55
|
+
* @returns {Object} 包含连接数、当前负载以及各连接健康状态的快照
|
|
56
|
+
*/
|
|
57
|
+
export function getMcpPoolStats(pool = []) {
|
|
58
|
+
const connections = pool.map((conn, index) => ({
|
|
59
|
+
index,
|
|
60
|
+
load: typeof conn.load === 'function' ? conn.load() : 0,
|
|
61
|
+
hasProcess: Boolean(conn.proc ?? true),
|
|
62
|
+
}))
|
|
63
|
+
|
|
64
|
+
const totalLoad = connections.reduce((sum, item) => sum + item.load, 0)
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
poolSize: pool.length,
|
|
68
|
+
activeConnections: pool.filter(conn => typeof conn.load === 'function' && conn.load() > 0).length,
|
|
69
|
+
totalLoad,
|
|
70
|
+
connections,
|
|
71
|
+
timestamp: Date.now(),
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 诊断并重置 MCP 连接池。
|
|
77
|
+
*
|
|
78
|
+
* @param {Array} pool - MCP 连接池实例数组
|
|
79
|
+
* @param {Function} disposeFn - 释放函数
|
|
80
|
+
* @returns {Object} 重置结果摘要
|
|
81
|
+
*/
|
|
82
|
+
export function resetMcpPool(pool = [], disposeFn) {
|
|
83
|
+
const beforeCount = pool.length
|
|
84
|
+
if (typeof disposeFn === 'function') {
|
|
85
|
+
disposeFn()
|
|
86
|
+
} else {
|
|
87
|
+
for (const conn of [...pool]) {
|
|
88
|
+
try { conn.close?.() } catch { /* ignore */ }
|
|
89
|
+
}
|
|
90
|
+
pool.length = 0
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
evictedCount: beforeCount,
|
|
94
|
+
poolSizeNow: pool.length,
|
|
95
|
+
success: true,
|
|
96
|
+
}
|
|
97
|
+
}
|