ai-project-manage-cli 4.0.17 → 4.0.18
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 +12 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -155,6 +155,10 @@ var requestConfig = {
|
|
|
155
155
|
})
|
|
156
156
|
},
|
|
157
157
|
theater: {
|
|
158
|
+
reportMemberAgentProgress: defineEndpoint({
|
|
159
|
+
method: "POST",
|
|
160
|
+
path: "/theater/sessions/report-member-agent-progress"
|
|
161
|
+
}),
|
|
158
162
|
submitMemberResponse: defineEndpoint({
|
|
159
163
|
method: "POST",
|
|
160
164
|
path: "/theater/sessions/submit-member-response"
|
|
@@ -845,6 +849,12 @@ async function handleTheaterJob(api, payload) {
|
|
|
845
849
|
throw new Error("THEATER_JOB \u7F3A\u5C11 memberKey");
|
|
846
850
|
}
|
|
847
851
|
console.log("[apm] \u5267\u573A\u4F1A\u8BDD:", sessionId, "\u6210\u5458:", memberKey);
|
|
852
|
+
await api.theater.reportMemberAgentProgress({
|
|
853
|
+
sessionId,
|
|
854
|
+
memberKey,
|
|
855
|
+
status: "IN_PROGRESS",
|
|
856
|
+
logId: payload.logId?.trim() || void 0
|
|
857
|
+
});
|
|
848
858
|
const eventSession = new EventSession(payload.prompt);
|
|
849
859
|
const agent = await createAgentForJob(payload);
|
|
850
860
|
const { agentId, failed, failReason } = await runAgentStream(
|
|
@@ -853,12 +863,13 @@ async function handleTheaterJob(api, payload) {
|
|
|
853
863
|
agent
|
|
854
864
|
);
|
|
855
865
|
const assistantText = eventSession.getAssistantText();
|
|
856
|
-
const content = failed ?
|
|
866
|
+
const content = failed ? failReason || assistantText || "\u672A\u77E5\u9519\u8BEF" : assistantText || "[Agent \u672A\u4EA7\u751F\u6587\u672C\u8F93\u51FA]";
|
|
857
867
|
const result = await api.theater.submitMemberResponse({
|
|
858
868
|
sessionId,
|
|
859
869
|
memberKey,
|
|
860
870
|
content,
|
|
861
871
|
agentId,
|
|
872
|
+
agentStatus: failed ? "FAILED" : "SUCCESS",
|
|
862
873
|
logId: payload.logId?.trim() || void 0
|
|
863
874
|
});
|
|
864
875
|
console.log(
|