@x-otto/cli 0.0.1-alpha.40 → 0.0.1-alpha.41

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.
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./feedback-F6_POHpG.js";export{e as runFeedbackCommand};
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e,r as t,t as n}from"./build-id-DV9hBn0e.js";import{t as r}from"./create-host-app-BXQ8bU-B.js";import{platform as i,release as a}from"node:os";import{execFile as o}from"node:child_process";import{openBrowser as s}from"@x-otto/shared";import{SDK_VERSION as c}from"@x-otto/env";import{promisify as l}from"node:util";const u=l(o);function d(e){let t=e.trim().replace(/\.git$/,``),n=t.match(/^git@[^:]+:(.+)$/);if(n)return n[1];let r=t.match(/^https?:\/\/[^/]+\/(.+)$/);if(r)return r[1]}async function f(e){try{let{stdout:t}=await u(`git`,[`remote`,`get-url`,`origin`],{cwd:e,timeout:5e3});return d(t)}catch{return}}async function p(e){return e.configuredRepo?e.configuredRepo:await f(e.cwd)||e.cliRepoArg}function m(r){return[`- otto version: ${c} (build ${t}, ${e}@${n})`,`- Node: ${process.version}`,`- OS: ${i()} ${process.arch} ${a()}`,`- Model: ${r??`(none configured)`}`].join(`
3
- `)}function h(e){let t,n,r,i,a,o=!1,s=(t,n)=>{let r=e[t+1];if(r===void 0||r.startsWith(`--`))throw Error(`${n} requires a value`);return r};for(let c=0;c<e.length;c++){let l=e[c];l===`--title`?(t=s(c,`--title`),c++):l===`--reproduce`?(n=s(c,`--reproduce`),c++):l===`--expected`?(r=s(c,`--expected`),c++):l===`--actual`?(i=s(c,`--actual`),c++):l===`--repo`?(a=s(c,`--repo`),c++):l===`--browser`&&(o=!0)}return{title:t,reproduce:n,expected:r,actual:i,repo:a,browser:o}}function g(e){e(`Usage: otto feedback --title <title> [options]
4
-
5
- Report an issue or send feedback via GitHub (non-interactive — for scripting/CI).
6
- For an interactive prompt-driven flow, use the "/feedback" command inside otto.
7
-
8
- Options:
9
- --title <title> Short issue title (required)
10
- --reproduce <text> Steps to reproduce (optional)
11
- --expected <text> Expected behavior (optional)
12
- --actual <text> Actual behavior (optional)
13
- --repo <owner/repo> Target repository (defaults to feedback_repo config, then git remote origin)
14
- --browser Skip the gh CLI channel and always use the browser fallback
15
- --help Show this help
16
- `)}async function _(e,t={}){let n=t.stdout??(e=>process.stdout.write(e)),i=t.stderr??(e=>process.stderr.write(e));if(e[0]===`help`||e[0]===`--help`)return g(n),0;let a;try{a=h(e)}catch(e){return i(`otto feedback: ${e instanceof Error?e.message:String(e)}\n`),1}if(!a.title)return i(`otto feedback: --title is required (see --help)
17
- `),1;let o=t.app??r({logger:{name:`otto-feedback`,level:`error`,destination:`stderr`},workspaceDir:t.projectDir,projectConfigPath:t.configPath});try{await o.start()}catch(e){return i(`otto feedback: failed to start app: ${e instanceof Error?e.message:String(e)}\n`),1}try{let e=o.feedbackRegistry.get();if(!e)return i(`otto feedback: feedback plugin is not available (disabled or not installed)
18
- `),1;let r=await p({configuredRepo:o.settings.get(`feedback_repo`),cliRepoArg:a.repo,cwd:t.projectDir??process.cwd()});if(!r)return i(`otto feedback: could not resolve a target repository — pass --repo or set "feedback_repo" in .otto/config.json
19
- `),1;let c=m(void 0),l={title:a.title,reproduce:a.reproduce,expected:a.expected,actual:a.actual,envInfo:c,repo:r};if(!a.browser&&e.submitIssueViaGh){let t=await e.submitIssueViaGh(l);if(t.ok)return n(`Issue created: ${t.url}\n`),0;i(`otto feedback: gh channel failed (${t.kind}) — falling back to browser\n`)}let u=e.buildIssueUrl?.(l);return u?(s(u),n(`Opened: ${u}\n`),0):(i(`otto feedback: feedback plugin does not support buildIssueUrl
20
- `),1)}finally{await o.stop()}}export{p as n,_ as r,m as t};
21
- //# sourceMappingURL=feedback-F6_POHpG.js.map