@ouro.bot/cli 0.1.0-alpha.366 → 0.1.0-alpha.367
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,14 @@
|
|
|
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.367",
|
|
6
|
+
"changes": [
|
|
7
|
+
"`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`.",
|
|
8
|
+
"Interactive repair tests now assert exact prompt text for quoted and unquoted repair commands, covering both provider auth and vault unlock flows.",
|
|
9
|
+
"`@ouro.bot/cli` and the `ouro.bot` wrapper are version-synced for the repair command parsing release."
|
|
10
|
+
]
|
|
11
|
+
},
|
|
4
12
|
{
|
|
5
13
|
"version": "0.1.0-alpha.366",
|
|
6
14
|
"changes": [
|
|
@@ -31,12 +31,26 @@ 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
|
}
|
|
42
56
|
async function runInteractiveRepair(degraded, deps) {
|