@oracle-agent/oracle 0.28.25 → 0.28.27

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.
@@ -0,0 +1,35 @@
1
+ import{spawnSync as d}from"node:child_process";import{homedir as l}from"node:os";import{join as i}from"node:path";var c=process.env.ORACLE_PUBLIC_DESKTOP==="1",v=c?process.env.ORACLE_CONFIG_DIR||i(l(),".config","oracle"):i(l(),".config","oracle"),O=c?v:i(l(),".config","mad-desk");function f(t,e,o=""){let r=process.env[t];if(r!=null&&String(r).trim()!=="")return r;let n=e?process.env[e]:void 0;return n!=null&&String(n).trim()!==""?n:o}function a(t,e,o=!1){return String(f(t,e,o?"1":"")).trim()==="1"}function u(){return a("ORACLE_EXECUTE_ENABLED","MAD_EXECUTE_ENABLED",!1)}function p(){return a("ORACLE_DEPLOY_ENABLED","MAD_DEPLOY_ENABLED",!1)}function E(){return a("ORACLE_MEV_EXECUTE_ENABLED",null,!1)}var m=`oracle mev <observe|observe-arb|status|control|keygen|operator|restore-keygen|restore-approve|restore-apply> [args]
2
+
3
+ Observer (read-only, loopback, no signer):
4
+ oracle mev observe Base WETH/USDC Uni V3 <-> Aerodrome observer (127.0.0.1:8808)
5
+ oracle mev observe-arb Arbitrum Uni V3 fee-tier paper observer (127.0.0.1:8809)
6
+ oracle mev status flag posture; never implies a live trade
7
+
8
+ Kill switch (one-way revoke; no arm/restore here):
9
+ oracle mev control status
10
+ oracle mev control bootstrap-revoked --reason <text>
11
+ oracle mev control revoke-chain --chain-id 8453 --reason <text> --expected-revision <n>
12
+ oracle mev control revoke-all --reason <text> --expected-revision <n>
13
+
14
+ Private owner-triggered execution (fail-closed; not autonomous):
15
+ oracle mev keygen
16
+ oracle mev operator status|reconcile|prepare|simulate|execute
17
+ oracle mev operator execute --execute --owner-action-id <id> --artifact <file> --simulation <file>
18
+
19
+ Restore (two-party Ed25519; isolated from the kill-switch CLI):
20
+ oracle mev restore-keygen
21
+ oracle mev restore-approve ...
22
+ oracle mev restore-apply ...
23
+
24
+ Defaults:
25
+ Observer may run. It never prepares, signs, or broadcasts.
26
+ Execution stays off unless ORACLE_MEV_EXECUTE_ENABLED=1 AND you pass literal --execute.
27
+ Autonomous trading stays off unless ORACLE_AUTONOMOUS_TRADING=1, and even then
28
+ there is no MEV loop \u2014 each trade still needs an explicit operator execute.
29
+ ORACLE_EXECUTE_ENABLED does not arm flash-loan execution.
30
+ `,x={observe:"oracle-mev-shadow.mjs","observe-arb":"oracle-mev-arb-shadow.mjs",control:"oracle-mev-control.mjs",keygen:"oracle-mev-keygen.mjs",operator:"oracle-mev-operator.mjs","restore-keygen":"oracle-mev-restore-keygen.mjs","restore-approve":"oracle-mev-restore-approve.mjs","restore-apply":"oracle-mev-restore-apply.mjs"};function A(){return{service:"oracle-mev",observer:{available:!0,execution:!1,signer:!1,broadcaster:!1},flags:{ORACLE_EXECUTE_ENABLED:u(),ORACLE_DEPLOY_ENABLED:p(),ORACLE_MEV_EXECUTE_ENABLED:E(),ORACLE_AUTONOMOUS_TRADING:a("ORACLE_AUTONOMOUS_TRADING",null,!1)},autonomousLoop:!1,executionPermitted:!1,note:"Observer is live as a command. Flash-loan execute requires ORACLE_MEV_EXECUTE_ENABLED=1, an unpaused executor, authenticated ownerActionId, and literal --execute. There is no autonomous MEV loop."}}function _(t,e,o,{inherit:r=!0}={}){let n=t.bin(e),s=d(process.execPath,[n,...o],{stdio:r?"inherit":["ignore","pipe","pipe"],encoding:"utf8"});return s.error?(process.stderr.write(`oracle mev: failed to spawn ${e}: ${s.error.message}
31
+ `),1):(r||(s.stdout&&process.stdout.write(s.stdout),s.stderr&&process.stderr.write(s.stderr)),typeof s.status=="number"?s.status:1)}var R={name:"mev",summary:"MEV observer plus gated Base flash-loan execute (explicit --execute only; no autonomous loop)",group:"read",usage:m,async run(t){let e=Array.isArray(t.argv)?t.argv:[];if(e.length===0||e[0]==="--help"||e[0]==="-h"||e[0]==="help")return process.stdout.write(m),0;let[o,...r]=e;if(o==="status")return process.stdout.write(`${JSON.stringify(A(),null,2)}
32
+ `),0;let n=x[o];return n?o==="operator"&&r[0]==="execute"&&!r.includes("--execute")?(process.stderr.write(`oracle mev: execute requires literal --execute; refusing autonomous/implied execution
33
+ `),1):o==="operator"&&r[0]==="execute"&&a("ORACLE_AUTONOMOUS_TRADING",null,!1)&&r.includes("--loop")?(process.stderr.write(`oracle mev: autonomous looping is not implemented; pass one explicit --execute action
34
+ `),1):_(t,n,r,{inherit:!0}):(process.stderr.write(`oracle mev: unknown verb '${o}'. Try: oracle mev --help
35
+ `),1)}};export{R as default};