dsh-multigameassistant 2.0.1 → 2.0.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/lib/game-intel.js CHANGED
@@ -7,11 +7,11 @@ import {
7
7
  GAME_MANIFEST_FILE,
8
8
  GameManifest,
9
9
  parseGameManifest
10
- } from "./chunk-J46OASOG.js";
10
+ } from "./chunk-NWM5ZN7E.js";
11
11
  import {
12
12
  sessionConversations
13
- } from "./chunk-BNGDT7YT.js";
14
- import "./chunk-ZQ6KFVEO.js";
13
+ } from "./chunk-I5AFAEXG.js";
14
+ import "./chunk-OPV336S5.js";
15
15
  import {
16
16
  writeFileAtomic
17
17
  } from "./chunk-CCAB6XXZ.js";
@@ -19,10 +19,12 @@ import {
19
19
  GAMES_CAPABILITY,
20
20
  GamesSettings,
21
21
  OWN_IMAGE,
22
+ OWN_SOURCE,
23
+ SCREEN_SOURCE,
22
24
  SHOT_IMAGE,
23
25
  external_exports,
24
26
  taskMessage
25
- } from "./chunk-HPQCV6WO.js";
27
+ } from "./chunk-QAP7IYBS.js";
26
28
  import "./chunk-2UFLGPDY.js";
27
29
 
28
30
  // packages/game-intel/lib/index.js
@@ -165,6 +167,14 @@ var MISMATCH_MS = 30 * MS.HOUR;
165
167
  var DEFAULT_SETTINGS = { report: { enabled: true, at: "09:00", games: [], soonDays: 3, ai: true }, followed: [] };
166
168
  var AGENT_PAGE = { id: "agent", name: "agent \u67E5\u5230\u7684\u7F51\u9875" };
167
169
  var OWN_FIELDS = ["name", "startsAt", "endsAt", "kind", "description", "url", "cover"];
170
+ var CHOSEN_FIELDS = ["cover", "startsAt", "endsAt", "shopEndsAt"];
171
+ function saidBy(item, source) {
172
+ if (source === OWN_SOURCE)
173
+ return item.mine;
174
+ if (source === SCREEN_SOURCE)
175
+ return item.screen === void 0 ? void 0 : { endsAt: item.screen.endsAt, cover: item.screen.image };
176
+ return item.facts[source];
177
+ }
168
178
  var StoredSchema = external_exports.object({
169
179
  activities: external_exports.array(external_exports.looseObject({ id: external_exports.string(), game: external_exports.string(), name: external_exports.string() })).default([]),
170
180
  refreshed: external_exports.record(external_exports.string(), external_exports.object({ at: external_exports.number(), ok: external_exports.boolean(), count: external_exports.number(), detail: external_exports.string().optional() })).default({}),
@@ -228,9 +238,11 @@ var Calendar = class {
228
238
  /** Every picture address a data site gave: the only ones the host will fetch. */
229
239
  pictures() {
230
240
  const out = /* @__PURE__ */ new Set();
231
- for (const a of this.#items)
232
- if (a.cover !== void 0)
233
- out.add(a.cover);
241
+ for (const a of this.#items) {
242
+ for (const cover of [a.cover, a.mine?.cover, ...Object.values(a.facts).map((f) => f.cover)])
243
+ if (cover !== void 0)
244
+ out.add(cover);
245
+ }
234
246
  for (const v of Object.values(this.#saved.versions))
235
247
  if (v.cover !== void 0)
236
248
  out.add(v.cover);
@@ -471,6 +483,13 @@ var Calendar = class {
471
483
  delete item.mine;
472
484
  else
473
485
  item.mine = { ...mine, at: now };
486
+ if (item.chosen !== void 0) {
487
+ const written = OWN_FIELDS.filter((key) => patch[key] !== void 0 && mine[key] !== void 0);
488
+ const taken = OWN_FIELDS.filter((key) => patch[key] === null);
489
+ item.chosen.over = unique([...item.chosen.over, ...written]).filter((key) => !taken.includes(key));
490
+ if (item.chosen.source === OWN_SOURCE && item.mine === void 0)
491
+ delete item.chosen;
492
+ }
474
493
  if (mine.name !== void 0)
475
494
  item.names = unique([...item.names, mine.name]);
476
495
  if (patch.todo !== void 0)
@@ -494,6 +513,10 @@ var Calendar = class {
494
513
  if (item === void 0)
495
514
  return void 0;
496
515
  delete item.mine;
516
+ if (item.chosen?.source === OWN_SOURCE)
517
+ delete item.chosen;
518
+ else if (item.chosen !== void 0)
519
+ item.chosen.over = [];
497
520
  if (!this.#sourced(item)) {
498
521
  this.#items = this.#items.filter((a) => a !== item);
499
522
  await this.save();
@@ -503,6 +526,44 @@ var Calendar = class {
503
526
  await this.save();
504
527
  return this.#public(item);
505
528
  }
529
+ /**
530
+ * The source an event's picture and dates come from (`null`: the default order).
531
+ * @returns the event; undefined when there is none with that id.
532
+ * @throws Error when that source says nothing about the event.
533
+ */
534
+ async chooseSource(id, source, timeZone) {
535
+ const item = this.#items.find((a) => a.id === id);
536
+ if (item === void 0)
537
+ return void 0;
538
+ if (source === null)
539
+ delete item.chosen;
540
+ else if (saidBy(item, source) === void 0)
541
+ throw new Error("\u8FD9\u4E2A\u6D3B\u52A8\u6CA1\u6709\u8FD9\u4E2A\u6765\u6E90");
542
+ else
543
+ item.chosen = { source, over: [] };
544
+ this.#derive(item, timeZone);
545
+ await this.save();
546
+ return this.#public(item);
547
+ }
548
+ /** The screenshot the agent took of an event, as its own picture (the lowest rank). */
549
+ async setShot(id, shot, context) {
550
+ const item = this.#items.find((a) => a.id === id);
551
+ if (item === void 0)
552
+ return void 0;
553
+ item.screen = { ...item.screen, at: context.now, evidence: true, image: shot, ...context.sessionId === void 0 ? {} : { sessionId: context.sessionId } };
554
+ this.#derive(item, context.timeZone);
555
+ await this.save();
556
+ return this.#public(item);
557
+ }
558
+ /** Work every event out again: a calendar saved by an older version shows what this one would. */
559
+ async rederive(timeZone) {
560
+ if (this.#items.length === 0)
561
+ return;
562
+ for (const item of this.#items)
563
+ if (this.#sourced(item) || item.mine !== void 0)
564
+ this.#derive(item, timeZone(item.game));
565
+ await this.save();
566
+ }
506
567
  /** The pictures the user added that an event still shows (`own:<file>`). */
507
568
  ownImages() {
508
569
  const out = /* @__PURE__ */ new Set();
@@ -576,25 +637,40 @@ var Calendar = class {
576
637
  * The event as shown, from what its sources said: each detail from the
577
638
  * data sites first (the one that wrote last), then the web pages (the
578
639
  * newest reading); the end from the game screen when no source gives one.
640
+ * The picture goes by rank: what the user set, then what a source gives,
641
+ * then the agent's screenshot. A source the user chose comes before all of
642
+ * that for the picture and the dates, where it says anything.
579
643
  * Disagreements on the end are said: a web page against a data site, the
580
- * screen against a data site (the data site counts).
644
+ * screen against a data site (the data site counts), unless the user chose.
581
645
  */
582
646
  #derive(item, timeZone) {
583
647
  const ordered = Object.entries(item.facts).map(([id, fact], index) => ({ id, fact, index })).sort((a, b) => Number(a.fact.web) - Number(b.fact.web) || b.fact.at - a.fact.at || b.index - a.index);
584
648
  const first = (key) => ordered.find((o) => o.fact[key] !== void 0)?.fact[key];
649
+ const firstFrom = (key) => ordered.find((o) => o.fact[key] !== void 0)?.id;
585
650
  const set = (key, value) => {
586
651
  if (value === void 0)
587
652
  delete item[key];
588
653
  else
589
654
  item[key] = value;
590
655
  };
656
+ const origin = {};
657
+ const put = (key, value, from) => {
658
+ set(key, value);
659
+ if (value === void 0 || from === void 0)
660
+ delete origin[key];
661
+ else
662
+ origin[key] = from;
663
+ };
591
664
  const site = ordered.find((o) => !o.fact.web);
592
665
  const primary = ordered[0];
593
- set("startsAt", site !== void 0 ? site.fact.startsAt : first("startsAt"));
594
- set("endsAt", first("endsAt") ?? item.screen?.endsAt);
666
+ put("startsAt", site !== void 0 ? site.fact.startsAt : first("startsAt"), site !== void 0 ? site.id : firstFrom("startsAt"));
667
+ if (first("endsAt") !== void 0)
668
+ put("endsAt", first("endsAt"), firstFrom("endsAt"));
669
+ else
670
+ put("endsAt", item.screen?.endsAt, SCREEN_SOURCE);
595
671
  set("shopEndsAt", site !== void 0 ? site.fact.shopEndsAt : first("shopEndsAt"));
596
672
  set("url", first("url"));
597
- set("cover", first("cover"));
673
+ put("cover", first("cover"), firstFrom("cover"));
598
674
  set("description", first("description"));
599
675
  set("kind", first("kind"));
600
676
  if (primary === void 0)
@@ -610,13 +686,30 @@ var Calendar = class {
610
686
  item.name = item.baseName;
611
687
  delete item.baseName;
612
688
  }
613
- for (const key of ["startsAt", "endsAt", "kind", "description", "url", "cover"])
689
+ for (const key of ["kind", "description", "url"])
614
690
  if (mine?.[key] !== void 0)
615
691
  set(key, mine[key]);
616
- if (item.cover === void 0 && item.screen?.image !== void 0)
617
- item.cover = item.screen.image;
692
+ for (const key of ["startsAt", "endsAt", "cover"])
693
+ if (mine?.[key] !== void 0)
694
+ put(key, mine[key], OWN_SOURCE);
695
+ if (item.cover === void 0)
696
+ put("cover", item.screen?.image, SCREEN_SOURCE);
697
+ const chosen = item.chosen;
698
+ const said = chosen === void 0 ? void 0 : saidBy(item, chosen.source);
699
+ if (chosen !== void 0 && said !== void 0) {
700
+ for (const key of CHOSEN_FIELDS) {
701
+ const value = said[key];
702
+ if (value === void 0 || key !== "shopEndsAt" && chosen.over.includes(key) && mine?.[key] !== void 0)
703
+ continue;
704
+ if (key === "shopEndsAt")
705
+ set(key, value);
706
+ else
707
+ put(key, value, chosen.source);
708
+ }
709
+ }
710
+ item.shown = origin;
618
711
  delete item.mismatch;
619
- if (mine?.endsAt !== void 0)
712
+ if (mine?.endsAt !== void 0 || said !== void 0)
620
713
  return;
621
714
  const siteEnd = site?.fact.endsAt;
622
715
  if (site === void 0 || siteEnd === void 0)
@@ -644,10 +737,30 @@ var Calendar = class {
644
737
  });
645
738
  }
646
739
  #public(item) {
647
- const { names: _names, facts, mine, baseName: _baseName, ...activity } = item;
648
- const sources = Object.entries(facts).map(([id, f]) => ({ id, name: f.name, at: f.at, web: f.web, ...f.endsAt === void 0 ? {} : { endsAt: f.endsAt } }));
649
- const own = mine === void 0 ? void 0 : { at: mine.at, fields: OWN_FIELDS.filter((k) => mine[k] !== void 0) };
650
- return structuredClone({ ...activity, ...sources.length === 0 ? {} : { sources }, ...own === void 0 ? {} : { own } });
740
+ const { names: _names, facts, mine, baseName: _baseName, chosen, ...activity } = item;
741
+ const sources = Object.entries(facts).map(([id, f]) => ({
742
+ id,
743
+ name: f.name,
744
+ at: f.at,
745
+ web: f.web,
746
+ ...f.startsAt === void 0 ? {} : { startsAt: f.startsAt },
747
+ ...f.endsAt === void 0 ? {} : { endsAt: f.endsAt },
748
+ ...f.shopEndsAt === void 0 ? {} : { shopEndsAt: f.shopEndsAt },
749
+ ...f.cover === void 0 ? {} : { cover: f.cover }
750
+ }));
751
+ const own = mine === void 0 ? void 0 : {
752
+ at: mine.at,
753
+ fields: OWN_FIELDS.filter((k) => mine[k] !== void 0),
754
+ ...mine.startsAt === void 0 ? {} : { startsAt: mine.startsAt },
755
+ ...mine.endsAt === void 0 ? {} : { endsAt: mine.endsAt },
756
+ ...mine.cover === void 0 ? {} : { cover: mine.cover }
757
+ };
758
+ return structuredClone({
759
+ ...activity,
760
+ ...sources.length === 0 ? {} : { sources },
761
+ ...own === void 0 ? {} : { own },
762
+ ...chosen === void 0 || saidBy(item, chosen.source) === void 0 ? {} : { chosen: chosen.source }
763
+ });
651
764
  }
652
765
  };
653
766
  function migrate(item) {
@@ -1125,6 +1238,13 @@ function followedManifest(game) {
1125
1238
 
1126
1239
  // packages/game-intel/lib/tools.js
1127
1240
  var OWN_KEYS = { name: "name", starts_at: "startsAt", ends_at: "endsAt", kind: "kind", description: "description", url: "url", image: "cover" };
1241
+ function sourceName(a, source) {
1242
+ if (source === OWN_SOURCE)
1243
+ return "\u7528\u6237\u81EA\u5DF1\u586B\u7684";
1244
+ if (source === SCREEN_SOURCE)
1245
+ return "\u6E38\u620F\u753B\u9762";
1246
+ return a.sources?.find((s) => s.id === source)?.name ?? a.site?.name ?? (a.screen !== void 0 ? "\u6E38\u620F\u753B\u9762" : "\u672A\u77E5");
1247
+ }
1128
1248
  function parse(schema, args) {
1129
1249
  const parsed = schema.safeParse(args);
1130
1250
  if (!parsed.success)
@@ -1159,10 +1279,12 @@ function gameTools(deps) {
1159
1279
  ...a.startsAt !== void 0 && a.startsAt > now ? { starts: shortDate(a.startsAt, timeZone) } : {},
1160
1280
  ends: a.endsAt === void 0 ? "\u672A\u77E5" : `${shortDate(a.endsAt, timeZone)}\uFF08${leftText(a.endsAt, now)}\uFF09`,
1161
1281
  ...a.shopEndsAt === void 0 ? {} : { shop_ends: shortDate(a.shopEndsAt, timeZone) },
1162
- dates_from: a.own?.fields.some((f) => f === "startsAt" || f === "endsAt") === true ? "\u7528\u6237\u81EA\u5DF1\u586B\u7684" : a.site?.name ?? (a.screen !== void 0 ? "\u6E38\u620F\u753B\u9762" : "\u672A\u77E5"),
1282
+ dates_from: sourceName(a, a.shown?.endsAt ?? a.shown?.startsAt),
1283
+ ...a.sources === void 0 ? {} : { sources: a.sources.map((s) => ({ id: s.id, name: s.name, ...s.endsAt === void 0 ? {} : { ends: shortDate(s.endsAt, timeZone) } })) },
1284
+ ...a.chosen === void 0 ? {} : { chosen_by_user: sourceName(a, a.chosen) },
1163
1285
  ...a.own === void 0 ? {} : { set_by_user: a.own.fields.map((f) => Object.entries(OWN_KEYS).find(([, v]) => v === f)[0]), ...a.sources === void 0 && a.screen === void 0 ? { added_by_user: true } : {} },
1164
1286
  ...a.kind === void 0 ? {} : { kind: a.kind },
1165
- ...a.cover === void 0 ? {} : { image: a.cover.startsWith("own:") ? "\u7528\u6237\u7684\u56FE\u7247" : a.cover.startsWith("shot:") ? "\u6E38\u620F\u622A\u56FE\uFF08\u6CA1\u6709\u522B\u7684\u56FE\u65F6\u7528\u5B83\uFF09" : a.cover },
1287
+ ...a.cover === void 0 ? {} : { image: a.cover.startsWith("own:") ? "\u7528\u6237\u7684\u56FE\u7247" : a.cover.startsWith("shot:") ? "\u6E38\u620F\u622A\u56FE\uFF08\u4F18\u5148\u7EA7\u6700\u4F4E\uFF0C\u6CA1\u6709\u522B\u7684\u56FE\u65F6\u7528\u5B83\uFF09" : a.cover },
1166
1288
  ...a.screen === void 0 ? {} : { read_in_game: shortDate(a.screen.at, timeZone), ...a.progress === void 0 ? {} : { progress: a.progress } },
1167
1289
  // The checklist (from the game screen or kept by the user on the board), and the user's own "done".
1168
1290
  ...a.todo.length + a.done.length === 0 ? {} : { todo: a.todo, done: a.done },
@@ -1352,7 +1474,8 @@ function gameTools(deps) {
1352
1474
  description: [
1353
1475
  "\u66FF\u7528\u6237\u624B\u52A8\u6DFB\u52A0\u4E00\u4E2A\u6D3B\u52A8\uFF0C\u6216\u6539\u4E00\u4E2A\u5DF2\u6709\u6D3B\u52A8\uFF08id \u4ECE game_activities \u67E5\uFF09\u3002\u7528\u6237\u8BF4\u300C\u5E2E\u6211\u52A0\u4E00\u4E2A XX \u6D3B\u52A8\u300D\u300C\u628A XX \u7684\u7ED3\u675F\u65F6\u95F4\u6539\u6210\u2026\u300D\u300C\u7ED9\u8FD9\u4E2A\u6D3B\u52A8\u6362\u5F20\u56FE\u300D\u65F6\u7528\u3002",
1354
1476
  "\u5199\u8FDB\u53BB\u7684\u5B57\u6BB5\u662F\u7528\u6237\u81EA\u5DF1\u7684\u8BF4\u6CD5\uFF1A\u6BD4\u6570\u636E\u7AD9\u548C\u7F51\u9875\u4F18\u5148\uFF0C\u5237\u65B0\u4E0D\u4F1A\u6539\u6389\u4E5F\u4E0D\u4F1A\u5220\u6389\uFF1B\u548C\u6765\u6E90\u4E00\u6837\u7684\u503C\u4E0D\u5355\u72EC\u4FDD\u5B58\u3002\u8BFB\u5230\u7684\u7F51\u9875\u6216\u6E38\u620F\u753B\u9762\u7528 game_record\uFF0C\u4E0D\u8981\u7528\u8FD9\u4E2A\u3002",
1355
- "image \u53EF\u4EE5\u662F\u56FE\u7247\u7F51\u5740\uFF08https\uFF0C\u4F1A\u4E0B\u8F7D\u4FDD\u5B58\uFF09\u3001\u672C\u673A\u56FE\u7247\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u8DEF\u5F84\u6309\u5DE5\u4F5C\u533A\uFF09\u3001\u6216 screenshot\uFF08\u8FD9\u4E2A\u5BF9\u8BDD\u6700\u8FD1\u4E00\u5F20\u622A\u56FE\uFF09\u3002clear \u91CC\u7684\u5B57\u6BB5\u6536\u56DE\u7528\u6237\u7684\u503C\uFF0C\u6062\u590D\u6210\u6765\u6E90\u7684\u3002"
1477
+ "\u6D3B\u52A8\u56FE\u7247\u5206\u4E09\u7EA7\uFF1A\u7528\u6237\u8BBE\u7684 > \u6570\u636E\u7AD9\u548C\u7F51\u9875\u7ED9\u7684 > agent \u7684\u622A\u56FE\u3002image \u5199\u56FE\u7247\u7F51\u5740\uFF08https\uFF0C\u4F1A\u4E0B\u8F7D\u4FDD\u5B58\uFF09\u6216\u672C\u673A\u56FE\u7247\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u8DEF\u5F84\u6309\u5DE5\u4F5C\u533A\uFF09\u7B97\u7528\u6237\u8BBE\u7684\uFF1B\u5199 screenshot\uFF08\u8FD9\u4E2A\u5BF9\u8BDD\u6700\u8FD1\u4E00\u5F20\u622A\u56FE\uFF09\u7B97 agent \u7684\u622A\u56FE\uFF0C\u53EA\u5728\u6CA1\u6709\u522B\u7684\u56FE\u65F6\u663E\u793A\u3002clear \u91CC\u7684\u5B57\u6BB5\u6536\u56DE\u7528\u6237\u7684\u503C\uFF0C\u6062\u590D\u6210\u6765\u6E90\u7684\u3002",
1478
+ "use_source \u9009\u8FD9\u4E2A\u6D3B\u52A8\u7684\u56FE\u7247\u548C\u65F6\u95F4\u7528\u54EA\u4E2A\u6765\u6E90\uFF08game_activities \u7684 sources \u91CC\u7684 id\uFF0C\u6216 own=\u7528\u6237\u81EA\u5DF1\u586B\u7684\u3001screen=\u6E38\u620F\u753B\u9762\u3001default=\u6062\u590D\u9ED8\u8BA4\u987A\u5E8F\uFF09\uFF1B\u7528\u6237\u8BF4\u300C\u7528 PRTS \u7684\u65F6\u95F4\u300D\u65F6\u7528\u3002"
1356
1479
  ].join(""),
1357
1480
  properties: {
1358
1481
  game: GAME,
@@ -1363,7 +1486,8 @@ function gameTools(deps) {
1363
1486
  kind: { type: "string", description: "\u7C7B\u578B\uFF08\u53EF\u9009\uFF09\uFF0C\u4F8B\u5982\u300CSideStory\u300D\u300C\u7B7E\u5230\u300D\u300C\u9650\u65F6\u5546\u5E97\u300D\u3002" },
1364
1487
  description: { type: "string", description: "\u8BF4\u660E\uFF08\u53EF\u9009\uFF09\uFF0C500 \u5B57\u4EE5\u5185\u3002" },
1365
1488
  url: { type: "string", description: "\u6D3B\u52A8\u9875\u9762\u5730\u5740\uFF08\u53EF\u9009\uFF09\u3002" },
1366
- image: { type: "string", description: "\u6D3B\u52A8\u5361\u7247\u7684\u56FE\u7247\uFF1Ahttps \u56FE\u7247\u7F51\u5740\u3001\u672C\u673A\u56FE\u7247\u6587\u4EF6\u8DEF\u5F84\uFF0C\u6216 screenshot\u3002" },
1489
+ image: { type: "string", description: "\u6D3B\u52A8\u5361\u7247\u7684\u56FE\u7247\uFF1Ahttps \u56FE\u7247\u7F51\u5740\u3001\u672C\u673A\u56FE\u7247\u6587\u4EF6\u8DEF\u5F84\uFF0C\u6216 screenshot\uFF08\u4F18\u5148\u7EA7\u6700\u4F4E\uFF09\u3002" },
1490
+ use_source: { type: "string", description: "\u56FE\u7247\u548C\u65F6\u95F4\u7528\u54EA\u4E2A\u6765\u6E90\uFF1A\u6765\u6E90 id\u3001own\u3001screen\uFF0C\u6216 default\uFF08\u6062\u590D\u9ED8\u8BA4\u987A\u5E8F\uFF09\u3002\u8981\u6709 id\u3002" },
1367
1491
  todo: { type: "array", items: { type: "string" }, description: "\u8981\u505A\u7684\u4E8B\uFF08\u53EF\u9009\uFF0C\u66FF\u6362\u539F\u6765\u6CA1\u505A\u5B8C\u7684\u6E05\u5355\uFF09\uFF0C\u4F8B\u5982\u300C\u6D3B\u52A8\u5546\u5E97\u6362\u5B8C\u300D\u3002" },
1368
1492
  clear: { type: "array", items: { type: "string", enum: Object.keys(OWN_KEYS) }, description: "\u6536\u56DE\u7528\u6237\u586B\u8FC7\u7684\u8FD9\u4E9B\u5B57\u6BB5\uFF08\u6062\u590D\u6210\u6765\u6E90\u7684\u503C\uFF09\u3002" }
1369
1493
  },
@@ -1382,11 +1506,14 @@ function gameTools(deps) {
1382
1506
  url: external_exports.string().regex(/^https?:\/\/\S+$/, "\u53EA\u80FD\u662F http \u6216 https \u7F51\u5740").nullish(),
1383
1507
  image: external_exports.string().nullish(),
1384
1508
  todo: external_exports.array(external_exports.string().min(1).max(80)).max(30).nullish(),
1509
+ use_source: external_exports.string().nullish(),
1385
1510
  clear: external_exports.array(external_exports.enum(Object.keys(OWN_KEYS))).nullish()
1386
1511
  }), args);
1387
1512
  const game = known(a.game);
1388
1513
  if (a.id == null && (a.name == null || a.name.trim() === ""))
1389
1514
  throw new Error("\u65B0\u52A0\u6D3B\u52A8\u8981\u5199 name\uFF1B\u6539\u5DF2\u6709\u7684\u6D3B\u52A8\u8981\u5199 id\uFF08game_activities \u53EF\u67E5\uFF09");
1515
+ if (a.id == null && a.use_source != null)
1516
+ throw new Error("use_source \u8981\u548C id \u4E00\u8D77\u7528\uFF1A\u5148\u7528 game_activities \u67E5\u5230\u8FD9\u4E2A\u6D3B\u52A8");
1390
1517
  const when = (text, what) => {
1391
1518
  if (text == null)
1392
1519
  return void 0;
@@ -1407,7 +1534,12 @@ function gameTools(deps) {
1407
1534
  for (const key of a.clear ?? [])
1408
1535
  patch[OWN_KEYS[key]] = null;
1409
1536
  const sessionId = exec.agent?.session.id;
1410
- const activity = await deps.saveActivity(game.id, a.id ?? void 0, patch, a.image ?? void 0, sessionId);
1537
+ const edited = Object.keys(patch).length > 0 || a.image != null;
1538
+ let activity = edited || a.id == null ? await deps.saveActivity(game.id, a.id ?? void 0, patch, a.image ?? void 0, sessionId) : void 0;
1539
+ if (a.use_source != null)
1540
+ activity = await deps.chooseSource(a.id, a.use_source === "default" ? null : a.use_source === "own" ? OWN_SOURCE : a.use_source === "screen" ? SCREEN_SOURCE : a.use_source);
1541
+ if (activity === void 0)
1542
+ throw new Error("\u6CA1\u6709\u8981\u6539\u7684\u5185\u5BB9\uFF1A\u5199\u4E0A\u8981\u6539\u7684\u5B57\u6BB5\u3001image \u6216 use_source");
1411
1543
  return { saved: brief(activity, game.timezone), note: a.id == null ? "\u5DF2\u52A0\u5230\u6D3B\u52A8\u65E5\u5386\uFF1B\u6E38\u620F\u9875\u548C\u65E5\u62A5\u91CC\u90FD\u80FD\u770B\u5230" : "\u5DF2\u6539\u597D" };
1412
1544
  }
1413
1545
  }),
@@ -1494,7 +1626,7 @@ var GAME_ROLE = {
1494
1626
  duty: [
1495
1627
  "# \u4F60\u7684\u89D2\u8272\uFF1A\u6E38\u620F",
1496
1628
  "\u4F60\u662F MultiGameAssistant \u7684\u300C\u6E38\u620F\u300Dagent\uFF1A\u8BFB\u6E38\u620F\u7684\u6D3B\u52A8\u3001\u8D44\u8BAF\u548C\u8FDB\u5EA6\u5E76\u8BB0\u4E0B\u6765\uFF08game_record\uFF09\uFF0C\u5199\u65E5\u62A5\uFF0C\u6DFB\u52A0\u6E38\u620F\u3002",
1497
- "\u4E0D\u5B89\u88C5\u3001\u8FD0\u884C\u6216\u4FEE\u811A\u672C\uFF0C\u4E0D\u6539\u6D41\u6C34\u7EBF\u548C\u5B9A\u65F6\uFF1B\u9700\u8981\u8FD9\u4E9B\u65F6\u5728\u56DE\u590D\u91CC\u8BF4\u6E05\u695A\uFF0C\u7528\u6237\u4F1A\u4EA4\u7ED9\u5BF9\u5E94\u7684 agent\u3002"
1629
+ "\u4E0D\u5B89\u88C5\u3001\u8FD0\u884C\u6216\u4FEE\u811A\u672C\uFF0C\u4E0D\u6539\u6D41\u6C34\u7EBF\u548C\u5B9A\u65F6\uFF1B\u9700\u8981\u8FD9\u4E9B\u65F6\u4EA4\u7ED9\u5BF9\u5E94\u7684\u540C\u4E8B\uFF08agent_delegate\uFF09\uFF0C\u6216\u8005\u5728\u56DE\u590D\u91CC\u8BF4\u6E05\u695A\u3002"
1498
1630
  ].join("\n")
1499
1631
  };
1500
1632
  var SKILL = new URL("../skills/game-intel.md", import.meta.url);
@@ -1540,6 +1672,7 @@ var AdgGameIntel = class extends Service {
1540
1672
  await calendar.load();
1541
1673
  await this.loadGames(log);
1542
1674
  await this.adoptEvidence().catch((error) => log.warn(`old screenshots not converted: ${String(error)}`));
1675
+ await calendar.rederive((game) => this.timezone(game)).catch((error) => log.warn(`calendar not worked out again: ${String(error)}`));
1543
1676
  daily.start();
1544
1677
  })();
1545
1678
  ctx.effect(() => () => this.daily.stop(), "adg-game-intel daily report");
@@ -1604,8 +1737,16 @@ var AdgGameIntel = class extends Service {
1604
1737
  },
1605
1738
  saveActivity: async (game, id, patch, image, sessionId) => {
1606
1739
  await this.ready;
1740
+ if (image?.trim() === "screenshot") {
1741
+ const shot = await this.imageFrom(image, sessionId);
1742
+ return this.saveAgentShot(await this.saveActivity(game, id, patch), shot, sessionId);
1743
+ }
1607
1744
  return this.saveActivity(game, id, patch, image === void 0 ? void 0 : await this.imageFrom(image, sessionId));
1608
1745
  },
1746
+ chooseSource: async (id, source) => {
1747
+ await this.ready;
1748
+ return this.chooseSource(id, source);
1749
+ },
1609
1750
  removeActivity: async (id, what) => {
1610
1751
  await this.ready;
1611
1752
  if (what === "mine")
@@ -1737,6 +1878,11 @@ var AdgGameIntel = class extends Service {
1737
1878
  const { game, activityId, image, todo, ...fields } = params;
1738
1879
  return this.saveActivity(game, activityId, { ...fields, ...todo === void 0 ? {} : { todo } }, image === void 0 ? void 0 : Buffer.from(image.data, "base64"));
1739
1880
  },
1881
+ "games/activity/source": async (params) => {
1882
+ await this.ready;
1883
+ const { activityId, source } = params;
1884
+ return this.chooseSource(activityId, source);
1885
+ },
1740
1886
  "games/activity/reset": async (params) => {
1741
1887
  await this.ready;
1742
1888
  const activity = await this.resetActivity(params.activityId);
@@ -1857,13 +2003,34 @@ var AdgGameIntel = class extends Service {
1857
2003
  throw new Error("\u4EC0\u4E48\u90FD\u6CA1\u7559\u4E0B\uFF1A\u8FD9\u4E2A\u6D3B\u52A8\u53EA\u6709\u4F60\u586B\u7684\u5185\u5BB9\uFF0C\u6E05\u7A7A\u540E\u5C31\u4ECE\u65E5\u5386\u53BB\u6389\u4E86");
1858
2004
  return activity;
1859
2005
  }
2006
+ timezone(game) {
2007
+ return this.games.find((g) => g.manifest.id === game)?.manifest.timezone ?? "Asia/Shanghai";
2008
+ }
2009
+ /** Keep the agent's screenshot of an event as what it read from the screen: the lowest rank of picture. */
2010
+ async saveAgentShot(saved, bytes, sessionId) {
2011
+ const shot = await this.keepImage(bytes, "shot");
2012
+ const activity = await this.calendar.setShot(saved.id, shot, { now: this.clock.now(), timeZone: this.timezone(saved.game), sessionId });
2013
+ await this.sweepImages();
2014
+ this.changed(saved.game);
2015
+ return activity ?? saved;
2016
+ }
2017
+ /** Which source an event's picture and dates come from; `null`: the default order. */
2018
+ async chooseSource(activityId, source) {
2019
+ const before = this.calendar.get(activityId);
2020
+ if (before === void 0)
2021
+ throw new Error("\u6CA1\u6709\u8FD9\u4E2A\u6D3B\u52A8\uFF08\u53EF\u80FD\u5DF2\u7ECF\u7ED3\u675F\u88AB\u6E05\u6389\u4E86\uFF09");
2022
+ const activity = await this.calendar.chooseSource(activityId, source, this.timezone(before.game));
2023
+ if (activity === void 0)
2024
+ throw new Error("\u6CA1\u6709\u8FD9\u4E2A\u6D3B\u52A8\uFF08\u53EF\u80FD\u5DF2\u7ECF\u7ED3\u675F\u88AB\u6E05\u6389\u4E86\uFF09");
2025
+ this.changed(before.game);
2026
+ return activity;
2027
+ }
1860
2028
  /** Take back what the user wrote on an event. @returns it as it is now; undefined when it went. */
1861
2029
  async resetActivity(activityId) {
1862
2030
  const before = this.calendar.get(activityId);
1863
2031
  if (before === void 0)
1864
2032
  throw new Error("\u6CA1\u6709\u8FD9\u4E2A\u6D3B\u52A8\uFF08\u53EF\u80FD\u5DF2\u7ECF\u7ED3\u675F\u88AB\u6E05\u6389\u4E86\uFF09");
1865
- const timezone = this.games.find((g) => g.manifest.id === before.game)?.manifest.timezone ?? "Asia/Shanghai";
1866
- const activity = await this.calendar.resetOwn(activityId, timezone);
2033
+ const activity = await this.calendar.resetOwn(activityId, this.timezone(before.game));
1867
2034
  await this.sweepImages();
1868
2035
  this.changed(before.game);
1869
2036
  return activity;
package/lib/gateway.js CHANGED
@@ -17,9 +17,9 @@ import {
17
17
  copyLabel,
18
18
  lib_default,
19
19
  streamFacts
20
- } from "./chunk-ZQ6KFVEO.js";
20
+ } from "./chunk-OPV336S5.js";
21
21
  import "./chunk-CCAB6XXZ.js";
22
- import "./chunk-HPQCV6WO.js";
22
+ import "./chunk-QAP7IYBS.js";
23
23
  import "./chunk-2UFLGPDY.js";
24
24
  export {
25
25
  AGENT_PRESET,
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-HPQCV6WO.js";
4
+ } from "./chunk-QAP7IYBS.js";
5
5
  import "./chunk-2UFLGPDY.js";
6
6
 
7
7
  // packages/guard/lib/index.js
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-BNGDT7YT.js";
6
- import "./chunk-ZQ6KFVEO.js";
5
+ } from "./chunk-I5AFAEXG.js";
6
+ import "./chunk-OPV336S5.js";
7
7
  import {
8
8
  writeFileAtomic
9
9
  } from "./chunk-CCAB6XXZ.js";
@@ -11,7 +11,7 @@ import {
11
11
  INTERVENE_CAPABILITY,
12
12
  UPDATE_RULE,
13
13
  external_exports
14
- } from "./chunk-HPQCV6WO.js";
14
+ } from "./chunk-QAP7IYBS.js";
15
15
  import "./chunk-2UFLGPDY.js";
16
16
 
17
17
  // packages/intervene/lib/index.js
@@ -58,7 +58,7 @@ var INTERVENE_ROLE = {
58
58
  duty: [
59
59
  "# \u4F60\u7684\u89D2\u8272\uFF1A\u5E72\u9884",
60
60
  "\u4F60\u662F MultiGameAssistant \u7684\u300C\u5E72\u9884\u300Dagent\u3002\u811A\u672C\u8FD0\u884C\u65F6\u51FA\u9519\u3001\u5361\u4F4F\u6216\u8D85\u65F6\uFF0C\u8F6F\u4EF6\u628A\u8FD9\u6B21\u4E8B\u6545\u4EA4\u7ED9\u4F60\uFF1A\u5148\u770B\u65E5\u5FD7\u3001\u8FDB\u7A0B\u548C\u914D\u7F6E\uFF0C\u80FD\u7528\u547D\u4EE4\u6216\u5DE5\u5177\uFF08\u91CD\u8DD1\u4EFB\u52A1\u3001\u66F4\u65B0\u811A\u672C\u3001\u6539\u914D\u7F6E\u3001\u7ED3\u675F\u5361\u4F4F\u7684\u8FDB\u7A0B\uFF09\u89E3\u51B3\u7684\u5C31\u8FD9\u6837\u89E3\u51B3\uFF1B\u53EA\u6709\u65E5\u5FD7\u8BF4\u4E0D\u6E05\u3001\u5FC5\u987B\u770B\u753B\u9762\u65F6\u624D\u622A\u56FE\uFF0C\u5728\u6A21\u62DF\u5668\u6216\u7A97\u53E3\u91CC\u70B9\u3002\u5904\u7406\u5B8C\u8C03\u7528 intervention_done\u3002",
61
- "\u53EA\u5904\u7406\u8FD9\u4E00\u6B21\u4E8B\u6545\u3002\u4E0D\u5B89\u88C5\u65B0\u811A\u672C\u3001\u4E0D\u52A0\u6E38\u620F\u3001\u4E0D\u6539\u6D41\u6C34\u7EBF\u548C\u5B9A\u65F6\uFF1B\u8FD9\u4E9B\u5199\u8FDB intervention_done \u7684 summary \u7559\u7ED9\u7528\u6237\u3002"
61
+ "\u53EA\u5904\u7406\u8FD9\u4E00\u6B21\u4E8B\u6545\u3002\u4E0D\u5B89\u88C5\u65B0\u811A\u672C\u3001\u4E0D\u52A0\u6E38\u620F\u3001\u4E0D\u6539\u6D41\u6C34\u7EBF\u548C\u5B9A\u65F6\uFF1B\u8FD9\u4E9B\u5199\u8FDB intervention_done \u7684 summary \u7559\u7ED9\u7528\u6237\u3002\u95EE\u540C\u4E8B\uFF08agent_delegate\uFF09\u53EA\u5728\u5904\u7406\u8FD9\u6B21\u4E8B\u6545\u79BB\u4E0D\u5F00\u5B83\u65F6\u624D\u7528\uFF1A\u7B49\u5B83\u7684\u65F6\u95F4\u4E5F\u7B97\u5728\u4F60\u7684\u65F6\u9650\u91CC\u3002"
62
62
  ].join("\n")
63
63
  };
64
64
  var KEEP = 100;
@@ -99,7 +99,7 @@ var Interventions = class {
99
99
  }
100
100
  /** The intervention a session is doing, for the screen tools' permissions: the first still going (its turn is the one running). */
101
101
  forSession(sessionId) {
102
- const ids = sessionId === void 0 ? void 0 : this.#bySession.get(sessionId);
102
+ const ids = sessionId === void 0 ? void 0 : this.#bySession.get(this.#deps.parentOf?.(sessionId) ?? sessionId);
103
103
  for (const id of ids ?? []) {
104
104
  const active = this.#active.get(id);
105
105
  if (active !== void 0)
@@ -1529,6 +1529,7 @@ var AdgIntervene = class extends Service {
1529
1529
  const parts = run.resources.flatMap((r) => r.startsWith("adb:") ? [`\u6A21\u62DF\u5668 ${r.slice(4)}\uFF08target=emulator\uFF09`] : r === "desktop" ? ["\u684C\u9762\uFF08target=desktop\uFF1B\u7528 window_list \u627E\u5230\u6E38\u620F\u7A97\u53E3\u540E\u4E5F\u53EF\u4EE5 target=window \u53EA\u622A\u8FD9\u4E2A\u7A97\u53E3\uFF09"] : []);
1530
1530
  return parts.length > 0 ? parts.join("\uFF1B") : "\u6CA1\u6709\uFF08\u8FD9\u4E2A\u4EFB\u52A1\u4E0D\u7528\u6A21\u62DF\u5668\u4E5F\u4E0D\u7528\u684C\u9762\uFF0C\u53EA\u80FD\u622A\u56FE\u67E5\u770B\u3001\u66F4\u65B0\u6216\u91CD\u65B0\u8FD0\u884C\u811A\u672C\uFF09";
1531
1531
  },
1532
+ parentOf: (sessionId) => ctx.get("adgGateway")?.parentSession(sessionId),
1532
1533
  onChange: (item) => ctx.get("adgGateway")?.broadcast("intervene/changed", item),
1533
1534
  settle: async (incidentId, action) => {
1534
1535
  const monitor = ctx.get("adgMonitor")?.monitor;
@@ -1570,7 +1571,8 @@ var AdgIntervene = class extends Service {
1570
1571
  return false;
1571
1572
  return await approval.request({ agent: exec.agent, toolName: exec.name, callId: exec.callId, reason, signal: exec.signal }) === "allowed-once";
1572
1573
  },
1573
- sendToSession: async (sessionId, title, png) => {
1574
+ sendToSession: async (session, title, png) => {
1575
+ const sessionId = gateway.adgGateway.parentSession(session) ?? session;
1574
1576
  const notify = ctx.get("adgNotify");
1575
1577
  if (notify === void 0)
1576
1578
  return false;
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-D7JEXAT5.js";
5
- import "./chunk-J46OASOG.js";
4
+ } from "./chunk-ZR74PFWR.js";
5
+ import "./chunk-NWM5ZN7E.js";
6
6
  import {
7
7
  writeFileAtomic
8
8
  } from "./chunk-CCAB6XXZ.js";
@@ -11,7 +11,7 @@ import {
11
11
  MONITOR_CAPABILITY,
12
12
  MonitorSettings,
13
13
  external_exports
14
- } from "./chunk-HPQCV6WO.js";
14
+ } from "./chunk-QAP7IYBS.js";
15
15
  import "./chunk-2UFLGPDY.js";
16
16
 
17
17
  // packages/monitor/lib/index.js
package/lib/notify.js CHANGED
@@ -16,10 +16,10 @@ import {
16
16
  replyPlain,
17
17
  sessionConversations,
18
18
  textReply
19
- } from "./chunk-BNGDT7YT.js";
20
- import "./chunk-ZQ6KFVEO.js";
19
+ } from "./chunk-I5AFAEXG.js";
20
+ import "./chunk-OPV336S5.js";
21
21
  import "./chunk-CCAB6XXZ.js";
22
- import "./chunk-HPQCV6WO.js";
22
+ import "./chunk-QAP7IYBS.js";
23
23
  import "./chunk-2UFLGPDY.js";
24
24
  export {
25
25
  AdgNotify,
@@ -4,17 +4,17 @@ import {
4
4
  PARAMS_SCHEMA,
5
5
  parseDuration,
6
6
  taskParams
7
- } from "./chunk-D7JEXAT5.js";
7
+ } from "./chunk-ZR74PFWR.js";
8
8
  import {
9
9
  TaskInputError,
10
10
  renderTask
11
- } from "./chunk-J46OASOG.js";
11
+ } from "./chunk-NWM5ZN7E.js";
12
12
  import {
13
13
  MAIN,
14
14
  finalText,
15
15
  sessionConversations
16
- } from "./chunk-BNGDT7YT.js";
17
- import "./chunk-ZQ6KFVEO.js";
16
+ } from "./chunk-I5AFAEXG.js";
17
+ import "./chunk-OPV336S5.js";
18
18
  import {
19
19
  writeFileAtomic
20
20
  } from "./chunk-CCAB6XXZ.js";
@@ -33,7 +33,7 @@ import {
33
33
  isMarker,
34
34
  taskMessage,
35
35
  withStartEnd
36
- } from "./chunk-HPQCV6WO.js";
36
+ } from "./chunk-QAP7IYBS.js";
37
37
  import "./chunk-2UFLGPDY.js";
38
38
 
39
39
  // packages/orchestrator/lib/index.js
package/lib/qqbot.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  questionText,
5
5
  replyMarkdown,
6
6
  replyPlain
7
- } from "./chunk-BNGDT7YT.js";
8
- import "./chunk-ZQ6KFVEO.js";
7
+ } from "./chunk-I5AFAEXG.js";
8
+ import "./chunk-OPV336S5.js";
9
9
  import {
10
10
  writeFileAtomic
11
11
  } from "./chunk-CCAB6XXZ.js";
@@ -15,7 +15,7 @@ import {
15
15
  QQPending,
16
16
  QQSettings,
17
17
  external_exports
18
- } from "./chunk-HPQCV6WO.js";
18
+ } from "./chunk-QAP7IYBS.js";
19
19
  import "./chunk-2UFLGPDY.js";
20
20
 
21
21
  // packages/qqbot/lib/index.js
package/lib/runner.js CHANGED
@@ -19,9 +19,9 @@ import {
19
19
  runnerTools,
20
20
  setIn,
21
21
  taskParams
22
- } from "./chunk-D7JEXAT5.js";
23
- import "./chunk-J46OASOG.js";
24
- import "./chunk-HPQCV6WO.js";
22
+ } from "./chunk-ZR74PFWR.js";
23
+ import "./chunk-NWM5ZN7E.js";
24
+ import "./chunk-QAP7IYBS.js";
25
25
  import "./chunk-2UFLGPDY.js";
26
26
  export {
27
27
  AdgRunner,
package/lib/scheduler.js CHANGED
@@ -2,7 +2,7 @@ import { createRequire as __adgCreateRequire } from 'node:module'; import { dirn
2
2
  import {
3
3
  SCHEDULE_CAPABILITY,
4
4
  external_exports
5
- } from "./chunk-HPQCV6WO.js";
5
+ } from "./chunk-QAP7IYBS.js";
6
6
  import "./chunk-2UFLGPDY.js";
7
7
 
8
8
  // packages/scheduler/lib/index.js
@@ -32,11 +32,11 @@ import {
32
32
  globToRegExp,
33
33
  parseManifest,
34
34
  versionOfTag
35
- } from "./chunk-J46OASOG.js";
35
+ } from "./chunk-NWM5ZN7E.js";
36
36
  import {
37
37
  sessionConversations
38
- } from "./chunk-BNGDT7YT.js";
39
- import "./chunk-ZQ6KFVEO.js";
38
+ } from "./chunk-I5AFAEXG.js";
39
+ import "./chunk-OPV336S5.js";
40
40
  import {
41
41
  writeFileAtomic
42
42
  } from "./chunk-CCAB6XXZ.js";
@@ -59,7 +59,7 @@ import {
59
59
  optimizeScriptPrompt,
60
60
  parseGitHubLink,
61
61
  taskMessage
62
- } from "./chunk-HPQCV6WO.js";
62
+ } from "./chunk-QAP7IYBS.js";
63
63
  import "./chunk-2UFLGPDY.js";
64
64
 
65
65
  // packages/script-registry/lib/index.js
@@ -94,7 +94,7 @@ var SCRIPT_ROLE = {
94
94
  "\u4F60\u662F MultiGameAssistant \u7684\u300C\u811A\u672C\u300Dagent\uFF1A\u5B89\u88C5\u3001\u66F4\u65B0\u548C\u4ECB\u7ECD\u811A\u672C\uFF0C\u68C0\u67E5\u548C\u4FEE\u597D\u8FD0\u884C\u73AF\u5883\uFF0C\u68C0\u67E5\u811A\u672C\u5305\uFF0C\u5B89\u88C5\u548C\u5408\u5E76\u6280\u80FD\u3002",
95
95
  UPDATE_RULE,
96
96
  "script_update \u4ECE Mirror\u9171\uFF08\u8F6F\u4EF6\u91CC\u7684 CDK\uFF0C\u6216\u811A\u672C\u81EA\u5DF1\u8BBE\u7F6E\u91CC\u586B\u7684 CDK\uFF09\u6216 GitHub \u7684\u53D1\u5E03\u5305\u4E0B\u8F7D\uFF0C\u5E76\u63A5\u4E0A\u539F\u6765\u7684\u914D\u7F6E\u3002\u8FD0\u884C\u4EFB\u52A1\u524D\u8F6F\u4EF6\u4E5F\u4F1A\u5148\u8FD9\u6837\u66F4\u65B0\u4E00\u6B21\uFF08\u8DDF\u7740\u5206\u652F\u6E90\u7801\u7684\u811A\u672C\u4E0D\u4F1A\u81EA\u52A8\u66F4\u65B0\uFF09\uFF0C\u66F4\u65B0\u5931\u8D25\u5C31\u7167\u65E7\u7528\u73B0\u6709\u7248\u672C\u8FD0\u884C\u3002",
97
- "\u4E0D\u8BFB\u6E38\u620F\u6D3B\u52A8\u3001\u4E0D\u5199\u65E5\u62A5\u3001\u4E0D\u6539\u6D41\u6C34\u7EBF\u548C\u5B9A\u65F6\uFF1B\u9700\u8981\u8FD9\u4E9B\u65F6\u5728\u56DE\u590D\u91CC\u8BF4\u6E05\u695A\uFF0C\u7528\u6237\u4F1A\u4EA4\u7ED9\u5BF9\u5E94\u7684 agent\u3002"
97
+ "\u4E0D\u8BFB\u6E38\u620F\u6D3B\u52A8\u3001\u4E0D\u5199\u65E5\u62A5\u3001\u4E0D\u6539\u6D41\u6C34\u7EBF\u548C\u5B9A\u65F6\uFF1B\u9700\u8981\u8FD9\u4E9B\u65F6\u4EA4\u7ED9\u5BF9\u5E94\u7684\u540C\u4E8B\uFF08agent_delegate\uFF09\uFF0C\u6216\u8005\u5728\u56DE\u590D\u91CC\u8BF4\u6E05\u695A\u3002"
98
98
  ].join("\n")
99
99
  };
100
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-multigameassistant",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "多游戏助手 MultiGameAssistant 的 dsh 插件版:让 agent 管好各个游戏的日常脚本(安装、编排定时流水线、看护运行、查活动),界面在自己的网页里。",
5
5
  "keywords": [
6
6
  "dsh",
@@ -33,6 +33,8 @@ description: 游戏活动信息:查有什么活动、还剩几天、商店换
33
33
 
34
34
  - 新加:写 `game`、`name`,有时间就写 `starts_at` / `ends_at`(游戏服务器时间)。改已有的:先 `game_activities` 找到 `id`,只写要改的字段。
35
35
  - 图片 `image`:用户给的图片网址、本机图片文件路径,或 `screenshot`(这个对话最近一张截图,比如刚用 `screen_capture` 截的活动页)。
36
+ - 活动图片分三级:用户设的 > 数据站和网页给的 > agent 的截图。`screenshot` 算 agent 的截图,有别的图时不显示;用户想让截图显示,用 `use_source`=screen。
37
+ - 一个活动有多个来源时(`game_activities` 的 `sources`),用户说「用 PRTS 的时间」就写 `use_source`(来源 id、own、screen,或 default 恢复默认顺序):图片和时间都跟着换。
36
38
  - 用户填的内容比数据站优先,刷新不会改掉。要恢复成来源的:`clear` 列出字段,或 `game_activity_remove`(what=mine)。用户要删掉才用 `game_activity_remove`(what=all)。
37
39
 
38
40
  ## 日报