@oracle-agent/oracle 0.9.8 → 0.11.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/README.md +15 -10
- package/bin/oracle-data-mcp.mjs +9 -0
- package/docs/architecture.md +3 -1
- package/docs/profiles.md +3 -6
- package/docs/public-surface.md +133 -0
- package/package.json +3 -2
- package/public/oracle-splash/assets/cli-chain-hyperliquid.jpg +0 -0
- package/public/oracle-splash/brand/aave.webp +0 -0
- package/public/oracle-splash/brand/aavev2.webp +0 -0
- package/public/oracle-splash/brand/aborean.webp +0 -0
- package/public/oracle-splash/brand/across.webp +0 -0
- package/public/oracle-splash/brand/aerodrome.webp +0 -0
- package/public/oracle-splash/brand/afi.webp +0 -0
- package/public/oracle-splash/brand/arcus.webp +0 -0
- package/public/oracle-splash/brand/aster.webp +0 -0
- package/public/oracle-splash/brand/avant.webp +0 -0
- package/public/oracle-splash/brand/balancer.webp +0 -0
- package/public/oracle-splash/brand/beefy.webp +0 -0
- package/public/oracle-splash/brand/benqi.webp +0 -0
- package/public/oracle-splash/brand/bestinslot.ico +0 -0
- package/public/oracle-splash/brand/bitfi.webp +0 -0
- package/public/oracle-splash/brand/bonkswap.webp +0 -0
- package/public/oracle-splash/brand/bouncebit.webp +0 -0
- package/public/oracle-splash/brand/camelot.webp +0 -0
- package/public/oracle-splash/brand/compound.webp +0 -0
- package/public/oracle-splash/brand/concrete.webp +0 -0
- package/public/oracle-splash/brand/cow.webp +0 -0
- package/public/oracle-splash/brand/curve.webp +0 -0
- package/public/oracle-splash/brand/derive.webp +0 -0
- package/public/oracle-splash/brand/dolomite.webp +0 -0
- package/public/oracle-splash/brand/eigenlayer.webp +0 -0
- package/public/oracle-splash/brand/ekubo.webp +0 -0
- package/public/oracle-splash/brand/ethena.webp +0 -0
- package/public/oracle-splash/brand/etherfi.webp +0 -0
- package/public/oracle-splash/brand/etherfiborrow.webp +0 -0
- package/public/oracle-splash/brand/felix.webp +0 -0
- package/public/oracle-splash/brand/fluid.webp +0 -0
- package/public/oracle-splash/brand/fluxbeam.webp +0 -0
- package/public/oracle-splash/brand/folks.webp +0 -0
- package/public/oracle-splash/brand/fortyacres.webp +0 -0
- package/public/oracle-splash/brand/gainsnetwork.webp +0 -0
- package/public/oracle-splash/brand/gassss.webp +0 -0
- package/public/oracle-splash/brand/gmx.webp +0 -0
- package/public/oracle-splash/brand/harmonix.webp +0 -0
- package/public/oracle-splash/brand/hlorderbook.webp +0 -0
- package/public/oracle-splash/brand/hlp.webp +0 -0
- package/public/oracle-splash/brand/hop.webp +0 -0
- package/public/oracle-splash/brand/hyperbeat.webp +0 -0
- package/public/oracle-splash/brand/hyperlend.webp +0 -0
- package/public/oracle-splash/brand/hyperliquid.webp +0 -0
- package/public/oracle-splash/brand/hyperliquidhpl.webp +0 -0
- package/public/oracle-splash/brand/hyperliquidspot.webp +0 -0
- package/public/oracle-splash/brand/hyperswap.webp +0 -0
- package/public/oracle-splash/brand/hypha.webp +0 -0
- package/public/oracle-splash/brand/joedex.webp +0 -0
- package/public/oracle-splash/brand/jupiter.webp +0 -0
- package/public/oracle-splash/brand/kelp.webp +0 -0
- package/public/oracle-splash/brand/kinetiq.webp +0 -0
- package/public/oracle-splash/brand/kmhype.webp +0 -0
- package/public/oracle-splash/brand/kona.webp +0 -0
- package/public/oracle-splash/brand/konalend.webp +0 -0
- package/public/oracle-splash/brand/lfj.webp +0 -0
- package/public/oracle-splash/brand/lido.webp +0 -0
- package/public/oracle-splash/brand/lifi.webp +0 -0
- package/public/oracle-splash/brand/lighter.webp +0 -0
- package/public/oracle-splash/brand/lista.webp +0 -0
- package/public/oracle-splash/brand/loopedhype.webp +0 -0
- package/public/oracle-splash/brand/lorenzo.webp +0 -0
- package/public/oracle-splash/brand/magic-eden.webp +0 -0
- package/public/oracle-splash/brand/magiceden.webp +0 -0
- package/public/oracle-splash/brand/mempool.png +0 -0
- package/public/oracle-splash/brand/meteora.webp +0 -0
- package/public/oracle-splash/brand/morpho.webp +0 -0
- package/public/oracle-splash/brand/myriad.webp +0 -0
- package/public/oracle-splash/brand/noxa.webp +0 -0
- package/public/oracle-splash/brand/odos.webp +0 -0
- package/public/oracle-splash/brand/oneinch.webp +0 -0
- package/public/oracle-splash/brand/openbook.webp +0 -0
- package/public/oracle-splash/brand/opensea.webp +0 -0
- package/public/oracle-splash/brand/orca.webp +0 -0
- package/public/oracle-splash/brand/ordinals.png +0 -0
- package/public/oracle-splash/brand/ostium.webp +0 -0
- package/public/oracle-splash/brand/pancakeswap.webp +0 -0
- package/public/oracle-splash/brand/pendle.webp +0 -0
- package/public/oracle-splash/brand/perena.webp +0 -0
- package/public/oracle-splash/brand/pharaoh.webp +0 -0
- package/public/oracle-splash/brand/phoenix.webp +0 -0
- package/public/oracle-splash/brand/polymarket.webp +0 -0
- package/public/oracle-splash/brand/polynomial.webp +0 -0
- package/public/oracle-splash/brand/projectx.webp +0 -0
- package/public/oracle-splash/brand/pumpfun.webp +0 -0
- package/public/oracle-splash/brand/quickswap.webp +0 -0
- package/public/oracle-splash/brand/rain.webp +0 -0
- package/public/oracle-splash/brand/raydium.webp +0 -0
- package/public/oracle-splash/brand/relay.webp +0 -0
- package/public/oracle-splash/brand/rocketpool.webp +0 -0
- package/public/oracle-splash/brand/saber.webp +0 -0
- package/public/oracle-splash/brand/sakuraswap.webp +0 -0
- package/public/oracle-splash/brand/sanctum.webp +0 -0
- package/public/oracle-splash/brand/satflow.png +0 -0
- package/public/oracle-splash/brand/sierra.webp +0 -0
- package/public/oracle-splash/brand/sky.webp +0 -0
- package/public/oracle-splash/brand/solv.webp +0 -0
- package/public/oracle-splash/brand/spark.webp +0 -0
- package/public/oracle-splash/brand/sparksavings.webp +0 -0
- package/public/oracle-splash/brand/sphere.webp +0 -0
- package/public/oracle-splash/brand/ssv.webp +0 -0
- package/public/oracle-splash/brand/stabble.webp +0 -0
- package/public/oracle-splash/brand/stableswap.webp +0 -0
- package/public/oracle-splash/brand/stakewise.webp +0 -0
- package/public/oracle-splash/brand/stargate.webp +0 -0
- package/public/oracle-splash/brand/sthype.webp +0 -0
- package/public/oracle-splash/brand/sushiswap.webp +0 -0
- package/public/oracle-splash/brand/unisat.png +0 -0
- package/public/oracle-splash/brand/uniswap.webp +0 -0
- package/public/oracle-splash/brand/uniswapv2.webp +0 -0
- package/public/oracle-splash/brand/uniswapv4.webp +0 -0
- package/public/oracle-splash/brand/unit.webp +0 -0
- package/public/oracle-splash/brand/velodrome.webp +0 -0
- package/public/oracle-splash/brand/velora.webp +0 -0
- package/public/oracle-splash/brand/venus.webp +0 -0
- package/public/oracle-splash/brand/wbeth.webp +0 -0
- package/public/oracle-splash/brand/xsy.webp +0 -0
- package/public/oracle-splash/brand/yieldyak.webp +0 -0
- package/public/oracle-splash/brand/zerobase.webp +0 -0
- package/public/oracle-splash/brand/zerox.webp +0 -0
- package/public/oracle-splash/index.html +337 -197
- package/scripts/check-doc-drift.mjs +11 -0
- package/scripts/e2e-solana-bitcoin.mjs +1 -1
- package/scripts/secret-scan.mjs +1 -1
- package/src/action-receipts.mjs +108 -11
- package/src/auth/oauth.mjs +672 -0
- package/src/cli/commands/auth.mjs +193 -0
- package/src/cli/commands/bootstrap.mjs +2 -2
- package/src/cli/commands/chat.mjs +97 -75
- package/src/cli/commands/data.mjs +3 -1
- package/src/cli/commands/doctor.mjs +11 -1
- package/src/cli/commands/model.mjs +79 -23
- package/src/cli/kernel.mjs +4 -3
- package/src/cli/model-config.mjs +70 -0
- package/src/data/catalog.mjs +38 -7
- package/src/data/desk-data.mjs +12 -0
- package/src/data/providers/evm-rpc.mjs +19 -16
- package/src/data/providers/jupiter-venues.mjs +119 -0
- package/src/data/providers/jupiter.mjs +132 -0
- package/src/data/providers/magiceden-sol.mjs +13 -0
- package/src/data/providers/morpho.mjs +6 -2
- package/src/data/providers/pendle.mjs +3 -2
- package/src/data/providers/satflow.mjs +4 -1
- package/src/data/providers/signed-material-guard.mjs +108 -0
- package/src/data/providers/uniswap-v3.mjs +34 -5
- package/src/data/providers/uniswap-v4.mjs +414 -0
- package/src/prepare-envelope.mjs +22 -4
- package/src/router/prepare-route.mjs +17 -0
- package/src/router/route-sources.mjs +35 -0
- package/src/tui/app.mjs +18 -7
- package/src/tui/backend.mjs +145 -0
- package/src/tui/standalone-client.mjs +666 -0
- package/src/cards.mjs +0 -369
- package/src/cli/__pycache__/oracle-harness.cpython-311.pyc +0 -0
|
@@ -60,6 +60,17 @@ function checkVersionPins(rel, text) {
|
|
|
60
60
|
`${rel}:${i + 1} advertises oracle ${latest[1]} as latest but this package is ${pkg.version}\n ${line.trim().slice(0, 120)}`,
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
+
// The 2026-08-03 grok lane found `Source tree: **oracle \`0.5.0\`**` and a
|
|
64
|
+
// `Published npm: **oracle \`0.4.2\`**` line surviving inside a 0.10.0
|
|
65
|
+
// tarball. Both shapes sailed past the two matchers above, so a stranger
|
|
66
|
+
// reading the shipped README saw a version five releases stale. Match any
|
|
67
|
+
// prose that states an oracle version, not just the two blessed prefixes.
|
|
68
|
+
const stated = line.match(/oracle\s+`(\d+\.\d+\.\d+)`/i);
|
|
69
|
+
if (stated && stated[1] !== pkg.version) {
|
|
70
|
+
failures.push(
|
|
71
|
+
`${rel}:${i + 1} states oracle ${stated[1]} but this package is ${pkg.version}\n ${line.trim().slice(0, 120)}`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
63
74
|
});
|
|
64
75
|
}
|
|
65
76
|
|
|
@@ -9,7 +9,7 @@ import { jupiterQuote, jupiterPrepareSwap, SOL_MINT, USDC_MINT } from "../src/da
|
|
|
9
9
|
import { solanaSimulateTransaction } from "../src/data/providers/solana-rpc.mjs";
|
|
10
10
|
import { magicEdenSolStats, magicEdenSolListings, magicEdenSolPrepareBuy } from "../src/data/providers/magiceden-sol.mjs";
|
|
11
11
|
|
|
12
|
-
const PROBE_WALLET = process.env.ORACLE_E2E_SOL_PUBKEY || "
|
|
12
|
+
const PROBE_WALLET = process.env.ORACLE_E2E_SOL_PUBKEY || "DtM6A1ivwvFeT14f7ggTAGvpUTZA5LeutV3rLe8wR6U3";
|
|
13
13
|
const PROBE_BTC = process.env.ORACLE_E2E_BTC_ADDRESS || "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq";
|
|
14
14
|
|
|
15
15
|
const results = [];
|
package/scripts/secret-scan.mjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { execFileSync } from "node:child_process";
|
|
8
8
|
|
|
9
|
-
const ROOT = process.cwd();
|
|
9
|
+
const ROOT = execFileSync("git", ["rev-parse", "--show-toplevel"], { cwd: process.cwd(), encoding: "utf8" }).trim();
|
|
10
10
|
|
|
11
11
|
// Live values that must never appear. Sourced from the environment at scan
|
|
12
12
|
// time so the scanner itself contains no secrets.
|
package/src/action-receipts.mjs
CHANGED
|
@@ -4,17 +4,89 @@
|
|
|
4
4
|
// sign, broadcast, or fetch. It only records facts supplied by its caller.
|
|
5
5
|
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
|
+
import { wordlists } from "ethers";
|
|
7
8
|
|
|
8
9
|
export const ACTION_RECEIPT_VERSION = 1;
|
|
9
10
|
|
|
11
|
+
// Key-name matching was exact-ish and only covered five words, so every wallet
|
|
12
|
+
// export alias (secretKey, seedPhrase, wif, keyMaterial, privKey, xprv, seed,
|
|
13
|
+
// keystore) sailed through. There was also NO value-shape rule, so a raw key or
|
|
14
|
+
// a BIP-39 phrase pasted into a benign field like `memo` was recorded verbatim.
|
|
15
|
+
//
|
|
16
|
+
// Both concerns were already solved in src/address-book.mjs; this module simply
|
|
17
|
+
// did not use the hardened list. Found by the opus lane of the 2026-08-03
|
|
18
|
+
// four-model review, and verified to PERSIST: unknown top-level props are
|
|
19
|
+
// dropped by the schema whitelist, but a secret nested inside a RETAINED field
|
|
20
|
+
// (intent, route, decodedAction) survives into the frozen receipt.
|
|
10
21
|
const SECRET_KEYS = new Set([
|
|
11
22
|
"privatekey",
|
|
23
|
+
"privkey",
|
|
24
|
+
"secretkey",
|
|
25
|
+
"seedphrase",
|
|
26
|
+
"seed",
|
|
12
27
|
"mnemonic",
|
|
28
|
+
"passphrase",
|
|
29
|
+
"password",
|
|
30
|
+
"keystore",
|
|
31
|
+
"keymaterial",
|
|
32
|
+
"wif",
|
|
33
|
+
"xprv",
|
|
34
|
+
"xpriv",
|
|
13
35
|
"bearer",
|
|
14
36
|
"authorization",
|
|
15
37
|
"signature",
|
|
38
|
+
"apikey",
|
|
39
|
+
"credential",
|
|
40
|
+
]);
|
|
41
|
+
|
|
42
|
+
// Unambiguous key shapes: WIF, extended private key, BIP-39 word run. These are
|
|
43
|
+
// refused wherever they appear.
|
|
44
|
+
//
|
|
45
|
+
// A bare 64-hex string is deliberately NOT in this list. A raw EVM private key
|
|
46
|
+
// and a bytes32 tx hash are byte-identical, and receipts legitimately carry
|
|
47
|
+
// txHash / orderHash / salt / merkleRoot / nonce. Blanket-refusing 64-hex would
|
|
48
|
+
// break real receipts — an over-tight filter is its own bug. It is instead
|
|
49
|
+
// gated on the field name below.
|
|
50
|
+
const KEY_SHAPED_VALUE = [
|
|
51
|
+
/\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,
|
|
52
|
+
/\bxprv[0-9A-Za-z]{50,}\b/,
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
const BIP39_WORD_COUNTS = new Set([12, 15, 18, 21, 24]);
|
|
56
|
+
|
|
57
|
+
function isBip39EnglishPhrase(value) {
|
|
58
|
+
const words = String(value).trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
59
|
+
return BIP39_WORD_COUNTS.has(words.length) && words.every((word) => wordlists.en.getWordIndex(word) >= 0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const BARE_32_BYTE_HEX = /^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/;
|
|
63
|
+
|
|
64
|
+
// Field names whose whole value is EXPECTED to be a 32-byte digest.
|
|
65
|
+
//
|
|
66
|
+
// The trailing `(?:e?s)?` matters: `publicValue` scans array leaves using the
|
|
67
|
+
// PARENT key, so a batched route's `orderHashes` / `proofs` / `commitments`
|
|
68
|
+
// arrives here in its plural form (English pluralizes `hash` as `hashes`).
|
|
69
|
+
// Without it a digest LIST is refused while the exact same digest in singular
|
|
70
|
+
// form is accepted — an over-tight filter that breaks real receipts and blocks
|
|
71
|
+
// no secret (key-SHAPED values are refused by KEY_SHAPED_VALUE / BIP-39
|
|
72
|
+
// regardless of field name).
|
|
73
|
+
const DIGEST_FIELD = /(hash|digest|root|salt|nonce|proof|commitment|sig|id)(?:e?s)?$/i;
|
|
74
|
+
const PROTOCOL_HEX_FIELDS = new Set([
|
|
75
|
+
"calldata",
|
|
76
|
+
"data",
|
|
77
|
+
"publickey",
|
|
78
|
+
"pubkey",
|
|
79
|
+
"message",
|
|
80
|
+
"payload",
|
|
81
|
+
"input",
|
|
82
|
+
"extradata",
|
|
16
83
|
]);
|
|
17
84
|
|
|
85
|
+
function allows32ByteHex(key) {
|
|
86
|
+
const normalized = normalizedKey(key);
|
|
87
|
+
return PROTOCOL_HEX_FIELDS.has(normalized) || DIGEST_FIELD.test(normalized);
|
|
88
|
+
}
|
|
89
|
+
|
|
18
90
|
export class ActionReceiptSecretError extends Error {
|
|
19
91
|
constructor(path) {
|
|
20
92
|
super(`action receipt refused: secret-bearing field at ${path}`);
|
|
@@ -32,23 +104,45 @@ function isSecretKey(key) {
|
|
|
32
104
|
return [...SECRET_KEYS].some((secret) => normalized.includes(secret));
|
|
33
105
|
}
|
|
34
106
|
|
|
35
|
-
|
|
36
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Refuse a key-material-shaped VALUE, so a secret pasted into a benign field
|
|
109
|
+
* name (memo, note, label) cannot be recorded verbatim.
|
|
110
|
+
*
|
|
111
|
+
* Bare 64-hex is only refused when the field name is NOT digest-shaped: a raw
|
|
112
|
+
* EVM private key and a bytes32 hash are byte-identical, and receipts carry
|
|
113
|
+
* txHash / orderHash / salt / nonce legitimately.
|
|
114
|
+
*/
|
|
115
|
+
function assertNoSecretValue(key, value, path) {
|
|
116
|
+
if (typeof value !== "string") return;
|
|
117
|
+
if (KEY_SHAPED_VALUE.some((re) => re.test(value)) || isBip39EnglishPhrase(value)) {
|
|
118
|
+
throw new ActionReceiptSecretError(path);
|
|
119
|
+
}
|
|
120
|
+
if (BARE_32_BYTE_HEX.test(value) && !allows32ByteHex(key)) {
|
|
121
|
+
throw new ActionReceiptSecretError(path);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function publicValue(value, path = "$", key = "") {
|
|
126
|
+
if (value == null || typeof value === "boolean") return value;
|
|
127
|
+
if (typeof value === "string") {
|
|
128
|
+
assertNoSecretValue(key, value, path);
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
37
131
|
if (typeof value === "number") {
|
|
38
132
|
if (!Number.isFinite(value)) throw new TypeError(`action receipt: non-finite number at ${path}`);
|
|
39
133
|
return value;
|
|
40
134
|
}
|
|
41
135
|
if (typeof value === "bigint") return value.toString();
|
|
42
|
-
if (Array.isArray(value)) return value.map((item, index) => publicValue(item, `${path}[${index}]
|
|
136
|
+
if (Array.isArray(value)) return value.map((item, index) => publicValue(item, `${path}[${index}]`, key));
|
|
43
137
|
if (typeof value !== "object" || Object.getPrototypeOf(value) !== Object.prototype) {
|
|
44
138
|
throw new TypeError(`action receipt: JSON-like value required at ${path}`);
|
|
45
139
|
}
|
|
46
140
|
|
|
47
141
|
const out = {};
|
|
48
|
-
for (const
|
|
49
|
-
const childPath = `${path}.${
|
|
50
|
-
if (isSecretKey(
|
|
51
|
-
if (value[
|
|
142
|
+
for (const childKey of Object.keys(value).sort()) {
|
|
143
|
+
const childPath = `${path}.${childKey}`;
|
|
144
|
+
if (isSecretKey(childKey)) throw new ActionReceiptSecretError(childPath);
|
|
145
|
+
if (value[childKey] !== undefined) out[childKey] = publicValue(value[childKey], childPath, childKey);
|
|
52
146
|
}
|
|
53
147
|
return out;
|
|
54
148
|
}
|
|
@@ -58,12 +152,15 @@ export function assertNoReceiptSecrets(value) {
|
|
|
58
152
|
return publicValue(value);
|
|
59
153
|
}
|
|
60
154
|
|
|
155
|
+
function canonicalPublicJson(value) {
|
|
156
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
157
|
+
if (Array.isArray(value)) return `[${value.map(canonicalPublicJson).join(",")}]`;
|
|
158
|
+
return `{${Object.keys(value).map((key) => `${JSON.stringify(key)}:${canonicalPublicJson(value[key])}`).join(",")}}`;
|
|
159
|
+
}
|
|
160
|
+
|
|
61
161
|
/** Canonical JSON with recursively sorted object keys. */
|
|
62
162
|
export function canonicalReceiptJson(value) {
|
|
63
|
-
|
|
64
|
-
if (safe === null || typeof safe !== "object") return JSON.stringify(safe);
|
|
65
|
-
if (Array.isArray(safe)) return `[${safe.map(canonicalReceiptJson).join(",")}]`;
|
|
66
|
-
return `{${Object.keys(safe).map((key) => `${JSON.stringify(key)}:${canonicalReceiptJson(safe[key])}`).join(",")}}`;
|
|
163
|
+
return canonicalPublicJson(publicValue(value));
|
|
67
164
|
}
|
|
68
165
|
|
|
69
166
|
/** Hash exactly the public receipt fields, excluding the self-referential id. */
|