@ouro.bot/cli 0.1.0-alpha.366 → 0.1.0-alpha.368
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.368",
|
|
6
|
+
"changes": [
|
|
7
|
+
"`ouro up` interactive repair prompts now treat `yes`, `YES`, and whitespace-padded affirmative answers as yes for both provider auth and vault unlock repairs.",
|
|
8
|
+
"Interactive repair now uses one shared affirmative-answer parser instead of duplicating raw `y` checks across repair branches.",
|
|
9
|
+
"`@ouro.bot/cli` and the `ouro.bot` wrapper are version-synced for the repair answer parsing release."
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"version": "0.1.0-alpha.367",
|
|
14
|
+
"changes": [
|
|
15
|
+
"`ouro up` repair prompts now extract exact `ouro auth` and `ouro vault unlock` commands from fix hints instead of swallowing trailing prose such as `then run ouro up again`.",
|
|
16
|
+
"Interactive repair tests now assert exact prompt text for quoted and unquoted repair commands, covering both provider auth and vault unlock flows.",
|
|
17
|
+
"`@ouro.bot/cli` and the `ouro.bot` wrapper are version-synced for the repair command parsing release."
|
|
18
|
+
]
|
|
19
|
+
},
|
|
4
20
|
{
|
|
5
21
|
"version": "0.1.0-alpha.366",
|
|
6
22
|
"changes": [
|
|
@@ -31,14 +31,31 @@ function extractProviderFromFixHint(fixHint) {
|
|
|
31
31
|
return undefined;
|
|
32
32
|
return provider;
|
|
33
33
|
}
|
|
34
|
+
function escapeRegExp(value) {
|
|
35
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
36
|
+
}
|
|
37
|
+
function cleanExtractedCommand(command) {
|
|
38
|
+
const cleaned = command?.trim().replace(/[`'",;:.)]+$/g, "").trim();
|
|
39
|
+
return cleaned && cleaned.length > 0 ? cleaned : undefined;
|
|
40
|
+
}
|
|
41
|
+
function extractRepairCommand(fixHint, commandPrefix) {
|
|
42
|
+
const escapedPrefix = escapeRegExp(commandPrefix);
|
|
43
|
+
const commandBody = `${escapedPrefix}(?=\\s|$)[^\`'"]*`;
|
|
44
|
+
const quoted = fixHint.match(new RegExp(`[\`'"](${commandBody})[\`'"]`, "i"))?.[1];
|
|
45
|
+
const unquoted = fixHint.match(new RegExp(`(${escapedPrefix}(?=\\s|$)[^\\n,;.]+)`, "i"))?.[1];
|
|
46
|
+
return cleanExtractedCommand(quoted) ?? cleanExtractedCommand(unquoted);
|
|
47
|
+
}
|
|
34
48
|
function authCommandFor(degraded) {
|
|
35
|
-
const command = degraded.fixHint
|
|
49
|
+
const command = extractRepairCommand(degraded.fixHint, "ouro auth");
|
|
36
50
|
return command && command.length > 0 ? command : `ouro auth --agent ${degraded.agent}`;
|
|
37
51
|
}
|
|
38
52
|
function vaultUnlockCommandFor(degraded) {
|
|
39
|
-
const command = degraded.fixHint
|
|
53
|
+
const command = extractRepairCommand(degraded.fixHint, "ouro vault unlock");
|
|
40
54
|
return command && command.length > 0 ? command : `ouro vault unlock --agent ${degraded.agent}`;
|
|
41
55
|
}
|
|
56
|
+
function isAffirmativeAnswer(answer) {
|
|
57
|
+
return /^(y|yes)$/i.test(answer.trim());
|
|
58
|
+
}
|
|
42
59
|
async function runInteractiveRepair(degraded, deps) {
|
|
43
60
|
(0, runtime_1.emitNervesEvent)({
|
|
44
61
|
level: "info",
|
|
@@ -55,7 +72,7 @@ async function runInteractiveRepair(degraded, deps) {
|
|
|
55
72
|
if (isVaultUnlockIssue(entry)) {
|
|
56
73
|
const unlockCommand = vaultUnlockCommandFor(entry);
|
|
57
74
|
const answer = await deps.promptInput(`run \`${unlockCommand}\` now? [y/n] `);
|
|
58
|
-
if (answer
|
|
75
|
+
if (isAffirmativeAnswer(answer)) {
|
|
59
76
|
try {
|
|
60
77
|
if (!deps.runVaultUnlock) {
|
|
61
78
|
deps.writeStdout(`fix hint for ${entry.agent}: ${entry.fixHint}`);
|
|
@@ -83,7 +100,7 @@ async function runInteractiveRepair(degraded, deps) {
|
|
|
83
100
|
const provider = extractProviderFromFixHint(entry.fixHint);
|
|
84
101
|
const authCommand = authCommandFor(entry);
|
|
85
102
|
const answer = await deps.promptInput(`run \`${authCommand}\` now? [y/n] `);
|
|
86
|
-
if (answer
|
|
103
|
+
if (isAffirmativeAnswer(answer)) {
|
|
87
104
|
try {
|
|
88
105
|
if (provider) {
|
|
89
106
|
await deps.runAuthFlow(entry.agent, provider);
|