@taptap/maker 0.0.6 → 0.0.7

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
@@ -26,4 +26,4 @@ This package contains only the Maker CLI/MCP bundle and Maker workflow skills.
26
26
  It does not include the legacy TapTap Open API MCP server, proxy, native signer,
27
27
  or OpenClaw plugin package contents.
28
28
 
29
- Version: 0.0.6
29
+ Version: 0.0.7
package/dist/maker.js CHANGED
@@ -29436,7 +29436,7 @@ async function cloneMakerProject(options) {
29436
29436
  });
29437
29437
  await setOrigin(target, authUrl);
29438
29438
  try {
29439
- transientRetries += await runGitWithTransientRetry(["fetch", "origin"], {
29439
+ transientRetries += await runGitWithTransientRetry(["fetch", "--progress", "origin"], {
29440
29440
  cwd: target,
29441
29441
  onProgress: options.onProgress
29442
29442
  });
@@ -29452,7 +29452,7 @@ async function cloneMakerProject(options) {
29452
29452
  authUrl = makeAuthenticatedGitUrl(gitUrl, pat.token);
29453
29453
  retriedWithNewPat = true;
29454
29454
  await setOrigin(target, authUrl);
29455
- transientRetries += await runGitWithTransientRetry(["fetch", "origin"], {
29455
+ transientRetries += await runGitWithTransientRetry(["fetch", "--progress", "origin"], {
29456
29456
  cwd: target,
29457
29457
  onProgress: options.onProgress
29458
29458
  }).catch((retryError) => {
@@ -30123,7 +30123,7 @@ async function cloneOrInitializeTarget(target, authUrl, pat, onProgress) {
30123
30123
  onProgress
30124
30124
  });
30125
30125
  await setOrigin(target, authUrl);
30126
- transientRetries += await runGitWithTransientRetry(["fetch", "origin"], {
30126
+ transientRetries += await runGitWithTransientRetry(["fetch", "--progress", "origin"], {
30127
30127
  cwd: target,
30128
30128
  onProgress
30129
30129
  });
@@ -30144,7 +30144,7 @@ async function cloneOrInitializeTarget(target, authUrl, pat, onProgress) {
30144
30144
  return transientRetries;
30145
30145
  }
30146
30146
  emitFirstCloneWaitNotice(onProgress, "clone");
30147
- return runGitCaptureWithTransientRetry(["clone", authUrl, target], {
30147
+ return runGitCaptureWithTransientRetry(["clone", "--progress", authUrl, target], {
30148
30148
  sanitize: pat,
30149
30149
  onProgress
30150
30150
  });
@@ -30843,6 +30843,7 @@ function getBundledSkillSourceDir(skillName) {
30843
30843
  import fs6 from "node:fs";
30844
30844
  import path7 from "node:path";
30845
30845
  var DEFAULT_RUNTIME_LOG_SINCE_SECONDS = 600;
30846
+ var DEFAULT_RUNTIME_LOG_IDLE_TIMEOUT_MS = 10 * 60 * 1e3;
30846
30847
  var MAX_RUNTIME_LOG_WINDOW_SECONDS = 3600;
30847
30848
  var DEFAULT_RUNTIME_LOG_TOPICS = ["user_script", "server_user_script"];
30848
30849
  var MERGED_RUNTIME_LOG_FILE = "runtime.log";
@@ -30861,6 +30862,7 @@ async function watchRuntimeLogs(options) {
30861
30862
  resetRuntimeLogs(options.projectRoot);
30862
30863
  }
30863
30864
  const intervalMs = options.intervalMs ?? 5e3;
30865
+ const idleTimeoutMs = options.idleTimeoutMs ?? DEFAULT_RUNTIME_LOG_IDLE_TIMEOUT_MS;
30864
30866
  const maxConsecutiveFailures = options.maxConsecutiveFailures;
30865
30867
  const sleep2 = options.sleep || defaultSleep;
30866
30868
  const nowMs = options.nowMs || Date.now;
@@ -30868,6 +30870,7 @@ async function watchRuntimeLogs(options) {
30868
30870
  let writtenLogs = 0;
30869
30871
  let lastResult;
30870
30872
  let consecutiveFailures = 0;
30873
+ let idleStartedAt = nowMs();
30871
30874
  for (; ; ) {
30872
30875
  try {
30873
30876
  const previousCursor = lastResult == null ? void 0 : lastResult.nextStartTime;
@@ -30884,8 +30887,25 @@ async function watchRuntimeLogs(options) {
30884
30887
  lastResult = result;
30885
30888
  consecutiveFailures = 0;
30886
30889
  await ((_a3 = options.onPoll) == null ? void 0 : _a3.call(options, result));
30890
+ if (result.writtenLogs > 0) {
30891
+ idleStartedAt = nowMs();
30892
+ } else if (nowMs() - idleStartedAt >= idleTimeoutMs) {
30893
+ return {
30894
+ projectRoot: options.projectRoot,
30895
+ polls,
30896
+ writtenLogs,
30897
+ lastResult,
30898
+ stopReason: "idle_timeout"
30899
+ };
30900
+ }
30887
30901
  if (options.maxPolls !== void 0 && polls >= options.maxPolls) {
30888
- return { projectRoot: options.projectRoot, polls, writtenLogs, lastResult };
30902
+ return {
30903
+ projectRoot: options.projectRoot,
30904
+ polls,
30905
+ writtenLogs,
30906
+ lastResult,
30907
+ stopReason: "max_polls"
30908
+ };
30889
30909
  }
30890
30910
  const cursorProgressed = previousCursor === void 0 ? result.writtenLogs > 0 : result.nextStartTime !== previousCursor;
30891
30911
  if (!result.hasMore || !cursorProgressed) {
@@ -30980,23 +31000,6 @@ function readRuntimeLogState(projectRoot) {
30980
31000
  return null;
30981
31001
  }
30982
31002
  }
30983
- function formatRuntimeLogPullResult(result) {
30984
- return [
30985
- "✓ Maker runtime logs pulled once",
30986
- "",
30987
- `- project_root: ${result.projectRoot}`,
30988
- `- query_args: ${JSON.stringify(result.queryArgs)}`,
30989
- `- written_logs: ${result.writtenLogs}`,
30990
- `- files: ${result.files.length > 0 ? result.files.join(", ") : "(none)"}`,
30991
- `- state: ${result.statePath}`,
30992
- `- next_start_time: ${result.nextStartTime}`,
30993
- `- server_time: ${result.serverTime}`,
30994
- `- has_more: ${result.hasMore ? "yes" : "no"}`,
30995
- result.cursorExpired ? "- cursor_expired: yes; old cursor exceeded 1 hour, used default since window" : "- cursor_expired: no",
30996
- "",
30997
- result.hasMore ? "next_action: 还有更多远端日志;可以再次调用 maker_pull_runtime_logs 继续拉取。" : "next_action: 日志已写入 .maker/logs/runtime/runtime.log,AI/skill 可直接读取这一份合并日志。"
30998
- ].join("\n");
30999
- }
31000
31003
  function normalizeRuntimeLogQueryResult(result) {
31001
31004
  const payload = findRuntimeLogPayload(extractRemoteToolPayload(result));
31002
31005
  if (!payload) {
@@ -31213,7 +31216,7 @@ function compactRuntimeLogEntry(entry) {
31213
31216
  }
31214
31217
 
31215
31218
  // src/maker/server/mcp.ts
31216
- var VERSION = true ? "0.0.6" : "dev";
31219
+ var VERSION = true ? "0.0.7" : "dev";
31217
31220
  var DEFAULT_BUILD_TIMEOUT_MS = 10 * 60 * 1e3;
31218
31221
  var PREVIEW_REFRESH_TIMEOUT_MS = 15 * 1e3;
31219
31222
  var WATCHER_STOP_TIMEOUT_MS = 1500;
@@ -31304,44 +31307,6 @@ var tools = [
31304
31307
  }
31305
31308
  }
31306
31309
  }
31307
- },
31308
- {
31309
- name: "maker_pull_runtime_logs",
31310
- description: "Pull Maker Lua runtime logs once from the remote Maker MCP query_runtime_logs tool and write user_script/server_user_script logs to .maker/logs/runtime/runtime.log. This is a one-shot fixed business flow for AI diagnostics; it does not start a watcher, does not keep a long-running MCP call open, and does not clear local logs.",
31311
- inputSchema: {
31312
- type: "object",
31313
- properties: {
31314
- target_dir: {
31315
- type: "string",
31316
- description: "Optional Maker project directory. Defaults to the MCP process cwd. Pass the user current working directory when it differs from the MCP process cwd."
31317
- },
31318
- start_time: {
31319
- type: "number",
31320
- description: "Optional Unix seconds cursor. If omitted, the tool uses a fresh local state cursor, otherwise defaults to since_seconds."
31321
- },
31322
- since_seconds: {
31323
- type: "number",
31324
- description: "Optional fallback lookback window in seconds when no fresh cursor exists. Defaults to 600 seconds and is capped by the remote server."
31325
- },
31326
- limit: {
31327
- type: "number",
31328
- description: "Optional maximum log entries returned by the remote query."
31329
- },
31330
- server_url: {
31331
- type: "string",
31332
- description: "Optional remote MCP server URL override. Defaults to the Maker endpoint table for TAPTAP_MCP_ENV."
31333
- },
31334
- env: {
31335
- type: "string",
31336
- enum: ["rnd", "production"],
31337
- description: "Remote MCP environment. Defaults to TAPTAP_MCP_ENV."
31338
- },
31339
- timeout_ms: {
31340
- type: "number",
31341
- description: "Optional remote log query timeout in milliseconds. Defaults to 60 seconds."
31342
- }
31343
- }
31344
- }
31345
31310
  }
31346
31311
  ];
31347
31312
  var resources = [
@@ -31439,30 +31404,6 @@ async function startMakerMcpServer() {
31439
31404
  ]
31440
31405
  };
31441
31406
  }
31442
- if (name === "maker_pull_runtime_logs") {
31443
- const args = request.params.arguments || {};
31444
- const proxy = createRemoteProxyContext({
31445
- targetDir: resolveMakerToolTargetDir(args.target_dir),
31446
- serverUrl: args.server_url,
31447
- env: args.env
31448
- });
31449
- const result = await pullRuntimeLogs({
31450
- projectRoot: proxy.projectRoot,
31451
- projectId: proxy.projectId,
31452
- startTime: args.start_time,
31453
- sinceSeconds: args.since_seconds,
31454
- limit: args.limit,
31455
- callRemoteRuntimeLogs: (queryArgs) => callRemoteRuntimeLogs(proxy, queryArgs, args.timeout_ms)
31456
- });
31457
- return {
31458
- content: [
31459
- {
31460
- type: "text",
31461
- text: formatRuntimeLogPullResult(result)
31462
- }
31463
- ]
31464
- };
31465
- }
31466
31407
  throw new McpError(ErrorCode.MethodNotFound, `Unknown Maker tool: ${name}`);
31467
31408
  } catch (error2) {
31468
31409
  return {
@@ -32379,14 +32320,6 @@ async function refreshMakerPreview(buildResult) {
32379
32320
  clearTimeout(timeout);
32380
32321
  }
32381
32322
  }
32382
- async function callRemoteRuntimeLogs(proxy, args, timeoutMs = 60 * 1e3) {
32383
- const runtimeLogClient = createRemoteRuntimeLogClient(proxy, timeoutMs);
32384
- try {
32385
- return await runtimeLogClient.call(args);
32386
- } finally {
32387
- await runtimeLogClient.close();
32388
- }
32389
- }
32390
32323
  function createRemoteRuntimeLogClient(proxy, timeoutMs = 60 * 1e3, options = {}) {
32391
32324
  let client;
32392
32325
  const createTransport = options.createTransport || (() => new HiddenStdioClientTransport({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taptap/maker",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "description": "TapTap Maker local development CLI and MCP server",
6
6
  "main": "dist/maker.js",
@@ -34,9 +34,8 @@ Keep this split clear:
34
34
 
35
35
  - Skill: user intent, step order, whether to ask the user, friendly explanations, failure recovery.
36
36
  - CLI: save PAT, fetch app list, clone, prepare dev kit, install MCP config, verify local setup,
37
- and run the local runtime log watcher.
38
- - MCP tools/resources: inspect Maker status, run the combined commit/push/build path, and support
39
- one-shot runtime log pulls.
37
+ and run the local runtime log watcher, including runtime log polling.
38
+ - MCP tools/resources: inspect Maker status and run the combined commit/push/build path.
40
39
 
41
40
  Do not reimplement Maker API calls or Git authentication in shell when the Maker CLI or MCP tool
42
41
  exists.