@oracle-agent/oracle 0.15.0 → 0.17.0
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/dist/assets/profiles/oracle/SOUL.md +14 -0
- package/dist/bin/desk-server.mjs +17 -16
- package/dist/bin/oracle-data-mcp.mjs +7 -6
- package/dist/bin/oracle-public-server.mjs +4 -4
- package/dist/bin/oracle-route.mjs +9 -9
- package/dist/bin/oracle-scan.mjs +9 -9
- package/dist/bin/oracle.mjs +20 -17
- package/dist/cli/commands/auth.mjs +12 -12
- package/dist/cli/commands/bootstrap.mjs +7 -7
- package/dist/cli/commands/chain.mjs +15 -15
- package/dist/cli/commands/chat.mjs +34 -34
- package/dist/cli/commands/doctor.mjs +5 -5
- package/dist/cli/commands/eval.mjs +18 -0
- package/dist/cli/commands/fees.mjs +4 -4
- package/dist/cli/commands/mcp.mjs +46 -22
- package/dist/cli/commands/model.mjs +37 -37
- package/dist/cli/commands/plugins.mjs +35 -35
- package/dist/cli/commands/setup.mjs +27 -27
- package/dist/cli/commands/sign.mjs +19 -2
- package/dist/cli/commands/strategy.mjs +18 -0
- package/dist/cli/commands/swap.mjs +19 -19
- package/dist/data/desk-data.mjs +13 -13
- package/dist/index.mjs +18 -18
- package/dist/router/index.mjs +2 -2
- package/dist/scanner/index.mjs +4 -4
- package/dist/strategy/index.mjs +3 -0
- package/package.json +2 -1
- package/public/oracle-splash/_variants/ice.html +3 -3
- package/public/oracle-splash/_variants/ivory.html +3 -3
- package/public/oracle-splash/downloads/index.html +4 -4
- package/public/oracle-splash/index.html +8 -9
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
`)}var
|
|
3
|
-
`),0;let
|
|
1
|
+
import a from"node:fs";import c from"node:path";import{createHash as Y}from"node:crypto";import{spawnSync as y}from"node:child_process";import x from"node:fs";import M from"node:os";import m from"node:path";import{fileURLToPath as B}from"node:url";var V=m.dirname(B(import.meta.url)),oe=m.resolve(V,"../..");function _(){return process.env.ORACLE_FAKE_HOME||M.homedir()}function T(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function S(){return T()?process.env.ORACLE_CONFIG_DIR||m.join(_(),".config","oracle"):m.join(_(),".config","oracle")}function F(){return m.join(S(),"desk.json")}function K(){return m.join(S(),"env")}function h({force:t=!1}={}){if(h._done&&!t)return h._result||null;h._done=!0;let n={},e=(s,r)=>{if(r==null)return;let i=String(r).trim();i&&(process.env[s]!=null&&String(process.env[s]).trim()!==""||(process.env[s]=i,n[s]=i))};try{let s=K();if(x.existsSync(s))for(let r of x.readFileSync(s,"utf8").split(/\r?\n/)){let i=r.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!i||i[2].startsWith("#"))continue;let u=i[2];(u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"))&&(u=u.slice(1,-1)),e(i[1],u)}}catch{}try{let s=F();if(x.existsSync(s)){let r=JSON.parse(x.readFileSync(s,"utf8"));r&&typeof r=="object"&&(e("ORACLE_DESK_URL",r.deskUrl||r.dataUrl||r.url),e("ORACLE_DATA_URL",r.dataUrl||r.deskUrl||r.url),e("ORACLE_API_URL",r.apiUrl||r.dataUrl||r.deskUrl),e("ORACLE_PUBLIC_URL",r.publicUrl||r.deskUrl||r.dataUrl),e("ORACLE_EXEC_URL",r.execUrl),e("MAD_DESK_URL",r.deskUrl||r.dataUrl))}}catch{}let o=process.env.ORACLE_DESK_URL||process.env.ORACLE_DATA_URL||"";return o&&(e("ORACLE_DESK_URL",o),e("ORACLE_DATA_URL",o),e("ORACLE_API_URL",o),e("ORACLE_PUBLIC_URL",o),e("MAD_DESK_URL",o)),h._result=Object.keys(n).length?n:null,h._result}try{h()}catch{}function R(t){return x.mkdirSync(t,{recursive:!0}),t}var W="0.19.0",j=`hermes-agent==${W}`,A=[3,11],w=[3,14],b="3.13",k="0.12.1",U=Object.freeze({posix:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${k}/uv-installer.sh`,sha256:"d3f5412d38c99f9d024901843bf98206f0d2c6dbe64df40d0b740e2751ca62c1"}),windows:Object.freeze({url:`https://github.com/astral-sh/uv/releases/download/${k}/uv-installer.ps1`,sha256:"b9ec035151bfbb11d616dbd69886498d885551489eddf095ea3c0ad59f640eb0"})});function z(t,{windows:n=process.platform==="win32"}={}){let e=Buffer.isBuffer(t)?t:Buffer.from(t),o=n?U.windows:U.posix,s=Y("sha256").update(e).digest("hex"),r=e.toString("utf8");return s===o.sha256&&r.length>=1e3&&r.includes(k)}function p(){return c.join(S(),"runtime")}function P(){return c.join(p(),"venv")}function $(t){let n=process.platform==="win32"?"Scripts":"bin",e=process.platform==="win32"?`${t}.exe`:t;return c.join(P(),n,e)}function g(){return $("hermes")}function J(){let t=$("python3");return a.existsSync(t)?t:$("python")}function E(){return c.join(p(),"uv",process.platform==="win32"?"uv.exe":"uv")}function v(t){let n=process.platform==="win32"&&!c.extname(t)?["",".exe",".cmd",".bat"]:[""];for(let e of(process.env.PATH||"").split(c.delimiter))if(e)for(let o of n){let s=c.join(e,`${t}${o}`);try{if(a.existsSync(s))return s}catch{}}return null}function X(t){let n=/Python (\d+)\.(\d+)\.(\d+)/.exec(t||"");return n?[Number(n[1]),Number(n[2]),Number(n[3])]:null}function G(t){if(!t)return!1;let[n,e]=t;return!(n<A[0]||n===A[0]&&e<A[1]||n>w[0]||n===w[0]&&e>=w[1])}function C(){let t=[process.env.ORACLE_PYTHON,"python3.13","python3.12","python3.11","python3","python"].filter(Boolean);for(let n of t){let e=c.isAbsolute(n)?a.existsSync(n)?n:null:v(n);if(!e)continue;let o=y(e,["--version"],{encoding:"utf8",timeout:15e3}),s=X(`${o.stdout||""}${o.stderr||""}`);if(G(s))return{bin:e,version:s.join("."),source:"host"}}return null}function D(){return process.env.ORACLE_UV_BIN||v("uv")||(a.existsSync(c.join(_(),".local","bin","uv"))?c.join(_(),".local","bin","uv"):null)||(a.existsSync(E())?E():null)}function Z(t,n){let e=["const fs=require('node:fs');","const [url,dest]=process.argv.slice(1);","fetch(url).then(r=>{if(!r.ok)throw new Error('http '+r.status);return r.arrayBuffer()})",".then(b=>fs.writeFileSync(dest,Buffer.from(b)))",".catch(e=>{console.error(e.message);process.exit(1)});"].join("");return y(process.execPath,["-e",e,t,n],{encoding:"utf8",timeout:2*6e4})}function Q({quiet:t=!1}={}){let n=D();if(n)return{ok:!0,bin:n,reused:!0};R(p());let e=process.platform==="win32",o=c.join(p(),e?"uv-install.ps1":"uv-install.sh"),s=e?U.windows:U.posix,r=Z(s.url,o);if(r.status!==0)return{ok:!1,reason:`could not download the uv installer (${r.status})`,stderr:(r.stderr||"").slice(-800)};let i=a.readFileSync(o);if(!z(i,{windows:e}))return{ok:!1,reason:`uv ${k} installer checksum mismatch`};let u=c.dirname(E());R(u);let d=e?v("powershell.exe")||v("powershell"):v("sh")||"/bin/sh";if(!d)return{ok:!1,reason:e?"PowerShell not found":"sh not found"};let f=y(d,e?["-NoProfile","-ExecutionPolicy","Bypass","-File",o]:[o],{stdio:t?"pipe":"inherit",encoding:"utf8",timeout:5*6e4,env:{...process.env,UV_INSTALL_DIR:u,UV_NO_MODIFY_PATH:"1"}});return f.status!==0||!a.existsSync(E())?{ok:!1,reason:`uv install failed (${f.status})`,stderr:(f.stderr||"").slice(-800)}:{ok:!0,bin:E(),reused:!1}}function O({quiet:t=!1}={}){let n=Q({quiet:t});if(!n.ok)return n;let e=n.bin,o={...process.env,UV_PYTHON_INSTALL_DIR:c.join(p(),"python"),UV_CACHE_DIR:c.join(p(),"cache")},s=y(e,["python","install","--no-bin",b],{stdio:t?"pipe":"inherit",encoding:"utf8",timeout:15*6e4,env:o});if(s.status!==0)return{ok:!1,reason:`uv python install ${b} failed (${s.status})`,stderr:(s.stderr||"").slice(-800)};let r=y(e,["python","find",b],{encoding:"utf8",timeout:6e4,env:o}),i=(r.stdout||"").trim().split(/\r?\n/)[0];return r.status!==0||!i||!a.existsSync(i)?{ok:!1,reason:`uv could not locate python ${b}`}:{ok:!0,bin:i,version:b,source:"uv"}}function q(){if(process.env.ORACLE_HERMES_BIN)return{ok:!0,bin:process.env.ORACLE_HERMES_BIN,source:"env"};let t=v("hermes");if(t)return{ok:!0,bin:t,source:"path"};let n=g();return a.existsSync(n)?{ok:!0,bin:n,source:"managed"}:{ok:!1,bin:null,source:null}}function I(){let t=q(),n=C();return{hermes:t,managedVenv:P(),managedInstalled:a.existsSync(g()),hostPython:n,uv:D()}}function L(t,n,{quiet:e}){return y(t,n,{stdio:e?"pipe":"inherit",encoding:"utf8",timeout:20*6e4})}function H({quiet:t=!1,upgrade:n=!1}={}){let e=C();if(!e){let l=O({quiet:t});if(l.ok)e={bin:l.bin,version:l.version,source:"uv"};else return{ok:!1,reason:`no supported python found (need 3.11-3.13) and uv could not provide one: ${l.reason}. install uv (https://docs.astral.sh/uv) or python 3.13, then re-run 'oracle bootstrap'`}}R(p());let o=P();if(a.existsSync(g())&&!n)return{ok:!0,bin:g(),reused:!0};if(!a.existsSync(c.join(o,"pyvenv.cfg"))){let l=L(e.bin,["-m","venv",o],{quiet:t});if(l.status!==0&&e.source!=="uv"){a.rmSync(o,{recursive:!0,force:!0});let f=O({quiet:t});if(f.ok)e={bin:f.bin,version:f.version,source:"uv"},l=L(e.bin,["-m","venv",o],{quiet:t});else return{ok:!1,reason:`python -m venv failed (${l.status}) and uv fallback failed: ${f.reason}`,stderr:(l.stderr||"").slice(-800)}}if(l.status!==0)return{ok:!1,reason:`isolated python -m venv failed (${l.status})`,stderr:(l.stderr||"").slice(-800)}}let r=J();if(!a.existsSync(r))return{ok:!1,reason:`venv python missing at ${r}`};let i=["-m","pip","install","--disable-pip-version-check"];n&&i.push("--upgrade"),i.push(j);let u=L(r,i,{quiet:t});if(u.status!==0)return{ok:!1,reason:`pip install ${j} failed (${u.status})`,stderr:(u.stderr||"").slice(-1200)};let d=g();return a.existsSync(d)?{ok:!0,bin:d,reused:!1,python:e.version}:{ok:!1,reason:`hermes entrypoint not found after install (${d})`}}function N(){return["oracle bootstrap - optionally install an isolated Hermes compatibility runtime",""," oracle bootstrap install into ~/.config/oracle/runtime/venv"," oracle bootstrap --upgrade upgrade the managed runtime"," oracle bootstrap --status show what runtime oracle would use"," oracle bootstrap --json machine-readable status","","notes:"," a hermes on PATH always wins; bootstrap never touches system python"," read/prepare commands (chain, scan, route, data) never need this"].join(`
|
|
2
|
+
`)}var de={name:"bootstrap",summary:"optionally install a Hermes compatibility runtime",group:"read",usage:N(),async run(t){let n=t.argv;if(n.includes("-h")||n.includes("--help"))return process.stdout.write(N()+`
|
|
3
|
+
`),0;let e=n.includes("--json"),o=I();if(n.includes("--status")||e)return e?(process.stdout.write(JSON.stringify(o,null,2)+`
|
|
4
4
|
`),0):(process.stdout.write([`hermes: ${o.hermes.ok?`${o.hermes.bin} (${o.hermes.source})`:"not installed"}`,`managed venv: ${o.managedVenv}`,`managed built: ${o.managedInstalled?"yes":"no"}`,`host python: ${o.hostPython?`${o.hostPython.bin} (${o.hostPython.version})`:"none supported (need 3.11-3.13)"}`,`uv: ${o.uv||"not installed (oracle will install it locally)"}`,""].join(`
|
|
5
|
-
`)),0);let s=
|
|
5
|
+
`)),0);let s=n.includes("--upgrade");if(o.hermes.ok&&o.hermes.source==="path"&&!s)return process.stdout.write(`hermes already on PATH: ${o.hermes.bin}
|
|
6
6
|
nothing to do. run: oracle
|
|
7
|
-
`),0;process.stdout.write(`installing ${j} into ${
|
|
7
|
+
`),0;process.stdout.write(`installing ${j} into ${P()}
|
|
8
8
|
`+(o.hostPython?`using python ${o.hostPython.version} (${o.hostPython.bin})
|
|
9
9
|
`:`provisioning an isolated python 3.13 with uv
|
|
10
10
|
`)+`this takes a few minutes on first run
|
|
11
11
|
|
|
12
|
-
`);let r=
|
|
12
|
+
`);let r=H({upgrade:s});return r.ok?(process.stdout.write(r.reused?`runtime already present: ${r.bin}
|
|
13
13
|
`:`
|
|
14
14
|
runtime ready: ${r.bin}
|
|
15
15
|
run: oracle
|
|
16
16
|
`),0):(process.stderr.write(`oracle bootstrap failed: ${r.reason}
|
|
17
17
|
`),r.stderr&&process.stderr.write(`${r.stderr}
|
|
18
|
-
`),1)}};export{
|
|
18
|
+
`),1)}};export{de as default};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import D from"node:readline/promises";import{stdin as P,stdout as N}from"node:process";var A=Object.freeze([{key:"hyperliquid",aliases:["hl","hyperevm","hype","999"],chainId:999,name:"hyperliquid",kind:"evm",family:"hyperliquid",agent:"hyperliquid-agent",note:"perps \xB7 hip-3/4 \xB7 hyperevm 999",build:!0},{key:"ethereum",aliases:["eth","mainnet","1"],chainId:1,name:"ethereum",kind:"evm",family:"evm",agent:"oracle",note:"l1 \xB7 bridge hub",build:!0},{key:"base",aliases:["8453"],chainId:8453,name:"base",kind:"evm",family:"evm",agent:"oracle",note:"evm l2",build:!0},{key:"arbitrum",aliases:["arb","42161"],chainId:42161,name:"arbitrum",kind:"evm",family:"evm",agent:"oracle",note:"evm l2",build:!0},{key:"optimism",aliases:["op","10"],chainId:10,name:"optimism",kind:"evm",family:"evm",agent:"oracle",note:"op mainnet",build:!0},{key:"polygon",aliases:["matic","137"],chainId:137,name:"polygon",kind:"evm",family:"evm",agent:"oracle",note:"evm l2",build:!0},{key:"bsc",aliases:["bnb","56"],chainId:56,name:"bnb chain",kind:"evm",family:"evm",agent:"oracle",note:"bsc",build:!0},{key:"avalanche",aliases:["avax","43114"],chainId:43114,name:"avalanche",kind:"evm",family:"evm",agent:"oracle",note:"c-chain",build:!0},{key:"abstract",aliases:["abs","2741"],chainId:2741,name:"abstract",kind:"evm",family:"evm",agent:"oracle",note:"open / add agent",build:!0},{key:"stable",aliases:["988"],chainId:988,name:"stable",kind:"evm",family:"stable",agent:"stable-agent",note:"usdt0 gas \xB7 stable agent",build:!0},{key:"robinhood",aliases:["rh","4663"],chainId:4663,name:"robinhood",kind:"evm",family:"robinhood",agent:"robinhood-agent",note:"rh chain 4663",build:!0},{key:"solana",aliases:["sol"],chainId:"SOL",name:"solana",kind:"svm",family:"solana",agent:"solana-agent",note:"jup \xB7 nfts \xB7 dexs",build:!0},{key:"bitcoin",aliases:["btc"],chainId:"BTC",name:"bitcoin",kind:"utxo",family:"bitcoin",agent:"bitcoin-agent",note:"ord \xB7 runes \xB7 l1",build:!0},{key:"polymarket",aliases:["poly","polygon-poly"],chainId:137,name:"polymarket",kind:"venue",family:"polymarket",agent:"polymarket-agent",note:"prediction markets (polygon venue)",build:!1}]);function y(t){return String(t||"").trim().toLowerCase().replace(/^\/+/,"").replace(/\s+/g,"-")}function f({buildOnly:t=!1}={}){return A.filter(n=>t?n.build:!0)}function u(t){let n=y(t);if(!n)return null;for(let e of A)if(e.key===n||String(e.chainId).toLowerCase()===n||(e.aliases||[]).map(y).includes(n)||y(e.name)===n)return e;return null}function g({selectedKey:t=null,buildOnly:n=!1}={}){let e=f({buildOnly:n}),i=["oracle chains","","pick a build/trade surface:",""];for(let a of e){let r=t&&t===a.key?"*":" ",o=String(a.chainId).padEnd(6),s=a.key.padEnd(12);i.push(`${r} ${s} ${o} ${a.note}`)}return i.push(""),i.push("usage:"),i.push(" /chain list"),i.push(" /chain hyperliquid select"),i.push(" /chain show current"),i.push(" /chain clear unset"),i.push(" oracle chain use base same from shell"),t&&i.push("",`active: ${t}`),i.join(`
|
|
2
2
|
`)+`
|
|
3
|
-
`}import
|
|
4
|
-
`,{mode:384}),
|
|
5
|
-
`)}function
|
|
6
|
-
`),0):(process.stdout.write(
|
|
7
|
-
`),
|
|
3
|
+
`}import p from"node:fs";import U from"node:path";import d from"node:fs";import L from"node:os";import l from"node:path";import{fileURLToPath as w}from"node:url";var j=l.dirname(w(import.meta.url)),F=l.resolve(j,"../..");function k(){return process.env.ORACLE_FAKE_HOME||L.homedir()}function R(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function h(){return R()?process.env.ORACLE_CONFIG_DIR||l.join(k(),".config","oracle"):l.join(k(),".config","oracle")}function O(){return l.join(h(),"desk.json")}function S(){return l.join(h(),"env")}function c({force:t=!1}={}){if(c._done&&!t)return c._result||null;c._done=!0;let n={},e=(a,r)=>{if(r==null)return;let o=String(r).trim();o&&(process.env[a]!=null&&String(process.env[a]).trim()!==""||(process.env[a]=o,n[a]=o))};try{let a=S();if(d.existsSync(a))for(let r of d.readFileSync(a,"utf8").split(/\r?\n/)){let o=r.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!o||o[2].startsWith("#"))continue;let s=o[2];(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))&&(s=s.slice(1,-1)),e(o[1],s)}}catch{}try{let a=O();if(d.existsSync(a)){let r=JSON.parse(d.readFileSync(a,"utf8"));r&&typeof r=="object"&&(e("ORACLE_DESK_URL",r.deskUrl||r.dataUrl||r.url),e("ORACLE_DATA_URL",r.dataUrl||r.deskUrl||r.url),e("ORACLE_API_URL",r.apiUrl||r.dataUrl||r.deskUrl),e("ORACLE_PUBLIC_URL",r.publicUrl||r.deskUrl||r.dataUrl),e("ORACLE_EXEC_URL",r.execUrl),e("MAD_DESK_URL",r.deskUrl||r.dataUrl))}}catch{}let i=process.env.ORACLE_DESK_URL||process.env.ORACLE_DATA_URL||"";return i&&(e("ORACLE_DESK_URL",i),e("ORACLE_DATA_URL",i),e("ORACLE_API_URL",i),e("ORACLE_PUBLIC_URL",i),e("MAD_DESK_URL",i)),c._result=Object.keys(n).length?n:null,c._result}try{c()}catch{}function E(t){return d.mkdirSync(t,{recursive:!0}),t}function v(){return U.join(h(),"active-chain.json")}function m(){let t=v();if(!p.existsSync(t))return null;try{let n=JSON.parse(p.readFileSync(t,"utf8"));if(!n||typeof n!="object"||!n.key)return null;let e=u(n.key);return e?{key:e.key,chainId:e.chainId,name:e.name,agent:e.agent,selectedAt:n.selectedAt||null}:null}catch{return null}}function x(t){let n=u(t);if(!n){let i=new Error(`unknown chain '${t}'`);throw i.code="UNKNOWN_CHAIN",i}E(h());let e={key:n.key,chainId:n.chainId,name:n.name,agent:n.agent,selectedAt:new Date().toISOString()};return p.writeFileSync(v(),JSON.stringify(e,null,2)+`
|
|
4
|
+
`,{mode:384}),e}function I(){let t=v();return p.existsSync(t)&&p.unlinkSync(t),!0}function b(){return["oracle chain \u2014 pick the build/trade surface",""," oracle chain list working chains"," oracle chain list same"," oracle chain show show active chain"," oracle chain use <name> select (hyperliquid, base, solana, ...)"," oracle chain clear unset"," oracle chain --json machine output","","chat:"," /chain"," /chain hyperliquid"," /chain show"].join(`
|
|
5
|
+
`)}function $(t){let n=m();return t?(process.stdout.write(JSON.stringify({active:n,chains:f()},null,2)+`
|
|
6
|
+
`),0):(process.stdout.write(g({selectedKey:n?.key||null})),0)}function T(t){let n=m();return t?(process.stdout.write(JSON.stringify({active:n},null,2)+`
|
|
7
|
+
`),n?0:1):n?(process.stdout.write(`active: ${n.key} id=${n.chainId} agent=${n.agent}
|
|
8
8
|
`),0):(process.stdout.write(`active: none
|
|
9
9
|
run: oracle chain use hyperliquid
|
|
10
|
-
`),1)}function
|
|
11
|
-
`):process.stdout.write(`selected ${
|
|
10
|
+
`),1)}function C(t,n){try{let e=x(t);return n?process.stdout.write(JSON.stringify({ok:!0,active:e},null,2)+`
|
|
11
|
+
`):process.stdout.write(`selected ${e.key} (${e.chainId}) \xB7 agent ${e.agent}
|
|
12
12
|
build/trade context pinned for this machine
|
|
13
|
-
`),0}catch(
|
|
13
|
+
`),0}catch(e){if(e?.code==="UNKNOWN_CHAIN")return process.stderr.write(`oracle chain: unknown '${t}'
|
|
14
14
|
`),process.stderr.write(`try: oracle chain list
|
|
15
|
-
`),1;throw
|
|
16
|
-
`),0;if(["list","ls"].includes(
|
|
15
|
+
`),1;throw e}}var ne={name:"chain",summary:"list/select working chains (hyperliquid, base, solana, ...)",group:"read",usage:b(),async run(t){let n=[...t.argv],e=n.includes("--json"),i=n.filter(o=>o!=="--json"),a=(i[0]||"list").toLowerCase(),r=i.slice(1);if(["-h","--help","help"].includes(a))return process.stdout.write(b()+`
|
|
16
|
+
`),0;if(["list","ls"].includes(a))return $(e);if(["show","status","current"].includes(a))return T(e);if(["clear","unset","none"].includes(a))return I(),process.stdout.write(e?`{"ok":true,"active":null}
|
|
17
17
|
`:`active chain cleared
|
|
18
|
-
`),0;if(["use","set","select","pick"].includes(
|
|
19
|
-
`),1)}if(
|
|
20
|
-
${
|
|
21
|
-
`),1}};export{
|
|
18
|
+
`),0;if(["use","set","select","pick"].includes(a)){let o=r.join(" ").trim();return o?C(o,e):(process.stderr.write(`usage: oracle chain use <name>
|
|
19
|
+
`),1)}if(u(a))return C(a,e);if(!i.length&&process.stdin.isTTY){let o=f();process.stdout.write(g({selectedKey:m()?.key}));let s=D.createInterface({input:P,output:N});try{let _=(await s.question("chain> ")).trim();return _?C(_,!1):0}finally{s.close()}}return process.stderr.write(`oracle chain: unknown verb '${a}'
|
|
20
|
+
${b()}
|
|
21
|
+
`),1}};export{ne as default};
|