dsh-multigameassistant 2.2.0 → 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-I4NHWXKH.js → chunk-6YPSKAQ5.js} +169 -123
- package/lib/{chunk-J4QJC6UZ.js → chunk-CCYE6H2F.js} +32 -18
- package/lib/{chunk-KTOQFJ7R.js → chunk-DSWWQWQH.js} +423 -26
- package/lib/{chunk-ICJLH3DP.js → chunk-KMVQK5CI.js} +1 -1
- package/lib/{chunk-NEUZQ7TI.js → chunk-LXHF6AKU.js} +91 -16
- package/lib/{chunk-26JIEF6M.js → chunk-RGEGJH6R.js} +1 -1
- package/lib/{chunk-EKTA4OYC.js → chunk-TELJUUBZ.js} +28 -5
- package/lib/emulator.js +1 -1
- package/lib/feishu.js +4 -4
- package/lib/game-intel.js +4363 -365
- 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/game-intel.md +4 -3
- package/skills/web-reading.md +51 -19
- 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-C5cMI4PK.css +0 -1
- package/web/assets/index-ClYIoZUR.js +0 -244
- package/web/assets/index-ClYIoZUR.js.map +0 -1
- /package/lib/{chunk-J4QJC6UZ.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/game-intel.md
CHANGED
|
@@ -12,14 +12,15 @@ description: 游戏活动信息:查有什么活动、还剩几天、商店换
|
|
|
12
12
|
1. `game_activities` 看日历。某个游戏的 refreshed 超过半天,先 `game_sites_refresh` 再看。
|
|
13
13
|
2. 照日历回答:活动名、还剩几天、商店开到什么时候、还没做完的事。有 `mismatch` 的说明以数据站为准。`todo` / `done` 可能是 agent 在游戏里读到的,也可能是用户自己在「游戏 → 全部活动」里勾的;`finished_by_user` 表示用户说这个活动做完了,不要再提醒它。
|
|
14
14
|
用户想看更多游戏(原神、绝区零、鸣潮等没有游戏包的):告诉他在「游戏 → 全部活动 → 更多游戏」里勾上,活动来自 SRA 公共 API,每天自动刷新。
|
|
15
|
-
3. 游戏包里没有可直接读的数据站(`game_list` 里 auto 都是 false):按技能 web-reading 的顺序查(先公开 API,如 SRA 公共 API,再 Wiki 接口,最后官网公告页),找到活动名和起止时间后 `game_record`(source=site,带上 `url`)。
|
|
15
|
+
3. 游戏包里没有可直接读的数据站(`game_list` 里 auto 都是 false):按技能 web-reading 的顺序查(先公开 API,如 SRA 公共 API,再 Wiki 接口,最后官网公告页),找到活动名和起止时间后 `game_record`(source=site,带上 `url`,有配图把图片地址写进 `cover`)。
|
|
16
16
|
|
|
17
17
|
## 公告和版本更新(单机游戏主要看这个)
|
|
18
18
|
|
|
19
19
|
不是限时活动的消息记在游戏的「公告」里:版本更新、补丁说明、长期有效的公告、其他资讯。`game_activities` 每个游戏带着最近的 `notices`(`single_player` 为 true 的是单机游戏)。
|
|
20
20
|
|
|
21
21
|
- 用户问「XX 最近更新了什么」「最新版本是多少」:先看 `notices`;没有或太旧,先 `game_sites_refresh`(有 Steam 来源的游戏,插件每天自己读它在 Steam 的官方公告),再按技能 web-reading 上网查。
|
|
22
|
-
-
|
|
22
|
+
- `notices` 里只有一两句摘要。用户要细节(具体改了哪些卡、平衡调整、修复了什么):按技能 web-reading 读那一篇的全文(Steam 用 `enddate` 取单篇,或读中文 RSS),按小标题把要点讲全,附上网址。
|
|
23
|
+
- 自己读到的公告用 `game_notice` 记下,公告列表上最近的每一篇都记(最多 20 篇,没点开的照列表写标题、日期、网址),不是只记点开读过的那几篇:版本更新 kind=update(写上版本号、发布日期、一两句改了什么、网址、配图地址 `cover`),长期有效的 kind=notice 加 lasting=true(会一直排在最前面,过时了用 lasting=false 收回),其他 kind=news。同一个网址再记就是更新原来那条。
|
|
23
24
|
- 单机游戏(买断制、没有限时活动)一般不用 `game_record`;真有限时的事(限时折扣、联动、节日活动)才记成活动。
|
|
24
25
|
|
|
25
26
|
## 进游戏读进度
|
|
@@ -40,7 +41,7 @@ description: 游戏活动信息:查有什么活动、还剩几天、商店换
|
|
|
40
41
|
用户说「帮我加一个活动」「把 XX 改成 …结束」「给这个活动换张图」时用 `game_activity_save`,不要用 `game_record`(那是记读到的):
|
|
41
42
|
|
|
42
43
|
- 新加:写 `game`、`name`,有时间就写 `starts_at` / `ends_at`(游戏服务器时间)。改已有的:先 `game_activities` 找到 `id`,只写要改的字段。
|
|
43
|
-
- 图片 `image`:用户给的图片网址、本机图片文件路径,或 `screenshot`(这个对话最近一张截图,比如刚用 `screen_capture`
|
|
44
|
+
- 图片 `image`:用户给的图片网址、本机图片文件路径,或 `screenshot`(这个对话最近一张截图,比如刚用 `screen_capture` 截的活动页;内置浏览器的截图不算)。用户让你「找张图」:按技能 web-reading 从公告、Wiki 或 Steam 取图片地址。
|
|
44
45
|
- 活动图片分三级:用户设的 > 数据站和网页给的 > agent 的截图。`screenshot` 算 agent 的截图,有别的图时不显示;用户想让截图显示,用 `use_source`=screen。
|
|
45
46
|
- 一个活动有多个来源时(`game_activities` 的 `sources`),用户说「用 PRTS 的时间」就写 `use_source`(来源 id、own、screen,或 default 恢复默认顺序):图片和时间都跟着换。
|
|
46
47
|
- 用户填的内容比数据站优先,刷新不会改掉。要恢复成来源的:`clear` 列出字段,或 `game_activity_remove`(what=mine)。用户要删掉才用 `game_activity_remove`(what=all)。
|
package/skills/web-reading.md
CHANGED
|
@@ -1,44 +1,76 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: web-reading
|
|
3
|
-
description:
|
|
3
|
+
description: 从网上查游戏资讯(版本、活动、卡池、维护公告、版本更新和补丁说明、兑换码等),连配图地址和完整正文一起拿到:先找数据的源头(公开 API、RSS、Wiki 接口),读不到再读网页、开内置浏览器;少请求、少花模型。用户要查游戏相关的网上信息、要公告配图,或游戏包里没有能自动读的数据站时使用。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 从网上查游戏资讯
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
目标:用最少的请求拿到**准确、完整、有出处**的信息——标题原文、发布时间、正文要点、网址,还有**配图地址**。
|
|
9
|
+
|
|
10
|
+
## 为什么要找源头
|
|
11
|
+
|
|
12
|
+
网页上看到的公告,几乎都是从一个 JSON 接口或 RSS 读出来再画到页面上的。直接读这个源头,拿到的是完整正文、准确时间和图片的真实地址;读渲染后的网页文字,图片就只剩说明文字,截短的摘要还会把段落挤在一起、把图丢掉。所以:
|
|
13
|
+
|
|
14
|
+
- **先找源头,别先读网页**:游戏数据站、Steam 接口、RSS、Wiki 的 `api.php`。
|
|
15
|
+
- **正文不要截短**:要看全文时不加 `maxlength` 这类截短参数(截短后是去掉图片的纯文本)。先用短的列表挑出要看的那几篇,再只读那几篇的全文。
|
|
16
|
+
- **列表上的都记,全文只读几篇**:记公告时,列表上最近的每一篇都记下(标题、日期、网址、缩略图,列表上就有);只读全文的那几篇才写正文要点。不要因为只点开了两三篇就只记两三篇。
|
|
17
|
+
- **图片地址照原样取,补成完整地址**:占位符换成真地址(Steam 公告里的 `{STEAM_CLAN_IMAGE}` 换成 `https://clan.akamai.steamstatic.com/images`);`/images/a.png` 这样的相对地址前面补上网页的域名(`https://站点域名/images/a.png`),`//` 开头的补 `https:`。
|
|
18
|
+
|
|
19
|
+
## 你的工具能拿到什么
|
|
20
|
+
|
|
21
|
+
- `web_fetch`:JSON、XML(RSS)**原样返回**,字段和图片地址都在;HTML 转成 Markdown,图片是 ``、链接是 `[文字](地址)`,可以直接从里面取图片和文章链接。但 `<head>` 里的分享图(og:image)和页面脚本里的数据会被去掉;懒加载的图片地址可能是占位图(`data:`、`loading`、`blank`、1×1 小图),这时去找源头接口。前端渲染的官网只拿到标题或空壳。
|
|
22
|
+
- 内置浏览器 `browser_*`:能读前端渲染的页面。`browser_text` 的 `images` 返回页面分享图和正文图的 HTTPS 候选地址,结合文章内容选取配图。页面快照中的链接只有文字;点进一个链接后,返回的页面内容第一行就是它的网址。要看图片里的字(海报上的活动时间、奖励表)用 `browser_screenshot`(模型要能看图);浏览器截图只给你看,不能当配图存下来。
|
|
23
|
+
- 在 `run_code` 程序里调用 `web_fetch` 时:在程序里解析 JSON / XML,用代码取出标题、日期、网址、图片地址和要的那几段正文,只把这些返回,不要把整页返回到对话里。
|
|
9
24
|
|
|
10
25
|
## 先后顺序
|
|
11
26
|
|
|
12
|
-
1. **日历里已经有的**:`game_activities`
|
|
27
|
+
1. **日历里已经有的**:`game_activities` 先看(带着最近的 `notices` 公告)。数据站一天会刷新(`game_sites_refresh`),不用自己再去网上查同样的东西。
|
|
13
28
|
2. **公开 API(JSON,免费、不用登录)**——优先:
|
|
14
29
|
- **SRA 公共 API**(StarRailAssistant 社区维护,取自官方公告并人工核对):
|
|
15
30
|
`GET https://starrailassistant.top/api/v1/activity/{game}.json`
|
|
16
|
-
返回当前版本号 `version`、版本名 `versionName`、版本起止 `startTime` / `endTime`、活动列表 `activities[]`(`name`、`
|
|
31
|
+
返回当前版本号 `version`、版本名 `versionName`、版本起止 `startTime` / `endTime`、版本配图 `cover`、活动列表 `activities[]`(`name`、`description`、`startTime`、`endTime`、配图 `cover`,空字符串就是没有),有的还有卡池 `pools[]`(`name`、`type`、`upCharacters`、起止时间)。时间是服务器时间(不带时区,国服按北京时间)。
|
|
17
32
|
游戏标识:`sr` 崩坏:星穹铁道、`ys` 原神、`zzz` 绝区零、`ww` 鸣潮、`nte` 异环、`ak` 明日方舟、`end` 明日方舟:终末地、`xtlr` 星塔旅人、`ba-cn` / `ba-jp` / `ba-global` 蔚蓝档案。英文数据加语言后缀:`{game}-en-US.json`。说明页:https://starrailassistant.top/reference/public-api/
|
|
18
|
-
|
|
19
|
-
- **Steam
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
游戏包里已经写了 `sra` 来源的游戏,插件每天自己读,不用你再读;别的游戏直接用 `web_fetch` 读这个 JSON。
|
|
34
|
+
- **Steam**(Steam 上的游戏,单机游戏首选;免费、不用 key)。`appid` 是商店页 `store.steampowered.com/app/<数字>` 里的数字。
|
|
35
|
+
- 公告列表(很短,用来挑):`https://api.steampowered.com/ISteamNews/GetNewsForApp/v2/?appid={appid}&count=20&maxlength=1&feeds=steam_community_announcements&format=json`
|
|
36
|
+
`appnews.newsitems[]`:`title`、`url`、`date`(Unix 秒)、`tags`(含 `patchnotes` 的是补丁说明)。`feeds=steam_community_announcements` 只要官方公告。
|
|
37
|
+
- 某一篇的全文:`https://api.steampowered.com/ISteamNews/GetNewsForApp/v2/?appid={appid}&count=1&enddate={那一篇的 date}&feeds=steam_community_announcements&format=json`(不加 `maxlength`)。`contents` 是完整的 BBCode:`[h2]`/`[b]` 是小标题,`[list][*]` 是条目;图片是 `[img]{STEAM_CLAN_IMAGE}/…[/img]`(把占位符换成 `https://clan.akamai.steamstatic.com/images`)或 `[img src="https://…"]`,视频是 `[previewyoutube=…]`。
|
|
38
|
+
- 官方中文版:`https://store.steampowered.com/feeds/news/app/{appid}/?l=schinese`(RSS,最近 10 篇的全文,常有十万字,要中文或在 `run_code` 程序里处理时再用)。开发者写了中文的公告这里是中文:`<item>` 里 `title`、`link`(商店新闻页的正式网址)、`pubDate`、`description`(完整正文 HTML,`<img src="https://clan.fastly.steamstatic.com/images/…">` 是真地址),`<enclosure url="…">` 是这篇的封面图。
|
|
39
|
+
- 游戏本身的资料和图:`https://store.steampowered.com/api/appdetails?appids={appid}&l=schinese&cc=cn&filters=basic` → 中文名 `name`、简介 `short_description`、横幅图 `header_image`、官网 `website`;`filters=screenshots` 是截图(`path_full`),`filters=release_date` 是发售日期。
|
|
40
|
+
- 公告网址用接口给的 `url` 或 RSS 的 `link`。不要用 `gid` 自己拼 `store.steampowered.com/news/app/{appid}/view/…`:商店新闻页的编号和 `gid` 不一样,拼出来的页面一直显示 LOADING。
|
|
41
|
+
游戏包里写了 `steam: { appid: … }` 来源的,插件每天自己读最近 20 篇公告(`game_add` 时马上读一次),不用你再读列表、也不用再记。
|
|
23
42
|
3. **Wiki 的查询接口**:PRTS、B 站游戏 WIKI 都是 MediaWiki,用 `api.php` 拿结构化结果,比读页面省得多:
|
|
24
43
|
- 按属性查(Semantic MediaWiki):`https://prts.wiki/api.php?action=ask&format=json&query=[[分类:有活动信息的页面]]|?活动开始时间|?活动结束时间|limit=50`
|
|
25
44
|
- 读一个页面的正文:`api.php?action=parse&page=页面名&prop=wikitext&format=json`
|
|
45
|
+
- 一个页面用到的图片,一次拿到真地址:`api.php?action=query&generator=images&titles=页面名&gimlimit=20&prop=imageinfo&iiprop=url&format=json`(每张图的 `imageinfo[0].url`;名字带 icon、图标、头像的一般不是配图)
|
|
46
|
+
- 已知文件名的图片地址:`api.php?action=query&titles=文件:文件名&prop=imageinfo&iiprop=url&format=json`
|
|
47
|
+
- 最近上传的图片(新活动的横幅常在这里):`api.php?action=query&list=allimages&aisort=timestamp&aidir=descending&ailimit=10&aiprop=url|timestamp&format=json`
|
|
26
48
|
- 搜页面:`api.php?action=opensearch&search=关键词&limit=10`
|
|
27
|
-
4. **官方公告页**:官网新闻(游戏包 `sources` 里的 `homepage
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
49
|
+
4. **官方公告页**:官网新闻(游戏包 `sources` 里的 `homepage`)。先读**列表页**找到目标公告的链接,再只读那几篇;不要一页一页往下翻。
|
|
50
|
+
- `web_fetch` 列表页:Markdown 里的 `[标题](链接)` 就是文章地址,列表上的缩略图 `` 常常就是封面。列表页没有图时,文章页一般有:正文里第一张不是图标的 `` 就是配图。
|
|
51
|
+
- 列表页只拿到空壳、或找不到文章链接时,先花一两个请求找源头,再开浏览器:页面上写着的 RSS / 订阅地址,或常见的 `/feed.xml`、`/feed`、`/rss.xml`、`/atom.xml`(RSS 里每篇的 `title`、`link`、`pubDate` 就是文章列表);WordPress 站点 `/wp-json/wp/v2/posts?per_page=5&_embed`(正文 `content.rendered`,封面 `_embedded["wp:featuredmedia"][0].source_url`)。试不出来就算了,不要一个个猜下去。
|
|
52
|
+
- 再用**内置浏览器**:`browser_navigate` 打开列表页,`browser_text` 读渲染后的全文,`browser_click` 点进那篇公告(返回的第一行是它的网址)再 `browser_text`。要配图时用 `web_fetch` 读这篇文章的网址(文章页常常不是空壳),从 `` 里取;还是没有就不写配图。用户能在浏览器面板里看到你打开的页面。
|
|
53
|
+
- 你的对话里没有 `browser_*`(主 agent 的对话不直接操作):开子 agent 去读,任务里写明「用内置浏览器(browser_navigate 打开,browser_text 读渲染后的文字)」,并写明要它带回什么:标题、发布时间、网址、正文要点、配图地址。
|
|
54
|
+
5. **搜索**:前面都没有时才用 `web_search`,关键词带上游戏名、版本号、「公告」「更新」等,优先点官方域名、Steam 和 Wiki。
|
|
31
55
|
|
|
32
|
-
##
|
|
56
|
+
## 读全、读准
|
|
33
57
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
58
|
+
- 每篇公告要的:标题原文、发布时间(哪个时区)、版本号、正文要点、网址、配图地址。网址和图片地址只写读到的,不要自己拼。
|
|
59
|
+
- 补丁说明和版本公告很长:按它的小标题(新内容、平衡调整、修复、活动、奖励、兑换码、维护时间)归纳,每类写最要紧的几条,不要只看第一段。
|
|
60
|
+
- 挑配图:优先公告的封面(RSS 的 `enclosure`、列表页缩略图、正文第一张大图),游戏本身用 `header_image`。不要图标、表情、头像、二维码、分享按钮、`.svg` 和 1×1 小图;地址必须是 `https://` 开头的完整地址。
|
|
61
|
+
- 时间写清楚是哪个时区;网页上的「10月25日 03:59」按游戏服务器时间理解(`game_list` 里的 `timezone`),Steam 的 `date` 是 Unix 秒。
|
|
36
62
|
- 没有确切出处的时间不要写;不同来源对不上时说明以哪个为准(数据站 > 官方公告 > 其他网站)。
|
|
63
|
+
|
|
64
|
+
## 读网页时
|
|
65
|
+
|
|
66
|
+
- 一次只读需要的那一页;返回的内容很长时,只提取要的字段,不要把整页复述给用户。
|
|
37
67
|
- 不登录、不填表、不点广告和下载;遇到验证码、需要登录的页面就停下告诉用户。
|
|
38
|
-
-
|
|
68
|
+
- 请求要少:同一个地址一次对话里只读一次,出错重试最多一次。网站拦了你(403、429、567、「Access Restricted」「访问受限」)就不要再请求这个网站,换别的来源(另一个 Wiki、官网、Steam),并告诉用户哪里没读到。
|
|
39
69
|
|
|
40
70
|
## 记下来
|
|
41
71
|
|
|
42
|
-
- 查到的活动用 `game_record`(`source: site`,带上 `url`)写进日历,以后看板、日报都能用,不用再查一遍。
|
|
43
|
-
- 版本更新、补丁说明、长期有效的公告这些没有起止时间的,用 `game_notice` 记到游戏的「公告」里(kind=update / notice / news,长期的 lasting=true
|
|
72
|
+
- 查到的活动用 `game_record`(`source: site`,带上 `url`,有配图写进 `cover`)写进日历,以后看板、日报都能用,不用再查一遍。
|
|
73
|
+
- 版本更新、补丁说明、长期有效的公告这些没有起止时间的,用 `game_notice` 记到游戏的「公告」里(kind=update / notice / news,长期的 lasting=true;`summary` 写一两句中文要点。读到全文时,将原文段落和本文图片按阅读顺序写进 `article`,封面另存到 `cover`)。单机游戏主要记这个。
|
|
74
|
+
列表上最近的每一篇都记(单机游戏最近三个月、网游最近一个月,最多 20 篇,一次 `game_notice` 可以记 30 篇);没点开的那些不写 `summary`,标题、日期、网址照列表写。综合新闻站(一个厂商的多款游戏)只记这个游戏的。
|
|
75
|
+
- 回答用户时把要点讲全,附上网址;用户要看图就给图片地址。
|
|
44
76
|
- 某个游戏有好用的固定接口,但游戏包里还没有:告诉用户可以在游戏包的 `game.yaml` 里加一个来源(`sra: { game: … }`、`smw: …` 或 `steam: { appid: … }`),以后插件每天自己读,不花模型。
|