u-foo 1.9.6 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u-foo",
3
- "version": "1.9.6",
3
+ "version": "1.9.7",
4
4
  "description": "Multi-Agent Workspace Protocol. Just add u. claude → uclaude, codex → ucodex.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://ufoo.dev",
@@ -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 soloNickname = explicitNickname || "ucode";
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: "ufoo-code",
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
- const prepared = prepareSoloUcodeBootstrap(projectRoot, soloNickname, built.promptText);
1367
- op.extra_env = {
1368
- ...(op.extra_env && typeof op.extra_env === "object" ? op.extra_env : {}),
1369
- UFOO_UCODE_BOOTSTRAP_FILE: prepared.file,
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 ucode bootstrap",
1402
+ error: err.message || "failed to prepare solo bootstrap",
1381
1403
  })}
1382
1404
  `,
1383
1405
  );