@ouro.bot/cli 0.1.0-alpha.423 → 0.1.0-alpha.425
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/changelog.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.425",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Human-facing single-agent CLI commands now resolve an omitted `--agent` through one shared path: use the explicit flag when present, otherwise use runtime identity when it can name the current agent, otherwise use the only discovered local agent, otherwise ask which agent to use, and otherwise explain how to hatch or clone one.",
|
|
8
|
+
"`ouro auth`, `ouro auth verify`, `ouro auth switch`, `ouro use`, `ouro provider` commands, `ouro vault` commands, `ouro connect`, `ouro config model`, `ouro config models`, `ouro setup`, `ouro bluebubbles replay`, `ouro thoughts`, `ouro attention`, `ouro inner`, `ouro task`, `ouro reminder create`, `ouro friend` management commands, `ouro habit`, and `ouro session list` now share that missing-agent contract instead of quietly depending on argv or ambient context.",
|
|
9
|
+
"Task/reminder execution now builds agent-scoped task modules directly from the selected bundle, session scanning now accepts an explicit agent name, and local friend/habit flows now read the selected agent bundle instead of falling back to hidden global defaults.",
|
|
10
|
+
"`ouro whoami` keeps its richer runtime identity output but now shares the same no-agent fallback behavior when runtime identity is unavailable, and the runtime seam no longer grabs unrelated ambient repo identity behind the human's back.",
|
|
11
|
+
"CLI help and execution coverage now protect single-agent auto-selection, multi-agent prompting, no-agent guidance, noninteractive ambiguity handling, and the newly covered local task/reminder/friend/habit/session flows.",
|
|
12
|
+
"`@ouro.bot/cli` and the `ouro.bot` wrapper are version-synced for the complete missing-agent resolution release."
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"version": "0.1.0-alpha.424",
|
|
17
|
+
"changes": [
|
|
18
|
+
"Human-facing single-agent CLI commands now resolve an omitted `--agent` through one shared path: use the explicit flag when present, otherwise use the only installed agent, otherwise ask which agent to use, and otherwise explain how to hatch or clone one.",
|
|
19
|
+
"`ouro auth`, `ouro auth verify`, `ouro auth switch`, `ouro use`, `ouro provider refresh`, `ouro provider check`, `ouro provider status`, `ouro vault` commands, `ouro connect`, `ouro config model`, `ouro config models`, `ouro setup`, and `ouro bluebubbles replay` now accept `[--agent <name>]` instead of failing during parse before Ouro has a chance to help.",
|
|
20
|
+
"`ouro whoami` keeps its richer runtime identity output but now shares the same no-agent fallback behavior when runtime identity is unavailable, and the runtime seam no longer grabs unrelated ambient repo identity behind the human's back.",
|
|
21
|
+
"CLI help text now tells the truth about optional-agent behavior, and focused parser/execution/help coverage protects single-agent auto-selection, multi-agent prompting, no-agent guidance, and noninteractive ambiguity handling.",
|
|
22
|
+
"`@ouro.bot/cli` and the `ouro.bot` wrapper are version-synced for the missing-agent resolution release."
|
|
23
|
+
]
|
|
24
|
+
},
|
|
4
25
|
{
|
|
5
26
|
"version": "0.1.0-alpha.423",
|
|
6
27
|
"changes": [
|
|
@@ -587,8 +587,7 @@ function createDefaultOuroCliDeps(socketPath = socket_client_1.DEFAULT_DAEMON_SO
|
|
|
587
587
|
const { main } = await Promise.resolve().then(() => __importStar(require("../../senses/cli")));
|
|
588
588
|
await main(agentName);
|
|
589
589
|
},
|
|
590
|
-
scanSessions: async () => {
|
|
591
|
-
const agentName = (0, identity_1.getAgentName)();
|
|
590
|
+
scanSessions: async (agentName) => {
|
|
592
591
|
const agentRoot = (0, identity_1.getAgentRoot)(agentName);
|
|
593
592
|
return (0, session_activity_1.listSessionActivity)({
|
|
594
593
|
sessionsDir: path.join(agentRoot, "state", "sessions"),
|
|
@@ -158,6 +158,132 @@ async function listCliAgents(deps) {
|
|
|
158
158
|
}
|
|
159
159
|
return [];
|
|
160
160
|
}
|
|
161
|
+
function runtimeContextAgentName(deps) {
|
|
162
|
+
try {
|
|
163
|
+
return deps.whoamiInfo?.().agentName.trim() || undefined;
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function normalizeCliAgentNames(agentNames) {
|
|
170
|
+
return [...new Set(agentNames.map((agent) => agent.trim()).filter((agent) => agent.length > 0))];
|
|
171
|
+
}
|
|
172
|
+
function resolveSelectedCliAgent(answer, agentNames) {
|
|
173
|
+
const trimmed = answer.trim();
|
|
174
|
+
if (!trimmed)
|
|
175
|
+
return undefined;
|
|
176
|
+
const byName = agentNames.find((agent) => agent.toLowerCase() === trimmed.toLowerCase());
|
|
177
|
+
if (byName)
|
|
178
|
+
return byName;
|
|
179
|
+
const parsedIndex = Number.parseInt(trimmed, 10);
|
|
180
|
+
if (Number.isNaN(parsedIndex))
|
|
181
|
+
return undefined;
|
|
182
|
+
return agentNames[parsedIndex - 1];
|
|
183
|
+
}
|
|
184
|
+
function noAgentsFoundMessage() {
|
|
185
|
+
return "no agents found. Run `ouro` to hatch one or `ouro clone <remote>` to add an existing agent.";
|
|
186
|
+
}
|
|
187
|
+
function multipleAgentsFoundMessage(agentNames) {
|
|
188
|
+
return [
|
|
189
|
+
`multiple agents found: ${agentNames.join(", ")}`,
|
|
190
|
+
"Re-run with --agent <name>.",
|
|
191
|
+
].join("\n");
|
|
192
|
+
}
|
|
193
|
+
function invalidAgentSelectionMessage(agentNames) {
|
|
194
|
+
return [
|
|
195
|
+
`invalid agent selection. Available agents: ${agentNames.join(", ")}`,
|
|
196
|
+
"Re-run with --agent <name>.",
|
|
197
|
+
].join("\n");
|
|
198
|
+
}
|
|
199
|
+
function agentResolutionFailureMode(command) {
|
|
200
|
+
switch (command.kind) {
|
|
201
|
+
case "task.board":
|
|
202
|
+
case "task.create":
|
|
203
|
+
case "task.update":
|
|
204
|
+
case "task.show":
|
|
205
|
+
case "task.actionable":
|
|
206
|
+
case "task.deps":
|
|
207
|
+
case "task.sessions":
|
|
208
|
+
case "task.fix":
|
|
209
|
+
case "reminder.create":
|
|
210
|
+
case "friend.list":
|
|
211
|
+
case "friend.show":
|
|
212
|
+
case "friend.create":
|
|
213
|
+
case "friend.update":
|
|
214
|
+
case "habit.list":
|
|
215
|
+
case "habit.create":
|
|
216
|
+
case "thoughts":
|
|
217
|
+
case "attention.list":
|
|
218
|
+
case "attention.show":
|
|
219
|
+
case "attention.history":
|
|
220
|
+
case "inner.status":
|
|
221
|
+
case "session.list":
|
|
222
|
+
return "return-message";
|
|
223
|
+
case "provider.use":
|
|
224
|
+
case "provider.check":
|
|
225
|
+
case "provider.status":
|
|
226
|
+
case "provider.refresh":
|
|
227
|
+
case "vault.create":
|
|
228
|
+
case "vault.replace":
|
|
229
|
+
case "vault.recover":
|
|
230
|
+
case "vault.unlock":
|
|
231
|
+
case "vault.status":
|
|
232
|
+
case "vault.config.set":
|
|
233
|
+
case "vault.config.status":
|
|
234
|
+
case "connect":
|
|
235
|
+
case "auth.run":
|
|
236
|
+
case "auth.verify":
|
|
237
|
+
case "auth.switch":
|
|
238
|
+
case "config.model":
|
|
239
|
+
case "config.models":
|
|
240
|
+
case "setup":
|
|
241
|
+
case "bluebubbles.replay":
|
|
242
|
+
return "throw";
|
|
243
|
+
default:
|
|
244
|
+
return undefined;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async function resolveMissingAgentName(deps, failureMode) {
|
|
248
|
+
const runtimeAgent = runtimeContextAgentName(deps);
|
|
249
|
+
if (runtimeAgent) {
|
|
250
|
+
return { ok: true, agent: runtimeAgent };
|
|
251
|
+
}
|
|
252
|
+
const discoveredAgents = normalizeCliAgentNames(await listCliAgents(deps));
|
|
253
|
+
if (discoveredAgents.length === 0) {
|
|
254
|
+
return { ok: false, message: noAgentsFoundMessage(), failureMode };
|
|
255
|
+
}
|
|
256
|
+
if (discoveredAgents.length === 1) {
|
|
257
|
+
return { ok: true, agent: discoveredAgents[0] };
|
|
258
|
+
}
|
|
259
|
+
if (!deps.promptInput) {
|
|
260
|
+
return { ok: false, message: multipleAgentsFoundMessage(discoveredAgents), failureMode };
|
|
261
|
+
}
|
|
262
|
+
const answer = await deps.promptInput([
|
|
263
|
+
"Which agent should this use?",
|
|
264
|
+
...discoveredAgents.map((agent, index) => `${index + 1}. ${agent}`),
|
|
265
|
+
`Choose [1-${discoveredAgents.length}] or type a name: `,
|
|
266
|
+
].join("\n"));
|
|
267
|
+
const selectedAgent = resolveSelectedCliAgent(answer, discoveredAgents);
|
|
268
|
+
if (!selectedAgent) {
|
|
269
|
+
return { ok: false, message: invalidAgentSelectionMessage(discoveredAgents), failureMode };
|
|
270
|
+
}
|
|
271
|
+
return { ok: true, agent: selectedAgent };
|
|
272
|
+
}
|
|
273
|
+
async function resolveCommandAgent(command, deps) {
|
|
274
|
+
const failureMode = agentResolutionFailureMode(command);
|
|
275
|
+
if (!failureMode) {
|
|
276
|
+
return { ok: true, command: command };
|
|
277
|
+
}
|
|
278
|
+
const explicitAgent = "agent" in command && typeof command.agent === "string" ? command.agent.trim() : "";
|
|
279
|
+
if (explicitAgent) {
|
|
280
|
+
return { ok: true, command: { ...command, agent: explicitAgent } };
|
|
281
|
+
}
|
|
282
|
+
const resolvedAgent = await resolveMissingAgentName(deps, failureMode);
|
|
283
|
+
if (!resolvedAgent.ok)
|
|
284
|
+
return resolvedAgent;
|
|
285
|
+
return { ok: true, command: { ...command, agent: resolvedAgent.agent } };
|
|
286
|
+
}
|
|
161
287
|
function managedAgentsSignature(agentNames) {
|
|
162
288
|
const unique = [...new Set(agentNames.map((agent) => agent.trim()).filter((agent) => agent.length > 0))].sort();
|
|
163
289
|
return unique.length > 0 ? unique.join(",") : "(none)";
|
|
@@ -2887,9 +3013,9 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
2887
3013
|
deps.writeStdout(text);
|
|
2888
3014
|
return text;
|
|
2889
3015
|
}
|
|
2890
|
-
let
|
|
3016
|
+
let parsedCommand;
|
|
2891
3017
|
try {
|
|
2892
|
-
|
|
3018
|
+
parsedCommand = (0, cli_parse_1.parseOuroCommand)(args);
|
|
2893
3019
|
}
|
|
2894
3020
|
catch (parseError) {
|
|
2895
3021
|
if (deps.startChat && deps.listDiscoveredAgents && args.length === 1) {
|
|
@@ -2902,6 +3028,15 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
2902
3028
|
}
|
|
2903
3029
|
throw parseError;
|
|
2904
3030
|
}
|
|
3031
|
+
const resolvedCommand = await resolveCommandAgent(parsedCommand, deps);
|
|
3032
|
+
if (!resolvedCommand.ok) {
|
|
3033
|
+
if (resolvedCommand.failureMode === "return-message") {
|
|
3034
|
+
deps.writeStdout(resolvedCommand.message);
|
|
3035
|
+
return resolvedCommand.message;
|
|
3036
|
+
}
|
|
3037
|
+
throw new Error(resolvedCommand.message);
|
|
3038
|
+
}
|
|
3039
|
+
let command = resolvedCommand.command;
|
|
2905
3040
|
if (args.length === 0) {
|
|
2906
3041
|
const discovered = await Promise.resolve(deps.listDiscoveredAgents ? deps.listDiscoveredAgents() : (0, cli_defaults_1.defaultListDiscoveredAgents)());
|
|
2907
3042
|
if (discovered.length === 0 && deps.runSerpentGuide) {
|
|
@@ -3781,7 +3916,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
3781
3916
|
command.kind === "task.show" || command.kind === "task.actionable" || command.kind === "task.deps" ||
|
|
3782
3917
|
command.kind === "task.sessions" || command.kind === "task.fix") {
|
|
3783
3918
|
/* v8 ignore start -- production default: requires full identity setup @preserve */
|
|
3784
|
-
const taskMod = deps.taskModule ?? (0, tasks_1.
|
|
3919
|
+
const taskMod = deps.taskModule ?? (0, tasks_1.createTaskModule)(path.join(deps.bundlesRoot ?? (0, identity_1.getAgentBundlesRoot)(), `${command.agent}.ouro`, "tasks"));
|
|
3785
3920
|
/* v8 ignore stop */
|
|
3786
3921
|
const message = executeTaskCommand(command, taskMod);
|
|
3787
3922
|
deps.writeStdout(message);
|
|
@@ -3790,7 +3925,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
3790
3925
|
// ── reminder subcommands (local, no daemon socket needed) ──
|
|
3791
3926
|
if (command.kind === "reminder.create") {
|
|
3792
3927
|
/* v8 ignore start -- production default: requires full identity setup @preserve */
|
|
3793
|
-
const taskMod = deps.taskModule ?? (0, tasks_1.
|
|
3928
|
+
const taskMod = deps.taskModule ?? (0, tasks_1.createTaskModule)(path.join(deps.bundlesRoot ?? (0, identity_1.getAgentBundlesRoot)(), `${command.agent}.ouro`, "tasks"));
|
|
3794
3929
|
/* v8 ignore stop */
|
|
3795
3930
|
const message = executeReminderCommand(command, taskMod);
|
|
3796
3931
|
deps.writeStdout(message);
|
|
@@ -3800,8 +3935,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
3800
3935
|
if (command.kind === "habit.list" || command.kind === "habit.create") {
|
|
3801
3936
|
const { parseHabitFile, renderHabitFile } = await Promise.resolve().then(() => __importStar(require("../habits/habit-parser")));
|
|
3802
3937
|
/* v8 ignore start -- production default: uses real bundle root @preserve */
|
|
3803
|
-
const
|
|
3804
|
-
const bundleRoot = deps.agentBundleRoot ?? path.join((0, identity_1.getAgentBundlesRoot)(), `${agentName}.ouro`);
|
|
3938
|
+
const bundleRoot = deps.agentBundleRoot ?? path.join(deps.bundlesRoot ?? (0, identity_1.getAgentBundlesRoot)(), `${command.agent}.ouro`);
|
|
3805
3939
|
/* v8 ignore stop */
|
|
3806
3940
|
const habitsDir = path.join(bundleRoot, "habits");
|
|
3807
3941
|
if (command.kind === "habit.list") {
|
|
@@ -3860,8 +3994,8 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
3860
3994
|
// Derive agent-scoped friends dir from --agent flag or link/unlink's agent field
|
|
3861
3995
|
const agentName = ("agent" in command && command.agent) ? command.agent : undefined;
|
|
3862
3996
|
const friendsDir = agentName
|
|
3863
|
-
? path.join((0, identity_1.getAgentBundlesRoot)(), `${agentName}.ouro`, "friends")
|
|
3864
|
-
: path.join((0, identity_1.getAgentBundlesRoot)(), "friends");
|
|
3997
|
+
? path.join(deps.bundlesRoot ?? (0, identity_1.getAgentBundlesRoot)(), `${agentName}.ouro`, "friends")
|
|
3998
|
+
: path.join(deps.bundlesRoot ?? (0, identity_1.getAgentBundlesRoot)(), "friends");
|
|
3865
3999
|
store = new store_file_1.FileFriendStore(friendsDir);
|
|
3866
4000
|
}
|
|
3867
4001
|
/* v8 ignore stop */
|
|
@@ -4044,29 +4178,41 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
4044
4178
|
deps.writeStdout(message);
|
|
4045
4179
|
return message;
|
|
4046
4180
|
}
|
|
4047
|
-
/* v8 ignore start -- production default: requires full identity setup @preserve */
|
|
4048
4181
|
try {
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4182
|
+
if (deps.whoamiInfo) {
|
|
4183
|
+
try {
|
|
4184
|
+
const info = deps.whoamiInfo();
|
|
4185
|
+
const message = [
|
|
4186
|
+
`agent: ${info.agentName}`,
|
|
4187
|
+
`home: ${info.homePath}`,
|
|
4188
|
+
`bones: ${info.bonesVersion}`,
|
|
4189
|
+
].join("\n");
|
|
4190
|
+
deps.writeStdout(message);
|
|
4191
|
+
return message;
|
|
4192
|
+
}
|
|
4193
|
+
catch {
|
|
4194
|
+
// Fall through to shared agent selection when no runtime identity is available.
|
|
4195
|
+
}
|
|
4196
|
+
}
|
|
4197
|
+
const resolvedAgent = await resolveMissingAgentName(deps, "return-message");
|
|
4198
|
+
if (!resolvedAgent.ok) {
|
|
4199
|
+
deps.writeStdout(resolvedAgent.message);
|
|
4200
|
+
return resolvedAgent.message;
|
|
4201
|
+
}
|
|
4202
|
+
const agentRoot = path.join((0, identity_1.getAgentBundlesRoot)(), `${resolvedAgent.agent}.ouro`);
|
|
4056
4203
|
const message = [
|
|
4057
|
-
`agent: ${
|
|
4058
|
-
`home: ${
|
|
4059
|
-
`bones: ${
|
|
4204
|
+
`agent: ${resolvedAgent.agent}`,
|
|
4205
|
+
`home: ${agentRoot}`,
|
|
4206
|
+
`bones: ${(0, runtime_metadata_1.getRuntimeMetadata)().version}`,
|
|
4060
4207
|
].join("\n");
|
|
4061
4208
|
deps.writeStdout(message);
|
|
4062
4209
|
return message;
|
|
4063
4210
|
}
|
|
4064
4211
|
catch {
|
|
4065
|
-
const message =
|
|
4212
|
+
const message = noAgentsFoundMessage();
|
|
4066
4213
|
deps.writeStdout(message);
|
|
4067
4214
|
return message;
|
|
4068
4215
|
}
|
|
4069
|
-
/* v8 ignore stop */
|
|
4070
4216
|
}
|
|
4071
4217
|
// ── changelog (local, no daemon socket needed) ──
|
|
4072
4218
|
if (command.kind === "changelog") {
|
|
@@ -4110,10 +4256,9 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
4110
4256
|
// ── thoughts (local, no daemon socket needed) ──
|
|
4111
4257
|
if (command.kind === "thoughts") {
|
|
4112
4258
|
try {
|
|
4113
|
-
const agentName = command.agent ?? (0, identity_1.getAgentName)();
|
|
4114
4259
|
/* v8 ignore next -- production fallback: tests always inject bundlesRoot via createTmpBundle @preserve */
|
|
4115
4260
|
const bundlesRoot = deps.bundlesRoot ?? (0, identity_1.getAgentBundlesRoot)();
|
|
4116
|
-
const agentRoot = path.join(bundlesRoot, `${
|
|
4261
|
+
const agentRoot = path.join(bundlesRoot, `${command.agent}.ouro`);
|
|
4117
4262
|
const sessionFilePath = (0, thoughts_1.getInnerDialogSessionPath)(agentRoot);
|
|
4118
4263
|
if (command.json) {
|
|
4119
4264
|
try {
|
|
@@ -4156,10 +4301,9 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
4156
4301
|
/* v8 ignore start -- CLI attention handler: requires real obligation store on disk @preserve */
|
|
4157
4302
|
if (command.kind === "attention.list" || command.kind === "attention.show" || command.kind === "attention.history") {
|
|
4158
4303
|
try {
|
|
4159
|
-
const agentName = command.agent ?? (0, identity_1.getAgentName)();
|
|
4160
4304
|
const { listActiveReturnObligations, readReturnObligation } = await Promise.resolve().then(() => __importStar(require("../../arc/obligations")));
|
|
4161
4305
|
if (command.kind === "attention.list") {
|
|
4162
|
-
const obligations = listActiveReturnObligations(
|
|
4306
|
+
const obligations = listActiveReturnObligations(command.agent);
|
|
4163
4307
|
if (obligations.length === 0) {
|
|
4164
4308
|
const message = "nothing held — attention queue is empty";
|
|
4165
4309
|
deps.writeStdout(message);
|
|
@@ -4171,7 +4315,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
4171
4315
|
return message;
|
|
4172
4316
|
}
|
|
4173
4317
|
if (command.kind === "attention.show") {
|
|
4174
|
-
const obligation = readReturnObligation(
|
|
4318
|
+
const obligation = readReturnObligation(command.agent, command.id);
|
|
4175
4319
|
if (!obligation) {
|
|
4176
4320
|
const message = `no obligation found with id ${command.id}`;
|
|
4177
4321
|
deps.writeStdout(message);
|
|
@@ -4183,7 +4327,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
4183
4327
|
}
|
|
4184
4328
|
// attention.history: show returned obligations
|
|
4185
4329
|
const { getReturnObligationsDir } = await Promise.resolve().then(() => __importStar(require("../../arc/obligations")));
|
|
4186
|
-
const obligationsDir = getReturnObligationsDir(
|
|
4330
|
+
const obligationsDir = getReturnObligationsDir(command.agent);
|
|
4187
4331
|
let attEntries = [];
|
|
4188
4332
|
try {
|
|
4189
4333
|
attEntries = fs.readdirSync(obligationsDir);
|
|
@@ -4224,8 +4368,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
4224
4368
|
/* v8 ignore start -- inner status handler: requires real agent state on disk @preserve */
|
|
4225
4369
|
if (command.kind === "inner.status") {
|
|
4226
4370
|
try {
|
|
4227
|
-
const
|
|
4228
|
-
const agentRoot = (0, identity_1.getAgentRoot)(agentName);
|
|
4371
|
+
const agentRoot = (0, identity_1.getAgentRoot)(command.agent);
|
|
4229
4372
|
const { buildInnerStatusOutput } = await Promise.resolve().then(() => __importStar(require("./inner-status")));
|
|
4230
4373
|
const { sessionPath: getSessionPath } = await Promise.resolve().then(() => __importStar(require("../config")));
|
|
4231
4374
|
const { parseCadenceToMs: parseCadenceMs, DEFAULT_CADENCE_MS } = await Promise.resolve().then(() => __importStar(require("./cadence")));
|
|
@@ -4283,9 +4426,9 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
4283
4426
|
}
|
|
4284
4427
|
catch { /* no habits — heartbeat unknown */ }
|
|
4285
4428
|
// Attention count
|
|
4286
|
-
const activeObligations = listActiveReturnObligations(
|
|
4429
|
+
const activeObligations = listActiveReturnObligations(command.agent);
|
|
4287
4430
|
const message = buildInnerStatusOutput({
|
|
4288
|
-
agentName,
|
|
4431
|
+
agentName: command.agent,
|
|
4289
4432
|
runtimeState,
|
|
4290
4433
|
journalFiles,
|
|
4291
4434
|
heartbeat,
|
|
@@ -4307,7 +4450,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
4307
4450
|
/* v8 ignore start -- production default: requires full identity setup @preserve */
|
|
4308
4451
|
const scanner = deps.scanSessions ?? (async () => []);
|
|
4309
4452
|
/* v8 ignore stop */
|
|
4310
|
-
const sessions = await scanner();
|
|
4453
|
+
const sessions = await scanner(command.agent);
|
|
4311
4454
|
if (sessions.length === 0) {
|
|
4312
4455
|
const message = "no active sessions";
|
|
4313
4456
|
deps.writeStdout(message);
|
|
@@ -94,8 +94,8 @@ exports.COMMAND_REGISTRY = {
|
|
|
94
94
|
config: {
|
|
95
95
|
category: "Agents",
|
|
96
96
|
description: "View or change agent configuration",
|
|
97
|
-
usage: "ouro config <subcommand> --agent <name>",
|
|
98
|
-
example: "ouro config models
|
|
97
|
+
usage: "ouro config <subcommand> [--agent <name>]",
|
|
98
|
+
example: "ouro config models",
|
|
99
99
|
subcommands: ["model", "models"],
|
|
100
100
|
},
|
|
101
101
|
changelog: {
|
|
@@ -159,27 +159,27 @@ exports.COMMAND_REGISTRY = {
|
|
|
159
159
|
auth: {
|
|
160
160
|
category: "Auth",
|
|
161
161
|
description: "Set up, verify, or switch agent credentials",
|
|
162
|
-
usage: "ouro auth [verify|switch] --agent <name> [--provider <provider>]",
|
|
163
|
-
example: "ouro auth
|
|
162
|
+
usage: "ouro auth [verify|switch] [--agent <name>] [--provider <provider>]",
|
|
163
|
+
example: "ouro auth",
|
|
164
164
|
subcommands: ["verify", "switch"],
|
|
165
165
|
},
|
|
166
166
|
connect: {
|
|
167
167
|
category: "Auth",
|
|
168
168
|
description: "Connect providers, portable integrations, and local senses from one guided bay",
|
|
169
|
-
usage: "ouro connect [providers|perplexity|embeddings|teams|bluebubbles] --agent <name>",
|
|
170
|
-
example: "ouro connect
|
|
169
|
+
usage: "ouro connect [providers|perplexity|embeddings|teams|bluebubbles] [--agent <name>]",
|
|
170
|
+
example: "ouro connect",
|
|
171
171
|
subcommands: ["providers", "perplexity", "embeddings", "teams", "bluebubbles"],
|
|
172
172
|
},
|
|
173
173
|
use: {
|
|
174
174
|
category: "Auth",
|
|
175
175
|
description: "Choose this machine's provider/model lane for an agent",
|
|
176
|
-
usage: "ouro use --agent <name> --lane outward|inner --provider <provider> --model <model> [--force]",
|
|
176
|
+
usage: "ouro use [--agent <name>] --lane outward|inner --provider <provider> --model <model> [--force]",
|
|
177
177
|
example: "ouro use --agent ouroboros --lane outward --provider minimax --model MiniMax-M2.5",
|
|
178
178
|
},
|
|
179
179
|
check: {
|
|
180
180
|
category: "Auth",
|
|
181
181
|
description: "Run a live check for this machine's selected provider/model lane",
|
|
182
|
-
usage: "ouro check --agent <name> --lane outward|inner",
|
|
182
|
+
usage: "ouro check [--agent <name>] --lane outward|inner",
|
|
183
183
|
example: "ouro check --agent ouroboros --lane outward",
|
|
184
184
|
},
|
|
185
185
|
repair: {
|
|
@@ -191,15 +191,15 @@ exports.COMMAND_REGISTRY = {
|
|
|
191
191
|
provider: {
|
|
192
192
|
category: "Auth",
|
|
193
193
|
description: "Refresh daemon provider credentials from an agent vault",
|
|
194
|
-
usage: "ouro provider refresh --agent <name>",
|
|
194
|
+
usage: "ouro provider refresh [--agent <name>]",
|
|
195
195
|
example: "ouro provider refresh --agent ouroboros",
|
|
196
196
|
subcommands: ["refresh"],
|
|
197
197
|
},
|
|
198
198
|
vault: {
|
|
199
199
|
category: "Auth",
|
|
200
200
|
description: "Create, replace, recover, unlock, inspect, and populate the agent credential vault",
|
|
201
|
-
usage: "ouro vault <create|replace|recover|unlock|status|config> --agent <name>",
|
|
202
|
-
example: "ouro vault status
|
|
201
|
+
usage: "ouro vault <create|replace|recover|unlock|status|config> [--agent <name>]",
|
|
202
|
+
example: "ouro vault status",
|
|
203
203
|
subcommands: ["create", "replace", "recover", "unlock", "status", "config set", "config status"],
|
|
204
204
|
},
|
|
205
205
|
thoughts: {
|
|
@@ -244,8 +244,8 @@ exports.COMMAND_REGISTRY = {
|
|
|
244
244
|
setup: {
|
|
245
245
|
category: "System",
|
|
246
246
|
description: "Register MCP server and hooks for a dev tool",
|
|
247
|
-
usage: "ouro setup --tool <claude-code|codex> --agent <name>",
|
|
248
|
-
example: "ouro setup --tool claude-code
|
|
247
|
+
usage: "ouro setup --tool <claude-code|codex> [--agent <name>]",
|
|
248
|
+
example: "ouro setup --tool claude-code",
|
|
249
249
|
},
|
|
250
250
|
hook: {
|
|
251
251
|
category: "System",
|
|
@@ -256,86 +256,86 @@ exports.COMMAND_REGISTRY = {
|
|
|
256
256
|
bluebubbles: {
|
|
257
257
|
category: "System",
|
|
258
258
|
description: "BlueBubbles integration commands",
|
|
259
|
-
usage: "ouro bluebubbles replay --agent <name> --message-guid <guid> [--event-type <type>] [--json]",
|
|
260
|
-
example: "ouro bluebubbles replay --
|
|
259
|
+
usage: "ouro bluebubbles replay [--agent <name>] --message-guid <guid> [--event-type <type>] [--json]",
|
|
260
|
+
example: "ouro bluebubbles replay --message-guid abc123",
|
|
261
261
|
subcommands: ["replay"],
|
|
262
262
|
},
|
|
263
263
|
};
|
|
264
264
|
const SUBCOMMAND_HELP = {
|
|
265
265
|
"auth verify": {
|
|
266
266
|
description: "Verify agent provider credentials without changing provider/model lanes",
|
|
267
|
-
usage: "ouro auth verify --agent <name> [--provider <provider>]",
|
|
268
|
-
example: "ouro auth verify --
|
|
267
|
+
usage: "ouro auth verify [--agent <name>] [--provider <provider>]",
|
|
268
|
+
example: "ouro auth verify --provider openai-codex",
|
|
269
269
|
},
|
|
270
270
|
"auth switch": {
|
|
271
271
|
description: "Switch local provider/model lanes after credentials are available",
|
|
272
|
-
usage: "ouro auth switch --agent <name> --provider <provider> [--facing human|agent]",
|
|
273
|
-
example: "ouro auth switch --
|
|
272
|
+
usage: "ouro auth switch [--agent <name>] --provider <provider> [--facing human|agent]",
|
|
273
|
+
example: "ouro auth switch --provider minimax",
|
|
274
274
|
},
|
|
275
275
|
"connect perplexity": {
|
|
276
276
|
description: "Connect Perplexity search for this agent",
|
|
277
|
-
usage: "ouro connect perplexity --agent <name>",
|
|
278
|
-
example: "ouro connect perplexity
|
|
277
|
+
usage: "ouro connect perplexity [--agent <name>]",
|
|
278
|
+
example: "ouro connect perplexity",
|
|
279
279
|
},
|
|
280
280
|
"connect providers": {
|
|
281
281
|
description: "Open provider auth from the connect bay without remembering the auth command",
|
|
282
|
-
usage: "ouro connect providers --agent <name>",
|
|
283
|
-
example: "ouro connect providers
|
|
282
|
+
usage: "ouro connect providers [--agent <name>]",
|
|
283
|
+
example: "ouro connect providers",
|
|
284
284
|
},
|
|
285
285
|
"connect embeddings": {
|
|
286
286
|
description: "Connect memory embeddings for this agent",
|
|
287
|
-
usage: "ouro connect embeddings --agent <name>",
|
|
288
|
-
example: "ouro connect embeddings
|
|
287
|
+
usage: "ouro connect embeddings [--agent <name>]",
|
|
288
|
+
example: "ouro connect embeddings",
|
|
289
289
|
},
|
|
290
290
|
"connect teams": {
|
|
291
291
|
description: "Connect Microsoft Teams credentials and enable the Teams sense",
|
|
292
|
-
usage: "ouro connect teams --agent <name>",
|
|
293
|
-
example: "ouro connect teams
|
|
292
|
+
usage: "ouro connect teams [--agent <name>]",
|
|
293
|
+
example: "ouro connect teams",
|
|
294
294
|
},
|
|
295
295
|
"connect bluebubbles": {
|
|
296
296
|
description: "Attach BlueBubbles iMessage to this machine only",
|
|
297
|
-
usage: "ouro connect bluebubbles --agent <name>",
|
|
298
|
-
example: "ouro connect bluebubbles
|
|
297
|
+
usage: "ouro connect bluebubbles [--agent <name>]",
|
|
298
|
+
example: "ouro connect bluebubbles",
|
|
299
299
|
},
|
|
300
300
|
"provider refresh": {
|
|
301
301
|
description: "Reload this agent's provider credentials from its vault into daemon memory",
|
|
302
|
-
usage: "ouro provider refresh --agent <name>",
|
|
303
|
-
example: "ouro provider refresh
|
|
302
|
+
usage: "ouro provider refresh [--agent <name>]",
|
|
303
|
+
example: "ouro provider refresh",
|
|
304
304
|
},
|
|
305
305
|
"vault create": {
|
|
306
306
|
description: "Create an agent credential vault and store local unlock material",
|
|
307
|
-
usage: "ouro vault create --agent <name> --email <email> [--server <url>] [--store <store>]",
|
|
308
|
-
example: "ouro vault create --
|
|
307
|
+
usage: "ouro vault create [--agent <name>] --email <email> [--server <url>] [--store <store>]",
|
|
308
|
+
example: "ouro vault create --email ouroboros@ouro.bot",
|
|
309
309
|
},
|
|
310
310
|
"vault replace": {
|
|
311
311
|
description: "Create an empty agent vault at the stable agent email when no unlock secret or JSON export exists",
|
|
312
|
-
usage: "ouro vault replace --agent <name> [--email <email>] [--server <url>] [--store <store>]",
|
|
313
|
-
example: "ouro vault replace
|
|
312
|
+
usage: "ouro vault replace [--agent <name>] [--email <email>] [--server <url>] [--store <store>]",
|
|
313
|
+
example: "ouro vault replace",
|
|
314
314
|
},
|
|
315
315
|
"vault recover": {
|
|
316
316
|
description: "Create an agent vault at the stable agent email and import local JSON credential exports",
|
|
317
|
-
usage: "ouro vault recover --agent <name> --from <json> [--from <json> ...] [--email <email>] [--server <url>] [--store <store>]",
|
|
318
|
-
example: "ouro vault recover --
|
|
317
|
+
usage: "ouro vault recover [--agent <name>] --from <json> [--from <json> ...] [--email <email>] [--server <url>] [--store <store>]",
|
|
318
|
+
example: "ouro vault recover --from ./credentials.json",
|
|
319
319
|
},
|
|
320
320
|
"vault unlock": {
|
|
321
321
|
description: "Unlock an existing agent credential vault on this machine",
|
|
322
|
-
usage: "ouro vault unlock --agent <name> [--store <store>]",
|
|
323
|
-
example: "ouro vault unlock
|
|
322
|
+
usage: "ouro vault unlock [--agent <name>] [--store <store>]",
|
|
323
|
+
example: "ouro vault unlock",
|
|
324
324
|
},
|
|
325
325
|
"vault status": {
|
|
326
326
|
description: "Show whether this machine can unlock an agent credential vault",
|
|
327
|
-
usage: "ouro vault status --agent <name> [--store <store>]",
|
|
328
|
-
example: "ouro vault status
|
|
327
|
+
usage: "ouro vault status [--agent <name>] [--store <store>]",
|
|
328
|
+
example: "ouro vault status",
|
|
329
329
|
},
|
|
330
330
|
"vault config set": {
|
|
331
331
|
description: "Write runtime configuration into the agent credential vault without printing values",
|
|
332
|
-
usage: "ouro vault config set --agent <name> --key <path> [--value <value>] [--scope agent|machine]",
|
|
333
|
-
example: "ouro vault config set --
|
|
332
|
+
usage: "ouro vault config set [--agent <name>] --key <path> [--value <value>] [--scope agent|machine]",
|
|
333
|
+
example: "ouro vault config set --key teams.clientSecret",
|
|
334
334
|
},
|
|
335
335
|
"vault config status": {
|
|
336
336
|
description: "List runtime configuration keys stored in the agent credential vault",
|
|
337
|
-
usage: "ouro vault config status --agent <name> [--scope agent|machine|all]",
|
|
338
|
-
example: "ouro vault config status --
|
|
337
|
+
usage: "ouro vault config status [--agent <name>] [--scope agent|machine|all]",
|
|
338
|
+
example: "ouro vault config status --scope all",
|
|
339
339
|
},
|
|
340
340
|
};
|
|
341
341
|
// ── Levenshtein distance ──
|
|
@@ -74,25 +74,25 @@ function usage() {
|
|
|
74
74
|
" ouro dev [--repo-path <path>] [--clone [--clone-path <path>]]",
|
|
75
75
|
" ouro stop|down|status|logs|hatch",
|
|
76
76
|
" ouro status --agent <name>",
|
|
77
|
-
" ouro use --agent <name> --lane outward|inner --provider <provider> --model <model> [--force]",
|
|
78
|
-
" ouro check --agent <name> --lane outward|inner",
|
|
77
|
+
" ouro use [--agent <name>] --lane outward|inner --provider <provider> --model <model> [--force]",
|
|
78
|
+
" ouro check [--agent <name>] --lane outward|inner",
|
|
79
79
|
" ouro repair [--agent <name>]",
|
|
80
|
-
" ouro provider refresh --agent <name>",
|
|
80
|
+
" ouro provider refresh [--agent <name>]",
|
|
81
81
|
" ouro outlook [--json]",
|
|
82
82
|
" ouro -v|--version",
|
|
83
|
-
" ouro config model --agent <name> <model-name>",
|
|
84
|
-
" ouro config models --agent <name>",
|
|
85
|
-
" ouro auth --agent <name> [--provider <provider>]",
|
|
86
|
-
" ouro connect [providers|perplexity|embeddings|teams|bluebubbles] --agent <name>",
|
|
87
|
-
" ouro auth verify --agent <name> [--provider <provider>]",
|
|
88
|
-
" ouro auth switch --agent <name> --provider <provider>",
|
|
89
|
-
" ouro vault create --agent <name> --email <email> [--server <url>] [--store <store>]",
|
|
90
|
-
" ouro vault replace --agent <name> [--email <email>] [--server <url>] [--store <store>]",
|
|
91
|
-
" ouro vault recover --agent <name> --from <json> [--from <json>] [--email <email>] [--server <url>] [--store <store>]",
|
|
92
|
-
" ouro vault unlock --agent <name> [--store auto|macos-keychain|windows-dpapi|linux-secret-service|plaintext-file]",
|
|
93
|
-
" ouro vault status --agent <name> [--store auto|macos-keychain|windows-dpapi|linux-secret-service|plaintext-file]",
|
|
94
|
-
" ouro vault config set --agent <name> --key <path> [--value <value>] [--scope agent|machine]",
|
|
95
|
-
" ouro vault config status --agent <name> [--scope agent|machine|all]",
|
|
83
|
+
" ouro config model [--agent <name>] <model-name>",
|
|
84
|
+
" ouro config models [--agent <name>]",
|
|
85
|
+
" ouro auth [--agent <name>] [--provider <provider>]",
|
|
86
|
+
" ouro connect [providers|perplexity|embeddings|teams|bluebubbles] [--agent <name>]",
|
|
87
|
+
" ouro auth verify [--agent <name>] [--provider <provider>]",
|
|
88
|
+
" ouro auth switch [--agent <name>] --provider <provider>",
|
|
89
|
+
" ouro vault create [--agent <name>] --email <email> [--server <url>] [--store <store>]",
|
|
90
|
+
" ouro vault replace [--agent <name>] [--email <email>] [--server <url>] [--store <store>]",
|
|
91
|
+
" ouro vault recover [--agent <name>] --from <json> [--from <json>] [--email <email>] [--server <url>] [--store <store>]",
|
|
92
|
+
" ouro vault unlock [--agent <name>] [--store auto|macos-keychain|windows-dpapi|linux-secret-service|plaintext-file]",
|
|
93
|
+
" ouro vault status [--agent <name>] [--store auto|macos-keychain|windows-dpapi|linux-secret-service|plaintext-file]",
|
|
94
|
+
" ouro vault config set [--agent <name>] --key <path> [--value <value>] [--scope agent|machine]",
|
|
95
|
+
" ouro vault config status [--agent <name>] [--scope agent|machine|all]",
|
|
96
96
|
" ouro chat <agent>",
|
|
97
97
|
" ouro msg --to <agent> [--session <id>] [--task <ref>] <message>",
|
|
98
98
|
" ouro poke <agent> --task <task-id>",
|
|
@@ -100,7 +100,7 @@ function usage() {
|
|
|
100
100
|
" ouro habit list [--agent <name>]",
|
|
101
101
|
" ouro habit create [--agent <name>] <name> [--cadence <interval>]",
|
|
102
102
|
" ouro link <agent> --friend <id> --provider <provider> --external-id <external-id>",
|
|
103
|
-
" ouro bluebubbles replay --agent <name> --message-guid <guid> [--event-type new-message|updated-message] [--json]",
|
|
103
|
+
" ouro bluebubbles replay [--agent <name>] --message-guid <guid> [--event-type new-message|updated-message] [--json]",
|
|
104
104
|
" ouro task board [<status>] [--agent <name>]",
|
|
105
105
|
" ouro task create <title> [--type <type>] [--agent <name>]",
|
|
106
106
|
" ouro task update <id> <status> [--agent <name>]",
|
|
@@ -415,15 +415,21 @@ function parseAuthCommand(args) {
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
/* v8 ignore stop */
|
|
418
|
-
/* v8 ignore next -- defensive: agent always provided in tests @preserve */
|
|
419
|
-
if (!agent)
|
|
420
|
-
throw new Error(`Usage\n${usage()}`);
|
|
421
418
|
if (subcommand === "switch") {
|
|
422
419
|
if (!provider)
|
|
423
420
|
throw new Error(`auth switch requires --provider.\n${usage()}`);
|
|
424
|
-
return
|
|
421
|
+
return {
|
|
422
|
+
kind: "auth.switch",
|
|
423
|
+
...(agent ? { agent } : {}),
|
|
424
|
+
provider,
|
|
425
|
+
...(facing ? { facing } : {}),
|
|
426
|
+
};
|
|
425
427
|
}
|
|
426
|
-
return
|
|
428
|
+
return {
|
|
429
|
+
kind: "auth.verify",
|
|
430
|
+
...(agent ? { agent } : {}),
|
|
431
|
+
...(provider ? { provider } : {}),
|
|
432
|
+
};
|
|
427
433
|
}
|
|
428
434
|
const { agent, rest } = extractAgentFlag(args);
|
|
429
435
|
let provider;
|
|
@@ -437,15 +443,11 @@ function parseAuthCommand(args) {
|
|
|
437
443
|
continue;
|
|
438
444
|
}
|
|
439
445
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
" ouro auth switch --agent <name> --provider <p> Switch active provider",
|
|
446
|
-
].join("\n"));
|
|
447
|
-
}
|
|
448
|
-
return provider ? { kind: "auth.run", agent, provider } : { kind: "auth.run", agent };
|
|
446
|
+
return {
|
|
447
|
+
kind: "auth.run",
|
|
448
|
+
...(agent ? { agent } : {}),
|
|
449
|
+
...(provider ? { provider } : {}),
|
|
450
|
+
};
|
|
449
451
|
}
|
|
450
452
|
function isVaultUnlockStoreKind(value) {
|
|
451
453
|
return value === "auto" || value === "macos-keychain" || value === "windows-dpapi" || value === "linux-secret-service" || value === "plaintext-file";
|
|
@@ -487,7 +489,7 @@ function parseVaultCommand(args) {
|
|
|
487
489
|
}
|
|
488
490
|
const value = rest[i + 1];
|
|
489
491
|
if (!value)
|
|
490
|
-
throw new Error("Usage: ouro vault recover --agent <name> --from <json> [--from <json> ...]");
|
|
492
|
+
throw new Error("Usage: ouro vault recover [--agent <name>] --from <json> [--from <json> ...]");
|
|
491
493
|
sources.push(value);
|
|
492
494
|
i += 1;
|
|
493
495
|
continue;
|
|
@@ -496,15 +498,15 @@ function parseVaultCommand(args) {
|
|
|
496
498
|
generateUnlockSecret = true;
|
|
497
499
|
continue;
|
|
498
500
|
}
|
|
499
|
-
throw new Error("Usage: ouro vault create|replace|recover|unlock|status --agent <name>");
|
|
501
|
+
throw new Error("Usage: ouro vault create|replace|recover|unlock|status [--agent <name>]");
|
|
500
502
|
}
|
|
501
|
-
if (
|
|
502
|
-
throw new Error("Usage: ouro vault create|replace|recover|unlock|status --agent <name>");
|
|
503
|
+
if (sub !== "create" && sub !== "replace" && sub !== "recover" && sub !== "unlock" && sub !== "status") {
|
|
504
|
+
throw new Error("Usage: ouro vault create|replace|recover|unlock|status [--agent <name>]");
|
|
503
505
|
}
|
|
504
506
|
if (sub === "create") {
|
|
505
507
|
return {
|
|
506
508
|
kind: "vault.create",
|
|
507
|
-
agent,
|
|
509
|
+
...(agent ? { agent } : {}),
|
|
508
510
|
...(email ? { email } : {}),
|
|
509
511
|
...(serverUrl ? { serverUrl } : {}),
|
|
510
512
|
...(store ? { store } : {}),
|
|
@@ -514,7 +516,7 @@ function parseVaultCommand(args) {
|
|
|
514
516
|
if (sub === "replace") {
|
|
515
517
|
return {
|
|
516
518
|
kind: "vault.replace",
|
|
517
|
-
agent,
|
|
519
|
+
...(agent ? { agent } : {}),
|
|
518
520
|
...(email ? { email } : {}),
|
|
519
521
|
...(serverUrl ? { serverUrl } : {}),
|
|
520
522
|
...(store ? { store } : {}),
|
|
@@ -523,11 +525,11 @@ function parseVaultCommand(args) {
|
|
|
523
525
|
}
|
|
524
526
|
if (sub === "recover") {
|
|
525
527
|
if (sources.length === 0) {
|
|
526
|
-
throw new Error("Usage: ouro vault recover --agent <name> --from <json> [--from <json> ...]");
|
|
528
|
+
throw new Error("Usage: ouro vault recover [--agent <name>] --from <json> [--from <json> ...]");
|
|
527
529
|
}
|
|
528
530
|
return {
|
|
529
531
|
kind: "vault.recover",
|
|
530
|
-
agent,
|
|
532
|
+
...(agent ? { agent } : {}),
|
|
531
533
|
sources,
|
|
532
534
|
...(email ? { email } : {}),
|
|
533
535
|
...(serverUrl ? { serverUrl } : {}),
|
|
@@ -536,9 +538,9 @@ function parseVaultCommand(args) {
|
|
|
536
538
|
};
|
|
537
539
|
}
|
|
538
540
|
if (sub === "unlock") {
|
|
539
|
-
return { kind: "vault.unlock", agent, ...(store ? { store } : {}) };
|
|
541
|
+
return { kind: "vault.unlock", ...(agent ? { agent } : {}), ...(store ? { store } : {}) };
|
|
540
542
|
}
|
|
541
|
-
return { kind: "vault.status", agent, ...(store ? { store } : {}) };
|
|
543
|
+
return { kind: "vault.status", ...(agent ? { agent } : {}), ...(store ? { store } : {}) };
|
|
542
544
|
}
|
|
543
545
|
function parseVaultConfigCommand(args) {
|
|
544
546
|
const sub = args[0];
|
|
@@ -567,23 +569,23 @@ function parseVaultConfigCommand(args) {
|
|
|
567
569
|
i += 1;
|
|
568
570
|
continue;
|
|
569
571
|
}
|
|
570
|
-
throw new Error("Usage: ouro vault config set --agent <name> --key <path> [--value <value>] OR ouro vault config status --agent <name>");
|
|
572
|
+
throw new Error("Usage: ouro vault config set [--agent <name>] --key <path> [--value <value>] OR ouro vault config status [--agent <name>]");
|
|
571
573
|
}
|
|
572
|
-
if (
|
|
573
|
-
throw new Error("Usage: ouro vault config set --agent <name> --key <path> [--value <value>] OR ouro vault config status --agent <name>");
|
|
574
|
+
if (sub !== "set" && sub !== "status") {
|
|
575
|
+
throw new Error("Usage: ouro vault config set [--agent <name>] --key <path> [--value <value>] OR ouro vault config status [--agent <name>]");
|
|
574
576
|
}
|
|
575
577
|
if (sub === "status") {
|
|
576
578
|
if (key || value) {
|
|
577
|
-
throw new Error("Usage: ouro vault config status --agent <name>");
|
|
579
|
+
throw new Error("Usage: ouro vault config status [--agent <name>]");
|
|
578
580
|
}
|
|
579
|
-
return { kind: "vault.config.status", agent, ...(scope ? { scope } : {}) };
|
|
581
|
+
return { kind: "vault.config.status", ...(agent ? { agent } : {}), ...(scope ? { scope } : {}) };
|
|
580
582
|
}
|
|
581
583
|
if (scope === "all")
|
|
582
584
|
throw new Error("vault config --scope all is only valid for status");
|
|
583
585
|
if (!key) {
|
|
584
|
-
throw new Error("Usage: ouro vault config set --agent <name> --key <path> [--value <value>]");
|
|
586
|
+
throw new Error("Usage: ouro vault config set [--agent <name>] --key <path> [--value <value>]");
|
|
585
587
|
}
|
|
586
|
-
return { kind: "vault.config.set", agent, key, ...(value !== undefined ? { value } : {}), ...(scope ? { scope } : {}) };
|
|
588
|
+
return { kind: "vault.config.set", ...(agent ? { agent } : {}), key, ...(value !== undefined ? { value } : {}), ...(scope ? { scope } : {}) };
|
|
587
589
|
}
|
|
588
590
|
function normalizeConnectTarget(value) {
|
|
589
591
|
if (!value)
|
|
@@ -598,16 +600,14 @@ function normalizeConnectTarget(value) {
|
|
|
598
600
|
return "teams";
|
|
599
601
|
if (value === "bluebubbles" || value === "imessage" || value === "messages")
|
|
600
602
|
return "bluebubbles";
|
|
601
|
-
throw new Error("Usage: ouro connect [providers|perplexity|embeddings|teams|bluebubbles] --agent <name>");
|
|
603
|
+
throw new Error("Usage: ouro connect [providers|perplexity|embeddings|teams|bluebubbles] [--agent <name>]");
|
|
602
604
|
}
|
|
603
605
|
function parseConnectCommand(args) {
|
|
604
606
|
const { agent, rest } = extractAgentFlag(args);
|
|
605
|
-
if (!agent)
|
|
606
|
-
throw new Error("Usage: ouro connect --agent <name> [providers|perplexity|embeddings|teams|bluebubbles]");
|
|
607
607
|
if (rest.length > 1)
|
|
608
|
-
throw new Error("Usage: ouro connect [providers|perplexity|embeddings|teams|bluebubbles] --agent <name>");
|
|
608
|
+
throw new Error("Usage: ouro connect [providers|perplexity|embeddings|teams|bluebubbles] [--agent <name>]");
|
|
609
609
|
const target = normalizeConnectTarget(rest[0]);
|
|
610
|
-
return { kind: "connect", agent, ...(target ? { target } : {}) };
|
|
610
|
+
return { kind: "connect", ...(agent ? { agent } : {}), ...(target ? { target } : {}) };
|
|
611
611
|
}
|
|
612
612
|
function parseProviderUseCommand(args) {
|
|
613
613
|
const { agent, rest: afterAgent } = extractAgentFlag(args);
|
|
@@ -621,7 +621,7 @@ function parseProviderUseCommand(args) {
|
|
|
621
621
|
if (token === "--provider") {
|
|
622
622
|
const value = rest[i + 1];
|
|
623
623
|
if (!isAgentProvider(value))
|
|
624
|
-
throw new Error(
|
|
624
|
+
throw new Error("Usage: ouro use [--agent <name>] --lane outward|inner --provider <provider> --model <model>");
|
|
625
625
|
provider = value;
|
|
626
626
|
i += 1;
|
|
627
627
|
continue;
|
|
@@ -635,15 +635,15 @@ function parseProviderUseCommand(args) {
|
|
|
635
635
|
force = true;
|
|
636
636
|
continue;
|
|
637
637
|
}
|
|
638
|
-
throw new Error("Usage: ouro use --agent <name> --lane outward|inner --provider <provider> --model <model> [--force]");
|
|
638
|
+
throw new Error("Usage: ouro use [--agent <name>] --lane outward|inner --provider <provider> --model <model> [--force]");
|
|
639
639
|
}
|
|
640
640
|
const resolvedLane = lane ?? (facing ? facingToProviderLane(facing) : undefined);
|
|
641
|
-
if (!
|
|
642
|
-
throw new Error("Usage: ouro use --agent <name> --lane outward|inner --provider <provider> --model <model> [--force]");
|
|
641
|
+
if (!resolvedLane || !provider || !model) {
|
|
642
|
+
throw new Error("Usage: ouro use [--agent <name>] --lane outward|inner --provider <provider> --model <model> [--force]");
|
|
643
643
|
}
|
|
644
644
|
return {
|
|
645
645
|
kind: "provider.use",
|
|
646
|
-
agent,
|
|
646
|
+
...(agent ? { agent } : {}),
|
|
647
647
|
lane: resolvedLane,
|
|
648
648
|
provider,
|
|
649
649
|
model,
|
|
@@ -656,12 +656,12 @@ function parseProviderCheckCommand(args) {
|
|
|
656
656
|
const { facing, rest: afterFacing } = extractFacingFlag(afterAgent);
|
|
657
657
|
const { lane, rest } = extractLaneFlag(afterFacing);
|
|
658
658
|
const resolvedLane = lane ?? (facing ? facingToProviderLane(facing) : undefined);
|
|
659
|
-
if (!
|
|
660
|
-
throw new Error("Usage: ouro check --agent <name> --lane outward|inner");
|
|
659
|
+
if (!resolvedLane || rest.length > 0) {
|
|
660
|
+
throw new Error("Usage: ouro check [--agent <name>] --lane outward|inner");
|
|
661
661
|
}
|
|
662
662
|
return {
|
|
663
663
|
kind: "provider.check",
|
|
664
|
-
agent,
|
|
664
|
+
...(agent ? { agent } : {}),
|
|
665
665
|
lane: resolvedLane,
|
|
666
666
|
...(facing ? { legacyFacing: facing } : {}),
|
|
667
667
|
};
|
|
@@ -669,10 +669,10 @@ function parseProviderCheckCommand(args) {
|
|
|
669
669
|
function parseProviderCommand(args) {
|
|
670
670
|
const sub = args[0];
|
|
671
671
|
const { agent, rest } = extractAgentFlag(args.slice(1));
|
|
672
|
-
if (sub === "refresh" &&
|
|
673
|
-
return { kind: "provider.refresh", agent };
|
|
672
|
+
if (sub === "refresh" && rest.length === 0) {
|
|
673
|
+
return { kind: "provider.refresh", ...(agent ? { agent } : {}) };
|
|
674
674
|
}
|
|
675
|
-
throw new Error("Usage: ouro provider refresh --agent <name>");
|
|
675
|
+
throw new Error("Usage: ouro provider refresh [--agent <name>]");
|
|
676
676
|
}
|
|
677
677
|
function parseReminderCommand(args) {
|
|
678
678
|
const { agent, rest: cleaned } = extractAgentFlag(args);
|
|
@@ -836,17 +836,18 @@ function parseConfigCommand(args) {
|
|
|
836
836
|
if (!sub)
|
|
837
837
|
throw new Error(`Usage\n${usage()}`);
|
|
838
838
|
if (sub === "model") {
|
|
839
|
-
if (!agent)
|
|
840
|
-
throw new Error("--agent is required for config model");
|
|
841
839
|
const modelName = rest[0];
|
|
842
840
|
if (!modelName)
|
|
843
|
-
throw new Error(
|
|
844
|
-
return
|
|
841
|
+
throw new Error("Usage: ouro config model [--agent <name>] <model-name>");
|
|
842
|
+
return {
|
|
843
|
+
kind: "config.model",
|
|
844
|
+
...(agent ? { agent } : {}),
|
|
845
|
+
modelName,
|
|
846
|
+
...(facing ? { facing } : {}),
|
|
847
|
+
};
|
|
845
848
|
}
|
|
846
849
|
if (sub === "models") {
|
|
847
|
-
|
|
848
|
-
throw new Error("--agent is required for config models");
|
|
849
|
-
return { kind: "config.models", agent };
|
|
850
|
+
return { kind: "config.models", ...(agent ? { agent } : {}) };
|
|
850
851
|
}
|
|
851
852
|
throw new Error(`Usage\n${usage()}`);
|
|
852
853
|
}
|
|
@@ -937,13 +938,13 @@ function parseSetupCommand(args) {
|
|
|
937
938
|
continue;
|
|
938
939
|
}
|
|
939
940
|
}
|
|
941
|
+
if (args.includes("--agent") && !agent)
|
|
942
|
+
throw new Error("setup requires --agent <name>");
|
|
940
943
|
if (!tool)
|
|
941
944
|
throw new Error("setup requires --tool (claude-code | codex)");
|
|
942
945
|
if (tool !== "claude-code" && tool !== "codex")
|
|
943
946
|
throw new Error(`Unknown tool: ${tool}. Supported: claude-code, codex`);
|
|
944
|
-
|
|
945
|
-
throw new Error("setup requires --agent <name>");
|
|
946
|
-
return { kind: "setup", tool, agent };
|
|
947
|
+
return { kind: "setup", tool, ...(agent ? { agent } : {}) };
|
|
947
948
|
}
|
|
948
949
|
function parseBlueBubblesCommand(args) {
|
|
949
950
|
const subcommand = args[0];
|
|
@@ -976,13 +977,11 @@ function parseBlueBubblesCommand(args) {
|
|
|
976
977
|
continue;
|
|
977
978
|
}
|
|
978
979
|
}
|
|
979
|
-
if (!agent)
|
|
980
|
-
throw new Error("bluebubbles replay requires --agent <name>");
|
|
981
980
|
if (!messageGuid)
|
|
982
981
|
throw new Error("bluebubbles replay requires --message-guid <guid>");
|
|
983
982
|
return {
|
|
984
983
|
kind: "bluebubbles.replay",
|
|
985
|
-
agent,
|
|
984
|
+
...(agent ? { agent } : {}),
|
|
986
985
|
messageGuid,
|
|
987
986
|
eventType,
|
|
988
987
|
...(json ? { json: true } : {}),
|
|
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.createTaskModule = createTaskModule;
|
|
36
37
|
exports.getTaskModule = getTaskModule;
|
|
37
38
|
exports.resetTaskModule = resetTaskModule;
|
|
38
39
|
const fs = __importStar(require("fs"));
|
|
@@ -67,8 +68,12 @@ function removeRuntimeFrontmatter(frontmatter) {
|
|
|
67
68
|
return clean;
|
|
68
69
|
}
|
|
69
70
|
class FileTaskModule {
|
|
71
|
+
root;
|
|
72
|
+
constructor(root = (0, scanner_1.getTaskRoot)()) {
|
|
73
|
+
this.root = root;
|
|
74
|
+
}
|
|
70
75
|
scan() {
|
|
71
|
-
return (0, scanner_1.scanTasks)(
|
|
76
|
+
return (0, scanner_1.scanTasks)(this.root);
|
|
72
77
|
}
|
|
73
78
|
getBoard() {
|
|
74
79
|
return (0, board_1.buildTaskBoard)(this.scan());
|
|
@@ -94,7 +99,7 @@ class FileTaskModule {
|
|
|
94
99
|
const collection = (0, transitions_1.canonicalCollectionForTaskType)(type);
|
|
95
100
|
const stem = `${formatStemTimestamp()}-${(0, config_1.slugify)(input.title).slice(0, 64) || "task"}`;
|
|
96
101
|
const filename = `${stem}.md`;
|
|
97
|
-
const root =
|
|
102
|
+
const root = this.root;
|
|
98
103
|
const filePath = path.join(root, collection, filename);
|
|
99
104
|
const today = formatDate();
|
|
100
105
|
const frontmatter = {
|
|
@@ -194,7 +199,7 @@ class FileTaskModule {
|
|
|
194
199
|
return (0, middleware_1.validateSpawn)(task, spawnType);
|
|
195
200
|
}
|
|
196
201
|
fix(options) {
|
|
197
|
-
return (0, fix_1.applyFixes)(options,
|
|
202
|
+
return (0, fix_1.applyFixes)(options, this.root);
|
|
198
203
|
}
|
|
199
204
|
detectStale(thresholdDays) {
|
|
200
205
|
return (0, lifecycle_1.detectStaleTasks)(this.scan(), thresholdDays);
|
|
@@ -216,9 +221,12 @@ class FileTaskModule {
|
|
|
216
221
|
}
|
|
217
222
|
}
|
|
218
223
|
let taskModule = null;
|
|
224
|
+
function createTaskModule(root = (0, scanner_1.getTaskRoot)()) {
|
|
225
|
+
return new FileTaskModule(root);
|
|
226
|
+
}
|
|
219
227
|
function getTaskModule() {
|
|
220
228
|
if (!taskModule) {
|
|
221
|
-
taskModule =
|
|
229
|
+
taskModule = createTaskModule();
|
|
222
230
|
}
|
|
223
231
|
return taskModule;
|
|
224
232
|
}
|