@oracle-agent/oracle 0.28.5 → 0.28.6

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.
@@ -117,7 +117,7 @@ evidence. When something failed, say what failed and what you tried.
117
117
 
118
118
  ## Self-host
119
119
 
120
- Oracle ships its own agent runtime — direct OAuth to Claude, Codex, and Grok.
120
+ Oracle ships its own agent harness — direct OAuth to Claude, Codex, and Grok.
121
121
  Native standalone is the only default. Hermes is optional and never auto-selected:
122
122
  `oracle harness detect` can show it on PATH, and you opt in only with
123
123
  `ORACLE_CHAT_BACKEND=hermes`. Otherwise `oracle chat` runs the built-in agent
@@ -97,7 +97,7 @@ does not prove npm users receive it. A locally hosted model/data/policy loop doe
97
97
  a bundled signer. A merged feature is not public until the npm artifact containing it is
98
98
  published and inspected.
99
99
 
100
- **Candidate release in this source tree:** public package `@oracle-agent/oracle@0.28.5`
100
+ **Candidate release in this source tree:** public package `@oracle-agent/oracle@0.28.6`
101
101
  ships the encrypted local vault + short-lived loopback signer. Hosted/keyless
102
102
  Oracle cannot hold keys or move funds. Self-host after `oracle sign init|import` is **auto-armed**
103
103
  for user-initiated actions. Public still charges the disclosed fee card; Administrator
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{realpathSync as b}from"node:fs";import{fileURLToPath as re}from"node:url";import h from"node:fs";import g from"node:path";import{pathToFileURL as Y}from"node:url";import d from"node:fs";import D from"node:os";import i from"node:path";import{fileURLToPath as T}from"node:url";var P=i.dirname(T(import.meta.url)),l=i.resolve(P,"../..");function u(){return process.env.ORACLE_FAKE_HOME||D.homedir()}function A(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function f(){return A()?process.env.ORACLE_CONFIG_DIR||i.join(u(),".config","oracle"):i.join(u(),".config","oracle")}function $(){return i.join(f(),"exec.env")}function _(){return i.join(f(),"desk.json")}function R(){return i.join(f(),"env")}function p({force:e=!1}={}){if(p._done&&!e)return p._result||null;p._done=!0;let o={},r=(a,t)=>{if(t==null)return;let n=String(t).trim();n&&(process.env[a]!=null&&String(process.env[a]).trim()!==""||(process.env[a]=n,o[a]=n))};try{let a=R();if(d.existsSync(a))for(let t of d.readFileSync(a,"utf8").split(/\r?\n/)){let n=t.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!n||n[2].startsWith("#"))continue;let c=n[2];(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),r(n[1],c)}}catch{}try{let a=_();if(d.existsSync(a)){let t=JSON.parse(d.readFileSync(a,"utf8"));t&&typeof t=="object"&&(r("ORACLE_DESK_URL",t.deskUrl||t.dataUrl||t.url),r("ORACLE_DATA_URL",t.dataUrl||t.deskUrl||t.url),r("ORACLE_API_URL",t.apiUrl||t.dataUrl||t.deskUrl),r("ORACLE_PUBLIC_URL",t.publicUrl||t.deskUrl||t.dataUrl),r("ORACLE_EXEC_URL",t.execUrl),r("MAD_DESK_URL",t.deskUrl||t.dataUrl))}}catch{}let s=process.env.ORACLE_DESK_URL||process.env.ORACLE_DATA_URL||"";return s&&(r("ORACLE_DESK_URL",s),r("ORACLE_DATA_URL",s),r("ORACLE_API_URL",s),r("ORACLE_PUBLIC_URL",s),r("MAD_DESK_URL",s)),p._result=Object.keys(o).length?o:null,p._result}try{p()}catch{}function I(){return process.env.HERMES_HOME?i.resolve(process.env.HERMES_HOME):i.join(u(),".hermes")}function M(){return i.join(u(),".claude.json")}function H(e=process.cwd()){return i.join(e,".mcp.json")}function N(){return process.platform==="darwin"?i.join(u(),"Library","Application Support","Claude","claude_desktop_config.json"):i.join(u(),".config","Claude","claude_desktop_config.json")}function F(){return i.join(u(),".codex","config.toml")}function k(){return i.join(f(),"connectors")}function q(){return i.join(k(),"chatgpt-openapi.json")}function K(){return i.join(f(),"active-chain.json")}function y(e){let o=[i.join(l,"bin",e),i.join(l,"dist","bin",e),i.join(l,"..","bin",e)];return o.find(r=>d.existsSync(r))||o[0]}function G(e){return d.mkdirSync(e,{recursive:!0}),e}var C={homeDir:u,isPublicDesktop:A,oracleConfigDir:f,oracleExecEnvPath:$,oracleDeskJsonPath:_,oracleEnvFilePath:R,loadDeskRouting:p,hermesRoot:I,activeChainPath:K,claudeCodeUserConfigPath:M,claudeCodeProjectMcpPath:H,claudeDesktopConfigPath:N,codexConfigPath:F,chatgptConnectorDir:k,chatgptOpenApiPath:q,packageBin:y,ensureDir:G,PACKAGE_ROOT:l};import{execFile as B}from"node:child_process";import{existsSync as de,mkdirSync as fe,readFileSync as V,realpathSync as me,writeFileSync as he}from"node:fs";import v from"node:path";import{promisify as J}from"node:util";var xe=J(B);var Ee=1440*60*1e3;function j(e,o){let r=t=>String(t).replace(/^v/,"").split("-")[0].split(".").map(n=>Number.parseInt(n,10)||0),s=r(e),a=r(o);for(let t=0;t<Math.max(s.length,a.length);t+=1){let n=s[t]??0,c=a[t]??0;if(n>c)return 1;if(n<c)return-1}return 0}function W(e){let o=e?.stateDir||v.join(process.env.HOME||".",".oracle");return v.join(o,"update-check.json")}function w(e){try{return JSON.parse(V(W(e),"utf8"))}catch{return null}}var z="\u25C7 ORACLE // self-custody multichain agent control plane",X=`START
2
+ import{realpathSync as T}from"node:fs";import{fileURLToPath as oe}from"node:url";import h from"node:fs";import g from"node:path";import{pathToFileURL as X}from"node:url";import d from"node:fs";import P from"node:os";import i from"node:path";import{fileURLToPath as $}from"node:url";var I=i.dirname($(import.meta.url)),l=i.resolve(I,"../..");function u(){return process.env.ORACLE_FAKE_HOME||P.homedir()}function R(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function f(){return R()?process.env.ORACLE_CONFIG_DIR||i.join(u(),".config","oracle"):i.join(u(),".config","oracle")}function M(){return i.join(f(),"exec.env")}function k(){return i.join(f(),"desk.json")}function C(){return i.join(f(),"env")}function p({force:e=!1}={}){if(p._done&&!e)return p._result||null;p._done=!0;let o={},n=(c,t)=>{if(t==null)return;let r=String(t).trim();r&&(process.env[c]!=null&&String(process.env[c]).trim()!==""||(process.env[c]=r,o[c]=r))};try{let c=C();if(d.existsSync(c))for(let t of d.readFileSync(c,"utf8").split(/\r?\n/)){let r=t.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!r||r[2].startsWith("#"))continue;let a=r[2];(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),n(r[1],a)}}catch{}try{let c=k();if(d.existsSync(c)){let t=JSON.parse(d.readFileSync(c,"utf8"));t&&typeof t=="object"&&(n("ORACLE_DESK_URL",t.deskUrl||t.dataUrl||t.url),n("ORACLE_DATA_URL",t.dataUrl||t.deskUrl||t.url),n("ORACLE_API_URL",t.apiUrl||t.dataUrl||t.deskUrl),n("ORACLE_PUBLIC_URL",t.publicUrl||t.deskUrl||t.dataUrl),n("ORACLE_EXEC_URL",t.execUrl),n("MAD_DESK_URL",t.deskUrl||t.dataUrl))}}catch{}let s=process.env.ORACLE_DESK_URL||process.env.ORACLE_DATA_URL||"";return s&&(n("ORACLE_DESK_URL",s),n("ORACLE_DATA_URL",s),n("ORACLE_API_URL",s),n("ORACLE_PUBLIC_URL",s),n("MAD_DESK_URL",s)),p._result=Object.keys(o).length?o:null,p._result}try{p()}catch{}function H(){return process.env.HERMES_HOME?i.resolve(process.env.HERMES_HOME):i.join(u(),".hermes")}function N(){return i.join(u(),".claude.json")}function F(e=process.cwd()){return i.join(e,".mcp.json")}function q(){return process.platform==="darwin"?i.join(u(),"Library","Application Support","Claude","claude_desktop_config.json"):i.join(u(),".config","Claude","claude_desktop_config.json")}function K(){return i.join(u(),".codex","config.toml")}function v(){return i.join(f(),"connectors")}function G(){return i.join(v(),"chatgpt-openapi.json")}function B(){return i.join(f(),"active-chain.json")}function y(e){let o=[i.join(l,"bin",e),i.join(l,"dist","bin",e),i.join(l,"..","bin",e)];return o.find(n=>d.existsSync(n))||o[0]}function V(e){return d.mkdirSync(e,{recursive:!0}),e}var j={homeDir:u,isPublicDesktop:R,oracleConfigDir:f,oracleExecEnvPath:M,oracleDeskJsonPath:k,oracleEnvFilePath:C,loadDeskRouting:p,hermesRoot:H,activeChainPath:B,claudeCodeUserConfigPath:N,claudeCodeProjectMcpPath:F,claudeDesktopConfigPath:q,codexConfigPath:K,chatgptConnectorDir:v,chatgptOpenApiPath:G,packageBin:y,ensureDir:V,PACKAGE_ROOT:l};import{execFile as J}from"node:child_process";import{existsSync as me,mkdirSync as he,readFileSync as W,realpathSync as ge,writeFileSync as ye}from"node:fs";import w from"node:path";import{promisify as Y}from"node:util";var Ae=Y(J);var _e=1440*60*1e3;function L(e,o){let n=t=>String(t).replace(/^v/,"").split("-")[0].split(".").map(r=>Number.parseInt(r,10)||0),s=n(e),c=n(o);for(let t=0;t<Math.max(s.length,c.length);t+=1){let r=s[t]??0,a=c[t]??0;if(r>a)return 1;if(r<a)return-1}return 0}function z(e){let o=e?.stateDir||w.join(process.env.HOME||".",".oracle");return w.join(o,"update-check.json")}function O(e){try{return JSON.parse(W(z(e),"utf8"))}catch{return null}}var Q="\u25C7 ORACLE // self-custody multichain agent control plane",Z=`START
3
3
  oracle open the native Oracle chat (TTY)
4
4
  oracle chat open chat explicitly
5
5
  oracle setup connect a model and optional messaging
@@ -28,7 +28,7 @@ EXTEND
28
28
  oracle data-mcp expose the read-only MCP server
29
29
  oracle mcp install <t> wire Oracle into claude-code|claude-desktop|codex|chatgpt
30
30
  oracle plugins install \xB7 list \xB7 remove \xB7 scan \xB7 setup
31
- oracle harness detect \xB7 list installed agent clients
31
+ oracle harness detect \xB7 list installed agent harnesses
32
32
 
33
33
  SYSTEM
34
34
  oracle init optional Hermes lane install (dry-run by default)
@@ -43,16 +43,16 @@ BOUNDARY
43
43
  access cannot move value without the operator's encrypted local signer.
44
44
  Autonomous execution additionally requires ORACLE_AUTONOMOUS_TRADING=1.
45
45
  Use oracle <command> --help for command details.
46
- `;function S(){try{return JSON.parse(h.readFileSync(g.join(l,"package.json"),"utf8")).version||"0.0.0"}catch{return"0.0.0"}}function Q(){let e=g.join(l,"src","cli","commands");return h.existsSync(e)?e:g.join(l,"dist","cli","commands")}async function m(){let e=Q(),o=new Map;if(!h.existsSync(e))return o;let r=h.readdirSync(e).filter(s=>s.endsWith(".mjs")).sort();for(let s of r){let a=g.join(e,s);try{let n=(await import(Y(a).href+`?t=${Date.now()}`)).default;if(!n||typeof n!="object"||typeof n.run!="function")continue;let c=n.name||s.replace(/\.mjs$/,"");o.set(c,{...n,name:c,__file:a})}catch(t){process.env.ORACLE_CLI_DEBUG&&console.error(`oracle: failed loading command ${s}: ${t.message}`)}}return o}function Z(e,o=w()){return!o?.latest||!e||j(o.latest,e)<=0?"":`
46
+ `;function b(){try{return JSON.parse(h.readFileSync(g.join(l,"package.json"),"utf8")).version||"0.0.0"}catch{return"0.0.0"}}function ee(){let e=g.join(l,"src","cli","commands");return h.existsSync(e)?e:g.join(l,"dist","cli","commands")}async function m(){let e=ee(),o=new Map;if(!h.existsSync(e))return o;let n=h.readdirSync(e).filter(s=>s.endsWith(".mjs")).sort();for(let s of n){let c=g.join(e,s);try{let r=(await import(X(c).href+`?t=${Date.now()}`)).default;if(!r||typeof r!="object"||typeof r.run!="function")continue;let a=r.name||s.replace(/\.mjs$/,""),A={...r,name:a,__file:c};o.set(a,A);for(let _ of Array.isArray(r.aliases)?r.aliases:[])o.set(_,{...A,name:_,aliasFor:a})}catch(t){process.env.ORACLE_CLI_DEBUG&&console.error(`oracle: failed loading command ${s}: ${t.message}`)}}return o}function te(e,o=O()){return!o?.latest||!e||L(o.latest,e)<=0?"":`
47
47
  Update available: ${e} \u2192 ${o.latest}. Run 'oracle update'.
48
- `}function x(e,o){let r=[];r.push(`${z} (v${e})`),r.push(""),r.push(X.trimEnd());let s=[];for(let a of o.values()){if(["help","version"].includes(a.name))continue;!new Set(["init","doctor","chat","model","auth","chain","setup","data","data-mcp","scan","route","prepare","swap","farm","follow","equities","strategy","public","mcp","plugins","harness","upgrade","bootstrap","eval","fees","sign","signer"]).has(a.name)&&a.summary&&s.push(` oracle ${a.name.padEnd(20)} ${a.summary}`)}return s.length&&(r.push(""),r.push("ADDITIONAL"),r.push(...s)),r.join(`
48
+ `}function x(e,o){let n=[];n.push(`${Q} (v${e})`),n.push(""),n.push(Z.trimEnd());let s=[];for(let c of o.values()){if(["help","version"].includes(c.name))continue;!new Set(["init","doctor","chat","model","auth","chain","setup","data","data-mcp","scan","route","prepare","swap","farm","follow","equities","strategy","public","mcp","plugins","harness","clients","upgrade","bootstrap","eval","fees","sign","signer"]).has(c.name)&&c.summary&&s.push(` oracle ${c.name.padEnd(20)} ${c.summary}`)}return s.length&&(n.push(""),n.push("ADDITIONAL"),n.push(...s)),n.join(`
49
49
  `)+`
50
- `+Z(e)}function L(e,o){let r=[...o.keys()].sort(),s=r.length?r.join(", "):"(none loaded yet)";return`oracle: unknown command '${e}'. Known: ${s}
50
+ `+te(e)}function S(e,o){let n=[...o.keys()].sort(),s=n.length?n.join(", "):"(none loaded yet)";return`oracle: unknown command '${e}'. Known: ${s}
51
51
  Try: oracle --help
52
- `}function E(e){return{argv:e,root:l,bin:y,paths:C}}async function U(e=[]){let o=S();if(e.includes("--version")||e.includes("-V"))return O();if(e[0]==="--help"||e[0]==="-h"){let n=await m();return process.stdout.write(x(o,n)),0}if(e.length===0){let n=await m();if(ee(e)){let c=n.get("chat");if(c)return c.run(E([]))}return process.stdout.write(x(o,n)),0}if(te(e[0])){let c=(await m()).get("chat");if(c)return c.run(E(e))}let r=e[0],s=e.slice(1);if(r==="version")return O();if(r==="help"){let n=await m();if(s[0]){let c=n.get(s[0]);return c?(process.stdout.write((c.usage||`oracle ${c.name}`)+`
53
- `),c.summary&&process.stdout.write(c.summary+`
54
- `),0):(process.stderr.write(L(s[0],n)),1)}return process.stdout.write(x(o,n)),0}let a=await m(),t=a.get(r);if(t){if(s[0]==="--help"||s[0]==="-h")return process.stdout.write((t.usage||`oracle ${t.name}`)+`
52
+ `}function E(e){return{argv:e,root:l,bin:y,paths:j}}async function D(e=[]){let o=b();if(e.includes("--version")||e.includes("-V"))return U();if(e[0]==="--help"||e[0]==="-h"){let r=await m();return process.stdout.write(x(o,r)),0}if(e.length===0){let r=await m();if(re(e)){let a=r.get("chat");if(a)return a.run(E([]))}return process.stdout.write(x(o,r)),0}if(ne(e[0])){let a=(await m()).get("chat");if(a)return a.run(E(e))}let n=e[0],s=e.slice(1);if(n==="version")return U();if(n==="help"){let r=await m();if(s[0]){let a=r.get(s[0]);return a?(process.stdout.write((a.usage||`oracle ${a.name}`)+`
53
+ `),a.summary&&process.stdout.write(a.summary+`
54
+ `),0):(process.stderr.write(S(s[0],r)),1)}return process.stdout.write(x(o,r)),0}let c=await m(),t=c.get(n);if(t){if(s[0]==="--help"||s[0]==="-h")return process.stdout.write((t.usage||`oracle ${t.name}`)+`
55
55
  `),t.summary&&process.stdout.write(t.summary+`
56
- `),0;try{let n=await t.run(E(s));return typeof n=="number"?n:0}catch(n){return process.stderr.write(`oracle ${r}: ${n?.message||n}
57
- `),1}}return process.stderr.write(L(r,a)),1}async function O(){let e=S();return process.stdout.write(`oracle ${e}
58
- `),0}function ee(e=[],o={stdin:process.stdin,stdout:process.stdout}){return e.length!==0?!1:process.env.ORACLE_FORCE_CHAT==="1"?!0:o.stdin?.isTTY===!0&&o.stdout?.isTTY===!0}function te(e){return["-m","--model","--provider","-q","--query","-Q","--quiet","-c","--continue","-r","--resume","-s","--skills","-t","--toolsets","--reasoning","--tui","--cli","--yolo","--checkpoints","--source","--max-turns"].includes(String(e||""))}var Se=Object.freeze({data:"./desk-server.mjs",public:"./oracle-public-server.mjs","data-mcp":"./oracle-data-mcp.mjs",init:"./oracle-init.mjs",upgrade:"./oracle-upgrade.mjs",scan:"./oracle-scan.mjs",route:"./oracle-route.mjs",equities:"./oracle-equities.mjs"});function ne(){if(!process.argv[1])return!1;try{return b(re(import.meta.url))===b(process.argv[1])}catch{return!1}}async function oe(e=process.argv.slice(2)){return U(e)}if(ne()){let e=await oe();process.exit(typeof e=="number"?e:0)}export{Se as COMMANDS,oe as main};
56
+ `),0;try{let r=await t.run(E(s));return typeof r=="number"?r:0}catch(r){return process.stderr.write(`oracle ${n}: ${r?.message||r}
57
+ `),1}}return process.stderr.write(S(n,c)),1}async function U(){let e=b();return process.stdout.write(`oracle ${e}
58
+ `),0}function re(e=[],o={stdin:process.stdin,stdout:process.stdout}){return e.length!==0?!1:process.env.ORACLE_FORCE_CHAT==="1"?!0:o.stdin?.isTTY===!0&&o.stdout?.isTTY===!0}function ne(e){return["-m","--model","--provider","-q","--query","-Q","--quiet","-c","--continue","-r","--resume","-s","--skills","-t","--toolsets","--reasoning","--tui","--cli","--yolo","--checkpoints","--source","--max-turns"].includes(String(e||""))}var be=Object.freeze({data:"./desk-server.mjs",public:"./oracle-public-server.mjs","data-mcp":"./oracle-data-mcp.mjs",init:"./oracle-init.mjs",upgrade:"./oracle-upgrade.mjs",scan:"./oracle-scan.mjs",route:"./oracle-route.mjs",equities:"./oracle-equities.mjs"});function se(){if(!process.argv[1])return!1;try{return T(oe(import.meta.url))===T(process.argv[1])}catch{return!1}}async function ae(e=process.argv.slice(2)){return D(e)}if(se()){let e=await ae();process.exit(typeof e=="number"?e:0)}export{be as COMMANDS,ae as main};