u-foo 1.9.5 → 1.9.7
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/chat/index.js +1 -0
- package/src/daemon/index.js +31 -9
package/package.json
CHANGED
package/src/chat/index.js
CHANGED
|
@@ -56,6 +56,7 @@ const {
|
|
|
56
56
|
resolveGlobalControllerProjectRoot,
|
|
57
57
|
} = require("../projects");
|
|
58
58
|
const { loadTemplateRegistry } = require("../group/templates");
|
|
59
|
+
const { loadPromptProfileRegistry } = require("../group/promptProfiles");
|
|
59
60
|
const {
|
|
60
61
|
DEFAULT_TRANSIENT_AGENT_STATE_TTL_MS,
|
|
61
62
|
setTransientAgentState: setTransientAgentStateValue,
|
package/src/daemon/index.js
CHANGED
|
@@ -1342,8 +1342,11 @@ function startDaemon({ projectRoot, provider, model, resumeMode = "auto" }) {
|
|
|
1342
1342
|
: null,
|
|
1343
1343
|
};
|
|
1344
1344
|
let soloLaunchBootstrap = null;
|
|
1345
|
-
if (requestedProfile && normalizedAgent === "ufoo") {
|
|
1346
|
-
const
|
|
1345
|
+
if (requestedProfile && (normalizedAgent === "ufoo" || normalizedAgent === "claude" || normalizedAgent === "codex")) {
|
|
1346
|
+
const agentTypeMap = { ufoo: "ufoo-code", claude: "claude-code", codex: "codex" };
|
|
1347
|
+
const defaultNickMap = { ufoo: "ucode", claude: "claude", codex: "codex" };
|
|
1348
|
+
const agentTypeForBootstrap = agentTypeMap[normalizedAgent];
|
|
1349
|
+
const soloNickname = explicitNickname || defaultNickMap[normalizedAgent];
|
|
1347
1350
|
const profileResult = resolveSoloPromptProfile(projectRoot, requestedProfile);
|
|
1348
1351
|
if (!profileResult.ok) {
|
|
1349
1352
|
socket.write(
|
|
@@ -1357,17 +1360,36 @@ function startDaemon({ projectRoot, provider, model, resumeMode = "auto" }) {
|
|
|
1357
1360
|
}
|
|
1358
1361
|
const built = buildSoloBootstrap({
|
|
1359
1362
|
nickname: soloNickname,
|
|
1360
|
-
agentType:
|
|
1363
|
+
agentType: agentTypeForBootstrap,
|
|
1361
1364
|
requestedProfile: profileResult.requested_profile,
|
|
1362
1365
|
profile: profileResult.profile,
|
|
1363
1366
|
});
|
|
1364
1367
|
if (built.required) {
|
|
1365
1368
|
try {
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1369
|
+
if (normalizedAgent === "ufoo") {
|
|
1370
|
+
// ucode: bootstrap via env var pointing to file
|
|
1371
|
+
const prepared = prepareSoloUcodeBootstrap(projectRoot, soloNickname, built.promptText);
|
|
1372
|
+
op.extra_env = {
|
|
1373
|
+
...(op.extra_env && typeof op.extra_env === "object" ? op.extra_env : {}),
|
|
1374
|
+
UFOO_UCODE_BOOTSTRAP_FILE: prepared.file,
|
|
1375
|
+
};
|
|
1376
|
+
} else if (normalizedAgent === "claude") {
|
|
1377
|
+
// claude-code: bootstrap via --append-system-prompt file
|
|
1378
|
+
const bootstrapDir = path.join(getUfooPaths(projectRoot).agentDir, "claude-code", "solo");
|
|
1379
|
+
fs.mkdirSync(bootstrapDir, { recursive: true });
|
|
1380
|
+
const bootstrapFile = path.join(bootstrapDir, `${soloNickname}.bootstrap.md`);
|
|
1381
|
+
fs.writeFileSync(bootstrapFile, built.promptText, "utf8");
|
|
1382
|
+
op.extra_args = [
|
|
1383
|
+
...(Array.isArray(op.extra_args) ? op.extra_args : []),
|
|
1384
|
+
"--append-system-prompt", bootstrapFile,
|
|
1385
|
+
];
|
|
1386
|
+
} else if (normalizedAgent === "codex") {
|
|
1387
|
+
// codex: bootstrap via initial prompt argument
|
|
1388
|
+
op.extra_args = [
|
|
1389
|
+
...(Array.isArray(op.extra_args) ? op.extra_args : []),
|
|
1390
|
+
built.promptText,
|
|
1391
|
+
];
|
|
1392
|
+
}
|
|
1371
1393
|
soloLaunchBootstrap = {
|
|
1372
1394
|
requested_profile: profileResult.requested_profile,
|
|
1373
1395
|
resolved_profile: profileResult.profile.id,
|
|
@@ -1377,7 +1399,7 @@ function startDaemon({ projectRoot, provider, model, resumeMode = "auto" }) {
|
|
|
1377
1399
|
socket.write(
|
|
1378
1400
|
`${JSON.stringify({
|
|
1379
1401
|
type: IPC_RESPONSE_TYPES.ERROR,
|
|
1380
|
-
error: err.message || "failed to prepare
|
|
1402
|
+
error: err.message || "failed to prepare solo bootstrap",
|
|
1381
1403
|
})}
|
|
1382
1404
|
`,
|
|
1383
1405
|
);
|