ai-project-manage-cli 8.1.2 → 8.1.4

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/dist/index.js CHANGED
@@ -1044,7 +1044,7 @@ function validateWebIdeMessagePush(o) {
1044
1044
  return { ok: false, reason: "webide-message \u7F3A\u5C11 user" };
1045
1045
  }
1046
1046
  const useNewAgent = o.useNewAgent === true;
1047
- const tools = Array.isArray(o.tools) ? o.tools.filter((t) => typeof t === "string" && t.trim().length > 0).map((t) => t.trim()) : void 0;
1047
+ const tools = Array.isArray(o.tools) ? o.tools.filter((t) => typeof t === "string" && t.trim().length > 0).map((t) => t.trim()) : [];
1048
1048
  return {
1049
1049
  ok: true,
1050
1050
  data: {
@@ -1058,7 +1058,7 @@ function validateWebIdeMessagePush(o) {
1058
1058
  workdir: o.workdir.trim(),
1059
1059
  user: o.user.trim(),
1060
1060
  ...useNewAgent ? { useNewAgent: true } : {},
1061
- ...tools && tools.length > 0 ? { tools } : {}
1061
+ tools
1062
1062
  }
1063
1063
  };
1064
1064
  }
@@ -2251,7 +2251,7 @@ var WORKSPACE_BOUNDARY_HINT = `[\u5DE5\u4F5C\u533A\u8FB9\u754C]
2251
2251
  \u6240\u6709\u6587\u4EF6\u8BFB\u5199\u3001\u641C\u7D22\uFF08Grep/Glob/Read\uFF09\u3001Shell \u5FC5\u987B\u4E25\u683C\u9650\u5236\u5728\u5F53\u524D\u5DE5\u4F5C\u533A cwd \u5185\u3002
2252
2252
  \u7981\u6B62\u8BBF\u95EE\u5DE5\u4F5C\u533A\u5916\u8DEF\u5F84\uFF08\u5982\u5176\u5B83\u9879\u76EE\u3001~/.cursor\u3001agent-transcripts\u3001\u7CFB\u7EDF\u76EE\u5F55\u7B49\uFF09\u3002`;
2253
2253
  function wantsTool(name, options, legacyDefault) {
2254
- if (options.toolNames) {
2254
+ if (options.toolNames !== void 0) {
2255
2255
  return options.toolNames.includes(name);
2256
2256
  }
2257
2257
  return legacyDefault;
@@ -4386,15 +4386,12 @@ var WEBIDE_CODE_CHANGE_ACTIONS = /* @__PURE__ */ new Set([
4386
4386
  function shouldCommitAfterWebIdeMessage(action) {
4387
4387
  return WEBIDE_CODE_CHANGE_ACTIONS.has(action);
4388
4388
  }
4389
- function isStartLocalServicesAction(_action) {
4390
- return false;
4389
+ function isStartLocalServicesAction(action) {
4390
+ return action === "enter-manual-test" || action === "skip-test" || action === "request-start-project";
4391
4391
  }
4392
4392
  function isDesignAction(action) {
4393
4393
  return action === "request-design" || action === "request-revise-design";
4394
4394
  }
4395
- function isExecuteSqlAction(action) {
4396
- return action === "request-execute-sql";
4397
- }
4398
4395
  function syncLocalTaskStatus(workdir, taskId, msg2, status) {
4399
4396
  syncWebIdeTaskState(workdir, taskId, {
4400
4397
  messageId: msg2.messageId,
@@ -4638,8 +4635,8 @@ async function handleWebIdeInboundMessage(cfg2, msg2, signal) {
4638
4635
  await syncPrepLog();
4639
4636
  const startLocalServices = isStartLocalServicesAction(msg2.action);
4640
4637
  const designAction = isDesignAction(msg2.action);
4641
- const executeSql = isExecuteSqlAction(msg2.action);
4642
4638
  const useNewAgent = msg2.useNewAgent === true;
4639
+ const toolNames = Array.isArray(msg2.tools) ? msg2.tools.map((t) => String(t).trim()).filter(Boolean) : [];
4643
4640
  if (useNewAgent && !startLocalServices) {
4644
4641
  if (designAction) {
4645
4642
  clearWebIdeDesignAgentId(workdir, taskId);
@@ -4648,8 +4645,8 @@ async function handleWebIdeInboundMessage(cfg2, msg2, signal) {
4648
4645
  }
4649
4646
  }
4650
4647
  const savedAgentId = startLocalServices || useNewAgent ? void 0 : designAction ? loadWebIdeDesignAgentId(workdir, taskId) : loadWebIdeAgentId(workdir, taskId);
4651
- const promptPayload = executeSql ? parseWebIdePromptPayload(msg2.content) : null;
4652
- const sqlExecutionId = executeSql && typeof promptPayload?.executionId === "string" ? promptPayload.executionId.trim() : void 0;
4648
+ const promptPayload = toolNames.includes("MysqlExecute") ? parseWebIdePromptPayload(msg2.content) : null;
4649
+ const sqlExecutionId = toolNames.includes("MysqlExecute") && typeof promptPayload?.executionId === "string" ? promptPayload.executionId.trim() : void 0;
4653
4650
  const persistAgentId = (agentId) => {
4654
4651
  if (startLocalServices) return;
4655
4652
  if (designAction) {
@@ -4677,19 +4674,21 @@ ${assumptionAnswersText}` : msg2.content,
4677
4674
  forceSend: true,
4678
4675
  eventSession,
4679
4676
  appendMessageContent: (content) => appendContent(cfg2, messageId, content),
4680
- askQuestionExecute: startLocalServices ? void 0 : createWebIdeAskQuestionExecute({
4677
+ askQuestionExecute: !startLocalServices && toolNames.includes("AskQuestion") ? createWebIdeAskQuestionExecute({
4681
4678
  cfg: cfg2,
4682
4679
  taskId,
4683
4680
  onAwaitingAssumptions: () => {
4684
4681
  pausedForAssumptions = true;
4685
4682
  }
4686
- }),
4687
- enableAskQuestion: !startLocalServices && !executeSql,
4688
- enableWebIdePlanTools: !startLocalServices && !executeSql && !designAction,
4689
- enablePtySessionMcp: startLocalServices,
4690
- enableMysqlTools: executeSql,
4683
+ }) : void 0,
4684
+ // 工具名单完全以服务端模板配置为准,不再按 action 硬编码开关
4685
+ enableAppendMessage: false,
4686
+ enableAskQuestion: false,
4687
+ enableWebIdePlanTools: false,
4688
+ enableMysqlTools: false,
4689
+ enablePtySessionMcp: startLocalServices || toolNames.includes("PtySession"),
4691
4690
  sqlExecutionId,
4692
- toolNames: Array.isArray(msg2.tools) && msg2.tools.length > 0 ? msg2.tools : void 0,
4691
+ toolNames,
4693
4692
  enableSandbox: false,
4694
4693
  onInvalidatePersistedAgentId: startLocalServices ? void 0 : () => {
4695
4694
  if (designAction) {
@@ -4748,7 +4747,7 @@ ${assumptionAnswersText}` : msg2.content,
4748
4747
  detail,
4749
4748
  tokenUsage
4750
4749
  );
4751
- if (executeSql && sqlExecutionId) {
4750
+ if (sqlExecutionId) {
4752
4751
  try {
4753
4752
  await api.cli.webideFinalizeSqlExecution({
4754
4753
  executionId: sqlExecutionId,
@@ -4773,7 +4772,7 @@ ${assumptionAnswersText}` : msg2.content,
4773
4772
  "\u5DF2\u53D6\u6D88",
4774
4773
  tokenUsage
4775
4774
  );
4776
- if (executeSql && sqlExecutionId) {
4775
+ if (sqlExecutionId) {
4777
4776
  try {
4778
4777
  await api.cli.webideFinalizeSqlExecution({
4779
4778
  executionId: sqlExecutionId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-project-manage-cli",
3
- "version": "8.1.2",
3
+ "version": "8.1.4",
4
4
  "description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
5
5
  "type": "module",
6
6
  "private": false,