ai-project-manage-cli 7.1.19 → 7.1.20

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.
@@ -3119,17 +3119,21 @@ async function ensureWebIdePullRequests(cfg, taskId, workdir) {
3119
3119
  "[apm] WebIDE PR\uFF1A\u8BFB\u53D6\u4ED3\u5E93\u6E05\u5355\u5931\u8D25:",
3120
3120
  err instanceof Error ? err.message : err
3121
3121
  );
3122
- return;
3122
+ return { ensured: 0, skipped: 0, failed: 1 };
3123
3123
  }
3124
3124
  console.log(
3125
3125
  `[apm] WebIDE PR\uFF1A\u51C6\u5907\u4E3A ${repoRoots.length} \u4E2A\u4ED3\u5E93\u521B\u5EFA feat/task-${taskId}`
3126
3126
  );
3127
+ let ensured = 0;
3128
+ let skipped = 0;
3129
+ let failed = 0;
3127
3130
  for (const gitRoot of repoRoots) {
3128
3131
  const label = formatRepoLabel(workdir, gitRoot);
3129
3132
  try {
3130
3133
  const originUrl = await tryReadGitOriginUrl(gitRoot);
3131
3134
  if (!originUrl) {
3132
3135
  console.warn(`[apm] WebIDE PR\uFF1A\u8DF3\u8FC7 ${label}\uFF08\u65E0 remote.origin.url\uFF09`);
3136
+ skipped += 1;
3133
3137
  continue;
3134
3138
  }
3135
3139
  const matched = await api.cli.matchRepository({ url: originUrl });
@@ -3138,22 +3142,26 @@ async function ensureWebIdePullRequests(cfg, taskId, workdir) {
3138
3142
  console.warn(
3139
3143
  `[apm] WebIDE PR\uFF1A\u8DF3\u8FC7 ${label}\uFF08\u5E73\u53F0\u672A\u767B\u8BB0\u4ED3\u5E93 ${originUrl}\uFF09`
3140
3144
  );
3145
+ skipped += 1;
3141
3146
  continue;
3142
3147
  }
3143
3148
  const pr = await api.cli.createWebIdeDraftPullRequest({
3144
3149
  taskId,
3145
3150
  repositoryId
3146
3151
  });
3152
+ ensured += 1;
3147
3153
  console.log(
3148
3154
  `[apm] WebIDE PR\uFF1A${label} \u2192 #${pr.number} ${pr.state} ${pr.url || ""}`
3149
3155
  );
3150
3156
  } catch (err) {
3157
+ failed += 1;
3151
3158
  console.warn(
3152
3159
  `[apm] WebIDE PR\uFF1A${label} \u5931\u8D25:`,
3153
3160
  err instanceof Error ? err.message : err
3154
3161
  );
3155
3162
  }
3156
3163
  }
3164
+ return { ensured, skipped, failed };
3157
3165
  }
3158
3166
 
3159
3167
  // src/version.ts
@@ -3678,7 +3686,11 @@ async function handleWebIdeInboundMessage(cfg, msg, signal, options) {
3678
3686
  `[apm] webide create-pr \u524D push action=${msg.action} repos=${pushed}`
3679
3687
  );
3680
3688
  }
3681
- await ensureWebIdePullRequests(cfg, taskId, workdir);
3689
+ const prResult = await ensureWebIdePullRequests(cfg, taskId, workdir);
3690
+ if (prResult.ensured === 0) {
3691
+ const detail = prResult.failed > 0 ? `\u521B\u5EFA PR \u5931\u8D25\uFF08${prResult.failed} \u4E2A\u4ED3\u5E93\u51FA\u9519\uFF09` : "\u672A\u80FD\u521B\u5EFA PR\uFF1A\u672A\u5339\u914D\u5230\u53EF\u767B\u8BB0\u7684\u4ED3\u5E93\uFF0C\u8BF7\u68C0\u67E5\u5DE5\u4F5C\u533A git remote \u4E0E\u5E73\u53F0\u4ED3\u5E93\u767B\u8BB0";
3692
+ throw new Error(detail);
3693
+ }
3682
3694
  }
3683
3695
  if (projectId) {
3684
3696
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-project-manage-cli",
3
- "version": "7.1.19",
3
+ "version": "7.1.20",
4
4
  "description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
5
5
  "type": "module",
6
6
  "private": false,