@xmanrui/dsh-im 2.0.0 → 2.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmanrui/dsh-im",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "把九种 IM 机器人和公网 AI Office 接入本机 DeepSeek Harness。 Connect nine IM channels and a public AI Office to a local DeepSeek Harness.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -450,7 +450,7 @@ const CSS = String.raw`
450
450
  .bxf-connectedFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); }
451
451
  .bxf-healthSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; }
452
452
  .bxf-healthSummary[data-error="true"] { color: var(--bxf-error); }
453
- .bxf-botActions { flex: none; flex-wrap: nowrap; gap: 8px; margin-top: 0; justify-content: flex-end; }
453
+ .bxf-botActions { flex: none; width: 100%; flex-wrap: wrap; gap: 8px; margin-top: 0; justify-content: flex-end; }
454
454
  .bxf-botActions .bxf-button { flex: none; white-space: nowrap; }
455
455
  .bxf-botActions .bxf-repairButton { color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 35%, var(--dsw-alias-border-l2, #dee0e3)); }
456
456
  .bxf-botActions .bxf-repairButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); }
@@ -206,9 +206,9 @@ const CSS = String.raw`
206
206
  .dim-directoryPickerActions button:disabled { cursor: not-allowed; opacity: .52; }
207
207
  .dim-panel .dim-cardSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font: inherit; font-size: 12px; font-weight: 400; line-height: normal; }
208
208
  .dim-panel .dim-cardFooterLayout { min-width: 0; width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
209
- .dim-panel .dim-cardFooterLayout > .dim-cardActions { align-self: flex-end; }
209
+ .dim-panel .dim-cardFooterLayout > .dim-cardActions { align-self: stretch; }
210
210
  .dim-panel .dim-cardFeedback { width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f7f8fa); font: inherit; font-size: 12px; font-weight: 400; line-height: 18px; overflow-wrap: anywhere; white-space: normal; }
211
- .dim-panel .dim-cardActions { flex: none; display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; margin: 0 0 0 auto; }
211
+ .dim-panel .dim-cardActions { flex: none; width: 100%; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 0; }
212
212
  .dim-panel .dim-cardActions .dim-cardAction { flex: none; min-height: 32px; padding: 0 11px; 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: 13px; font-weight: 560; line-height: normal; white-space: nowrap; }
213
213
  .dim-panel .dim-cardActions .dim-cardAction:hover:not(:disabled) { border-color: #aeb3bb; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
214
214
  .dim-panel .dim-cardActions .dim-cardAction[data-kind="danger"] { color: var(--dsw-alias-state-error-primary, #d54941); }
@@ -37,6 +37,18 @@ export function createImHostPlugin(internals = {}) {
37
37
  const startDiscord = internals.applyDiscord ?? applyDiscord;
38
38
  const startOffice = internals.applyOffice ?? applyOffice;
39
39
  const startWhatsapp = internals.applyWhatsapp ?? applyWhatsapp;
40
+ const channels = [
41
+ ['feishu', startFeishu],
42
+ ['weixin', startWeixin],
43
+ ['dingtalk', startDingtalk],
44
+ ['wecom', startWecom],
45
+ ['qq', startQq],
46
+ ['slack', startSlack],
47
+ ['telegram', startTelegram],
48
+ ['discord', startDiscord],
49
+ ['whatsapp', startWhatsapp],
50
+ ['office', startOffice],
51
+ ];
40
52
  return Object.freeze({
41
53
  name,
42
54
  inject,
@@ -49,16 +61,21 @@ export function createImHostPlugin(internals = {}) {
49
61
  } else {
50
62
  installOutboundArtifactTool(ctx);
51
63
  }
52
- await startFeishu(ctx, channelConfig(config, 'feishu'));
53
- await startWeixin(ctx, channelConfig(config, 'weixin'));
54
- await startDingtalk(ctx, channelConfig(config, 'dingtalk'));
55
- await startWecom(ctx, channelConfig(config, 'wecom'));
56
- await startQq(ctx, channelConfig(config, 'qq'));
57
- await startSlack(ctx, channelConfig(config, 'slack'));
58
- await startTelegram(ctx, channelConfig(config, 'telegram'));
59
- await startDiscord(ctx, channelConfig(config, 'discord'));
60
- await startWhatsapp(ctx, channelConfig(config, 'whatsapp'));
61
- await startOffice(ctx, channelConfig(config, 'office'));
64
+ const logger = typeof ctx?.logger === 'function'
65
+ ? ctx.logger(name)
66
+ : (ctx?.logger ?? console);
67
+ const failures = [];
68
+ for (const [channel, start] of channels) {
69
+ try {
70
+ await start(ctx, channelConfig(config, channel));
71
+ } catch (error) {
72
+ failures.push(error);
73
+ logger.error?.(`[dsh-im] failed to activate ${channel}; continuing with the remaining channels`, error);
74
+ }
75
+ }
76
+ if (failures.length === channels.length) {
77
+ throw new AggregateError(failures, 'dsh-im failed to activate every channel');
78
+ }
62
79
  },
63
80
  });
64
81
  }