@xmanrui/dsh-im 0.6.0 → 0.7.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/README.md +22 -4
- package/lib/client.js +649 -357
- package/lib/index.js +120 -111
- package/package.json +1 -1
- package/plugin-src/client/build.mjs +1 -1
- package/plugin-src/client/i18n.js +14 -0
- package/plugin-src/client/index.js +11 -3
- package/plugin-src/client/styles.js +49 -8
- package/plugin-src/client/workspace-directory-picker.js +230 -0
- package/plugin-src/client/workspace-editor.js +38 -65
- package/scripts/verify-package.mjs +5 -0
- package/src/channels/dingtalk/dingtalk-bridge.mjs +363 -9
- package/src/channels/dingtalk/harness-client.mjs +16 -310
- package/src/channels/discord/discord-api.mjs +1 -1
- package/src/channels/discord/discord-runtime.mjs +11 -1
- package/src/channels/discord/harness-client.mjs +10 -2
- package/src/channels/feishu/bridge.mjs +525 -51
- package/src/channels/feishu/feishu-runtime.mjs +41 -1
- package/src/channels/feishu/harness-client.mjs +16 -279
- package/src/channels/qq/harness-client.mjs +10 -2
- package/src/channels/qq/qq-bridge.mjs +383 -29
- package/src/channels/qq/qq-runtime.mjs +14 -3
- package/src/channels/shared/bot-workspace-store.mjs +185 -4
- package/src/channels/shared/harness-client.mjs +825 -0
- package/src/channels/shared/harness-question.mjs +85 -0
- package/src/channels/shared/harness-session-binding.mjs +110 -0
- package/src/channels/shared/text-harness-bridge.mjs +439 -25
- package/src/channels/shared/workspace-command.mjs +212 -16
- package/src/channels/shared/workspace-session.mjs +22 -9
- package/src/channels/slack/harness-client.mjs +10 -2
- package/src/channels/slack/slack-runtime.mjs +11 -1
- package/src/channels/telegram/harness-client.mjs +10 -2
- package/src/channels/telegram/telegram-runtime.mjs +15 -4
- package/src/channels/wecom/harness-client.mjs +10 -2
- package/src/channels/wecom/wecom-bridge.mjs +389 -15
- package/src/channels/wecom/wecom-runtime.mjs +6 -0
- package/src/channels/weixin/harness-client.mjs +16 -270
- package/src/channels/weixin/weixin-api.mjs +1 -1
- package/src/channels/weixin/weixin-bridge.mjs +406 -24
- package/src/channels/weixin/weixin-runtime.mjs +56 -7
- package/src/channels/whatsapp/harness-client.mjs +10 -2
- package/src/channels/whatsapp/whatsapp-runtime.mjs +1 -0
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { FeishuHarnessBridge } from './bridge.mjs';
|
|
2
2
|
import { VerifiedFeishuChannel } from './feishu-channel.mjs';
|
|
3
3
|
|
|
4
|
+
const DEFAULT_REQUEST_TIMEOUT_MS = 15_000;
|
|
5
|
+
|
|
6
|
+
function httpInstanceWithTimeout(httpInstance, timeoutMs) {
|
|
7
|
+
if (!httpInstance || typeof httpInstance.request !== 'function') return undefined;
|
|
8
|
+
const optionsWithTimeout = (options) => ({
|
|
9
|
+
...(options ?? {}),
|
|
10
|
+
timeout: options?.timeout ?? timeoutMs,
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
request: (options) => httpInstance.request(optionsWithTimeout(options)),
|
|
14
|
+
get: (url, options) => httpInstance.get(url, optionsWithTimeout(options)),
|
|
15
|
+
delete: (url, options) => httpInstance.delete(url, optionsWithTimeout(options)),
|
|
16
|
+
head: (url, options) => httpInstance.head(url, optionsWithTimeout(options)),
|
|
17
|
+
options: (url, options) => httpInstance.options(url, optionsWithTimeout(options)),
|
|
18
|
+
post: (url, data, options) => httpInstance.post(url, data, optionsWithTimeout(options)),
|
|
19
|
+
put: (url, data, options) => httpInstance.put(url, data, optionsWithTimeout(options)),
|
|
20
|
+
patch: (url, data, options) => httpInstance.patch(url, data, optionsWithTimeout(options)),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
4
24
|
export function createBridgeStatus({ allowedSenderCount = 1 } = {}) {
|
|
5
25
|
return {
|
|
6
26
|
startedAt: null,
|
|
@@ -43,11 +63,13 @@ export class FeishuRuntime {
|
|
|
43
63
|
#state;
|
|
44
64
|
#replyTimeoutMs;
|
|
45
65
|
#connectTimeoutMs;
|
|
66
|
+
#requestTimeoutMs;
|
|
46
67
|
#logger;
|
|
47
68
|
#client = null;
|
|
48
69
|
#bridge = null;
|
|
49
70
|
#wsClient = null;
|
|
50
71
|
#starting = null;
|
|
72
|
+
#abortController = null;
|
|
51
73
|
#status;
|
|
52
74
|
|
|
53
75
|
constructor({
|
|
@@ -61,6 +83,7 @@ export class FeishuRuntime {
|
|
|
61
83
|
state,
|
|
62
84
|
replyTimeoutMs = 600000,
|
|
63
85
|
connectTimeoutMs = 15000,
|
|
86
|
+
requestTimeoutMs = DEFAULT_REQUEST_TIMEOUT_MS,
|
|
64
87
|
logger = console,
|
|
65
88
|
}) {
|
|
66
89
|
if (!lark) throw new Error('FeishuRuntime requires the Feishu SDK');
|
|
@@ -70,6 +93,9 @@ export class FeishuRuntime {
|
|
|
70
93
|
if (normalizedOwners.length === 0) throw new Error('FeishuRuntime requires at least one owner open_id');
|
|
71
94
|
if (!harness) throw new Error('FeishuRuntime requires a Harness client');
|
|
72
95
|
if (!state) throw new Error('FeishuRuntime requires a state store');
|
|
96
|
+
if (!Number.isFinite(requestTimeoutMs) || requestTimeoutMs <= 0) {
|
|
97
|
+
throw new TypeError('FeishuRuntime requestTimeoutMs must be a positive number');
|
|
98
|
+
}
|
|
73
99
|
|
|
74
100
|
this.#lark = lark;
|
|
75
101
|
this.#appId = appId;
|
|
@@ -80,6 +106,7 @@ export class FeishuRuntime {
|
|
|
80
106
|
this.#state = state;
|
|
81
107
|
this.#replyTimeoutMs = replyTimeoutMs;
|
|
82
108
|
this.#connectTimeoutMs = connectTimeoutMs;
|
|
109
|
+
this.#requestTimeoutMs = requestTimeoutMs;
|
|
83
110
|
this.#logger = logger;
|
|
84
111
|
this.#status = createBridgeStatus({ allowedSenderCount: normalizedOwners.length });
|
|
85
112
|
}
|
|
@@ -99,12 +126,15 @@ export class FeishuRuntime {
|
|
|
99
126
|
}
|
|
100
127
|
|
|
101
128
|
async #start() {
|
|
129
|
+
const abortController = new AbortController();
|
|
130
|
+
this.#abortController = abortController;
|
|
131
|
+
const { signal } = abortController;
|
|
102
132
|
this.#status.startedAt = new Date().toISOString();
|
|
103
133
|
this.#status.feishuLongConnectionState = 'connecting';
|
|
104
134
|
this.#status.lastError = null;
|
|
105
135
|
|
|
106
136
|
try {
|
|
107
|
-
await this.#harness.ensureRunning();
|
|
137
|
+
await this.#harness.ensureRunning({ signal });
|
|
108
138
|
this.#status.harnessReachable = true;
|
|
109
139
|
|
|
110
140
|
const sdkDomain = this.#domain === 'lark'
|
|
@@ -115,6 +145,11 @@ export class FeishuRuntime {
|
|
|
115
145
|
appSecret: this.#appSecret,
|
|
116
146
|
domain: sdkDomain,
|
|
117
147
|
};
|
|
148
|
+
const httpInstance = httpInstanceWithTimeout(
|
|
149
|
+
this.#lark.defaultHttpInstance,
|
|
150
|
+
this.#requestTimeoutMs,
|
|
151
|
+
);
|
|
152
|
+
if (httpInstance) larkConfig.httpInstance = httpInstance;
|
|
118
153
|
this.#client = new this.#lark.Client(larkConfig);
|
|
119
154
|
const channel = new VerifiedFeishuChannel({
|
|
120
155
|
client: this.#client,
|
|
@@ -128,6 +163,8 @@ export class FeishuRuntime {
|
|
|
128
163
|
status: this.#status,
|
|
129
164
|
allowedSenderOpenIds: new Set(this.#ownerOpenIds),
|
|
130
165
|
replyTimeoutMs: this.#replyTimeoutMs,
|
|
166
|
+
signal,
|
|
167
|
+
logger: this.#logger,
|
|
131
168
|
});
|
|
132
169
|
|
|
133
170
|
const dispatcher = new this.#lark.EventDispatcher({}).register({
|
|
@@ -205,6 +242,9 @@ export class FeishuRuntime {
|
|
|
205
242
|
|
|
206
243
|
async stop({ preserveError = false } = {}) {
|
|
207
244
|
const error = preserveError ? this.#status.lastError : null;
|
|
245
|
+
const abortController = this.#abortController;
|
|
246
|
+
this.#abortController = null;
|
|
247
|
+
abortController?.abort(new DOMException('Feishu runtime stopped', 'AbortError'));
|
|
208
248
|
this.#status.ready = false;
|
|
209
249
|
if (this.#wsClient) {
|
|
210
250
|
this.#wsClient.close({ force: true });
|
|
@@ -1,282 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.map((part) => part.text)
|
|
18
|
-
.join('\n')
|
|
19
|
-
.trim();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export class HarnessReplyTracker {
|
|
23
|
-
#promptRpcId;
|
|
24
|
-
#lastSeq;
|
|
25
|
-
#openTurn = null;
|
|
26
|
-
#targetTurn = null;
|
|
27
|
-
#stepText = new Map();
|
|
28
|
-
#latestText = '';
|
|
29
|
-
#finished = false;
|
|
30
|
-
#reason = null;
|
|
31
|
-
|
|
32
|
-
constructor({ promptRpcId, afterSeq = -1 }) {
|
|
33
|
-
this.#promptRpcId = promptRpcId;
|
|
34
|
-
this.#lastSeq = afterSeq;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
get finished() {
|
|
38
|
-
return this.#finished;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
get answer() {
|
|
42
|
-
return this.#latestText.trim();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
get reason() {
|
|
46
|
-
return this.#reason;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
consume(entries) {
|
|
50
|
-
let update = null;
|
|
51
|
-
const ordered = [...entries]
|
|
52
|
-
.map((entry) => entry?.event ?? entry)
|
|
53
|
-
.filter(Boolean)
|
|
54
|
-
.sort((left, right) => (left.seq ?? -1) - (right.seq ?? -1));
|
|
55
|
-
|
|
56
|
-
for (const event of ordered) {
|
|
57
|
-
const seq = event.seq ?? -1;
|
|
58
|
-
if (seq <= this.#lastSeq) continue;
|
|
59
|
-
this.#lastSeq = seq;
|
|
60
|
-
|
|
61
|
-
if (event.type === 'turn/start') {
|
|
62
|
-
this.#openTurn = event.data?.turn ?? null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (event.type === 'user/message'
|
|
66
|
-
&& event.data?.source?.rpcId === this.#promptRpcId) {
|
|
67
|
-
this.#targetTurn = this.#openTurn;
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (this.#targetTurn === null) continue;
|
|
72
|
-
|
|
73
|
-
if (event.type === 'turn/end') {
|
|
74
|
-
if (event.data?.turn !== this.#targetTurn) continue;
|
|
75
|
-
this.#finished = true;
|
|
76
|
-
this.#reason = event.data?.reason ?? null;
|
|
77
|
-
this.#openTurn = null;
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (event.data?.turn !== this.#targetTurn) continue;
|
|
82
|
-
|
|
83
|
-
if (event.type === 'assistant/chunk' && event.data?.chunk?.type === 'text-delta') {
|
|
84
|
-
const step = event.data?.step ?? 0;
|
|
85
|
-
const index = event.data.chunk.index ?? 0;
|
|
86
|
-
const key = `${step}:${index}`;
|
|
87
|
-
this.#stepText.set(key, (this.#stepText.get(key) ?? '') + event.data.chunk.text);
|
|
88
|
-
const stepPrefix = `${step}:`;
|
|
89
|
-
const text = [...this.#stepText.entries()]
|
|
90
|
-
.filter(([partKey]) => partKey.startsWith(stepPrefix))
|
|
91
|
-
.sort(([left], [right]) => Number(left.split(':')[1]) - Number(right.split(':')[1]))
|
|
92
|
-
.map(([, part]) => part)
|
|
93
|
-
.join('\n')
|
|
94
|
-
.trim();
|
|
95
|
-
if (text && text !== this.#latestText) {
|
|
96
|
-
this.#latestText = text;
|
|
97
|
-
update = { type: 'text', text };
|
|
98
|
-
}
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (event.type === 'assistant/message') {
|
|
103
|
-
const text = messageText(event);
|
|
104
|
-
if (text && text !== this.#latestText) {
|
|
105
|
-
this.#latestText = text;
|
|
106
|
-
update = { type: 'text', text };
|
|
107
|
-
}
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (event.type === 'tool/call') {
|
|
112
|
-
update = { type: 'tool', name: event.data?.name ?? '工具' };
|
|
113
|
-
} else if (event.type === 'tool/result') {
|
|
114
|
-
update = { type: 'status', text: '正在整理结果…' };
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return update;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export class HarnessRpcError extends Error {
|
|
123
|
-
constructor(method, error) {
|
|
124
|
-
super(`${method}: ${error?.message ?? 'unknown Harness RPC error'}`);
|
|
125
|
-
this.name = 'HarnessRpcError';
|
|
126
|
-
this.method = method;
|
|
127
|
-
this.code = error?.code ?? 'internal';
|
|
128
|
-
this.details = error?.details ?? {};
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export class HarnessClient {
|
|
133
|
-
#baseUrl;
|
|
134
|
-
#workspace;
|
|
135
|
-
#agentPreset;
|
|
136
|
-
#autostart;
|
|
137
|
-
#dshBin;
|
|
138
|
-
#managedProcess = null;
|
|
139
|
-
|
|
140
|
-
constructor({ baseUrl, workspace, agentPreset, autostart, dshBin }) {
|
|
141
|
-
this.#baseUrl = new URL(baseUrl);
|
|
142
|
-
this.#workspace = workspace;
|
|
143
|
-
this.#agentPreset = agentPreset;
|
|
144
|
-
this.#autostart = autostart;
|
|
145
|
-
this.#dshBin = dshBin;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
async rpc(method, payload = {}, timeoutMs = 30000, options = {}) {
|
|
149
|
-
const rpcId = options.rpcId ?? `feishu-${randomUUID()}`;
|
|
150
|
-
const response = await fetch(new URL(`/api/${method}`, this.#baseUrl), {
|
|
151
|
-
method: 'POST',
|
|
152
|
-
headers: { 'content-type': 'application/json' },
|
|
153
|
-
body: JSON.stringify({ type: 'client-request', rpcId, method, payload }),
|
|
154
|
-
signal: AbortSignal.timeout(timeoutMs),
|
|
155
|
-
});
|
|
156
|
-
if (!response.ok) throw new Error(`Harness transport ${method} failed: HTTP ${response.status}`);
|
|
157
|
-
const body = await response.json();
|
|
158
|
-
if (body?.type !== 'server-response' || body?.rpcId !== rpcId) {
|
|
159
|
-
throw new Error(`Harness returned an invalid response for ${method}`);
|
|
160
|
-
}
|
|
161
|
-
if (!body.result?.ok) throw new HarnessRpcError(method, body.result?.error);
|
|
162
|
-
return body.result.value;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
async health() {
|
|
166
|
-
await this.rpc('host.describe', {}, 5000);
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
async ensureRunning() {
|
|
171
|
-
try {
|
|
172
|
-
return await this.health();
|
|
173
|
-
} catch (firstError) {
|
|
174
|
-
if (!this.#autostart) throw firstError;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (!this.#managedProcess || this.#managedProcess.exitCode !== null) {
|
|
178
|
-
const port = this.#baseUrl.port || (this.#baseUrl.protocol === 'https:' ? '443' : '80');
|
|
179
|
-
this.#managedProcess = spawn(this.#dshBin, [
|
|
180
|
-
'web',
|
|
181
|
-
'--host',
|
|
182
|
-
this.#baseUrl.hostname,
|
|
183
|
-
'--port',
|
|
184
|
-
port,
|
|
185
|
-
], {
|
|
186
|
-
cwd: this.#workspace,
|
|
187
|
-
env: process.env,
|
|
188
|
-
stdio: ['ignore', 'inherit', 'inherit'],
|
|
189
|
-
});
|
|
190
|
-
this.#managedProcess.on('error', (error) => {
|
|
191
|
-
console.error('[bridge] failed to start Harness:', error.message);
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
const deadline = Date.now() + 60000;
|
|
196
|
-
let lastError;
|
|
197
|
-
while (Date.now() < deadline) {
|
|
198
|
-
await sleep(1000);
|
|
199
|
-
try {
|
|
200
|
-
return await this.health();
|
|
201
|
-
} catch (error) {
|
|
202
|
-
lastError = error;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
throw new Error(`Harness did not become ready: ${lastError?.message ?? 'timeout'}`);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
async listWorkspaces(options = {}) {
|
|
209
|
-
await this.ensureRunning();
|
|
210
|
-
return workspacePaths(await this.rpc('workspace.list', {}, 30000, options));
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
async workspaceId(options = {}) {
|
|
214
|
-
const workspace = options.workspace ?? this.#workspace;
|
|
215
|
-
const { items } = await this.rpc('workspace.list', {});
|
|
216
|
-
const existing = items.find((item) => item.path === workspace);
|
|
217
|
-
if (existing) return existing.workspaceId;
|
|
218
|
-
const created = await this.rpc('workspace.create', { path: workspace });
|
|
219
|
-
return created.workspace.workspaceId;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
async createSession(options = {}) {
|
|
223
|
-
await this.ensureRunning();
|
|
224
|
-
const workspaceId = await this.workspaceId(options);
|
|
225
|
-
const created = await this.rpc('session.create', {
|
|
226
|
-
workspaceId,
|
|
227
|
-
agentPreset: this.#agentPreset,
|
|
1
|
+
import {
|
|
2
|
+
HarnessClient as SharedHarnessClient,
|
|
3
|
+
} from '../shared/harness-client.mjs';
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
HarnessInteractionError,
|
|
7
|
+
HarnessReplyTracker,
|
|
8
|
+
HarnessRpcError,
|
|
9
|
+
} from '../shared/harness-client.mjs';
|
|
10
|
+
|
|
11
|
+
export class HarnessClient extends SharedHarnessClient {
|
|
12
|
+
constructor(options) {
|
|
13
|
+
super({
|
|
14
|
+
...options,
|
|
15
|
+
rpcIdPrefix: 'feishu',
|
|
16
|
+
logPrefix: 'dsh-feishu',
|
|
228
17
|
});
|
|
229
|
-
return created.sessionId;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
async sessionExists(sessionId) {
|
|
233
|
-
try {
|
|
234
|
-
await this.rpc('session.history', { sessionId, maxMessages: 1 });
|
|
235
|
-
return true;
|
|
236
|
-
} catch (error) {
|
|
237
|
-
if (error instanceof HarnessRpcError && error.code === 'session-not-found') return false;
|
|
238
|
-
throw error;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
async ask(sessionId, text, options = {}) {
|
|
243
|
-
if (typeof options === 'number') options = { timeoutMs: options };
|
|
244
|
-
const timeoutMs = options.timeoutMs ?? 600000;
|
|
245
|
-
const onUpdate = typeof options.onUpdate === 'function' ? options.onUpdate : null;
|
|
246
|
-
await this.ensureRunning();
|
|
247
|
-
const before = await this.rpc('session.history', { sessionId, maxMessages: 1 });
|
|
248
|
-
const baselineSeq = Math.max(-1, ...(before.events ?? []).map(({ event }) => event.seq ?? -1));
|
|
249
|
-
const promptRpcId = `feishu-${randomUUID()}`;
|
|
250
|
-
const tracker = new HarnessReplyTracker({ promptRpcId, afterSeq: baselineSeq });
|
|
251
|
-
|
|
252
|
-
await this.rpc('session.prompt', {
|
|
253
|
-
sessionId,
|
|
254
|
-
mode: 'queue',
|
|
255
|
-
content: [{ type: 'text', text }],
|
|
256
|
-
clientTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
257
|
-
}, 30000, { rpcId: promptRpcId });
|
|
258
|
-
|
|
259
|
-
const deadline = Date.now() + timeoutMs;
|
|
260
|
-
while (Date.now() < deadline) {
|
|
261
|
-
await sleep(300);
|
|
262
|
-
const history = await this.rpc('session.history', { sessionId, maxMessages: 50 });
|
|
263
|
-
const update = tracker.consume(history.events ?? []);
|
|
264
|
-
if (update && onUpdate) {
|
|
265
|
-
try {
|
|
266
|
-
await onUpdate(update);
|
|
267
|
-
} catch (error) {
|
|
268
|
-
console.warn('[bridge] ignored a progress update failure:', error.message);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
if (!tracker.finished) continue;
|
|
272
|
-
if (tracker.answer) return tracker.answer;
|
|
273
|
-
|
|
274
|
-
throw new Error(`Harness turn ended without a text reply${tracker.reason ? ` (${JSON.stringify(tracker.reason)})` : ''}`);
|
|
275
|
-
}
|
|
276
|
-
throw new Error(`Harness reply timed out after ${Math.round(timeoutMs / 1000)} seconds`);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
stopManagedProcess() {
|
|
280
|
-
if (this.#managedProcess?.exitCode === null) this.#managedProcess.kill('SIGTERM');
|
|
281
18
|
}
|
|
282
19
|
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { HarnessClient } from '../
|
|
1
|
+
import { HarnessClient } from '../shared/harness-client.mjs';
|
|
2
2
|
|
|
3
|
-
export class QqHarnessClient extends HarnessClient {
|
|
3
|
+
export class QqHarnessClient extends HarnessClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super({
|
|
6
|
+
...options,
|
|
7
|
+
rpcIdPrefix: 'qq',
|
|
8
|
+
logPrefix: 'dsh-qq',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|