@ouro.bot/cli 0.1.0-alpha.6 → 0.1.0-alpha.8
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.
|
@@ -467,25 +467,27 @@ async function defaultRunAdoptionSpecialist() {
|
|
|
467
467
|
return answer.trim();
|
|
468
468
|
};
|
|
469
469
|
try {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
470
|
+
process.stdout.write("\nwelcome to ouro. let's get you set up.\n");
|
|
471
|
+
process.stdout.write("i need an API key to power our conversation.\n\n");
|
|
472
|
+
const providerRaw = await prompt("provider (anthropic/azure/minimax/openai-codex): ");
|
|
473
|
+
if (!isAgentProvider(providerRaw)) {
|
|
474
|
+
process.stdout.write("unknown provider. run `ouro hatch` to try again.\n");
|
|
474
475
|
return null;
|
|
475
476
|
}
|
|
476
477
|
const credentials = {};
|
|
477
478
|
if (providerRaw === "anthropic")
|
|
478
|
-
credentials.setupToken = await prompt("
|
|
479
|
+
credentials.setupToken = await prompt("API key: ");
|
|
479
480
|
if (providerRaw === "openai-codex")
|
|
480
|
-
credentials.oauthAccessToken = await prompt("
|
|
481
|
+
credentials.oauthAccessToken = await prompt("OAuth token: ");
|
|
481
482
|
if (providerRaw === "minimax")
|
|
482
|
-
credentials.apiKey = await prompt("
|
|
483
|
+
credentials.apiKey = await prompt("API key: ");
|
|
483
484
|
if (providerRaw === "azure") {
|
|
484
|
-
credentials.apiKey = await prompt("
|
|
485
|
-
credentials.endpoint = await prompt("
|
|
486
|
-
credentials.deployment = await prompt("
|
|
485
|
+
credentials.apiKey = await prompt("API key: ");
|
|
486
|
+
credentials.endpoint = await prompt("endpoint: ");
|
|
487
|
+
credentials.deployment = await prompt("deployment: ");
|
|
487
488
|
}
|
|
488
489
|
rl.close();
|
|
490
|
+
process.stdout.write("\n");
|
|
489
491
|
// Locate the bundled AdoptionSpecialist.ouro shipped with the npm package
|
|
490
492
|
const bundleSourceDir = path.resolve(__dirname, "..", "..", "..", "AdoptionSpecialist.ouro");
|
|
491
493
|
const bundlesRoot = (0, identity_1.getAgentBundlesRoot)();
|
|
@@ -496,7 +498,7 @@ async function defaultRunAdoptionSpecialist() {
|
|
|
496
498
|
secretsRoot,
|
|
497
499
|
provider: providerRaw,
|
|
498
500
|
credentials,
|
|
499
|
-
humanName,
|
|
501
|
+
humanName: os.userInfo().username,
|
|
500
502
|
createReadline: () => {
|
|
501
503
|
const rl2 = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
502
504
|
return { question: (q) => rl2.question(q), close: () => rl2.close() };
|
|
@@ -709,6 +711,32 @@ async function runOuroCli(args, deps = createDefaultOuroCliDeps()) {
|
|
|
709
711
|
return message;
|
|
710
712
|
}
|
|
711
713
|
if (command.kind === "hatch.start") {
|
|
714
|
+
// Route through adoption specialist when no explicit hatch args were provided
|
|
715
|
+
const hasExplicitHatchArgs = !!(command.agentName || command.humanName || command.provider || command.credentials);
|
|
716
|
+
if (deps.runAdoptionSpecialist && !hasExplicitHatchArgs) {
|
|
717
|
+
const hatchlingName = await deps.runAdoptionSpecialist();
|
|
718
|
+
if (!hatchlingName) {
|
|
719
|
+
return "";
|
|
720
|
+
}
|
|
721
|
+
try {
|
|
722
|
+
await deps.installSubagents();
|
|
723
|
+
}
|
|
724
|
+
catch (error) {
|
|
725
|
+
(0, runtime_1.emitNervesEvent)({
|
|
726
|
+
level: "warn",
|
|
727
|
+
component: "daemon",
|
|
728
|
+
event: "daemon.subagent_install_error",
|
|
729
|
+
message: "subagent auto-install failed",
|
|
730
|
+
meta: { error: error instanceof Error ? error.message : /* v8 ignore next -- defensive: non-Error catch branch @preserve */ String(error) },
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
await registerOuroBundleTypeNonBlocking(deps);
|
|
734
|
+
await ensureDaemonRunning(deps);
|
|
735
|
+
if (deps.startChat) {
|
|
736
|
+
await deps.startChat(hatchlingName);
|
|
737
|
+
}
|
|
738
|
+
return "";
|
|
739
|
+
}
|
|
712
740
|
const hatchRunner = deps.runHatchFlow;
|
|
713
741
|
if (!hatchRunner) {
|
|
714
742
|
const response = await deps.sendCommand(deps.socketPath, { kind: "hatch.start" });
|
|
@@ -727,7 +755,7 @@ async function runOuroCli(args, deps = createDefaultOuroCliDeps()) {
|
|
|
727
755
|
component: "daemon",
|
|
728
756
|
event: "daemon.subagent_install_error",
|
|
729
757
|
message: "subagent auto-install failed",
|
|
730
|
-
meta: { error: error instanceof Error ? error.message : String(error) },
|
|
758
|
+
meta: { error: error instanceof Error ? error.message : /* v8 ignore next -- defensive: non-Error catch branch @preserve */ String(error) },
|
|
731
759
|
});
|
|
732
760
|
}
|
|
733
761
|
await registerOuroBundleTypeNonBlocking(deps);
|
|
@@ -27,9 +27,16 @@ function buildSpecialistSystemPrompt(soulText, identityText, existingBundles) {
|
|
|
27
27
|
sections.push("## Existing agents\nThe human has no agents yet. This will be their first hatchling.");
|
|
28
28
|
}
|
|
29
29
|
sections.push([
|
|
30
|
+
"## Conversation flow",
|
|
31
|
+
"I start by warmly greeting the human and asking their name.",
|
|
32
|
+
"I then learn about what they want their agent to do — goals, personality, working style.",
|
|
33
|
+
"I keep the conversation natural and concise. I do not overwhelm with questions.",
|
|
34
|
+
"When I have enough context, I suggest a name for the hatchling and confirm with the human.",
|
|
35
|
+
"Then I call `hatch_agent` with the agent name and the human's name.",
|
|
36
|
+
"",
|
|
30
37
|
"## Tools",
|
|
31
38
|
"I have these tools available:",
|
|
32
|
-
"- `hatch_agent`: Create a new agent bundle. I call this with
|
|
39
|
+
"- `hatch_agent`: Create a new agent bundle. I call this with `name` (the agent name, PascalCase) and `humanName` (what the human told me their name is).",
|
|
33
40
|
"- `final_answer`: End the conversation with a final message to the human. I call this when the adoption process is complete.",
|
|
34
41
|
"- `read_file`: Read a file from disk. Useful for reviewing existing agent bundles or migration sources.",
|
|
35
42
|
"- `list_directory`: List directory contents. Useful for exploring existing agent bundles.",
|
|
@@ -52,8 +52,12 @@ const hatchAgentTool = {
|
|
|
52
52
|
type: "string",
|
|
53
53
|
description: "the name for the new agent (PascalCase, e.g. 'Slugger')",
|
|
54
54
|
},
|
|
55
|
+
humanName: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "the human's preferred name, as they told you during conversation",
|
|
58
|
+
},
|
|
55
59
|
},
|
|
56
|
-
required: ["name"],
|
|
60
|
+
required: ["name", "humanName"],
|
|
57
61
|
},
|
|
58
62
|
},
|
|
59
63
|
};
|
|
@@ -83,7 +87,7 @@ async function execSpecialistTool(name, args, deps) {
|
|
|
83
87
|
}
|
|
84
88
|
const input = {
|
|
85
89
|
agentName,
|
|
86
|
-
humanName: deps.humanName,
|
|
90
|
+
humanName: args.humanName || deps.humanName,
|
|
87
91
|
provider: deps.provider,
|
|
88
92
|
credentials: deps.credentials,
|
|
89
93
|
};
|