@ouro.bot/cli 0.1.0-alpha.407 → 0.1.0-alpha.408
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 +10 -0
- package/dist/heart/auth/auth-flow.js +4 -1
- package/dist/heart/daemon/agent-config-check.js +8 -0
- package/dist/heart/daemon/cli-exec.js +4 -0
- package/dist/heart/daemon/readiness-repair.js +25 -0
- package/dist/repertoire/credential-access.js +7 -3
- package/dist/repertoire/vault-unlock.js +18 -0
- package/package.json +2 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
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.408",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Existing agents without a `vault` block in `agent.json` now fail fast with explicit `ouro vault create --agent <agent>` guidance instead of silently deriving a stable vault account and misreporting missing provider credentials.",
|
|
8
|
+
"`ouro auth`, `ouro up`, and `ouro repair` now treat a missing agent vault locator as a first-class readiness state with create/recover choices, then continue through the normal provider-auth repair path after the vault exists.",
|
|
9
|
+
"Runtime credential access now requires an explicit agent vault locator before opening Bitwarden or Vaultwarden, which keeps provider, runtime, travel, and tool credential flows truthful for pre-vault agent migrations.",
|
|
10
|
+
"Added regression coverage for missing-vault-locator auth, provider readiness, guided repair, and the real Bitwarden-backed auth path, plus the default local `spawnSync` fallback used by Linux secure-store probing.",
|
|
11
|
+
"`@ouro.bot/cli` and the `ouro.bot` wrapper are version-synced for the pre-vault agent locator repair release."
|
|
12
|
+
]
|
|
13
|
+
},
|
|
4
14
|
{
|
|
5
15
|
"version": "0.1.0-alpha.407",
|
|
6
16
|
"changes": [
|
|
@@ -389,7 +389,10 @@ async function runRuntimeAuthFlow(input, deps = {}) {
|
|
|
389
389
|
writeAuthProgress(input, `checking ${input.agentName}'s vault access...`);
|
|
390
390
|
const vault = await (0, provider_credentials_1.refreshProviderCredentialPool)(input.agentName);
|
|
391
391
|
if (!vault.ok && vault.reason === "unavailable") {
|
|
392
|
-
|
|
392
|
+
const fix = (0, vault_unlock_1.isCredentialVaultNotConfiguredError)(vault.error)
|
|
393
|
+
? (0, vault_unlock_1.vaultCreateRecoverFix)(input.agentName, `Then retry 'ouro auth --agent ${input.agentName} --provider ${input.provider}'.`)
|
|
394
|
+
: (0, vault_unlock_1.vaultUnlockReplaceRecoverFix)(input.agentName, `Then retry 'ouro auth --agent ${input.agentName} --provider ${input.provider}'.`);
|
|
395
|
+
throw new Error(`${vault.error}\n${fix}`);
|
|
393
396
|
}
|
|
394
397
|
const credentials = await collectRuntimeAuthCredentials(input, deps);
|
|
395
398
|
let credentialPath;
|
|
@@ -252,6 +252,14 @@ function invalidPoolResult(agentName, lane, provider, model, pool) {
|
|
|
252
252
|
issue: (0, readiness_repair_1.vaultLockedIssue)(agentName),
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
+
if (pool.reason === "unavailable" && (0, vault_unlock_1.isCredentialVaultNotConfiguredError)(pool.error)) {
|
|
256
|
+
return {
|
|
257
|
+
ok: false,
|
|
258
|
+
error: `${lane} provider ${provider} model ${model} cannot read provider credentials because ${agentName}'s credential vault is not configured in agent.json.`,
|
|
259
|
+
fix: (0, vault_unlock_1.vaultCreateRecoverFix)(agentName, `Then run 'ouro auth --agent ${agentName} --provider ${provider}' and rerun 'ouro up'.`),
|
|
260
|
+
issue: (0, readiness_repair_1.vaultUnconfiguredIssue)(agentName),
|
|
261
|
+
};
|
|
262
|
+
}
|
|
255
263
|
if (pool.reason === "invalid") {
|
|
256
264
|
return {
|
|
257
265
|
ok: false,
|
|
@@ -1396,6 +1396,10 @@ async function readinessReportForAgent(agent, deps) {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
}
|
|
1398
1398
|
async function executeReadinessRepairAction(agent, action, deps) {
|
|
1399
|
+
if (action.kind === "vault-create") {
|
|
1400
|
+
await executeVaultCreate({ kind: "vault.create", agent }, deps);
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1399
1403
|
if (action.kind === "vault-unlock") {
|
|
1400
1404
|
await executeVaultUnlock({ kind: "vault.unlock", agent }, deps);
|
|
1401
1405
|
return;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.vaultLockedIssue = vaultLockedIssue;
|
|
4
|
+
exports.vaultUnconfiguredIssue = vaultUnconfiguredIssue;
|
|
4
5
|
exports.providerCredentialMissingIssue = providerCredentialMissingIssue;
|
|
5
6
|
exports.providerLiveCheckFailedIssue = providerLiveCheckFailedIssue;
|
|
6
7
|
exports.genericReadinessIssue = genericReadinessIssue;
|
|
@@ -39,6 +40,30 @@ function vaultLockedIssue(agentName) {
|
|
|
39
40
|
],
|
|
40
41
|
};
|
|
41
42
|
}
|
|
43
|
+
function vaultUnconfiguredIssue(agentName) {
|
|
44
|
+
return {
|
|
45
|
+
kind: "vault-unconfigured",
|
|
46
|
+
severity: "blocked",
|
|
47
|
+
actor: "human-required",
|
|
48
|
+
summary: `${agentName}: vault not configured`,
|
|
49
|
+
detail: "This bundle does not have a vault locator in agent.json yet. Create the agent vault before authenticating providers.",
|
|
50
|
+
actions: [
|
|
51
|
+
{
|
|
52
|
+
kind: "vault-create",
|
|
53
|
+
label: "Create this agent's vault",
|
|
54
|
+
command: `ouro vault create --agent ${agentName}`,
|
|
55
|
+
actor: "human-required",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
kind: "vault-recover",
|
|
59
|
+
label: "Recover from JSON export",
|
|
60
|
+
command: `ouro vault recover --agent ${agentName} --from <json>`,
|
|
61
|
+
actor: "human-required",
|
|
62
|
+
executable: false,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
42
67
|
function providerCredentialMissingIssue(input) {
|
|
43
68
|
return {
|
|
44
69
|
kind: "provider-credentials-missing",
|
|
@@ -58,10 +58,10 @@ function loadVaultSectionForAgent(agentName) {
|
|
|
58
58
|
const configPath = path.join(identity.getAgentRoot(agentName), "agent.json");
|
|
59
59
|
try {
|
|
60
60
|
const parsed = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
61
|
-
return parsed.vault;
|
|
61
|
+
return { configPath, vault: parsed.vault };
|
|
62
62
|
}
|
|
63
63
|
catch {
|
|
64
|
-
return
|
|
64
|
+
return { configPath };
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
function bitwardenAppDataDir(agentName, vaultConfig) {
|
|
@@ -77,7 +77,11 @@ function getCredentialStore(agentNameInput) {
|
|
|
77
77
|
if (agentName === "SerpentGuide") {
|
|
78
78
|
throw new Error("SerpentGuide does not have a persistent credential vault; hatch bootstrap uses provider credentials in memory only.");
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const { configPath, vault } = loadVaultSectionForAgent(agentName);
|
|
81
|
+
if (!vault || typeof vault.email !== "string" || vault.email.trim().length === 0) {
|
|
82
|
+
throw new Error((0, vault_unlock_1.credentialVaultNotConfiguredError)(agentName, configPath));
|
|
83
|
+
}
|
|
84
|
+
const vaultConfig = identity.resolveVaultConfig(agentName, vault);
|
|
81
85
|
const cacheKey = `${agentName}:${vaultConfig.serverUrl}:${vaultConfig.email}`;
|
|
82
86
|
const cached = stores.get(cacheKey);
|
|
83
87
|
if (cached)
|
|
@@ -34,6 +34,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.vaultUnlockReplaceRecoverFix = vaultUnlockReplaceRecoverFix;
|
|
37
|
+
exports.credentialVaultNotConfiguredError = credentialVaultNotConfiguredError;
|
|
38
|
+
exports.isCredentialVaultNotConfiguredError = isCredentialVaultNotConfiguredError;
|
|
39
|
+
exports.vaultCreateRecoverFix = vaultCreateRecoverFix;
|
|
37
40
|
exports.resolveVaultUnlockStore = resolveVaultUnlockStore;
|
|
38
41
|
exports.readVaultUnlockSecret = readVaultUnlockSecret;
|
|
39
42
|
exports.storeVaultUnlockSecret = storeVaultUnlockSecret;
|
|
@@ -45,6 +48,7 @@ const os = __importStar(require("node:os"));
|
|
|
45
48
|
const path = __importStar(require("node:path"));
|
|
46
49
|
const runtime_1 = require("../nerves/runtime");
|
|
47
50
|
const VAULT_UNLOCK_SERVICE = "ouro.vault";
|
|
51
|
+
const CREDENTIAL_VAULT_NOT_CONFIGURED_PREFIX = "credential vault is not configured in ";
|
|
48
52
|
const PLAINTEXT_UNLOCK_DIR = path.join(".ouro-cli", "vault-unlock");
|
|
49
53
|
const WINDOWS_DPAPI_UNLOCK_DIR = path.join(".ouro-cli", "vault-unlock-dpapi");
|
|
50
54
|
const SUPPORTED_STORES = ["auto", "macos-keychain", "windows-dpapi", "linux-secret-service", "plaintext-file"];
|
|
@@ -104,6 +108,20 @@ function vaultUnlockReplaceRecoverFix(agentName, nextStep = "Then run 'ouro up'
|
|
|
104
108
|
nextStep,
|
|
105
109
|
].join(" ");
|
|
106
110
|
}
|
|
111
|
+
function credentialVaultNotConfiguredError(agentName, configPath) {
|
|
112
|
+
return (`${CREDENTIAL_VAULT_NOT_CONFIGURED_PREFIX}${configPath}. ` +
|
|
113
|
+
`Run 'ouro vault create --agent ${agentName}' to create this agent's vault before loading or storing credentials.`);
|
|
114
|
+
}
|
|
115
|
+
function isCredentialVaultNotConfiguredError(message) {
|
|
116
|
+
return message.includes(CREDENTIAL_VAULT_NOT_CONFIGURED_PREFIX);
|
|
117
|
+
}
|
|
118
|
+
function vaultCreateRecoverFix(agentName, nextStep = "Then run 'ouro up' again.") {
|
|
119
|
+
return [
|
|
120
|
+
`Run 'ouro vault create --agent ${agentName}' to create this agent's vault.`,
|
|
121
|
+
`If you still have a local JSON credential export from an earlier alpha, run 'ouro vault recover --agent ${agentName} --from <json>' instead.`,
|
|
122
|
+
nextStep,
|
|
123
|
+
].join(" ");
|
|
124
|
+
}
|
|
107
125
|
function lostUnlockSecretGuidance(config) {
|
|
108
126
|
if (!config.agentName) {
|
|
109
127
|
return "If nobody saved that unlock secret, run `ouro vault replace --agent <agent>` to create a new empty vault and re-enter credentials. If you do have a local JSON credential export, run `ouro vault recover --agent <agent> --from <json>` to import it.";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.408",
|
|
4
4
|
"main": "dist/heart/daemon/ouro-entry.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"cli": "dist/heart/daemon/ouro-bot-entry.js",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"test:coverage": "node scripts/run-coverage-gate.cjs",
|
|
33
33
|
"build": "tsc && (cd packages/outlook-ui && npm install --ignore-scripts 2>/dev/null && npm run build && cp -r dist ../../dist/outlook-ui) || echo 'outlook-ui build skipped'",
|
|
34
34
|
"lint": "eslint src/",
|
|
35
|
+
"release:preflight": "node scripts/release-preflight.cjs",
|
|
35
36
|
"release:smoke": "node scripts/release-smoke.cjs",
|
|
36
37
|
"audit:nerves": "npm run build && node dist/nerves/coverage/cli-main.js"
|
|
37
38
|
},
|