dsh-multigameassistant 2.2.2 → 2.2.3
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/cordis.patch.yml +1 -1
- package/lib/analyzer.js +3 -3
- package/lib/{chunk-DSWWQWQH.js → chunk-6NJSSOB6.js} +20 -4
- package/lib/{chunk-6YPSKAQ5.js → chunk-A6YQRWHZ.js} +90 -51
- package/lib/{chunk-CCYE6H2F.js → chunk-YTIR5JW4.js} +3 -3
- package/lib/feishu.js +2 -2
- package/lib/game-intel.js +2 -2
- package/lib/gateway.js +1 -1
- package/lib/intervene.js +2 -2
- package/lib/notify.js +2 -2
- package/lib/orchestrator.js +2 -2
- package/lib/qqbot.js +2 -2
- package/lib/script-registry.js +3 -3
- package/package.json +1 -1
- /package/lib/{chunk-CCYE6H2F.js.LEGAL.txt → chunk-YTIR5JW4.js.LEGAL.txt} +0 -0
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# dsh-multigameassistant 2.2.
|
|
1
|
+
# dsh-multigameassistant 2.2.3
|
|
2
2
|
# dsh-multigameassistant: the app's plugins (packages/bundle/cordis.patch.yml, each @adg/<plugin> as dsh-multigameassistant/<plugin>)
|
|
3
3
|
# sharing the dsh with the person's other chats, and the app's agent preset (dsh's standard one with the app's
|
|
4
4
|
# tools and prompts, and compaction as 设置 → 对话压缩 says). No row of dsh is restated.
|
package/lib/analyzer.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
discoverMcp,
|
|
4
4
|
discoverSkills,
|
|
5
5
|
mcpEndpoints
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YTIR5JW4.js";
|
|
7
7
|
import {
|
|
8
8
|
probeProject
|
|
9
9
|
} from "./chunk-B4UT4NYH.js";
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
require_dist,
|
|
17
17
|
stripJsonc
|
|
18
18
|
} from "./chunk-RGEGJH6R.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-A6YQRWHZ.js";
|
|
20
|
+
import "./chunk-6NJSSOB6.js";
|
|
21
21
|
import "./chunk-KMVQK5CI.js";
|
|
22
22
|
import "./chunk-RESS7WVY.js";
|
|
23
23
|
import {
|
|
@@ -7476,10 +7476,12 @@ var HandOffs = class {
|
|
|
7476
7476
|
#listeners = /* @__PURE__ */ new Set();
|
|
7477
7477
|
loaded;
|
|
7478
7478
|
constructor(file, changed = () => {
|
|
7479
|
-
}) {
|
|
7479
|
+
}, log = console) {
|
|
7480
7480
|
this.#file = file;
|
|
7481
7481
|
this.#changed = changed;
|
|
7482
|
-
this.loaded = this.#load()
|
|
7482
|
+
this.loaded = this.#load().catch((error) => {
|
|
7483
|
+
log.warn(`\u5199\u56DE\u4E2D\u65AD\u4EFB\u52A1\u72B6\u6001\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`);
|
|
7484
|
+
});
|
|
7483
7485
|
}
|
|
7484
7486
|
/** Those from or to this conversation, oldest first. */
|
|
7485
7487
|
of(sessionId) {
|
|
@@ -7524,6 +7526,7 @@ var HandOffs = class {
|
|
|
7524
7526
|
async #load() {
|
|
7525
7527
|
if (this.#file === void 0)
|
|
7526
7528
|
return;
|
|
7529
|
+
let recovered = false;
|
|
7527
7530
|
try {
|
|
7528
7531
|
const saved = JSON.parse(await readFile7(this.#file, "utf8"));
|
|
7529
7532
|
if (!Array.isArray(saved))
|
|
@@ -7531,10 +7534,17 @@ var HandOffs = class {
|
|
|
7531
7534
|
for (const item of saved) {
|
|
7532
7535
|
if (typeof item?.id !== "string")
|
|
7533
7536
|
continue;
|
|
7534
|
-
|
|
7537
|
+
if (item.state === "running" || item.state === "waiting") {
|
|
7538
|
+
this.#items.set(item.id, { ...item, state: "failed", reply: "\u8F6F\u4EF6\u5173\u95ED\u65F6\u5B83\u8FD8\u6CA1\u505A\u5B8C\uFF0C\u8FD9\u4E00\u8F6E\u4E2D\u65AD\u4E86", endedAt: Date.now() });
|
|
7539
|
+
recovered = true;
|
|
7540
|
+
} else
|
|
7541
|
+
this.#items.set(item.id, item);
|
|
7535
7542
|
}
|
|
7536
7543
|
} catch {
|
|
7544
|
+
return;
|
|
7537
7545
|
}
|
|
7546
|
+
if (recovered)
|
|
7547
|
+
await this.#save();
|
|
7538
7548
|
}
|
|
7539
7549
|
};
|
|
7540
7550
|
|
|
@@ -9182,7 +9192,7 @@ var AdgGateway = class extends Service {
|
|
|
9182
9192
|
this.agentModels = new AgentModels(config.dataDir === void 0 ? void 0 : join8(config.dataDir, "agent-models.json"), config.dataDir === void 0 ? void 0 : join8(config.dataDir, "role-model.json"));
|
|
9183
9193
|
this.roles = new SessionRoles(config.dataDir === void 0 ? void 0 : join8(config.dataDir, "session-roles.json"), () => this.broadcast("roles/changed", { items: this.roles.list() }));
|
|
9184
9194
|
this.homes = new AgentHomes(config.dataDir === void 0 ? void 0 : join8(config.dataDir, "agent-homes.json"));
|
|
9185
|
-
this.handOffs = new HandOffs(config.dataDir === void 0 ? void 0 : join8(config.dataDir, "handoffs.json"), (item) => this.broadcast("handoffs/changed", { item }));
|
|
9195
|
+
this.handOffs = new HandOffs(config.dataDir === void 0 ? void 0 : join8(config.dataDir, "handoffs.json"), (item) => this.broadcast("handoffs/changed", { item }), log);
|
|
9186
9196
|
if (!this.shared)
|
|
9187
9197
|
ctx.inject(["tools", "systemPrompt"], (scoped) => {
|
|
9188
9198
|
scoped.effect(() => this.parts.attach(scoped), "adg-gateway agent parts");
|
|
@@ -10400,6 +10410,12 @@ Content-Length: 0
|
|
|
10400
10410
|
return;
|
|
10401
10411
|
}
|
|
10402
10412
|
}
|
|
10413
|
+
promptChild(request, signal) {
|
|
10414
|
+
const service = this.ctx.get("subagents");
|
|
10415
|
+
if (!service)
|
|
10416
|
+
throw new Error("\u539F\u751F\u5B50\u4EE3\u7406\u670D\u52A1\u672A\u52A0\u8F7D");
|
|
10417
|
+
return service.prompt(request, signal);
|
|
10418
|
+
}
|
|
10403
10419
|
/** App actions are addressed to an agent's home. dsh owns child membership, model selection, settlement and parent delivery. */
|
|
10404
10420
|
async runChild(owner, childId, title, instruction, signal, images = []) {
|
|
10405
10421
|
if (!this.homes.agentOf(owner))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __adgCreateRequire } from 'node:module'; import { dirname as __adgDirname } from 'node:path'; import { fileURLToPath as __adgFileURLToPath } from 'node:url'; const require = __adgCreateRequire(import.meta.url); const __filename = __adgFileURLToPath(import.meta.url); const __dirname = __adgDirname(__filename);
|
|
2
2
|
import {
|
|
3
3
|
convertRecord
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6NJSSOB6.js";
|
|
5
5
|
import {
|
|
6
6
|
writeFileAtomic
|
|
7
7
|
} from "./chunk-RESS7WVY.js";
|
|
@@ -136,6 +136,9 @@ function pastBetween(all, a, b, name) {
|
|
|
136
136
|
var MAX_THREAD_MESSAGES = 10;
|
|
137
137
|
var MAX_HOPS = 3;
|
|
138
138
|
var MAX_CHAIN_MESSAGES = 30;
|
|
139
|
+
function failedReply(error) {
|
|
140
|
+
return { blocks: [], outcome: "failed", ended: error instanceof Error ? error.message : String(error) };
|
|
141
|
+
}
|
|
139
142
|
function createHandOffDesk(deps) {
|
|
140
143
|
const now = deps.now ?? Date.now;
|
|
141
144
|
const live = /* @__PURE__ */ new Map();
|
|
@@ -149,9 +152,18 @@ function createHandOffDesk(deps) {
|
|
|
149
152
|
chainTop(thread).said++;
|
|
150
153
|
await save(thread, { ...patch, messages: [...thread.item.messages ?? [], { from, kind, text, at: now() }] });
|
|
151
154
|
};
|
|
152
|
-
const
|
|
153
|
-
|
|
155
|
+
const deliver = (session, message2, signal, parentSessionId) => {
|
|
156
|
+
const receipt = Promise.withResolvers();
|
|
157
|
+
const reply = deps.converse(session, message2, signal, [], { insert: true, parentSessionId, onAccepted: receipt.resolve });
|
|
158
|
+
void reply.then(() => receipt.resolve(), receipt.reject);
|
|
159
|
+
return { accepted: receipt.promise, reply };
|
|
160
|
+
};
|
|
161
|
+
const toWorker = (thread, message2, record) => {
|
|
162
|
+
const { accepted, reply } = deliver(thread.item.toSession, message2, thread.signal, thread.item.ownerSession);
|
|
163
|
+
const recorded = accepted.then(record);
|
|
164
|
+
thread.turns.push(recorded.then(() => reply, () => ({ blocks: [] })).catch(failedReply));
|
|
154
165
|
thread.wake();
|
|
166
|
+
return recorded;
|
|
155
167
|
};
|
|
156
168
|
const askerKind = (agent) => agent === void 0 || agent === MAIN ? "main" : "lead";
|
|
157
169
|
const late = async ({ thread: id, fromSession, from, kind, text }) => {
|
|
@@ -170,29 +182,39 @@ function createHandOffDesk(deps) {
|
|
|
170
182
|
if (worker && askerNow === "")
|
|
171
183
|
throw new Error(`\u8FD9\u4EF6\u4E8B\u662F${item.by}\u4EA4\u7684\uFF0C\u6CA1\u6709\u4EBA\u5728\u7B49\u6D88\u606F\uFF1A\u8981\u544A\u8BC9\u8C01\u5C31\u91CD\u65B0\u4EA4\u7ED9\u5B83`);
|
|
172
184
|
const said = kind === "done" && (!worker || item.state !== "failed") ? "update" : kind;
|
|
173
|
-
await deps.record({ ...item, messages: [...item.messages ?? [], { from, kind: said, text, at: now() }] });
|
|
174
185
|
const message2 = threadMessage({ from, kind: said === "done" ? "update" : said, thread: id, title: item.title, text: said === "done" ? `\u8865\u4EA4\u7ED3\u8BBA\uFF1A${text}` : text, reader: worker ? askerKind(askerAgent) : "worker", closed: true });
|
|
175
186
|
const recipient = worker ? askerNow : workerNow;
|
|
176
|
-
|
|
177
|
-
|
|
187
|
+
await deliver(recipient, message2, AbortSignal.timeout(RELAY_TIMEOUT_MS), workingOn(recipient)?.item.ownerSession).accepted;
|
|
188
|
+
const latest = deps.threads?.().find((h) => h.id === id) ?? item;
|
|
189
|
+
await deps.record({ ...latest, messages: [...latest.messages ?? [], { from, kind: said, text, at: now() }] });
|
|
178
190
|
return "\u5DF2\u7ECF\u9001\u5230\u5BF9\u65B9\u90A3\u91CC\u4E86\u3002";
|
|
179
191
|
};
|
|
180
192
|
const toAsker = (thread, message2, asked) => {
|
|
181
|
-
|
|
193
|
+
const session = thread.item.fromSession;
|
|
194
|
+
const { reply, accepted } = deliver(session, message2, AbortSignal.any([thread.signal, AbortSignal.timeout(RELAY_TIMEOUT_MS)]), workingOn(session)?.item.ownerSession);
|
|
195
|
+
void reply.then((answer) => {
|
|
182
196
|
if (!asked || !thread.awaiting || thread.deferred || !live.has(thread.item.id))
|
|
183
197
|
return;
|
|
184
198
|
const said = finalText(answer).trim();
|
|
185
|
-
|
|
199
|
+
return answered(thread, thread.item.by, said === "" || isQuiet(said) ? "\uFF08\u5B83\u6CA1\u6709\u56DE\u7B54\uFF1A\u6309\u4F60\u81EA\u5DF1\u7684\u5224\u65AD\u63A5\u7740\u505A\u3002\uFF09" : said);
|
|
186
200
|
}, () => {
|
|
187
201
|
if (asked && thread.awaiting && live.has(thread.item.id))
|
|
188
|
-
|
|
202
|
+
return answered(thread, thread.item.by, "\uFF08\u6CA1\u6709\u7B49\u5230\u56DE\u7B54\uFF1A\u6309\u4F60\u81EA\u5DF1\u7684\u5224\u65AD\u63A5\u7740\u505A\u3002\uFF09");
|
|
203
|
+
}).catch((error) => {
|
|
204
|
+
if (!thread.awaiting || !live.has(thread.item.id))
|
|
205
|
+
return;
|
|
206
|
+
thread.awaiting = false;
|
|
207
|
+
thread.turns.push(Promise.resolve(failedReply(error)));
|
|
208
|
+
thread.wake();
|
|
189
209
|
});
|
|
210
|
+
return accepted;
|
|
190
211
|
};
|
|
191
212
|
const answered = async (thread, from, text) => {
|
|
192
|
-
thread.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
213
|
+
await toWorker(thread, threadMessage({ from, kind: "answer", thread: thread.item.id, title: thread.item.title, text }), () => {
|
|
214
|
+
thread.awaiting = false;
|
|
215
|
+
thread.deferred = false;
|
|
216
|
+
return say(thread, from, "answer", text, { state: "running" });
|
|
217
|
+
});
|
|
196
218
|
};
|
|
197
219
|
return {
|
|
198
220
|
refusal(fromSession, to, fromAgent, toName = to) {
|
|
@@ -248,15 +270,16 @@ function createHandOffDesk(deps) {
|
|
|
248
270
|
return "\u7ED3\u8BBA\u5DF2\u7ECF\u4EA4\u56DE\u53BB\u4E86\u3002\u8FD9\u4E00\u8F6E\u53EF\u4EE5\u7ED3\u675F\u4E86\u3002";
|
|
249
271
|
case "update":
|
|
250
272
|
if (!worker) {
|
|
251
|
-
thread.
|
|
252
|
-
|
|
253
|
-
|
|
273
|
+
await toWorker(thread, threadMessage({ from, kind, thread: id, title: thread.item.title, text }), () => {
|
|
274
|
+
thread.deferred = true;
|
|
275
|
+
return say(thread, from, "update", text);
|
|
276
|
+
});
|
|
254
277
|
return "\u5DF2\u7ECF\u544A\u8BC9\u5B83\u4E86\u3002\u6709\u7ED3\u679C\u8981\u56DE\u7B54\u5B83\u7684\u8BDD\uFF0C\u7528 kind: answer\u3002";
|
|
255
278
|
}
|
|
256
279
|
await say(thread, from, "update", text);
|
|
257
280
|
if (thread.item.fromSession === "")
|
|
258
281
|
return "\u8BB0\u4E0B\u4E86\u3002\u63A5\u7740\u505A\u3002";
|
|
259
|
-
toAsker(thread, threadMessage({ from, kind, thread: id, title: thread.item.title, text, reader: askerKind(thread.input.from?.agent) }), false);
|
|
282
|
+
await toAsker(thread, threadMessage({ from, kind, thread: id, title: thread.item.title, text, reader: askerKind(thread.input.from?.agent) }), false);
|
|
260
283
|
return "\u5DF2\u7ECF\u9001\u5230\u5BF9\u65B9\u90A3\u91CC\u4E86\u3002\u63A5\u7740\u505A\u3002";
|
|
261
284
|
case "question":
|
|
262
285
|
if (worker) {
|
|
@@ -264,11 +287,10 @@ function createHandOffDesk(deps) {
|
|
|
264
287
|
throw new Error(`\u8FD9\u4EF6\u4E8B\u662F${asker}\u4EA4\u7684\uFF0C\u6CA1\u6709\u4EBA\u7B49\u7740\u56DE\u7B54\uFF1A\u6309\u4F60\u81EA\u5DF1\u7684\u5224\u65AD\u505A\uFF0C\u628A\u8981\u95EE\u7684\u5199\u8FDB\u7ED3\u8BBA`);
|
|
265
288
|
thread.awaiting = true;
|
|
266
289
|
await say(thread, from, "question", text, { state: "waiting" });
|
|
267
|
-
toAsker(thread, threadMessage({ from, kind, thread: id, title: thread.item.title, text }), true);
|
|
290
|
+
await toAsker(thread, threadMessage({ from, kind, thread: id, title: thread.item.title, text }), true);
|
|
268
291
|
return `\u5DF2\u7ECF\u95EE\u4E86${asker}\u3002\u5B83\u56DE\u7B54\u540E\u4F1A\u4F5C\u4E3A\u4E00\u6761\u65B0\u6D88\u606F\u53D1\u5230\u8FD9\u91CC\uFF1A\u73B0\u5728\u7ED3\u675F\u8FD9\u4E00\u8F6E\uFF0C\u4E0D\u8981\u66FF\u5B83\u56DE\u7B54\u3002`;
|
|
269
292
|
}
|
|
270
|
-
toWorker(thread, threadMessage({ from, kind, thread: id, title: thread.item.title, text }));
|
|
271
|
-
await say(thread, from, "question", text);
|
|
293
|
+
await toWorker(thread, threadMessage({ from, kind, thread: id, title: thread.item.title, text }), () => say(thread, from, "question", text));
|
|
272
294
|
return `\u5DF2\u7ECF\u95EE\u4E86\u300C${thread.item.to}\u300D\u3002\u5B83\u56DE\u7B54\u540E\u4F1A\u4F5C\u4E3A\u4E00\u6761\u65B0\u6D88\u606F\u53D1\u5230\u8FD9\u91CC\uFF1A\u73B0\u5728\u7ED3\u675F\u8FD9\u4E00\u8F6E\u3002`;
|
|
273
295
|
case "answer":
|
|
274
296
|
if (!worker) {
|
|
@@ -276,7 +298,7 @@ function createHandOffDesk(deps) {
|
|
|
276
298
|
return "\u5DF2\u7ECF\u56DE\u7B54\u4E86\u3002\u73B0\u5728\u7ED3\u675F\u8FD9\u4E00\u8F6E\u3002";
|
|
277
299
|
}
|
|
278
300
|
await say(thread, from, "answer", text);
|
|
279
|
-
toAsker(thread, threadMessage({ from, kind, thread: id, title: thread.item.title, text, reader: askerKind(thread.input.from?.agent) }), false);
|
|
301
|
+
await toAsker(thread, threadMessage({ from, kind, thread: id, title: thread.item.title, text, reader: askerKind(thread.input.from?.agent) }), false);
|
|
280
302
|
return "\u5DF2\u7ECF\u56DE\u7B54\u4E86\u3002\u63A5\u7740\u505A\u3002";
|
|
281
303
|
}
|
|
282
304
|
},
|
|
@@ -399,7 +421,7 @@ function createHandOffDesk(deps) {
|
|
|
399
421
|
...thread.consulted.size === 0 ? {} : { consulted: [...thread.consulted] },
|
|
400
422
|
...input.from?.agent === void 0 || input.from.agent === MAIN ? {} : { toLead: true }
|
|
401
423
|
});
|
|
402
|
-
const back = deps.converse(fromSession, message2, AbortSignal.timeout(RELAY_TIMEOUT_MS));
|
|
424
|
+
const back = deps.converse(fromSession, message2, AbortSignal.timeout(RELAY_TIMEOUT_MS), [], { parentSessionId: parent?.item.ownerSession });
|
|
403
425
|
if (parent !== void 0 && live.has(parent.item.id))
|
|
404
426
|
parent.turns.push(back.catch(() => ({ blocks: [] })));
|
|
405
427
|
void back.then((answer) => input.relayed?.(answer), () => {
|
|
@@ -426,44 +448,65 @@ function sessionConversations(sessions, _cwd = () => void 0, focus, app) {
|
|
|
426
448
|
const converse = async (sessionId, text, signal, images = [], options = {}) => {
|
|
427
449
|
signal.throwIfAborted();
|
|
428
450
|
const controller = new AbortController();
|
|
451
|
+
const observing = AbortSignal.any([signal, controller.signal]);
|
|
429
452
|
const requestId = `notify-${crypto.randomUUID()}`;
|
|
430
453
|
const turn = { started: false };
|
|
431
|
-
let
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
454
|
+
let parent = options.parentSessionId;
|
|
455
|
+
let childMessageId;
|
|
456
|
+
let iterator;
|
|
457
|
+
const cancel = async () => {
|
|
458
|
+
if (parent !== void 0) {
|
|
459
|
+
if (turn.started || options.isolated)
|
|
460
|
+
app?.()?.stopSubAgent(sessionId);
|
|
461
|
+
else if (childMessageId !== void 0) {
|
|
462
|
+
await sessions.updateQueue?.({ sessionId, itemId: childMessageId, action: { kind: "remove" } });
|
|
463
|
+
}
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
if (turn.started || options.isolated) {
|
|
467
|
+
try {
|
|
468
|
+
await sessions.cancel?.({ sessionId });
|
|
469
|
+
} finally {
|
|
470
|
+
app?.()?.stopSubAgents?.(sessionId);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
if (!turn.started)
|
|
474
|
+
await unqueue(sessions, sessionId, requestId);
|
|
447
475
|
};
|
|
448
|
-
signal.addEventListener("abort", abort, { once: true });
|
|
449
476
|
try {
|
|
450
|
-
const
|
|
477
|
+
const summary = parent === void 0 ? (await sessions.list({}, observing)).items.find((s) => s.sessionId === sessionId) : void 0;
|
|
478
|
+
if (summary?.origin === "subagent") {
|
|
479
|
+
parent = summary.parentSessionId;
|
|
480
|
+
if (parent === void 0)
|
|
481
|
+
throw new Error("\u5B50\u4EFB\u52A1\u7F3A\u5C11\u6240\u5C5E\u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u6295\u9012\u6D88\u606F");
|
|
482
|
+
}
|
|
483
|
+
const id = sessionId;
|
|
484
|
+
const address = parent === void 0 ? { kind: "session", sessionId: id } : { kind: "subagent", parentSessionId: parent, childSessionId: id, mode: "unknown" };
|
|
485
|
+
iterator = sessions.follow({ address, assistantStream: true, maxMessages: 1 }, observing)[Symbol.asyncIterator]();
|
|
451
486
|
const first = await iterator.next();
|
|
452
487
|
if (first.done === true)
|
|
453
488
|
throw new Error("\u4F1A\u8BDD\u6CA1\u6709\u6253\u5F00");
|
|
454
|
-
|
|
489
|
+
const prompt = {
|
|
455
490
|
requestId,
|
|
456
|
-
sessionId,
|
|
457
|
-
mode: options.insert === true && await running(sessions, sessionId, controller.signal) ? "steer" : "queue",
|
|
458
491
|
content: [{ type: "text", text }, ...images.map((png) => ({ type: "image", mediaType: "image/png", data: png.toString("base64") }))],
|
|
459
492
|
clientTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
460
|
-
}
|
|
493
|
+
};
|
|
494
|
+
if (parent !== void 0) {
|
|
495
|
+
const receipt = await gateway().promptChild({ ...prompt, childSessionId: id, delivery: options.insert ? "steer" : "queue" }, observing);
|
|
496
|
+
childMessageId = receipt.messageId;
|
|
497
|
+
} else {
|
|
498
|
+
await sessions.prompt({ ...prompt, sessionId: id, mode: options.insert && summary?.running ? "steer" : "queue" }, observing);
|
|
499
|
+
}
|
|
500
|
+
signal.throwIfAborted();
|
|
501
|
+
options.onAccepted?.();
|
|
461
502
|
const settled = app?.()?.settled;
|
|
462
|
-
return await workReply(iterator, requestId, text, turn, settled === void 0 ? void 0 : () => settled.call(app(), sessionId,
|
|
503
|
+
return await workReply(iterator, requestId, text, turn, settled === void 0 ? void 0 : () => settled.call(app(), sessionId, observing), options.onWorkerReport);
|
|
463
504
|
} finally {
|
|
464
|
-
signal.removeEventListener("abort", abort);
|
|
465
505
|
controller.abort();
|
|
466
|
-
|
|
506
|
+
if (signal.aborted && iterator !== void 0)
|
|
507
|
+
await cancel().catch(() => {
|
|
508
|
+
});
|
|
509
|
+
await iterator?.return?.();
|
|
467
510
|
}
|
|
468
511
|
};
|
|
469
512
|
const gateway = () => {
|
|
@@ -525,10 +568,6 @@ function sessionConversations(sessions, _cwd = () => void 0, focus, app) {
|
|
|
525
568
|
converse
|
|
526
569
|
};
|
|
527
570
|
}
|
|
528
|
-
async function running(sessions, sessionId, signal) {
|
|
529
|
-
const { items } = await sessions.list({}, signal);
|
|
530
|
-
return items.find((s) => s.sessionId === sessionId)?.running === true;
|
|
531
|
-
}
|
|
532
571
|
async function unqueue(sessions, sessionId, requestId) {
|
|
533
572
|
if (sessions.updateQueue === void 0)
|
|
534
573
|
return;
|
|
@@ -38,10 +38,10 @@ import {
|
|
|
38
38
|
} from "./chunk-RGEGJH6R.js";
|
|
39
39
|
import {
|
|
40
40
|
sessionConversations
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-A6YQRWHZ.js";
|
|
42
42
|
import {
|
|
43
43
|
pluginVersion
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-6NJSSOB6.js";
|
|
45
45
|
import {
|
|
46
46
|
ExeIcons,
|
|
47
47
|
writeFileAtomic
|
|
@@ -22955,4 +22955,4 @@ export {
|
|
|
22955
22955
|
AdgScripts,
|
|
22956
22956
|
lib_default
|
|
22957
22957
|
};
|
|
22958
|
-
/*! For license information please see chunk-
|
|
22958
|
+
/*! For license information please see chunk-YTIR5JW4.js.LEGAL.txt */
|
package/lib/feishu.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire as __adgCreateRequire } from 'node:module'; import { dirn
|
|
|
2
2
|
import {
|
|
3
3
|
replyMarkdown,
|
|
4
4
|
replyPlain
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-A6YQRWHZ.js";
|
|
6
6
|
import {
|
|
7
7
|
require_extension,
|
|
8
8
|
require_permessage_deflate,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
require_subprotocol,
|
|
13
13
|
require_websocket,
|
|
14
14
|
require_websocket_server
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6NJSSOB6.js";
|
|
16
16
|
import "./chunk-KMVQK5CI.js";
|
|
17
17
|
import {
|
|
18
18
|
writeFileAtomic
|
package/lib/game-intel.js
CHANGED
package/lib/gateway.js
CHANGED
package/lib/intervene.js
CHANGED
|
@@ -2,8 +2,8 @@ import { createRequire as __adgCreateRequire } from 'node:module'; import { dirn
|
|
|
2
2
|
import {
|
|
3
3
|
finalText,
|
|
4
4
|
sessionConversations
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-A6YQRWHZ.js";
|
|
6
|
+
import "./chunk-6NJSSOB6.js";
|
|
7
7
|
import "./chunk-KMVQK5CI.js";
|
|
8
8
|
import {
|
|
9
9
|
writeFileAtomic
|
package/lib/notify.js
CHANGED
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
replyPlain,
|
|
17
17
|
sessionConversations,
|
|
18
18
|
textReply
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-A6YQRWHZ.js";
|
|
20
|
+
import "./chunk-6NJSSOB6.js";
|
|
21
21
|
import "./chunk-KMVQK5CI.js";
|
|
22
22
|
import "./chunk-RESS7WVY.js";
|
|
23
23
|
import "./chunk-LXHF6AKU.js";
|
package/lib/orchestrator.js
CHANGED
package/lib/qqbot.js
CHANGED
package/lib/script-registry.js
CHANGED
|
@@ -17,11 +17,11 @@ import {
|
|
|
17
17
|
packForRepo,
|
|
18
18
|
parseMcpConfig,
|
|
19
19
|
readSkills
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YTIR5JW4.js";
|
|
21
21
|
import "./chunk-B4UT4NYH.js";
|
|
22
22
|
import "./chunk-RGEGJH6R.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-A6YQRWHZ.js";
|
|
24
|
+
import "./chunk-6NJSSOB6.js";
|
|
25
25
|
import "./chunk-KMVQK5CI.js";
|
|
26
26
|
import "./chunk-RESS7WVY.js";
|
|
27
27
|
import "./chunk-LXHF6AKU.js";
|
package/package.json
CHANGED
|
File without changes
|