dsh-agent-control-center 0.2.0 → 0.3.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/src/client/app.js CHANGED
@@ -121,6 +121,19 @@ body, .acc-root {
121
121
  scrollbar-gutter: stable;
122
122
  padding: 2px 4px 2px 0;
123
123
  }
124
+ /* Section label above each rail group: 11px uppercase micro-heading. The rail
125
+ * is 176px, so a long English label truncates instead of wrapping; the full
126
+ * text stays in the DOM (accessible name) and in the title attribute. */
127
+ .acc-nav-group {
128
+ padding: 8px 8px 2px;
129
+ color: var(--acc-fg-faint);
130
+ font: 600 11px/16px var(--acc-font);
131
+ letter-spacing: .08em;
132
+ text-transform: uppercase;
133
+ white-space: nowrap;
134
+ overflow: hidden;
135
+ text-overflow: ellipsis;
136
+ }
124
137
  .acc-nav-item {
125
138
  position: relative;
126
139
  display: flex;
@@ -181,6 +194,17 @@ body, .acc-root {
181
194
  .acc-nav-horizontal .acc-nav-icon { width: 14px; height: 14px; }
182
195
  .acc-nav-horizontal .acc-nav-label { flex: 0 1 auto; }
183
196
  .acc-nav-horizontal .acc-nav-state { position: static; margin-inline-start: 2px; max-width: 72px; }
197
+ /* A hairline marks the group boundary in the wrapped bar; the rail uses its
198
+ * label and the narrow select its optgroup, so this appears mid-only. */
199
+ .acc-nav-sep {
200
+ flex: none;
201
+ align-self: center;
202
+ width: 2px;
203
+ height: 8px;
204
+ margin: 0 4px;
205
+ border-radius: 1px;
206
+ background: var(--acc-border);
207
+ }
184
208
 
185
209
  /* ---- navigation: dropdown (narrow) ------------------------------------- */
186
210
  .acc-narrowbar { position: relative; display: flex; align-items: center; min-width: 0; }
@@ -540,6 +564,19 @@ const ACC_LAYOUT_RAIL_MIN = 640
540
564
  /** Below this the navigation becomes a dropdown. */
541
565
  const ACC_LAYOUT_BAR_MIN = 460
542
566
 
567
+ /**
568
+ * Fixed navigation group order, shared by the rail, the wrapped bar and the
569
+ * narrow select. The landing page (Overview) lives in `insight`, so that group
570
+ * leads and the active tab sits at the start of every surface.
571
+ */
572
+ const ACC_NAV_GROUPS = ['insight', 'edit', 'maintain']
573
+ /**
574
+ * Fallback split for pages that register no `group`: ≤20 edit, ≤60 insight,
575
+ * everything later maintain. Explicit `group` always wins, so pages stay
576
+ * correctly placed when their order changes to fit a different section.
577
+ */
578
+ const ACC_NAV_INSIGHT_MAX_ORDER = 60
579
+
543
580
  /** @param {{ id: string, icon?: string, state?: string }} page @returns {string} */
544
581
  function pageIcon(page) {
545
582
  if (page && typeof page.icon === 'string' && ACC.icons[page.icon]) return page.icon
@@ -562,6 +599,31 @@ function layoutForWidth(width) {
562
599
  return 'narrow'
563
600
  }
564
601
 
602
+ /**
603
+ * Resolve one page's navigation group. An explicit `group` wins; otherwise
604
+ * `order` keeps pages written before the groups existed in a sensible slot.
605
+ * @param {{ group?: string, order?: number }} page
606
+ * @returns {'edit' | 'insight' | 'maintain'}
607
+ */
608
+ function groupOf(page) {
609
+ if (page && ACC_NAV_GROUPS.includes(page.group)) return page.group
610
+ const order = page && typeof page.order === 'number' ? page.order : 100
611
+ if (order <= 20) return 'edit'
612
+ return order <= ACC_NAV_INSIGHT_MAX_ORDER ? 'insight' : 'maintain'
613
+ }
614
+
615
+ /**
616
+ * Bucket already-sorted pages into the fixed group order. Empty groups are
617
+ * dropped so a label never appears without pages under it.
618
+ * @param {readonly object[]} pages
619
+ * @returns {Array<{ id: 'edit' | 'insight' | 'maintain', pages: object[] }>}
620
+ */
621
+ function groupedPages(pages) {
622
+ const buckets = { edit: [], insight: [], maintain: [] }
623
+ for (const page of pages) buckets[groupOf(page)].push(page)
624
+ return ACC_NAV_GROUPS.filter((id) => buckets[id].length > 0).map((id) => ({ id, pages: buckets[id] }))
625
+ }
626
+
565
627
  /**
566
628
  * The one settings page. Owns internal navigation only; each page owns its
567
629
  * data, loading/error/empty states and destructive confirmations.
@@ -570,6 +632,7 @@ function layoutForWidth(width) {
570
632
  function AccSection(props) {
571
633
  const t = props.t
572
634
  const pages = ACC.pagesSorted()
635
+ const navGroups = groupedPages(pages)
573
636
  const rootRef = useRef(null)
574
637
  const [activeId, setActiveId] = useState(() => {
575
638
  try {
@@ -695,9 +758,28 @@ function AccSection(props) {
695
758
  'div',
696
759
  { className: wide ? 'acc-body' : 'acc-body acc-body-narrow' },
697
760
  wide
698
- ? h('nav', { className: 'acc-nav', 'aria-label': t('nav.ariaLabel') }, pages.map(renderNavItem))
761
+ ? h(
762
+ 'nav',
763
+ { className: 'acc-nav', 'aria-label': t('nav.ariaLabel') },
764
+ navGroups.flatMap((group) => {
765
+ const label = t(`nav.group.${group.id}`)
766
+ return [
767
+ h('div', { key: `group-${group.id}`, className: 'acc-nav-group', title: label }, label),
768
+ ...group.pages.map(renderNavItem),
769
+ ]
770
+ }),
771
+ )
699
772
  : layout === 'mid'
700
- ? h('nav', { className: 'acc-nav acc-nav-horizontal', 'aria-label': t('nav.ariaLabel') }, pages.map(renderNavItem))
773
+ ? h(
774
+ 'nav',
775
+ { className: 'acc-nav acc-nav-horizontal', 'aria-label': t('nav.ariaLabel') },
776
+ navGroups.flatMap((group, index) => [
777
+ ...(index === 0
778
+ ? []
779
+ : [h('span', { key: `sep-${group.id}`, className: 'acc-nav-sep', 'aria-hidden': 'true' })]),
780
+ ...group.pages.map(renderNavItem),
781
+ ]),
782
+ )
701
783
  : h(
702
784
  'div',
703
785
  { className: 'acc-narrowbar' },
@@ -710,7 +792,13 @@ function AccSection(props) {
710
792
  'aria-label': t('nav.ariaLabel'),
711
793
  onChange: (event) => setActiveId(event.target.value),
712
794
  },
713
- pages.map((page) => h('option', { key: page.id, value: page.id }, t(page.titleKey))),
795
+ navGroups.map((group) =>
796
+ h(
797
+ 'optgroup',
798
+ { key: `group-${group.id}`, label: t(`nav.group.${group.id}`) },
799
+ group.pages.map((page) => h('option', { key: page.id, value: page.id }, t(page.titleKey))),
800
+ ),
801
+ ),
714
802
  ),
715
803
  ),
716
804
  h(
@@ -6,6 +6,9 @@ ACC.addI18n({
6
6
  'nav.ariaLabel': '控制台页面导航',
7
7
  'nav.refreshStatus': '刷新状态',
8
8
  'nav.refreshStatusHint': '只刷新宿主健康状态,不重新加载当前页面',
9
+ 'nav.group.edit': '编辑与指令',
10
+ 'nav.group.insight': '会话与洞察',
11
+ 'nav.group.maintain': '维护',
9
12
  'nav.desc.overview': '环境、宿主能力与今天的关键数字',
10
13
  'nav.desc.agents': 'AGENTS.md 指令链的读取、编辑、校验与备份',
11
14
  'nav.desc.tools': '宿主导出的工具清单、定义状态与调用统计',
@@ -54,6 +57,9 @@ ACC.addI18n({
54
57
  'nav.ariaLabel': 'Control center page navigation',
55
58
  'nav.refreshStatus': 'Refresh status',
56
59
  'nav.refreshStatusHint': 'Refreshes host health only; the current page is not reloaded',
60
+ 'nav.group.edit': 'Editing & instructions',
61
+ 'nav.group.insight': 'Sessions & insights',
62
+ 'nav.group.maintain': 'Maintenance',
57
63
  'nav.desc.overview': 'Environment, host capabilities and today’s key numbers',
58
64
  'nav.desc.agents': 'Read, edit, validate and back up the AGENTS.md instruction chain',
59
65
  'nav.desc.tools': 'Tools exposed by the host, their definition state and call statistics',
@@ -0,0 +1,174 @@
1
+ /* Export page vocabulary (module K). Every user-visible string lives here.
2
+ * The build checks zh/en key parity, so both dictionaries stay in lockstep. */
3
+ ACC.addI18n({
4
+ zh: {
5
+ 'nav.export': '会话导出',
6
+ 'nav.desc.export': '把会话只读导出为 Markdown 或 JSON,可复制与下载',
7
+
8
+ 'export.policyNote': '只读导出:不删除、不归档、不上传。',
9
+ 'export.policySource': '宿主策略原文',
10
+ 'export.loading': '正在读取导出能力…',
11
+ 'export.loadFailed': '导出能力读取失败',
12
+ 'export.moduleMissing': '当前宿主插件构建没有加载 export 模块(版本 {version})。',
13
+ 'export.errorHint': '页面本身已加载;若当前宿主缺少导出方法,请升级并重启插件后重试,本页不会显示假数据。',
14
+ 'export.unavailableHint': '请升级并重启 Agent Control Center,确认宿主提供 export.* 方法后重试;本页不会显示假数据。',
15
+ 'export.capabilityHint': '导出需要宿主提供 sessionQuery 服务(含 readSession);请在支持该能力的版本中重启插件后重试。',
16
+ 'export.unknownReason': '宿主未返回原因',
17
+ 'export.reasonLabel': '原因',
18
+ 'export.nextStepLabel': '下一步',
19
+
20
+ 'export.pickTitle': '选择会话',
21
+ 'export.sessionsCount': '显示 {shown} / 共 {total} 个会话',
22
+ 'export.searchActive': '筛选:{query}',
23
+ 'export.searchPlaceholder': '按标题或会话 ID 搜索…',
24
+ 'export.searchAria': '搜索可导出的会话',
25
+ 'export.searchClear': '清空搜索',
26
+ 'export.sessionsListAria': '可导出的会话列表',
27
+ 'export.loadingSessions': '正在读取会话列表…',
28
+ 'export.loadFailedSessions': '会话列表加载失败',
29
+ 'export.emptySessions': '没有可导出的会话',
30
+ 'export.emptySessionsHint': '宿主没有返回可导出的会话记录;可以刷新后重试。',
31
+ 'export.emptySearch': '没有匹配的会话',
32
+ 'export.emptySearchHint': '换个关键词,或清空搜索。',
33
+ 'export.untitled': '未命名会话',
34
+ 'export.archived': '已归档',
35
+ 'export.originLabel': '来源',
36
+ 'export.eventCount': '{count} 个事件',
37
+
38
+ 'export.settingsTitle': '导出设置',
39
+ 'export.settingsHint': '格式、工具结果与字节上限只影响下一次生成。',
40
+ 'export.format': '格式',
41
+ 'export.formatAria': '导出格式',
42
+ 'export.formatMarkdown': 'Markdown',
43
+ 'export.formatJson': 'JSON',
44
+ 'export.includeToolResults': '包含工具结果',
45
+ 'export.includeToolResultsHint': '关闭后工具调用只保留摘要,导出更小。',
46
+ 'export.maxBytes': '字节上限',
47
+ 'export.maxBytesHint': '超过上限时按事件边界截断,不会留下半个事件。',
48
+ 'export.limit64': '64 KiB',
49
+ 'export.limit256': '256 KiB',
50
+ 'export.limit1m': '1 MiB',
51
+
52
+ 'export.resultTitle': '导出结果',
53
+ 'export.resultHint': '先看概况,再生成预览;生成不会写入任何会话记录。',
54
+ 'export.selectHint': '从左侧选择一个会话',
55
+ 'export.selectHintHint': '选中后会先显示概况,再按当前设置生成导出。',
56
+ 'export.summaryLoading': '正在统计会话…',
57
+ 'export.summaryFailed': '会话概况加载失败',
58
+ 'export.countEvents': '事件',
59
+ 'export.countUser': '用户消息',
60
+ 'export.countAssistant': '助手消息',
61
+ 'export.countToolCalls': '工具调用',
62
+ 'export.countToolResults': '工具结果',
63
+ 'export.countToolErrors': '工具错误',
64
+ 'export.countErrors': '错误',
65
+ 'export.estimatedMarkdown': 'Markdown 估算',
66
+ 'export.estimatedJson': 'JSON 估算',
67
+ 'export.generate': '生成导出',
68
+ 'export.generating': '正在生成…',
69
+ 'export.generateFailed': '生成导出失败',
70
+ 'export.generateHint': '设置改动后需要重新生成;复制与下载使用最近一次结果。',
71
+ 'export.resultBytes': '导出字节',
72
+ 'export.resultTotalBytes': '完整字节',
73
+ 'export.truncated': '截断',
74
+ 'export.truncatedYes': '已截断',
75
+ 'export.truncatedNo': '未截断',
76
+ 'export.omittedEvents': '省略事件',
77
+ 'export.generatedAt': '生成时间',
78
+ 'export.truncatedNotice': '超出字节上限,已按事件边界省略 {count} 个事件。',
79
+ 'export.warnings': '提示',
80
+ 'export.preview': '预览',
81
+ 'export.previewEmpty': '导出内容为空',
82
+ 'export.copy': '复制',
83
+ 'export.copied': '已复制',
84
+ 'export.copyFailed': '复制失败(浏览器未授权剪贴板)',
85
+ 'export.download': '下载',
86
+ 'export.downloaded': '已开始下载',
87
+ 'export.downloadFailed': '下载失败(浏览器不支持 Blob 下载)',
88
+ },
89
+ en: {
90
+ 'nav.export': 'Export',
91
+ 'nav.desc.export': 'Read-only session export to Markdown or JSON, with copy and download',
92
+
93
+ 'export.policyNote': 'Read-only export: it never deletes, archives or uploads anything.',
94
+ 'export.policySource': 'Host policy text',
95
+ 'export.loading': 'Reading export capabilities…',
96
+ 'export.loadFailed': 'Could not read export capabilities',
97
+ 'export.moduleMissing': 'The current host plugin build does not load the export module (version {version}).',
98
+ 'export.errorHint': 'The page itself loaded; if the host is missing the export methods, upgrade and restart the plugin, then retry. This page never shows made-up data.',
99
+ 'export.unavailableHint': 'Upgrade and restart Agent Control Center so the host exposes the export.* methods, then retry; this page never shows made-up data.',
100
+ 'export.capabilityHint': 'Export needs the host sessionQuery service with readSession; restart the plugin on a build that provides it, then retry.',
101
+ 'export.unknownReason': 'The host returned no reason',
102
+ 'export.reasonLabel': 'Reason',
103
+ 'export.nextStepLabel': 'Next step',
104
+
105
+ 'export.pickTitle': 'Choose a session',
106
+ 'export.sessionsCount': 'Showing {shown} of {total} sessions',
107
+ 'export.searchActive': 'Filtered by: {query}',
108
+ 'export.searchPlaceholder': 'Search by title or session ID…',
109
+ 'export.searchAria': 'Search exportable sessions',
110
+ 'export.searchClear': 'Clear search',
111
+ 'export.sessionsListAria': 'Exportable session list',
112
+ 'export.loadingSessions': 'Loading the session list…',
113
+ 'export.loadFailedSessions': 'Could not load the session list',
114
+ 'export.emptySessions': 'No sessions available for export',
115
+ 'export.emptySessionsHint': 'The host returned no exportable session records; refresh and retry.',
116
+ 'export.emptySearch': 'No sessions match the search',
117
+ 'export.emptySearchHint': 'Try another keyword, or clear the search.',
118
+ 'export.untitled': 'Untitled session',
119
+ 'export.archived': 'Archived',
120
+ 'export.originLabel': 'Origin',
121
+ 'export.eventCount': '{count} events',
122
+
123
+ 'export.settingsTitle': 'Export settings',
124
+ 'export.settingsHint': 'Format, tool results and the byte limit only affect the next generated export.',
125
+ 'export.format': 'Format',
126
+ 'export.formatAria': 'Export format',
127
+ 'export.formatMarkdown': 'Markdown',
128
+ 'export.formatJson': 'JSON',
129
+ 'export.includeToolResults': 'Include tool results',
130
+ 'export.includeToolResultsHint': 'When off, tool calls keep only summaries and the export is smaller.',
131
+ 'export.maxBytes': 'Byte limit',
132
+ 'export.maxBytesHint': 'Over the limit, events are dropped at event boundaries; never half an event.',
133
+ 'export.limit64': '64 KiB',
134
+ 'export.limit256': '256 KiB',
135
+ 'export.limit1m': '1 MiB',
136
+
137
+ 'export.resultTitle': 'Export result',
138
+ 'export.resultHint': 'Review the summary, then generate a preview; generation never writes session records.',
139
+ 'export.selectHint': 'Pick a session from the left',
140
+ 'export.selectHintHint': 'A selected session shows its summary first; then export with the current settings.',
141
+ 'export.summaryLoading': 'Counting the session…',
142
+ 'export.summaryFailed': 'Could not load the session summary',
143
+ 'export.countEvents': 'Events',
144
+ 'export.countUser': 'User messages',
145
+ 'export.countAssistant': 'Assistant messages',
146
+ 'export.countToolCalls': 'Tool calls',
147
+ 'export.countToolResults': 'Tool results',
148
+ 'export.countToolErrors': 'Tool errors',
149
+ 'export.countErrors': 'Errors',
150
+ 'export.estimatedMarkdown': 'Markdown estimate',
151
+ 'export.estimatedJson': 'JSON estimate',
152
+ 'export.generate': 'Generate export',
153
+ 'export.generating': 'Generating…',
154
+ 'export.generateFailed': 'Could not generate the export',
155
+ 'export.generateHint': 'Changing settings requires regenerating; copy and download use the latest result.',
156
+ 'export.resultBytes': 'Export bytes',
157
+ 'export.resultTotalBytes': 'Full size',
158
+ 'export.truncated': 'Truncation',
159
+ 'export.truncatedYes': 'Truncated',
160
+ 'export.truncatedNo': 'Not truncated',
161
+ 'export.omittedEvents': 'Omitted events',
162
+ 'export.generatedAt': 'Generated',
163
+ 'export.truncatedNotice': 'Over the byte limit; {count} events omitted at event boundaries.',
164
+ 'export.warnings': 'Warnings',
165
+ 'export.preview': 'Preview',
166
+ 'export.previewEmpty': 'The export is empty',
167
+ 'export.copy': 'Copy',
168
+ 'export.copied': 'Copied',
169
+ 'export.copyFailed': 'Copy failed (the browser denied clipboard access)',
170
+ 'export.download': 'Download',
171
+ 'export.downloaded': 'Download started',
172
+ 'export.downloadFailed': 'Download failed (Blob download unsupported)',
173
+ },
174
+ })
@@ -0,0 +1,236 @@
1
+ /* Instruction preview page vocabulary (module J). Every user-visible string
2
+ * lives here; the English dictionary is a complete mirror of the Chinese one
3
+ * (scripts/build-client.mjs rejects a mismatch). Host-provided text (reasons,
4
+ * hints, notes) is never translated here: pages show it through ACC.l10n.host
5
+ * and disclose the original in the raw block when the English UI would leak
6
+ * Chinese. */
7
+ ACC.addI18n({
8
+ zh: {
9
+ 'nav.instruction': '指令预览',
10
+ 'nav.desc.instruction': '按文件与会话两条视角只读查看模型实际收到的指令内容',
11
+
12
+ 'instruction.readOnly': '只读:不修改任何指令文件',
13
+ 'instruction.tabsLabel': '指令视图',
14
+ 'instruction.tabFiles': '按文件重组(近似)',
15
+ 'instruction.tabSession': '按会话精确',
16
+ 'instruction.tabCompare': '对比',
17
+ 'instruction.failed': '指令预览加载失败',
18
+ 'instruction.unavailableTitle': '指令预览不可用',
19
+ 'instruction.reasonGeneric': '宿主报告该数据源不可用;原始原因见下方。',
20
+ 'instruction.hintGeneric': '宿主未提供进一步提示。',
21
+ 'instruction.hint': '提示',
22
+ 'instruction.rawHostText': '原始宿主文本(英文界面折叠显示)',
23
+ 'instruction.moduleAUnavailable': '文件侧不可用:AGENTS.md 模块(模块 A)未加载,只能查看会话精确视图。',
24
+
25
+ 'instruction.chainTitle': '指令链(按文件)',
26
+ 'instruction.chainUnavailableTitle': '指令链不可用',
27
+ 'instruction.chainUserGlobal': '用户全局链',
28
+ 'instruction.chainProject': '项目链',
29
+ 'instruction.budgetFits': '预算内',
30
+ 'instruction.budgetOver': '超出预算',
31
+ 'instruction.budgetUsage': '{rendered} / {max}',
32
+ 'instruction.budgetRaw': '原始文件字节 {bytes}',
33
+ 'instruction.budgetSource': '预算来源',
34
+ 'instruction.budgetSourceUnknown': '预算来源未知',
35
+ 'instruction.chainCwd': '工作目录',
36
+ 'instruction.chainProjectRoot': '项目根目录',
37
+ 'instruction.chainSource': '目录来源',
38
+ 'instruction.chainFilesCount': '共 {count} 个文件',
39
+ 'instruction.displayPath': '显示路径',
40
+ 'instruction.source': '来源',
41
+ 'instruction.flags': '标记',
42
+ 'instruction.badgeEffective': '生效中',
43
+ 'instruction.badgeOmitted': '预算省略',
44
+ 'instruction.badgeTruncated': '预算截断',
45
+ 'instruction.badgeDeduped': '已去重',
46
+ 'instruction.badgeDedupedBy': '去重于 {path}',
47
+ 'instruction.sourceUserGlobal': '用户全局',
48
+ 'instruction.sourceProject': '项目',
49
+ 'instruction.sourceAgentsHome': '共享 agents 根',
50
+ 'instruction.sourceProjectLocal': '项目本地覆盖',
51
+ 'instruction.sourceUnknown': '其它来源',
52
+ 'instruction.chainEmpty': '未发现指令文件',
53
+ 'instruction.chainEmptyHint': '当前工作目录没有可读的 AGENTS.md 指令文件,因此没有可重组的链。',
54
+ 'instruction.chainWarnings': '链警告',
55
+ 'instruction.chainTruncated': '响应超限:部分文件行已被省略;请以宿主侧的完整清单为准。',
56
+
57
+ 'instruction.previewTitle': '渲染后的指令预览',
58
+ 'instruction.previewExact': '与宿主注入格式一致(精确)',
59
+ 'instruction.previewApprox': '按预算重组的近似文本(exact=false)',
60
+ 'instruction.exact': '精确',
61
+ 'instruction.approximate': '近似',
62
+ 'instruction.copied': '已复制',
63
+ 'instruction.copyFailed': '复制失败',
64
+ 'instruction.copyPreview': '复制预览文本',
65
+ 'instruction.previewBytes': '字节数 {bytes}',
66
+ 'instruction.previewSections': '共 {count} 个文件段',
67
+ 'instruction.previewOmitted': '预算省略了 {count} 个文件',
68
+ 'instruction.previewTruncated': '预算截断了 {count} 个文件',
69
+ 'instruction.previewResponseTruncated': '响应超过上限,预览文本已截断;完整文本请以会话精确视图为准。',
70
+ 'instruction.previewNote': '文件侧是按宿主预算重组的近似文本;只有「精确」徽标表示与宿主注入格式完全一致。',
71
+ 'instruction.previewEmpty': '宿主未返回预览文本',
72
+ 'instruction.previewEmptyHint': '文件侧没有可渲染的文本;请确认 AGENTS.md 模块与指令预算可用。',
73
+
74
+ 'instruction.sessionPickTitle': '会话选择',
75
+ 'instruction.sessionPickHint': '选择一条会话后读取其持久化的指令事件;只读,不会续跑或修改会话。',
76
+ 'instruction.sessionPick': '选择会话',
77
+ 'instruction.sessionPickAria': '选择要查看指令的会话',
78
+ 'instruction.sessionListLoaded': '已加载 {count} 个会话',
79
+ 'instruction.sessionsFailed': '会话列表加载失败',
80
+ 'instruction.sessionListRefresh': '刷新会话列表',
81
+ 'instruction.sessionsEmpty': '宿主还没有会话',
82
+ 'instruction.sessionsEmptyHint': '先在宿主中开始一轮对话;指令块写入会话日志后会出现在这里。',
83
+ 'instruction.untitled': '未命名会话',
84
+ 'instruction.sessionFailed': '会话指令加载失败',
85
+ 'instruction.sessionUnavailableTitle': '会话精确视图不可用',
86
+ 'instruction.sessionBlocksTitle': '会话中的指令块',
87
+ 'instruction.sessionId': '会话 ID',
88
+ 'instruction.sessionInstructionCount': '指令块 {count} 个',
89
+ 'instruction.sessionEmpty': '该会话没有记录指令块',
90
+ 'instruction.sessionEmptyHint': '会话日志中没有 agent-instructions 事件;宿主只在首次注入指令时写入。',
91
+ 'instruction.sessionReason': '宿主说明',
92
+ 'instruction.baseline': '基线',
93
+ 'instruction.change': '变更',
94
+ 'instruction.blockTitle': '指令块 #{seq}',
95
+ 'instruction.blockTime': '时间',
96
+ 'instruction.blockTruncated': '已截断',
97
+ 'instruction.blockTruncatedHint': '响应超限,该块文本已截断;完整内容请到宿主会话日志中查看。',
98
+ 'instruction.blockEmpty': '该块没有可显示的文本',
99
+ 'instruction.blockCollapsed': '内容较长({bytes}),已折叠',
100
+ 'instruction.expand': '展开内容',
101
+ 'instruction.collapse': '收起内容',
102
+ 'instruction.copyBlock': '复制指令块',
103
+ 'instruction.copyBlockAria': '复制指令块 #{seq}',
104
+
105
+ 'instruction.noSelection': '先选择一个会话',
106
+ 'instruction.noSelectionHint': '会话数据按需读取;选中会话后才会请求指令块与对比结果。',
107
+ 'instruction.compareFailed': '对比加载失败',
108
+ 'instruction.compareUnavailableTitle': '对比不可用',
109
+ 'instruction.compareTitle': '文件侧与会话侧对比',
110
+ 'instruction.compareSubtitle': '差值 = 会话侧字节 − 文件侧字节;正数表示会话侧更大。',
111
+ 'instruction.compareFilesBytes': '文件侧重构字节',
112
+ 'instruction.compareSessionBytes': '会话侧精确字节',
113
+ 'instruction.compareDeltaBytes': '差值(正数=会话侧更大)',
114
+ 'instruction.sameText': '文本一致',
115
+ 'instruction.differentText': '文本不一致',
116
+ 'instruction.exactFilesYes': '文件侧精确',
117
+ 'instruction.exactFilesNo': '文件侧近似',
118
+ 'instruction.sessionItemsValue': '会话侧指令块 {count} 个',
119
+ 'instruction.compareWhy': '两侧文本不同:文件侧是按预算重组的近似文本(可能省略、截断或去重),会话侧是宿主当时实际注入的精确文本;字节差异由此而来。',
120
+ 'instruction.compareNote': '对比说明',
121
+ },
122
+ en: {
123
+ 'nav.instruction': 'Instruction preview',
124
+ 'nav.desc.instruction': 'Read-only view of the instruction text the model actually received, by files and by session',
125
+
126
+ 'instruction.readOnly': 'Read-only: no instruction file is ever modified',
127
+ 'instruction.tabsLabel': 'Instruction views',
128
+ 'instruction.tabFiles': 'By files (approximate)',
129
+ 'instruction.tabSession': 'By session (exact)',
130
+ 'instruction.tabCompare': 'Compare',
131
+ 'instruction.failed': 'Could not load the instruction preview',
132
+ 'instruction.unavailableTitle': 'Instruction preview unavailable',
133
+ 'instruction.reasonGeneric': 'The host reported this source as unavailable; the raw reason is shown below.',
134
+ 'instruction.hintGeneric': 'The host gave no further hint.',
135
+ 'instruction.hint': 'Hint',
136
+ 'instruction.rawHostText': 'Raw host text (collapsed in the English UI)',
137
+ 'instruction.moduleAUnavailable': 'The files side is unavailable: the AGENTS.md module (module A) is not loaded, so only the exact session view can be shown.',
138
+
139
+ 'instruction.chainTitle': 'Instruction chain (by files)',
140
+ 'instruction.chainUnavailableTitle': 'Instruction chain unavailable',
141
+ 'instruction.chainUserGlobal': 'User-global chain',
142
+ 'instruction.chainProject': 'Project chain',
143
+ 'instruction.budgetFits': 'Within budget',
144
+ 'instruction.budgetOver': 'Over budget',
145
+ 'instruction.budgetUsage': '{rendered} / {max}',
146
+ 'instruction.budgetRaw': 'Raw file bytes {bytes}',
147
+ 'instruction.budgetSource': 'Budget source',
148
+ 'instruction.budgetSourceUnknown': 'Budget source unknown',
149
+ 'instruction.chainCwd': 'Working directory',
150
+ 'instruction.chainProjectRoot': 'Project root',
151
+ 'instruction.chainSource': 'Directory source',
152
+ 'instruction.chainFilesCount': '{count} files',
153
+ 'instruction.displayPath': 'Display path',
154
+ 'instruction.source': 'Source',
155
+ 'instruction.flags': 'Flags',
156
+ 'instruction.badgeEffective': 'In effect',
157
+ 'instruction.badgeOmitted': 'Budget-omitted',
158
+ 'instruction.badgeTruncated': 'Budget-truncated',
159
+ 'instruction.badgeDeduped': 'Deduplicated',
160
+ 'instruction.badgeDedupedBy': 'Deduplicated by {path}',
161
+ 'instruction.sourceUserGlobal': 'User global',
162
+ 'instruction.sourceProject': 'Project',
163
+ 'instruction.sourceAgentsHome': 'Shared agents root',
164
+ 'instruction.sourceProjectLocal': 'Project-local overlay',
165
+ 'instruction.sourceUnknown': 'Other source',
166
+ 'instruction.chainEmpty': 'No instruction files discovered',
167
+ 'instruction.chainEmptyHint': 'The current working directory has no readable AGENTS.md instruction file, so there is no chain to reconstruct.',
168
+ 'instruction.chainWarnings': 'Chain warnings',
169
+ 'instruction.chainTruncated': 'The response hit its ceiling, so some file rows were omitted; use the host-side full list as the reference.',
170
+
171
+ 'instruction.previewTitle': 'Rendered instruction preview',
172
+ 'instruction.previewExact': 'Matches the host injection format (exact)',
173
+ 'instruction.previewApprox': 'Reconstructed under budget (exact=false)',
174
+ 'instruction.exact': 'Exact',
175
+ 'instruction.approximate': 'Approximate',
176
+ 'instruction.copied': 'Copied',
177
+ 'instruction.copyFailed': 'Copy failed',
178
+ 'instruction.copyPreview': 'Copy preview text',
179
+ 'instruction.previewBytes': 'Size {bytes}',
180
+ 'instruction.previewSections': '{count} file sections',
181
+ 'instruction.previewOmitted': '{count} files omitted by budget',
182
+ 'instruction.previewTruncated': '{count} files truncated by budget',
183
+ 'instruction.previewResponseTruncated': 'The response exceeded its ceiling, so the preview text was clipped; use the exact session view for the full text.',
184
+ 'instruction.previewNote': 'The files side is a reconstruction under the host budget; only the Exact badge means it matches the host injection format byte for byte.',
185
+ 'instruction.previewEmpty': 'The host returned no preview text',
186
+ 'instruction.previewEmptyHint': 'The files side rendered no text; check that the AGENTS.md module and the instruction budget are available.',
187
+
188
+ 'instruction.sessionPickTitle': 'Session selection',
189
+ 'instruction.sessionPickHint': 'Pick a session to read its durable instruction events; read-only, it never resumes or modifies a session.',
190
+ 'instruction.sessionPick': 'Select a session',
191
+ 'instruction.sessionPickAria': 'Session whose instructions to inspect',
192
+ 'instruction.sessionListLoaded': '{count} sessions loaded',
193
+ 'instruction.sessionsFailed': 'Could not load the session list',
194
+ 'instruction.sessionListRefresh': 'Refresh the session list',
195
+ 'instruction.sessionsEmpty': 'The host has no sessions yet',
196
+ 'instruction.sessionsEmptyHint': 'Start a turn in the host first; instruction blocks appear here once they are written to the session log.',
197
+ 'instruction.untitled': 'Untitled session',
198
+ 'instruction.sessionFailed': 'Could not load the session instructions',
199
+ 'instruction.sessionUnavailableTitle': 'Exact session view unavailable',
200
+ 'instruction.sessionBlocksTitle': 'Instruction blocks in this session',
201
+ 'instruction.sessionId': 'Session ID',
202
+ 'instruction.sessionInstructionCount': '{count} instruction blocks',
203
+ 'instruction.sessionEmpty': 'This session recorded no instruction blocks',
204
+ 'instruction.sessionEmptyHint': 'The session log has no agent-instructions event; the host writes one only when it first injects instructions.',
205
+ 'instruction.sessionReason': 'Host explanation',
206
+ 'instruction.baseline': 'Baseline',
207
+ 'instruction.change': 'Change',
208
+ 'instruction.blockTitle': 'Instruction block #{seq}',
209
+ 'instruction.blockTime': 'Time',
210
+ 'instruction.blockTruncated': 'Truncated',
211
+ 'instruction.blockTruncatedHint': 'The response hit its ceiling and this block was clipped; read the full text in the host session log.',
212
+ 'instruction.blockEmpty': 'This block has no displayable text',
213
+ 'instruction.blockCollapsed': 'Long content ({bytes}), collapsed',
214
+ 'instruction.expand': 'Show content',
215
+ 'instruction.collapse': 'Hide content',
216
+ 'instruction.copyBlock': 'Copy block',
217
+ 'instruction.copyBlockAria': 'Copy instruction block #{seq}',
218
+
219
+ 'instruction.noSelection': 'Select a session first',
220
+ 'instruction.noSelectionHint': 'Session data is read on demand; instruction blocks and the comparison are requested only after you pick a session.',
221
+ 'instruction.compareFailed': 'Could not load the comparison',
222
+ 'instruction.compareUnavailableTitle': 'Comparison unavailable',
223
+ 'instruction.compareTitle': 'Files side vs session side',
224
+ 'instruction.compareSubtitle': 'Delta = session-side bytes − files-side bytes; a positive value means the session side is larger.',
225
+ 'instruction.compareFilesBytes': 'Files-side bytes',
226
+ 'instruction.compareSessionBytes': 'Session-side bytes',
227
+ 'instruction.compareDeltaBytes': 'Delta (positive = session side larger)',
228
+ 'instruction.sameText': 'Same text',
229
+ 'instruction.differentText': 'Different text',
230
+ 'instruction.exactFilesYes': 'Files side exact',
231
+ 'instruction.exactFilesNo': 'Files side approximate',
232
+ 'instruction.sessionItemsValue': '{count} session-side blocks',
233
+ 'instruction.compareWhy': 'The two sides differ: the files side is a reconstruction under budget (files may be omitted, truncated, or deduplicated), while the session side is the exact text the host injected; the byte difference follows from that.',
234
+ 'instruction.compareNote': 'Comparison note',
235
+ },
236
+ })
@@ -81,6 +81,7 @@ ACC.t = function translate(key, fallback) {
81
81
  * @param {{
82
82
  * id: string,
83
83
  * titleKey: string,
84
+ * group?: 'edit' | 'insight' | 'maintain',
84
85
  * order?: number,
85
86
  * descriptionKey?: string,
86
87
  * icon?: string,
@@ -96,6 +97,7 @@ ACC.registerPage = function registerPage(definition) {
96
97
  ACC.pages.push({
97
98
  id: definition.id,
98
99
  titleKey: definition.titleKey,
100
+ group: typeof definition.group === 'string' ? definition.group : undefined,
99
101
  descriptionKey: definition.descriptionKey,
100
102
  icon: typeof definition.icon === 'string' ? definition.icon : undefined,
101
103
  order: typeof definition.order === 'number' ? definition.order : 100,
@@ -259,6 +261,17 @@ const ACC_ICONS = {
259
261
  ['path', { d: 'M13.35 2.85v3.95h-3.95' }],
260
262
  ],
261
263
  close: [['path', { d: 'M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6' }]],
264
+ // Pages added in 0.3.0 (instruction preview, session export).
265
+ 'file-text': [
266
+ ['path', { d: 'M3.9 1.9h4.85L12.1 5.25v8.85H3.9z' }],
267
+ ['path', { d: 'M8.6 2.1v3.4h3.4' }],
268
+ ['path', { d: 'M5.9 7.5h4.2M5.9 10h4.2' }],
269
+ ],
270
+ download: [
271
+ ['path', { d: 'M8 2.2v7.1' }],
272
+ ['path', { d: 'M5.1 6.6 8 9.5l2.9-2.9' }],
273
+ ['path', { d: 'M2.9 11.2v1.35a1.2 1.2 0 0 0 1.2 1.2h7.8a1.2 1.2 0 0 0 1.2-1.2v-1.35' }],
274
+ ],
262
275
  check: [['path', { d: 'M3.3 8.4 6.3 11.4 12.7 5.1' }]],
263
276
  dot: [['circle', { cx: 8, cy: 8, r: 2.4 }]],
264
277
  }
@@ -1072,6 +1072,7 @@ ACC.l10n = (function createL10n() {
1072
1072
  id: 'agents',
1073
1073
  titleKey: 'nav.agents',
1074
1074
  order: 20,
1075
+ group: 'edit',
1075
1076
  render: (props) => h(AgentsPage, props),
1076
1077
  })
1077
1078
  })()
@@ -626,6 +626,7 @@
626
626
  id: 'diagnostics',
627
627
  titleKey: 'nav.diagnostics',
628
628
  order: 70,
629
+ group: 'maintain',
629
630
  render: (props) => h(DiagnosticsPage, props),
630
631
  })
631
632
  })()