@shendeguize/dsh-agent-sidecar 0.1.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.
- package/LICENSE +21 -0
- package/README.md +167 -0
- package/cordis.patch.yml +10 -0
- package/lib/client.js +8062 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +396 -0
- package/lib/index.js +4166 -0
- package/package.json +101 -0
- package/src/analysis.ts +782 -0
- package/src/bridge.ts +841 -0
- package/src/client/analysis/AnalysisPanel.tsx +191 -0
- package/src/client/analysis/analysis.module.css +183 -0
- package/src/client/analysis-glue.ts +331 -0
- package/src/client/api.ts +380 -0
- package/src/client/board/Board.tsx +214 -0
- package/src/client/board/board.module.css +302 -0
- package/src/client/board/logic.ts +556 -0
- package/src/client/board/project-view-logic.ts +361 -0
- package/src/client/board/project-view.module.css +307 -0
- package/src/client/board/project-view.tsx +189 -0
- package/src/client/board/strings.ts +112 -0
- package/src/client/commands.ts +484 -0
- package/src/client/controller.ts +360 -0
- package/src/client/css-modules.d.ts +11 -0
- package/src/client/detail/SessionDetail.tsx +270 -0
- package/src/client/detail/detail.module.css +433 -0
- package/src/client/detail/logic.ts +779 -0
- package/src/client/detail/strings.ts +98 -0
- package/src/client/detail/transport.ts +175 -0
- package/src/client/detail-glue.ts +397 -0
- package/src/client/detail-view.module.css +79 -0
- package/src/client/detail-view.tsx +233 -0
- package/src/client/dsh-tools/LineageTree.tsx +210 -0
- package/src/client/dsh-tools/SearchPanel.tsx +169 -0
- package/src/client/dsh-tools/dsh-tools.module.css +374 -0
- package/src/client/dsh-tools/logic.ts +596 -0
- package/src/client/dsh-tools/strings.ts +90 -0
- package/src/client/index.ts +315 -0
- package/src/client/inject/InjectPanel.tsx +482 -0
- package/src/client/inject/inject.module.css +446 -0
- package/src/client/inject/logic.ts +516 -0
- package/src/client/inject/overlay.module.css +22 -0
- package/src/client/inject-glue.ts +171 -0
- package/src/client/locales/command.ts +48 -0
- package/src/client/locales/en.ts +385 -0
- package/src/client/locales/index.ts +123 -0
- package/src/client/locales/zh.ts +402 -0
- package/src/client/m3-transport.ts +151 -0
- package/src/client/mount.tsx +307 -0
- package/src/client/project-glue.ts +134 -0
- package/src/client/search-glue.ts +143 -0
- package/src/client/settings-card.module.css +359 -0
- package/src/client/settings-card.tsx +565 -0
- package/src/client/settings-glue.ts +130 -0
- package/src/client/sidebar-tab.tsx +494 -0
- package/src/client/sse.ts +366 -0
- package/src/client/widget.tsx +80 -0
- package/src/config.ts +193 -0
- package/src/dsh-inject.ts +240 -0
- package/src/fusion.ts +988 -0
- package/src/guard.ts +274 -0
- package/src/index.ts +950 -0
- package/src/inject-gateway.ts +574 -0
- package/src/routes.ts +1133 -0
- package/src/send-cli.ts +340 -0
- package/src/session-store.ts +184 -0
- package/src/skills-provider.ts +293 -0
- package/src/supervisor.ts +463 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module-owned lightweight locale table for the agent-sidecar client half.
|
|
3
|
+
*
|
|
4
|
+
* WHY MODULE-OWNED (source-audit conclusion, T2.3): the installed SDK
|
|
5
|
+
* surface (`@deepseek-ai/dsh-client-runtime` 0.1.1-rc.2 +
|
|
6
|
+
* `@deepseek-ai/dsh-client-ui-slots`) ships only the locale TYPE currency
|
|
7
|
+
* (`LocaleNamespaceMap`, `Translate`, the `locale:` register option and the
|
|
8
|
+
* `t` standard seat) plus the boot-once `slots.installLocale(face)` hook;
|
|
9
|
+
* the `ctx.locale` service itself lives in a separate plugin
|
|
10
|
+
* (`@deepseek-ai/dsh-client-locale`, harness `packages/client/locale`) that
|
|
11
|
+
* is NOT part of this package's dependency set. This table therefore keeps
|
|
12
|
+
* the copy self-contained: default zh, switchable en, with a `t(key)`
|
|
13
|
+
* helper whose lookup chain is active locale → zh → the key itself (fail
|
|
14
|
+
* visible, never blank — same posture as the ecosystem LocaleRuntime,
|
|
15
|
+
* which falls back to en; ours falls back to zh per this plugin's spec).
|
|
16
|
+
*
|
|
17
|
+
* BRIDGE PATH (for the wiring task): each dictionary is a flat
|
|
18
|
+
* `Record<string, string>` — exactly the shape the ecosystem locale
|
|
19
|
+
* service's untyped overload `ctx.locale.register(ns, locale, dict)`
|
|
20
|
+
* accepts — so when the runtime composition provides `ctx.locale`, the
|
|
21
|
+
* wiring half can feed `dictionaries.zh` / `dictionaries.en` straight into
|
|
22
|
+
* it and hand the slot-injected `t` seat to the components instead of the
|
|
23
|
+
* module-local {@link t}. Template params use the same `{name}` syntax as
|
|
24
|
+
* the ecosystem translate.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { zh } from './zh.ts'
|
|
28
|
+
import { en } from './en.ts'
|
|
29
|
+
import type { SidecarLocaleDomain, SidecarLocaleKey } from './zh.ts'
|
|
30
|
+
|
|
31
|
+
export { zh, en }
|
|
32
|
+
export type { SidecarLocaleDomain, SidecarLocaleKey }
|
|
33
|
+
|
|
34
|
+
/** Shipped locales. */
|
|
35
|
+
export type SidecarLocale = 'zh' | 'en'
|
|
36
|
+
|
|
37
|
+
/** Default locale AND the final dictionary consulted before echoing the key. */
|
|
38
|
+
export const BASE_LOCALE: SidecarLocale = 'zh'
|
|
39
|
+
|
|
40
|
+
/** One flat dictionary (the `ctx.locale.register(ns, locale, dict)` currency). */
|
|
41
|
+
export type SidecarDict = Readonly<Record<string, string>>
|
|
42
|
+
|
|
43
|
+
/** Complete shipped dictionaries keyed by locale id. */
|
|
44
|
+
export const dictionaries: Readonly<Record<SidecarLocale, SidecarDict>> = { zh, en }
|
|
45
|
+
|
|
46
|
+
/** Keys of one domain (`settings.` / `inject.` are live; `board.` stays reserved). */
|
|
47
|
+
export type KeysOfDomain<D extends SidecarLocaleDomain> = Extract<
|
|
48
|
+
SidecarLocaleKey,
|
|
49
|
+
`${D}.${string}`
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
/** The settings card's own key union. */
|
|
53
|
+
export type SettingsLocaleKey = KeysOfDomain<'settings'>
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Substitute `{name}` template params; unknown placeholders stay verbatim
|
|
57
|
+
* (same semantics as the ecosystem LocaleRuntime.translate).
|
|
58
|
+
*/
|
|
59
|
+
function interpolate(template: string, params?: Record<string, unknown>): string {
|
|
60
|
+
if (!params) return template
|
|
61
|
+
return template.replace(/\{(\w+)\}/g, (match, name: string) =>
|
|
62
|
+
name in params ? String(params[name]) : match)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Build a translate engine over an arbitrary (possibly partial) dictionary
|
|
67
|
+
* set. Lookup chain per key: requested locale → {@link BASE_LOCALE} (zh) →
|
|
68
|
+
* the key itself. Exposed for tests and for compositions that need a
|
|
69
|
+
* non-shipped dictionary set; the shipped {@link t} is this engine bound to
|
|
70
|
+
* {@link dictionaries} and the module's active locale.
|
|
71
|
+
* @param dicts - dictionaries keyed by locale id (missing locales allowed).
|
|
72
|
+
* @returns pure translate function addressed by explicit locale.
|
|
73
|
+
*/
|
|
74
|
+
export function createTranslator(
|
|
75
|
+
dicts: Partial<Record<SidecarLocale, SidecarDict>>,
|
|
76
|
+
): (locale: SidecarLocale, key: string, params?: Record<string, unknown>) => string {
|
|
77
|
+
return (locale, key, params) => {
|
|
78
|
+
const template = dicts[locale]?.[key] ?? dicts[BASE_LOCALE]?.[key] ?? key
|
|
79
|
+
return interpolate(template, params)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const shippedTranslate = createTranslator(dictionaries)
|
|
84
|
+
|
|
85
|
+
let activeLocale: SidecarLocale = BASE_LOCALE
|
|
86
|
+
const localeListeners = new Set<() => void>()
|
|
87
|
+
|
|
88
|
+
/** @returns the active locale id. */
|
|
89
|
+
export function getLocale(): SidecarLocale {
|
|
90
|
+
return activeLocale
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Switch the active locale and notify subscribers (no-op when unchanged).
|
|
95
|
+
* @param locale - a shipped locale id.
|
|
96
|
+
*/
|
|
97
|
+
export function setLocale(locale: SidecarLocale): void {
|
|
98
|
+
if (activeLocale === locale) return
|
|
99
|
+
activeLocale = locale
|
|
100
|
+
for (const fn of [...localeListeners]) fn()
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Observe active-locale switches (React consumers pair this with
|
|
105
|
+
* {@link getLocale} as a uSES source).
|
|
106
|
+
* @param fn - change callback.
|
|
107
|
+
* @returns unsubscribe.
|
|
108
|
+
*/
|
|
109
|
+
export function subscribeLocale(fn: () => void): () => void {
|
|
110
|
+
localeListeners.add(fn)
|
|
111
|
+
return () => { localeListeners.delete(fn) }
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Translate a typed key in the active locale. Missing entries fall back to
|
|
116
|
+
* zh, then to the key itself (see module doc for why the chain ends visible).
|
|
117
|
+
* @param key - a key of the shipped table.
|
|
118
|
+
* @param params - optional `{name}` template params.
|
|
119
|
+
* @returns the translated string.
|
|
120
|
+
*/
|
|
121
|
+
export function t(key: SidecarLocaleKey, params?: Record<string, unknown>): string {
|
|
122
|
+
return shippedTranslate(activeLocale, key, params)
|
|
123
|
+
}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simplified-Chinese dictionary — the key-set source of truth for the
|
|
3
|
+
* agent-sidecar client locale table (the en dictionary is checked complete
|
|
4
|
+
* against this key union; see ./en.ts).
|
|
5
|
+
*
|
|
6
|
+
* Key-space convention (compile-enforced by the `satisfies` clause): every
|
|
7
|
+
* key is `<domain>.<leaf>` where the domain is one of
|
|
8
|
+
* {@link SidecarLocaleDomain}. `settings.*` is owned by the settings card
|
|
9
|
+
* (T2.3); `inject.*` by the inject panel (T4.5, src/client/inject/);
|
|
10
|
+
* `board.*` by the board-tab chrome (view switcher); `detail.*` /
|
|
11
|
+
* `dshtools.*` / `project.*` mirror the M3 module tables (see below);
|
|
12
|
+
* `analysis.*` is owned by the analysis panel (T5.10b); `command.*` by the
|
|
13
|
+
* `/sidecar` slash command (T4.6, re-exported via ./command.ts);
|
|
14
|
+
* `sidebar.*` by the optional better-sidebar mini tab (T6.3,
|
|
15
|
+
* src/client/sidebar-tab.tsx) — keeping the prefixes in one flat namespace
|
|
16
|
+
* avoids cross-task collisions.
|
|
17
|
+
*
|
|
18
|
+
* M3 unification (T5.10b): the component-local tables `detail/strings.ts`,
|
|
19
|
+
* `dsh-tools/strings.ts` and `PROJECT_VIEW_STRINGS` stay the rendering
|
|
20
|
+
* source for their components (decoupling kept), and this table REFERENCES
|
|
21
|
+
* them entry-by-entry so `t()` covers every M3 string with zero copy drift
|
|
22
|
+
* (parity is pinned by test/locales.test.ts). en translations for those
|
|
23
|
+
* domains live in ./en.ts (the module tables are zh-only).
|
|
24
|
+
*
|
|
25
|
+
* Copy sources: the schemastery `.description()` strings in src/config.ts
|
|
26
|
+
* (the authoritative zh copy for each field) and design doc §4.a/§5.3/§6/§8.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { DETAIL_STRINGS } from '../detail/strings.ts'
|
|
30
|
+
import { DSH_TOOLS_STRINGS } from '../dsh-tools/strings.ts'
|
|
31
|
+
import { PROJECT_VIEW_STRINGS } from '../board/project-view-logic.ts'
|
|
32
|
+
|
|
33
|
+
/** Locale key domains (one owner surface per domain, see module doc). */
|
|
34
|
+
export type SidecarLocaleDomain =
|
|
35
|
+
| 'settings'
|
|
36
|
+
| 'board'
|
|
37
|
+
| 'inject'
|
|
38
|
+
| 'detail'
|
|
39
|
+
| 'dshtools'
|
|
40
|
+
| 'project'
|
|
41
|
+
| 'analysis'
|
|
42
|
+
| 'command'
|
|
43
|
+
| 'sidebar'
|
|
44
|
+
|
|
45
|
+
const D = DETAIL_STRINGS
|
|
46
|
+
const Q = DSH_TOOLS_STRINGS
|
|
47
|
+
const P = PROJECT_VIEW_STRINGS
|
|
48
|
+
|
|
49
|
+
export const zh = {
|
|
50
|
+
// ── card chrome ────────────────────────────────────────────────────────
|
|
51
|
+
'settings.cardTitle': 'Agent Sidecar',
|
|
52
|
+
'settings.cardDescription': '跨 agent 会话监控、注入与旁路分析的运行设置。',
|
|
53
|
+
'settings.docsLink': '查看文档',
|
|
54
|
+
'settings.readOnly': '当前设置文档为只读,修改不可保存。',
|
|
55
|
+
'settings.unsaved': '未保存',
|
|
56
|
+
'settings.save': '保存',
|
|
57
|
+
'settings.saving': '保存中…',
|
|
58
|
+
'settings.discard': '放弃修改',
|
|
59
|
+
'settings.saveFailed': '保存失败,请重试。',
|
|
60
|
+
'settings.expand': '展开',
|
|
61
|
+
'settings.collapse': '收起',
|
|
62
|
+
'settings.invalidNumber': '请输入不小于 {min} 的整数',
|
|
63
|
+
|
|
64
|
+
// ── daemon lifecycle ───────────────────────────────────────────────────
|
|
65
|
+
'settings.sectionDaemon': 'daemon 生命周期',
|
|
66
|
+
'settings.daemonPolicyLabel': '托管策略',
|
|
67
|
+
'settings.daemonPolicyHint':
|
|
68
|
+
'adopt-or-host=探测并领养既有 daemon,否则自行拉起;adopt-only=只领养绝不拉起;off=不管理生命周期(仍只读对账既有 daemon 的数据)。',
|
|
69
|
+
'settings.daemonPolicyAdoptOrHost': 'adopt-or-host(领养或拉起)',
|
|
70
|
+
'settings.daemonPolicyAdoptOnly': 'adopt-only(只领养)',
|
|
71
|
+
'settings.daemonPolicyOff': 'off(不管理)',
|
|
72
|
+
'settings.daemonBackoffLimitLabel': '熔断阈值',
|
|
73
|
+
'settings.daemonBackoffLimitHint': '连续托管失败达到该次数后停止重启并进入 failed。',
|
|
74
|
+
'settings.daemonStatusLabel': 'daemon 状态',
|
|
75
|
+
'settings.daemonStateProbe': '探测中',
|
|
76
|
+
'settings.daemonStateAdopted': '已领养既有 daemon',
|
|
77
|
+
'settings.daemonStateDefer': '等待系统服务拉活',
|
|
78
|
+
'settings.daemonStateReprobe': '重新探测中',
|
|
79
|
+
'settings.daemonStateHosting': '正在拉起',
|
|
80
|
+
'settings.daemonStateHosted': '插件托管中',
|
|
81
|
+
'settings.daemonStateBackoff': '退避重试中',
|
|
82
|
+
'settings.daemonStateFailed': '已熔断',
|
|
83
|
+
'settings.daemonPidVersion': 'pid {pid} · v{version}',
|
|
84
|
+
'settings.daemonDeferNote':
|
|
85
|
+
'daemon 由系统服务(LaunchAgent)托管;插件只探测等待,不重复拉起,也不会终止它。',
|
|
86
|
+
'settings.daemonFailedNote':
|
|
87
|
+
'连续托管失败已达熔断阈值;看板降级为最后快照。排查 sidecar 命令后可点击重试。',
|
|
88
|
+
'settings.daemonRetry': '重试',
|
|
89
|
+
|
|
90
|
+
// ── sidecar invocation ─────────────────────────────────────────────────
|
|
91
|
+
'settings.sectionSidecar': 'sidecar 调用',
|
|
92
|
+
'settings.sidecarCommandLabel': '可执行命令',
|
|
93
|
+
'settings.sidecarCommandHint':
|
|
94
|
+
'PATH 名、绝对路径或空格分隔的多段命令(如 python3 /path/agent-sidecar.pyz);插件绝不代装 sidecar。',
|
|
95
|
+
'settings.sidecarRuntimeDirLabel': '运行时目录',
|
|
96
|
+
'settings.sidecarRuntimeDirHint':
|
|
97
|
+
'留空使用默认 ~/.agent_sidecar(尊重 AGENT_SIDECAR_RUNTIME_DIR 环境变量);非空时经环境变量传给受托管的 daemon。',
|
|
98
|
+
|
|
99
|
+
// ── stream reconciliation ──────────────────────────────────────────────
|
|
100
|
+
'settings.sectionStream': '数据流对账',
|
|
101
|
+
'settings.streamActiveMsLabel': '活跃对账周期(毫秒)',
|
|
102
|
+
'settings.streamActiveMsHint': '有会话工作中时的 status 快照周期。',
|
|
103
|
+
'settings.streamIdleMsLabel': '空闲对账周期(毫秒)',
|
|
104
|
+
'settings.streamIdleMsHint': '无会话工作时的 status 快照周期。',
|
|
105
|
+
|
|
106
|
+
// ── injection ──────────────────────────────────────────────────────────
|
|
107
|
+
'settings.sectionInject': '消息注入',
|
|
108
|
+
'settings.injectEnabledLabel': '启用注入',
|
|
109
|
+
'settings.injectEnabledHint':
|
|
110
|
+
'关闭时看板隐藏全部注入入口,写接口在服务端同步拒绝。',
|
|
111
|
+
'settings.injectDefaultModeLabel': '默认注入模式',
|
|
112
|
+
'settings.injectDefaultModeHint': '注入面板打开时预选的模式。',
|
|
113
|
+
'settings.injectModeQueue': 'queue(排队下一轮)',
|
|
114
|
+
'settings.injectModeSteer': 'steer(中途注入)',
|
|
115
|
+
'settings.injectSafetyNote':
|
|
116
|
+
'安全须知:注入默认关闭;开启后每次注入仍须经确认对话框逐次放行,无任何批量或定时注入。多用户主机不建议开启。',
|
|
117
|
+
|
|
118
|
+
// ── bypass analysis ────────────────────────────────────────────────────
|
|
119
|
+
'settings.sectionAnalysis': '旁路分析',
|
|
120
|
+
'settings.analysisEnabledLabel': '启用 AI 旁路分析',
|
|
121
|
+
'settings.analysisEnabledHint':
|
|
122
|
+
'按需拉起 dsh 分析会话解读被观测会话(消耗模型 token,默认关闭)。',
|
|
123
|
+
|
|
124
|
+
// ── board UI ───────────────────────────────────────────────────────────
|
|
125
|
+
'settings.sectionUi': '看板界面',
|
|
126
|
+
'settings.uiTimeWindowHoursLabel': '会话时间窗(小时)',
|
|
127
|
+
'settings.uiTimeWindowHoursHint': '看板只显示该时间窗内活动过的会话。',
|
|
128
|
+
'settings.uiShowDeadLabel': '显示 dead 会话',
|
|
129
|
+
'settings.uiShowDeadHint': '把已结束(dead)的会话也列入看板。',
|
|
130
|
+
|
|
131
|
+
// ── skill mode ─────────────────────────────────────────────────────────
|
|
132
|
+
'settings.sectionSkill': 'skill 模式',
|
|
133
|
+
'settings.skillProvideLabel': '内嵌提供 skill',
|
|
134
|
+
'settings.skillProvideHint':
|
|
135
|
+
'经 registerProvider 向 dsh 提供 agent-sidecar skill(M4 启用;重启后生效)。',
|
|
136
|
+
|
|
137
|
+
// ── inject panel: chrome & editor (T4.5, design §5.1 view 3) ───────────
|
|
138
|
+
'inject.title': '注入消息',
|
|
139
|
+
'inject.confirmTitle': '确认注入',
|
|
140
|
+
'inject.close': '关闭',
|
|
141
|
+
'inject.done': '完成',
|
|
142
|
+
'inject.capabilityOff': '注入功能未开启;请在设置中开启注入。',
|
|
143
|
+
'inject.noTarget': '未选择注入目标;请从看板卡片或会话详情发起注入。',
|
|
144
|
+
'inject.targetLabel': '注入目标',
|
|
145
|
+
'inject.messageLabel': '消息内容',
|
|
146
|
+
'inject.messagePlaceholder': '输入要注入的消息(上限 16 KiB;请勿粘贴密钥等敏感内容)',
|
|
147
|
+
'inject.byteCount': '{bytes} / {limit} 字节',
|
|
148
|
+
'inject.msgEmpty': '消息不能为空。',
|
|
149
|
+
'inject.msgNul': '消息包含非法 NUL 字符。',
|
|
150
|
+
'inject.msgTooLarge': '消息 {bytes} 字节,超出 {limit} 字节上限。',
|
|
151
|
+
'inject.modeLabel': '注入模式',
|
|
152
|
+
'inject.modeQueue': 'queue(排队下一轮)',
|
|
153
|
+
'inject.modeQueueHint': '消息排队等待,目标会话下一轮开始时处理。',
|
|
154
|
+
'inject.modeSteer': 'steer(中途注入)',
|
|
155
|
+
'inject.modeSteerHint': '消息在目标会话当前轮次中途注入,立即介入其工作。',
|
|
156
|
+
'inject.argvWarning':
|
|
157
|
+
'目标为 cursor-cli:注入经其原生子进程执行,消息在该进程存续期间对本机进程列表可见;请勿包含密钥等敏感内容。',
|
|
158
|
+
'inject.auditNote':
|
|
159
|
+
'本次注入会被记入 sidecar 审计日志(含字节数与内容指纹,不含消息明文)。',
|
|
160
|
+
'inject.prepare': '准备注入',
|
|
161
|
+
'inject.preparing': '校验中…',
|
|
162
|
+
|
|
163
|
+
// ── inject panel: confirm phase ──────────────────────────────────────
|
|
164
|
+
'inject.planTargetLabel': '目标现状',
|
|
165
|
+
'inject.planStatus': '当前状态:{status}',
|
|
166
|
+
'inject.statusObservedNote': '状态为从持久化数据推断的观察值,可能滞后。',
|
|
167
|
+
'inject.planModeLabel': '模式',
|
|
168
|
+
'inject.planPreviewLabel': '消息摘要({bytes} 字节)',
|
|
169
|
+
'inject.countdown': '确认令牌 {seconds} 秒后过期',
|
|
170
|
+
'inject.confirmExecute': '确认注入',
|
|
171
|
+
'inject.executing': '注入中…',
|
|
172
|
+
'inject.cancel': '取消',
|
|
173
|
+
'inject.tokenExpired': '确认已超时,令牌失效;请重新准备注入。',
|
|
174
|
+
|
|
175
|
+
// ── inject panel: result phase ───────────────────────────────────────
|
|
176
|
+
'inject.resultDelivered': '已投递:消息已注入目标会话。',
|
|
177
|
+
'inject.resultFailed': '注入失败。',
|
|
178
|
+
'inject.resultUnknown':
|
|
179
|
+
'结果未知:消息可能已投递。请勿重试;请前往目标会话核对后再决定下一步。',
|
|
180
|
+
'inject.resultReplayed': '幂等重放:返回的是此前同一请求的结果,未发生二次注入。',
|
|
181
|
+
'inject.reprepare': '重新准备',
|
|
182
|
+
|
|
183
|
+
// ── inject panel: error vocabulary (gateway + transport) ─────────────
|
|
184
|
+
'inject.errInjectDisabled': '注入功能已在服务端关闭;请在设置中开启注入。',
|
|
185
|
+
'inject.errInvalidMessage': '消息未通过服务端校验。',
|
|
186
|
+
'inject.errTargetNotFound': '目标会话不存在或已离开观测范围。',
|
|
187
|
+
'inject.errTargetDead': '目标会话已结束(dead),无法注入。',
|
|
188
|
+
'inject.errTooManyPending': '待确认的注入请求过多,请稍后再试。',
|
|
189
|
+
'inject.errTokenMissing': '确认令牌缺失或未被签发;请重新准备。',
|
|
190
|
+
'inject.errTokenExpired': '确认令牌已过期;请重新准备。',
|
|
191
|
+
'inject.errTokenReused': '确认令牌已被消费;请重新准备。',
|
|
192
|
+
'inject.errTokenMismatch': '确认内容与准备时不一致;请重新准备。',
|
|
193
|
+
'inject.errUnsupportedAgent': '该 agent 没有可用的注入通道。',
|
|
194
|
+
'inject.errExecutorError': '注入通路执行出错。',
|
|
195
|
+
'inject.errTimeout': '请求超时,未收到服务端回执。',
|
|
196
|
+
'inject.errAborted': '请求已取消。',
|
|
197
|
+
'inject.errNetwork': '网络错误,请求未能送达。',
|
|
198
|
+
'inject.errParse': '服务端响应无法解析。',
|
|
199
|
+
'inject.errGeneric': '请求失败({code})。',
|
|
200
|
+
|
|
201
|
+
// ── board tab chrome: main-view switcher (T5.10b, design §5.1) ─────────
|
|
202
|
+
'board.viewBoard': '会话看板',
|
|
203
|
+
'board.viewProjects': '项目视图',
|
|
204
|
+
|
|
205
|
+
// ── session detail (T5.3 detail/strings.ts, referenced verbatim) ───────
|
|
206
|
+
'detail.header.close': D.header.close,
|
|
207
|
+
'detail.header.listenOn': D.header.listenOn,
|
|
208
|
+
'detail.header.listenOff': D.header.listenOff,
|
|
209
|
+
'detail.header.listenHint': D.header.listenHint,
|
|
210
|
+
'detail.header.untitled': D.header.untitled,
|
|
211
|
+
'detail.header.unknownProject': D.header.unknownProject,
|
|
212
|
+
'detail.header.observedDisclaimer': D.header.observedDisclaimer,
|
|
213
|
+
'detail.status.working': D.status.working,
|
|
214
|
+
'detail.status.waiting': D.status.waiting,
|
|
215
|
+
'detail.status.idle': D.status.idle,
|
|
216
|
+
'detail.status.dead': D.status.dead,
|
|
217
|
+
'detail.status.unknown': D.status.unknown,
|
|
218
|
+
'detail.sources.title': D.sources.title,
|
|
219
|
+
'detail.sources.dshLive': D.sources.dshLive,
|
|
220
|
+
'detail.sources.dshCold': D.sources.dshCold,
|
|
221
|
+
'detail.sources.sidecarReplay': D.sources.sidecarReplay,
|
|
222
|
+
'detail.sources.sidecarBuffer': D.sources.sidecarBuffer,
|
|
223
|
+
'detail.sources.none': D.sources.none,
|
|
224
|
+
'detail.kind.user': D.kind.user,
|
|
225
|
+
'detail.kind.assistant': D.kind.assistant,
|
|
226
|
+
'detail.kind.thinking': D.kind.thinking,
|
|
227
|
+
'detail.kind.toolCall': D.kind.toolCall,
|
|
228
|
+
'detail.kind.toolResult': D.kind.toolResult,
|
|
229
|
+
'detail.kind.turn': D.kind.turn,
|
|
230
|
+
'detail.kind.step': D.kind.step,
|
|
231
|
+
'detail.kind.error': D.kind.error,
|
|
232
|
+
'detail.kind.other': D.kind.other,
|
|
233
|
+
'detail.gap.label': D.gap.label,
|
|
234
|
+
'detail.timeline.loadMore': D.timeline.loadMore,
|
|
235
|
+
'detail.timeline.loadingMore': D.timeline.loadingMore,
|
|
236
|
+
'detail.timeline.noMore': D.timeline.noMore,
|
|
237
|
+
'detail.timeline.expand': D.timeline.expand,
|
|
238
|
+
'detail.timeline.collapse': D.timeline.collapse,
|
|
239
|
+
'detail.timeline.newBadge': D.timeline.newBadge,
|
|
240
|
+
'detail.timeline.seq': D.timeline.seq,
|
|
241
|
+
'detail.timeline.hiddenNotice': D.timeline.hiddenNotice,
|
|
242
|
+
'detail.timeline.showAll': D.timeline.showAll,
|
|
243
|
+
'detail.states.loadingTitle': D.states.loadingTitle,
|
|
244
|
+
'detail.states.emptyTitle': D.states.emptyTitle,
|
|
245
|
+
'detail.states.emptyHint': D.states.emptyHint,
|
|
246
|
+
'detail.states.errorTitle': D.states.errorTitle,
|
|
247
|
+
'detail.states.errorFallback': D.states.errorFallback,
|
|
248
|
+
'detail.states.errors.session_not_found': D.states.errors.session_not_found,
|
|
249
|
+
'detail.states.errors.invalid_cursor': D.states.errors.invalid_cursor,
|
|
250
|
+
'detail.states.errors.fusion_not_wired': D.states.errors.fusion_not_wired,
|
|
251
|
+
'detail.states.errors.network_error': D.states.errors.network_error,
|
|
252
|
+
'detail.states.errors.request_timeout': D.states.errors.request_timeout,
|
|
253
|
+
'detail.time.justNow': D.time.justNow,
|
|
254
|
+
'detail.time.minutesAgo': D.time.minutesAgo,
|
|
255
|
+
'detail.time.hoursAgo': D.time.hoursAgo,
|
|
256
|
+
'detail.time.daysAgo': D.time.daysAgo,
|
|
257
|
+
|
|
258
|
+
// ── session detail: integration chrome (T5.10b literals) ───────────────
|
|
259
|
+
'detail.actions.inject': '注入',
|
|
260
|
+
'detail.actions.analyze': 'AI 分析',
|
|
261
|
+
'detail.actions.analyzeDisabledHint': '在设置中开启「启用 AI 旁路分析」后可用',
|
|
262
|
+
|
|
263
|
+
// ── dsh deep-query tools (T5.4 dsh-tools/strings.ts, referenced) ───────
|
|
264
|
+
'dshtools.lineage.title': Q.lineage.title,
|
|
265
|
+
'dshtools.lineage.loading': Q.lineage.loading,
|
|
266
|
+
'dshtools.lineage.error': Q.lineage.error,
|
|
267
|
+
'dshtools.lineage.empty': Q.lineage.empty,
|
|
268
|
+
'dshtools.lineage.currentBadge': Q.lineage.currentBadge,
|
|
269
|
+
'dshtools.lineage.liveBadge': Q.lineage.liveBadge,
|
|
270
|
+
'dshtools.lineage.notPersistedBadge': Q.lineage.notPersistedBadge,
|
|
271
|
+
'dshtools.lineage.role.ancestor': Q.lineage.role.ancestor,
|
|
272
|
+
'dshtools.lineage.role.target': Q.lineage.role.target,
|
|
273
|
+
'dshtools.lineage.role.descendant': Q.lineage.role.descendant,
|
|
274
|
+
'dshtools.lineage.jumpTitle': Q.lineage.jumpTitle,
|
|
275
|
+
'dshtools.lineage.currentTitle': Q.lineage.currentTitle,
|
|
276
|
+
'dshtools.lineage.expand': Q.lineage.expand,
|
|
277
|
+
'dshtools.lineage.collapse': Q.lineage.collapse,
|
|
278
|
+
'dshtools.lineage.nodeCount': Q.lineage.nodeCount,
|
|
279
|
+
'dshtools.lineage.incompleteWithId': Q.lineage.incompleteWithId,
|
|
280
|
+
'dshtools.lineage.incomplete': Q.lineage.incomplete,
|
|
281
|
+
'dshtools.lineage.degrade.notDshTitle': Q.lineage.degrade.notDshTitle,
|
|
282
|
+
'dshtools.lineage.degrade.notDshBody': Q.lineage.degrade.notDshBody,
|
|
283
|
+
'dshtools.lineage.degrade.queryUnavailableTitle': Q.lineage.degrade.queryUnavailableTitle,
|
|
284
|
+
'dshtools.lineage.degrade.queryUnavailableBody': Q.lineage.degrade.queryUnavailableBody,
|
|
285
|
+
'dshtools.lineage.degrade.traceFailedTitle': Q.lineage.degrade.traceFailedTitle,
|
|
286
|
+
'dshtools.lineage.degrade.traceFailedBody': Q.lineage.degrade.traceFailedBody,
|
|
287
|
+
'dshtools.lineage.degrade.unknownTitle': Q.lineage.degrade.unknownTitle,
|
|
288
|
+
'dshtools.lineage.degrade.unknownBody': Q.lineage.degrade.unknownBody,
|
|
289
|
+
'dshtools.search.title': Q.search.title,
|
|
290
|
+
'dshtools.search.placeholder': Q.search.placeholder,
|
|
291
|
+
'dshtools.search.submit': Q.search.submit,
|
|
292
|
+
'dshtools.search.loading': Q.search.loading,
|
|
293
|
+
'dshtools.search.error': Q.search.error,
|
|
294
|
+
'dshtools.search.empty': Q.search.empty,
|
|
295
|
+
'dshtools.search.filterOnlyNotice': Q.search.filterOnlyNotice,
|
|
296
|
+
'dshtools.search.projectFilter': Q.search.projectFilter,
|
|
297
|
+
'dshtools.search.matchedBy.full-text': Q.search.matchedBy['full-text'],
|
|
298
|
+
'dshtools.search.matchedBy.title': Q.search.matchedBy.title,
|
|
299
|
+
'dshtools.search.matchedBy.project': Q.search.matchedBy.project,
|
|
300
|
+
'dshtools.search.matchedBy.other': Q.search.matchedBy.other,
|
|
301
|
+
'dshtools.search.untitled': Q.search.untitled,
|
|
302
|
+
|
|
303
|
+
// ── project correlation view (T5.5 PROJECT_VIEW_STRINGS, referenced) ───
|
|
304
|
+
'project.title': P.title,
|
|
305
|
+
'project.summary': P.summary,
|
|
306
|
+
'project.crossAgent': P.crossAgent,
|
|
307
|
+
'project.sessionCount': P.sessionCount,
|
|
308
|
+
'project.lastActive': P.lastActive,
|
|
309
|
+
'project.liveChip': P.liveChip,
|
|
310
|
+
'project.untitled': P.untitled,
|
|
311
|
+
'project.empty.title': P.empty.title,
|
|
312
|
+
'project.empty.hint': P.empty.hint,
|
|
313
|
+
'project.loading': P.loading,
|
|
314
|
+
'project.errorTitle': P.errorTitle,
|
|
315
|
+
|
|
316
|
+
// ── AI bypass analysis panel (T5.10b, design §4.e.3 / §5.1) ────────────
|
|
317
|
+
'analysis.title': 'AI 分析',
|
|
318
|
+
'analysis.close': '关闭',
|
|
319
|
+
'analysis.disabledNote': 'AI 旁路分析未开启;请在设置中开启「启用 AI 旁路分析」。',
|
|
320
|
+
'analysis.idleHint':
|
|
321
|
+
'按需拉起一次 dsh 旁路分析,解读该会话的当前状态与走向(消耗模型 token)。',
|
|
322
|
+
'analysis.start': '开始分析',
|
|
323
|
+
'analysis.requesting': '分析中…(最长约 60 秒)',
|
|
324
|
+
'analysis.exchangeInitial': '分析摘要',
|
|
325
|
+
'analysis.followupLabel': '追问',
|
|
326
|
+
'analysis.truncatedNotice': '输入超出预算已截断,分析基于部分上下文。',
|
|
327
|
+
'analysis.emptySummary': '(分析会话未返回摘要)',
|
|
328
|
+
'analysis.disclaimerFallback': 'AI 分析仅供参考,结论以实际会话为准。',
|
|
329
|
+
'analysis.followupPlaceholder': '继续追问这次分析…',
|
|
330
|
+
'analysis.followupSubmit': '追问',
|
|
331
|
+
'analysis.answering': '回答中…',
|
|
332
|
+
'analysis.stop': '停止分析',
|
|
333
|
+
'analysis.stopped': '分析已停止,分析会话已释放。',
|
|
334
|
+
'analysis.restart': '重新分析',
|
|
335
|
+
'analysis.noticeTimeout': '本次追问超时,可稍后重试;分析会话仍保留。',
|
|
336
|
+
'analysis.noticeNetwork': '请求未能送达,可重试;分析会话仍保留。',
|
|
337
|
+
'analysis.noticeCancelFailed': '停止请求未送达,请重试。',
|
|
338
|
+
'analysis.errDisabled': 'AI 分析已在服务端关闭;请在设置中开启后重试。',
|
|
339
|
+
'analysis.errUnavailable': '当前 host 未接入 AI 分析能力(agents 服务不可用)。',
|
|
340
|
+
'analysis.errTargetNotFound': '分析目标不存在或已离开观测范围。',
|
|
341
|
+
'analysis.errTooManyActive': '并发分析会话已达上限,请稍后再试。',
|
|
342
|
+
'analysis.errTimeout': '分析超时,分析会话已释放;可重新发起。',
|
|
343
|
+
'analysis.errCreateFailed': '分析会话创建失败。',
|
|
344
|
+
'analysis.errCancelled': '分析已取消。',
|
|
345
|
+
'analysis.errNetwork': '网络错误,分析请求未能完成。',
|
|
346
|
+
'analysis.errGeneric': '分析失败({code})。',
|
|
347
|
+
|
|
348
|
+
// ── /sidecar slash command (T4.6, folded from locales/command.ts) ──────
|
|
349
|
+
'command.description': '查看 Sidecar 状态速览(daemon、连接与会话)',
|
|
350
|
+
'command.daemon.probe': '探测中',
|
|
351
|
+
'command.daemon.adopted': '已连接 · 领养',
|
|
352
|
+
'command.daemon.defer': '等待系统服务',
|
|
353
|
+
'command.daemon.reprobe': '重新探测中',
|
|
354
|
+
'command.daemon.hosting': '正在启动',
|
|
355
|
+
'command.daemon.hosted': '已连接 · 托管',
|
|
356
|
+
'command.daemon.backoff': '重启退避中',
|
|
357
|
+
'command.daemon.failed': '离线',
|
|
358
|
+
'command.daemon.unknown': '状态未知',
|
|
359
|
+
'command.connection.ok': '已连接',
|
|
360
|
+
'command.connection.degraded': '连接不稳定',
|
|
361
|
+
'command.connection.off': '离线',
|
|
362
|
+
'command.status.working': '工作中',
|
|
363
|
+
'command.status.waiting': '等待中',
|
|
364
|
+
'command.status.idle': '空闲',
|
|
365
|
+
'command.status.dead': '已结束',
|
|
366
|
+
'command.status.unknown': '未知',
|
|
367
|
+
'command.daemonRow': 'Sidecar · {state}',
|
|
368
|
+
'command.countsRow': '{working} 个工作中 · {waiting} 个等待中',
|
|
369
|
+
'command.countsDetail': '共 {total} 个会话',
|
|
370
|
+
'command.sessionDetail': '{project} · {status} · {time}',
|
|
371
|
+
'command.noSessions': '暂无被观测的会话',
|
|
372
|
+
'command.unknownProject': '未知项目',
|
|
373
|
+
'command.untitled': '(无标题)',
|
|
374
|
+
'command.truncated': '还有 {n} 个活跃会话未列出',
|
|
375
|
+
'command.boardHint': '打开会话视图的「Sidecar」Tab 查看完整看板',
|
|
376
|
+
'command.unreachable': 'sidecar 未连接',
|
|
377
|
+
'command.unreachableHint':
|
|
378
|
+
'无法获取状态快照;请确认 agent-sidecar 插件已启用、daemon 可用后重试。',
|
|
379
|
+
'command.offlineFailed': 'sidecar 已离线(daemon 连续启动失败已熔断)',
|
|
380
|
+
'command.offlineFailedHint':
|
|
381
|
+
'以下为最后一次快照。可在设置卡重试,或手动运行 agent-sidecar daemon start 后等待自动领养。',
|
|
382
|
+
'command.offlineDefer': '等待系统服务拉起 daemon',
|
|
383
|
+
'command.offlineDeferHint':
|
|
384
|
+
'检测到 LaunchAgent 托管,插件只探测等待;服务拉起后速览会自动恢复。',
|
|
385
|
+
'command.time.justNow': '刚刚',
|
|
386
|
+
'command.time.minutesAgo': '{n} 分钟前',
|
|
387
|
+
'command.time.hoursAgo': '{n} 小时前',
|
|
388
|
+
'command.time.daysAgo': '{n} 天前',
|
|
389
|
+
|
|
390
|
+
// ── better-sidebar mini tab (T6.3, design §5.2 optional soft dep) ──────
|
|
391
|
+
'sidebar.tabTitle': 'Sidecar',
|
|
392
|
+
'sidebar.countsRow': '{working} 工作中 · {waiting} 等待中',
|
|
393
|
+
'sidebar.recentTitle': '最近活跃',
|
|
394
|
+
'sidebar.connecting': '等待 sidecar 快照…',
|
|
395
|
+
'sidebar.noSessions': '暂无活跃会话',
|
|
396
|
+
'sidebar.noEvent': '暂无事件记录',
|
|
397
|
+
'sidebar.untitled': '(无标题)',
|
|
398
|
+
'sidebar.boardHint': '完整看板见会话视图的「Sidecar」Tab',
|
|
399
|
+
} satisfies Record<`${SidecarLocaleDomain}.${string}`, string>
|
|
400
|
+
|
|
401
|
+
/** Key union of the locale table (zh is the source of truth). */
|
|
402
|
+
export type SidecarLocaleKey = keyof typeof zh
|