@ai-wendao/ant 0.4.7 → 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 +23 -19
  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 } }, '由团队管理员提供服务地址;管理员可在控制台管理成员、模型和协作设置。')),
@@ -388,8 +394,8 @@ window.__ModuleLoader__.load({
388
394
  : activeTab === 'connection' ? h('button', { type: 'button', onClick: () => selectSettingsTab('bot-chat'),
389
395
  style: secondaryButtonStyle }, '设置或管理机器人') : null),
390
396
  h('div', { style: { position: 'sticky', top: 0, zIndex: 8, display: 'grid', gap: 8, padding: '6px 0',
391
- backgroundColor: 'var(--dsw-alias-bg-module-platform)' } },
392
- pluginAlerts.length ? h('section', { role: 'alert', style: { ...panelStyle,
397
+ backgroundColor: 'var(--dsw-alias-bg-base)' } },
398
+ pluginAlerts.length ? h('section', { role: 'alert', style: { ...settingsPanelStyle,
393
399
  borderColor: 'var(--dsw-alias-label-danger, #d44)', maxHeight: '28vh', overflowY: 'auto' } },
394
400
  h('h3', { style: sectionTitleStyle }, '已安装插件存在安全撤回公告'),
395
401
  ...pluginAlerts.map((plugin) => h('p', { key: plugin.id, style: mutedTextStyle },
@@ -426,8 +432,8 @@ window.__ModuleLoader__.load({
426
432
  onKeyDown: (event) => moveSettingsTabFocus(event, index), onClick: () => selectSettingsTab(tab),
427
433
  style: { ...secondaryButtonStyle, minHeight: 38, padding: '7px 12px', whiteSpace: 'nowrap',
428
434
  borderRadius: '8px 8px 0 0', color: activeTab === tab ? 'var(--dsw-alias-state-business-primary)' : secondaryButtonStyle.color,
429
- borderBottom: activeTab === tab ? '2px solid var(--dsw-alias-state-business-primary)' : secondaryButtonStyle.border,
430
- 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',
431
437
  } }, tab === 'updates' && updateNeedsAttention ? `${label} · ${updateSummary.state === 'available' ? '有新版' : '需处理'}` : label)))),
432
438
  h('div', { id: 'ant-settings-content', role: 'tabpanel', 'aria-labelledby': `ant-settings-tab-${activeTab}` },
433
439
  teamServicePanel,
@@ -753,7 +759,7 @@ window.__ModuleLoader__.load({
753
759
  h('button', { type: 'button', 'aria-current': state === '当前' ? 'step' : undefined,
754
760
  onClick: () => goToSetupStep(index), style: { width: '100%', minHeight: 70, display: 'grid', gap: 3,
755
761
  padding: '8px 10px', textAlign: 'left', color: mutedTextStyle.color,
756
- backgroundColor: 'var(--dsw-alias-bg-module-platform)', cursor: 'pointer',
762
+ backgroundColor: 'var(--dsw-alias-bg-layer-1)', cursor: 'pointer',
757
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)'}`,
758
764
  borderRadius: 0 } },
759
765
  h('span', { style: { display: 'flex', justifyContent: 'space-between', gap: 6, alignItems: 'center' } },
@@ -766,7 +772,7 @@ window.__ModuleLoader__.load({
766
772
  h('strong', null, '机器人和聊天范围'),
767
773
  h('div', { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 240px), 1fr))', gap: 8 } },
768
774
  h('div', { style: { display: 'grid', gap: 5, padding: 10, borderRadius: 8,
769
- backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
775
+ border: '1px solid var(--dsw-alias-border-l2)', backgroundColor: 'var(--dsw-alias-bg-layer-1)' } },
770
776
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
771
777
  h('label', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
772
778
  h('input', { type: 'checkbox', checked: dmChatEnabled,
@@ -777,7 +783,7 @@ window.__ModuleLoader__.load({
777
783
  h('span', { style: { ...mutedTextStyle, whiteSpace: 'nowrap' } }, dmChatStatus)),
778
784
  h('p', { style: mutedTextStyle }, dmChatDescription)),
779
785
  h('div', { style: { display: 'grid', gap: 5, padding: 10, borderRadius: 8,
780
- backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
786
+ border: '1px solid var(--dsw-alias-border-l2)', backgroundColor: 'var(--dsw-alias-bg-layer-1)' } },
781
787
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
782
788
  h('label', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
783
789
  h('input', { type: 'checkbox', checked: Boolean(selectedChatGroup?.chat_enabled),
@@ -932,7 +938,7 @@ window.__ModuleLoader__.load({
932
938
  } catch (error) { setMessage(error.message) }
933
939
  finally { setBusy(false) }
934
940
  }
935
- return h('section', { style: { ...panelStyle,
941
+ return h('section', { style: { ...settingsPanelStyle,
936
942
  display: ['bot-chat', 'capability', 'local'].includes(activeTab) ? 'grid' : 'none' },
937
943
  'aria-label': '协作机器人与开放能力' },
938
944
  message ? h('p', { role: 'status', style: mutedTextStyle }, message) : null,
@@ -1207,7 +1213,7 @@ window.__ModuleLoader__.load({
1207
1213
  h('option', { value: 1 }, '1 天'), h('option', { value: 7 }, '7 天'), h('option', { value: 30 }, '30 天')))),
1208
1214
  ),
1209
1215
  h('aside', { id: 'ant-authorization-review', role: 'region', 'aria-label': '开放前复核', tabIndex: -1,
1210
- style: { ...panelStyle, padding: 14, gap: 10,
1216
+ style: { ...settingsPanelStyle, padding: 14, gap: 10,
1211
1217
  position: 'sticky', top: 12, alignSelf: 'start' } },
1212
1218
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
1213
1219
  h('h4', { style: sectionTitleStyle }, '开放前复核'),
@@ -1230,7 +1236,7 @@ window.__ModuleLoader__.load({
1230
1236
  h('button', { type: 'submit', form: 'ant-capability-create-form', disabled: busy || Boolean(cardBlockReason),
1231
1237
  style: { ...primaryButtonStyle, width: '100%' } }, '确认并开放能力'))))),
1232
1238
  h('div', { role: 'region', 'aria-label': '本机处理设置', style: { display: activeTab === 'local' ? 'grid' : 'none', gap: 12 } },
1233
- h('section', { style: { ...panelStyle, padding: 14 } },
1239
+ h('section', { style: { ...settingsPanelStyle, padding: 14 } },
1234
1240
  h('strong', null, 'Gitea 本机凭据'),
1235
1241
  h('p', { style: mutedTextStyle }, tokenConfigured
1236
1242
  ? '只读访问令牌已保存在这台 DSH 的安全凭据中;不会同步到 ANT 服务端或发送给执行器。'
@@ -2279,7 +2285,7 @@ window.__ModuleLoader__.load({
2279
2285
  backgroundColor: 'var(--dsw-alias-bg-layer-2)', color: 'var(--dsw-alias-label-secondary)', fontSize: 12 } },
2280
2286
  `${model.protocol === 'anthropic' ? 'Anthropic' : 'OpenAI'} 协议`),
2281
2287
  h('span', { style: { ...mutedTextStyle, textAlign: 'right' } }, '已同步到 DSH')))
2282
- const connectionPanel = h('section', { style: { ...panelStyle, display: activeTab === 'connection' ? 'grid' : 'none' } },
2288
+ const connectionPanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'connection' ? 'grid' : 'none' } },
2283
2289
  h('div', null,
2284
2290
  h('h3', { style: sectionTitleStyle }, 'ANT 团队账号'),
2285
2291
  h('p', { style: { ...mutedTextStyle, marginTop: 4 } }, '邮箱验证建立这台 DSH 的成员凭证;断开后会清除此设备凭证和同步的模型设置。')),
@@ -2287,8 +2293,7 @@ window.__ModuleLoader__.load({
2287
2293
  ? '本机有 ANT 凭证,但尚未确认它绑定的团队;请完成上方的绑定检查。'
2288
2294
  : credentialConfigured === true ? 'DSH 已安全保存此设备的 ANT 团队凭证。'
2289
2295
  : credentialConfigured === false ? '验证工作邮箱后即可连接团队服务。' : '正在检查 ANT 连接状态…'),
2290
- h('div', { role: 'note', style: { display: 'grid', gap: 3, padding: '9px 11px', borderRadius: 8,
2291
- backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
2296
+ h('div', { role: 'note', style: infoNoticeStyle },
2292
2297
  h('strong', { style: { fontSize: 13, fontWeight: 600 } }, '配置保存范围'),
2293
2298
  h('p', { style: mutedTextStyle }, '团队模型与能力授权由 ANT 管理;成员凭证、Gitea 令牌、本机缓存和任务记录保存在这台 DSH。')),
2294
2299
  serviceCompatibility.state !== 'idle' ? h('p', { role: 'status', style: { ...mutedTextStyle,
@@ -2314,7 +2319,7 @@ window.__ModuleLoader__.load({
2314
2319
  credentialConfigured === true && showConnectForm ? h('button', { type: 'button', disabled: busy,
2315
2320
  onClick: () => { if (window.confirm('断开当前设备与 ANT 的连接?本机 ANT 凭证和模型设置将被清除,团队服务地址会保留。')) void disconnect() },
2316
2321
  style: secondaryButtonStyle }, '断开当前设备') : null,
2317
- allowLocalCleanup ? h('section', { style: { ...panelStyle, padding: 14, gap: 9 } },
2322
+ allowLocalCleanup ? h('section', { style: { ...settingsPanelStyle, padding: 14, gap: 9 } },
2318
2323
  h('p', { style: mutedTextStyle }, savedDeviceId()
2319
2324
  ? `已保存的设备编号:${savedDeviceId()}。请交给原团队管理员核对。`
2320
2325
  : '本机无法确认旧设备编号。请让原团队管理员按成员查看设备清单,勿用新编号猜测。'),
@@ -2332,7 +2337,7 @@ window.__ModuleLoader__.load({
2332
2337
  }, style: secondaryButtonStyle }, '复制设备编号'))) : null,
2333
2338
  message ? h('p', { role: 'status', style: mutedTextStyle }, message) : null)
2334
2339
 
2335
- const modelPanel = h('section', { style: { ...panelStyle, display: activeTab === 'models' ? 'grid' : 'none' } },
2340
+ const modelPanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'models' ? 'grid' : 'none' } },
2336
2341
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 12 } },
2337
2342
  h('div', null,
2338
2343
  h('h3', { style: sectionTitleStyle }, '团队模型'),
@@ -2371,7 +2376,7 @@ window.__ModuleLoader__.load({
2371
2376
  : bundleRelease?.version ? `最新版本 ${bundleRelease.version}` : ''
2372
2377
  const showReleaseNotes = canCheckUpdate && bundleRelease?.version && bundleRelease.release_notes
2373
2378
  && ['current', 'available', 'artifact-missing'].includes(bundleUpdate.state)
2374
- const updatePanel = h('section', { style: { ...panelStyle, display: activeTab === 'updates' ? 'grid' : 'none' } },
2379
+ const updatePanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'updates' ? 'grid' : 'none' } },
2375
2380
  h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 12 } },
2376
2381
  h('div', null,
2377
2382
  h('h3', { style: sectionTitleStyle }, '关于 ANT'),
@@ -2381,8 +2386,7 @@ window.__ModuleLoader__.load({
2381
2386
  ? 'var(--dsw-alias-state-error-primary)' : mutedTextStyle.color } },
2382
2387
  updateStatusLabels[bundleUpdate.state] || '等待检查')),
2383
2388
  updateVersionSummary ? h('p', { style: { ...mutedTextStyle, color: 'var(--dsw-alias-label-primary)', fontWeight: 550 } }, updateVersionSummary) : null,
2384
- showReleaseNotes ? h('section', { style: { display: 'grid', gap: 6, padding: 12, borderRadius: 8,
2385
- backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
2389
+ showReleaseNotes ? h('section', { style: { ...infoNoticeStyle, padding: 12 } },
2386
2390
  h('strong', { style: { fontSize: 14, lineHeight: 1.4 } }, '本版更新'),
2387
2391
  h('p', { style: mutedTextStyle }, bundleRelease.release_notes)) : null,
2388
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.7",
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": {