@ai-wendao/ant 0.4.6 → 0.4.8

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.
Files changed (2) hide show
  1. package/client.js +92 -49
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -112,6 +112,12 @@ window.__ModuleLoader__.load({
112
112
  border: '0.5px solid var(--dsw-alias-border-l2)', borderRadius: 14,
113
113
  backgroundColor: 'var(--dsw-alias-bg-module-platform)', boxSizing: 'border-box',
114
114
  }
115
+ const settingsPanelStyle = { ...panelStyle, border: '1px solid var(--dsw-alias-border-l2)', backgroundColor: 'var(--dsw-alias-bg-layer-1)' }
116
+ const infoNoticeStyle = {
117
+ display: 'grid', gap: 3, padding: '9px 11px', borderRadius: 8,
118
+ backgroundColor: 'var(--dsw-alias-state-business-tertiary)',
119
+ borderLeft: '3px solid var(--dsw-alias-state-business-primary)',
120
+ }
115
121
  const mutedTextStyle = { margin: 0, color: 'var(--dsw-alias-label-secondary)', fontSize: 13, lineHeight: 1.6 }
116
122
  const sectionTitleStyle = { margin: 0, fontSize: 16, fontWeight: 650, lineHeight: 1.4 }
117
123
  const inputStyle = {
@@ -358,7 +364,7 @@ window.__ModuleLoader__.load({
358
364
  try { localStorage.setItem(SERVICE_URL_STORAGE_KEY, url) } catch {}
359
365
  }
360
366
  }
361
- const teamServicePanel = h('section', { style: { ...panelStyle, display: activeTab === 'connection' ? 'grid' : 'none' } },
367
+ const teamServicePanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'connection' ? 'grid' : 'none' } },
362
368
  h('div', null,
363
369
  h('h3', { style: sectionTitleStyle }, '团队服务'),
364
370
  h('p', { style: { ...mutedTextStyle, marginTop: 4 } }, '由团队管理员提供服务地址;管理员可在控制台管理成员、模型和协作设置。')),
@@ -377,17 +383,19 @@ window.__ModuleLoader__.load({
377
383
  link ? h('a', { href: link, target: '_blank', rel: 'noopener noreferrer', style: { color: 'var(--dsw-alias-link)', fontSize: 13 } }, '打开团队管理 ↗') : null))
378
384
  return h('section', { style: { display: 'grid', gap: 16, width: '100%', maxWidth: 1120 } },
379
385
  h('div', { style: { display: 'grid', gap: 4 } },
380
- h('h2', { style: { margin: 0, fontSize: 20, fontWeight: 650, lineHeight: 1.35 } }, '协作机器人'),
381
- h('p', { style: mutedTextStyle }, '同事可以像平常一样聊天;需要使用你电脑的能力时,ANT 才核验授权。')),
386
+ h('h2', { style: { margin: 0, fontSize: 20, fontWeight: 650, lineHeight: 1.35 } }, '团队与协作'),
387
+ h('p', { style: mutedTextStyle }, '管理团队连接、机器人聊天入口和本机任务授权。日常聊天保持自然;执行能力按你开放的范围核验。')),
382
388
  h('div', { role: 'status', style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between',
383
389
  flexWrap: 'wrap', gap: 10, padding: '10px 12px', borderRadius: 8,
384
390
  backgroundColor: bindingReadyForSummary ? 'var(--dsw-alias-state-success-tertiary)' : 'var(--dsw-alias-bg-layer-2)' } },
385
391
  h('span', null, bindingSummary),
386
392
  !bindingReadyForSummary ? h('button', { type: 'button', onClick: () => selectSettingsTab('connection'),
387
- style: secondaryButtonStyle }, binding.state === 'error' ? '检查连接' : '查看连接设置') : null),
393
+ style: secondaryButtonStyle }, binding.state === 'error' ? '检查连接' : '查看连接设置')
394
+ : activeTab === 'connection' ? h('button', { type: 'button', onClick: () => selectSettingsTab('bot-chat'),
395
+ style: secondaryButtonStyle }, '设置或管理机器人') : null),
388
396
  h('div', { style: { position: 'sticky', top: 0, zIndex: 8, display: 'grid', gap: 8, padding: '6px 0',
389
- backgroundColor: 'var(--dsw-alias-bg-module-platform)' } },
390
- pluginAlerts.length ? h('section', { role: 'alert', style: { ...panelStyle,
397
+ backgroundColor: 'var(--dsw-alias-bg-base)' } },
398
+ pluginAlerts.length ? h('section', { role: 'alert', style: { ...settingsPanelStyle,
391
399
  borderColor: 'var(--dsw-alias-label-danger, #d44)', maxHeight: '28vh', overflowY: 'auto' } },
392
400
  h('h3', { style: sectionTitleStyle }, '已安装插件存在安全撤回公告'),
393
401
  ...pluginAlerts.map((plugin) => h('p', { key: plugin.id, style: mutedTextStyle },
@@ -407,7 +415,12 @@ window.__ModuleLoader__.load({
407
415
  ? `有新版 ANT:${updateSummary.currentVersion || '当前版本未知'} → ${updateSummary.version}`
408
416
  : updateSummary.state === 'done' ? `ANT ${updateSummary.version} 已安装,需重启 DSH`
409
417
  : updateSummary.state === 'revoked' ? '当前 ANT 安装包已撤回' : 'ANT 更新需要处理'),
410
- h('span', { style: mutedTextStyle }, updateSummary.message || '打开“关于”查看处理方式。')),
418
+ h('span', { style: mutedTextStyle }, updateSummary.state === 'available'
419
+ ? '查看“关于”中的更新说明与兼容要求;安装后需重启 DSH。'
420
+ : updateSummary.state === 'done' ? '请完全退出并重新启动 DSH 后生效。'
421
+ : updateSummary.state === 'revoked' ? '打开“关于”查看安全处置方式。'
422
+ : updateSummary.state === 'artifact-missing' ? '新版安装包尚未审核,请联系管理员。'
423
+ : '打开“关于”查看处理方式。')),
411
424
  h('button', { type: 'button', onClick: () => selectSettingsTab('updates'), style: primaryButtonStyle },
412
425
  updateSummary.state === 'available' ? '查看并更新' : '查看处理方式')) : null,
413
426
  h('nav', { role: 'tablist', 'aria-label': 'ANT 插件设置', style: {
@@ -419,8 +432,8 @@ window.__ModuleLoader__.load({
419
432
  onKeyDown: (event) => moveSettingsTabFocus(event, index), onClick: () => selectSettingsTab(tab),
420
433
  style: { ...secondaryButtonStyle, minHeight: 38, padding: '7px 12px', whiteSpace: 'nowrap',
421
434
  borderRadius: '8px 8px 0 0', color: activeTab === tab ? 'var(--dsw-alias-state-business-primary)' : secondaryButtonStyle.color,
422
- borderBottom: activeTab === tab ? '2px solid var(--dsw-alias-state-business-primary)' : secondaryButtonStyle.border,
423
- backgroundColor: activeTab === tab ? 'var(--dsw-alias-bg-layer-2)' : secondaryButtonStyle.backgroundColor,
435
+ border: '0', borderBottom: activeTab === tab ? '2px solid var(--dsw-alias-state-business-primary)' : '2px solid transparent',
436
+ backgroundColor: 'transparent',
424
437
  } }, tab === 'updates' && updateNeedsAttention ? `${label} · ${updateSummary.state === 'available' ? '有新版' : '需处理'}` : label)))),
425
438
  h('div', { id: 'ant-settings-content', role: 'tabpanel', 'aria-labelledby': `ant-settings-tab-${activeTab}` },
426
439
  teamServicePanel,
@@ -715,28 +728,51 @@ window.__ModuleLoader__.load({
715
728
  } catch (error) { setMessage(error.message) }
716
729
  finally { setBusy(false) }
717
730
  }
718
- const setupStepper = h('ol', { 'aria-label': '设置步骤', style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 150px), 1fr))',
719
- gap: 8, padding: 0, margin: 0, listStyle: 'none' } },
720
- ...[
721
- { label: '绑定机器人', detail: '连接到这台 DSH' },
722
- { label: '设置聊天范围', detail: '私聊和群聊分别控制' },
723
- { label: '开放能力', detail: selectedTaskCount ? `${selectedTaskCount} 项已开放` : '按需要逐项开放' },
724
- { label: '复核授权', detail: createOpen ? '正在配置授权范围' : selectedTaskCount ? '可随时查看与停止' : '请求范围由所有者设定' },
725
- ].map((step, index) => {
726
- const currentStep = !botConnected || !selectedEnrollmentBound ? 0 : createOpen ? 3 : selectedTaskCount ? 4 : 2
727
- const state = index < currentStep ? '完成' : index === currentStep ? '当前' : '待完成'
728
- return h('li', { key: step.label, style: { display: 'grid', gap: 3, padding: '8px 10px',
729
- borderTop: `2px solid ${state === '完成' ? 'var(--dsw-alias-state-success-primary)' : state === '当前' ? 'var(--dsw-alias-state-business-primary)' : 'var(--dsw-alias-border-l2)'}`,
730
- minWidth: 0 } },
731
- h('strong', { style: { fontSize: 13, fontWeight: 600 } }, step.label),
732
- h('span', { style: mutedTextStyle }, step.detail))
733
- }))
734
- const chatScopePanel = h('div', { style: { border: '1px solid var(--dsw-alias-border-l2)', borderRadius: 8, padding: 12,
731
+ const focusAfterTabChange = (tab, elementId) => {
732
+ onSelectTab(tab)
733
+ window.requestAnimationFrame?.(() => {
734
+ const target = window.document?.getElementById(elementId)
735
+ target?.scrollIntoView?.({ behavior: 'smooth', block: 'start' })
736
+ target?.focus?.({ preventScroll: true })
737
+ })
738
+ }
739
+ const goToSetupStep = (index) => {
740
+ if (index === 0) return focusAfterTabChange('bot-chat', selectedBot ? 'ant-bot-selector' : 'ant-chat-entry')
741
+ if (index === 1) return focusAfterTabChange('bot-chat', 'ant-chat-scope-panel')
742
+ if (authorizationLoadError || selectedTaskCount > 0) return focusAfterTabChange('capability', 'ant-capability-list')
743
+ setCreateOpen(true)
744
+ focusAfterTabChange('capability', index === 2 ? 'ant-new-task-summary' : 'ant-authorization-review')
745
+ }
746
+ const setupStepper = h('section', { 'aria-label': '首次设置引导', style: { display: 'grid', gap: 6 } },
747
+ h('p', { style: mutedTextStyle }, '首次设置可按顺序完成;你也可以直接切换页面。普通聊天不需要先开放任务。'),
748
+ h('ol', { 'aria-label': '设置步骤', style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 150px), 1fr))',
749
+ gap: 8, padding: 0, margin: 0, listStyle: 'none' } },
750
+ ...[
751
+ { label: '机器人和设备', detail: !selectedBot ? '选择已连接的机器人' : !botConnected ? '检查 DSH-IM 连接' : selectedEnrollmentBound ? '已绑定到这台 DSH' : '绑定到这台 DSH' },
752
+ { label: '聊天入口', detail: !selectedBot || !selectedEnrollmentBound ? '绑定设备后设置私聊和群聊' : groupChatLoadFailed ? '群列表暂不可用,可手动输入群 ID' : `${dmChatEnabled ? '私聊可用' : '私聊已关闭'} · ${availableGroups.length} 个已发现群` },
753
+ { label: '开放能力', detail: !botConnected || !selectedEnrollmentBound ? '完成机器人绑定后再开放' : authorizationLoadError ? '授权列表暂不可读,请刷新状态' : selectedTaskCount ? `${selectedTaskCount} 项已开放,可查看或停止` : '按需要创建任务' },
754
+ { label: '复核授权', detail: authorizationLoadError ? '先确认已保存授权' : createOpen ? '检查请求范围后确认' : selectedTaskCount ? '查看已开放范围' : '请求人、执行方和期限' },
755
+ ].map((step, index) => {
756
+ const currentStep = !botConnected || !selectedEnrollmentBound ? 0 : createOpen ? 3 : selectedTaskCount ? 4 : 2
757
+ const state = index < currentStep ? '完成' : index === currentStep ? '当前' : '待完成'
758
+ return h('li', { key: step.label, style: { minWidth: 0 } },
759
+ h('button', { type: 'button', 'aria-current': state === '当前' ? 'step' : undefined,
760
+ onClick: () => goToSetupStep(index), style: { width: '100%', minHeight: 70, display: 'grid', gap: 3,
761
+ padding: '8px 10px', textAlign: 'left', color: mutedTextStyle.color,
762
+ backgroundColor: 'var(--dsw-alias-bg-layer-1)', cursor: 'pointer',
763
+ border: '0', borderTop: `2px solid ${state === '完成' ? 'var(--dsw-alias-state-success-primary)' : state === '当前' ? 'var(--dsw-alias-state-business-primary)' : 'var(--dsw-alias-border-l2)'}`,
764
+ borderRadius: 0 } },
765
+ h('span', { style: { display: 'flex', justifyContent: 'space-between', gap: 6, alignItems: 'center' } },
766
+ h('strong', { style: { fontSize: 13, fontWeight: 600 } }, step.label),
767
+ h('span', { style: { fontSize: 12, color: mutedTextStyle.color } }, state)),
768
+ h('span', { style: mutedTextStyle }, step.detail)))
769
+ })))
770
+ const chatScopePanel = h('div', { id: 'ant-chat-scope-panel', tabIndex: -1, style: { border: '1px solid var(--dsw-alias-border-l2)', borderRadius: 8, padding: 12,
735
771
  display: 'grid', gap: 8 } },
736
772
  h('strong', null, '机器人和聊天范围'),
737
773
  h('div', { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 240px), 1fr))', gap: 8 } },
738
774
  h('div', { style: { display: 'grid', gap: 5, padding: 10, borderRadius: 8,
739
- backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
775
+ border: '1px solid var(--dsw-alias-border-l2)', backgroundColor: 'var(--dsw-alias-bg-layer-1)' } },
740
776
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
741
777
  h('label', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
742
778
  h('input', { type: 'checkbox', checked: dmChatEnabled,
@@ -747,7 +783,7 @@ window.__ModuleLoader__.load({
747
783
  h('span', { style: { ...mutedTextStyle, whiteSpace: 'nowrap' } }, dmChatStatus)),
748
784
  h('p', { style: mutedTextStyle }, dmChatDescription)),
749
785
  h('div', { style: { display: 'grid', gap: 5, padding: 10, borderRadius: 8,
750
- backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
786
+ border: '1px solid var(--dsw-alias-border-l2)', backgroundColor: 'var(--dsw-alias-bg-layer-1)' } },
751
787
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
752
788
  h('label', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
753
789
  h('input', { type: 'checkbox', checked: Boolean(selectedChatGroup?.chat_enabled),
@@ -902,14 +938,15 @@ window.__ModuleLoader__.load({
902
938
  } catch (error) { setMessage(error.message) }
903
939
  finally { setBusy(false) }
904
940
  }
905
- return h('section', { style: { ...panelStyle,
941
+ return h('section', { style: { ...settingsPanelStyle,
906
942
  display: ['bot-chat', 'capability', 'local'].includes(activeTab) ? 'grid' : 'none' },
907
943
  'aria-label': '协作机器人与开放能力' },
908
944
  message ? h('p', { role: 'status', style: mutedTextStyle }, message) : null,
909
- h('div', { role: 'region', 'aria-label': '机器人连接和聊天范围', style: { display: activeTab === 'bot-chat' ? 'grid' : 'none', gap: 14 } },
910
- h('h3', { style: sectionTitleStyle }, '协作机器人'),
945
+ h('div', { id: 'ant-chat-entry', role: 'region', 'aria-label': '聊天入口和机器人状态', tabIndex: -1,
946
+ style: { display: activeTab === 'bot-chat' ? 'grid' : 'none', gap: 14 } },
947
+ h('h3', { style: sectionTitleStyle }, '聊天入口'),
911
948
  h('p', { style: mutedTextStyle }, '在所有者开启的私聊或群聊中,同事可以像平常一样和机器人聊天。DSH 负责理解与回答;只有准备执行你开放的能力时,ANT 才核对请求人、群、参数和权限。群里的任务结果会回复原群。'),
912
- h('p', { role: 'status', style: mutedTextStyle }, '每项能力都单独设定执行方和请求范围。普通对话不会自动获得读取电脑、调用工具或访问其他群的权限。'),
949
+ h('p', { role: 'status', style: mutedTextStyle }, '私聊与群聊可同时开启;每项能力一次只授权给一个私聊或一个群。普通对话不会自动获得读取电脑、调用工具或访问其他群的权限。'),
913
950
  loadFailures.length ? h('p', { role: 'status', style: mutedTextStyle },
914
951
  `部分协作信息暂时无法读取:${loadFailures.map((path) => loadNames[path]).join('、')}。已读取的信息仍显示,请稍后刷新状态。`) : null,
915
952
  h('span', { role: 'status', style: mutedTextStyle }, loading ? '正在读取机器人与任务状态…'
@@ -928,7 +965,7 @@ window.__ModuleLoader__.load({
928
965
  : !dmChatEnabled ? `“${selectedBot.name}”已启用协作;私聊已关闭,群聊仍按各自设置工作。`
929
966
  : selectedTaskCount === 0 ? `“${selectedBot.name}”已启用协作;下一步开放一项能力。你也可以先私聊自测普通聊天。`
930
967
  : `“${selectedBot.name}”已启用协作 · ${selectedTaskCount} 项能力已开放。可以私聊自测。`),
931
- bots.length ? h('label', null, '我的机器人', h('select', { value: botId,
968
+ bots.length ? h('label', null, '我的机器人', h('select', { id: 'ant-bot-selector', value: botId,
932
969
  onChange: (event) => { setBotId(event.target.value); setGroupId(''); setChatGroupId(''); setBindingCode('');
933
970
  setTrustedOrigin(enrolled.find((bot) => bot.bot_id === event.target.value)?.gitea_origin || '') }, style: inputStyle },
934
971
  h('option', { value: '' }, '请选择机器人'),
@@ -1002,7 +1039,8 @@ window.__ModuleLoader__.load({
1002
1039
  h('button', { type: 'button', onClick: () => { preparePrExample(); onSelectTab('capability') }, style: secondaryButtonStyle }, '使用 PR 差异审查示例'),
1003
1040
  h('button', { type: 'button', onClick: () => void load().catch((error) => setMessage(error.message)),
1004
1041
  style: secondaryButtonStyle }, '刷新状态'))),
1005
- h('div', { role: 'region', 'aria-label': '已开放能力列表', style: { display: activeTab === 'capability' ? 'grid' : 'none', gap: 12 } },
1042
+ h('div', { id: 'ant-capability-list', role: 'region', 'aria-label': '已开放能力列表', tabIndex: -1,
1043
+ style: { display: activeTab === 'capability' ? 'grid' : 'none', gap: 12 } },
1006
1044
  h('h4', { style: sectionTitleStyle }, `我开放的能力 · ${authorizationLoadError ? '暂未读取' : activeCards.length}`),
1007
1045
  h('p', { style: mutedTextStyle }, '当前一项能力只能绑定一个范围:私聊,或某一个群。若要给其他群或私聊开放相同任务,目前需分别建立能力卡;它们的请求人和有效期独立。'),
1008
1046
  ...activeCards.map((card) => {
@@ -1047,9 +1085,13 @@ window.__ModuleLoader__.load({
1047
1085
  h('button', { type: 'button', disabled: busy, onClick: () => copyCardToDraft(card), style: secondaryButtonStyle }, '复制'),
1048
1086
  h('button', { type: 'button', disabled: busy, onClick: () => void revokeCard(card), style: secondaryButtonStyle }, '停止')))
1049
1087
  }),
1050
- activeCards.length === 0 ? h('p', { style: mutedTextStyle },
1051
- authorizationLoadError ? '暂时无法确认已开放的能力,请刷新状态后再试。'
1052
- : '还没有开放能力。先选机器人,再开放一项能力;PR 审查只是可选示例。') : null),
1088
+ activeCards.length === 0 ? h('div', { style: { display: 'grid', justifyItems: 'start', gap: 8 } },
1089
+ h('p', { style: mutedTextStyle }, authorizationLoadError
1090
+ ? '暂时无法确认已开放的能力。刷新授权状态后再试;列表未核实前请勿重复创建。'
1091
+ : '还没有开放能力。先选机器人,再开放一项能力;PR 审查只是可选示例。'),
1092
+ authorizationLoadError ? h('button', { type: 'button', disabled: loading,
1093
+ onClick: () => void load().catch((error) => setMessage(error.message)), style: secondaryButtonStyle },
1094
+ loading ? '正在刷新…' : '刷新授权状态') : null) : null),
1053
1095
  h('div', { role: 'region', 'aria-label': '最近任务', style: { display: activeTab === 'local' ? 'grid' : 'none', gap: 12 } },
1054
1096
  h('h4', { style: sectionTitleStyle }, '最近任务'),
1055
1097
  ...(tasks.filter((task) => task.task_id).length ? tasks.filter((task) => task.task_id)
@@ -1075,7 +1117,7 @@ window.__ModuleLoader__.load({
1075
1117
  h('details', { id: 'ant-new-task', open: createOpen,
1076
1118
  onToggle: (event) => setCreateOpen(event.currentTarget.open),
1077
1119
  style: { border: '1px solid var(--dsw-alias-border-l2)', borderRadius: 8, padding: 12 } },
1078
- h('summary', { style: { cursor: 'pointer', fontWeight: 600 } }, '开放一项能力'),
1120
+ h('summary', { id: 'ant-new-task-summary', style: { cursor: 'pointer', fontWeight: 600 } }, '开放一项能力'),
1079
1121
  h('div', { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 320px), 1fr))',
1080
1122
  gap: 16, alignItems: 'start', marginTop: 12 } },
1081
1123
  h('form', { id: 'ant-capability-create-form', onSubmit: createCard, style: { display: 'grid', gap: 9, minWidth: 0 } },
@@ -1170,7 +1212,8 @@ window.__ModuleLoader__.load({
1170
1212
  h('label', null, '有效期', h('select', { value: days, onChange: (event) => setDays(Number(event.target.value)), style: inputStyle },
1171
1213
  h('option', { value: 1 }, '1 天'), h('option', { value: 7 }, '7 天'), h('option', { value: 30 }, '30 天')))),
1172
1214
  ),
1173
- h('aside', { role: 'region', 'aria-label': '开放前复核', style: { ...panelStyle, padding: 14, gap: 10,
1215
+ h('aside', { id: 'ant-authorization-review', role: 'region', 'aria-label': '开放前复核', tabIndex: -1,
1216
+ style: { ...settingsPanelStyle, padding: 14, gap: 10,
1174
1217
  position: 'sticky', top: 12, alignSelf: 'start' } },
1175
1218
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
1176
1219
  h('h4', { style: sectionTitleStyle }, '开放前复核'),
@@ -1193,7 +1236,7 @@ window.__ModuleLoader__.load({
1193
1236
  h('button', { type: 'submit', form: 'ant-capability-create-form', disabled: busy || Boolean(cardBlockReason),
1194
1237
  style: { ...primaryButtonStyle, width: '100%' } }, '确认并开放能力'))))),
1195
1238
  h('div', { role: 'region', 'aria-label': '本机处理设置', style: { display: activeTab === 'local' ? 'grid' : 'none', gap: 12 } },
1196
- h('section', { style: { ...panelStyle, padding: 14 } },
1239
+ h('section', { style: { ...settingsPanelStyle, padding: 14 } },
1197
1240
  h('strong', null, 'Gitea 本机凭据'),
1198
1241
  h('p', { style: mutedTextStyle }, tokenConfigured
1199
1242
  ? '只读访问令牌已保存在这台 DSH 的安全凭据中;不会同步到 ANT 服务端或发送给执行器。'
@@ -2242,7 +2285,7 @@ window.__ModuleLoader__.load({
2242
2285
  backgroundColor: 'var(--dsw-alias-bg-layer-2)', color: 'var(--dsw-alias-label-secondary)', fontSize: 12 } },
2243
2286
  `${model.protocol === 'anthropic' ? 'Anthropic' : 'OpenAI'} 协议`),
2244
2287
  h('span', { style: { ...mutedTextStyle, textAlign: 'right' } }, '已同步到 DSH')))
2245
- const connectionPanel = h('section', { style: { ...panelStyle, display: activeTab === 'connection' ? 'grid' : 'none' } },
2288
+ const connectionPanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'connection' ? 'grid' : 'none' } },
2246
2289
  h('div', null,
2247
2290
  h('h3', { style: sectionTitleStyle }, 'ANT 团队账号'),
2248
2291
  h('p', { style: { ...mutedTextStyle, marginTop: 4 } }, '邮箱验证建立这台 DSH 的成员凭证;断开后会清除此设备凭证和同步的模型设置。')),
@@ -2250,8 +2293,7 @@ window.__ModuleLoader__.load({
2250
2293
  ? '本机有 ANT 凭证,但尚未确认它绑定的团队;请完成上方的绑定检查。'
2251
2294
  : credentialConfigured === true ? 'DSH 已安全保存此设备的 ANT 团队凭证。'
2252
2295
  : credentialConfigured === false ? '验证工作邮箱后即可连接团队服务。' : '正在检查 ANT 连接状态…'),
2253
- h('div', { role: 'note', style: { display: 'grid', gap: 3, padding: '9px 11px', borderRadius: 8,
2254
- backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
2296
+ h('div', { role: 'note', style: infoNoticeStyle },
2255
2297
  h('strong', { style: { fontSize: 13, fontWeight: 600 } }, '配置保存范围'),
2256
2298
  h('p', { style: mutedTextStyle }, '团队模型与能力授权由 ANT 管理;成员凭证、Gitea 令牌、本机缓存和任务记录保存在这台 DSH。')),
2257
2299
  serviceCompatibility.state !== 'idle' ? h('p', { role: 'status', style: { ...mutedTextStyle,
@@ -2277,7 +2319,7 @@ window.__ModuleLoader__.load({
2277
2319
  credentialConfigured === true && showConnectForm ? h('button', { type: 'button', disabled: busy,
2278
2320
  onClick: () => { if (window.confirm('断开当前设备与 ANT 的连接?本机 ANT 凭证和模型设置将被清除,团队服务地址会保留。')) void disconnect() },
2279
2321
  style: secondaryButtonStyle }, '断开当前设备') : null,
2280
- allowLocalCleanup ? h('section', { style: { ...panelStyle, padding: 14, gap: 9 } },
2322
+ allowLocalCleanup ? h('section', { style: { ...settingsPanelStyle, padding: 14, gap: 9 } },
2281
2323
  h('p', { style: mutedTextStyle }, savedDeviceId()
2282
2324
  ? `已保存的设备编号:${savedDeviceId()}。请交给原团队管理员核对。`
2283
2325
  : '本机无法确认旧设备编号。请让原团队管理员按成员查看设备清单,勿用新编号猜测。'),
@@ -2295,7 +2337,7 @@ window.__ModuleLoader__.load({
2295
2337
  }, style: secondaryButtonStyle }, '复制设备编号'))) : null,
2296
2338
  message ? h('p', { role: 'status', style: mutedTextStyle }, message) : null)
2297
2339
 
2298
- const modelPanel = h('section', { style: { ...panelStyle, display: activeTab === 'models' ? 'grid' : 'none' } },
2340
+ const modelPanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'models' ? 'grid' : 'none' } },
2299
2341
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 12 } },
2300
2342
  h('div', null,
2301
2343
  h('h3', { style: sectionTitleStyle }, '团队模型'),
@@ -2324,7 +2366,9 @@ window.__ModuleLoader__.load({
2324
2366
  installing: '正在安装', done: '需重启 DSH', current: '已是最新', checking: '正在检查', none: '尚未发布',
2325
2367
  }
2326
2368
  const updateStatusNeedsDetails = ['artifact-missing', 'revoked', 'migration-required', 'unknown', 'failed', 'installing', 'done']
2327
- const updateVersionSummary = bundleUpdate.currentVersion && bundleRelease?.version
2369
+ const updateVersionSummary = bundleUpdate.state === 'available'
2370
+ ? `可更新至 ${bundleRelease?.version || '最新版本'}`
2371
+ : updateStatusNeedsDetails.includes(bundleUpdate.state) ? '' : bundleUpdate.currentVersion && bundleRelease?.version
2328
2372
  ? bundleUpdate.currentVersion === bundleRelease.version
2329
2373
  ? `当前版本 ${bundleUpdate.currentVersion} · 已是最新`
2330
2374
  : `当前版本 ${bundleUpdate.currentVersion} · 最新版本 ${bundleRelease.version}`
@@ -2332,7 +2376,7 @@ window.__ModuleLoader__.load({
2332
2376
  : bundleRelease?.version ? `最新版本 ${bundleRelease.version}` : ''
2333
2377
  const showReleaseNotes = canCheckUpdate && bundleRelease?.version && bundleRelease.release_notes
2334
2378
  && ['current', 'available', 'artifact-missing'].includes(bundleUpdate.state)
2335
- const updatePanel = h('section', { style: { ...panelStyle, display: activeTab === 'updates' ? 'grid' : 'none' } },
2379
+ const updatePanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'updates' ? 'grid' : 'none' } },
2336
2380
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 12 } },
2337
2381
  h('div', null,
2338
2382
  h('h3', { style: sectionTitleStyle }, '关于 ANT'),
@@ -2342,8 +2386,7 @@ window.__ModuleLoader__.load({
2342
2386
  ? 'var(--dsw-alias-state-error-primary)' : mutedTextStyle.color } },
2343
2387
  updateStatusLabels[bundleUpdate.state] || '等待检查')),
2344
2388
  updateVersionSummary ? h('p', { style: { ...mutedTextStyle, color: 'var(--dsw-alias-label-primary)', fontWeight: 550 } }, updateVersionSummary) : null,
2345
- showReleaseNotes ? h('section', { style: { display: 'grid', gap: 6, padding: 12, borderRadius: 8,
2346
- backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
2389
+ showReleaseNotes ? h('section', { style: { ...infoNoticeStyle, padding: 12 } },
2347
2390
  h('strong', { style: { fontSize: 14, lineHeight: 1.4 } }, '本版更新'),
2348
2391
  h('p', { style: mutedTextStyle }, bundleRelease.release_notes)) : null,
2349
2392
  ['incompatible', 'unknown'].includes(serviceCompatibility.state) ? h('p', { role: 'status', style: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-wendao/ant",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "ANT (AI-native Teams) connects a DeepSeek Harness Desktop profile to team identity and approved models.",
5
5
  "type": "module",
6
6
  "scripts": {