@dotaz/cli 0.0.30 → 0.0.31

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.
Files changed (2) hide show
  1. package/bin/dotaz.js +1 -1
  2. package/package.json +1 -1
package/bin/dotaz.js CHANGED
@@ -18,7 +18,7 @@ ${io(t,n)}`,mode:"sql"}}function Pn(e,n,t){let o=n.trim().replace(/;\s*$/,"");sw
18
18
  `,stderr:`output exceeds --max-bytes (${n}) and cannot be truncated safely
19
19
  `}}function tt(e,n){let t=n.quiet?[]:e.notes??[],o=t.length>0?`${t.join(`
20
20
  `)}
21
- `:"",r=n.format==="json"?Ro(e.json,n.maxBytes):sn(e.sections,n.format,n.maxBytes);return{stdout:r.stdout,stderr:o+r.stderr}}var ot="0.0.30";async function N(e,n){if(!n)return;try{await Bun.write(e,n)}catch{}}async function Oo(e){let n=mn(e,(p)=>Oe(p)?.flags);if(O(n.args,"version"))return await N(Bun.stdout,`dotaz ${ot}
21
+ `:"",r=n.format==="json"?Ro(e.json,n.maxBytes):sn(e.sections,n.format,n.maxBytes);return{stdout:r.stdout,stderr:o+r.stderr}}var ot="0.0.31";async function N(e,n){if(!n)return;try{await Bun.write(e,n)}catch{}}async function Oo(e){let n=mn(e,(p)=>Oe(p)?.flags);if(O(n.args,"version"))return await N(Bun.stdout,`dotaz ${ot}
22
22
  `),m.ok;if(!n.command)return await N(Bun.stdout,ln(ot)),O(n.args,"help")?m.ok:m.usage;let t=Oe(n.command);if(!t)throw new b(m.usage,`Unknown command "${n.command}"`);if(O(n.args,"help"))return await N(Bun.stdout,un(t.name,{...t.help,flags:t.flags})),m.ok;let o=dn(n.args),r=nt({explicitFile:g(n.args,"endpoint"),instancePid:y(n.args,"instance")}),s=new ye(r.endpoint,pn(n.args)),i=new Le(s),a=await t.run({args:n.args,output:o,client:s,app:i,endpoint:r}),u=tt(a.output,o);return await N(Bun.stdout,u.stdout),await N(Bun.stderr,u.stderr),a.exitCode??m.ok}var me=m.ok;try{me=await Oo(process.argv.slice(2))}catch(e){if(e instanceof b){if(await N(Bun.stderr,`dotaz: ${e.message}
23
23
  `),e.hint)await N(Bun.stderr,`${e.hint}
24
24
  `);else if(e.exitCode===m.usage)await N(Bun.stderr,"Run `dotaz --help` for usage.\n");me=e.exitCode}else await N(Bun.stderr,`dotaz: unexpected error: ${B(e)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotaz/cli",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "Agent CLI for the running Dotaz desktop database client",
5
5
  "type": "module",
6
6
  "license": "MIT",