dsh-multigameassistant 2.0.3 → 2.0.5

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.
@@ -3,7 +3,7 @@ import {
3
3
  ScriptFamily,
4
4
  ScriptId,
5
5
  external_exports
6
- } from "./chunk-IH3K4QPN.js";
6
+ } from "./chunk-BTT2GBTQ.js";
7
7
  import {
8
8
  __commonJS,
9
9
  __require,
@@ -7340,9 +7340,6 @@ var require_dist = __commonJS({
7340
7340
  }
7341
7341
  });
7342
7342
 
7343
- // packages/pack-schema/lib/parse.js
7344
- var import_yaml = __toESM(require_dist(), 1);
7345
-
7346
7343
  // packages/pack-schema/lib/manifest.js
7347
7344
  var Requirement = external_exports.object({
7348
7345
  /** e.g. `dotnet-desktop-runtime`, `vcredist`, `adb`, `python`, `node`, `emulator`. */
@@ -7420,7 +7417,9 @@ var ConfigPatch = external_exports.object({
7420
7417
  when: external_exports.enum(["emulator-managed"]).optional(),
7421
7418
  set: external_exports.array(external_exports.object({
7422
7419
  path: external_exports.array(PathSegment).min(1),
7423
- value: external_exports.unknown()
7420
+ value: external_exports.unknown(),
7421
+ /** What this change does, for people: shown in the script's guide (e.g. 「启动 MAA 后直接开始任务」). */
7422
+ note: external_exports.string().optional()
7424
7423
  })).min(1)
7425
7424
  });
7426
7425
  var Resources = external_exports.object({
@@ -7538,6 +7537,65 @@ var Recovery = external_exports.object({
7538
7537
  do: external_exports.enum(["reconnect-adb", "restart", "stop"]),
7539
7538
  max: external_exports.number().int().min(1).max(10).default(1)
7540
7539
  });
7540
+ var Text = external_exports.string().trim().min(1);
7541
+ var KeyRef = external_exports.object({
7542
+ /** One of `config.files` (a path it lists, or a file its `*` matches). */
7543
+ file: external_exports.string().min(1),
7544
+ path: external_exports.array(PathSegment).min(1)
7545
+ });
7546
+ var Guide = external_exports.object({
7547
+ /** What the script does and how (on an emulator, or holding the mouse), in a few sentences. */
7548
+ overview: Text,
7549
+ /** One-time setup before the first run, in order: what to set in the script's own window. */
7550
+ setup: external_exports.array(Text).default([]),
7551
+ /** What to check before each run. */
7552
+ checks: external_exports.array(Text).default([]),
7553
+ /** The script's features and how each is turned on. */
7554
+ features: external_exports.array(external_exports.object({
7555
+ title: Text,
7556
+ description: Text.optional(),
7557
+ /** How to turn it on in the script's own window: where it is and what to pick. */
7558
+ enable: Text,
7559
+ /** The config keys behind that setting and the value that turns it on. */
7560
+ config: external_exports.array(KeyRef.extend({ value: external_exports.unknown() })).default([]),
7561
+ /** Tasks that do it, by id. */
7562
+ tasks: external_exports.array(external_exports.string()).default([])
7563
+ })).default([]),
7564
+ /** The config files: what each holds and the keys that matter. */
7565
+ config: external_exports.array(external_exports.object({
7566
+ file: external_exports.string().min(1),
7567
+ /** What the file holds and when the script reads it. */
7568
+ about: Text,
7569
+ keys: external_exports.array(external_exports.object({
7570
+ path: external_exports.array(PathSegment).min(1),
7571
+ /** What the key does. */
7572
+ meaning: Text,
7573
+ /** Its values and what each means, e.g. 「True 开,False 关」. */
7574
+ values: Text.optional(),
7575
+ /** Its default, as the script writes it. */
7576
+ default: external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).optional(),
7577
+ /** What to set it to for use with MultiGameAssistant, and why. */
7578
+ advice: Text.optional()
7579
+ })).default([])
7580
+ })).default([]),
7581
+ /** Common problems: what is seen (a log message in the script's own words, or a symptom), what it means, what to do. */
7582
+ troubleshooting: external_exports.array(external_exports.object({
7583
+ problem: Text,
7584
+ cause: Text.optional(),
7585
+ fix: Text,
7586
+ /** The log rule it comes from (a rule's tag). */
7587
+ tag: external_exports.string().optional()
7588
+ })).default([])
7589
+ });
7590
+ function declaresFile(files, file) {
7591
+ const norm = (p) => p.replace(/\\/g, "/").toLowerCase();
7592
+ return files.some((f) => {
7593
+ if (!f.path.includes("*"))
7594
+ return norm(f.path) === norm(file);
7595
+ const pattern = norm(f.path).split("*").map((part) => part.replace(/[.+?^${}()|[\]\\]/g, "\\$&")).join("[^/]*");
7596
+ return new RegExp(`^${pattern}$`).test(norm(file));
7597
+ });
7598
+ }
7541
7599
  var ScriptManifest = external_exports.object({
7542
7600
  id: ScriptId,
7543
7601
  name: external_exports.string().min(1),
@@ -7589,6 +7647,8 @@ var ScriptManifest = external_exports.object({
7589
7647
  logs: Logs.default({ sources: [{ stdout: true, encoding: "auto" }], rules: [] }),
7590
7648
  recovery: external_exports.array(Recovery).default([]),
7591
7649
  game: Game.optional(),
7650
+ /** The user guide shown on the 脚本 page. */
7651
+ guide: Guide.optional(),
7592
7652
  intervention: open.optional(),
7593
7653
  update: open.optional()
7594
7654
  }).superRefine((manifest, issues) => {
@@ -7605,9 +7665,231 @@ var ScriptManifest = external_exports.object({
7605
7665
  if (!tags.has(entry.on))
7606
7666
  issues.addIssue({ code: "custom", path: ["recovery", index, "on"], message: `no log rule has tag ${entry.on} (use a rule tag, stalled or failed)` });
7607
7667
  });
7668
+ const guide = manifest.guide;
7669
+ if (guide === void 0)
7670
+ return;
7671
+ const file = (name, path) => {
7672
+ if (!declaresFile(manifest.config.files, name))
7673
+ issues.addIssue({ code: "custom", path, message: `${name} is not one of config.files` });
7674
+ };
7675
+ guide.features.forEach((feature, index) => {
7676
+ feature.config.forEach((key, k) => file(key.file, ["guide", "features", index, "config", k, "file"]));
7677
+ feature.tasks.forEach((task, t) => {
7678
+ if (!ids.has(task))
7679
+ issues.addIssue({ code: "custom", path: ["guide", "features", index, "tasks", t], message: `no task ${task}` });
7680
+ });
7681
+ });
7682
+ guide.config.forEach((entry, index) => file(entry.file, ["guide", "config", index, "file"]));
7683
+ guide.troubleshooting.forEach((entry, index) => {
7684
+ if (entry.tag !== void 0 && !tags.has(entry.tag))
7685
+ issues.addIssue({ code: "custom", path: ["guide", "troubleshooting", index, "tag"], message: `no log rule has tag ${entry.tag}` });
7686
+ });
7608
7687
  });
7609
7688
 
7689
+ // packages/pack-schema/lib/guide.js
7690
+ var FACTS = { adb: "\u6A21\u62DF\u5668\u7684 ADB \u5730\u5740", dir: "\u811A\u672C\u76EE\u5F55" };
7691
+ var WHEN = { "emulator-managed": "\u672C\u5E94\u7528\u542F\u52A8\u4E86\u6A21\u62DF\u5668\u65F6\uFF08\u586B\u4E86\u624B\u52A8 ADB \u5730\u5740\u65F6\u4E0D\u6539\uFF09" };
7692
+ function keyText(path, params = {}) {
7693
+ return path.map((seg) => typeof seg === "string" ? seg : typeof seg === "number" ? `[${seg}]` : `[${seg.where.field} = ${templateText(seg.where.equals, params)}]`).join(" \u203A ");
7694
+ }
7695
+ function valueText(value, params = {}) {
7696
+ if (typeof value === "string")
7697
+ return templateText(value, params);
7698
+ if (value === void 0)
7699
+ return "";
7700
+ return JSON.stringify(value);
7701
+ }
7702
+ function templateText(template, params) {
7703
+ const name = (key) => FACTS[key] ?? (params[key] === void 0 ? `{${key}}` : `\u53C2\u6570 ${key}${params[key].description === void 0 ? "" : `\uFF08${params[key].description}\uFF09`}`);
7704
+ const whole = /^\{([A-Za-z][A-Za-z0-9_.]*)\}$/.exec(template);
7705
+ if (whole !== null)
7706
+ return `\u300C${name(whole[1])}\u300D`;
7707
+ return template.replace(/\{([A-Za-z][A-Za-z0-9_.]*)\}/g, (_, key) => `\u300C${name(key)}\u300D`);
7708
+ }
7709
+ function paramValues(spec) {
7710
+ if (spec.enum !== void 0)
7711
+ return spec.enum.join("\u3001");
7712
+ if (spec.choices !== void 0)
7713
+ return `\u4ECE\u811A\u672C\u914D\u7F6E\uFF08${spec.choices.file}\uFF09\u91CC\u5DF2\u6709\u7684\u9879\u4E2D\u9009${spec.choices.create === void 0 ? "" : "\uFF0C\u4E5F\u53EF\u4EE5\u65B0\u5EFA\u4E00\u4E2A"}`;
7714
+ if (spec.type === "boolean")
7715
+ return "true\uFF08\u662F\uFF09/ false\uFF08\u5426\uFF09";
7716
+ return void 0;
7717
+ }
7718
+ function guideView(manifest, options) {
7719
+ const guide = manifest.guide;
7720
+ const titleOf = (id) => manifest.tasks.find((t) => t.id === id)?.title ?? id;
7721
+ const files = (guide?.config ?? []).map((entry) => ({
7722
+ file: entry.file,
7723
+ about: entry.about,
7724
+ keys: entry.keys.map((k) => ({
7725
+ key: keyText(k.path),
7726
+ meaning: k.meaning,
7727
+ ...k.values === void 0 ? {} : { values: k.values },
7728
+ ...k.default === void 0 ? {} : { default: String(k.default) },
7729
+ ...k.advice === void 0 ? {} : { advice: k.advice }
7730
+ })),
7731
+ changes: []
7732
+ }));
7733
+ for (const task of manifest.tasks) {
7734
+ for (const patch of task.patches) {
7735
+ let entry = files.find((f) => f.file === patch.file) ?? files.find((f) => declaresFile([{ path: f.file }], patch.file));
7736
+ if (entry === void 0) {
7737
+ entry = { file: patch.file, keys: [], changes: [] };
7738
+ files.push(entry);
7739
+ }
7740
+ for (const op of patch.set) {
7741
+ const key = keyText(op.path, task.params);
7742
+ const value = valueText(op.value, task.params);
7743
+ const when = patch.when === void 0 ? void 0 : WHEN[patch.when] ?? patch.when;
7744
+ const same = entry.changes.find((c) => c.key === key && c.value === value && c.when === when);
7745
+ if (same !== void 0) {
7746
+ if (!same.tasks.includes(task.title))
7747
+ same.tasks.push(task.title);
7748
+ if (same.note === void 0 && op.note !== void 0)
7749
+ same.note = op.note;
7750
+ continue;
7751
+ }
7752
+ entry.changes.push({ key, value, ...op.note === void 0 ? {} : { note: op.note }, ...when === void 0 ? {} : { when }, tasks: [task.title] });
7753
+ }
7754
+ }
7755
+ }
7756
+ const overview = guide?.overview ?? manifest.description;
7757
+ return {
7758
+ packId: manifest.id,
7759
+ name: manifest.name,
7760
+ builtin: options.builtin,
7761
+ written: guide !== void 0,
7762
+ ...overview === void 0 ? {} : { overview },
7763
+ tasks: manifest.tasks.map((task) => ({
7764
+ id: task.id,
7765
+ title: task.title,
7766
+ ...task.description === void 0 ? {} : { description: task.description },
7767
+ utterances: [...task.utterances],
7768
+ input: task.resources.input,
7769
+ ...task.expectedDuration === void 0 ? {} : { expectedDuration: task.expectedDuration },
7770
+ params: Object.entries(task.params).map(([name, spec]) => {
7771
+ const values = paramValues(spec);
7772
+ return {
7773
+ name,
7774
+ type: spec.type,
7775
+ ...spec.description === void 0 ? {} : { description: spec.description },
7776
+ ...spec.default === void 0 ? {} : { default: String(spec.default) },
7777
+ ...values === void 0 ? {} : { values }
7778
+ };
7779
+ })
7780
+ })),
7781
+ setup: [...guide?.setup ?? []],
7782
+ checks: [...guide?.checks ?? []],
7783
+ features: (guide?.features ?? []).map((f) => ({
7784
+ title: f.title,
7785
+ ...f.description === void 0 ? {} : { description: f.description },
7786
+ enable: f.enable,
7787
+ config: f.config.map((k) => ({ file: k.file, key: keyText(k.path), value: valueText(k.value) })),
7788
+ tasks: f.tasks.map(titleOf)
7789
+ })),
7790
+ config: files,
7791
+ troubleshooting: (guide?.troubleshooting ?? []).map((p) => ({ problem: p.problem, ...p.cause === void 0 ? {} : { cause: p.cause }, fix: p.fix }))
7792
+ };
7793
+ }
7794
+ var TOOLS = [
7795
+ "script_analyze",
7796
+ "script_changelog",
7797
+ "script_choice_create",
7798
+ "script_config_get",
7799
+ "script_config_import",
7800
+ "script_config_set",
7801
+ "script_config_status",
7802
+ "script_env_check",
7803
+ "script_env_fix",
7804
+ "script_help",
7805
+ "script_import",
7806
+ "script_install",
7807
+ "script_list",
7808
+ "script_profiles",
7809
+ "script_releases",
7810
+ "script_remove",
7811
+ "script_rollback",
7812
+ "script_run",
7813
+ "script_run_log",
7814
+ "script_runs",
7815
+ "script_search",
7816
+ "script_settings",
7817
+ "script_setup_run",
7818
+ "script_stop",
7819
+ "script_tasks",
7820
+ "script_update",
7821
+ "pack_propose",
7822
+ "pack_reviewed",
7823
+ "skill_focus",
7824
+ "skill_save",
7825
+ "skill_hub_install",
7826
+ "skill_hub_list",
7827
+ "emulator_configure",
7828
+ "emulator_install",
7829
+ "emulator_start",
7830
+ "emulator_status",
7831
+ "emulator_stop",
7832
+ "game_launch",
7833
+ "game_locate",
7834
+ "game_path_set",
7835
+ "intervention_done",
7836
+ "monitor_incidents",
7837
+ "monitor_stall_check",
7838
+ "monitor_stall_set"
7839
+ ];
7840
+ var AGENT_NOTES = [
7841
+ [new RegExp(`\\b(?:${TOOLS.join("|")})\\b`), "\u5DE5\u5177\u540D", "anywhere"],
7842
+ // A bare word: `resource/manifest.json` in a script's log is the script's own file.
7843
+ [/(?<![\w./\\-])manifest(?![\w./\\-])|adg\.script\.yaml|SKILL\.md/i, "\u811A\u672C\u5305\u7684\u6587\u4EF6", "unquoted"],
7844
+ [/\bpatch(?:es)?\b|\bdone-log\b|\bexit-code\b|\bstopAfterDone\b|\bselfLaunch\b|\brestore\b|\bsuccess:/i, "\u811A\u672C\u5305\u7684\u5B57\u6BB5", "unquoted"],
7845
+ [/\{[A-Za-z][A-Za-z0-9_.]*\}/, "\u5360\u4F4D\u7B26", "unquoted"],
7846
+ [/渲染器|占位符|待确认|待核验|待校准|尚未验证|未经验证|核验依据|本草稿|草稿/, "\u7ED9 agent \u7684\u5907\u6CE8", "unquoted"]
7847
+ ];
7848
+ var unquoted = (text) => text.replace(/「[^」]*」/g, "\u300C\u300D");
7849
+ function guideIssues(manifest) {
7850
+ const issues = [];
7851
+ if (manifest.guide === void 0)
7852
+ issues.push("\u7F3A\u5C11 guide\uFF08\u7ED9\u7528\u6237\u770B\u7684\u4F7F\u7528\u8BF4\u660E\uFF09\uFF1A\u81F3\u5C11\u5199 overview\uFF0C\u518D\u6309\u811A\u672C\u7684\u5B9E\u9645\u60C5\u51B5\u5199 setup\u3001checks\u3001features\u3001config\u3001troubleshooting");
7853
+ const texts = [];
7854
+ for (const task of manifest.tasks) {
7855
+ if (task.description === void 0)
7856
+ issues.push(`\u4EFB\u52A1 ${task.id} \u7F3A\u5C11 description\uFF1A\u7528\u4E00\u4E24\u53E5\u8BDD\u544A\u8BC9\u7528\u6237\u8FD9\u4E2A\u4EFB\u52A1\u505A\u4EC0\u4E48`);
7857
+ texts.push([`tasks.${task.id}.title`, task.title], [`tasks.${task.id}.description`, task.description]);
7858
+ for (const [name, spec] of Object.entries(task.params)) {
7859
+ if (spec.description === void 0)
7860
+ issues.push(`\u4EFB\u52A1 ${task.id} \u7684\u53C2\u6570 ${name} \u7F3A\u5C11 description\uFF1A\u5199\u5B83\u7684\u542B\u4E49`);
7861
+ texts.push([`tasks.${task.id}.params.${name}.description`, spec.description]);
7862
+ }
7863
+ task.patches.forEach((patch, p) => patch.set.forEach((op, s) => texts.push([`tasks.${task.id}.patches.${p}.set.${s}.note`, op.note])));
7864
+ }
7865
+ const guide = manifest.guide;
7866
+ if (guide !== void 0) {
7867
+ texts.push(["guide.overview", guide.overview]);
7868
+ guide.setup.forEach((t, i) => texts.push([`guide.setup.${i}`, t]));
7869
+ guide.checks.forEach((t, i) => texts.push([`guide.checks.${i}`, t]));
7870
+ guide.features.forEach((f, i) => texts.push([`guide.features.${i}.title`, f.title], [`guide.features.${i}.description`, f.description], [`guide.features.${i}.enable`, f.enable]));
7871
+ guide.config.forEach((c, i) => {
7872
+ texts.push([`guide.config.${i}.about`, c.about]);
7873
+ c.keys.forEach((k, j) => texts.push([`guide.config.${i}.keys.${j}.meaning`, k.meaning], [`guide.config.${i}.keys.${j}.values`, k.values], [`guide.config.${i}.keys.${j}.advice`, k.advice]));
7874
+ });
7875
+ guide.troubleshooting.forEach((t, i) => texts.push([`guide.troubleshooting.${i}.problem`, t.problem], [`guide.troubleshooting.${i}.cause`, t.cause], [`guide.troubleshooting.${i}.fix`, t.fix]));
7876
+ }
7877
+ for (const [where, text] of texts) {
7878
+ if (text === void 0)
7879
+ continue;
7880
+ for (const [pattern, what, scope] of AGENT_NOTES) {
7881
+ const found = pattern.exec(scope === "anywhere" ? text : unquoted(text));
7882
+ if (found === null)
7883
+ continue;
7884
+ issues.push(`${where} \u91CC\u6709${what}\u300C${found[0]}\u300D\uFF1A\u4F7F\u7528\u8BF4\u660E\u53EA\u5199\u7528\u6237\u8981\u77E5\u9053\u7684\uFF08\u80FD\u505A\u4EC0\u4E48\u3001\u600E\u4E48\u8BBE\u7F6E\u3001\u51FA\u9519\u600E\u4E48\u529E\uFF09\uFF1B\u5DE5\u5177\u7528\u6CD5\u3001\u811A\u672C\u5305\u5185\u90E8\u3001\u6838\u9A8C\u4F9D\u636E\u548C\u5F85\u786E\u8BA4\u5199\u8FDB SKILL.md${scope === "unquoted" ? "\u3002\u5982\u679C\u8FD9\u662F\u811A\u672C\u81EA\u5DF1\u7684\u65E5\u5FD7\u539F\u6587\u6216\u754C\u9762\u6587\u5B57\uFF0C\u7528\u300C\u300D\u62EC\u8D77\u6765\u3001\u539F\u6837\u4FDD\u7559\uFF0C\u4E0D\u8981\u6539\u5199" : ""}`);
7885
+ break;
7886
+ }
7887
+ }
7888
+ return issues;
7889
+ }
7890
+
7610
7891
  // packages/pack-schema/lib/parse.js
7892
+ var import_yaml = __toESM(require_dist(), 1);
7611
7893
  var PackError = class extends Error {
7612
7894
  file;
7613
7895
  issues;
@@ -7893,6 +8175,8 @@ var MANIFEST_FILE = "adg.script.yaml";
7893
8175
  var SKILL_FILE = "SKILL.md";
7894
8176
 
7895
8177
  export {
8178
+ guideView,
8179
+ guideIssues,
7896
8180
  TaskInputError,
7897
8181
  renderTask,
7898
8182
  require_dist,
@@ -1,14 +1,15 @@
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
  globToRegExp,
4
+ guideView,
4
5
  renderTask,
5
6
  require_dist
6
- } from "./chunk-OQZ2XZVP.js";
7
+ } from "./chunk-KHO3SRUJ.js";
7
8
  import {
8
9
  RUNS_CAPABILITY,
9
10
  ScriptId,
10
11
  external_exports
11
- } from "./chunk-IH3K4QPN.js";
12
+ } from "./chunk-BTT2GBTQ.js";
12
13
  import {
13
14
  __toESM
14
15
  } from "./chunk-2UFLGPDY.js";
@@ -2372,15 +2373,24 @@ function runnerTools(runner, config) {
2372
2373
  }),
2373
2374
  tool({
2374
2375
  name: TOOL_NAMES.tasks,
2375
- description: "\u5217\u51FA\u4E00\u4E2A\u811A\u672C\u80FD\u8FD0\u884C\u7684\u4EFB\u52A1\uFF1A\u4EFB\u52A1 id\u3001\u540D\u79F0\u3001\u7528\u6237\u53EF\u80FD\u7684\u8BF4\u6CD5\u3001\u53C2\u6570\uFF08\u7C7B\u578B\u3001\u9ED8\u8BA4\u503C\u3001\u53EF\u9009\u503C\uFF1Bchoices \u662F\u4ECE\u811A\u672C\u914D\u7F6E\u91CC\u8BFB\u51FA\u7684\u53EF\u9009\u9879\uFF0C\u4F8B\u5982 MaaEnd \u7684\u5B9E\u4F8B\u540D\uFF0CcanCreate \u8868\u793A\u53EF\u4EE5\u7528 script_choice_create \u65B0\u5EFA\uFF09\u3001\u5360\u7528\u7684\u8D44\u6E90\uFF08desktop \u62A2\u5360\u9F20\u6807\u952E\u76D8\u3001adb \u4F7F\u7528\u6A21\u62DF\u5668\uFF09\u3002\u8FD0\u884C\u524D\u5148\u8C03\u7528\u5B83\u628A\u7528\u6237\u7684\u8BDD\u5BF9\u5E94\u5230\u4EFB\u52A1\u548C\u53C2\u6570\u3002",
2376
- properties: { id, profile: { ...profile, description: "\u53EF\u9009\u9879\uFF08choices\uFF09\u4ECE\u54EA\u4EFD\u914D\u7F6E\u91CC\u8BFB\uFF1B\u4E0D\u586B\u662F\u5F53\u524D\u90A3\u4EFD\u3002" } },
2376
+ description: "\u5217\u51FA\u4E00\u4E2A\u811A\u672C\u80FD\u8FD0\u884C\u7684\u4EFB\u52A1\uFF1A\u4EFB\u52A1 id\u3001\u540D\u79F0\u3001\u7528\u6237\u53EF\u80FD\u7684\u8BF4\u6CD5\u3001\u53C2\u6570\uFF08\u7C7B\u578B\u3001\u9ED8\u8BA4\u503C\u3001\u53EF\u9009\u503C\uFF1Bchoices \u662F\u4ECE\u811A\u672C\u914D\u7F6E\u91CC\u8BFB\u51FA\u7684\u53EF\u9009\u9879\uFF0C\u4F8B\u5982 MaaEnd \u7684\u5B9E\u4F8B\u540D\uFF0CcanCreate \u8868\u793A\u53EF\u4EE5\u7528 script_choice_create \u65B0\u5EFA\uFF09\u3001\u5360\u7528\u7684\u8D44\u6E90\uFF08desktop \u62A2\u5360\u9F20\u6807\u952E\u76D8\u3001adb \u4F7F\u7528\u6A21\u62DF\u5668\uFF09\u3002\u8FD0\u884C\u524D\u5148\u8C03\u7528\u5B83\u628A\u7528\u6237\u7684\u8BDD\u5BF9\u5E94\u5230\u4EFB\u52A1\u548C\u53C2\u6570\u3002guide \u4E3A true \u65F6\u9644\u4E0A\u811A\u672C\u5305\u7684\u4F7F\u7528\u8BF4\u660E\uFF08\u811A\u672C\u9875\u4E0A\u7ED9\u7528\u6237\u770B\u7684\u540C\u4E00\u4EFD\uFF09\uFF1A\u529F\u80FD\u600E\u4E48\u5F00\u542F\u3001\u914D\u7F6E\u6587\u4EF6\u7684\u91CD\u8981\u952E\u548C\u8FD0\u884C\u65F6\u4E34\u65F6\u6539\u7684\u952E\u3001\u9996\u6B21\u8BBE\u7F6E\u3001\u8FD0\u884C\u524D\u68C0\u67E5\u3001\u5E38\u89C1\u95EE\u9898\uFF1B\u7528\u6237\u95EE\u300C\u600E\u4E48\u5F00\u542F\u67D0\u529F\u80FD\u300D\u300C\u8FD9\u4E2A\u8BBE\u7F6E\u662F\u4EC0\u4E48\u610F\u601D\u300D\u300C\u8FD9\u4E2A\u62A5\u9519\u600E\u4E48\u529E\u300D\u65F6\u7528\u3002",
2377
+ properties: {
2378
+ id,
2379
+ profile: { ...profile, description: "\u53EF\u9009\u9879\uFF08choices\uFF09\u4ECE\u54EA\u4EFD\u914D\u7F6E\u91CC\u8BFB\uFF1B\u4E0D\u586B\u662F\u5F53\u524D\u90A3\u4EFD\u3002" },
2380
+ guide: { type: "boolean", description: "\u9644\u4E0A\u4F7F\u7528\u8BF4\u660E\u3002" }
2381
+ },
2377
2382
  required: ["id"],
2378
2383
  readOnly: true,
2379
2384
  kind: "read",
2380
2385
  title: (a) => `\u67E5\u770B\u4EFB\u52A1\uFF1A${String(a["id"] ?? "")}`,
2381
2386
  execute: async (args) => {
2382
- const a = parse(external_exports.object({ id: ScriptId, profile: Profile }), args);
2383
- return { ...await runner.tasks(a.id, ref(a.profile)), profiles: await runner.profiles.list(a.id) };
2387
+ const a = parse(external_exports.object({ id: ScriptId, profile: Profile, guide: external_exports.boolean().nullish() }), args);
2388
+ const listed = { ...await runner.tasks(a.id, ref(a.profile)), profiles: await runner.profiles.list(a.id) };
2389
+ const manifest = a.guide === true ? config.library.packOf(a.id)?.manifest : void 0;
2390
+ if (manifest === void 0)
2391
+ return listed;
2392
+ const { tasks: _tasks, packId: _packId, builtin: _builtin, ...guide } = guideView(manifest, { builtin: false });
2393
+ return { ...listed, guide };
2384
2394
  }
2385
2395
  }),
2386
2396
  tool({