ai-project-manage-cli 8.1.0 → 8.1.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/dist/index.js +3 -1
- package/dist/worker-script.js +37 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1043,6 +1043,7 @@ function validateWebIdeMessagePush(o) {
|
|
|
1043
1043
|
if (!nonEmptyString(o.user)) {
|
|
1044
1044
|
return { ok: false, reason: "webide-message \u7F3A\u5C11 user" };
|
|
1045
1045
|
}
|
|
1046
|
+
const useNewAgent = o.useNewAgent === true;
|
|
1046
1047
|
return {
|
|
1047
1048
|
ok: true,
|
|
1048
1049
|
data: {
|
|
@@ -1054,7 +1055,8 @@ function validateWebIdeMessagePush(o) {
|
|
|
1054
1055
|
model: o.model.trim(),
|
|
1055
1056
|
apiKey: o.apiKey.trim(),
|
|
1056
1057
|
workdir: o.workdir.trim(),
|
|
1057
|
-
user: o.user.trim()
|
|
1058
|
+
user: o.user.trim(),
|
|
1059
|
+
...useNewAgent ? { useNewAgent: true } : {}
|
|
1058
1060
|
}
|
|
1059
1061
|
};
|
|
1060
1062
|
}
|
package/dist/worker-script.js
CHANGED
|
@@ -3902,10 +3902,12 @@ function markBranchDone(taskId, workdir) {
|
|
|
3902
3902
|
}
|
|
3903
3903
|
|
|
3904
3904
|
// src/commands/connect/webide-pull-requests.ts
|
|
3905
|
-
var
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3905
|
+
var POST_AGENT_PR_ACTIONS = /* @__PURE__ */ new Set([
|
|
3906
|
+
"request-organize-code",
|
|
3907
|
+
"request-patch"
|
|
3908
|
+
]);
|
|
3909
|
+
function shouldEnsureWebIdePullRequests(_action) {
|
|
3910
|
+
return false;
|
|
3909
3911
|
}
|
|
3910
3912
|
function shouldEnsureWebIdePullRequestsAfterAgent(action) {
|
|
3911
3913
|
return POST_AGENT_PR_ACTIONS.has(action);
|
|
@@ -4396,10 +4398,6 @@ async function handleWebIdeInboundMessage(cfg2, msg2, signal) {
|
|
|
4396
4398
|
);
|
|
4397
4399
|
await updateStatus2(cfg2, messageId, "TYPING");
|
|
4398
4400
|
syncLocalTaskStatus(workdir, taskId, msg2, "TYPING");
|
|
4399
|
-
const startAction = startActionForInbound(msg2.action);
|
|
4400
|
-
if (startAction) {
|
|
4401
|
-
await webIdeRunAction(cfg2, taskId, startAction);
|
|
4402
|
-
}
|
|
4403
4401
|
const eventSession = new EventSession(msg2.content);
|
|
4404
4402
|
const prepAgentId = loadWebIdeAgentId(workdir, taskId) ?? "webide-cli-prep";
|
|
4405
4403
|
const logSyncRef = {
|
|
@@ -4435,7 +4433,12 @@ async function handleWebIdeInboundMessage(cfg2, msg2, signal) {
|
|
|
4435
4433
|
throw err;
|
|
4436
4434
|
}
|
|
4437
4435
|
};
|
|
4436
|
+
let pausedForAssumptions = false;
|
|
4438
4437
|
try {
|
|
4438
|
+
const startAction = startActionForInbound(msg2.action);
|
|
4439
|
+
if (startAction) {
|
|
4440
|
+
await webIdeRunAction(cfg2, taskId, startAction);
|
|
4441
|
+
}
|
|
4439
4442
|
if (signal.aborted) throw new Error("\u4EFB\u52A1\u5DF2\u53D6\u6D88");
|
|
4440
4443
|
let assumptionAnswersText;
|
|
4441
4444
|
if (msg2.action === "confirm-assumptions") {
|
|
@@ -4443,7 +4446,6 @@ async function handleWebIdeInboundMessage(cfg2, msg2, signal) {
|
|
|
4443
4446
|
{ cfg: cfg2, taskId }
|
|
4444
4447
|
);
|
|
4445
4448
|
}
|
|
4446
|
-
let pausedForAssumptions = false;
|
|
4447
4449
|
await runPrepStep(
|
|
4448
4450
|
"\u521D\u59CB\u5316\u5DE5\u4F5C\u533A",
|
|
4449
4451
|
async () => {
|
|
@@ -4505,7 +4507,7 @@ async function handleWebIdeInboundMessage(cfg2, msg2, signal) {
|
|
|
4505
4507
|
if (shouldEnsureWebIdePullRequests(msg2.action)) {
|
|
4506
4508
|
if (signal.aborted) throw new Error("\u4EFB\u52A1\u5DF2\u53D6\u6D88");
|
|
4507
4509
|
await runPrepStep(
|
|
4508
|
-
"\
|
|
4510
|
+
"\u9A8C\u6536\u524D\u63A8\u9001",
|
|
4509
4511
|
async () => pushWorkspaceRepos(workdir),
|
|
4510
4512
|
(pushed) => `\u5DF2 push ${pushed} \u4E2A\u4ED3\u5E93`
|
|
4511
4513
|
);
|
|
@@ -4611,7 +4613,15 @@ async function handleWebIdeInboundMessage(cfg2, msg2, signal) {
|
|
|
4611
4613
|
const startLocalServices = isStartLocalServicesAction(msg2.action);
|
|
4612
4614
|
const designAction = isDesignAction(msg2.action);
|
|
4613
4615
|
const executeSql = isExecuteSqlAction(msg2.action);
|
|
4614
|
-
const
|
|
4616
|
+
const useNewAgent = msg2.useNewAgent === true;
|
|
4617
|
+
if (useNewAgent && !startLocalServices) {
|
|
4618
|
+
if (designAction) {
|
|
4619
|
+
clearWebIdeDesignAgentId(workdir, taskId);
|
|
4620
|
+
} else {
|
|
4621
|
+
clearWebIdeAgentId(workdir, taskId);
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4624
|
+
const savedAgentId = startLocalServices || useNewAgent ? void 0 : designAction ? loadWebIdeDesignAgentId(workdir, taskId) : loadWebIdeAgentId(workdir, taskId);
|
|
4615
4625
|
const promptPayload = executeSql ? parseWebIdePromptPayload(msg2.content) : null;
|
|
4616
4626
|
const sqlExecutionId = executeSql && typeof promptPayload?.executionId === "string" ? promptPayload.executionId.trim() : void 0;
|
|
4617
4627
|
const persistAgentId = (agentId) => {
|
|
@@ -4911,6 +4921,22 @@ ${assumptionAnswersText}` : msg2.content,
|
|
|
4911
4921
|
statusErr instanceof Error ? statusErr.message : statusErr
|
|
4912
4922
|
);
|
|
4913
4923
|
}
|
|
4924
|
+
const completeAction = completeActionForInbound(msg2.action);
|
|
4925
|
+
if (completeAction && !pausedForAssumptions) {
|
|
4926
|
+
try {
|
|
4927
|
+
await webIdeRunAction(
|
|
4928
|
+
cfg2,
|
|
4929
|
+
taskId,
|
|
4930
|
+
completeAction,
|
|
4931
|
+
completeAction === "complete-assessment" ? { force: true } : void 0
|
|
4932
|
+
);
|
|
4933
|
+
} catch (completeErr) {
|
|
4934
|
+
console.warn(
|
|
4935
|
+
`[apm] \u5931\u8D25\u540E\u56DE\u5199 complete \u8DF3\u8FC7 action=${completeAction}:`,
|
|
4936
|
+
completeErr instanceof Error ? completeErr.message : completeErr
|
|
4937
|
+
);
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4914
4940
|
syncLocalTaskStatus(workdir, taskId, msg2, "FAILED");
|
|
4915
4941
|
}
|
|
4916
4942
|
}
|