@xmanrui/dsh-im 5.10.0 → 5.11.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/README.en.md +39 -5
- package/README.md +42 -5
- package/bin/dsh-im.mjs +65 -0
- package/docs/client-integration.md +4 -0
- package/lib/client.js +1202 -95
- package/lib/index.js +365 -339
- package/package.json +7 -6
- package/plugin-src/client/access-policy-settings.js +210 -12
- package/plugin-src/client/bot-general-settings.js +44 -3
- package/plugin-src/client/i18n-ru.js +85 -0
- package/plugin-src/client/i18n.js +83 -0
- package/plugin-src/client/im-channels.js +419 -0
- package/plugin-src/client/index.js +33 -1
- package/plugin-src/client/styles.js +7 -7
- package/plugin-src/client/update-panel.js +2 -1
- package/plugin-src/host/channel-list-rpc.mjs +280 -0
- package/plugin-src/host/channels/dingtalk/production.mjs +28 -10
- package/plugin-src/host/channels/dingtalk/rpc.mjs +10 -1
- package/plugin-src/host/channels/feishu/production.mjs +39 -10
- package/plugin-src/host/channels/feishu/rpc.mjs +10 -1
- package/plugin-src/host/channels/matrix/production.mjs +28 -10
- package/plugin-src/host/channels/matrix/rpc.mjs +10 -0
- package/plugin-src/host/channels/qq/production.mjs +30 -11
- package/plugin-src/host/channels/qq/rpc.mjs +10 -1
- package/plugin-src/host/channels/shared/access-policy-production.mjs +9 -0
- package/plugin-src/host/channels/shared/binding-events.mjs +109 -0
- package/plugin-src/host/channels/shared/production.mjs +14 -1
- package/plugin-src/host/channels/shared/reply-content-rpc.mjs +17 -0
- package/plugin-src/host/channels/shared/rpc.mjs +9 -0
- package/plugin-src/host/channels/slack/production.mjs +28 -10
- package/plugin-src/host/channels/slack/rpc.mjs +10 -0
- package/plugin-src/host/channels/telegram/production.mjs +5 -0
- package/plugin-src/host/channels/wecom/production.mjs +28 -10
- package/plugin-src/host/channels/wecom/rpc.mjs +10 -1
- package/plugin-src/host/channels/wecom-app/production.mjs +28 -10
- package/plugin-src/host/channels/wecom-app/rpc.mjs +9 -0
- package/plugin-src/host/channels/weixin/production.mjs +28 -10
- package/plugin-src/host/channels/weixin/rpc.mjs +10 -1
- package/plugin-src/host/channels/whatsapp/production.mjs +28 -10
- package/plugin-src/host/channels/whatsapp/rpc.mjs +10 -1
- package/plugin-src/host/delivery-service.mjs +3 -4
- package/plugin-src/host/delivery-suggestions.mjs +3 -1
- package/plugin-src/host/harness-connection.mjs +2 -1
- package/plugin-src/host/harness-peer.mjs +3 -1
- package/plugin-src/host/index.mjs +8 -1
- package/plugin-src/host/modern-harness-api.mjs +5 -1
- package/plugin-src/host/root-scope.mjs +32 -0
- package/plugin-src/host/session-sync-coordinator.mjs +2 -1
- package/plugin-src/management-rpc.mjs +18 -2
- package/scripts/verify-package.mjs +36 -7
- package/src/channels/dingtalk/dingtalk-bridge.mjs +50 -6
- package/src/channels/dingtalk/state-store.mjs +56 -0
- package/src/channels/discord/discord-api.mjs +2 -1
- package/src/channels/feishu/bridge.mjs +154 -58
- package/src/channels/feishu/feishu-cards.mjs +10 -4
- package/src/channels/feishu/feishu-runtime.mjs +11 -3
- package/src/channels/feishu/message-utils.mjs +106 -30
- package/src/channels/feishu/slash-command-panel.mjs +26 -0
- package/src/channels/feishu/state-store.mjs +14 -0
- package/src/channels/matrix/matrix-api.mjs +2 -1
- package/src/channels/qq/qq-bridge.mjs +105 -14
- package/src/channels/qq/state-store.mjs +13 -1
- package/src/channels/shared/access-policy.mjs +60 -7
- package/src/channels/shared/bot-workspace-store.mjs +155 -3
- package/src/channels/shared/busy-message-dispatcher.mjs +2 -2
- package/src/channels/shared/channel-capabilities.mjs +44 -0
- package/src/channels/shared/command-catalog.mjs +68 -3
- package/src/channels/shared/command-permission.mjs +6 -2
- package/src/channels/shared/conversation-state-store.mjs +16 -0
- package/src/channels/shared/deferred-delivery-coordinator.mjs +6 -1
- package/src/channels/shared/deferred-delivery.mjs +4 -0
- package/src/channels/shared/diagnostic-details.mjs +6 -1
- package/src/channels/shared/failure-log-file.mjs +79 -0
- package/src/channels/shared/harness-client.mjs +111 -6
- package/src/channels/shared/i18n-en/feishu.mjs +2 -2
- package/src/channels/shared/i18n-en/shared-a.mjs +13 -2
- package/src/channels/shared/i18n-en/shared-b.mjs +67 -4
- package/src/channels/shared/i18n-en/shared-d.mjs +144 -0
- package/src/channels/shared/i18n-en/weixin.mjs +4 -0
- package/src/channels/shared/i18n-en.mjs +2 -0
- package/src/channels/shared/i18n-ru/feishu.mjs +2 -2
- package/src/channels/shared/i18n-ru/shared-a.mjs +13 -2
- package/src/channels/shared/i18n-ru/shared-b.mjs +67 -4
- package/src/channels/shared/i18n-ru/shared-d.mjs +144 -0
- package/src/channels/shared/i18n-ru/weixin.mjs +4 -0
- package/src/channels/shared/i18n-ru.mjs +2 -0
- package/src/channels/shared/inbound-access.mjs +10 -0
- package/src/channels/shared/markdown-chunks.mjs +5 -0
- package/src/channels/shared/message-failure.mjs +22 -1
- package/src/channels/shared/new-command.mjs +158 -4
- package/src/channels/shared/plan-goal-command.mjs +132 -0
- package/src/channels/shared/qrcode.mjs +5 -0
- package/src/channels/shared/reply-content.mjs +102 -0
- package/src/channels/shared/reset-command.mjs +46 -0
- package/src/channels/shared/semantic/artifact.mjs +133 -29
- package/src/channels/shared/semantic/reply-reference.mjs +18 -3
- package/src/channels/shared/session-nav-command.mjs +999 -0
- package/src/channels/shared/session-ring-support.mjs +184 -0
- package/src/channels/shared/session-ring.mjs +202 -0
- package/src/channels/shared/session-title.mjs +11 -0
- package/src/channels/shared/status-command.mjs +2 -1
- package/src/channels/shared/text-harness-bridge.mjs +166 -7
- package/src/channels/shared/workspace-command.mjs +567 -31
- package/src/channels/shared/workspace-session.mjs +39 -3
- package/src/channels/slack/slack-api.mjs +2 -1
- package/src/channels/telegram/config-store.mjs +10 -2
- package/src/channels/telegram/telegram-rich-message.mjs +17 -5
- package/src/channels/telegram/telegram-runtime.mjs +14 -1
- package/src/channels/wecom/state-store.mjs +13 -1
- package/src/channels/wecom/wecom-bridge.mjs +183 -26
- package/src/channels/wecom-app/state-store.mjs +13 -1
- package/src/channels/wecom-app/wecom-app-bridge.mjs +44 -4
- package/src/channels/weixin/state-store.mjs +13 -1
- package/src/channels/weixin/weixin-bridge.mjs +71 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BusyMessageDispatcher, canAutomaticallySteer } from '../shared/busy-message-dispatcher.mjs';
|
|
2
|
+
import { SESSION_NAV_HELP_LINES } from '../shared/command-catalog.mjs';
|
|
2
3
|
import { createDeferredDeliveryCoordinator, deferredOutcomeText } from '../shared/deferred-delivery-coordinator.mjs';
|
|
3
4
|
import {
|
|
4
5
|
harnessAnswerForQuestion,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
} from '../shared/batch-input.mjs';
|
|
14
15
|
import { runCompactCommand } from '../shared/compact-command.mjs';
|
|
15
16
|
import { isClearCommand, runClearCommand } from '../shared/clear-command.mjs';
|
|
17
|
+
import { isResetCommand, runResetCommand } from '../shared/reset-command.mjs';
|
|
16
18
|
import { isHistoryCommand, runHistoryCommand } from '../shared/history-command.mjs';
|
|
17
19
|
import {
|
|
18
20
|
isControlCommand,
|
|
@@ -28,6 +30,11 @@ import {
|
|
|
28
30
|
} from '../shared/preset-command.mjs';
|
|
29
31
|
import { runWorkspaceCommand } from '../shared/workspace-command.mjs';
|
|
30
32
|
import { askInWorkspaceSession } from '../shared/workspace-session.mjs';
|
|
33
|
+
import {
|
|
34
|
+
isSessionNavCommand,
|
|
35
|
+
runSessionNavTextCommand,
|
|
36
|
+
} from '../shared/session-nav-command.mjs';
|
|
37
|
+
import { createConversationSession, isNewCommand, newCommandTitle } from '../shared/new-command.mjs';
|
|
31
38
|
import {
|
|
32
39
|
captureContextEnhancement,
|
|
33
40
|
captureContextEnhancementSource,
|
|
@@ -83,8 +90,10 @@ const HELP_TEXT = () => [
|
|
|
83
90
|
t('/workspacelist 列出工作区绝对路径'),
|
|
84
91
|
t('/ws、/wsl、/workspaces 工作区命令别名'),
|
|
85
92
|
t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'),
|
|
93
|
+
t('/sessionlist --all 跨工作区汇总会话(每个工作区默认显示 10 个,可用 --limit N 调整)'),
|
|
86
94
|
t('/sessionlist --limit N 仅列出当前工作区前 N 个会话'),
|
|
87
|
-
t('/session Session ID
|
|
95
|
+
t('/session Session ID、当前工作区序号或标题关键词 将当前聊天绑定到指定会话'),
|
|
96
|
+
...SESSION_NAV_HELP_LINES.map((line) => t(line)),
|
|
88
97
|
t('/models 按序号列出所有可用模型'),
|
|
89
98
|
t('/reasoninglist 或 /reasonings 按序号列出当前模型可用推理等级'),
|
|
90
99
|
t('/reasoning [序号、等级ID或 --default] 查看或切换当前推理等级'),
|
|
@@ -316,6 +325,7 @@ export class WecomAppBridge {
|
|
|
316
325
|
}
|
|
317
326
|
}
|
|
318
327
|
const commandRunner = isClearCommand(commandText) ? runClearCommand
|
|
328
|
+
: isResetCommand(commandText) ? runResetCommand
|
|
319
329
|
: isHistoryCommand(commandText) ? runHistoryCommand
|
|
320
330
|
: isControlCommand(commandText)
|
|
321
331
|
? runControlCommand
|
|
@@ -588,9 +598,39 @@ export class WecomAppBridge {
|
|
|
588
598
|
await this.#state.markSeen(messageId);
|
|
589
599
|
return;
|
|
590
600
|
}
|
|
591
|
-
if (!hasImages && !hasFiles &&
|
|
592
|
-
await this.#state
|
|
593
|
-
await this.#send(sender, t('已开启新会话。请发送你的问题。'));
|
|
601
|
+
if (!hasImages && !hasFiles && isNewCommand(text)) {
|
|
602
|
+
const created = await createConversationSession({ state: this.#state, harness: this.#harness, key, title: newCommandTitle(text) });
|
|
603
|
+
await this.#send(sender, created.failed ? t('暂时无法创建新会话,请稍后重试。') : t('已开启新会话。请发送你的问题。'));
|
|
604
|
+
await this.#state.markSeen(messageId);
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
if (!hasImages && !hasFiles && isSessionNavCommand(text)) {
|
|
608
|
+
const nav = await runSessionNavTextCommand(text, this.#harness, this.#state, key, {
|
|
609
|
+
signal: this.#signal,
|
|
610
|
+
});
|
|
611
|
+
if (nav) {
|
|
612
|
+
for (const reply of nav.messages ?? [nav.message]) {
|
|
613
|
+
await this.#send(sender, reply);
|
|
614
|
+
}
|
|
615
|
+
if (nav.askText) {
|
|
616
|
+
const followUp = this.#enqueueMessage(
|
|
617
|
+
{
|
|
618
|
+
...message,
|
|
619
|
+
msgtype: 'text',
|
|
620
|
+
text: { content: nav.askText },
|
|
621
|
+
image: undefined,
|
|
622
|
+
mediaId: undefined,
|
|
623
|
+
},
|
|
624
|
+
`${messageId}-ask`,
|
|
625
|
+
key,
|
|
626
|
+
{ sink },
|
|
627
|
+
);
|
|
628
|
+
followUp.catch((error) => {
|
|
629
|
+
this.#logger.warn?.(`[dsh-im:wecom-app] follow-up ask after a nav command failed:`, error?.message ?? error);
|
|
630
|
+
this.#send(sender, t('切换后的提问发送失败,请重试。')).catch(() => undefined);
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
}
|
|
594
634
|
await this.#state.markSeen(messageId);
|
|
595
635
|
return;
|
|
596
636
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { weixinStageError } from './connection-error.mjs';
|
|
2
2
|
import { deferredStateAccess, normalizeDeferredState } from '../shared/deferred-state.mjs';
|
|
3
|
+
import { createSessionRingSupport, normalizePendingTitles, normalizeSessionRings } from '../shared/session-ring-support.mjs';
|
|
3
4
|
import { createHash } from 'node:crypto';
|
|
4
5
|
import { mkdir, readFile, rename, unlink, writeFile } from 'node:fs/promises';
|
|
5
6
|
import { dirname } from 'node:path';
|
|
@@ -97,6 +98,10 @@ function normalizeState(value) {
|
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
const contextTokens = normalizeContextTokens(value.contextTokens);
|
|
101
|
+
// A file written before the navigation ring existed loads unchanged: the keys
|
|
102
|
+
// are only added when they hold something.
|
|
103
|
+
const rings = normalizeSessionRings(value.rings);
|
|
104
|
+
const pendingTitles = normalizePendingTitles(value.pendingTitles);
|
|
100
105
|
return {
|
|
101
106
|
version: 1,
|
|
102
107
|
sessions,
|
|
@@ -107,6 +112,8 @@ function normalizeState(value) {
|
|
|
107
112
|
getUpdatesBuf: typeof value.getUpdatesBuf === 'string' ? value.getUpdatesBuf : '',
|
|
108
113
|
recentOutboundMessages: recentOutboundMessages(value.recentOutboundMessages),
|
|
109
114
|
...(contextTokens ? { contextTokens } : {}),
|
|
115
|
+
...(Object.keys(rings).length ? { rings } : {}),
|
|
116
|
+
...(Object.keys(pendingTitles).length ? { pendingTitles } : {}),
|
|
110
117
|
};
|
|
111
118
|
}
|
|
112
119
|
|
|
@@ -118,8 +125,13 @@ export class WeixinStateStore {
|
|
|
118
125
|
|
|
119
126
|
constructor(path) {
|
|
120
127
|
this.#path = path;
|
|
128
|
+
// The navigation ring is a view over this store's state, shared with the
|
|
129
|
+
// channels that inherit `ConversationStateStore`.
|
|
130
|
+
Object.assign(this, createSessionRingSupport({
|
|
131
|
+
state: () => this.#state,
|
|
132
|
+
persist: () => this.#persist(),
|
|
133
|
+
}));
|
|
121
134
|
}
|
|
122
|
-
|
|
123
135
|
async load() {
|
|
124
136
|
try {
|
|
125
137
|
this.#state = normalizeState(JSON.parse(await readFile(this.#path, 'utf8')));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BusyMessageDispatcher, canAutomaticallySteer } from '../shared/busy-message-dispatcher.mjs';
|
|
2
|
+
import { SESSION_NAV_HELP_LINES } from '../shared/command-catalog.mjs';
|
|
2
3
|
import { createDeferredDeliveryCoordinator, deferredOutcomeText } from '../shared/deferred-delivery-coordinator.mjs';
|
|
3
4
|
import {
|
|
4
5
|
DEFAULT_WEIXIN_MAX_MESSAGE_CHARS,
|
|
@@ -22,7 +23,9 @@ import {
|
|
|
22
23
|
isBatchInputCommand,
|
|
23
24
|
} from '../shared/batch-input.mjs';
|
|
24
25
|
import { runCompactCommand } from '../shared/compact-command.mjs';
|
|
26
|
+
import { runPlanCommand, runGoalCommand } from '../shared/plan-goal-command.mjs';
|
|
25
27
|
import { isClearCommand, runClearCommand } from '../shared/clear-command.mjs';
|
|
28
|
+
import { isResetCommand, runResetCommand } from '../shared/reset-command.mjs';
|
|
26
29
|
import { isHistoryCommand, runHistoryCommand } from '../shared/history-command.mjs';
|
|
27
30
|
import {
|
|
28
31
|
isControlCommand,
|
|
@@ -38,6 +41,11 @@ import {
|
|
|
38
41
|
} from '../shared/preset-command.mjs';
|
|
39
42
|
import { runWorkspaceCommand } from '../shared/workspace-command.mjs';
|
|
40
43
|
import { askInWorkspaceSession } from '../shared/workspace-session.mjs';
|
|
44
|
+
import {
|
|
45
|
+
isSessionNavCommand,
|
|
46
|
+
runSessionNavTextCommand,
|
|
47
|
+
} from '../shared/session-nav-command.mjs';
|
|
48
|
+
import { createConversationSession, isNewCommand, newCommandTitle } from '../shared/new-command.mjs';
|
|
41
49
|
import {
|
|
42
50
|
captureContextEnhancement,
|
|
43
51
|
captureContextEnhancementSource,
|
|
@@ -94,13 +102,17 @@ const HELP_TEXT = () => [
|
|
|
94
102
|
t('/new 开启一个全新会话'),
|
|
95
103
|
t('/compact 压缩当前会话的较早上下文'),
|
|
96
104
|
t('/clear 清空当前会话上下文(保留 Session 绑定和历史记录)'),
|
|
105
|
+
t('/plan 进入计划模式(/plan off 退出,可附带说明文字)'),
|
|
106
|
+
t('/goal [目标] 设置目标(clear 清除、edit 修改、pause 暂停、resume 恢复;不带参数查看)'),
|
|
97
107
|
t('/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)'),
|
|
98
108
|
t('/workspace 工作区序号或绝对路径 切换工作区'),
|
|
99
109
|
t('/workspacelist 列出工作区绝对路径'),
|
|
100
110
|
t('/ws、/wsl、/workspaces 工作区命令别名'),
|
|
101
111
|
t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'),
|
|
112
|
+
t('/sessionlist --all 跨工作区汇总会话(每个工作区默认显示 10 个,可用 --limit N 调整)'),
|
|
102
113
|
t('/sessionlist --limit N 仅列出当前工作区前 N 个会话'),
|
|
103
|
-
t('/session Session ID
|
|
114
|
+
t('/session Session ID、当前工作区序号或标题关键词 将当前聊天绑定到指定会话'),
|
|
115
|
+
...SESSION_NAV_HELP_LINES.map((line) => t(line)),
|
|
104
116
|
t('/models 按序号列出所有可用模型'),
|
|
105
117
|
t('/reasoninglist 或 /reasonings 按序号列出当前模型可用推理等级'),
|
|
106
118
|
t('/reasoning [序号、等级ID或 --default] 查看或切换当前推理等级'),
|
|
@@ -462,6 +474,7 @@ export class WeixinHarnessBridge {
|
|
|
462
474
|
}
|
|
463
475
|
}
|
|
464
476
|
const commandRunner = isClearCommand(commandText) ? runClearCommand
|
|
477
|
+
: isResetCommand(commandText) ? runResetCommand
|
|
465
478
|
: isHistoryCommand(commandText) ? runHistoryCommand
|
|
466
479
|
: hasWeixinFileItems(message) ? null : isControlCommand(commandText)
|
|
467
480
|
? runControlCommand
|
|
@@ -559,6 +572,7 @@ export class WeixinHarnessBridge {
|
|
|
559
572
|
isQueued: () => this.#queues.has(key),
|
|
560
573
|
enqueue: (options) => this.#enqueueMessage(message, messageId, key, options),
|
|
561
574
|
send: (reply) => this.#sendOutOfBand(key, sender, reply, contextToken, runId),
|
|
575
|
+
steerReceipt: false,
|
|
562
576
|
onError: (error) => this.#handleInteractionFailure(message, messageId, error),
|
|
563
577
|
});
|
|
564
578
|
}
|
|
@@ -818,9 +832,32 @@ export class WeixinHarnessBridge {
|
|
|
818
832
|
await this.#state.markSeen(messageId);
|
|
819
833
|
return;
|
|
820
834
|
}
|
|
821
|
-
if (!hasImages && !hasFiles &&
|
|
822
|
-
await this.#state
|
|
823
|
-
await this.#send(sender, t('已开启新会话。请发送你的问题。'), contextToken, runId);
|
|
835
|
+
if (!hasImages && !hasFiles && isNewCommand(text)) {
|
|
836
|
+
const created = await createConversationSession({ state: this.#state, harness: this.#harness, key, title: newCommandTitle(text) });
|
|
837
|
+
await this.#send(sender, created.failed ? t('暂时无法创建新会话,请稍后重试。') : t('已开启新会话。请发送你的问题。'), contextToken, runId);
|
|
838
|
+
await this.#state.markSeen(messageId);
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
if (!hasImages && !hasFiles && isSessionNavCommand(text)) {
|
|
842
|
+
const nav = await runSessionNavTextCommand(text, this.#harness, this.#state, key, {
|
|
843
|
+
signal: this.#signal,
|
|
844
|
+
});
|
|
845
|
+
if (nav) {
|
|
846
|
+
for (const reply of nav.messages ?? [nav.message]) {
|
|
847
|
+
await this.#send(sender, reply, contextToken, runId);
|
|
848
|
+
}
|
|
849
|
+
if (nav.askText) {
|
|
850
|
+
const followUp = this.#enqueueMessage(
|
|
851
|
+
{ ...message, item_list: [{ type: 1, text_item: { text: nav.askText } }] },
|
|
852
|
+
`${messageId}-ask`,
|
|
853
|
+
key,
|
|
854
|
+
);
|
|
855
|
+
followUp.catch((error) => {
|
|
856
|
+
this.#logger.warn?.(`[dsh-im:weixin] follow-up ask after a nav command failed:`, error?.message ?? error);
|
|
857
|
+
this.#send(sender, t('切换后的提问发送失败,请重试。'), contextToken, runId).catch(() => undefined);
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
}
|
|
824
861
|
await this.#state.markSeen(messageId);
|
|
825
862
|
return;
|
|
826
863
|
}
|
|
@@ -849,6 +886,36 @@ export class WeixinHarnessBridge {
|
|
|
849
886
|
return;
|
|
850
887
|
}
|
|
851
888
|
|
|
889
|
+
const planCommand = hasImages || hasFiles
|
|
890
|
+
? null
|
|
891
|
+
: await runPlanCommand(
|
|
892
|
+
text,
|
|
893
|
+
this.#harness,
|
|
894
|
+
this.#state,
|
|
895
|
+
key,
|
|
896
|
+
{ signal: this.#signal },
|
|
897
|
+
);
|
|
898
|
+
if (planCommand) {
|
|
899
|
+
await this.#send(sender, planCommand.message, contextToken, runId);
|
|
900
|
+
await this.#state.markSeen(messageId);
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
const goalCommand = hasImages || hasFiles
|
|
905
|
+
? null
|
|
906
|
+
: await runGoalCommand(
|
|
907
|
+
text,
|
|
908
|
+
this.#harness,
|
|
909
|
+
this.#state,
|
|
910
|
+
key,
|
|
911
|
+
{ signal: this.#signal },
|
|
912
|
+
);
|
|
913
|
+
if (goalCommand) {
|
|
914
|
+
await this.#send(sender, goalCommand.message, contextToken, runId);
|
|
915
|
+
await this.#state.markSeen(messageId);
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
|
|
852
919
|
let answer;
|
|
853
920
|
let artifacts = [];
|
|
854
921
|
await this.#startTyping(sender, contextToken);
|