@taptap/maker 0.0.28 → 0.0.29-beta.1

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/README.md CHANGED
@@ -32,4 +32,4 @@ or OpenClaw plugin package contents.
32
32
 
33
33
  Full connection and tool-call troubleshooting guide: `docs/MAKER_MCP_CONNECTION_TROUBLESHOOTING.md`.
34
34
 
35
- Version: 0.0.28
35
+ Version: 0.0.29-beta.1
package/dist/maker.js CHANGED
@@ -29158,20 +29158,30 @@ import fs5 from "node:fs";
29158
29158
  import path6 from "node:path";
29159
29159
 
29160
29160
  // src/maker/capabilityRouting.ts
29161
- var MAKER_CAPABILITY_ROUTING_INDEX = `TapTap Maker routing index:
29162
- - Start or resume Maker work, or diagnose project/MCP readiness: read
29163
- maker://status; use maker_status_lite when resources are unavailable.
29164
- - Build, preview, run, submit, or push: after checking project status, use
29165
- maker_build_current_directory.
29166
- - Ads: read maker://ads-integration-guide before any ad-related work.
29167
- - Tap flows: test QR -> generate_test_qrcode; current Maker game's online player feedback
29168
- (including player-submitted game bug reports, real-device game logs, or screenshots), or
29169
- server/Lua logs for a specified game session -> call get_debug_feedbacks only when it is
29170
- exposed by the current Maker tool list.
29171
- - Game assets: Maker MCP also provides image, video, music, sound-effect,
29172
- dialogue/voice, and 3D generation tools when exposed.
29173
-
29174
- Follow the selected tool schema and returned next_action.`;
29161
+ function formatMakerCapabilityRoutingIndex(options) {
29162
+ return [
29163
+ "TapTap Maker routing index:",
29164
+ "- Start or resume Maker work, or diagnose project/MCP readiness: read",
29165
+ " maker://status; use maker_status_lite when resources are unavailable.",
29166
+ "- Build, preview, run, submit, or push: after checking project status, use",
29167
+ " maker_build_current_directory.",
29168
+ "- Ads: read maker://ads-integration-guide before any ad-related work.",
29169
+ options.includeFeedback ? "- Tap flows: test QR -> generate_test_qrcode; current Maker game's online player feedback" : "",
29170
+ options.includeFeedback ? " (including player-submitted game bug reports, real-device game logs, or screenshots), or" : "- Tap flows: test QR -> generate_test_qrcode.",
29171
+ options.includeFeedback ? " server/Lua logs for a specified game session -> call get_debug_feedbacks only when it is" : "",
29172
+ options.includeFeedback ? " exposed by the current Maker tool list." : "",
29173
+ "- Game assets: Maker MCP also provides image, video, music, sound-effect,",
29174
+ " dialogue/voice, and 3D generation tools when exposed.",
29175
+ "",
29176
+ "Follow the selected tool schema and returned next_action."
29177
+ ].filter(Boolean).join("\n");
29178
+ }
29179
+ var MAKER_CAPABILITY_ROUTING_INDEX = formatMakerCapabilityRoutingIndex({
29180
+ includeFeedback: true
29181
+ });
29182
+ var MAKER_PROJECT_POLICY_ROUTING_INDEX = formatMakerCapabilityRoutingIndex({
29183
+ includeFeedback: false
29184
+ });
29175
29185
 
29176
29186
  // src/maker/cli/agentsPolicy.ts
29177
29187
  var MAKER_AGENTS_FILE = "AGENTS.md";
@@ -29261,7 +29271,7 @@ function createMakerAgentsPolicyBody() {
29261
29271
  "",
29262
29272
  "This is a bound TapTap Maker project.",
29263
29273
  "",
29264
- MAKER_CAPABILITY_ROUTING_INDEX,
29274
+ MAKER_PROJECT_POLICY_ROUTING_INDEX,
29265
29275
  "",
29266
29276
  "Maker build workflow:",
29267
29277
  "",
@@ -29343,20 +29353,6 @@ function createMakerAgentsPolicyBody() {
29343
29353
  " `generate_test_qrcode` once to generate test QR code metadata, then call `get_ad_config`",
29344
29354
  " again. Do not use publish-only tools for this recovery path.",
29345
29355
  "",
29346
- "Maker feedback workflow:",
29347
- "",
29348
- "- For user requests about the current Maker game's online player feedback, including",
29349
- " player-submitted game bug reports, real-device game logs, or screenshots, or server/Lua",
29350
- " logs for a specified game session, call the Maker proxy `get_debug_feedbacks` tool only",
29351
- " when it is exposed by the current Maker tool list.",
29352
- "- This includes 当前 Maker 游戏的玩家反馈、玩家提交的游戏故障、真机游戏日志或截图、",
29353
- " 指定游戏会话的服务端/Lua 日志. It does not include AI client, plugin, or other product",
29354
- " feedback.",
29355
- "- Use local runtime log files only for the current local build/runtime session. Do not use",
29356
- " local logs as a substitute for remote player-submitted feedback.",
29357
- "- Follow the remote tool schema and return the feedback records, logs, screenshots, and",
29358
- " full error payloads as provided by the remote Maker MCP server.",
29359
- "",
29360
29356
  "Maker MCP provides the following game asset generation and editing tools when they are",
29361
29357
  "exposed in the current session:",
29362
29358
  "",
@@ -31585,65 +31581,6 @@ function parseGitProgressLine(line) {
31585
31581
  return void 0;
31586
31582
  }
31587
31583
 
31588
- // src/maker/auth/patTap.ts
31589
- function getObjectValue(data, key) {
31590
- if (!data || typeof data !== "object") {
31591
- return void 0;
31592
- }
31593
- return data[key];
31594
- }
31595
- function normalizeTapAuthResponse(data) {
31596
- const body = data;
31597
- const nested = getObjectValue(body, "data");
31598
- const source = nested && typeof nested === "object" ? nested : body;
31599
- const kid = source.kid;
31600
- const macKey = source.mac_key;
31601
- if (typeof kid !== "string" || kid.length === 0 || typeof macKey !== "string" || macKey.length === 0) {
31602
- throw new Error("TapTap token response does not contain kid/mac_key");
31603
- }
31604
- return {
31605
- kid,
31606
- mac_key: macKey,
31607
- token_type: typeof source.token_type === "string" ? source.token_type : "mac",
31608
- mac_algorithm: typeof source.mac_algorithm === "string" ? source.mac_algorithm : "hmac-sha-1",
31609
- raw: data
31610
- };
31611
- }
31612
- function getMakerTapTokenUrl(environment) {
31613
- const tapTokenUrl = getMakerEndpoints(environment).tapTokenUrl;
31614
- return requireMakerEndpoint("tapTokenUrl", tapTokenUrl, environment);
31615
- }
31616
- async function requestTapAuthWithPat(manualPat, environment, options = {}) {
31617
- const pat = requireMakerPat(manualPat);
31618
- const response = await fetchWithTimeout(
31619
- options.fetchImpl || fetch,
31620
- getMakerTapTokenUrl(environment),
31621
- {
31622
- headers: {
31623
- Authorization: `Bearer ${pat.token}`,
31624
- Accept: "application/json"
31625
- }
31626
- },
31627
- options.timeoutMs ?? DEFAULT_SHORT_FETCH_TIMEOUT_MS,
31628
- "TapTap token request"
31629
- );
31630
- const text = await response.text();
31631
- let json2 = {};
31632
- if (text) {
31633
- try {
31634
- json2 = JSON.parse(text);
31635
- } catch {
31636
- json2 = { error: text };
31637
- }
31638
- }
31639
- if (!response.ok) {
31640
- throw new Error(`TapTap token request failed: HTTP ${response.status} ${JSON.stringify(json2)}`);
31641
- }
31642
- const auth2 = normalizeTapAuthResponse(json2);
31643
- saveTapAuth(auth2);
31644
- return auth2;
31645
- }
31646
-
31647
31584
  // src/maker/system/python.ts
31648
31585
  import { spawnSync as spawnSync4 } from "node:child_process";
31649
31586
  import fs8 from "node:fs";
@@ -36040,7 +35977,7 @@ var MAKER_STATUS_LITE_PUBLIC_DESCRIPTION = [
36040
35977
  "Compatibility tool for clients that cannot read the maker://status resource; prefer the resource when it is available.",
36041
35978
  "Use it when starting or resuming Maker work, or when the current project context and readiness are uncertain.",
36042
35979
  "Pass target_dir when the project cannot be resolved from MCP Roots or the server working directory; if multiple Maker projects remain ambiguous, ask the user instead of guessing.",
36043
- "By default the check may perform remote Git, package, dev-kit, proxy, and authentication probes. skip_remote_sync skips only remote Git and dev-kit freshness checks; it is not an offline or read-only mode.",
35980
+ "By default this is a fast local, read-only summary. Set detail=true only for explicit diagnostics; it enables remote Git, dev-kit, proxy, and maintenance checks. skip_remote_sync skips remote Git and dev-kit freshness checks in detail mode.",
36044
35981
  "Follow the returned next_action and next_step."
36045
35982
  ].join(" ");
36046
35983
  var MAKER_BUILD_CURRENT_DIRECTORY_PUBLIC_DESCRIPTION = [
@@ -36306,7 +36243,7 @@ function applyDefaults(config2) {
36306
36243
  var MAKER_MCP_TRACKING_ACTION = "tapmaker_mcp_call";
36307
36244
  var MAKER_MCP_TRACKING_SOURCE = "local_mcp";
36308
36245
  var MAKER_MCP_TRACKING_TIMEOUT_MS = 1500;
36309
- var MAKER_MCP_VERSION = "0.0.28".trim() ? "0.0.28".trim() : "dev";
36246
+ var MAKER_MCP_VERSION = "0.0.29-beta.1".trim() ? "0.0.29-beta.1".trim() : "dev";
36310
36247
  var TRACKING_ERROR_MAX_LENGTH = 500;
36311
36248
  function buildMakerMcpTrackingPayload(event) {
36312
36249
  var _a3, _b, _c;
@@ -36619,7 +36556,7 @@ function createMakerRemoteProxyManager(options = {}) {
36619
36556
  }
36620
36557
 
36621
36558
  // src/maker/server/mcp.ts
36622
- var VERSION = true ? "0.0.28" : "dev";
36559
+ var VERSION = true ? "0.0.29-beta.1" : "dev";
36623
36560
  var DEFAULT_BUILD_TIMEOUT_MS = 10 * 60 * 1e3;
36624
36561
  var DEFAULT_PROXY_RETRY_ATTEMPTS = 5;
36625
36562
  var DEFAULT_PROXY_RETRY_DELAY_MS = 30 * 1e3;
@@ -36723,7 +36660,11 @@ var tools = [
36723
36660
  },
36724
36661
  skip_remote_sync: {
36725
36662
  type: "boolean",
36726
- description: "If true, skip git fetch/ahead-behind remote sync checks. Use this for frequent polling or quick local status checks."
36663
+ description: "In detail mode, skip git fetch/ahead-behind remote sync and dev-kit freshness checks. Summary mode is already local-only; use this for frequent polling."
36664
+ },
36665
+ detail: {
36666
+ type: "boolean",
36667
+ description: "Set true only for explicit diagnostics. The default is a fast local summary without remote checks."
36727
36668
  }
36728
36669
  }
36729
36670
  }
@@ -37282,6 +37223,7 @@ async function startMakerMcpServer() {
37282
37223
  text: await formatStatus({
37283
37224
  targetDir: args.target_dir,
37284
37225
  skipRemoteSync: args.skip_remote_sync,
37226
+ detail: args.detail,
37285
37227
  listClientRoots,
37286
37228
  remoteProxyManager
37287
37229
  })
@@ -37331,6 +37273,7 @@ async function startMakerMcpServer() {
37331
37273
  throw error2;
37332
37274
  }
37333
37275
  const toolResult = {
37276
+ isError: !isMakerBuildActivitySuccessful(result.mode),
37334
37277
  content: [
37335
37278
  {
37336
37279
  type: "text",
@@ -37521,6 +37464,7 @@ function installMakerServerExitHandlers(remoteProxyManager) {
37521
37464
  }
37522
37465
  async function formatStatus(options = {}) {
37523
37466
  var _a3;
37467
+ const detail = options.detail === true;
37524
37468
  const projectContext = await resolveMakerProjectContext({
37525
37469
  targetDir: options.targetDir,
37526
37470
  listClientRoots: options.listClientRoots,
@@ -37532,45 +37476,85 @@ async function formatStatus(options = {}) {
37532
37476
  const mcpCwd = process.cwd();
37533
37477
  const mcpCwdIdentify = path18.resolve(mcpCwd) === path18.resolve(targetDir) ? identify : identifyMakerProject({ cwd: mcpCwd });
37534
37478
  const gitDirectoryStatus = inspectMakerDirectoryGitStatus(targetDir);
37535
- const remoteSyncText = identify.projectRoot && gitDirectoryStatus.isUsableMakerGitRepo && !options.skipRemoteSync ? await formatMakerRemoteSyncStatusSafely(identify.projectRoot) : identify.projectRoot && gitDirectoryStatus.isUsableMakerGitRepo ? formatMakerRemoteSyncSkipped() : "";
37479
+ const remoteSyncText = detail && identify.projectRoot && gitDirectoryStatus.isUsableMakerGitRepo && !options.skipRemoteSync ? await formatMakerRemoteSyncStatusSafely(identify.projectRoot) : detail && identify.projectRoot && gitDirectoryStatus.isUsableMakerGitRepo ? formatMakerRemoteSyncSkipped() : "";
37536
37480
  const pat = loadPat();
37537
- let tapAuth = loadTapAuth();
37538
- let tapAuthRefreshText = "";
37539
- if (pat && !tapAuth) {
37540
- try {
37541
- tapAuth = await requestTapAuthWithPat(pat.token, env);
37542
- tapAuthRefreshText = [
37543
- "TapTap token",
37544
- "",
37545
- `本地已有 Maker PAT,已自动获取并保存 TapTap token: ${getTapAuthPath()}`
37546
- ].join("\n");
37547
- } catch (error2) {
37548
- tapAuthRefreshText = [
37549
- "TapTap token",
37550
- "",
37551
- "本地已有 Maker PAT,但自动获取 TapTap token 失败。",
37552
- `原因:${error2 instanceof Error ? error2.message : String(error2)}`
37553
- ].join("\n");
37554
- }
37555
- }
37481
+ const tapAuth = loadTapAuth();
37556
37482
  const git = checkGitEnvironment();
37557
37483
  const python = checkMakerPythonEnvironment();
37558
37484
  const luaLsp = checkMakerLuaLspEnvironment({ pythonEnvironment: python });
37559
- const packageUpdateText = formatMakerPackageUpdateStatus(
37560
- await getMakerPackageUpdateStatus({
37561
- currentVersion: VERSION,
37562
- allowRemoteFetch: false
37563
- })
37564
- );
37565
- const projectInitializationText = identify.projectRoot ? formatMakerProjectInitializationStatus(
37566
- inspectMakerProjectInitialization(identify.projectRoot)
37567
- ) : "";
37568
- const projectHealthText = identify.projectRoot ? formatMakerProjectHealthStatus(inspectMakerProjectHealth(identify.projectRoot, "status")) : "";
37569
- const projectSection = identify.projectId ? [
37570
- "目标目录已绑定 Maker 项目。",
37571
- "请继续在当前绑定项目上执行状态、提交、构建等操作;用户明确要求切换或重新拉取项目时,再进入项目选择流程。",
37572
- "本地 Maker 工作流请参考 taptap-maker-local workflow guide document;CLI 负责初始化/PAT/app/clone,MCP 只保留状态和同步构建。"
37573
- ].join("\n") : isLikelyAiDialogueDirectory(targetDir) ? formatAiDialogueDirectoryHint(targetDir) : pat ? await formatAutoProjectListFromPat() : formatIdentifyHint();
37485
+ const packageUpdateStatus = await getMakerPackageUpdateStatus({
37486
+ currentVersion: VERSION,
37487
+ allowRemoteFetch: false,
37488
+ ...detail ? {} : { backgroundRefresh: false }
37489
+ });
37490
+ const packageUpdateText = detail ? formatMakerPackageUpdateStatus(packageUpdateStatus) : "";
37491
+ const projectInitialization = identify.projectRoot ? inspectMakerProjectInitialization(identify.projectRoot) : void 0;
37492
+ const projectHealth = identify.projectRoot ? inspectMakerProjectHealth(identify.projectRoot, "status") : void 0;
37493
+ const projectInitializationText = projectInitialization ? formatMakerProjectInitializationStatus(projectInitialization) : "";
37494
+ const projectHealthText = projectHealth ? formatMakerProjectHealthStatus(projectHealth) : "";
37495
+ let projectSection;
37496
+ if (projectContext.roots.status === "ambiguous") {
37497
+ projectSection = [
37498
+ "MCP client roots are ambiguous; do not continue Maker operations from the cwd fallback.",
37499
+ "Open a single Maker workspace or pass target_dir explicitly before status-dependent actions."
37500
+ ].join("\n");
37501
+ } else if (identify.projectId) {
37502
+ projectSection = [
37503
+ "目标目录已绑定 Maker 项目。",
37504
+ "请继续在当前绑定项目上执行状态、提交、构建等操作;用户明确要求切换或重新拉取项目时,再进入项目选择流程。",
37505
+ "本地 Maker 工作流请参考 taptap-maker-local workflow guide document;CLI 负责初始化/PAT/app/clone,MCP 只保留状态和同步构建。"
37506
+ ].join("\n");
37507
+ } else if (isLikelyAiDialogueDirectory(targetDir)) {
37508
+ projectSection = formatAiDialogueDirectoryHint(targetDir);
37509
+ } else if (detail && pat) {
37510
+ projectSection = await formatAutoProjectListFromPat();
37511
+ } else {
37512
+ projectSection = formatIdentifyHint();
37513
+ }
37514
+ const summaryText = [
37515
+ "Status summary",
37516
+ "",
37517
+ `- project: ${identify.projectId ? "bound" : "unbound"}`,
37518
+ `- target_dir: ${targetDir}`,
37519
+ `- tap_auth: ${tapAuth ? "found" : "missing"}`,
37520
+ `- pat: ${pat ? "found" : "missing"}`,
37521
+ `- git: ${gitDirectoryStatus.isUsableMakerGitRepo ? "ready" : gitDirectoryStatus.issue || "unavailable"}`,
37522
+ `- python: ${python.status}`,
37523
+ `- lua_lsp: ${luaLsp.status}`,
37524
+ "Maker MCP package update",
37525
+ `- status: ${packageUpdateStatus.status}`,
37526
+ packageUpdateStatus.target_version ? `- target_version: ${packageUpdateStatus.target_version}` : "",
37527
+ packageUpdateStatus.next_action ? `- next_action: ${packageUpdateStatus.next_action}` : "",
37528
+ projectInitialization ? `- project_initialization: ${projectInitialization.status}` : "",
37529
+ projectHealth ? `- project_health: ${projectHealth.status}` : "",
37530
+ formatMakerClientRootsSummary(projectContext.roots),
37531
+ "",
37532
+ formatAuthNextStep({
37533
+ hasPat: Boolean(pat),
37534
+ hasTapAuth: Boolean(tapAuth),
37535
+ isProjectBound: Boolean(identify.projectRoot),
37536
+ rootsAmbiguous: projectContext.roots.status === "ambiguous"
37537
+ }),
37538
+ formatMakerSummaryNextAction({
37539
+ git,
37540
+ gitDirectoryStatus,
37541
+ projectInitialization,
37542
+ projectHealth,
37543
+ rootsAmbiguous: projectContext.roots.status === "ambiguous"
37544
+ }),
37545
+ "",
37546
+ projectSection
37547
+ ].filter(Boolean).join("\n");
37548
+ if (!detail) {
37549
+ return [
37550
+ "TapTap Maker MCP status",
37551
+ "",
37552
+ `- version: ${VERSION}`,
37553
+ `- env: ${env}`,
37554
+ `- project_context_source: ${projectContext.source}`,
37555
+ summaryText
37556
+ ].join("\n");
37557
+ }
37574
37558
  return [
37575
37559
  "TapTap Maker MCP status",
37576
37560
  "",
@@ -37614,9 +37598,14 @@ async function formatStatus(options = {}) {
37614
37598
  remoteProxyManager: options.remoteProxyManager
37615
37599
  }) : "",
37616
37600
  "",
37617
- formatAuthNextStep({ hasPat: Boolean(pat), isProjectBound: Boolean(identify.projectRoot) }),
37601
+ formatAuthNextStep({
37602
+ hasPat: Boolean(pat),
37603
+ hasTapAuth: Boolean(tapAuth),
37604
+ isProjectBound: Boolean(identify.projectRoot),
37605
+ rootsAmbiguous: projectContext.roots.status === "ambiguous"
37606
+ }),
37607
+ "",
37618
37608
  "",
37619
- tapAuthRefreshText,
37620
37609
  "",
37621
37610
  identify.projectRoot ? formatMakerAgentsPolicyStatus(identify.projectRoot) : "",
37622
37611
  "",
@@ -37631,6 +37620,22 @@ async function formatStatus(options = {}) {
37631
37620
  ].filter(Boolean).join("\n");
37632
37621
  }
37633
37622
  function formatAuthNextStep(options) {
37623
+ if (!options.hasTapAuth) {
37624
+ if (options.hasPat) {
37625
+ return [
37626
+ "Auth next step",
37627
+ "",
37628
+ "TapTap auth 缺失。请运行 `taptap-maker login` 刷新登录授权。"
37629
+ ].join("\n");
37630
+ }
37631
+ if (options.isProjectBound) {
37632
+ return [
37633
+ "Auth next step",
37634
+ "",
37635
+ "Maker PAT 和 TapTap auth 缺失。请运行 `taptap-maker login` 刷新登录授权。"
37636
+ ].join("\n");
37637
+ }
37638
+ }
37634
37639
  if (options.hasPat) {
37635
37640
  return "";
37636
37641
  }
@@ -37641,6 +37646,9 @@ function formatAuthNextStep(options) {
37641
37646
  "Maker PAT 缺失。请运行 `taptap-maker login` 刷新登录授权。"
37642
37647
  ].join("\n");
37643
37648
  }
37649
+ if (options.rootsAmbiguous) {
37650
+ return "";
37651
+ }
37644
37652
  return [
37645
37653
  "Initialization next step",
37646
37654
  "",
@@ -37648,6 +37656,87 @@ function formatAuthNextStep(options) {
37648
37656
  "如果缺少 Maker PAT,CLI 会在 init 流程内自动打开登录授权页面并完成本地保存。"
37649
37657
  ].join("\n");
37650
37658
  }
37659
+ function formatMakerClientRootsSummary(roots) {
37660
+ if (roots.status === "not_requested") {
37661
+ return "";
37662
+ }
37663
+ const lines = ["MCP client roots", "", `- status: ${roots.status}`];
37664
+ if (roots.status === "selected") {
37665
+ lines.push(
37666
+ `- selected_project_root: ${roots.selectedProjectRoot || roots.selectedRoot}`,
37667
+ `- reason: ${roots.reason}`
37668
+ );
37669
+ } else if (roots.status === "ambiguous") {
37670
+ lines.push(
37671
+ `- roots: ${roots.roots.join(", ") || "(none)"}`,
37672
+ `- maker_project_roots: ${roots.makerProjectRoots.join(", ") || "(none)"}`,
37673
+ "- next_action: Open a single Maker workspace, or pass target_dir explicitly for this call."
37674
+ );
37675
+ } else if (roots.status === "unsupported") {
37676
+ lines.push("- next_action: This client did not advertise MCP roots; falling back to MCP cwd.");
37677
+ } else if (roots.status === "unavailable") {
37678
+ lines.push(
37679
+ `- failure_message: ${roots.message || "(unknown)"}`,
37680
+ "- next_action: Could not read MCP roots; falling back to MCP cwd."
37681
+ );
37682
+ } else {
37683
+ lines.push("- next_action: No MCP roots are attached; using MCP cwd.");
37684
+ }
37685
+ return lines.join("\n");
37686
+ }
37687
+ function formatMakerSummaryNextAction(options) {
37688
+ var _a3, _b, _c, _d, _e;
37689
+ if (options.rootsAmbiguous) {
37690
+ return "";
37691
+ }
37692
+ if (!options.git.installed) {
37693
+ return "- next_action: Git 未安装。请先安装 Git,并执行 `git --version` 验证。";
37694
+ }
37695
+ if (!options.gitDirectoryStatus.isUsableMakerGitRepo) {
37696
+ const nextAction = options.gitDirectoryStatus.issue === "inside_parent_git_repo" ? "当前目录位于外层 Git 仓库中;请使用独立 Maker 项目目录重新 clone。" : "当前目录没有可用的独立 Maker Git 仓库;请运行 `taptap-maker init` 重新初始化。";
37697
+ return `- next_action: ${nextAction}`;
37698
+ }
37699
+ if (((_a3 = options.projectHealth) == null ? void 0 : _a3.status) === "misplaced_config") {
37700
+ return "- next_action: 修复 Maker 项目结构或配置问题后再构建;检查器不会自动移动或覆盖文件。";
37701
+ }
37702
+ if (((_b = options.projectHealth) == null ? void 0 : _b.status) === "error" && !options.projectHealth.issues.some((issue3) => issue3.code === "invalid_project_json")) {
37703
+ const settingsIssue = options.projectHealth.issues.find(
37704
+ (issue3) => issue3.code === "invalid_settings_json" || issue3.code === "invalid_project_settings"
37705
+ );
37706
+ if (settingsIssue) {
37707
+ return "- next_action: 恢复 .project/settings.json 的构建关键字段后再构建;保留合法的 @runtime 配置。";
37708
+ }
37709
+ return "- next_action: 修复 Maker 项目结构或配置问题后再构建;检查器不会自动移动或覆盖文件。";
37710
+ }
37711
+ if (options.projectInitialization) {
37712
+ switch (options.projectInitialization.status) {
37713
+ case "missing_taptap_identity":
37714
+ return "- next_action: 先调用 `generate_test_qrcode` 一次生成测试二维码元数据,再重试 `get_ad_config`。";
37715
+ case "invalid_project_json":
37716
+ return "- next_action: 从 Git 或完整副本恢复合法的 `.project/project.json`,不要依赖构建覆盖已有坏文件。";
37717
+ case "missing_project_json":
37718
+ return "- next_action: 仅当用户明确要求构建、提交或预览时调用 `maker_build_current_directory`。";
37719
+ default:
37720
+ break;
37721
+ }
37722
+ }
37723
+ if (((_c = options.projectHealth) == null ? void 0 : _c.status) === "error") {
37724
+ const settingsIssue = options.projectHealth.issues.find(
37725
+ (issue3) => issue3.code === "invalid_settings_json" || issue3.code === "invalid_project_settings"
37726
+ );
37727
+ if (settingsIssue) {
37728
+ return "- next_action: 恢复 .project/settings.json 的构建关键字段后再构建;保留合法的 @runtime 配置。";
37729
+ }
37730
+ return "- next_action: 修复 Maker 项目结构或配置问题后再构建;检查器不会自动移动或覆盖文件。";
37731
+ }
37732
+ if (((_d = options.projectHealth) == null ? void 0 : _d.status) === "warning") {
37733
+ return "- next_action: 调用 `maker_status_lite` 并设置 `detail=true` 查看项目结构告警后再继续。";
37734
+ }
37735
+ if (((_e = options.projectHealth) == null ? void 0 : _e.status) === "not_initialized") {
37736
+ return "- next_action: 仅当用户明确要求构建、提交或预览时调用 `maker_build_current_directory`。";
37737
+ }
37738
+ return "";
37739
+ }
37651
37740
  function formatMakerRemoteSyncSkipped() {
37652
37741
  return [
37653
37742
  "Maker remote sync",
@@ -39599,6 +39688,65 @@ function formatError2(error2) {
39599
39688
  return error2 instanceof Error ? error2.message : String(error2);
39600
39689
  }
39601
39690
 
39691
+ // src/maker/auth/patTap.ts
39692
+ function getObjectValue(data, key) {
39693
+ if (!data || typeof data !== "object") {
39694
+ return void 0;
39695
+ }
39696
+ return data[key];
39697
+ }
39698
+ function normalizeTapAuthResponse(data) {
39699
+ const body = data;
39700
+ const nested = getObjectValue(body, "data");
39701
+ const source = nested && typeof nested === "object" ? nested : body;
39702
+ const kid = source.kid;
39703
+ const macKey = source.mac_key;
39704
+ if (typeof kid !== "string" || kid.length === 0 || typeof macKey !== "string" || macKey.length === 0) {
39705
+ throw new Error("TapTap token response does not contain kid/mac_key");
39706
+ }
39707
+ return {
39708
+ kid,
39709
+ mac_key: macKey,
39710
+ token_type: typeof source.token_type === "string" ? source.token_type : "mac",
39711
+ mac_algorithm: typeof source.mac_algorithm === "string" ? source.mac_algorithm : "hmac-sha-1",
39712
+ raw: data
39713
+ };
39714
+ }
39715
+ function getMakerTapTokenUrl(environment) {
39716
+ const tapTokenUrl = getMakerEndpoints(environment).tapTokenUrl;
39717
+ return requireMakerEndpoint("tapTokenUrl", tapTokenUrl, environment);
39718
+ }
39719
+ async function requestTapAuthWithPat(manualPat, environment, options = {}) {
39720
+ const pat = requireMakerPat(manualPat);
39721
+ const response = await fetchWithTimeout(
39722
+ options.fetchImpl || fetch,
39723
+ getMakerTapTokenUrl(environment),
39724
+ {
39725
+ headers: {
39726
+ Authorization: `Bearer ${pat.token}`,
39727
+ Accept: "application/json"
39728
+ }
39729
+ },
39730
+ options.timeoutMs ?? DEFAULT_SHORT_FETCH_TIMEOUT_MS,
39731
+ "TapTap token request"
39732
+ );
39733
+ const text = await response.text();
39734
+ let json2 = {};
39735
+ if (text) {
39736
+ try {
39737
+ json2 = JSON.parse(text);
39738
+ } catch {
39739
+ json2 = { error: text };
39740
+ }
39741
+ }
39742
+ if (!response.ok) {
39743
+ throw new Error(`TapTap token request failed: HTTP ${response.status} ${JSON.stringify(json2)}`);
39744
+ }
39745
+ const auth2 = normalizeTapAuthResponse(json2);
39746
+ saveTapAuth(auth2);
39747
+ return auth2;
39748
+ }
39749
+
39602
39750
  // src/maker/cli/mcpLauncher.ts
39603
39751
  import fs18 from "node:fs";
39604
39752
  import path19 from "node:path";
@@ -39752,7 +39900,7 @@ function uniqueStrings(values) {
39752
39900
  }
39753
39901
 
39754
39902
  // src/maker/cli/commands.ts
39755
- var VERSION2 = true ? "0.0.28" : "dev";
39903
+ var VERSION2 = true ? "0.0.29-beta.1" : "dev";
39756
39904
  var DEFAULT_MCP_NAME = "taptap-maker";
39757
39905
  var MAKER_NPM_PACKAGE = "@taptap/maker";
39758
39906
  var TWO_PART_COMMANDS = /* @__PURE__ */ new Set(["pat", "mcp", "dev-kit", "logs", "python", "lua-lsp", "agents"]);
@@ -40651,7 +40799,9 @@ async function runUpgrade(parsed, ctx) {
40651
40799
  env,
40652
40800
  mcp_install: installResults,
40653
40801
  agents_policy: agentsResult,
40654
- restart_required: true
40802
+ restart_required: false,
40803
+ apply_mode: "next_mcp_start",
40804
+ current_session: "preserved"
40655
40805
  };
40656
40806
  if (!payload.ok) {
40657
40807
  process.exitCode = 1;
@@ -40672,7 +40822,8 @@ async function runUpgrade(parsed, ctx) {
40672
40822
  `- previous_status: ${agentsResult.previousStatus}`
40673
40823
  ].join("\n") : "AGENTS.md managed policy skipped: current directory is not bound to a Maker project.",
40674
40824
  "",
40675
- "Restart or reconnect the AI client MCP session so the updated server and AGENTS.md are loaded.",
40825
+ "Current MCP session remains unchanged and continues using the existing version.",
40826
+ "The updated package and AGENTS.md will take effect on the next MCP start or user-requested reconnect.",
40676
40827
  ""
40677
40828
  ].join("\n")
40678
40829
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taptap/maker",
3
- "version": "0.0.28",
3
+ "version": "0.0.29-beta.1",
4
4
  "type": "module",
5
5
  "description": "TapTap Maker local development CLI and MCP server",
6
6
  "main": "dist/maker.js",
@@ -230,8 +230,9 @@ For a bound project, always inspect `maker://status` or `maker_status_lite` befo
230
230
  development after an MCP/package upgrade. If the status includes an `AGENTS.md` section with
231
231
  `status: missing_file`, `missing_block`, or `outdated`, run
232
232
  `taptap-maker agents update --target-dir <project dir>` or `taptap-maker upgrade --target-dir
233
- <project dir>` before making gameplay/code changes. After updating `AGENTS.md`, tell the user to
234
- restart/reconnect the AI client or open a new conversation so the updated instructions are loaded.
233
+ <project dir>` before making gameplay/code changes. After updating `AGENTS.md`, tell the user the
234
+ current session remains usable; updated instructions load on the next MCP start or user-requested
235
+ reconnect. Do not require a new conversation.
235
236
 
236
237
  When this file is missing and the user asks to clone, initialize, or continue Maker local
237
238
  development, do not ask the user for an app_id directly. Follow the initialization workflow.
@@ -603,12 +604,12 @@ being tied to a specific project folder.
603
604
 
604
605
  ## Remote Sync Status
605
606
 
606
- For a bound Maker project, `maker://status` and `maker_status_lite` include `Maker remote sync`.
607
- Read this section before the user starts editing in a fresh conversation:
607
+ For a bound Maker project, detailed status includes `Maker remote sync`. Read the default local summary
608
+ before routine work; use `maker_status_lite` with `detail: true` before explicit sync diagnostics:
608
609
 
609
- - For frequent polling or quick local-only status checks, call `maker_status_lite` with
610
- `skip_remote_sync: true` to avoid `git fetch origin` and AI dev kit latest-version network round
611
- trips on every status read.
610
+ - For frequent polling or quick local-only status checks, call the default `maker_status_lite`; it is
611
+ already local-only. In detail mode, pass `skip_remote_sync: true` to avoid `git fetch origin` and
612
+ AI dev kit latest-version network round trips.
612
613
  - `up_to_date`: continue development.
613
614
  - `needs_pull` with `local_changes: no`: tell the user the workspace is clean and the local AI can
614
615
  run `git pull --ff-only origin main` before editing.
@@ -24,6 +24,7 @@ This workflow upgrades only the current machine and the current Maker project di
24
24
  ## Required Steps
25
25
 
26
26
  1. Read `maker://status`; if resources are unavailable, fall back to `maker_status_lite`.
27
+ Use `maker_status_lite({ detail: true })` only when package or connection diagnostics are explicitly needed.
27
28
  If the `Maker MCP package update` section reports `required_upgrade`, explain the version reason
28
29
  to the user first.
29
30
  Do not run any upgrade command before that explanation and approval step.
@@ -47,10 +48,11 @@ If the user only wants to refresh the machine-level MCP command and no Maker pro
47
48
  confirmed, explain that this refresh will not update project `AGENTS.md`, then run
48
49
  `npx -y -p @taptap/maker taptap-maker upgrade` without `--target-dir` only after the user agrees.
49
50
 
50
- 5. Ask the user to restart/reconnect the AI client MCP session, or open a new AI conversation.
51
- Current conversations usually do not hot-load a new MCP process or re-read `AGENTS.md`.
52
- 6. After restart/reconnect, verify by reading `maker://status`; if resources are unavailable, call
53
- `maker_status_lite`.
51
+ 5. Tell the user that the current MCP session remains available and continues using the existing
52
+ version and proxy tools. The updated package and `AGENTS.md` take effect on the next MCP start or
53
+ user-requested reconnect; do not require a new conversation.
54
+ 6. After the next restart/reconnect, verify by reading `maker://status`; if resources are unavailable,
55
+ call `maker_status_lite`.
54
56
 
55
57
  ## Status-Driven Upgrade Notes
56
58
 
@@ -61,8 +63,8 @@ confirmed, explain that this refresh will not update project `AGENTS.md`, then r
61
63
  `minimum_supported`, `blacklist`, and `message`.
62
64
  - `required_upgrade` means the local AI must explain the reason, ask the user for approval, and only
63
65
  then run the appropriate upgrade command.
64
- - After any upgrade, restart or reconnect the MCP session before trusting the new status, then
65
- verify with `maker://status` or `maker_status_lite`.
66
+ - After any upgrade, the current session remains usable. Restart or reconnect only when the user wants
67
+ the new package loaded, then verify with `maker://status` or `maker_status_lite`.
66
68
 
67
69
  ## Expected Effects
68
70
 
@@ -103,8 +105,8 @@ When a user upgrades MCP and later opens an old Maker project:
103
105
  npx -y -p @taptap/maker taptap-maker agents update --target-dir <PROJECT_DIR>
104
106
  ```
105
107
 
106
- 3. Tell the user to restart/reconnect the AI client or open a new conversation so the updated
107
- `AGENTS.md` instructions are loaded.
108
+ 3. Tell the user the current session remains usable. The updated `AGENTS.md` instructions load on the
109
+ next MCP start or user-requested reconnect; do not require a new conversation.
108
110
 
109
111
  Status reads are intentionally read-only. Do not modify `AGENTS.md` from `maker://status` or
110
112
  `maker_status_lite`; use the CLI update command.