open-agents-ai 0.185.87 → 0.185.89
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 +17 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68133,22 +68133,26 @@ Respond conversationally. Call task_complete with your final response.`;
|
|
|
68133
68133
|
});
|
|
68134
68134
|
await new Promise((resolve36) => child.on("close", resolve36));
|
|
68135
68135
|
let content = "";
|
|
68136
|
-
|
|
68137
|
-
|
|
68138
|
-
|
|
68139
|
-
|
|
68140
|
-
|
|
68141
|
-
|
|
68142
|
-
|
|
68143
|
-
|
|
68144
|
-
|
|
68145
|
-
|
|
68136
|
+
try {
|
|
68137
|
+
const result = JSON.parse(output.trim());
|
|
68138
|
+
const summary = result.summary || "";
|
|
68139
|
+
const match = summary.match(/Tokens:\s*[\d,]+\s+([\s\S]*)/);
|
|
68140
|
+
content = match ? match[1].trim() : summary;
|
|
68141
|
+
} catch {
|
|
68142
|
+
for (const line of output.split("\n")) {
|
|
68143
|
+
if (!line.trim())
|
|
68144
|
+
continue;
|
|
68145
|
+
try {
|
|
68146
|
+
const evt = JSON.parse(line);
|
|
68147
|
+
if (evt.status === "completed") {
|
|
68148
|
+
const summary = evt.summary || "";
|
|
68149
|
+
const match = summary.match(/Tokens:\s*[\d,]+\s+([\s\S]*)/);
|
|
68150
|
+
content = match ? match[1].trim() : summary;
|
|
68151
|
+
}
|
|
68152
|
+
} catch {
|
|
68146
68153
|
}
|
|
68147
|
-
} catch {
|
|
68148
68154
|
}
|
|
68149
68155
|
}
|
|
68150
|
-
if (!content.trim())
|
|
68151
|
-
content = summaryContent;
|
|
68152
68156
|
addAssistantMessage(session, content.trim());
|
|
68153
68157
|
jsonResponse(res, 200, {
|
|
68154
68158
|
session_id: session.id,
|
package/package.json
CHANGED