@ouro.bot/cli 0.1.0-alpha.367 → 0.1.0-alpha.369
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,22 @@
|
|
|
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.369",
|
|
6
|
+
"changes": [
|
|
7
|
+
"`ouro up` now offers runnable local repairs such as `ouro vault unlock` or `ouro auth` before optional AI-assisted diagnosis, avoiding a model call when the deterministic fix is already known.",
|
|
8
|
+
"Agentic repair no longer repeats the deterministic repair prompt after diagnosis when that prompt was already offered first.",
|
|
9
|
+
"`@ouro.bot/cli` and the `ouro.bot` wrapper are version-synced for the deterministic-before-AI repair release."
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"version": "0.1.0-alpha.368",
|
|
14
|
+
"changes": [
|
|
15
|
+
"`ouro up` interactive repair prompts now treat `yes`, `YES`, and whitespace-padded affirmative answers as yes for both provider auth and vault unlock repairs.",
|
|
16
|
+
"Interactive repair now uses one shared affirmative-answer parser instead of duplicating raw `y` checks across repair branches.",
|
|
17
|
+
"`@ouro.bot/cli` and the `ouro.bot` wrapper are version-synced for the repair answer parsing release."
|
|
18
|
+
]
|
|
19
|
+
},
|
|
4
20
|
{
|
|
5
21
|
"version": "0.1.0-alpha.367",
|
|
6
22
|
"changes": [
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Agentic repair flow for degraded agents detected during `ouro up`.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Runs known local repair prompts first, then offers AI-assisted diagnosis
|
|
6
|
+
* when no local repair was attempted and a working LLM provider is available.
|
|
7
7
|
* This is a lightweight integration: one diagnostic LLM call, not a chat loop.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.createAgenticDiagnosisProviderRuntime = createAgenticDiagnosisProviderRuntime;
|
|
11
11
|
exports.runAgenticRepair = runAgenticRepair;
|
|
12
12
|
const runtime_1 = require("../../nerves/runtime");
|
|
13
|
+
const interactive_repair_1 = require("./interactive-repair");
|
|
13
14
|
const provider_ping_1 = require("../provider-ping");
|
|
14
15
|
function buildSystemPrompt(degraded) {
|
|
15
16
|
const agentList = degraded
|
|
@@ -51,6 +52,9 @@ function makeInteractiveRepairDeps(deps) {
|
|
|
51
52
|
runVaultUnlock: deps.runVaultUnlock,
|
|
52
53
|
};
|
|
53
54
|
}
|
|
55
|
+
async function runDeterministicRepair(degraded, deps) {
|
|
56
|
+
return deps.runInteractiveRepair(degraded, makeInteractiveRepairDeps(deps));
|
|
57
|
+
}
|
|
54
58
|
function discoveredProviderModel(provider) {
|
|
55
59
|
const model = provider.providerConfig.model?.trim();
|
|
56
60
|
return model ? model : undefined;
|
|
@@ -109,6 +113,13 @@ async function runAgenticRepair(degraded, deps) {
|
|
|
109
113
|
if (degraded.length === 0) {
|
|
110
114
|
return { repairsAttempted: false, usedAgentic: false };
|
|
111
115
|
}
|
|
116
|
+
const hasLocalRepair = degraded.some(interactive_repair_1.hasRunnableInteractiveRepair);
|
|
117
|
+
if (hasLocalRepair) {
|
|
118
|
+
const interactiveResult = await runDeterministicRepair(degraded, deps);
|
|
119
|
+
if (interactiveResult.repairsAttempted) {
|
|
120
|
+
return { repairsAttempted: true, usedAgentic: false };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
112
123
|
// Try to discover a working provider for agentic diagnosis
|
|
113
124
|
let discoveredProvider = null;
|
|
114
125
|
try {
|
|
@@ -133,7 +144,10 @@ async function runAgenticRepair(degraded, deps) {
|
|
|
133
144
|
message: "no working provider found, falling back to deterministic repair",
|
|
134
145
|
meta: {},
|
|
135
146
|
});
|
|
136
|
-
|
|
147
|
+
if (hasLocalRepair) {
|
|
148
|
+
return { repairsAttempted: false, usedAgentic: false };
|
|
149
|
+
}
|
|
150
|
+
const interactiveResult = await runDeterministicRepair(degraded, deps);
|
|
137
151
|
return { repairsAttempted: interactiveResult.repairsAttempted, usedAgentic: false };
|
|
138
152
|
}
|
|
139
153
|
// Offer agentic diagnosis
|
|
@@ -147,7 +161,10 @@ async function runAgenticRepair(degraded, deps) {
|
|
|
147
161
|
message: "user declined agentic diagnosis",
|
|
148
162
|
meta: {},
|
|
149
163
|
});
|
|
150
|
-
|
|
164
|
+
if (hasLocalRepair) {
|
|
165
|
+
return { repairsAttempted: false, usedAgentic: false };
|
|
166
|
+
}
|
|
167
|
+
const interactiveResult = await runDeterministicRepair(degraded, deps);
|
|
151
168
|
return { repairsAttempted: interactiveResult.repairsAttempted, usedAgentic: false };
|
|
152
169
|
}
|
|
153
170
|
// User accepted — run agentic diagnosis then fall through to deterministic repair
|
|
@@ -174,7 +191,9 @@ async function runAgenticRepair(degraded, deps) {
|
|
|
174
191
|
});
|
|
175
192
|
}
|
|
176
193
|
// Always fall through to deterministic repair for actionable fixes
|
|
177
|
-
const interactiveResult =
|
|
194
|
+
const interactiveResult = hasLocalRepair
|
|
195
|
+
? { repairsAttempted: false }
|
|
196
|
+
: await runDeterministicRepair(degraded, deps);
|
|
178
197
|
(0, runtime_1.emitNervesEvent)({
|
|
179
198
|
level: "info",
|
|
180
199
|
component: "daemon",
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* issue patterns and prompt the user for repair actions.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.hasRunnableInteractiveRepair = hasRunnableInteractiveRepair;
|
|
9
10
|
exports.runInteractiveRepair = runInteractiveRepair;
|
|
10
11
|
const runtime_1 = require("../../nerves/runtime");
|
|
11
12
|
const identity_1 = require("../identity");
|
|
@@ -21,6 +22,9 @@ function isVaultUnlockIssue(degraded) {
|
|
|
21
22
|
function isConfigError(degraded) {
|
|
22
23
|
return degraded.fixHint.length > 0 && !isVaultUnlockIssue(degraded) && !isCredentialIssue(degraded);
|
|
23
24
|
}
|
|
25
|
+
function hasRunnableInteractiveRepair(degraded) {
|
|
26
|
+
return isVaultUnlockIssue(degraded) || isCredentialIssue(degraded);
|
|
27
|
+
}
|
|
24
28
|
function isAgentProvider(value) {
|
|
25
29
|
return Object.prototype.hasOwnProperty.call(identity_1.PROVIDER_CREDENTIALS, value);
|
|
26
30
|
}
|
|
@@ -53,6 +57,9 @@ function vaultUnlockCommandFor(degraded) {
|
|
|
53
57
|
const command = extractRepairCommand(degraded.fixHint, "ouro vault unlock");
|
|
54
58
|
return command && command.length > 0 ? command : `ouro vault unlock --agent ${degraded.agent}`;
|
|
55
59
|
}
|
|
60
|
+
function isAffirmativeAnswer(answer) {
|
|
61
|
+
return /^(y|yes)$/i.test(answer.trim());
|
|
62
|
+
}
|
|
56
63
|
async function runInteractiveRepair(degraded, deps) {
|
|
57
64
|
(0, runtime_1.emitNervesEvent)({
|
|
58
65
|
level: "info",
|
|
@@ -69,7 +76,7 @@ async function runInteractiveRepair(degraded, deps) {
|
|
|
69
76
|
if (isVaultUnlockIssue(entry)) {
|
|
70
77
|
const unlockCommand = vaultUnlockCommandFor(entry);
|
|
71
78
|
const answer = await deps.promptInput(`run \`${unlockCommand}\` now? [y/n] `);
|
|
72
|
-
if (answer
|
|
79
|
+
if (isAffirmativeAnswer(answer)) {
|
|
73
80
|
try {
|
|
74
81
|
if (!deps.runVaultUnlock) {
|
|
75
82
|
deps.writeStdout(`fix hint for ${entry.agent}: ${entry.fixHint}`);
|
|
@@ -97,7 +104,7 @@ async function runInteractiveRepair(degraded, deps) {
|
|
|
97
104
|
const provider = extractProviderFromFixHint(entry.fixHint);
|
|
98
105
|
const authCommand = authCommandFor(entry);
|
|
99
106
|
const answer = await deps.promptInput(`run \`${authCommand}\` now? [y/n] `);
|
|
100
|
-
if (answer
|
|
107
|
+
if (isAffirmativeAnswer(answer)) {
|
|
101
108
|
try {
|
|
102
109
|
if (provider) {
|
|
103
110
|
await deps.runAuthFlow(entry.agent, provider);
|