@ouro.bot/cli 0.1.0-alpha.255 → 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 +15 -0
- package/dist/heart/daemon/cli-exec.js +15 -13
- package/dist/senses/cli/image-paste.js +2 -2
- package/dist/senses/cli/ouro-tui.js +12 -20
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
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
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"version": "0.1.0-alpha.256",
|
|
13
|
+
"changes": [
|
|
14
|
+
"fix(tui): cursor renders as inverse character (not inserted block) \u2014 matches standard terminal cursor behavior.",
|
|
15
|
+
"fix(tui): Alt+Enter via ESC-timing (50ms window) instead of raw stdin handler that interfered with arrow keys.",
|
|
16
|
+
"fix(tui): image path regex now matches backslash-escaped spaces from macOS drag-drop."
|
|
17
|
+
]
|
|
18
|
+
},
|
|
4
19
|
{
|
|
5
20
|
"version": "0.1.0-alpha.255",
|
|
6
21
|
"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
|
-
|
|
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 {
|
|
@@ -113,8 +113,8 @@ function formatImageRef(n) {
|
|
|
113
113
|
function replacePathsWithRefs(input) {
|
|
114
114
|
const images = new Map();
|
|
115
115
|
// Match absolute paths starting with / that end with an image extension.
|
|
116
|
-
// Allow backslash-escaped
|
|
117
|
-
const pathRegex = /(\/(?:[^\s
|
|
116
|
+
// Allow backslash-escaped spaces (like `\ ` from macOS drag-drop).
|
|
117
|
+
const pathRegex = /(\/(?:[^\s]|\\ )+\.(?:png|jpe?g|gif|webp))/gi;
|
|
118
118
|
let counter = 0;
|
|
119
119
|
const text = input.replace(pathRegex, (match) => {
|
|
120
120
|
counter++;
|
|
@@ -163,23 +163,10 @@ function InputArea({ onSubmit, onCtrlC, history, queuedInputs, onPopQueue, agent
|
|
|
163
163
|
const cursorRef = (0, react_1.useRef)(0);
|
|
164
164
|
const historyIdx = (0, react_1.useRef)(-1);
|
|
165
165
|
const savedInput = (0, react_1.useRef)("");
|
|
166
|
-
//
|
|
167
|
-
// \x1b\r into separate
|
|
168
|
-
|
|
169
|
-
(0, react_1.
|
|
170
|
-
if (!stdin)
|
|
171
|
-
return;
|
|
172
|
-
const onData = (data) => {
|
|
173
|
-
const str = data.toString("utf-8");
|
|
174
|
-
if (str === "\x1b\r" || str === "\x1b\n") {
|
|
175
|
-
const before = inputRef.current.slice(0, cursorRef.current);
|
|
176
|
-
const after = inputRef.current.slice(cursorRef.current);
|
|
177
|
-
updateInput(before + "\n" + after, cursorRef.current + 1);
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
stdin.on("data", onData);
|
|
181
|
-
return () => { stdin.off("data", onData); };
|
|
182
|
-
}, [stdin]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
166
|
+
// Track last ESC timestamp for Alt+Enter detection.
|
|
167
|
+
// Ink 3.2 splits \x1b\r into separate escape + return events.
|
|
168
|
+
// We detect the pattern by checking if Return arrives within 50ms of Escape.
|
|
169
|
+
const lastEscTime = (0, react_1.useRef)(0);
|
|
183
170
|
const tooltipTimerRef = (0, react_1.useRef)(null);
|
|
184
171
|
(0, react_1.useEffect)(() => () => {
|
|
185
172
|
if (tooltipTimerRef.current)
|
|
@@ -223,6 +210,7 @@ function InputArea({ onSubmit, onCtrlC, history, queuedInputs, onPopQueue, agent
|
|
|
223
210
|
// Any non-Ctrl-C input clears tooltip
|
|
224
211
|
setTooltip("");
|
|
225
212
|
if (key.escape) {
|
|
213
|
+
lastEscTime.current = Date.now();
|
|
226
214
|
if (inputRef.current) {
|
|
227
215
|
updateInput("");
|
|
228
216
|
historyIdx.current = -1;
|
|
@@ -243,8 +231,10 @@ function InputArea({ onSubmit, onCtrlC, history, queuedInputs, onPopQueue, agent
|
|
|
243
231
|
return;
|
|
244
232
|
}
|
|
245
233
|
if (key.return) {
|
|
246
|
-
// Alt+Enter
|
|
247
|
-
|
|
234
|
+
// Alt+Enter: detect via key.meta OR recent ESC (within 50ms — Ink splits \x1b\r)
|
|
235
|
+
const recentEsc = (Date.now() - lastEscTime.current) < 50;
|
|
236
|
+
if (key.meta || key.shift || recentEsc) {
|
|
237
|
+
lastEscTime.current = 0;
|
|
248
238
|
const before = inputRef.current.slice(0, cursorRef.current);
|
|
249
239
|
const after = inputRef.current.slice(cursorRef.current);
|
|
250
240
|
updateInput(before + "\n" + after, cursorRef.current + 1);
|
|
@@ -399,7 +389,9 @@ function InputArea({ onSubmit, onCtrlC, history, queuedInputs, onPopQueue, agent
|
|
|
399
389
|
});
|
|
400
390
|
const isMultiline = input.includes("\n");
|
|
401
391
|
const inputLines = input.split("\n");
|
|
402
|
-
return ((0, jsx_runtime_1.jsxs)(ink_1.Box, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { dimColor: true, children: "─".repeat(termWidth()) }), isMultiline ? ((0, jsx_runtime_1.jsx)(ink_1.Box, { flexDirection: "column", children: inputLines.map((line, i) => ((0, jsx_runtime_1.jsxs)(ink_1.Box, { children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.teal, bold: true, children: i === 0 ? ") " : "· " }), (0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.bone, children: line }), i === inputLines.length - 1 ? (cursorVisible ? (0, jsx_runtime_1.jsx)(ink_1.Text, {
|
|
392
|
+
return ((0, jsx_runtime_1.jsxs)(ink_1.Box, { flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { dimColor: true, children: "─".repeat(termWidth()) }), isMultiline ? ((0, jsx_runtime_1.jsx)(ink_1.Box, { flexDirection: "column", children: inputLines.map((line, i) => ((0, jsx_runtime_1.jsxs)(ink_1.Box, { children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.teal, bold: true, children: i === 0 ? ") " : "· " }), (0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.bone, children: line }), i === inputLines.length - 1 ? (cursorVisible ? (0, jsx_runtime_1.jsx)(ink_1.Text, { inverse: true, children: " " }) : (0, jsx_runtime_1.jsx)(ink_1.Text, { children: " " })) : null] }, i))) })) : ((0, jsx_runtime_1.jsxs)(ink_1.Box, { children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.teal, bold: true, children: ") " }), !input && queuedInputs.length > 0 ? ((0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.shadow, children: "Press up to edit queued messages" })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.bone, children: input.slice(0, cursorPos) }), cursorVisible
|
|
393
|
+
? (0, jsx_runtime_1.jsx)(ink_1.Text, { inverse: true, children: input[cursorPos] ?? " " })
|
|
394
|
+
: (0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.bone, children: input[cursorPos] ?? " " }), (0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.bone, children: input.slice(cursorPos + 1) })] }))] })), (0, jsx_runtime_1.jsx)(ink_1.Text, { dimColor: true, children: "─".repeat(termWidth()) }), (0, jsx_runtime_1.jsxs)(ink_1.Box, { children: [(0, jsx_runtime_1.jsxs)(ink_1.Text, { dimColor: true, children: [" ", agentName, model ? ` · ${model}` : "", " \u00B7 /help"] }), (0, jsx_runtime_1.jsx)(ink_1.Box, { flexGrow: 1 }), tooltip ? (0, jsx_runtime_1.jsx)(ink_1.Text, { dimColor: true, children: tooltip }) : (0, jsx_runtime_1.jsx)(ink_1.Text, { dimColor: true, children: "opt+enter for newline" })] })] }));
|
|
403
395
|
}
|
|
404
396
|
// ─── Main TUI Component ─────────────────────────────────────────────
|
|
405
397
|
function OuroTui({ agentName, model, completedMessages, inputHistory, queuedInputs, live, elapsedSeconds, contextPercent, onSubmit, onCtrlC, onPopQueue, cwd, resumeInfo, onImageMap, }) {
|