@kangyishuai/dsh-advisor 0.0.0-stage → 0.2.0

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.
@@ -0,0 +1,107 @@
1
+ // @ts-check
2
+ // 顾问的第二阶段取证:它返回 `needs: [{kind:"file", ref:"path"}]`,我们把文件内容读回来再喂一次,
3
+ // 让它基于**证据**而不是猜测下结论。
4
+ //
5
+ // 为什么不是「给顾问开放工具」:宿主目前的额外调用是单次补全,工具循环需要伪造 assistant/tool 消息,
6
+ // 跨 provider 不可靠;两阶段(请求证据 → 回灌 → 复核)语义等价、协议风险为零。
7
+ //
8
+ // 安全边界(必须全部满足才读):
9
+ // - 路径必须在**会话工作目录**之内(resolve 后做前缀比较,防 `../` 与符号链接逃逸);
10
+ // - 单文件 ≤ 64 KiB,一次最多 5 个文件(避免把顾问调用撑爆);
11
+ // - 只读,不列目录、不执行命令。
12
+ import { readFile, realpath } from "node:fs/promises";
13
+ import { isAbsolute, relative, resolve, sep } from "node:path";
14
+
15
+ /** 单文件上限。 */
16
+ export const MAX_FILE_BYTES = 64 * 1024;
17
+ /** 一次最多读几个文件。 */
18
+ export const MAX_FILES = 5;
19
+
20
+ /**
21
+ * 判断 target 是否在 root 之内(resolve + 相对路径不以 `..` 开头)。
22
+ * @param {string} root
23
+ * @param {string} target
24
+ * @returns {boolean}
25
+ */
26
+ export function isInside(root, target) {
27
+ if (typeof root !== "string" || root === "") return false;
28
+ const normalizedRoot = resolve(root);
29
+ const normalizedTarget = resolve(normalizedRoot, target);
30
+ const rel = relative(normalizedRoot, normalizedTarget);
31
+ return rel === "" || (!rel.startsWith("..") && !rel.startsWith(`..${sep}`) && !isAbsolute(rel));
32
+ }
33
+
34
+ /**
35
+ * 读回顾问要的证据。
36
+ * @param {{ root: string, needs: Array<{ kind: string, ref: string }>, maxFiles?: number, maxBytes?: number }} input
37
+ * @returns {Promise<{ sections: Array<{ ref: string, text: string, ok: boolean }>, refused: string[] }>}
38
+ */
39
+ export async function collectEvidence(input) {
40
+ const root = typeof input.root === "string" ? input.root : "";
41
+ const maxFiles = Number.isFinite(input.maxFiles) ? Number(input.maxFiles) : MAX_FILES;
42
+ const maxBytes = Number.isFinite(input.maxBytes) ? Number(input.maxBytes) : MAX_FILE_BYTES;
43
+ /** @type {Array<{ ref: string, text: string, ok: boolean }>} */
44
+ const sections = [];
45
+ /** @type {string[]} */
46
+ const refused = [];
47
+
48
+ const needs = Array.isArray(input.needs) ? input.needs : [];
49
+ let used = 0;
50
+ for (const need of needs) {
51
+ if (used >= maxFiles) break;
52
+ const ref = typeof need?.ref === "string" ? need.ref.trim() : "";
53
+ const kind = String(need?.kind ?? "file").toLowerCase();
54
+ if (ref === "") continue;
55
+ if (kind !== "file" && kind !== "path") {
56
+ refused.push(`${ref}(只支持 file/path)`);
57
+ continue;
58
+ }
59
+ if (!isInside(root, ref)) {
60
+ refused.push(`${ref}(不在会话工作目录内)`);
61
+ continue;
62
+ }
63
+ try {
64
+ const realRoot = await realpath(root).catch(() => resolve(root));
65
+ // 只有 realpath 成功时才做符号链接逃逸检查;文件不存在就交给 readFile 报 ENOENT。
66
+ const realTarget = await realpath(resolve(root, ref)).catch(() => null);
67
+ if (realTarget !== null && !isInside(realRoot, realTarget)) {
68
+ refused.push(`${ref}(真实路径逃出工作目录)`);
69
+ continue;
70
+ }
71
+ const buffer = await readFile(realTarget ?? resolve(root, ref));
72
+ const clipped = buffer.subarray(0, maxBytes);
73
+ const text = clipped.toString("utf8");
74
+ const note = buffer.length > maxBytes ? `\n…(已截断,原长 ${buffer.length} 字节)` : "";
75
+ sections.push({ ref, text: `${text}${note}`, ok: true });
76
+ used += 1;
77
+ } catch (error) {
78
+ const code = /** @type {any} */ (error)?.code;
79
+ refused.push(`${ref}(读取失败:${code ?? String(error)})`);
80
+ }
81
+ }
82
+ return { sections, refused };
83
+ }
84
+
85
+ /**
86
+ * 把取证结果拼成第二轮的用户消息片段。
87
+ * @param {{ sections: Array<{ ref: string, text: string }>, refused: string[] }} evidence
88
+ * @returns {string}
89
+ */
90
+ export function buildVerificationBlock(evidence) {
91
+ if (evidence.sections.length === 0 && evidence.refused.length === 0) return "";
92
+ const parts = [
93
+ "VERIFICATION PASS. You asked for evidence; here is what the workspace actually contains.",
94
+ "",
95
+ ];
96
+ for (const section of evidence.sections) {
97
+ parts.push(`--- ${section.ref} ---`, section.text, "");
98
+ }
99
+ if (evidence.refused.length > 0) {
100
+ parts.push(`Could not read: ${evidence.refused.join("; ")}`, "");
101
+ }
102
+ parts.push(
103
+ "Re-check your previous advice against this evidence. Keep it only if the evidence supports it;",
104
+ "correct anything the files contradict, and lower the severity when you cannot substantiate it.",
105
+ );
106
+ return parts.join("\n");
107
+ }
package/locale/en.json ADDED
@@ -0,0 +1,153 @@
1
+ {
2
+ "advisor": {
3
+ "title": "Pair the main model with a stronger advisor model it can consult at key moments",
4
+ "notReady.label": "Advisor is not ready · run /advisor doctor",
5
+ "notReady.detail": "The host returned no candidate routes: the plugin may be disabled, or host RPC is unavailable",
6
+ "group.current": "Current",
7
+ "group.extras": "Toggle & configure",
8
+ "current.detail": "In use in this session",
9
+ "toast.current": "This is already the current advisor",
10
+ "blocked.detail": "This route is unavailable right now",
11
+ "off.label": "Turn the advisor off",
12
+ "off.detail": "Reopen with /advisor at any time",
13
+ "settings.label": "+ Add or configure a provider…",
14
+ "settings.detail": "Open Settings → Models",
15
+ "settings.hint": "Put /advisor doctor in the composer — press Enter to see the next step",
16
+ "toast.settings": "Open Settings → Models to add or configure a provider",
17
+ "search.placeholder": "Search advisor models…",
18
+ "search.empty": "No advisor models are available yet",
19
+ "search.noResults": "No matching models",
20
+ "effort.auto": "auto",
21
+ "toast.applied": "Advisor set to {route} (reasoning effort {effort}); effective on the next consultation",
22
+ "toast.off": "Advisor turned off — reopen with /advisor at any time",
23
+ "toast.stale": "This choice is stale — reopen /advisor",
24
+ "error.failed": "Could not save the advisor; try again",
25
+ "error.unreachable": "Cannot reach the host — try again later or run /advisor doctor",
26
+ "error.malformed": "The host returned an unrecognized result — run /advisor doctor",
27
+ "settings.title": "Advisor",
28
+ "settings.desc": "Set the advisor mode, route, budgets and privacy. Saved changes apply to the next consultation.",
29
+ "settings.aria": "Advisor settings",
30
+ "settings.loading": "Reading host settings…",
31
+ "settings.retry": "Retry",
32
+ "settings.reload": "Reload",
33
+ "settings.save": "Save",
34
+ "settings.saving": "Saving…",
35
+ "settings.saved": "Saved",
36
+ "settings.noChanges": "No changes",
37
+ "settings.group.basic": "Basics",
38
+ "settings.group.budget": "Budgets",
39
+ "settings.group.privacy": "Privacy",
40
+ "settings.group.advanced": "Advanced & status",
41
+ "settings.mode": "Mode",
42
+ "settings.mode.off": "Off",
43
+ "settings.mode.offHint": "Never consult the advisor and never spend.",
44
+ "settings.mode.shadow": "Shadow",
45
+ "settings.mode.shadowHint": "Record only, never feed back to the model: the advisor is still called and logged, but its advice never enters the model context.",
46
+ "settings.mode.advisory": "Advisory",
47
+ "settings.mode.advisoryHint": "Normal consultation: advice returns to the model context as a tool card the model may follow or ignore.",
48
+ "settings.provider": "Provider",
49
+ "settings.provider.empty": "(none)",
50
+ "settings.provider.declared": "custom",
51
+ "settings.provider.none": "The host returned no routes (llm service unavailable?)",
52
+ "settings.provider.stale": "(current value is not in the route list)",
53
+ "settings.model": "Model",
54
+ "settings.model.empty": "(none)",
55
+ "settings.model.manual": "Type a model id",
56
+ "settings.model.manualHint": "Type an id if it is not listed; manual ids are not checked against the catalog.",
57
+ "settings.model.loading": "Loading models…",
58
+ "settings.model.pickProvider": "Pick a provider first",
59
+ "settings.model.none": "This route lists no models — type one manually",
60
+ "settings.model.stale": "(current value is not in the model list)",
61
+ "settings.effort": "Reasoning effort",
62
+ "settings.effort.auto": "Auto (model default)",
63
+ "settings.effort.none": "This model declares no reasoning efforts",
64
+ "settings.effort.pickModel": "Pick a model first",
65
+ "settings.effort.count": "The model declares {count} reasoning efforts",
66
+ "settings.effort.stale": "(current value is not declared by the model)",
67
+ "settings.postAnswer": "After each turn",
68
+ "settings.postAnswer.off": "off (do not run)",
69
+ "settings.postAnswer.card": "card (record one line)",
70
+ "settings.postAnswer.hint": "In advisory mode, run the advisor once after each turn; record only, never feed back.",
71
+ "settings.advisorTools": "Let the advisor read files",
72
+ "settings.advisorToolsHint": "Let the advisor request files inside the working directory (≤5 files, ≤64 KiB, read-only) to verify its conclusions; costs one extra model call.",
73
+ "settings.budget.maxCallsPerTurn": "Max calls per turn",
74
+ "settings.budget.maxCallsPerSession": "Max calls per session",
75
+ "settings.budget.maxCallsPerHour": "Max calls per hour",
76
+ "settings.budget.maxCostPerDayUsd": "Daily budget (USD)",
77
+ "settings.budget.workspaceMaxCallsPerDay": "Workspace max calls per day",
78
+ "settings.budget.workspaceMaxCostPerDayUsd": "Workspace daily budget (USD)",
79
+ "settings.budget.priceInputPerMTok": "Input price (USD / 1M tokens)",
80
+ "settings.budget.priceOutputPerMTok": "Output price (USD / 1M tokens)",
81
+ "settings.budget.range": "default {default} · range {min}–{max}",
82
+ "settings.budget.rangeUnlimited": "default {default} · range {min}–{max} (0 = unlimited)",
83
+ "settings.budget.priceHint": "0 = do not price tokens",
84
+ "settings.budget.workspaceHint": "Workspace-wide: shared across sessions, resets on the local day",
85
+ "settings.budget.poolLine": "Workspace today: {calls} calls · ≈{cost}",
86
+ "settings.budget.priceSource.builtin": "Price source: built-in reference",
87
+ "settings.budget.priceSource.settings": "Price source: yours",
88
+ "settings.budget.priceSource.none": "Price source: not set (tokens only)",
89
+ "settings.scope": "Send scope",
90
+ "settings.scope.off": "off",
91
+ "settings.scope.offHint": "Send no conversation content.",
92
+ "settings.scope.summary": "summary",
93
+ "settings.scope.summaryHint": "Send only the host-injected 300-character context (no file bodies).",
94
+ "settings.scope.full": "full",
95
+ "settings.scope.fullHint": "Send the full context, truncated to maxInputChars.",
96
+ "settings.privacy.redact": "Heuristic redaction",
97
+ "settings.privacy.redactHint": "Best-effort pattern replacement, not a secret scanner; leaks are still possible.",
98
+ "settings.privacy.dedupe": "Shadow-path dedupe",
99
+ "settings.privacy.dedupeHint": "Affects the shadow path only: identical advice is not recorded twice.",
100
+ "settings.advanced.maxTokens": "Output cap maxTokens",
101
+ "settings.advanced.temperature": "temperature",
102
+ "settings.advanced.temperatureHint": "Empty = not sent, decided by the adapter · range 0–2",
103
+ "settings.advanced.temperatureEmpty": "not sent",
104
+ "settings.advanced.maxInputChars": "Input cap maxInputChars (chars)",
105
+ "settings.advanced.sessionCap": "Session delivery cap sessionCap",
106
+ "settings.advanced.allowedModels": "Model allowlist allowedModels",
107
+ "settings.advanced.allowedModelsHint": "Empty = no limit; accepts provider/model or a bare model id",
108
+ "settings.advanced.allowedModelsPlaceholder": "e.g. deepseek/deepseek-chat, gpt-4o",
109
+ "settings.preview": "Send preview",
110
+ "settings.preview.run": "Preview what will be sent",
111
+ "settings.preview.running": "Previewing…",
112
+ "settings.preview.title": "Preview",
113
+ "settings.preview.expand": "Expand",
114
+ "settings.preview.collapse": "Collapse",
115
+ "settings.confirm": "Cross-provider send",
116
+ "settings.confirm.run": "Confirm cross-provider send",
117
+ "settings.confirm.running": "Confirming…",
118
+ "settings.confirm.hint": "Add the current provider to the confirmed list so cross-provider consultations stop being interrupted.",
119
+ "settings.confirm.done": "Confirmed {provider}",
120
+ "settings.status.title": "Status",
121
+ "settings.status.calls": "{count} calls so far",
122
+ "settings.status.tokens": "in {input} / out {output} tokens",
123
+ "settings.status.cost": "Estimated cost",
124
+ "settings.status.costUnset": "no prices configured",
125
+ "settings.status.last": "Last result",
126
+ "settings.status.skip": "Last skip reason",
127
+ "settings.status.ledger": "Ledger",
128
+ "settings.status.none": "none",
129
+ "settings.status.sep": ": ",
130
+ "settings.doctor": "Diagnostics",
131
+ "settings.doctor.run": "Run diagnostics",
132
+ "settings.doctor.running": "Running…",
133
+ "settings.doctor.empty": "No checks returned",
134
+ "settings.error.unreachable": "The host did not respond — try again later",
135
+ "settings.error.malformed": "The host returned unrecognized settings",
136
+ "settings.error.models": "Could not load the model list",
137
+ "settings.error.modelInfo": "Could not load the model's reasoning efforts",
138
+ "settings.error.doctor": "Diagnostics failed",
139
+ "settings.error.save": "Could not save",
140
+ "settings.error.saveHost": "Could not save: {message}",
141
+ "settings.error.preview": "Preview failed — try again later",
142
+ "settings.error.confirm": "Confirmation failed — try again later",
143
+ "tail.title": "Advisor",
144
+ "tail.severity.nit": "nit",
145
+ "tail.severity.concern": "concern",
146
+ "tail.severity.blocker": "blocker",
147
+ "tail.declined": "The advisor found nothing worth flagging",
148
+ "tail.empty": "(this advice has no body)",
149
+ "tail.anchors": "Evidence anchors did not match ({checked} checked)",
150
+ "tail.downgraded": "Severity downgraded",
151
+ "tail.aria": "Advisor advice (click to expand or collapse)"
152
+ }
153
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,153 @@
1
+ {
2
+ "advisor": {
3
+ "title": "让主模型在关键时刻咨询一个更强的顾问模型",
4
+ "notReady.label": "顾问尚未就绪 · 打开 /advisor doctor",
5
+ "notReady.detail": "宿主没有返回候选路由:插件可能未启用,或宿主 RPC 暂不可用",
6
+ "group.current": "当前",
7
+ "group.extras": "开关与配置",
8
+ "current.detail": "本会话正在使用",
9
+ "toast.current": "已经是当前顾问",
10
+ "blocked.detail": "该路由当前不可用",
11
+ "off.label": "不使用顾问(off)",
12
+ "off.detail": "随时可用 /advisor 重新开启",
13
+ "settings.label": "+ 添加或配置 provider…",
14
+ "settings.detail": "打开 设置 → 模型",
15
+ "settings.hint": "已把 /advisor doctor 放进输入框,回车查看下一步",
16
+ "toast.settings": "请打开 设置 → 模型 添加或配置 provider",
17
+ "search.placeholder": "搜索顾问模型…",
18
+ "search.empty": "还没有可选的顾问模型",
19
+ "search.noResults": "没有匹配的模型",
20
+ "effort.auto": "自动",
21
+ "toast.applied": "顾问已设为 {route}(思考档 {effort}),下一次徵询生效",
22
+ "toast.off": "顾问已关闭,随时可用 /advisor 重新开启",
23
+ "toast.stale": "这项选择已过期,请重新打开 /advisor",
24
+ "error.failed": "设置失败,请重试",
25
+ "error.unreachable": "连不上宿主,稍后重试或运行 /advisor doctor",
26
+ "error.malformed": "宿主返回了无法识别的结果,运行 /advisor doctor 查看诊断",
27
+ "settings.title": "顾问",
28
+ "settings.desc": "设置顾问模式、路由、预算与隐私;保存后的改动对下一次徵询生效。",
29
+ "settings.aria": "顾问设置",
30
+ "settings.loading": "正在读取宿主设置…",
31
+ "settings.retry": "重试",
32
+ "settings.reload": "重新加载",
33
+ "settings.save": "保存",
34
+ "settings.saving": "保存中…",
35
+ "settings.saved": "已保存",
36
+ "settings.noChanges": "没有改动",
37
+ "settings.group.basic": "基础",
38
+ "settings.group.budget": "预算",
39
+ "settings.group.privacy": "隐私",
40
+ "settings.group.advanced": "高级与状态",
41
+ "settings.mode": "模式",
42
+ "settings.mode.off": "关闭(off)",
43
+ "settings.mode.offHint": "不发起任何徵询,也不产生费用。",
44
+ "settings.mode.shadow": "影子(shadow)",
45
+ "settings.mode.shadowHint": "只记账,不回灌模型:仍会调用顾问并记录结果,但建议不会进入模型上下文。",
46
+ "settings.mode.advisory": "顾问(advisory)",
47
+ "settings.mode.advisoryHint": "正常徵询:顾问建议以工具卡回到模型上下文,模型可以采纳或忽略。",
48
+ "settings.provider": "provider",
49
+ "settings.provider.empty": "(未选择)",
50
+ "settings.provider.declared": "自定义",
51
+ "settings.provider.none": "宿主没有返回任何路由(llm 服务不可用?)",
52
+ "settings.provider.stale": "(当前值不在路由清单)",
53
+ "settings.model": "model",
54
+ "settings.model.empty": "(未选择)",
55
+ "settings.model.manual": "手填 model id",
56
+ "settings.model.manualHint": "列表里没有时可直接手填;手填不校验是否在目录中。",
57
+ "settings.model.loading": "正在读取模型…",
58
+ "settings.model.pickProvider": "先选 provider",
59
+ "settings.model.none": "该路由没有列出模型,可手填",
60
+ "settings.model.stale": "(当前值不在模型清单)",
61
+ "settings.effort": "思考档",
62
+ "settings.effort.auto": "自动(模型默认)",
63
+ "settings.effort.none": "该模型未声明思考档",
64
+ "settings.effort.pickModel": "先选 model",
65
+ "settings.effort.count": "模型声明了 {count} 个思考档",
66
+ "settings.effort.stale": "(当前值不在模型声明里)",
67
+ "settings.postAnswer": "回合结束后",
68
+ "settings.postAnswer.off": "off(不跑)",
69
+ "settings.postAnswer.card": "card(只记录一行)",
70
+ "settings.postAnswer.hint": "advisory 模式下,回合结束后自动跑一次顾问;只记录不回灌。",
71
+ "settings.advisorTools": "允许顾问读文件核实",
72
+ "settings.advisorToolsHint": "允许顾问请求读取工作目录内的文件(≤5 个、≤64 KiB、只读)来核实它的结论;会多一次模型调用。",
73
+ "settings.budget.maxCallsPerTurn": "每回合最多调用",
74
+ "settings.budget.maxCallsPerSession": "每会话最多调用",
75
+ "settings.budget.maxCallsPerHour": "每小时最多调用",
76
+ "settings.budget.maxCostPerDayUsd": "每日预算(USD)",
77
+ "settings.budget.workspaceMaxCallsPerDay": "工作区每日最多调用",
78
+ "settings.budget.workspaceMaxCostPerDayUsd": "工作区每日预算(USD)",
79
+ "settings.budget.priceInputPerMTok": "输入单价(USD / 百万 token)",
80
+ "settings.budget.priceOutputPerMTok": "输出单价(USD / 百万 token)",
81
+ "settings.budget.range": "默认 {default} · 范围 {min}–{max}",
82
+ "settings.budget.rangeUnlimited": "默认 {default} · 范围 {min}–{max}(0 = 不限)",
83
+ "settings.budget.priceHint": "0 = 不算钱,只统计 token",
84
+ "settings.budget.workspaceHint": "工作区级,跨会话累计、按本地日重置",
85
+ "settings.budget.poolLine": "工作区今日:{calls} 次 · ≈{cost}",
86
+ "settings.budget.priceSource.builtin": "单价来源:内置参考价",
87
+ "settings.budget.priceSource.settings": "单价来源:你设置的",
88
+ "settings.budget.priceSource.none": "单价来源:未配置(只记 token)",
89
+ "settings.scope": "发送范围",
90
+ "settings.scope.off": "off",
91
+ "settings.scope.offHint": "不发送任何会话内容。",
92
+ "settings.scope.summary": "summary",
93
+ "settings.scope.summaryHint": "只发 300 字符的宿主注入上下文(不含文件全文)。",
94
+ "settings.scope.full": "full",
95
+ "settings.scope.fullHint": "发送完整上下文,按 maxInputChars 截断。",
96
+ "settings.privacy.redact": "启发式脱敏",
97
+ "settings.privacy.redactHint": "尽力而为的模式替换,不是密钥扫描器,仍可能漏检。",
98
+ "settings.privacy.dedupe": "影子路径去重",
99
+ "settings.privacy.dedupeHint": "只影响 shadow 路径:相同结论不重复记账。",
100
+ "settings.advanced.maxTokens": "输出上限 maxTokens",
101
+ "settings.advanced.temperature": "temperature",
102
+ "settings.advanced.temperatureHint": "留空 = 不传,由 adapter 决定 · 范围 0–2",
103
+ "settings.advanced.temperatureEmpty": "不传",
104
+ "settings.advanced.maxInputChars": "输入上限 maxInputChars(字符)",
105
+ "settings.advanced.sessionCap": "单会话投递上限 sessionCap",
106
+ "settings.advanced.allowedModels": "模型白名单 allowedModels",
107
+ "settings.advanced.allowedModelsHint": "留空=不限制;可写 provider/model 或裸 model id",
108
+ "settings.advanced.allowedModelsPlaceholder": "例如 deepseek/deepseek-chat, gpt-4o",
109
+ "settings.preview": "发送预览",
110
+ "settings.preview.run": "预览会发什么",
111
+ "settings.preview.running": "预览中…",
112
+ "settings.preview.title": "预览内容",
113
+ "settings.preview.expand": "展开",
114
+ "settings.preview.collapse": "收起",
115
+ "settings.confirm": "跨 provider 发送",
116
+ "settings.confirm.run": "确认跨 provider 发送",
117
+ "settings.confirm.running": "确认中…",
118
+ "settings.confirm.hint": "把当前 provider 加进确认名单;跨 provider 徵询不再中断。",
119
+ "settings.confirm.done": "已确认 {provider}",
120
+ "settings.status.title": "状态摘要",
121
+ "settings.status.calls": "累计调用 {count} 次",
122
+ "settings.status.tokens": "in {input} / out {output} token",
123
+ "settings.status.cost": "估算金额",
124
+ "settings.status.costUnset": "未配置单价",
125
+ "settings.status.last": "最近一次结果",
126
+ "settings.status.skip": "最近跳过原因",
127
+ "settings.status.ledger": "账本",
128
+ "settings.status.none": "暂无",
129
+ "settings.status.sep": ":",
130
+ "settings.doctor": "诊断",
131
+ "settings.doctor.run": "运行诊断",
132
+ "settings.doctor.running": "诊断中…",
133
+ "settings.doctor.empty": "没有返回检查项",
134
+ "settings.error.unreachable": "宿主未响应,稍后重试",
135
+ "settings.error.malformed": "宿主返回了无法识别的设置",
136
+ "settings.error.models": "读取模型列表失败",
137
+ "settings.error.modelInfo": "读取模型思考档失败",
138
+ "settings.error.doctor": "诊断失败",
139
+ "settings.error.save": "保存失败",
140
+ "settings.error.saveHost": "保存失败:{message}",
141
+ "settings.error.preview": "预览失败,稍后重试",
142
+ "settings.error.confirm": "确认失败,稍后重试",
143
+ "tail.title": "顾问",
144
+ "tail.severity.nit": "轻微",
145
+ "tail.severity.concern": "关注",
146
+ "tail.severity.blocker": "阻塞",
147
+ "tail.declined": "顾问认为无需建议",
148
+ "tail.empty": "(这条建议没有正文)",
149
+ "tail.anchors": "证据锚点未对上({checked} 条)",
150
+ "tail.downgraded": "严重度已降级",
151
+ "tail.aria": "顾问建议(点击展开或收起)"
152
+ }
153
+ }
package/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "@kangyishuai/dsh-advisor",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Pair the main model with a stronger advisor model it consults at key moments: autonomous second opinion, cost ledger, and model picker",
5
+ "keywords": [
6
+ "dsh",
7
+ "dsh-plugin",
8
+ "deepseek-harness",
9
+ "advisor",
10
+ "second-opinion",
11
+ "consult",
12
+ "review"
13
+ ],
14
+ "license": "MIT",
15
+ "author": "nano (https://github.com/kangyishuai)",
16
+ "homepage": "https://github.com/kangyishuai/dsh-plugins/tree/main/packages/advisor#readme",
17
+ "bugs": "https://github.com/kangyishuai/dsh-plugins/issues",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/kangyishuai/dsh-plugins.git",
21
+ "directory": "packages/advisor"
22
+ },
23
+ "type": "module",
24
+ "main": "lib/index.js",
25
+ "exports": {
26
+ ".": "./lib/index.js",
27
+ "./client": "./lib/client.js",
28
+ "./package.json": "./package.json"
29
+ },
30
+ "files": [
31
+ "cordis.patch.yml",
32
+ "lib",
33
+ "locale",
34
+ "README.md",
35
+ "README.zh-CN.md",
36
+ "LICENSE"
37
+ ],
38
+ "scripts": {
39
+ "test": "node --test"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "dsh": {
45
+ "bundle": {
46
+ "patch": "./cordis.patch.yml"
47
+ },
48
+ "client": {
49
+ "platform": "web",
50
+ "inject": [
51
+ "@deepseek-ai/dsh-client-connection",
52
+ "@deepseek-ai/dsh-client-locale",
53
+ "@deepseek-ai/dsh-client-ui-commands",
54
+ "@deepseek-ai/dsh-client-ui-slots",
55
+ "@deepseek-ai/dsh-client-ui-chat",
56
+ "@deepseek-ai/dsh-client-ui-conversation",
57
+ "@deepseek-ai/dsh-client-ui-session",
58
+ "@deepseek-ai/dsh-client-ui-workspace"
59
+ ]
60
+ }
61
+ }
62
+ }