@xmanrui/dsh-im 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PROACTIVE_DELIVERY.en.md +321 -0
- package/PROACTIVE_DELIVERY.md +321 -0
- package/README.en.md +11 -5
- package/README.md +11 -5
- package/lib/client.js +1200 -110
- package/lib/index.js +229 -229
- package/package.json +4 -1
- package/plugin-src/client/channel-card-meta.js +44 -0
- package/plugin-src/client/channels/dingtalk/index.js +16 -8
- package/plugin-src/client/channels/feishu/index.js +17 -9
- package/plugin-src/client/channels/qq/index.js +16 -8
- package/plugin-src/client/channels/shared/token-channel.js +16 -8
- package/plugin-src/client/channels/wecom/index.js +16 -8
- package/plugin-src/client/channels/weixin/index.js +16 -8
- package/plugin-src/client/channels/whatsapp/index.js +16 -8
- package/plugin-src/client/delivery-settings.js +749 -0
- package/plugin-src/client/i18n.js +82 -0
- package/plugin-src/client/index.js +59 -22
- package/plugin-src/client/styles.js +72 -0
- package/plugin-src/host/channels/dingtalk/index.mjs +3 -0
- package/plugin-src/host/channels/dingtalk/production.mjs +4 -0
- package/plugin-src/host/channels/discord/index.mjs +6 -1
- package/plugin-src/host/channels/feishu/index.mjs +3 -0
- package/plugin-src/host/channels/feishu/production.mjs +4 -0
- package/plugin-src/host/channels/qq/index.mjs +6 -1
- package/plugin-src/host/channels/qq/production.mjs +2 -0
- package/plugin-src/host/channels/shared/production.mjs +7 -0
- package/plugin-src/host/channels/slack/index.mjs +6 -1
- package/plugin-src/host/channels/slack/production.mjs +4 -0
- package/plugin-src/host/channels/telegram/index.mjs +6 -1
- package/plugin-src/host/channels/wecom/index.mjs +6 -1
- package/plugin-src/host/channels/wecom/production.mjs +4 -0
- package/plugin-src/host/channels/weixin/index.mjs +3 -0
- package/plugin-src/host/channels/weixin/production.mjs +4 -0
- package/plugin-src/host/channels/whatsapp/index.mjs +6 -1
- package/plugin-src/host/channels/whatsapp/production.mjs +4 -0
- package/plugin-src/host/delivery-adapter.mjs +179 -0
- package/plugin-src/host/delivery-http.mjs +132 -0
- package/plugin-src/host/delivery-rpc.mjs +158 -0
- package/plugin-src/host/delivery-service.mjs +224 -0
- package/plugin-src/host/delivery-suggestions.mjs +135 -0
- package/plugin-src/host/index.mjs +32 -5
- package/scripts/verify-package.mjs +3 -0
- package/src/channels/dingtalk/dingtalk-api.mjs +33 -0
- package/src/channels/dingtalk/dingtalk-bridge.mjs +2 -2
- package/src/channels/dingtalk/dingtalk-controller.mjs +14 -0
- package/src/channels/dingtalk/dingtalk-runtime.mjs +39 -0
- package/src/channels/discord/discord-runtime.mjs +16 -0
- package/src/channels/feishu/bridge.mjs +4 -4
- package/src/channels/feishu/feishu-cards.mjs +4 -4
- package/src/channels/feishu/feishu-runtime.mjs +35 -0
- package/src/channels/feishu/multi-bot-controller.mjs +15 -0
- package/src/channels/qq/qq-bridge.mjs +2 -2
- package/src/channels/qq/qq-controller.mjs +14 -0
- package/src/channels/qq/qq-runtime.mjs +23 -0
- package/src/channels/shared/bot-workspace-store.mjs +192 -6
- package/src/channels/shared/i18n-en/feishu.mjs +6 -2
- package/src/channels/shared/i18n-en/shared-a.mjs +4 -0
- package/src/channels/shared/preset-command.mjs +2 -2
- package/src/channels/shared/text-harness-bridge.mjs +7 -2
- package/src/channels/shared/token-bot-controller.mjs +16 -0
- package/src/channels/shared/workspace-command.mjs +1 -1
- package/src/channels/slack/slack-controller.mjs +14 -0
- package/src/channels/slack/slack-runtime.mjs +24 -0
- package/src/channels/telegram/telegram-runtime.mjs +26 -0
- package/src/channels/wecom/state-store.mjs +4 -0
- package/src/channels/wecom/wecom-bridge.mjs +2 -2
- package/src/channels/wecom/wecom-controller.mjs +14 -0
- package/src/channels/wecom/wecom-runtime.mjs +21 -0
- package/src/channels/weixin/weixin-bridge.mjs +2 -2
- package/src/channels/weixin/weixin-controller.mjs +14 -0
- package/src/channels/weixin/weixin-runtime.mjs +24 -0
- package/src/channels/whatsapp/whatsapp-controller.mjs +14 -0
- package/src/channels/whatsapp/whatsapp-runtime.mjs +19 -0
|
@@ -6,6 +6,7 @@ const EN = Object.freeze({
|
|
|
6
6
|
'$locale': 'en',
|
|
7
7
|
'IM机器人': 'IM bots',
|
|
8
8
|
'IM机器人设置': 'IM bot settings',
|
|
9
|
+
'更多机器人设置': 'More bot settings',
|
|
9
10
|
'IM 渠道': 'IM channels',
|
|
10
11
|
'让 DeepSeek Harness 触手可及': 'Connecting DeepSeek Harness',
|
|
11
12
|
'当前版本': 'Current version',
|
|
@@ -673,6 +674,87 @@ const EN = Object.freeze({
|
|
|
673
674
|
'WhatsApp 服务没有返回有效的扫码任务': 'WhatsApp did not return a valid setup attempt',
|
|
674
675
|
'WhatsApp 服务没有返回有效的机器人列表': 'WhatsApp did not return a valid account list',
|
|
675
676
|
'用于关联 WhatsApp 设备的一次性二维码': 'One-time QR code for linking a WhatsApp device',
|
|
677
|
+
'用户': 'User',
|
|
678
|
+
'微信用户 ID': 'WeChat user ID',
|
|
679
|
+
'填写接收消息的用户 ID': 'Enter the recipient user ID',
|
|
680
|
+
'私聊': 'Direct message',
|
|
681
|
+
'群聊': 'Group',
|
|
682
|
+
'群 Chat ID': 'Group Chat ID',
|
|
683
|
+
'用户 ID': 'User ID',
|
|
684
|
+
'填写钉钉用户 ID': 'Enter the DingTalk user ID',
|
|
685
|
+
'群 Open Conversation ID': 'Group Open Conversation ID',
|
|
686
|
+
'填写企业微信用户 ID': 'Enter the WeCom user ID',
|
|
687
|
+
'填写群 chatid': 'Enter the group chatid',
|
|
688
|
+
'单聊': 'Direct message',
|
|
689
|
+
'用户 Open ID': 'User Open ID',
|
|
690
|
+
'填写 user_openid': 'Enter the user_openid',
|
|
691
|
+
'群 Open ID': 'Group Open ID',
|
|
692
|
+
'填写 group_openid': 'Enter the group_openid',
|
|
693
|
+
'会话': 'Conversation',
|
|
694
|
+
'线程': 'Thread',
|
|
695
|
+
'Thread 时间戳': 'Thread timestamp',
|
|
696
|
+
'聊天': 'Chat',
|
|
697
|
+
'话题': 'Topic',
|
|
698
|
+
'频道或私信': 'Channel or DM',
|
|
699
|
+
'填写可发消息的 Channel ID': 'Enter a Channel ID the bot can message',
|
|
700
|
+
'用户 JID': 'User JID',
|
|
701
|
+
'群 JID': 'Group JID',
|
|
702
|
+
'请求失败,请稍后重试。': 'Request failed. Try again later.',
|
|
703
|
+
'当前浏览器不支持自动复制,请手动选择复制。': 'Automatic copy is unavailable. Select and copy the value manually.',
|
|
704
|
+
'目标保存失败,请检查后重试。': 'Could not save the target. Check it and try again.',
|
|
705
|
+
'无法生成未占用的 Target ID,请重试。': 'Could not generate an unused Target ID. Try again.',
|
|
706
|
+
'编辑投递目标': 'Edit delivery target',
|
|
707
|
+
'新建投递目标': 'New delivery target',
|
|
708
|
+
'已从会话自动填入目标信息;确认后再保存。': 'Target details were filled from the conversation. Review them before saving.',
|
|
709
|
+
'请手动填写从对应平台取得的原生标识。': 'Enter the native identifier from the platform manually.',
|
|
710
|
+
'例如 daily-report': 'For example, daily-report',
|
|
711
|
+
'使用大小写字母、数字、点、下划线、冒号、@ 或连字符。': 'Use letters, numbers, dots, underscores, colons, @, or hyphens.',
|
|
712
|
+
'显示名称(可选)': 'Display name (optional)',
|
|
713
|
+
'例如 每日汇报群': 'For example, Daily reports',
|
|
714
|
+
'目标类型': 'Target type',
|
|
715
|
+
'保存目标': 'Save target',
|
|
716
|
+
'请先完成投递目标读取': 'Wait for delivery targets to finish loading',
|
|
717
|
+
'从已聊过的会话选择': 'Choose from conversations',
|
|
718
|
+
'已聊会话': 'Conversation',
|
|
719
|
+
'从会话选择targetID': 'Select a targetID from conversations',
|
|
720
|
+
'选择后会自动填写目标信息和调用别名,确认后再保存。': 'Selecting a conversation fills the target details and call alias. Review them before saving.',
|
|
721
|
+
'正在刷新…': 'Refreshing…',
|
|
722
|
+
'刷新': 'Refresh',
|
|
723
|
+
'正在读取已聊会话…': 'Loading known conversations…',
|
|
724
|
+
'无法读取已聊会话,请稍后重试。': 'Could not load known conversations. Try again later.',
|
|
725
|
+
'还没有可选择的会话': 'No conversations to choose from',
|
|
726
|
+
'先在对应平台与机器人聊一条消息,再刷新。': 'Send the bot a message on the platform, then refresh.',
|
|
727
|
+
'已添加': 'Added',
|
|
728
|
+
'手动填写(高级)': 'Enter manually (advanced)',
|
|
729
|
+
'测试消息已发送,请到目标会话确认。': 'Test message sent. Confirm it in the target conversation.',
|
|
730
|
+
'测试发送失败,请稍后重试。': 'Test delivery failed. Try again later.',
|
|
731
|
+
'已复制调用参数': 'Call parameters copied',
|
|
732
|
+
'复制失败。': 'Copy failed.',
|
|
733
|
+
'删除失败,请稍后重试。': 'Could not delete the target. Try again later.',
|
|
734
|
+
'复制调用参数': 'Copy call parameters',
|
|
735
|
+
'机器人离线时不可发送测试消息': 'Test delivery is unavailable while the bot is offline',
|
|
736
|
+
'测试投递目标': 'Test delivery target',
|
|
737
|
+
'测试': 'Test',
|
|
738
|
+
'编辑': 'Edit',
|
|
739
|
+
'删除': 'Delete',
|
|
740
|
+
'删除 ': 'Delete ',
|
|
741
|
+
'?使用这个 targetId 的外部调用将返回 unknown-target。': '? External calls using this targetId will return unknown-target.',
|
|
742
|
+
'正在删除…': 'Deleting…',
|
|
743
|
+
'确认删除': 'Delete target',
|
|
744
|
+
'投递目标设置暂不可用。': 'Delivery target settings are unavailable.',
|
|
745
|
+
'无法读取投递目标,请稍后重试。': 'Could not load delivery targets. Try again later.',
|
|
746
|
+
'← 返回机器人列表': '← Back to bots',
|
|
747
|
+
'使用文档': 'User guide',
|
|
748
|
+
'打开主动投递使用文档': 'Open the proactive delivery guide',
|
|
749
|
+
'当前渠道暂不支持投递目标。': 'Delivery targets are not supported for this channel.',
|
|
750
|
+
'已复制 Bot ID': 'Bot ID copied',
|
|
751
|
+
'复制': 'Copy',
|
|
752
|
+
'投递目标': 'Delivery targets',
|
|
753
|
+
'机器人当前离线;仍可配置目标,恢复连接后再测试。': 'The bot is offline. You can still configure targets and test them after reconnection.',
|
|
754
|
+
'新建目标': 'New target',
|
|
755
|
+
'正在读取投递目标…': 'Loading delivery targets…',
|
|
756
|
+
'尚未配置投递目标': 'No delivery targets yet',
|
|
757
|
+
'点击“新建目标”可从已聊过的会话选择,也可手动填写。': 'Select New target to choose a conversation or enter the details manually.',
|
|
676
758
|
});
|
|
677
759
|
|
|
678
760
|
export const en = EN;
|
|
@@ -43,6 +43,11 @@ import { WHATSAPP_RPC_CHANNEL } from './channels/whatsapp/api.js';
|
|
|
43
43
|
import { WhatsappSettingsTab } from './channels/whatsapp/index.js';
|
|
44
44
|
import { installWhatsappStyles } from './channels/whatsapp/styles.js';
|
|
45
45
|
import { en, h, IM_LOCALE_NAMESPACE, setImTranslator, zh } from './i18n.js';
|
|
46
|
+
import { BotSettingsContext } from './channel-card-meta.js';
|
|
47
|
+
import {
|
|
48
|
+
DELIVERY_RPC_CHANNEL,
|
|
49
|
+
DeliveryTargetSettingsPage,
|
|
50
|
+
} from './delivery-settings.js';
|
|
46
51
|
import {
|
|
47
52
|
createLoopbackAwareRpcCalls,
|
|
48
53
|
replacePageLocation,
|
|
@@ -55,6 +60,16 @@ export const name = 'im-settings';
|
|
|
55
60
|
export const inject = ['slots', 'connection', 'locale', 'workspaces'];
|
|
56
61
|
export const IM_PLUGIN_VERSION = manifest.version;
|
|
57
62
|
|
|
63
|
+
function callWorkspaceDirectoryApi(ctx, method, ...args) {
|
|
64
|
+
// Current DSH owns directory operations on uiWorkspace; legacy Hosts keep them on workspaces.
|
|
65
|
+
const uiWorkspace = typeof ctx.get === 'function' ? ctx.get('uiWorkspace') : undefined;
|
|
66
|
+
const service = typeof uiWorkspace?.[method] === 'function' ? uiWorkspace : ctx.workspaces;
|
|
67
|
+
if (typeof service?.[method] !== 'function') {
|
|
68
|
+
throw new Error('无法读取目录,请重试。');
|
|
69
|
+
}
|
|
70
|
+
return service[method](...args);
|
|
71
|
+
}
|
|
72
|
+
|
|
58
73
|
const CHANNELS = Object.freeze([
|
|
59
74
|
{ id: 'weixin', label: '微信' },
|
|
60
75
|
{ id: 'feishu', label: '飞书' },
|
|
@@ -157,6 +172,7 @@ export function IMSettingsTab({
|
|
|
157
172
|
whatsappRpcCall,
|
|
158
173
|
officeRpcCall,
|
|
159
174
|
updateRpcCall,
|
|
175
|
+
deliveryRpcCall,
|
|
160
176
|
workspaceDirectoryPicker,
|
|
161
177
|
browserLocation = globalThis.location,
|
|
162
178
|
navigateToRecoveryUrl = replacePageLocation,
|
|
@@ -164,6 +180,7 @@ export function IMSettingsTab({
|
|
|
164
180
|
const [selected, setSelected] = React.useState('weixin');
|
|
165
181
|
const [loopbackRecovery, setLoopbackRecovery] = React.useState(null);
|
|
166
182
|
const [runningVersion, setRunningVersion] = React.useState(IM_PLUGIN_VERSION);
|
|
183
|
+
const [deliverySettings, setDeliverySettings] = React.useState(null);
|
|
167
184
|
const githubTooltipId = React.useId();
|
|
168
185
|
const active = CHANNELS.find((channel) => channel.id === selected) ?? CHANNELS[0];
|
|
169
186
|
const reportLoopbackRecovery = React.useCallback((recovery) => {
|
|
@@ -184,6 +201,7 @@ export function IMSettingsTab({
|
|
|
184
201
|
whatsappRpcCall,
|
|
185
202
|
officeRpcCall,
|
|
186
203
|
updateRpcCall,
|
|
204
|
+
deliveryRpcCall,
|
|
187
205
|
}, {
|
|
188
206
|
location: browserLocation,
|
|
189
207
|
onRecovery: reportLoopbackRecovery,
|
|
@@ -191,6 +209,7 @@ export function IMSettingsTab({
|
|
|
191
209
|
browserLocation,
|
|
192
210
|
dingtalkRpcCall,
|
|
193
211
|
discordRpcCall,
|
|
212
|
+
deliveryRpcCall,
|
|
194
213
|
feishuRpcCall,
|
|
195
214
|
officeRpcCall,
|
|
196
215
|
qqRpcCall,
|
|
@@ -202,6 +221,9 @@ export function IMSettingsTab({
|
|
|
202
221
|
weixinRpcCall,
|
|
203
222
|
whatsappRpcCall,
|
|
204
223
|
]);
|
|
224
|
+
const botSettingsContext = React.useMemo(() => Object.freeze({
|
|
225
|
+
openBotSettings: setDeliverySettings,
|
|
226
|
+
}), []);
|
|
205
227
|
return h(WorkspaceDirectoryPickerContext.Provider, { value: workspaceDirectoryPicker },
|
|
206
228
|
h('section', { className: 'dim-page', 'aria-label': 'IM机器人设置' },
|
|
207
229
|
h('header', { className: 'dim-title' },
|
|
@@ -243,7 +265,10 @@ export function IMSettingsTab({
|
|
|
243
265
|
className: 'dim-channel',
|
|
244
266
|
'aria-selected': channel.id === active.id,
|
|
245
267
|
'aria-controls': `dim-panel-${channel.id}`,
|
|
246
|
-
onClick: () =>
|
|
268
|
+
onClick: () => {
|
|
269
|
+
setSelected(channel.id);
|
|
270
|
+
setDeliverySettings(null);
|
|
271
|
+
},
|
|
247
272
|
},
|
|
248
273
|
h(ChannelLogo, { channel: channel.id }),
|
|
249
274
|
h('span', { className: 'dim-channelCopy' },
|
|
@@ -263,25 +288,33 @@ export function IMSettingsTab({
|
|
|
263
288
|
onNavigate: navigateToRecoveryUrl,
|
|
264
289
|
})
|
|
265
290
|
: null,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
291
|
+
h(BotSettingsContext.Provider, { value: botSettingsContext },
|
|
292
|
+
deliverySettings?.channel === active.id
|
|
293
|
+
? h(DeliveryTargetSettingsPage, {
|
|
294
|
+
channel: active.id,
|
|
295
|
+
account: deliverySettings,
|
|
296
|
+
rpcCall: rpcCalls.deliveryRpcCall,
|
|
297
|
+
onBack: () => setDeliverySettings(null),
|
|
298
|
+
})
|
|
299
|
+
: active.id === 'weixin'
|
|
300
|
+
? h(WeixinSettingsTab, { rpcCall: rpcCalls.weixinRpcCall })
|
|
301
|
+
: active.id === 'feishu'
|
|
302
|
+
? h(FeishuSettingsTab, { rpcCall: rpcCalls.feishuRpcCall })
|
|
303
|
+
: active.id === 'dingtalk'
|
|
304
|
+
? h(DingtalkSettingsTab, { rpcCall: rpcCalls.dingtalkRpcCall })
|
|
305
|
+
: active.id === 'wecom'
|
|
306
|
+
? h(WecomSettingsTab, { rpcCall: rpcCalls.wecomRpcCall })
|
|
307
|
+
: active.id === 'qq'
|
|
308
|
+
? h(QqSettingsTab, { rpcCall: rpcCalls.qqRpcCall })
|
|
309
|
+
: active.id === 'slack'
|
|
310
|
+
? h(SlackSettingsTab, { rpcCall: rpcCalls.slackRpcCall })
|
|
311
|
+
: active.id === 'telegram'
|
|
312
|
+
? h(TelegramSettingsTab, { rpcCall: rpcCalls.telegramRpcCall })
|
|
313
|
+
: active.id === 'discord'
|
|
314
|
+
? h(DiscordSettingsTab, { rpcCall: rpcCalls.discordRpcCall })
|
|
315
|
+
: active.id === 'whatsapp'
|
|
316
|
+
? h(WhatsappSettingsTab, { rpcCall: rpcCalls.whatsappRpcCall })
|
|
317
|
+
: h(OfficeSettingsTab, { rpcCall: rpcCalls.officeRpcCall }))),
|
|
285
318
|
),
|
|
286
319
|
));
|
|
287
320
|
}
|
|
@@ -334,9 +367,12 @@ export function apply(ctx) {
|
|
|
334
367
|
ctx.connection.rpc.call(OFFICE_RPC_CHANNEL, endpoint, payload, signal);
|
|
335
368
|
const updateRpcCall = (endpoint, payload, signal) =>
|
|
336
369
|
ctx.connection.rpc.call(UPDATE_RPC_CHANNEL, endpoint, payload, signal);
|
|
370
|
+
const deliveryRpcCall = (endpoint, payload, signal) =>
|
|
371
|
+
ctx.connection.rpc.call(DELIVERY_RPC_CHANNEL, endpoint, payload, signal);
|
|
337
372
|
const workspaceDirectoryPicker = Object.freeze({
|
|
338
|
-
listDirectory: (path, signal) =>
|
|
339
|
-
|
|
373
|
+
listDirectory: (path, signal) =>
|
|
374
|
+
callWorkspaceDirectoryApi(ctx, 'listDirectory', path, signal),
|
|
375
|
+
pickDirectory: () => callWorkspaceDirectoryApi(ctx, 'pickDirectory'),
|
|
340
376
|
});
|
|
341
377
|
|
|
342
378
|
ctx.slots.inject('settings.section', () => ctx.slots.register({
|
|
@@ -357,6 +393,7 @@ export function apply(ctx) {
|
|
|
357
393
|
whatsappRpcCall,
|
|
358
394
|
officeRpcCall,
|
|
359
395
|
updateRpcCall,
|
|
396
|
+
deliveryRpcCall,
|
|
360
397
|
workspaceDirectoryPicker,
|
|
361
398
|
}),
|
|
362
399
|
}, IMSettingsTab));
|
|
@@ -350,6 +350,7 @@ const CSS = String.raw`
|
|
|
350
350
|
.dim-panel .dim-botName { min-width: 0; }
|
|
351
351
|
.dim-panel .dim-botName h3 { overflow: hidden; margin: 0; color: var(--dsw-alias-label-primary, #1f2329); font-size: 15px; font-weight: 650; line-height: normal; text-overflow: ellipsis; white-space: nowrap; }
|
|
352
352
|
.dim-panel .dim-botName p { overflow: hidden; margin: 4px 0 0; color: var(--dsw-alias-label-secondary, #646a73); font: 12px ui-monospace, SFMono-Regular, monospace; line-height: normal; text-overflow: ellipsis; white-space: nowrap; }
|
|
353
|
+
.dim-panel .dim-botCardTools { flex: none; display: flex; align-items: flex-start; gap: 8px; }
|
|
353
354
|
.dim-panel .dim-botHealthGroup { min-width: 0; max-width: 100%; flex: none; display: grid; justify-items: end; gap: 5px; }
|
|
354
355
|
.dim-panel .dim-botCard .dim-botHealth { flex: none; min-height: 0; display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; border-radius: 0; color: var(--dsw-alias-label-secondary, #646a73); background: transparent; font: inherit; font-size: 12px; font-weight: 400; line-height: normal; white-space: nowrap; }
|
|
355
356
|
.dim-panel .dim-lastChecked { display: inline-flex; align-items: baseline; gap: 4px; color: var(--dsw-alias-label-tertiary, #8f959e); font: inherit; font-size: 11px; font-weight: 400; line-height: normal; white-space: nowrap; }
|
|
@@ -357,6 +358,68 @@ const CSS = String.raw`
|
|
|
357
358
|
.dim-panel .dim-botCard .dim-healthDot[data-tone="success"] { background: var(--dsw-alias-state-success-primary, #20a162); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsw-alias-state-success-primary, #20a162) 14%, transparent); }
|
|
358
359
|
.dim-panel .dim-botCard .dim-healthDot[data-tone="warning"] { background: var(--dsw-alias-state-warn-primary, #d97706); }
|
|
359
360
|
.dim-panel .dim-botCard .dim-healthDot[data-tone="error"] { background: var(--dsw-alias-state-error-primary, #d54941); }
|
|
361
|
+
.dim-botSettingsAction { position: relative; flex: none; display: inline-flex; }
|
|
362
|
+
.dim-botSettingsButton { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--dsw-alias-label-secondary, #646a73); background: transparent; cursor: pointer; transition: color .15s ease, background .15s ease; }
|
|
363
|
+
.dim-botSettingsButton:hover { color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-interactive-bg-hover, #eef0f3); }
|
|
364
|
+
.dim-botSettingsButton:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary, #3370ff); outline-offset: 2px; }
|
|
365
|
+
.dim-botSettingsTooltip { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: max-content; padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
|
|
366
|
+
.dim-botSettingsAction:hover .dim-botSettingsTooltip, .dim-botSettingsAction:focus-within .dim-botSettingsTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
|
|
367
|
+
.dim-deliveryPage { min-width: 0; display: grid; gap: 14px; }
|
|
368
|
+
.dim-deliveryHeader { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
|
|
369
|
+
.dim-deliveryHeaderMeta { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-align: right; }
|
|
370
|
+
.dim-deliveryDocsLink { min-height: 30px; flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 7px; color: var(--dsw-alias-state-business-primary, #3370ff); font-size: 12px; line-height: 18px; text-decoration: none; white-space: nowrap; }
|
|
371
|
+
.dim-deliveryDocsLink:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #3370ff) 8%, transparent); }
|
|
372
|
+
.dim-deliveryDocsLink:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary, #3370ff); outline-offset: 2px; }
|
|
373
|
+
.dim-deliveryButton { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 12px; line-height: 18px; cursor: pointer; }
|
|
374
|
+
.dim-deliveryButton:hover:not(:disabled) { border-color: #aeb3bb; background: var(--dsw-alias-interactive-bg-hover, #eef0f3); }
|
|
375
|
+
.dim-deliveryButton:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary, #3370ff); outline-offset: 2px; }
|
|
376
|
+
.dim-deliveryButton:disabled { opacity: .5; cursor: not-allowed; }
|
|
377
|
+
.dim-deliveryButton[data-kind="primary"] { border-color: var(--dsw-alias-state-business-primary, #3370ff); color: #fff; background: var(--dsw-alias-state-business-primary, #3370ff); }
|
|
378
|
+
.dim-deliveryButton[data-kind="danger"] { color: var(--dsw-alias-state-error-primary, #d54941); }
|
|
379
|
+
.dim-deliveryBack { flex: none; border-color: transparent; background: transparent; }
|
|
380
|
+
.dim-deliveryIdentity, .dim-deliveryTargets { min-width: 0; padding: 16px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 12px; background: var(--dsw-alias-bg-layer-3, #fff); }
|
|
381
|
+
.dim-deliveryBotName, .dim-deliverySectionHeading h3 { min-width: 0; overflow: hidden; margin: 0; font-size: 15px; line-height: 22px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
|
|
382
|
+
.dim-deliveryIdentity > div:first-child p, .dim-deliverySectionHeading p { margin: 2px 0 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; }
|
|
383
|
+
.dim-deliveryBotId { min-width: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
|
|
384
|
+
.dim-deliveryBotId > span { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; }
|
|
385
|
+
.dim-deliveryBotId code { min-width: 0; overflow: hidden; font: 12px/18px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
|
|
386
|
+
.dim-deliverySectionHeading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
|
|
387
|
+
.dim-deliveryState { margin-top: 14px; padding: 24px 16px; border: 1px dashed var(--dsw-alias-border-l2, #dfe1e5); border-radius: 10px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 19px; text-align: center; }
|
|
388
|
+
.dim-deliveryState p { margin: 5px 0; }
|
|
389
|
+
.dim-deliveryEmpty strong { color: var(--dsw-alias-label-primary, #1f2329); font-size: 13px; }
|
|
390
|
+
.dim-targetList { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
|
|
391
|
+
.dim-targetRow { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 8px 14px; padding: 13px; border: 1px solid var(--dsw-alias-border-l1, #eef0f3); border-radius: 10px; background: var(--dsw-alias-bg-layer-1, #fff); }
|
|
392
|
+
.dim-targetSummary { min-width: 0; }
|
|
393
|
+
.dim-targetTitle { min-width: 0; display: flex; align-items: center; gap: 7px; }
|
|
394
|
+
.dim-targetTitle strong { overflow: hidden; font-size: 13px; line-height: 20px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
|
|
395
|
+
.dim-targetTitle span { flex: none; padding: 1px 6px; border-radius: 5px; color: var(--dsw-alias-state-business-primary, #3370ff); background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #3370ff) 9%, transparent); font-size: 10px; line-height: 16px; }
|
|
396
|
+
.dim-targetSummary code { display: block; overflow: hidden; margin-top: 3px; color: var(--dsw-alias-label-secondary, #646a73); font: 11px/17px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
|
|
397
|
+
.dim-targetActions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
|
|
398
|
+
.dim-targetFeedback { grid-column: 1 / -1; margin: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 17px; }
|
|
399
|
+
.dim-targetFeedback[data-tone="success"] { color: var(--dsw-alias-state-success-primary, #20a162); }
|
|
400
|
+
.dim-targetFeedback[data-tone="error"], .dim-targetFormError { color: var(--dsw-alias-state-error-primary, #d54941); }
|
|
401
|
+
.dim-targetDeleteConfirm { grid-column: 1 / -1; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--dsw-alias-state-error-primary, #d54941) 7%, var(--dsw-alias-bg-layer-1, #fff)); }
|
|
402
|
+
.dim-targetDeleteConfirm p { margin: 0 0 8px; font-size: 12px; line-height: 18px; }
|
|
403
|
+
.dim-targetSuggestions { margin-top: 14px; padding: 14px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 10px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
|
|
404
|
+
.dim-targetSuggestionHeading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
|
|
405
|
+
.dim-targetSuggestionHeading h3 { margin: 0; font-size: 14px; line-height: 21px; }
|
|
406
|
+
.dim-targetSuggestionHeading p { margin: 2px 0 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 17px; }
|
|
407
|
+
.dim-targetSuggestionState { margin-top: 12px; padding: 18px 12px; border: 1px dashed var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; text-align: center; }
|
|
408
|
+
.dim-targetSuggestionState p { margin: 4px 0; }
|
|
409
|
+
.dim-targetSuggestionState strong { color: var(--dsw-alias-label-primary, #1f2329); }
|
|
410
|
+
.dim-targetSuggestionField { min-width: 0; display: grid; gap: 5px; margin-top: 12px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 16px; }
|
|
411
|
+
.dim-targetSuggestionField select { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 12px; cursor: pointer; }
|
|
412
|
+
.dim-targetSuggestionField select:focus { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary, #3370ff) 28%, transparent); border-color: var(--dsw-alias-state-business-primary, #3370ff); }
|
|
413
|
+
.dim-targetForm { margin-top: 14px; padding: 14px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 10px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
|
|
414
|
+
.dim-targetFormHeading h3 { margin: 0; font-size: 14px; line-height: 21px; }
|
|
415
|
+
.dim-targetFormHeading p { margin: 2px 0 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 17px; }
|
|
416
|
+
.dim-targetFormGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; margin-top: 12px; }
|
|
417
|
+
.dim-targetField { min-width: 0; display: grid; align-content: start; gap: 5px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 16px; }
|
|
418
|
+
.dim-targetField input, .dim-targetField select { width: 100%; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 12px; }
|
|
419
|
+
.dim-targetField input:focus, .dim-targetField select:focus { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary, #3370ff) 28%, transparent); border-color: var(--dsw-alias-state-business-primary, #3370ff); }
|
|
420
|
+
.dim-targetField input[readonly] { color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
|
|
421
|
+
.dim-targetFormError { margin: 10px 0 0; font-size: 12px; line-height: 18px; }
|
|
422
|
+
.dim-targetFormActions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
|
|
360
423
|
.dim-panel .dim-botCard .dim-cardFooter { margin-top: 0; }
|
|
361
424
|
.dim-panel .ddt-headingCopy { display: none; }
|
|
362
425
|
.dim-panel .ddt-qrFrame, .dim-panel .ddt-countdown { width: min(270px, 100%); }
|
|
@@ -376,6 +439,10 @@ const CSS = String.raw`
|
|
|
376
439
|
.dim-panel .ddt-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 24px; }
|
|
377
440
|
.dim-panel .ddt-qrColumn { width: 100%; min-width: 0; }
|
|
378
441
|
.dim-panel .ddt-qrCopy { width: 100%; min-width: 0; overflow-wrap: anywhere; }
|
|
442
|
+
.dim-targetRow { grid-template-columns: minmax(0, 1fr); }
|
|
443
|
+
.dim-targetActions { justify-content: flex-start; }
|
|
444
|
+
.dim-targetFormGrid { grid-template-columns: minmax(0, 1fr); }
|
|
445
|
+
.dim-targetSuggestionHeading { align-items: stretch; flex-direction: column; }
|
|
379
446
|
}
|
|
380
447
|
@media (max-width: 840px) {
|
|
381
448
|
.dim-title { align-items: flex-start; }
|
|
@@ -399,6 +466,11 @@ const CSS = String.raw`
|
|
|
399
466
|
.dim-rail { grid-template-columns: minmax(0, 1fr); }
|
|
400
467
|
.dim-loopbackRecovery { align-items: stretch; flex-direction: column; gap: 12px; }
|
|
401
468
|
.dim-loopbackRecoveryAction { width: 100%; }
|
|
469
|
+
.dim-deliveryHeader, .dim-deliverySectionHeading { align-items: stretch; flex-direction: column; }
|
|
470
|
+
.dim-deliveryHeaderMeta { justify-content: space-between; text-align: left; }
|
|
471
|
+
.dim-deliveryBotId { grid-template-columns: minmax(0, 1fr) max-content; }
|
|
472
|
+
.dim-deliveryBotId > span { grid-column: 1 / -1; }
|
|
473
|
+
.dim-targetActions .dim-deliveryButton { flex: 1 1 auto; }
|
|
402
474
|
.dim-directoryPickerBackdrop { padding: 10px; }
|
|
403
475
|
.dim-directoryPicker { height: calc(100vh - 20px); min-height: 0; border-radius: 14px; }
|
|
404
476
|
.dim-directoryPickerHeader { padding: 18px 17px 14px; }
|
|
@@ -10,6 +10,8 @@ export async function apply(ctx, config = {}) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const production = await createProductionController(ctx, config, config.internals);
|
|
13
|
+
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
|
|
14
|
+
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
|
|
13
15
|
const disposeRpc = installDingtalkRpc(
|
|
14
16
|
ctx,
|
|
15
17
|
production.controller,
|
|
@@ -17,6 +19,7 @@ export async function apply(ctx, config = {}) {
|
|
|
17
19
|
config.rpcAuthority,
|
|
18
20
|
);
|
|
19
21
|
ctx.effect(() => async () => {
|
|
22
|
+
await unregisterDelivery?.();
|
|
20
23
|
await production.close();
|
|
21
24
|
}, 'dsh-dingtalk: close bot connections');
|
|
22
25
|
return disposeRpc;
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
observeBotWorkspaceRemovals,
|
|
16
16
|
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
|
|
17
17
|
import { listAgentPresetCatalog } from '../../../../src/channels/shared/agent-preset.mjs';
|
|
18
|
+
import { createDeliveryAdapter } from '../../delivery-adapter.mjs';
|
|
18
19
|
import { createConnectionSupervisor } from './connection-supervisor.mjs';
|
|
19
20
|
import { createHarnessCommandExecutor } from '../../harness-command-executor.mjs';
|
|
20
21
|
import { harnessConnection } from '../../harness-connection.mjs';
|
|
@@ -149,6 +150,9 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|
|
149
150
|
}).start();
|
|
150
151
|
return {
|
|
151
152
|
controller,
|
|
153
|
+
deliveryAdapter: createDeliveryAdapter({
|
|
154
|
+
channel: 'dingtalk', workspaces, coreController, stateFor,
|
|
155
|
+
}),
|
|
152
156
|
ready: supervisor.ready,
|
|
153
157
|
async close() {
|
|
154
158
|
await supervisor.close();
|
|
@@ -9,8 +9,13 @@ export async function apply(ctx, config = {}) {
|
|
|
9
9
|
return installDiscordRpc(ctx, config.controller, config.rpcAuthority);
|
|
10
10
|
}
|
|
11
11
|
const production = await createProductionController(ctx, config, config.internals ?? {});
|
|
12
|
+
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
|
|
13
|
+
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
|
|
12
14
|
const disposeRpc = installDiscordRpc(ctx, production.controller, config.rpcAuthority);
|
|
13
|
-
ctx.effect(() => async () =>
|
|
15
|
+
ctx.effect(() => async () => {
|
|
16
|
+
await unregisterDelivery?.();
|
|
17
|
+
await production.close();
|
|
18
|
+
}, 'dsh-im: close Discord bot connections');
|
|
14
19
|
return disposeRpc;
|
|
15
20
|
}
|
|
16
21
|
|
|
@@ -29,6 +29,8 @@ export async function apply(ctx, config = {}) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const production = await createProductionController(ctx, config);
|
|
32
|
+
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
|
|
33
|
+
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
|
|
32
34
|
const disposeRpc = installFeishuRpc(
|
|
33
35
|
ctx,
|
|
34
36
|
production.controller,
|
|
@@ -36,6 +38,7 @@ export async function apply(ctx, config = {}) {
|
|
|
36
38
|
config.rpcAuthority,
|
|
37
39
|
);
|
|
38
40
|
ctx.effect(() => async () => {
|
|
41
|
+
await unregisterDelivery?.();
|
|
39
42
|
await production.close();
|
|
40
43
|
}, 'dsh-feishu: close controller and live connection');
|
|
41
44
|
return disposeRpc;
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
observeBotWorkspaceRemovals,
|
|
24
24
|
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
|
|
25
25
|
import { listAgentPresetCatalog } from '../../../../src/channels/shared/agent-preset.mjs';
|
|
26
|
+
import { createDeliveryAdapter } from '../../delivery-adapter.mjs';
|
|
26
27
|
|
|
27
28
|
function webSocketProxyUrl(env) {
|
|
28
29
|
for (const key of ['https_proxy', 'HTTPS_PROXY', 'http_proxy', 'HTTP_PROXY']) {
|
|
@@ -204,6 +205,9 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|
|
204
205
|
}).start();
|
|
205
206
|
return {
|
|
206
207
|
controller,
|
|
208
|
+
deliveryAdapter: createDeliveryAdapter({
|
|
209
|
+
channel: 'feishu', workspaces, coreController, stateFor: stateForBotId,
|
|
210
|
+
}),
|
|
207
211
|
ready: supervisor.ready,
|
|
208
212
|
async close() {
|
|
209
213
|
await supervisor.close();
|
|
@@ -9,13 +9,18 @@ export async function apply(ctx, config = {}) {
|
|
|
9
9
|
return installQqRpc(ctx, config.controller, config.rpcOptions, config.rpcAuthority);
|
|
10
10
|
}
|
|
11
11
|
const production = await createProductionController(ctx, config, config.internals);
|
|
12
|
+
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
|
|
13
|
+
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
|
|
12
14
|
const disposeRpc = installQqRpc(
|
|
13
15
|
ctx,
|
|
14
16
|
production.controller,
|
|
15
17
|
config.rpcOptions,
|
|
16
18
|
config.rpcAuthority,
|
|
17
19
|
);
|
|
18
|
-
ctx.effect(() => async () =>
|
|
20
|
+
ctx.effect(() => async () => {
|
|
21
|
+
await unregisterDelivery?.();
|
|
22
|
+
await production.close();
|
|
23
|
+
}, 'dsh-im: close QQ bot connections');
|
|
19
24
|
return disposeRpc;
|
|
20
25
|
}
|
|
21
26
|
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
observeBotWorkspaceRemovals,
|
|
16
16
|
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
|
|
17
17
|
import { listAgentPresetCatalog } from '../../../../src/channels/shared/agent-preset.mjs';
|
|
18
|
+
import { createDeliveryAdapter } from '../../delivery-adapter.mjs';
|
|
18
19
|
import { createConnectionSupervisor } from './connection-supervisor.mjs';
|
|
19
20
|
import { createHarnessCommandExecutor } from '../../harness-command-executor.mjs';
|
|
20
21
|
import { harnessConnection } from '../../harness-connection.mjs';
|
|
@@ -139,6 +140,7 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|
|
139
140
|
}).start();
|
|
140
141
|
return {
|
|
141
142
|
controller,
|
|
143
|
+
deliveryAdapter: createDeliveryAdapter({ channel: 'qq', workspaces, coreController, stateFor }),
|
|
142
144
|
ready: supervisor.ready,
|
|
143
145
|
async close() {
|
|
144
146
|
await supervisor.close();
|
|
@@ -13,6 +13,10 @@ import {
|
|
|
13
13
|
observeBotWorkspaceRemovals,
|
|
14
14
|
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
|
|
15
15
|
import { listAgentPresetCatalog } from '../../../../src/channels/shared/agent-preset.mjs';
|
|
16
|
+
import {
|
|
17
|
+
createDeliveryAdapter,
|
|
18
|
+
supportsDeliveryChannel,
|
|
19
|
+
} from '../../delivery-adapter.mjs';
|
|
16
20
|
|
|
17
21
|
export function pluginPaths(config, channel) {
|
|
18
22
|
const dshHome = resolve(config.dshHome ?? process.env.DSH_HOME ?? join(homedir(), '.dsh'));
|
|
@@ -142,6 +146,9 @@ export async function createTokenProductionController(ctx, config, internals, de
|
|
|
142
146
|
}).start();
|
|
143
147
|
return {
|
|
144
148
|
controller,
|
|
149
|
+
...(supportsDeliveryChannel(channel) ? {
|
|
150
|
+
deliveryAdapter: createDeliveryAdapter({ channel, workspaces, coreController, stateFor }),
|
|
151
|
+
} : {}),
|
|
145
152
|
ready: supervisor.ready,
|
|
146
153
|
async close() {
|
|
147
154
|
await supervisor.close();
|
|
@@ -7,8 +7,13 @@ export const inject = ['connection', 'credentials', 'typertGateway'];
|
|
|
7
7
|
export async function apply(ctx, config = {}) {
|
|
8
8
|
if (config?.controller) return installSlackRpc(ctx, config.controller, config.rpcAuthority);
|
|
9
9
|
const production = await createProductionController(ctx, config, config.internals ?? {});
|
|
10
|
+
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
|
|
11
|
+
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
|
|
10
12
|
const disposeRpc = installSlackRpc(ctx, production.controller, config.rpcAuthority);
|
|
11
|
-
ctx.effect(() => async () =>
|
|
13
|
+
ctx.effect(() => async () => {
|
|
14
|
+
await unregisterDelivery?.();
|
|
15
|
+
await production.close();
|
|
16
|
+
}, 'dsh-im: close Slack bot connections');
|
|
12
17
|
return disposeRpc;
|
|
13
18
|
}
|
|
14
19
|
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
observeBotWorkspaceRemovals,
|
|
14
14
|
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
|
|
15
15
|
import { listAgentPresetCatalog } from '../../../../src/channels/shared/agent-preset.mjs';
|
|
16
|
+
import { createDeliveryAdapter } from '../../delivery-adapter.mjs';
|
|
16
17
|
import { createTokenConnectionSupervisor } from '../shared/connection-supervisor.mjs';
|
|
17
18
|
import { pluginPaths } from '../shared/production.mjs';
|
|
18
19
|
import { createHarnessCommandExecutor } from '../../harness-command-executor.mjs';
|
|
@@ -129,6 +130,9 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|
|
129
130
|
}).start();
|
|
130
131
|
return {
|
|
131
132
|
controller,
|
|
133
|
+
deliveryAdapter: createDeliveryAdapter({
|
|
134
|
+
channel: 'slack', workspaces, coreController, stateFor,
|
|
135
|
+
}),
|
|
132
136
|
ready: supervisor.ready,
|
|
133
137
|
async close() {
|
|
134
138
|
await supervisor.close();
|
|
@@ -9,8 +9,13 @@ export async function apply(ctx, config = {}) {
|
|
|
9
9
|
return installTelegramRpc(ctx, config.controller, config.rpcAuthority);
|
|
10
10
|
}
|
|
11
11
|
const production = await createProductionController(ctx, config, config.internals ?? {});
|
|
12
|
+
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
|
|
13
|
+
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
|
|
12
14
|
const disposeRpc = installTelegramRpc(ctx, production.controller, config.rpcAuthority);
|
|
13
|
-
ctx.effect(() => async () =>
|
|
15
|
+
ctx.effect(() => async () => {
|
|
16
|
+
await unregisterDelivery?.();
|
|
17
|
+
await production.close();
|
|
18
|
+
}, 'dsh-im: close Telegram bot connections');
|
|
14
19
|
return disposeRpc;
|
|
15
20
|
}
|
|
16
21
|
|
|
@@ -9,13 +9,18 @@ export async function apply(ctx, config = {}) {
|
|
|
9
9
|
return installWecomRpc(ctx, config.controller, config.rpcOptions, config.rpcAuthority);
|
|
10
10
|
}
|
|
11
11
|
const production = await createProductionController(ctx, config, config.internals);
|
|
12
|
+
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
|
|
13
|
+
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
|
|
12
14
|
const disposeRpc = installWecomRpc(
|
|
13
15
|
ctx,
|
|
14
16
|
production.controller,
|
|
15
17
|
config.rpcOptions,
|
|
16
18
|
config.rpcAuthority,
|
|
17
19
|
);
|
|
18
|
-
ctx.effect(() => async () =>
|
|
20
|
+
ctx.effect(() => async () => {
|
|
21
|
+
await unregisterDelivery?.();
|
|
22
|
+
await production.close();
|
|
23
|
+
}, 'dsh-im: close Enterprise WeChat bot connections');
|
|
19
24
|
return disposeRpc;
|
|
20
25
|
}
|
|
21
26
|
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
observeBotWorkspaceRemovals,
|
|
16
16
|
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
|
|
17
17
|
import { listAgentPresetCatalog } from '../../../../src/channels/shared/agent-preset.mjs';
|
|
18
|
+
import { createDeliveryAdapter } from '../../delivery-adapter.mjs';
|
|
18
19
|
import { createConnectionSupervisor } from './connection-supervisor.mjs';
|
|
19
20
|
import { createHarnessCommandExecutor } from '../../harness-command-executor.mjs';
|
|
20
21
|
import { harnessConnection } from '../../harness-connection.mjs';
|
|
@@ -143,6 +144,9 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|
|
143
144
|
}).start();
|
|
144
145
|
return {
|
|
145
146
|
controller,
|
|
147
|
+
deliveryAdapter: createDeliveryAdapter({
|
|
148
|
+
channel: 'wecom', workspaces, coreController, stateFor,
|
|
149
|
+
}),
|
|
146
150
|
ready: supervisor.ready,
|
|
147
151
|
async close() {
|
|
148
152
|
await supervisor.close();
|
|
@@ -10,6 +10,8 @@ export async function apply(ctx, config = {}) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const production = await createProductionController(ctx, config, config.internals);
|
|
13
|
+
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
|
|
14
|
+
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
|
|
13
15
|
const disposeRpc = installWeixinRpc(
|
|
14
16
|
ctx,
|
|
15
17
|
production.controller,
|
|
@@ -17,6 +19,7 @@ export async function apply(ctx, config = {}) {
|
|
|
17
19
|
config.rpcAuthority,
|
|
18
20
|
);
|
|
19
21
|
ctx.effect(() => async () => {
|
|
22
|
+
await unregisterDelivery?.();
|
|
20
23
|
await production.close();
|
|
21
24
|
}, 'dsh-weixin: close account connections');
|
|
22
25
|
return disposeRpc;
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
observeBotWorkspaceRemovals,
|
|
19
19
|
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
|
|
20
20
|
import { listAgentPresetCatalog } from '../../../../src/channels/shared/agent-preset.mjs';
|
|
21
|
+
import { createDeliveryAdapter } from '../../delivery-adapter.mjs';
|
|
21
22
|
import { createConnectionSupervisor } from './connection-supervisor.mjs';
|
|
22
23
|
import { createHarnessCommandExecutor } from '../../harness-command-executor.mjs';
|
|
23
24
|
import { harnessConnection } from '../../harness-connection.mjs';
|
|
@@ -146,6 +147,9 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|
|
146
147
|
}).start();
|
|
147
148
|
return {
|
|
148
149
|
controller,
|
|
150
|
+
deliveryAdapter: createDeliveryAdapter({
|
|
151
|
+
channel: 'weixin', workspaces, coreController, stateFor,
|
|
152
|
+
}),
|
|
149
153
|
ready: supervisor.ready,
|
|
150
154
|
async close() {
|
|
151
155
|
await supervisor.close();
|