@ouro.bot/cli 0.1.0-alpha.256 → 0.1.0-alpha.257

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,13 @@
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.257",
6
+ "changes": [
7
+ "test(daemon): convert all `daemon-cli.test.ts` auth/thoughts/config tests to use `os.tmpdir()` via the new `createTmpBundle()` helper. Previously these tests wrote real bundles to `~/AgentBundles/auth-local-${Date.now()}.ouro` etc., relying on `try/finally` cleanup that doesn't fire on test interruption \u2014 leaking bundle directories into the developer's home and inflating noise on the running daemon. The `REAL_BUNDLES_WRITE_ALLOWLIST` ratchet in `test-isolation.contract.test.ts` is now empty.",
8
+ "fix(daemon/cli-exec): plumb `bundlesRoot` and `secretsRoot` deps through the auth.run / auth.verify / auth.switch / config.model / config.models / thoughts handlers so tests can route reads/writes to a tmpdir without monkey-patching the identity module. Production code paths still default to `getAgentBundlesRoot()` and `~/.agentsecrets`."
9
+ ]
10
+ },
4
11
  {
5
12
  "version": "0.1.0-alpha.256",
6
13
  "changes": [
@@ -1345,7 +1345,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
1345
1345
  }
1346
1346
  // ── auth (local, no daemon socket needed) ──
1347
1347
  if (command.kind === "auth.run") {
1348
- const provider = command.provider ?? (0, auth_flow_1.readAgentConfigForAgent)(command.agent).config.humanFacing.provider;
1348
+ const provider = command.provider ?? (0, auth_flow_1.readAgentConfigForAgent)(command.agent, deps.bundlesRoot).config.humanFacing.provider;
1349
1349
  /* v8 ignore next -- tests always inject runAuthFlow; default is for production @preserve */
1350
1350
  const authRunner = deps.runAuthFlow ?? (await Promise.resolve().then(() => __importStar(require("../auth/auth-flow")))).runRuntimeAuthFlow;
1351
1351
  const result = await authRunner({
@@ -1359,7 +1359,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
1359
1359
  // Verify the credentials actually work by pinging the provider
1360
1360
  /* v8 ignore start -- integration: real API ping after auth @preserve */
1361
1361
  try {
1362
- const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent);
1362
+ const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent, { secretsRoot: deps.secretsRoot });
1363
1363
  const status = await verifyProviderCredentials(provider, secrets.providers);
1364
1364
  deps.writeStdout(`${provider}: ${status}`);
1365
1365
  }
@@ -1372,7 +1372,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
1372
1372
  // ── auth verify (local, no daemon socket needed) ──
1373
1373
  /* v8 ignore start -- auth verify/switch: tested in daemon-cli.test.ts but v8 traces differ in CI @preserve */
1374
1374
  if (command.kind === "auth.verify") {
1375
- const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent);
1375
+ const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent, { secretsRoot: deps.secretsRoot });
1376
1376
  const providers = secrets.providers;
1377
1377
  if (command.provider) {
1378
1378
  const status = await verifyProviderCredentials(command.provider, providers);
@@ -1391,7 +1391,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
1391
1391
  }
1392
1392
  // ── auth switch (local, no daemon socket needed) ──
1393
1393
  if (command.kind === "auth.switch") {
1394
- const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent);
1394
+ const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent, { secretsRoot: deps.secretsRoot });
1395
1395
  const providerSecrets = secrets.providers[command.provider];
1396
1396
  if (!providerSecrets || !hasStoredCredentials(command.provider, providerSecrets)) {
1397
1397
  const message = `no credentials stored for ${command.provider}. Run \`ouro auth --agent ${command.agent} --provider ${command.provider}\` first.`;
@@ -1406,11 +1406,11 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
1406
1406
  return message;
1407
1407
  }
1408
1408
  if (command.facing) {
1409
- (0, auth_flow_1.writeAgentProviderSelection)(command.agent, command.facing, command.provider);
1409
+ (0, auth_flow_1.writeAgentProviderSelection)(command.agent, command.facing, command.provider, deps.bundlesRoot);
1410
1410
  }
1411
1411
  else {
1412
- (0, auth_flow_1.writeAgentProviderSelection)(command.agent, "human", command.provider);
1413
- (0, auth_flow_1.writeAgentProviderSelection)(command.agent, "agent", command.provider);
1412
+ (0, auth_flow_1.writeAgentProviderSelection)(command.agent, "human", command.provider, deps.bundlesRoot);
1413
+ (0, auth_flow_1.writeAgentProviderSelection)(command.agent, "agent", command.provider, deps.bundlesRoot);
1414
1414
  }
1415
1415
  const message = `switched ${command.agent} to ${command.provider} (verified working)`;
1416
1416
  deps.writeStdout(message);
@@ -1420,14 +1420,14 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
1420
1420
  // ── config models (local, no daemon socket needed) ──
1421
1421
  /* v8 ignore start -- config models: tested via daemon-cli.test.ts @preserve */
1422
1422
  if (command.kind === "config.models") {
1423
- const { config } = (0, auth_flow_1.readAgentConfigForAgent)(command.agent);
1423
+ const { config } = (0, auth_flow_1.readAgentConfigForAgent)(command.agent, deps.bundlesRoot);
1424
1424
  const provider = config.humanFacing.provider;
1425
1425
  if (provider !== "github-copilot") {
1426
1426
  const message = `model listing not available for ${provider} — check provider documentation.`;
1427
1427
  deps.writeStdout(message);
1428
1428
  return message;
1429
1429
  }
1430
- const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent);
1430
+ const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent, { secretsRoot: deps.secretsRoot });
1431
1431
  const ghConfig = secrets.providers["github-copilot"];
1432
1432
  if (!ghConfig.githubToken || !ghConfig.baseUrl) {
1433
1433
  throw new Error(`github-copilot credentials not configured. Run \`ouro auth --agent ${command.agent} --provider github-copilot\` first.`);
@@ -1454,10 +1454,10 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
1454
1454
  if (command.kind === "config.model") {
1455
1455
  const facing = command.facing ?? "human";
1456
1456
  // Validate model availability for github-copilot before writing
1457
- const { config } = (0, auth_flow_1.readAgentConfigForAgent)(command.agent);
1457
+ const { config } = (0, auth_flow_1.readAgentConfigForAgent)(command.agent, deps.bundlesRoot);
1458
1458
  const facingConfig = facing === "human" ? config.humanFacing : config.agentFacing;
1459
1459
  if (facingConfig.provider === "github-copilot") {
1460
- const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent);
1460
+ const { secrets } = (0, auth_flow_1.loadAgentSecrets)(command.agent, { secretsRoot: deps.secretsRoot });
1461
1461
  const ghConfig = secrets.providers["github-copilot"];
1462
1462
  if (ghConfig.githubToken && ghConfig.baseUrl) {
1463
1463
  const fetchFn = deps.fetchImpl ?? fetch;
@@ -1482,7 +1482,7 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
1482
1482
  }
1483
1483
  }
1484
1484
  }
1485
- const { provider, previousModel } = (0, auth_flow_1.writeAgentModel)(command.agent, facing, command.modelName);
1485
+ const { provider, previousModel } = (0, auth_flow_1.writeAgentModel)(command.agent, facing, command.modelName, { bundlesRoot: deps.bundlesRoot });
1486
1486
  const message = previousModel
1487
1487
  ? `updated ${command.agent} model on ${provider}: ${previousModel} → ${command.modelName}`
1488
1488
  : `set ${command.agent} model on ${provider}: ${command.modelName}`;
@@ -1569,7 +1569,9 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
1569
1569
  if (command.kind === "thoughts") {
1570
1570
  try {
1571
1571
  const agentName = command.agent ?? (0, identity_1.getAgentName)();
1572
- const agentRoot = path.join((0, identity_1.getAgentBundlesRoot)(), `${agentName}.ouro`);
1572
+ /* v8 ignore next -- production fallback: tests always inject bundlesRoot via createTmpBundle @preserve */
1573
+ const bundlesRoot = deps.bundlesRoot ?? (0, identity_1.getAgentBundlesRoot)();
1574
+ const agentRoot = path.join(bundlesRoot, `${agentName}.ouro`);
1573
1575
  const sessionFilePath = (0, thoughts_1.getInnerDialogSessionPath)(agentRoot);
1574
1576
  if (command.json) {
1575
1577
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.256",
3
+ "version": "0.1.0-alpha.257",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",