@ai-wendao/ant 0.4.7 → 0.4.9
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/client.js +68 -51
- 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: { ...
|
|
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-
|
|
392
|
-
pluginAlerts.length ? h('section', { role: 'alert', style: { ...
|
|
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,10 +432,11 @@ 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)' :
|
|
430
|
-
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
|
-
h('div', { id: 'ant-settings-content', role: 'tabpanel', 'aria-labelledby': `ant-settings-tab-${activeTab}
|
|
438
|
+
h('div', { id: 'ant-settings-content', role: 'tabpanel', 'aria-labelledby': `ant-settings-tab-${activeTab}`,
|
|
439
|
+
style: { display: 'grid', gap: activeTab === 'connection' ? 12 : 0 } },
|
|
433
440
|
teamServicePanel,
|
|
434
441
|
h(ModelSyncFooter, { remote, serviceUrl, bindingReady: binding.state === 'ready', activeTab,
|
|
435
442
|
onServiceUrlChange: setServiceUrl, onConnectionChange,
|
|
@@ -651,7 +658,7 @@ window.__ModuleLoader__.load({
|
|
|
651
658
|
const result = await readLocalJsonResponse(response)
|
|
652
659
|
if (!response.ok) throw new Error(result.message || '无法获取身份绑定码。')
|
|
653
660
|
setBindingCode(result.code)
|
|
654
|
-
setMessage('
|
|
661
|
+
setMessage('')
|
|
655
662
|
} catch (error) { setMessage(error.message) }
|
|
656
663
|
finally { setBusy(false) }
|
|
657
664
|
}
|
|
@@ -753,7 +760,7 @@ window.__ModuleLoader__.load({
|
|
|
753
760
|
h('button', { type: 'button', 'aria-current': state === '当前' ? 'step' : undefined,
|
|
754
761
|
onClick: () => goToSetupStep(index), style: { width: '100%', minHeight: 70, display: 'grid', gap: 3,
|
|
755
762
|
padding: '8px 10px', textAlign: 'left', color: mutedTextStyle.color,
|
|
756
|
-
backgroundColor: 'var(--dsw-alias-bg-
|
|
763
|
+
backgroundColor: 'var(--dsw-alias-bg-layer-1)', cursor: 'pointer',
|
|
757
764
|
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
765
|
borderRadius: 0 } },
|
|
759
766
|
h('span', { style: { display: 'flex', justifyContent: 'space-between', gap: 6, alignItems: 'center' } },
|
|
@@ -766,7 +773,7 @@ window.__ModuleLoader__.load({
|
|
|
766
773
|
h('strong', null, '机器人和聊天范围'),
|
|
767
774
|
h('div', { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 240px), 1fr))', gap: 8 } },
|
|
768
775
|
h('div', { style: { display: 'grid', gap: 5, padding: 10, borderRadius: 8,
|
|
769
|
-
backgroundColor: 'var(--dsw-alias-bg-layer-
|
|
776
|
+
border: '1px solid var(--dsw-alias-border-l2)', backgroundColor: 'var(--dsw-alias-bg-layer-1)' } },
|
|
770
777
|
h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
|
|
771
778
|
h('label', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
|
|
772
779
|
h('input', { type: 'checkbox', checked: dmChatEnabled,
|
|
@@ -777,7 +784,7 @@ window.__ModuleLoader__.load({
|
|
|
777
784
|
h('span', { style: { ...mutedTextStyle, whiteSpace: 'nowrap' } }, dmChatStatus)),
|
|
778
785
|
h('p', { style: mutedTextStyle }, dmChatDescription)),
|
|
779
786
|
h('div', { style: { display: 'grid', gap: 5, padding: 10, borderRadius: 8,
|
|
780
|
-
backgroundColor: 'var(--dsw-alias-bg-layer-
|
|
787
|
+
border: '1px solid var(--dsw-alias-border-l2)', backgroundColor: 'var(--dsw-alias-bg-layer-1)' } },
|
|
781
788
|
h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
|
|
782
789
|
h('label', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
|
|
783
790
|
h('input', { type: 'checkbox', checked: Boolean(selectedChatGroup?.chat_enabled),
|
|
@@ -932,7 +939,7 @@ window.__ModuleLoader__.load({
|
|
|
932
939
|
} catch (error) { setMessage(error.message) }
|
|
933
940
|
finally { setBusy(false) }
|
|
934
941
|
}
|
|
935
|
-
return h('section', { style: { ...
|
|
942
|
+
return h('section', { style: { ...settingsPanelStyle,
|
|
936
943
|
display: ['bot-chat', 'capability', 'local'].includes(activeTab) ? 'grid' : 'none' },
|
|
937
944
|
'aria-label': '协作机器人与开放能力' },
|
|
938
945
|
message ? h('p', { role: 'status', style: mutedTextStyle }, message) : null,
|
|
@@ -943,7 +950,8 @@ window.__ModuleLoader__.load({
|
|
|
943
950
|
h('p', { role: 'status', style: mutedTextStyle }, '私聊与群聊可同时开启;每项能力一次只授权给一个私聊或一个群。普通对话不会自动获得读取电脑、调用工具或访问其他群的权限。'),
|
|
944
951
|
loadFailures.length ? h('p', { role: 'status', style: mutedTextStyle },
|
|
945
952
|
`部分协作信息暂时无法读取:${loadFailures.map((path) => loadNames[path]).join('、')}。已读取的信息仍显示,请稍后刷新状态。`) : null,
|
|
946
|
-
h('
|
|
953
|
+
h('div', { style: { display: 'flex', flexWrap: 'wrap', alignItems: 'flex-start', justifyContent: 'space-between', gap: 8 } },
|
|
954
|
+
h('span', { role: 'status', style: { ...mutedTextStyle, flex: '1 1 260px', minWidth: 0 } }, loading ? '正在读取机器人与任务状态…'
|
|
947
955
|
: botLoadError ? '暂时无法读取机器人状态。请刷新后再试。'
|
|
948
956
|
: connectedBots.length === 0 ? '尚未发现已连接的机器人。请先在 DSH-IM 中连接飞书机器人。'
|
|
949
957
|
: selectedBot && !botConnected ? `“${selectedBot.name}”当前离线;请先在 DSH-IM 恢复连接。`
|
|
@@ -959,6 +967,10 @@ window.__ModuleLoader__.load({
|
|
|
959
967
|
: !dmChatEnabled ? `“${selectedBot.name}”已启用协作;私聊已关闭,群聊仍按各自设置工作。`
|
|
960
968
|
: selectedTaskCount === 0 ? `“${selectedBot.name}”已启用协作;下一步开放一项能力。你也可以先私聊自测普通聊天。`
|
|
961
969
|
: `“${selectedBot.name}”已启用协作 · ${selectedTaskCount} 项能力已开放。可以私聊自测。`),
|
|
970
|
+
h('button', { type: 'button', disabled: loading || busy,
|
|
971
|
+
onClick: () => void load().catch((error) => setMessage(error.message)),
|
|
972
|
+
style: { ...secondaryButtonStyle, whiteSpace: 'nowrap' } },
|
|
973
|
+
loading ? '正在刷新…' : '刷新状态')),
|
|
962
974
|
bots.length ? h('label', null, '我的机器人', h('select', { id: 'ant-bot-selector', value: botId,
|
|
963
975
|
onChange: (event) => { setBotId(event.target.value); setGroupId(''); setChatGroupId(''); setBindingCode('');
|
|
964
976
|
setTrustedOrigin(enrolled.find((bot) => bot.bot_id === event.target.value)?.gitea_origin || '') }, style: inputStyle },
|
|
@@ -985,13 +997,29 @@ window.__ModuleLoader__.load({
|
|
|
985
997
|
h('button', { type: 'button', disabled: busy || !trustedOrigin.trim() || (!selectedEnrollmentBound && !botConnected),
|
|
986
998
|
onClick: () => void (selectedEnrollmentBound ? saveTrustedOrigin() : enrollBot()), style: secondaryButtonStyle },
|
|
987
999
|
selectedEnrollmentBound ? '保存可信地址' : botConnected ? '绑定机器人并保存地址' : '先连接机器人'))) : null,
|
|
1000
|
+
selectedBot && selectedEnrollmentBound ? h('div', { role: 'region', 'aria-label': '群任务所有者身份验证',
|
|
1001
|
+
style: { display: 'grid', gap: 8, padding: 10, border: '1px solid var(--dsw-alias-border-l2)', borderRadius: 8,
|
|
1002
|
+
backgroundColor: 'var(--dsw-alias-bg-layer-1)' } },
|
|
1003
|
+
h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
|
|
1004
|
+
h('strong', null, '群任务所有者身份'),
|
|
1005
|
+
h('span', { role: 'status', style: { ...mutedTextStyle, color: selectedEnrollment.owner_bound
|
|
1006
|
+
? 'var(--dsw-alias-state-success-primary)' : 'var(--dsw-alias-state-warning-primary, var(--dsw-alias-label-secondary))' } },
|
|
1007
|
+
selectedEnrollment.owner_bound ? '已绑定' : '尚未绑定')),
|
|
1008
|
+
h('p', { style: mutedTextStyle }, '绑定只针对当前机器人,所有群共用。只有允许群成员请求已开放能力时才需要;普通群聊无需绑定。绑定后,群任务仍需你在目标群按机器人提示确认。'),
|
|
1009
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' } },
|
|
1010
|
+
h('button', { type: 'button', disabled: busy || !botConnected || enrollmentLoadError,
|
|
1011
|
+
onClick: () => void issueBindingCode(), style: secondaryButtonStyle },
|
|
1012
|
+
selectedEnrollment.owner_bound ? '重新获取绑定码' : '获取绑定码'),
|
|
1013
|
+
bindingCode ? h('span', { role: 'status', style: mutedTextStyle },
|
|
1014
|
+
`请你本人私聊“${selectedBot.name}”发送“绑定身份 ${bindingCode}”。绑定码 5 分钟有效。`) : null)) : null,
|
|
988
1015
|
setupStepper,
|
|
989
1016
|
chatScopePanel,
|
|
990
1017
|
selectedEnrollmentBound && botConnected ? h('p', { style: mutedTextStyle },
|
|
991
1018
|
dmChatEnabled
|
|
992
1019
|
? `自测:私聊“${selectedBot.name}”发送“你能做什么”;发起任务后可问“刚才的任务怎么样了”。群聊请先在目标群 @机器人,再开放能力时选择该群。`
|
|
993
1020
|
: '私聊当前已关闭;如要恢复,请在上方开启。群聊请先在目标群 @机器人,再开放能力时选择该群。') : null,
|
|
994
|
-
selectedEnrollmentBound && botConnected ? h('div', {
|
|
1021
|
+
selectedEnrollmentBound && botConnected ? h('div', { role: 'region', 'aria-label': '群聊白名单',
|
|
1022
|
+
style: { display: 'grid', gap: 8 } },
|
|
995
1023
|
h('strong', null, '群聊白名单'),
|
|
996
1024
|
h('span', { role: 'status', style: mutedTextStyle }, groupChatLoadFailed
|
|
997
1025
|
? '群聊列表与当前权限暂时无法读取,请刷新后再更改;仍可填写群 ID。'
|
|
@@ -1014,28 +1042,16 @@ window.__ModuleLoader__.load({
|
|
|
1014
1042
|
onChange: (event) => setChatGroupId(event.target.value.trim()),
|
|
1015
1043
|
placeholder: '输入群 ID', style: inputStyle })),
|
|
1016
1044
|
selectedChatGroup?.chat_enabled && selectedGroupHasTasks ? h('span', { style: mutedTextStyle },
|
|
1017
|
-
'本群还有开放能力;关闭普通聊天前请先停止这些能力。') : null,
|
|
1018
|
-
h('div', { style: { display: 'flex', gap: 8, alignItems: 'center', flexWrap: 'wrap', paddingTop: 4,
|
|
1019
|
-
borderTop: '1px solid var(--dsw-alias-border-l2)' } },
|
|
1020
|
-
h('span', { style: mutedTextStyle }, '群内所有者身份'),
|
|
1021
|
-
h('span', { style: { ...mutedTextStyle, color: selectedEnrollment.owner_bound
|
|
1022
|
-
? 'var(--dsw-alias-state-success-primary)' : 'var(--dsw-alias-state-warning-primary, var(--dsw-alias-label-secondary))' } },
|
|
1023
|
-
selectedEnrollment.owner_bound ? '已绑定' : '尚未绑定'),
|
|
1024
|
-
h('button', { type: 'button', disabled: busy || !chatGroupId.trim(),
|
|
1025
|
-
onClick: () => void issueBindingCode(), style: secondaryButtonStyle },
|
|
1026
|
-
selectedEnrollment.owner_bound ? '重新获取绑定码' : '获取绑定码')),
|
|
1027
|
-
h('span', { style: mutedTextStyle }, '仅当允许群成员发起受限能力时需要;验证后由机器人所有者在群内确认。'),
|
|
1028
|
-
bindingCode ? h('p', { role: 'status', style: mutedTextStyle },
|
|
1029
|
-
`请你本人私聊机器人发送“绑定身份 ${bindingCode}”,再回到群里 @机器人完成确认。`) : null) : null,
|
|
1030
|
-
h('div', { style: { display: 'flex', gap: 8, flexWrap: 'wrap' } },
|
|
1031
|
-
h('button', { type: 'button', onClick: () => { setCreateOpen(true); onSelectTab('capability') },
|
|
1032
|
-
style: primaryButtonStyle }, '开放新能力'),
|
|
1033
|
-
h('button', { type: 'button', onClick: () => { preparePrExample(); onSelectTab('capability') }, style: secondaryButtonStyle }, '使用 PR 差异审查示例'),
|
|
1034
|
-
h('button', { type: 'button', onClick: () => void load().catch((error) => setMessage(error.message)),
|
|
1035
|
-
style: secondaryButtonStyle }, '刷新状态'))),
|
|
1045
|
+
'本群还有开放能力;关闭普通聊天前请先停止这些能力。') : null) : null),
|
|
1036
1046
|
h('div', { id: 'ant-capability-list', role: 'region', 'aria-label': '已开放能力列表', tabIndex: -1,
|
|
1037
1047
|
style: { display: activeTab === 'capability' ? 'grid' : 'none', gap: 12 } },
|
|
1038
|
-
h('
|
|
1048
|
+
h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 10, flexWrap: 'wrap' } },
|
|
1049
|
+
h('h4', { style: sectionTitleStyle }, `我开放的能力 · ${authorizationLoadError ? '暂未读取' : activeCards.length}`),
|
|
1050
|
+
h('div', { role: 'toolbar', 'aria-label': '能力授权操作', style: { display: 'flex', gap: 8, flexWrap: 'wrap' } },
|
|
1051
|
+
h('button', { type: 'button', onClick: () => { setCreateOpen(true); onSelectTab('capability') },
|
|
1052
|
+
style: primaryButtonStyle }, '开放新能力'),
|
|
1053
|
+
h('button', { type: 'button', onClick: () => { preparePrExample(); onSelectTab('capability') },
|
|
1054
|
+
style: secondaryButtonStyle }, '使用 PR 差异审查示例'))),
|
|
1039
1055
|
h('p', { style: mutedTextStyle }, '当前一项能力只能绑定一个范围:私聊,或某一个群。若要给其他群或私聊开放相同任务,目前需分别建立能力卡;它们的请求人和有效期独立。'),
|
|
1040
1056
|
...activeCards.map((card) => {
|
|
1041
1057
|
const expiresAt = Number(card.expires_at) * 1000
|
|
@@ -1207,7 +1223,7 @@ window.__ModuleLoader__.load({
|
|
|
1207
1223
|
h('option', { value: 1 }, '1 天'), h('option', { value: 7 }, '7 天'), h('option', { value: 30 }, '30 天')))),
|
|
1208
1224
|
),
|
|
1209
1225
|
h('aside', { id: 'ant-authorization-review', role: 'region', 'aria-label': '开放前复核', tabIndex: -1,
|
|
1210
|
-
style: { ...
|
|
1226
|
+
style: { ...settingsPanelStyle, padding: 14, gap: 10,
|
|
1211
1227
|
position: 'sticky', top: 12, alignSelf: 'start' } },
|
|
1212
1228
|
h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8 } },
|
|
1213
1229
|
h('h4', { style: sectionTitleStyle }, '开放前复核'),
|
|
@@ -1230,7 +1246,7 @@ window.__ModuleLoader__.load({
|
|
|
1230
1246
|
h('button', { type: 'submit', form: 'ant-capability-create-form', disabled: busy || Boolean(cardBlockReason),
|
|
1231
1247
|
style: { ...primaryButtonStyle, width: '100%' } }, '确认并开放能力'))))),
|
|
1232
1248
|
h('div', { role: 'region', 'aria-label': '本机处理设置', style: { display: activeTab === 'local' ? 'grid' : 'none', gap: 12 } },
|
|
1233
|
-
h('section', { style: { ...
|
|
1249
|
+
h('section', { style: { ...settingsPanelStyle, padding: 14 } },
|
|
1234
1250
|
h('strong', null, 'Gitea 本机凭据'),
|
|
1235
1251
|
h('p', { style: mutedTextStyle }, tokenConfigured
|
|
1236
1252
|
? '只读访问令牌已保存在这台 DSH 的安全凭据中;不会同步到 ANT 服务端或发送给执行器。'
|
|
@@ -1251,18 +1267,21 @@ window.__ModuleLoader__.load({
|
|
|
1251
1267
|
h('button', { type: 'button', onClick: () => void load().catch((error) => setMessage(error.message)), style: secondaryButtonStyle }, '刷新')),
|
|
1252
1268
|
loadFailures.includes('local-settings') ? h('p', { role: 'status', style: mutedTextStyle },
|
|
1253
1269
|
'本机处理设置暂未读取;请刷新后重试。')
|
|
1254
|
-
: h('form', { onSubmit: saveLocalProcessingSettings, style: { display: 'flex', gap:
|
|
1255
|
-
h('label',
|
|
1270
|
+
: h('form', { onSubmit: saveLocalProcessingSettings, style: { display: 'flex', gap: 12, flexWrap: 'wrap', alignItems: 'end' } },
|
|
1271
|
+
h('label', { style: { display: 'grid', gap: 5, flex: '0 1 280px', maxWidth: '100%' } }, '这台电脑最多同时处理',
|
|
1256
1272
|
h('select', { value: localConcurrency == null ? '' : String(localConcurrency),
|
|
1257
|
-
onChange: (event) => setLocalConcurrency(event.target.value), style: inputStyle },
|
|
1273
|
+
onChange: (event) => setLocalConcurrency(event.target.value), style: { ...inputStyle, width: '100%' } },
|
|
1258
1274
|
h('option', { value: '' }, '跟随团队默认'),
|
|
1259
1275
|
...Array.from({ length: 8 }, (_, index) => h('option', { key: index + 1, value: index + 1 }, `${index + 1} 项任务`)))),
|
|
1260
|
-
h('label',
|
|
1261
|
-
|
|
1276
|
+
h('label', { style: { display: 'grid', gap: 5, flex: '0 1 200px', maxWidth: '100%' } },
|
|
1277
|
+
'这台电脑 PR 仓库缓存上限(GiB)',
|
|
1278
|
+
h('input', { 'aria-label': '这台电脑 PR 仓库缓存上限(GiB)', type: 'number', min: 1, max: 100, step: 1, required: true,
|
|
1262
1279
|
value: repositoryCacheLimitGib,
|
|
1263
|
-
onChange: (event) => setRepositoryCacheLimitGib(event.target.value),
|
|
1264
|
-
|
|
1265
|
-
h('button', { disabled: busy, style: secondaryButtonStyle }, '保存本机处理设置')
|
|
1280
|
+
onChange: (event) => setRepositoryCacheLimitGib(event.target.value),
|
|
1281
|
+
style: { ...inputStyle, width: 128, maxWidth: '100%', boxSizing: 'border-box' } })),
|
|
1282
|
+
h('button', { disabled: busy, style: secondaryButtonStyle }, '保存本机处理设置'),
|
|
1283
|
+
h('p', { style: { ...mutedTextStyle, flex: '1 1 100%', margin: 0 } },
|
|
1284
|
+
'默认 10 GiB,范围 1–100 GiB,按长期仓库文件逻辑大小计算(不含临时工作区和文件系统分配开销)。日常不会淘汰仍启用能力的缓存;停用或到期能力会在刷新时回收。单次拉取若实际越界,为恢复预算会清理这项能力的仓库缓存(旧 PR 可重新下载)。')),
|
|
1266
1285
|
h('p', { style: mutedTextStyle }, `本机检测到的执行方:${executors.map((item) => `${item.title}${item.available ? '(可用)' : `(${item.reason || '未启用或未找到'})`}`).join('、') || '暂未读取到'}。只有能力配置下拉框中列出的执行方能接收委托。`))))
|
|
1267
1286
|
}
|
|
1268
1287
|
|
|
@@ -2279,7 +2298,7 @@ window.__ModuleLoader__.load({
|
|
|
2279
2298
|
backgroundColor: 'var(--dsw-alias-bg-layer-2)', color: 'var(--dsw-alias-label-secondary)', fontSize: 12 } },
|
|
2280
2299
|
`${model.protocol === 'anthropic' ? 'Anthropic' : 'OpenAI'} 协议`),
|
|
2281
2300
|
h('span', { style: { ...mutedTextStyle, textAlign: 'right' } }, '已同步到 DSH')))
|
|
2282
|
-
const connectionPanel = h('section', { style: { ...
|
|
2301
|
+
const connectionPanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'connection' ? 'grid' : 'none' } },
|
|
2283
2302
|
h('div', null,
|
|
2284
2303
|
h('h3', { style: sectionTitleStyle }, 'ANT 团队账号'),
|
|
2285
2304
|
h('p', { style: { ...mutedTextStyle, marginTop: 4 } }, '邮箱验证建立这台 DSH 的成员凭证;断开后会清除此设备凭证和同步的模型设置。')),
|
|
@@ -2287,8 +2306,7 @@ window.__ModuleLoader__.load({
|
|
|
2287
2306
|
? '本机有 ANT 凭证,但尚未确认它绑定的团队;请完成上方的绑定检查。'
|
|
2288
2307
|
: credentialConfigured === true ? 'DSH 已安全保存此设备的 ANT 团队凭证。'
|
|
2289
2308
|
: credentialConfigured === false ? '验证工作邮箱后即可连接团队服务。' : '正在检查 ANT 连接状态…'),
|
|
2290
|
-
h('div', { role: 'note', style:
|
|
2291
|
-
backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
|
|
2309
|
+
h('div', { role: 'note', style: infoNoticeStyle },
|
|
2292
2310
|
h('strong', { style: { fontSize: 13, fontWeight: 600 } }, '配置保存范围'),
|
|
2293
2311
|
h('p', { style: mutedTextStyle }, '团队模型与能力授权由 ANT 管理;成员凭证、Gitea 令牌、本机缓存和任务记录保存在这台 DSH。')),
|
|
2294
2312
|
serviceCompatibility.state !== 'idle' ? h('p', { role: 'status', style: { ...mutedTextStyle,
|
|
@@ -2314,7 +2332,7 @@ window.__ModuleLoader__.load({
|
|
|
2314
2332
|
credentialConfigured === true && showConnectForm ? h('button', { type: 'button', disabled: busy,
|
|
2315
2333
|
onClick: () => { if (window.confirm('断开当前设备与 ANT 的连接?本机 ANT 凭证和模型设置将被清除,团队服务地址会保留。')) void disconnect() },
|
|
2316
2334
|
style: secondaryButtonStyle }, '断开当前设备') : null,
|
|
2317
|
-
allowLocalCleanup ? h('section', { style: { ...
|
|
2335
|
+
allowLocalCleanup ? h('section', { style: { ...settingsPanelStyle, padding: 14, gap: 9 } },
|
|
2318
2336
|
h('p', { style: mutedTextStyle }, savedDeviceId()
|
|
2319
2337
|
? `已保存的设备编号:${savedDeviceId()}。请交给原团队管理员核对。`
|
|
2320
2338
|
: '本机无法确认旧设备编号。请让原团队管理员按成员查看设备清单,勿用新编号猜测。'),
|
|
@@ -2332,7 +2350,7 @@ window.__ModuleLoader__.load({
|
|
|
2332
2350
|
}, style: secondaryButtonStyle }, '复制设备编号'))) : null,
|
|
2333
2351
|
message ? h('p', { role: 'status', style: mutedTextStyle }, message) : null)
|
|
2334
2352
|
|
|
2335
|
-
const modelPanel = h('section', { style: { ...
|
|
2353
|
+
const modelPanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'models' ? 'grid' : 'none' } },
|
|
2336
2354
|
h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 12 } },
|
|
2337
2355
|
h('div', null,
|
|
2338
2356
|
h('h3', { style: sectionTitleStyle }, '团队模型'),
|
|
@@ -2371,7 +2389,7 @@ window.__ModuleLoader__.load({
|
|
|
2371
2389
|
: bundleRelease?.version ? `最新版本 ${bundleRelease.version}` : ''
|
|
2372
2390
|
const showReleaseNotes = canCheckUpdate && bundleRelease?.version && bundleRelease.release_notes
|
|
2373
2391
|
&& ['current', 'available', 'artifact-missing'].includes(bundleUpdate.state)
|
|
2374
|
-
const updatePanel = h('section', { style: { ...
|
|
2392
|
+
const updatePanel = h('section', { style: { ...settingsPanelStyle, display: activeTab === 'updates' ? 'grid' : 'none' } },
|
|
2375
2393
|
h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 12 } },
|
|
2376
2394
|
h('div', null,
|
|
2377
2395
|
h('h3', { style: sectionTitleStyle }, '关于 ANT'),
|
|
@@ -2381,8 +2399,7 @@ window.__ModuleLoader__.load({
|
|
|
2381
2399
|
? 'var(--dsw-alias-state-error-primary)' : mutedTextStyle.color } },
|
|
2382
2400
|
updateStatusLabels[bundleUpdate.state] || '等待检查')),
|
|
2383
2401
|
updateVersionSummary ? h('p', { style: { ...mutedTextStyle, color: 'var(--dsw-alias-label-primary)', fontWeight: 550 } }, updateVersionSummary) : null,
|
|
2384
|
-
showReleaseNotes ? h('section', { style: {
|
|
2385
|
-
backgroundColor: 'var(--dsw-alias-bg-layer-2)' } },
|
|
2402
|
+
showReleaseNotes ? h('section', { style: { ...infoNoticeStyle, padding: 12 } },
|
|
2386
2403
|
h('strong', { style: { fontSize: 14, lineHeight: 1.4 } }, '本版更新'),
|
|
2387
2404
|
h('p', { style: mutedTextStyle }, bundleRelease.release_notes)) : null,
|
|
2388
2405
|
['incompatible', 'unknown'].includes(serviceCompatibility.state) ? h('p', { role: 'status', style: {
|