@ouro.bot/cli 0.1.0-alpha.136 → 0.1.0-alpha.137

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.137",
6
+ "changes": [
7
+ "ouro dev auto-discovers existing repo at ~/Projects/ouroboros or prompts for clone path.",
8
+ "ouro dev never clones without user consent — prompts in interactive mode, errors in non-interactive.",
9
+ "ouro dev --repo-path errors clearly when the specified path has no repo."
10
+ ]
11
+ },
4
12
  {
5
13
  "version": "0.1.0-alpha.136",
6
14
  "changes": [
@@ -2002,22 +2002,49 @@ async function runOuroCli(args, deps = createDefaultOuroCliDeps()) {
2002
2002
  /* v8 ignore next -- defensive: existsSync always injected in tests @preserve */
2003
2003
  const checkExists = deps.existsSync ?? fs.existsSync;
2004
2004
  /* v8 ignore next -- repo resolution dispatched to v8-ignored helper @preserve */
2005
- const repoCwd = resolveDevRepoCwd(command, checkExists, deps);
2006
- const entryPath = path.join(repoCwd, "dist", "heart", "daemon", "daemon-entry.js");
2005
+ let repoCwd = resolveDevRepoCwd(command, checkExists, deps);
2006
+ let entryPath = path.join(repoCwd, "dist", "heart", "daemon", "daemon-entry.js");
2007
2007
  if (!checkExists(entryPath) || !checkExists(path.join(repoCwd, ".git"))) {
2008
- const lines = [
2009
- "no harness repo found at " + repoCwd,
2010
- "",
2011
- "options:",
2012
- " ouro dev --repo-path /path/to/ouroboros use an existing checkout",
2013
- " ouro dev --clone fresh clone to ~/Projects/ouroboros",
2014
- " ouro dev --clone --clone-path /somewhere fresh clone to a custom path",
2015
- "",
2016
- "if you have the repo, cd into it and run: npm run build && ouro dev",
2017
- ];
2018
- const message = lines.join("\n");
2019
- deps.writeStdout(message);
2020
- return message;
2008
+ if (command.repoPath) {
2009
+ // Explicit --repo-path didn't have a valid repo — error
2010
+ const message = `no harness repo found at ${repoCwd}. run npm run build first.`;
2011
+ deps.writeStdout(message);
2012
+ return message;
2013
+ }
2014
+ /* v8 ignore start -- auto-clone: interactive prompt + existing repo discovery + real git/npm @preserve */
2015
+ const defaultClonePath = path.join(os.homedir(), "Projects", "ouroboros");
2016
+ if (checkExists(path.join(defaultClonePath, ".git"))) {
2017
+ deps.writeStdout(`found existing repo at ${defaultClonePath}`);
2018
+ try {
2019
+ repoCwd = resolveClonePath({ clonePath: defaultClonePath }, checkExists, deps);
2020
+ entryPath = path.join(repoCwd, "dist", "heart", "daemon", "daemon-entry.js");
2021
+ }
2022
+ catch (err) {
2023
+ const message = err instanceof Error ? err.message : String(err);
2024
+ deps.writeStdout(message);
2025
+ return message;
2026
+ }
2027
+ }
2028
+ else if (deps.promptInput) {
2029
+ deps.writeStdout("no harness repo found.");
2030
+ const answer = await deps.promptInput(`already have a checkout? enter its path, or press enter to clone to ${defaultClonePath}: `);
2031
+ const cloneTarget = answer.trim() || defaultClonePath;
2032
+ try {
2033
+ repoCwd = resolveClonePath({ clonePath: cloneTarget }, checkExists, deps);
2034
+ entryPath = path.join(repoCwd, "dist", "heart", "daemon", "daemon-entry.js");
2035
+ }
2036
+ catch (err) {
2037
+ const message = err instanceof Error ? err.message : String(err);
2038
+ deps.writeStdout(message);
2039
+ return message;
2040
+ }
2041
+ }
2042
+ else {
2043
+ const message = `no harness repo found. run: ouro dev --repo-path /path/to/ouroboros`;
2044
+ deps.writeStdout(message);
2045
+ return message;
2046
+ }
2047
+ /* v8 ignore stop */
2021
2048
  }
2022
2049
  /* v8 ignore start -- defensive: ensureDaemonBootPersistence always injected in tests @preserve */
2023
2050
  if (deps.ensureDaemonBootPersistence) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.136",
3
+ "version": "0.1.0-alpha.137",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",