u-foo 2.3.11 → 2.3.13
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/package.json +1 -1
- package/src/agent/activityStateWriter.js +14 -3
- package/src/agent/defaultBootstrap.js +28 -3
- package/src/agent/internalRunner.js +139 -127
- package/src/agent/notifier.js +15 -4
- package/src/agent/ptyRunner.js +70 -8
- package/src/agent/ucodeBootstrap.js +23 -1
- package/src/agent/ufooAgent.js +7 -36
- package/src/bus/index.js +2 -1
- package/src/bus/store.js +17 -5
- package/src/bus/subscriber.js +57 -1
- package/src/bus/utils.js +6 -0
- package/src/chat/daemonMessageRouter.js +3 -1
- package/src/chat/dashboardKeyController.js +1 -1
- package/src/chat/dashboardView.js +1 -1
- package/src/chat/index.js +1 -1
- package/src/config.js +1 -0
- package/src/daemon/ops.js +57 -12
- package/src/ufoo/agentRegistryDiagnostics.js +91 -0
- package/src/ufoo/agentsStore.js +38 -2
- package/src/agent/cliRunner.js +0 -706
- package/src/agent/normalizeOutput.js +0 -41
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
function extractTextFromObject(obj) {
|
|
2
|
-
if (!obj || typeof obj !== "object") return "";
|
|
3
|
-
if (obj.structured_output && typeof obj.structured_output === "object") {
|
|
4
|
-
return JSON.stringify(obj.structured_output);
|
|
5
|
-
}
|
|
6
|
-
const candidates = ["reply", "output", "text", "message", "content", "output_text", "result"];
|
|
7
|
-
for (const key of candidates) {
|
|
8
|
-
const val = obj[key];
|
|
9
|
-
if (typeof val === "string") return val;
|
|
10
|
-
}
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function normalizeCliOutput(output) {
|
|
15
|
-
if (!output) return "";
|
|
16
|
-
if (typeof output === "string") return output;
|
|
17
|
-
if (Array.isArray(output)) {
|
|
18
|
-
const parts = [];
|
|
19
|
-
for (const item of output) {
|
|
20
|
-
if (typeof item === "string") {
|
|
21
|
-
parts.push(item);
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
if (item && typeof item === "object") {
|
|
25
|
-
if (item.item && typeof item.item === "object") {
|
|
26
|
-
if (item.item.type === "agent_message" && typeof item.item.text === "string") {
|
|
27
|
-
parts.push(item.item.text);
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (typeof item.text === "string") parts.push(item.text);
|
|
32
|
-
else if (typeof item.content === "string") parts.push(item.content);
|
|
33
|
-
else if (typeof item.output === "string") parts.push(item.output);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return parts.join("\n").trim();
|
|
37
|
-
}
|
|
38
|
-
return extractTextFromObject(output);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
module.exports = { normalizeCliOutput };
|