ai-project-manage-cli 8.1.2 → 8.1.3
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 +2 -2
- package/dist/worker-script.js +14 -15
- package/package.json +1 -1
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()) :
|
|
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
|
-
|
|
1061
|
+
tools
|
|
1062
1062
|
}
|
|
1063
1063
|
};
|
|
1064
1064
|
}
|
package/dist/worker-script.js
CHANGED
|
@@ -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;
|
|
@@ -4392,9 +4392,6 @@ function isStartLocalServicesAction(_action) {
|
|
|
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 =
|
|
4652
|
-
const sqlExecutionId =
|
|
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
|
|
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
|
-
|
|
4688
|
-
|
|
4683
|
+
}) : void 0,
|
|
4684
|
+
// 工具名单完全以服务端模板配置为准,不再按 action 硬编码开关
|
|
4685
|
+
enableAppendMessage: false,
|
|
4686
|
+
enableAskQuestion: false,
|
|
4687
|
+
enableWebIdePlanTools: false,
|
|
4688
|
+
enableMysqlTools: false,
|
|
4689
4689
|
enablePtySessionMcp: startLocalServices,
|
|
4690
|
-
enableMysqlTools: executeSql,
|
|
4691
4690
|
sqlExecutionId,
|
|
4692
|
-
toolNames
|
|
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 (
|
|
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 (
|
|
4775
|
+
if (sqlExecutionId) {
|
|
4777
4776
|
try {
|
|
4778
4777
|
await api.cli.webideFinalizeSqlExecution({
|
|
4779
4778
|
executionId: sqlExecutionId,
|