dsh-multigameassistant 2.2.1 → 2.2.2
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 +6 -6
- package/lib/browser.js +5 -1
- package/lib/{chunk-YSTZL6HE.js → chunk-6YPSKAQ5.js} +161 -123
- package/lib/{chunk-NOZCFSQP.js → chunk-CCYE6H2F.js} +32 -18
- package/lib/{chunk-OFVGRKTD.js → chunk-DSWWQWQH.js} +137 -23
- package/lib/{chunk-52LYI7WP.js → chunk-KMVQK5CI.js} +1 -1
- package/lib/{chunk-F7ZQE7BT.js → chunk-LXHF6AKU.js} +38 -15
- package/lib/{chunk-IBPJC6DX.js → chunk-RGEGJH6R.js} +1 -1
- package/lib/{chunk-EOZKHLHK.js → chunk-TELJUUBZ.js} +28 -5
- package/lib/emulator.js +1 -1
- package/lib/feishu.js +4 -4
- package/lib/game-intel.js +4279 -348
- package/lib/gateway.js +3 -3
- package/lib/guard.js +1 -1
- package/lib/intervene.js +19 -9
- package/lib/low-context.js +2 -2
- package/lib/monitor.js +20 -3
- package/lib/notify.js +4 -4
- package/lib/orchestrator.js +67 -12
- package/lib/qqbot.js +4 -4
- package/lib/runner.js +3 -3
- package/lib/scheduler.js +1 -1
- package/lib/script-registry.js +6 -6
- package/package.json +1 -1
- package/skills/web-reading.md +2 -2
- package/web/assets/index-DwItOcWq.css +1 -0
- package/web/assets/index-YiJ--jV1.js +255 -0
- package/web/assets/index-YiJ--jV1.js.map +1 -0
- package/web/index.html +2 -2
- package/web/assets/index-BBPTH2CM.css +0 -1
- package/web/assets/index-DRxvDcu6.js +0 -245
- package/web/assets/index-DRxvDcu6.js.map +0 -1
- /package/lib/{chunk-NOZCFSQP.js.LEGAL.txt → chunk-CCYE6H2F.js.LEGAL.txt} +0 -0
package/lib/gateway.js
CHANGED
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
pluginVersion,
|
|
24
24
|
streamFacts,
|
|
25
25
|
userSkills
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-DSWWQWQH.js";
|
|
27
|
+
import "./chunk-KMVQK5CI.js";
|
|
28
28
|
import "./chunk-RESS7WVY.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-LXHF6AKU.js";
|
|
30
30
|
import "./chunk-6DSSLS7I.js";
|
|
31
31
|
import "./chunk-2UFLGPDY.js";
|
|
32
32
|
export {
|
package/lib/guard.js
CHANGED
|
@@ -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
|
GUARD_CAPABILITY
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LXHF6AKU.js";
|
|
5
5
|
import "./chunk-6DSSLS7I.js";
|
|
6
6
|
import "./chunk-2UFLGPDY.js";
|
|
7
7
|
|
package/lib/intervene.js
CHANGED
|
@@ -2,16 +2,16 @@ import { createRequire as __adgCreateRequire } from 'node:module'; import { dirn
|
|
|
2
2
|
import {
|
|
3
3
|
finalText,
|
|
4
4
|
sessionConversations
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-6YPSKAQ5.js";
|
|
6
|
+
import "./chunk-DSWWQWQH.js";
|
|
7
|
+
import "./chunk-KMVQK5CI.js";
|
|
8
8
|
import {
|
|
9
9
|
writeFileAtomic
|
|
10
10
|
} from "./chunk-RESS7WVY.js";
|
|
11
11
|
import {
|
|
12
12
|
INTERVENE_CAPABILITY,
|
|
13
13
|
UPDATE_RULE
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LXHF6AKU.js";
|
|
15
15
|
import {
|
|
16
16
|
external_exports
|
|
17
17
|
} from "./chunk-6DSSLS7I.js";
|
|
@@ -135,10 +135,12 @@ var Interventions = class {
|
|
|
135
135
|
}
|
|
136
136
|
/** The intervention a session is doing, for the screen tools' permissions: the first still going (its turn is the one running). */
|
|
137
137
|
forSession(sessionId) {
|
|
138
|
-
const ids = sessionId === void 0 ? void 0 : this.#bySession.get(this.#deps.parentOf?.(sessionId) ?? sessionId);
|
|
139
|
-
|
|
138
|
+
const ids = sessionId === void 0 ? void 0 : this.#bySession.get(sessionId) ?? this.#bySession.get(this.#deps.parentOf?.(sessionId) ?? sessionId);
|
|
139
|
+
if (ids?.length !== 1)
|
|
140
|
+
return void 0;
|
|
141
|
+
for (const id of ids) {
|
|
140
142
|
const active = this.#active.get(id);
|
|
141
|
-
if (active
|
|
143
|
+
if (active && (!active.workerId || active.workerId === sessionId || active.workerId === this.#deps.parentOf?.(sessionId)))
|
|
142
144
|
return active;
|
|
143
145
|
}
|
|
144
146
|
return void 0;
|
|
@@ -276,10 +278,11 @@ var Interventions = class {
|
|
|
276
278
|
this.#active.set(item.id, active);
|
|
277
279
|
let answer = "";
|
|
278
280
|
const limitMs = this.#deps.timeoutMs ?? 15 * 6e4;
|
|
281
|
+
let worker;
|
|
279
282
|
const timeout = AbortSignal.timeout(limitMs);
|
|
280
283
|
try {
|
|
281
284
|
const focus = { scripts: [incident.scriptId] };
|
|
282
|
-
const sessionId = await conversations.home(INTERVENE_ROLE.id
|
|
285
|
+
const sessionId = await conversations.home(INTERVENE_ROLE.id);
|
|
283
286
|
item.sessionId = sessionId;
|
|
284
287
|
this.#bySession.set(sessionId, [...this.#bySession.get(sessionId) ?? [], item.id]);
|
|
285
288
|
this.#changed(item);
|
|
@@ -289,6 +292,10 @@ var Interventions = class {
|
|
|
289
292
|
title: incident.title,
|
|
290
293
|
focus,
|
|
291
294
|
relay: true,
|
|
295
|
+
onWorker: (id) => {
|
|
296
|
+
worker = active.workerId = id;
|
|
297
|
+
this.#bySession.set(id, [item.id]);
|
|
298
|
+
},
|
|
292
299
|
task: this.#prompt(incident, mode, item.paused, alive, run?.resources ?? [], windows, related),
|
|
293
300
|
signal: AbortSignal.any([active.controller.signal, timeout]),
|
|
294
301
|
...screenshot === void 0 ? {} : { images: [screenshot] }
|
|
@@ -303,6 +310,8 @@ var Interventions = class {
|
|
|
303
310
|
return finish("gave-up", `agent \u5904\u7406\u65F6\u51FA\u9519\uFF1A${error instanceof Error ? error.message : String(error)}`, imageOf(active, screenshot));
|
|
304
311
|
} finally {
|
|
305
312
|
this.#active.delete(item.id);
|
|
313
|
+
if (worker && worker !== item.sessionId)
|
|
314
|
+
this.#bySession.delete(worker);
|
|
306
315
|
if (item.sessionId !== void 0) {
|
|
307
316
|
const left = (this.#bySession.get(item.sessionId) ?? []).filter((id) => id !== item.id);
|
|
308
317
|
if (left.length > 0)
|
|
@@ -349,7 +358,7 @@ var Interventions = class {
|
|
|
349
358
|
const item = this.#items.find((i) => i.incidentId === incidentId && i.state === "running");
|
|
350
359
|
if (item === void 0)
|
|
351
360
|
return;
|
|
352
|
-
if (summary !== void 0 && item.sessionId !== void 0 && this.#bySession.get(item.sessionId)?.[0] === item.id)
|
|
361
|
+
if (summary !== void 0 && (this.#active.get(item.id)?.workerId || item.sessionId !== void 0 && this.#bySession.get(item.sessionId)?.[0] === item.id))
|
|
353
362
|
return;
|
|
354
363
|
Object.assign(item, { state: "taken-over", summary: summary ?? `\u4F60\u5DF2\u7ECF\u70B9\u4E86\u300C${why}\u300D\uFF0Cagent \u5DF2\u505C\u6B62`, endedAt: this.#now() });
|
|
355
364
|
this.#active.get(item.id)?.controller.abort(new Error(`\u7528\u6237\u70B9\u4E86\u300C${why}\u300D`));
|
|
@@ -429,6 +438,7 @@ var Interventions = class {
|
|
|
429
438
|
].join("\n") : "\u8FD9\u6B21\u53EA\u505A\u8BCA\u65AD\uFF1A\u53EF\u4EE5\u7528 screen_capture \u622A\u56FE\u67E5\u770B\uFF0C\u4F46\u4E0D\u8981\u70B9\u51FB\u6216\u8F93\u5165\u3002\u8BF4\u660E\u539F\u56E0\u548C\u5EFA\u8BAE\u3002",
|
|
430
439
|
"\u4E0D\u8981\u4FEE\u6539\u811A\u672C\u7684\u6587\u4EF6\uFF1B\u4E0D\u8981\u4ED8\u8D39\u3001\u4E0D\u8981\u8F93\u5165\u5BC6\u7801\u6216\u9A8C\u8BC1\u7801\uFF08\u9700\u8981\u7684\u8BDD\u4EA4\u7ED9\u7528\u6237\uFF09\u3002\u65C1\u8FB9\u53EF\u80FD\u6CA1\u6709\u4EBA\uFF1A\u4E0D\u8981\u7528 ask_user_question \u63D0\u95EE\uFF0C\u9700\u8981\u7528\u6237\u505A\u7684\u5199\u8FDB summary\u3002",
|
|
431
440
|
"",
|
|
441
|
+
`\u9700\u8981\u81EA\u884C\u8865\u507F\u5DF2\u5931\u8D25\u7684\u8FD9\u6B21\u8FD0\u884C\u65F6\uFF0Cscript_run \u4F20 repair_of=${incident.runId}\uFF0C\u8BA9\u6D41\u6C34\u7EBF\u5173\u8054\u8865\u507F\u7ED3\u679C\u3002\u5DF2\u7ECF\u6210\u529F\u8865\u507F\u540E\u7528 resolved \u4EA4\u4ED8\u3002`,
|
|
432
442
|
"\u6700\u540E\u5FC5\u987B\u8C03\u7528 intervention_done\uFF1Aresolved\uFF08\u5DF2\u7ECF\u6062\u590D\uFF0C\u811A\u672C\u53EF\u4EE5\u7EE7\u7EED\uFF09\u3001retry\uFF08\u9700\u8981\u91CD\u65B0\u8FD0\u884C\u8FD9\u4E2A\u4EFB\u52A1\uFF09\u6216 give-up\uFF08\u5904\u7406\u4E0D\u4E86\uFF09\u3002summary \u7528\u4E00\u4E24\u53E5\u8BDD\u5199\u6E05\u695A\u539F\u56E0\u3001\u4F60\u505A\u4E86\u4EC0\u4E48\u3001\u9700\u8981\u7528\u6237\u505A\u4EC0\u4E48\u3002"
|
|
433
443
|
].join("\n");
|
|
434
444
|
}
|
package/lib/low-context.js
CHANGED
|
@@ -38,8 +38,8 @@ import {
|
|
|
38
38
|
summaryTarget,
|
|
39
39
|
summaryText,
|
|
40
40
|
taskOver
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-
|
|
41
|
+
} from "./chunk-KMVQK5CI.js";
|
|
42
|
+
import "./chunk-LXHF6AKU.js";
|
|
43
43
|
import "./chunk-6DSSLS7I.js";
|
|
44
44
|
import "./chunk-2UFLGPDY.js";
|
|
45
45
|
export {
|
package/lib/monitor.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
parseDuration
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-TELJUUBZ.js";
|
|
5
|
+
import "./chunk-RGEGJH6R.js";
|
|
6
6
|
import {
|
|
7
7
|
writeFileAtomic
|
|
8
8
|
} from "./chunk-RESS7WVY.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Incident,
|
|
11
11
|
MONITOR_CAPABILITY,
|
|
12
12
|
MonitorSettings
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LXHF6AKU.js";
|
|
14
14
|
import {
|
|
15
15
|
external_exports
|
|
16
16
|
} from "./chunk-6DSSLS7I.js";
|
|
@@ -260,6 +260,10 @@ var Monitor = class {
|
|
|
260
260
|
const { run } = watched;
|
|
261
261
|
if (run.endedAt !== void 0 || run.state !== "running")
|
|
262
262
|
continue;
|
|
263
|
+
if (watched.unknownScreen && now - watched.unknownScreen.since >= 1e4 && !watched.unknownIncident) {
|
|
264
|
+
watched.unknownIncident = this.#raise(run, "warning", "screen-unknown", watched.unknownScreen.text).id;
|
|
265
|
+
watched.unknownScreen = void 0;
|
|
266
|
+
}
|
|
263
267
|
const manifest = this.#deps.packOf(run.scriptId)?.manifest;
|
|
264
268
|
const stall = this.stallFor(run.scriptId);
|
|
265
269
|
const held = this.#held(run.id);
|
|
@@ -314,12 +318,25 @@ var Monitor = class {
|
|
|
314
318
|
watched.stalled = void 0;
|
|
315
319
|
}
|
|
316
320
|
}
|
|
321
|
+
const screen = line.source === "adg" ? void 0 : /当前界面[::]\s*(\S+)/.exec(line.text)?.[1];
|
|
322
|
+
if (screen && screen !== "\u672A\u77E5") {
|
|
323
|
+
watched.unknownScreen = void 0;
|
|
324
|
+
const incident = watched.unknownIncident && this.#incidents.find((i) => i.id === watched.unknownIncident);
|
|
325
|
+
if (incident && incident.status === "open")
|
|
326
|
+
this.#resolve(incident, `\u5DF2\u8BC6\u522B\u5230\u754C\u9762\uFF1A${screen}`);
|
|
327
|
+
watched.unknownIncident = void 0;
|
|
328
|
+
}
|
|
317
329
|
if (line.level !== "error" && line.level !== "warning")
|
|
318
330
|
return;
|
|
319
331
|
if (run.halted === true || run.state === "stopping")
|
|
320
332
|
return;
|
|
321
333
|
if (run.state === "succeeded")
|
|
322
334
|
return;
|
|
335
|
+
if (screen === "\u672A\u77E5" && line.level === "warning") {
|
|
336
|
+
if (!watched.unknownIncident)
|
|
337
|
+
watched.unknownScreen ??= { since: this.#now(), text: line.text };
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
323
340
|
const tag = line.tag ?? line.level;
|
|
324
341
|
if (this.#incidents.some((i) => i.runId === run.id && i.tag === tag && i.status === "open"))
|
|
325
342
|
return;
|
package/lib/notify.js
CHANGED
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
replyPlain,
|
|
17
17
|
sessionConversations,
|
|
18
18
|
textReply
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-6YPSKAQ5.js";
|
|
20
|
+
import "./chunk-DSWWQWQH.js";
|
|
21
|
+
import "./chunk-KMVQK5CI.js";
|
|
22
22
|
import "./chunk-RESS7WVY.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-LXHF6AKU.js";
|
|
24
24
|
import "./chunk-6DSSLS7I.js";
|
|
25
25
|
import "./chunk-2UFLGPDY.js";
|
|
26
26
|
export {
|
package/lib/orchestrator.js
CHANGED
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
PARAMS_SCHEMA,
|
|
5
5
|
parseDuration,
|
|
6
6
|
taskParams
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TELJUUBZ.js";
|
|
8
8
|
import {
|
|
9
9
|
TaskInputError,
|
|
10
10
|
renderTask
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RGEGJH6R.js";
|
|
12
12
|
import {
|
|
13
13
|
MAIN,
|
|
14
14
|
finalText,
|
|
15
15
|
sessionConversations
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-6YPSKAQ5.js";
|
|
17
|
+
import "./chunk-DSWWQWQH.js";
|
|
18
|
+
import "./chunk-KMVQK5CI.js";
|
|
19
19
|
import {
|
|
20
20
|
writeFileAtomic
|
|
21
21
|
} from "./chunk-RESS7WVY.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
isMarker,
|
|
34
34
|
taskMessage,
|
|
35
35
|
withStartEnd
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-LXHF6AKU.js";
|
|
37
37
|
import {
|
|
38
38
|
external_exports
|
|
39
39
|
} from "./chunk-6DSSLS7I.js";
|
|
@@ -504,9 +504,10 @@ var Engine = class {
|
|
|
504
504
|
const conversations = this.#deps.conversations();
|
|
505
505
|
if (conversations === void 0)
|
|
506
506
|
return { ok: false, detail: "agent \u73B0\u5728\u4E0D\u53EF\u7528\uFF08\u4F1A\u8BDD\u670D\u52A1\u6CA1\u6709\u52A0\u8F7D\uFF09" };
|
|
507
|
-
|
|
507
|
+
const title = node.title ?? active.pipeline.name;
|
|
508
|
+
const work = await conversations.prepareTask(PIPELINE_ROLE.id, title);
|
|
508
509
|
const prompt = node.prompt.trimStart().startsWith("/") ? expandSlash(node.prompt, await this.#deps.skills?.().catch(() => []) ?? []) : node.prompt;
|
|
509
|
-
const answer = await
|
|
510
|
+
const answer = await work.run(taskMessage(`\u6D41\u6C34\u7EBF\u300C${active.pipeline.name}\u300D`, node.title ?? active.pipeline.name, `${prompt}
|
|
510
511
|
|
|
511
512
|
${NO_QUESTIONS}`), signal);
|
|
512
513
|
const clipped = answer.length > 300 ? `${answer.slice(0, 300)}\u2026` : answer;
|
|
@@ -521,7 +522,9 @@ ${NO_QUESTIONS}`), signal);
|
|
|
521
522
|
}
|
|
522
523
|
case "notify": {
|
|
523
524
|
const sink = this.#deps.notices();
|
|
524
|
-
const
|
|
525
|
+
const legacyDaily = node.text === "\u56DB\u6E38\u620F\u65E5\u5E38\u8DD1\u5B8C\uFF1A\u65B9\u821F/\u7EC8\u672B\u5730 \u2192 \u661F\u94C1 \u2192 \u9E23\u6F6E\uFF08\u661F\u94C1\u4E0E\u9E23\u6F6E\u5DF2\u6539\u6210\u4E32\u884C\uFF0C\u4E0D\u518D\u4E92\u76F8\u62A2\u5C4F\u5E55\uFF09";
|
|
526
|
+
const text = legacyDaily ? this.#taskResults(active).join("\n") : node.text.replaceAll("{\u8FD0\u884C\u7ED3\u679C}", () => this.#taskResults(active).join("\n"));
|
|
527
|
+
const reached = sink === void 0 ? [] : await sink.send({ id: `pipeline:${active.run.id}:${node.id}`, scope: "pipeline", title: active.pipeline.name, text, severity: "info" });
|
|
525
528
|
return { ok: true, detail: reached.length > 0 ? `\u5DF2\u53D1\u9001\uFF08${reached.join("\u3001")}\uFF09` : "\u6CA1\u6709\u53EF\u7528\u7684\u6D88\u606F\u6E20\u9053\uFF0C\u672A\u53D1\u9001" };
|
|
526
529
|
}
|
|
527
530
|
case "start":
|
|
@@ -585,6 +588,13 @@ ${NO_QUESTIONS}`), signal);
|
|
|
585
588
|
const going = active.pipeline.nodes.filter((n) => active.run.nodes[n.id]?.state === "running").map((n) => `\u300C${nodeLabel(n, this.#deps.library)}\u300D`);
|
|
586
589
|
return going.length === 0 ? "\u6B63\u5728\u6536\u5C3E\u2026" : `\u6B63\u5728\u7ED3\u675F${going.join("\u3001")}\u7684\u8FDB\u7A0B\u2026`;
|
|
587
590
|
}
|
|
591
|
+
#taskResults(active) {
|
|
592
|
+
return active.pipeline.nodes.filter((node) => node.kind === "script-task" && !active.passed.has(node.id)).map((node) => {
|
|
593
|
+
const result = active.run.nodes[node.id];
|
|
594
|
+
const attempts = result.runIds.length > 1 ? `\uFF08\u5171 ${result.runIds.length} \u6B21\u8FD0\u884C\uFF09` : "";
|
|
595
|
+
return `${nodeLabel(node, this.#deps.library)}\uFF1A${STATE_WORD[result.state]}${attempts}`;
|
|
596
|
+
});
|
|
597
|
+
}
|
|
588
598
|
async #finish(active) {
|
|
589
599
|
const { run, pipeline } = active;
|
|
590
600
|
if (run.state !== "running" || active.finishing === true)
|
|
@@ -631,7 +641,7 @@ ${NO_QUESTIONS}`), signal);
|
|
|
631
641
|
scope: "pipeline",
|
|
632
642
|
severity: run.state === "succeeded" ? "success" : "warning",
|
|
633
643
|
title: `${pipeline.name}\uFF1A${run.state === "succeeded" ? "\u5DF2\u5B8C\u6210" : run.state === "failed" ? "\u6709\u5931\u8D25" : "\u5DF2\u53D6\u6D88"}`,
|
|
634
|
-
text: [`${TRIGGER[run.trigger.kind]}\u8FD0\u884C\uFF0C${run.outcome}`, `\u7528\u65F6 ${Math.max(1, Math.round((run.endedAt - run.startedAt) / 6e4))} \u5206\u949F`, ...failed].join("\n")
|
|
644
|
+
text: [`${TRIGGER[run.trigger.kind]}\u8FD0\u884C\uFF0C${run.outcome}`, `\u7528\u65F6 ${Math.max(1, Math.round((run.endedAt - run.startedAt) / 6e4))} \u5206\u949F`, ...this.#taskResults(active), ...failed].join("\n")
|
|
635
645
|
}).catch(() => {
|
|
636
646
|
});
|
|
637
647
|
}
|
|
@@ -786,6 +796,26 @@ var Pipelines = class {
|
|
|
786
796
|
if (run.state !== "running" || index === -1)
|
|
787
797
|
void this.#store.saveRuns(this.#runs);
|
|
788
798
|
}
|
|
799
|
+
recordRepair(repair) {
|
|
800
|
+
if (!repair.retryOf || repair.endedAt === void 0 || repair.state !== "succeeded" && repair.state !== "cancelled" && repair.state !== "failed")
|
|
801
|
+
return;
|
|
802
|
+
for (const original of this.#runs) {
|
|
803
|
+
if (original.state === "running")
|
|
804
|
+
continue;
|
|
805
|
+
const entry = Object.entries(original.nodes).find(([, node2]) => node2.state === "failed" && node2.runIds.at(-1) === repair.retryOf);
|
|
806
|
+
if (!entry)
|
|
807
|
+
continue;
|
|
808
|
+
const [key, node] = entry;
|
|
809
|
+
const updated = { ...original, nodes: { ...original.nodes, [key]: {
|
|
810
|
+
...node,
|
|
811
|
+
runIds: [...node.runIds, repair.id],
|
|
812
|
+
repair: { runId: repair.id, state: repair.state, at: repair.endedAt }
|
|
813
|
+
} } };
|
|
814
|
+
this.recordRun(updated);
|
|
815
|
+
this.#changed();
|
|
816
|
+
return updated;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
789
819
|
list() {
|
|
790
820
|
return [...this.#pipelines.values()].sort((a, b) => a.name.localeCompare(b.name, "zh-CN")).map((p) => {
|
|
791
821
|
const last = this.runs(p.id, 1)[0];
|
|
@@ -1529,7 +1559,21 @@ var AdgOrchestrator = class extends Service {
|
|
|
1529
1559
|
},
|
|
1530
1560
|
emulators: () => {
|
|
1531
1561
|
const emulators = ctx.get("adgEmulators");
|
|
1532
|
-
|
|
1562
|
+
if (!emulators)
|
|
1563
|
+
return void 0;
|
|
1564
|
+
return { stop: async () => {
|
|
1565
|
+
const address = await emulators.expectedAddress?.();
|
|
1566
|
+
if (!address) {
|
|
1567
|
+
log.warn("\u6D41\u6C34\u7EBF\u6536\u5C3E\u65F6\u65E0\u6CD5\u786E\u8BA4\u6A21\u62DF\u5668\u5730\u5740\uFF0C\u5DF2\u4FDD\u7559\u5B9E\u4F8B");
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
const release2 = ctx.adgRunner.runner.locks.acquire([`adb:${address}`], { runId: "pipeline-cleanup", label: "\u6D41\u6C34\u7EBF\u6536\u5C3E" });
|
|
1571
|
+
try {
|
|
1572
|
+
await emulators.stop();
|
|
1573
|
+
} finally {
|
|
1574
|
+
release2();
|
|
1575
|
+
}
|
|
1576
|
+
} };
|
|
1533
1577
|
},
|
|
1534
1578
|
onRun: (run) => {
|
|
1535
1579
|
pipelines.recordRun(run);
|
|
@@ -1545,7 +1589,7 @@ var AdgOrchestrator = class extends Service {
|
|
|
1545
1589
|
if (talk === void 0)
|
|
1546
1590
|
throw new Error("\u5BF9\u8BDD\u529F\u80FD\u8FD8\u6CA1\u51C6\u5907\u597D");
|
|
1547
1591
|
if (task.agent === MAIN)
|
|
1548
|
-
return
|
|
1592
|
+
return (await talk.prepareTask(MAIN, task.title)).run(taskMessage(TASK_BY, task.title, task.prompt), signal);
|
|
1549
1593
|
const agent = ctx.get("adgGateway")?.roles.list().find((r) => r.id === task.agent);
|
|
1550
1594
|
if (agent === void 0)
|
|
1551
1595
|
throw new Error(`\u6CA1\u6709\u300C${task.agent}\u300D\u8FD9\u4E2A agent \u4E86`);
|
|
@@ -1557,6 +1601,17 @@ var AdgOrchestrator = class extends Service {
|
|
|
1557
1601
|
this.engine = engine;
|
|
1558
1602
|
this.pipelines = pipelines;
|
|
1559
1603
|
this.tasks = tasks;
|
|
1604
|
+
ctx.effect(() => ctx.adgRunner.runner.watch({ state: (run) => {
|
|
1605
|
+
if (!run.retryOf || run.endedAt === void 0)
|
|
1606
|
+
return;
|
|
1607
|
+
void this.ready.then(() => {
|
|
1608
|
+
const history = pipelines.recordRepair(run);
|
|
1609
|
+
if (history) {
|
|
1610
|
+
ctx.get("adgGateway")?.broadcast("pipelines/run", history);
|
|
1611
|
+
return ctx.get("adgNotify")?.update(`pipeline:${history.id}:summary`, { done: `${run.scriptName} \u8865\u507F${run.state === "succeeded" ? "\u6210\u529F" : "\u672A\u6210\u529F"}\uFF08${run.id}\uFF09` });
|
|
1612
|
+
}
|
|
1613
|
+
}).catch((error) => log.warn(String(error)));
|
|
1614
|
+
} }), "adg-orchestrator repair results");
|
|
1560
1615
|
this.ready = scripts.ready.then(() => Promise.all([pipelines.load({ warn: (m) => log.warn(m) }), tasks.load()])).then(() => {
|
|
1561
1616
|
});
|
|
1562
1617
|
ctx.effect(() => () => engine.dispose(), "adg-orchestrator engine");
|
package/lib/qqbot.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
questionText,
|
|
5
5
|
replyMarkdown,
|
|
6
6
|
replyPlain
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-6YPSKAQ5.js";
|
|
8
|
+
import "./chunk-DSWWQWQH.js";
|
|
9
|
+
import "./chunk-KMVQK5CI.js";
|
|
10
10
|
import {
|
|
11
11
|
writeFileAtomic
|
|
12
12
|
} from "./chunk-RESS7WVY.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
QQBOT_SECRET_REF,
|
|
16
16
|
QQPending,
|
|
17
17
|
QQSettings
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LXHF6AKU.js";
|
|
19
19
|
import {
|
|
20
20
|
external_exports
|
|
21
21
|
} from "./chunk-6DSSLS7I.js";
|
package/lib/runner.js
CHANGED
|
@@ -25,9 +25,9 @@ import {
|
|
|
25
25
|
setIn,
|
|
26
26
|
taskParams,
|
|
27
27
|
tidyRuns
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-TELJUUBZ.js";
|
|
29
|
+
import "./chunk-RGEGJH6R.js";
|
|
30
|
+
import "./chunk-LXHF6AKU.js";
|
|
31
31
|
import "./chunk-6DSSLS7I.js";
|
|
32
32
|
import "./chunk-2UFLGPDY.js";
|
|
33
33
|
export {
|
package/lib/scheduler.js
CHANGED
|
@@ -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
|
SCHEDULE_CAPABILITY
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LXHF6AKU.js";
|
|
5
5
|
import {
|
|
6
6
|
external_exports
|
|
7
7
|
} from "./chunk-6DSSLS7I.js";
|
package/lib/script-registry.js
CHANGED
|
@@ -17,14 +17,14 @@ import {
|
|
|
17
17
|
packForRepo,
|
|
18
18
|
parseMcpConfig,
|
|
19
19
|
readSkills
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CCYE6H2F.js";
|
|
21
21
|
import "./chunk-B4UT4NYH.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-RGEGJH6R.js";
|
|
23
|
+
import "./chunk-6YPSKAQ5.js";
|
|
24
|
+
import "./chunk-DSWWQWQH.js";
|
|
25
|
+
import "./chunk-KMVQK5CI.js";
|
|
26
26
|
import "./chunk-RESS7WVY.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-LXHF6AKU.js";
|
|
28
28
|
import "./chunk-6DSSLS7I.js";
|
|
29
29
|
import "./chunk-2UFLGPDY.js";
|
|
30
30
|
export {
|
package/package.json
CHANGED
package/skills/web-reading.md
CHANGED
|
@@ -19,7 +19,7 @@ description: 从网上查游戏资讯(版本、活动、卡池、维护公告
|
|
|
19
19
|
## 你的工具能拿到什么
|
|
20
20
|
|
|
21
21
|
- `web_fetch`:JSON、XML(RSS)**原样返回**,字段和图片地址都在;HTML 转成 Markdown,图片是 ``、链接是 `[文字](地址)`,可以直接从里面取图片和文章链接。但 `<head>` 里的分享图(og:image)和页面脚本里的数据会被去掉;懒加载的图片地址可能是占位图(`data:`、`loading`、`blank`、1×1 小图),这时去找源头接口。前端渲染的官网只拿到标题或空壳。
|
|
22
|
-
- 内置浏览器 `browser_
|
|
22
|
+
- 内置浏览器 `browser_*`:能读前端渲染的页面。`browser_text` 的 `images` 返回页面分享图和正文图的 HTTPS 候选地址,结合文章内容选取配图。页面快照中的链接只有文字;点进一个链接后,返回的页面内容第一行就是它的网址。要看图片里的字(海报上的活动时间、奖励表)用 `browser_screenshot`(模型要能看图);浏览器截图只给你看,不能当配图存下来。
|
|
23
23
|
- 在 `run_code` 程序里调用 `web_fetch` 时:在程序里解析 JSON / XML,用代码取出标题、日期、网址、图片地址和要的那几段正文,只把这些返回,不要把整页返回到对话里。
|
|
24
24
|
|
|
25
25
|
## 先后顺序
|
|
@@ -70,7 +70,7 @@ description: 从网上查游戏资讯(版本、活动、卡池、维护公告
|
|
|
70
70
|
## 记下来
|
|
71
71
|
|
|
72
72
|
- 查到的活动用 `game_record`(`source: site`,带上 `url`,有配图写进 `cover`)写进日历,以后看板、日报都能用,不用再查一遍。
|
|
73
|
-
- 版本更新、补丁说明、长期有效的公告这些没有起止时间的,用 `game_notice` 记到游戏的「公告」里(kind=update / notice / news,长期的 lasting=true;`summary`
|
|
73
|
+
- 版本更新、补丁说明、长期有效的公告这些没有起止时间的,用 `game_notice` 记到游戏的「公告」里(kind=update / notice / news,长期的 lasting=true;`summary` 写一两句中文要点。读到全文时,将原文段落和本文图片按阅读顺序写进 `article`,封面另存到 `cover`)。单机游戏主要记这个。
|
|
74
74
|
列表上最近的每一篇都记(单机游戏最近三个月、网游最近一个月,最多 20 篇,一次 `game_notice` 可以记 30 篇);没点开的那些不写 `summary`,标题、日期、网址照列表写。综合新闻站(一个厂商的多款游戏)只记这个游戏的。
|
|
75
75
|
- 回答用户时把要点讲全,附上网址;用户要看图就给图片地址。
|
|
76
76
|
- 某个游戏有好用的固定接口,但游戏包里还没有:告诉用户可以在游戏包的 `game.yaml` 里加一个来源(`sra: { game: … }`、`smw: …` 或 `steam: { appid: … }`),以后插件每天自己读,不花模型。
|