@oracle-agent/oracle 0.10.0 → 0.12.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/LICENSE +115 -201
- package/README.md +82 -91
- package/SECURITY.md +37 -12
- package/SETUP.md +207 -272
- package/dist/action-receipts.mjs +1 -0
- package/dist/action-semantics.mjs +1 -0
- package/dist/address-book.mjs +2 -0
- package/dist/bin/desk-server.mjs +14 -0
- package/dist/bin/oracle-data-mcp.mjs +8 -0
- package/dist/bin/oracle-init.mjs +24 -0
- package/dist/bin/oracle-public-server.mjs +5 -0
- package/dist/bin/oracle-route.mjs +22 -0
- package/dist/bin/oracle-scan.mjs +18 -0
- package/dist/bin/oracle-upgrade.mjs +21 -0
- package/dist/bin/oracle.mjs +68 -0
- package/dist/chains.mjs +1 -0
- package/dist/cli/commands/auth.mjs +16 -0
- package/dist/cli/commands/bootstrap.mjs +18 -0
- package/dist/cli/commands/chain.mjs +21 -0
- package/dist/cli/commands/chat.mjs +35 -0
- package/dist/cli/commands/credential.mjs +1 -0
- package/dist/cli/commands/data-mcp.mjs +2 -0
- package/dist/cli/commands/data.mjs +12 -0
- package/dist/cli/commands/doctor.mjs +5 -0
- package/dist/cli/commands/gate.mjs +13 -0
- package/dist/cli/commands/help.mjs +1 -0
- package/dist/cli/commands/init.mjs +3 -0
- package/dist/cli/commands/mcp.mjs +33 -0
- package/dist/cli/commands/model.mjs +44 -0
- package/dist/cli/commands/prepare.mjs +2 -0
- package/dist/cli/commands/public.mjs +3 -0
- package/dist/cli/commands/route.mjs +2 -0
- package/dist/cli/commands/runner.mjs +1 -0
- package/dist/cli/commands/scan.mjs +2 -0
- package/dist/cli/commands/setup.mjs +34 -0
- package/dist/cli/commands/sign.mjs +4 -0
- package/dist/cli/commands/signer.mjs +1 -0
- package/dist/cli/commands/upgrade.mjs +2 -0
- package/dist/cli/commands/vault.mjs +1 -0
- package/dist/cli/commands/version.mjs +2 -0
- package/dist/data/desk-data.mjs +12 -0
- package/dist/index.mjs +17 -0
- package/dist/nft-gas-war-guard.mjs +1 -0
- package/dist/onboarding/harness-configs.mjs +4 -0
- package/dist/portfolio-risk.mjs +1 -0
- package/dist/prepare-envelope.mjs +1 -0
- package/dist/public-control/policy-schema.mjs +1 -0
- package/dist/router/index.mjs +2 -0
- package/dist/scanner/index.mjs +4 -0
- package/dist/signals/index.mjs +1 -0
- package/dist/watch-preferences.mjs +1 -0
- package/package.json +27 -65
- 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 +246 -169
- package/CONTRIBUTING.md +0 -98
- package/bin/desk-server.mjs +0 -440
- package/bin/oracle-data-mcp.mjs +0 -1010
- package/bin/oracle-init.mjs +0 -496
- package/bin/oracle-public-server.mjs +0 -36
- package/bin/oracle-route.mjs +0 -254
- package/bin/oracle-scan.mjs +0 -192
- package/bin/oracle-upgrade.mjs +0 -42
- package/bin/oracle.mjs +0 -33
- package/docs/adding-a-chain.md +0 -229
- package/docs/architecture.md +0 -136
- package/docs/cli.md +0 -47
- package/docs/connectors.md +0 -13
- package/docs/oracle-pack-standard.md +0 -29
- package/docs/profiles.md +0 -154
- package/examples/add-a-chain.mjs +0 -65
- package/examples/oracle-pack-template.mjs +0 -38
- package/examples/research-a-token.mjs +0 -70
- package/plugins/oracle-owner-gate/__init__.py +0 -227
- package/plugins/oracle-owner-gate/plugin.yaml +0 -9
- package/profiles/_template/SOUL.md +0 -54
- package/profiles/_template/profile.json +0 -22
- package/profiles/bitcoin-agent/SOUL.md +0 -31
- package/profiles/bitcoin-agent/profile.json +0 -32
- package/profiles/hyperliquid-agent/SOUL.md +0 -34
- package/profiles/hyperliquid-agent/profile.json +0 -37
- package/profiles/oracle/SOUL.md +0 -107
- package/profiles/oracle/profile.json +0 -39
- package/profiles/polymarket-agent/SOUL.md +0 -35
- package/profiles/polymarket-agent/profile.json +0 -34
- package/profiles/profile.schema.json +0 -90
- package/profiles/protocol-builder/SOUL.md +0 -57
- package/profiles/protocol-builder/profile.json +0 -39
- package/profiles/robinhood-agent/SOUL.md +0 -53
- package/profiles/robinhood-agent/profile.json +0 -40
- package/profiles/solana-agent/SOUL.md +0 -37
- package/profiles/solana-agent/profile.json +0 -37
- package/profiles/stable-agent/SOUL.md +0 -43
- package/profiles/stable-agent/profile.json +0 -37
- package/protocols/templates/safe-erc20/SECURITY.md +0 -16
- package/protocols/templates/safe-erc20/foundry.toml +0 -12
- package/protocols/templates/safe-erc20/remappings.txt +0 -2
- package/protocols/templates/safe-erc20/src/SafeERC20.sol +0 -53
- package/protocols/templates/safe-erc20/test/SafeERC20.t.sol +0 -72
- package/scripts/adversarial-bench.mjs +0 -114
- package/scripts/build-inscription.py +0 -230
- package/scripts/check-doc-drift.mjs +0 -112
- package/scripts/check-test-count.mjs +0 -105
- package/scripts/e2e-hl-markets.mjs +0 -21
- package/scripts/e2e-hl-perps.mjs +0 -48
- package/scripts/e2e-hypercore-staking.mjs +0 -128
- package/scripts/e2e-solana-bitcoin.mjs +0 -183
- package/scripts/protocol-template-gate.mjs +0 -15
- package/scripts/public-api-scan.mjs +0 -23
- package/scripts/secret-scan.mjs +0 -181
- package/scripts/verify-v3-venues.mjs +0 -192
- package/skills/balance/SKILL.md +0 -176
- package/skills/oracle-action-semantics/SKILL.md +0 -40
- package/skills/oracle-best-execution/SKILL.md +0 -127
- package/skills/oracle-bitcoin/SKILL.md +0 -53
- package/skills/oracle-chain-graphs-telegram-cards/SKILL.md +0 -59
- package/skills/oracle-chat/SKILL.md +0 -61
- package/skills/oracle-chat/chain.SKILL.md +0 -31
- package/skills/oracle-chat/setup.SKILL.md +0 -37
- package/skills/oracle-circuit-breaker/SKILL.md +0 -51
- package/skills/oracle-contract-research/SKILL.md +0 -55
- package/skills/oracle-desk/SKILL.md +0 -58
- package/skills/oracle-dex-launch/SKILL.md +0 -38
- package/skills/oracle-grants/SKILL.md +0 -69
- package/skills/oracle-hypercore-staking/SKILL.md +0 -57
- package/skills/oracle-hyperliquid/SKILL.md +0 -56
- package/skills/oracle-meme-token-sniper/SKILL.md +0 -73
- package/skills/oracle-multichain-nft-launch/SKILL.md +0 -338
- package/skills/oracle-multichain-token-launch/SKILL.md +0 -300
- package/skills/oracle-nft-gacha-launch/SKILL.md +0 -48
- package/skills/oracle-nft-mint-gas-war/SKILL.md +0 -63
- package/skills/oracle-polymarket/SKILL.md +0 -60
- package/skills/oracle-protocol-builder/SKILL.md +0 -59
- package/skills/oracle-protocol-security/SKILL.md +0 -60
- package/skills/oracle-public-product/SKILL.md +0 -44
- package/skills/oracle-receipts/SKILL.md +0 -52
- package/skills/oracle-rfq-tokenized-assets/SKILL.md +0 -69
- package/skills/oracle-smart-wallet-scanner/SKILL.md +0 -49
- package/skills/oracle-solana/SKILL.md +0 -65
- package/skills/oracle-solana-nft/SKILL.md +0 -54
- package/skills/oracle-token-research/SKILL.md +0 -67
- package/skins/oracle.yaml +0 -56
- package/src/action-receipts.mjs +0 -168
- package/src/action-semantics.mjs +0 -62
- package/src/address-book.mjs +0 -208
- package/src/agent-auth.mjs +0 -206
- package/src/approval-guard.mjs +0 -282
- package/src/attestation-secret.mjs +0 -88
- package/src/audit-log.mjs +0 -196
- package/src/auth/oauth.mjs +0 -672
- package/src/auto-slippage.mjs +0 -378
- package/src/capability-posture.mjs +0 -125
- package/src/chains.mjs +0 -62
- package/src/cli/chain-catalog.mjs +0 -215
- package/src/cli/chain-state.mjs +0 -74
- package/src/cli/commands/auth.mjs +0 -193
- package/src/cli/commands/bootstrap.mjs +0 -87
- package/src/cli/commands/chain.mjs +0 -143
- package/src/cli/commands/chat.mjs +0 -434
- package/src/cli/commands/credential.mjs +0 -9
- package/src/cli/commands/data-mcp.mjs +0 -18
- package/src/cli/commands/data.mjs +0 -73
- package/src/cli/commands/doctor.mjs +0 -126
- package/src/cli/commands/help.mjs +0 -7
- package/src/cli/commands/init.mjs +0 -27
- package/src/cli/commands/mcp.mjs +0 -142
- package/src/cli/commands/model.mjs +0 -99
- package/src/cli/commands/prepare.mjs +0 -12
- package/src/cli/commands/public.mjs +0 -20
- package/src/cli/commands/route.mjs +0 -12
- package/src/cli/commands/runner.mjs +0 -9
- package/src/cli/commands/scan.mjs +0 -12
- package/src/cli/commands/setup.mjs +0 -275
- package/src/cli/commands/sign.mjs +0 -21
- package/src/cli/commands/signer.mjs +0 -9
- package/src/cli/commands/upgrade.mjs +0 -12
- package/src/cli/commands/vault.mjs +0 -9
- package/src/cli/commands/version.mjs +0 -22
- package/src/cli/first-run.mjs +0 -23
- package/src/cli/kernel.mjs +0 -239
- package/src/cli/mcp-targets/chatgpt.mjs +0 -51
- package/src/cli/mcp-targets/claude-code.mjs +0 -39
- package/src/cli/mcp-targets/claude-desktop.mjs +0 -24
- package/src/cli/mcp-targets/codex.mjs +0 -41
- package/src/cli/mcp-targets/shared.mjs +0 -61
- package/src/cli/messaging-platforms.mjs +0 -209
- package/src/cli/model-config.mjs +0 -70
- package/src/cli/operator-dispatch.mjs +0 -258
- package/src/cli/oracle-harness.py +0 -415
- package/src/cli/paths.mjs +0 -83
- package/src/cli/runtime.mjs +0 -351
- package/src/cli/setup-state.mjs +0 -168
- package/src/cli/spawn-child.mjs +0 -43
- package/src/data/catalog.mjs +0 -554
- package/src/data/desk-data.mjs +0 -683
- package/src/data/http.mjs +0 -253
- package/src/data/provider-endpoint.mjs +0 -94
- package/src/data/providers/aerodrome.mjs +0 -245
- package/src/data/providers/balancer.mjs +0 -209
- package/src/data/providers/bitcoin-esplora.mjs +0 -216
- package/src/data/providers/bitcoin-meta.mjs +0 -378
- package/src/data/providers/blockscout.mjs +0 -14
- package/src/data/providers/bridges.mjs +0 -242
- package/src/data/providers/cowswap.mjs +0 -415
- package/src/data/providers/curve.mjs +0 -201
- package/src/data/providers/defillama.mjs +0 -88
- package/src/data/providers/dexscreener.mjs +0 -43
- package/src/data/providers/evm-rpc.mjs +0 -222
- package/src/data/providers/geckoterminal.mjs +0 -34
- package/src/data/providers/gmx.mjs +0 -496
- package/src/data/providers/hl-assets.mjs +0 -165
- package/src/data/providers/hl-info.mjs +0 -108
- package/src/data/providers/hl-markets.mjs +0 -210
- package/src/data/providers/hl-outcome.mjs +0 -61
- package/src/data/providers/hl-perps.mjs +0 -387
- package/src/data/providers/hl-staking.mjs +0 -353
- package/src/data/providers/hl-ws.mjs +0 -119
- package/src/data/providers/hyperevm-dex.mjs +0 -49
- package/src/data/providers/jupiter.mjs +0 -183
- package/src/data/providers/lifi.mjs +0 -151
- package/src/data/providers/magiceden-sol.mjs +0 -393
- package/src/data/providers/morpho.mjs +0 -173
- package/src/data/providers/nft-gallery.mjs +0 -163
- package/src/data/providers/nft-portfolio.mjs +0 -494
- package/src/data/providers/odos.mjs +0 -156
- package/src/data/providers/oneinch.mjs +0 -174
- package/src/data/providers/opensea-multichain.mjs +0 -136
- package/src/data/providers/opensea-nft.mjs +0 -371
- package/src/data/providers/paraswap.mjs +0 -118
- package/src/data/providers/pendle.mjs +0 -187
- package/src/data/providers/poly-clob.mjs +0 -283
- package/src/data/providers/poly-public.mjs +0 -96
- package/src/data/providers/poly-ws.mjs +0 -103
- package/src/data/providers/portfolio-history.mjs +0 -394
- package/src/data/providers/portfolio.mjs +0 -594
- package/src/data/providers/rfq.mjs +0 -15
- package/src/data/providers/rh-agent.mjs +0 -59
- package/src/data/providers/satflow.mjs +0 -338
- package/src/data/providers/solana-rpc.mjs +0 -197
- package/src/data/providers/uniswap-v3.mjs +0 -320
- package/src/data/providers/zerox.mjs +0 -167
- package/src/data/public-api-scan.mjs +0 -61
- package/src/data/quote-placeholder.mjs +0 -31
- package/src/exact-integer.mjs +0 -72
- package/src/exec-policy.mjs +0 -455
- package/src/flags.mjs +0 -15
- package/src/fresh-window.mjs +0 -76
- package/src/gmx-attestation.mjs +0 -176
- package/src/index.mjs +0 -100
- package/src/nft-gas-war-guard.mjs +0 -139
- package/src/onboarding/agent-keys.mjs +0 -161
- package/src/onboarding/harness-configs.mjs +0 -102
- package/src/onboarding/index.mjs +0 -18
- package/src/onboarding/tiers.mjs +0 -139
- package/src/oracle-env.mjs +0 -47
- package/src/portfolio-risk.mjs +0 -170
- package/src/prepare-envelope.mjs +0 -186
- package/src/profile-upgrade.mjs +0 -277
- package/src/protocol-execution.mjs +0 -84
- package/src/protocol-templates/gate.mjs +0 -179
- package/src/protocol-templates/prepare-deploy.mjs +0 -81
- package/src/public-api/buzz-integration.mjs +0 -256
- package/src/public-api/connect-agent.mjs +0 -416
- package/src/public-api/grants.mjs +0 -142
- package/src/public-api/http.mjs +0 -389
- package/src/public-control/aa-adapter.mjs +0 -402
- package/src/public-control/build-registry.mjs +0 -227
- package/src/public-control/bundler-client.mjs +0 -357
- package/src/public-control/grant-indexer.mjs +0 -296
- package/src/public-control/policy-render.mjs +0 -69
- package/src/public-control/policy-schema.mjs +0 -318
- package/src/public-control/runtime-config.mjs +0 -275
- package/src/public-control/session-key-model.mjs +0 -374
- package/src/public-control/session-orchestrator.mjs +0 -412
- package/src/rfq/intent.mjs +0 -180
- package/src/rfq/sources.mjs +0 -181
- package/src/route-attestation.mjs +0 -132
- package/src/router/best-execution.mjs +0 -326
- package/src/router/index.mjs +0 -226
- package/src/router/prepare-bridge.mjs +0 -289
- package/src/router/prepare-route.mjs +0 -381
- package/src/router/proposal.mjs +0 -311
- package/src/router/risk-classifier.mjs +0 -119
- package/src/router/route-sources.mjs +0 -329
- package/src/scanner/chains.config.mjs +0 -430
- package/src/scanner/contract.mjs +0 -270
- package/src/scanner/evm-scanner.mjs +0 -394
- package/src/scanner/index.mjs +0 -9
- package/src/scanner/v2-venue.mjs +0 -335
- package/src/scanner/v3-venue.mjs +0 -290
- package/src/scopes.mjs +0 -44
- package/src/sell-simulation.mjs +0 -167
- package/src/signals/engine.mjs +0 -146
- package/src/signals/index.mjs +0 -1
- package/src/token-transfer-guard.mjs +0 -188
- package/src/tui/app.mjs +0 -438
- package/src/tui/backend.mjs +0 -145
- package/src/tui/format.mjs +0 -272
- package/src/tui/gateway-client.mjs +0 -177
- package/src/tui/input.mjs +0 -501
- package/src/tui/renderer.mjs +0 -443
- package/src/tui/standalone-client.mjs +0 -666
- package/src/tui/theme.mjs +0 -81
- package/src/vault-attestation.mjs +0 -146
- package/src/venues.mjs +0 -206
- package/src/watch-preferences.mjs +0 -85
package/SETUP.md
CHANGED
|
@@ -1,381 +1,316 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Oracle setup
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Oracle's public CLI is a standalone, prepare-only multichain agent. It can read,
|
|
4
|
+
research, quote, simulate, and build unsigned artifacts. It does not need Hermes,
|
|
5
|
+
it does not accept wallet private keys, and it does not broadcast transactions.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
The owner-operated signer/executor is private infrastructure. It is not published
|
|
8
|
+
on npm and is not part of public or holder onboarding.
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
npm i -g @oracle-agent/oracle
|
|
9
|
-
oracle
|
|
10
|
-
oracle init --apply
|
|
11
|
-
oracle doctor
|
|
12
|
-
```
|
|
10
|
+
## Requirements
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
- Node.js `20.19.0` or newer
|
|
13
|
+
- npm
|
|
14
|
+
- A supported model login or API key for chat
|
|
15
|
+
- A user-controlled wallet only when reviewing and signing a prepared artifact
|
|
15
16
|
|
|
17
|
+
Linux, Windows, and macOS apps are in beta.
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
a wallet private key. Prepared actions are signed in the user's wallet.
|
|
19
|
-
|
|
20
|
-
## Install
|
|
19
|
+
## 1. Install the standalone CLI
|
|
21
20
|
|
|
22
21
|
```bash
|
|
23
|
-
npm
|
|
22
|
+
npm view @oracle-agent/oracle version
|
|
23
|
+
npm i -g @oracle-agent/oracle@latest
|
|
24
|
+
oracle --version
|
|
24
25
|
```
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
The npm `latest` tag is the install source of truth. The repository can contain
|
|
28
|
+
an unreleased next version, so do not infer the published version from a branch.
|
|
29
|
+
|
|
30
|
+
For a project-local library install instead:
|
|
27
31
|
|
|
28
32
|
```bash
|
|
29
|
-
|
|
30
|
-
cd oracle
|
|
31
|
-
npm install
|
|
32
|
-
npm test
|
|
33
|
+
npm i @oracle-agent/oracle@latest
|
|
33
34
|
```
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
The package declares this floor through `engines`; `oracle doctor` treats an
|
|
37
|
+
unsupported Node runtime as blocking. npm may only warn unless the user's npm
|
|
38
|
+
configuration enables strict engine checks, so verify `node --version` yourself.
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
## 2. Authenticate a model provider
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|---|---|---|
|
|
41
|
-
| **Read / prepare** | Market data, quotes, and *unsigned* transactions or EIP-712 actions | No, mostly |
|
|
42
|
-
| **Owner-local source lane** | Optional companion `@oracle-agent/operator` — keys on YOUR machine | Yes |
|
|
42
|
+
### OAuth
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
The public data facade rejects `hl-exec` even when a signing key exists in the
|
|
51
|
-
environment. The npm artifact excludes the key vault and live signer modules.
|
|
52
|
-
Wallet signing, submission, receipt confirmation, and revocation happen outside
|
|
53
|
-
that public surface.
|
|
54
|
-
|
|
55
|
-
### Capability is not authorization
|
|
56
|
-
|
|
57
|
-
The public Oracle profile must report these as separate planes:
|
|
58
|
-
|
|
59
|
-
| Plane | Default capability |
|
|
60
|
-
|---|---|
|
|
61
|
-
| Public Oracle package | read, quote, simulate, unsigned prepare |
|
|
62
|
-
| Generic `oracle-signer` daemon | six bounded surfaces: `hl`, `poly`, `evm-swap`, `evm-bridge`, `btc`, `sol` (each fails closed on empty allowlists) |
|
|
63
|
-
| Ordinary EVM | unsigned preparation, user-wallet signature |
|
|
64
|
-
| Optional owner-gated EVM executor | one exact bounded action after explicit `arm` |
|
|
65
|
-
|
|
66
|
-
The optional EVM executor is not bundled into this public package and must never be exposed over LAN or a tailnet. A profile may describe bounded EVM execution as available only after verifying that separate local executor and its owner gate. Otherwise say the current deployment is prepare-only. Do not claim EVM execution is universally impossible.
|
|
67
|
-
|
|
68
|
-
Action records require explicit fields:
|
|
69
|
-
|
|
70
|
-
```json
|
|
71
|
-
{
|
|
72
|
-
"active": true,
|
|
73
|
-
"actionMode": "alert_only"
|
|
74
|
-
}
|
|
44
|
+
```bash
|
|
45
|
+
oracle auth login claude
|
|
46
|
+
# or
|
|
47
|
+
oracle auth login codex
|
|
48
|
+
oracle auth login grok
|
|
75
49
|
```
|
|
76
50
|
|
|
77
|
-
|
|
51
|
+
The command opens the provider's authorization flow and selects its default
|
|
52
|
+
model. Use `--no-browser` when the browser must be opened manually.
|
|
78
53
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## Source-only operator credentials
|
|
82
|
-
|
|
83
|
-
This section applies only to an owner-local source checkout. These signing
|
|
84
|
-
credentials are not consumed by the public package entrypoints.
|
|
85
|
-
|
|
86
|
-
## Keys: what each one unlocks
|
|
87
|
-
|
|
88
|
-
Everything is optional. Oracle degrades to whatever you have configured.
|
|
89
|
-
|
|
90
|
-
### Hyperliquid — perps, spot, staking
|
|
91
|
-
|
|
92
|
-
Hyperliquid does not issue API keys. You authorize with an **Ethereum private
|
|
93
|
-
key**, either your account key or (recommended) an **API wallet**.
|
|
94
|
-
|
|
95
|
-
Create an API wallet at <https://app.hyperliquid.xyz/API>. It can trade your
|
|
96
|
-
account but **cannot withdraw**, which is exactly what you want for an agent.
|
|
54
|
+
### API key
|
|
97
55
|
|
|
98
56
|
```bash
|
|
99
|
-
|
|
100
|
-
#
|
|
101
|
-
export HL_KEY_FILE=~/.config/oracle/keys/hl.key
|
|
57
|
+
oracle auth api-key openrouter
|
|
58
|
+
# also supported: openai, xai, deepseek, gemini, custom
|
|
102
59
|
```
|
|
103
60
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Two different credentials, for two different things:
|
|
61
|
+
Interactive API-key entry is hidden. Do not put a key directly in the command
|
|
62
|
+
line, shell history, a screenshot, or Oracle chat. For controlled automation,
|
|
63
|
+
pipe the secret over stdin instead of passing it as an argument:
|
|
109
64
|
|
|
110
65
|
```bash
|
|
111
|
-
|
|
112
|
-
export POLYMARKET_API_KEY=...
|
|
113
|
-
export POLYMARKET_API_SECRET=...
|
|
114
|
-
export POLYMARKET_API_PASSPHRASE=...
|
|
115
|
-
|
|
116
|
-
# 2. The Polygon key that actually owns the funds
|
|
117
|
-
export POLYMARKET_PRIVATE_KEY=0x...
|
|
66
|
+
printf '%s\n' "$OPENROUTER_API_KEY" | oracle auth api-key openrouter --stdin
|
|
118
67
|
```
|
|
119
68
|
|
|
120
|
-
|
|
121
|
-
API access, or via the CLOB `create-api-key` endpoint. Public market data,
|
|
122
|
-
prices, and order books need **no credentials**.
|
|
69
|
+
Check configuration without revealing credentials:
|
|
123
70
|
|
|
124
|
-
|
|
71
|
+
```bash
|
|
72
|
+
oracle auth status
|
|
73
|
+
oracle model --show
|
|
74
|
+
```
|
|
125
75
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
| `OPENSEA_API_KEY` | NFT collections, listings, offers | Heavily rate limited |
|
|
129
|
-
| `MAGICEDEN_API_KEY` | Solana NFT buy/list/mint intents | Floor and listing reads still work |
|
|
130
|
-
| `SATFLOW_API_KEY` | Bitcoin ordinals + runes marketplace | Esplora reads still work |
|
|
131
|
-
| `ZEROX_API_KEY` | 0x swap routing | Other routers still quote |
|
|
132
|
-
| `ONEINCH_API_KEY` | 1inch routing | Other routers still quote |
|
|
133
|
-
| `UNISAT_API_KEY` | Ordinals/BRC-20 indexing | Tip and UTXOs still work |
|
|
134
|
-
| `ORACLE_ROUTE_ATTESTATION_SECRET` | HMAC-signs route and slippage guards | **Required for swap sign/broadcast.** Read/quote/prepare still work. Fresh installs: `oracle-init --apply` writes one to `~/.config/oracle/exec.env`. Unsigned guards are refused at the signer boundary. |
|
|
76
|
+
OAuth credentials and stored API keys use the OS credential store when
|
|
77
|
+
available, with a private `0600` local fallback.
|
|
135
78
|
|
|
136
|
-
|
|
79
|
+
## 3. Open Oracle
|
|
137
80
|
|
|
138
81
|
```bash
|
|
139
|
-
|
|
140
|
-
export BASE_RPC_URL=https://...
|
|
141
|
-
export SOLANA_RPC_URL=https://...
|
|
82
|
+
oracle
|
|
142
83
|
```
|
|
143
84
|
|
|
144
|
-
|
|
145
|
-
wallet uses, then start `oracle-data` from the same environment:
|
|
85
|
+
Useful first commands:
|
|
146
86
|
|
|
147
87
|
```bash
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
npx oracle-data
|
|
88
|
+
oracle chain list
|
|
89
|
+
oracle chain use hyperliquid
|
|
90
|
+
oracle chain show
|
|
91
|
+
oracle doctor
|
|
153
92
|
```
|
|
154
93
|
|
|
155
|
-
|
|
156
|
-
`unavailable`, and unsupported chain families as `unsupported`. They are never
|
|
157
|
-
reported as zero. EVM native balances cover every configured EVM chain. Solana
|
|
158
|
-
adds SPL and Token-2022 accounts, Bitcoin adds Runes and inscriptions when an
|
|
159
|
-
address indexer is configured, Hyperliquid adds spot and perp account state, and
|
|
160
|
-
NFT inventory adds OpenSea-supported EVM/Solana collections plus Bitcoin
|
|
161
|
-
inscriptions where owner indexers are available.
|
|
94
|
+
Inside chat:
|
|
162
95
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
prepared transactions, or raw NFT metadata. Override the internal location only
|
|
167
|
-
when needed:
|
|
96
|
+
- `/chain` lists or selects the active chain.
|
|
97
|
+
- `/model` changes the model without changing the Oracle persona.
|
|
98
|
+
- `/setup` opens optional messaging setup.
|
|
168
99
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
100
|
+
A model response is not authorization, a prepared object is not a transaction,
|
|
101
|
+
and a submitted transaction is not a confirmed receipt.
|
|
102
|
+
|
|
103
|
+
## Public capability boundary
|
|
172
104
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
105
|
+
| Surface | Available to a public install | Custody |
|
|
106
|
+
|---|---:|---|
|
|
107
|
+
| Chat, research, market data | yes | none |
|
|
108
|
+
| Quotes and simulations | yes | none |
|
|
109
|
+
| Unsigned transaction / typed-data preparation | yes | user's wallet reviews and signs |
|
|
110
|
+
| Signing, submission, broadcast | no | private owner-operated boundary only |
|
|
111
|
+
| Automatic trading | no | not a public capability |
|
|
176
112
|
|
|
177
|
-
|
|
113
|
+
Never paste a seed phrase, private key, hardware-wallet recovery phrase, vault
|
|
114
|
+
passphrase, signer token, bot token, or provider credential into chat.
|
|
178
115
|
|
|
179
|
-
##
|
|
116
|
+
## Optional Hermes integration
|
|
180
117
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
`baseUrl` to another host, the credential is dropped rather than forwarded.
|
|
184
|
-
A plaintext `http://` downgrade also drops it.
|
|
118
|
+
Hermes is optional. Add it only if you want specialist profiles, messaging
|
|
119
|
+
channels, durable sessions, or the MCP-based local read plane:
|
|
185
120
|
|
|
186
|
-
|
|
121
|
+
```bash
|
|
122
|
+
oracle bootstrap
|
|
123
|
+
oracle init # dry run
|
|
124
|
+
oracle init --apply
|
|
125
|
+
oracle data serve
|
|
126
|
+
oracle doctor
|
|
127
|
+
```
|
|
187
128
|
|
|
188
|
-
|
|
129
|
+
`oracle bootstrap` installs an isolated Hermes compatibility runtime under
|
|
130
|
+
Oracle's config directory and never modifies system Python. `oracle init
|
|
131
|
+
--apply` writes profiles and a local HMAC attestation secret; it does not write a
|
|
132
|
+
wallet key.
|
|
189
133
|
|
|
190
|
-
|
|
191
|
-
leak into a shell history or a log.
|
|
134
|
+
The data service binds to `127.0.0.1:8787`. Keep it on loopback.
|
|
192
135
|
|
|
193
|
-
|
|
136
|
+
## Optional public HTTP plane
|
|
194
137
|
|
|
195
138
|
```bash
|
|
196
|
-
|
|
197
|
-
printf '%s' "0xYOUR_KEY" > ~/.config/oracle/keys/hl.key
|
|
198
|
-
chmod 600 ~/.config/oracle/keys/hl.key
|
|
199
|
-
export HL_KEY_FILE=~/.config/oracle/keys/hl.key
|
|
139
|
+
oracle public serve --port 8799
|
|
200
140
|
```
|
|
201
141
|
|
|
202
|
-
|
|
142
|
+
The public plane binds to `127.0.0.1` and exposes read, connect, grant,
|
|
143
|
+
portfolio, approval, prepare, Buzz-auth, and audit contracts. It has no signer,
|
|
144
|
+
key, send, execute, or broadcast route.
|
|
203
145
|
|
|
204
|
-
|
|
146
|
+
The service is rate limited but unauthenticated. It is **not** a Locals-holder
|
|
147
|
+
gate and must not be exposed directly to the internet, LAN, or tailnet. A hosted
|
|
148
|
+
deployment needs a controlled reverse proxy, TLS, edge limits, and the
|
|
149
|
+
server-side holder gate described in
|
|
150
|
+
[holder-beta.md](docs/holder-beta.md).
|
|
205
151
|
|
|
206
|
-
|
|
152
|
+
Verify liveness only after starting it:
|
|
207
153
|
|
|
208
154
|
```bash
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
155
|
+
curl -fsS http://127.0.0.1:8799/public/health
|
|
156
|
+
curl -fsS http://127.0.0.1:8799/public/buzz
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
A static Oracle website does not imply that this API is running.
|
|
213
160
|
|
|
214
|
-
|
|
215
|
-
export HL_KEY_FILE=~/.config/oracle/keys/hl.key.vault.json
|
|
161
|
+
## Optional messaging
|
|
216
162
|
|
|
217
|
-
|
|
218
|
-
oracle
|
|
219
|
-
|
|
163
|
+
```bash
|
|
164
|
+
oracle setup
|
|
165
|
+
oracle setup telegram --allowed-users <telegram-user-id>
|
|
166
|
+
oracle setup status
|
|
167
|
+
oracle setup gateway start
|
|
220
168
|
```
|
|
221
169
|
|
|
222
|
-
|
|
223
|
-
|
|
170
|
+
Interactive bot-token entry is hidden. Do not use `--token` in a normal shell;
|
|
171
|
+
arguments can be retained in history or visible to other local processes. For a
|
|
172
|
+
holder beta, do not run one shared messaging bot without a separate holder
|
|
173
|
+
admission layer and per-user session isolation.
|
|
174
|
+
|
|
175
|
+
## Public wallet addresses and portfolio reads
|
|
224
176
|
|
|
225
|
-
|
|
226
|
-
by something that is not you: a synced backup, a stolen laptop at rest, an
|
|
227
|
-
overly-broad `chmod`, a leaked tarball. It does **not** defend against malware
|
|
228
|
-
running as your user while the vault is unlocked. Nothing file-based does. If
|
|
229
|
-
you need that, use a hardware wallet and the prepare-only path.
|
|
177
|
+
Portfolio and approval reads use public addresses only:
|
|
230
178
|
|
|
231
179
|
```bash
|
|
232
|
-
|
|
233
|
-
|
|
180
|
+
export ORACLE_EVM_ADDRESS=0x...
|
|
181
|
+
export ORACLE_SOLANA_ADDRESS=...
|
|
182
|
+
export ORACLE_BITCOIN_ADDRESS=bc1...
|
|
183
|
+
export ORACLE_HYPERLIQUID_ADDRESS=0x... # optional; EVM address is the fallback
|
|
184
|
+
oracle data serve
|
|
234
185
|
```
|
|
235
186
|
|
|
236
|
-
|
|
187
|
+
Missing address families are reported as `not-configured`, provider failures as
|
|
188
|
+
`unavailable`, and unsupported families as `unsupported`. They are never
|
|
189
|
+
reported as zero. Portfolio history is stored profile-locally with mode `0600`
|
|
190
|
+
and contains public-address fingerprints and value observations, not wallet
|
|
191
|
+
keys or prepared transactions.
|
|
237
192
|
|
|
238
|
-
##
|
|
193
|
+
## Preparing an action
|
|
239
194
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
Oracle prepares, your wallet signs:
|
|
195
|
+
Preparation requires the real wallet that will sign. Placeholder and burn
|
|
196
|
+
addresses are rejected.
|
|
243
197
|
|
|
244
198
|
```js
|
|
245
|
-
import { data } from "
|
|
199
|
+
import { data } from "@oracle-agent/oracle";
|
|
246
200
|
|
|
247
|
-
const
|
|
248
|
-
|
|
201
|
+
const prepared = await data.call("hl-perps", "prepareOrder", {
|
|
202
|
+
/* exact market, side, size, limits, and owner wallet */
|
|
249
203
|
});
|
|
250
|
-
|
|
251
|
-
// order.action + order.signingReady === false
|
|
252
|
-
// Hand order.action to the user's wallet. Oracle is done.
|
|
253
204
|
```
|
|
254
205
|
|
|
255
|
-
|
|
206
|
+
Review the chain, destination, calldata or typed data, amount, minimum output,
|
|
207
|
+
expiry, approvals, and fees in the user's wallet. Oracle's public package stops
|
|
208
|
+
before signing. Report success only after a real transaction hash, successful
|
|
209
|
+
receipt, and expected balance or state change.
|
|
256
210
|
|
|
257
|
-
|
|
258
|
-
[`@oracle-agent/operator`](https://github.com/demi-hl/oracle-operator) on your
|
|
259
|
-
machine with your key. Import `hlSignAndSubmit` from that package — never from
|
|
260
|
-
this one. Do not expose it on a public HTTP port.
|
|
211
|
+
## Locals-only holder beta
|
|
261
212
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
213
|
+
Current release status is **HOLD for a holder-gated hosted launch**. The package
|
|
214
|
+
is safe to distribute for local read/research/prepare use, but this repository
|
|
215
|
+
does not contain an integrated Locals ownership gate. UI hiding, a wallet text
|
|
216
|
+
field, or possession of a URL is not access control.
|
|
266
217
|
|
|
267
|
-
|
|
218
|
+
Do not invite holders to a hosted surface until every required gate in
|
|
219
|
+
[holder-beta.md](docs/holder-beta.md) passes.
|
|
268
220
|
|
|
269
|
-
##
|
|
221
|
+
## Buzz integration
|
|
270
222
|
|
|
271
|
-
Oracle
|
|
272
|
-
|
|
273
|
-
|
|
223
|
+
Oracle includes a public, unsigned Buzz HTTP contract. It does not embed the
|
|
224
|
+
private executor and it does not turn Buzz into a custody surface. Setup,
|
|
225
|
+
endpoints, and deployment status rules are documented in
|
|
226
|
+
[buzz-integration.md](docs/buzz-integration.md).
|
|
227
|
+
|
|
228
|
+
## Doctor output
|
|
274
229
|
|
|
275
230
|
```bash
|
|
276
|
-
|
|
277
|
-
npx oracle-data-mcp # MCP stdio server, works with any MCP client (needs oracle-data up)
|
|
231
|
+
oracle doctor --json
|
|
278
232
|
```
|
|
279
233
|
|
|
280
|
-
|
|
234
|
+
A clean standalone install can legitimately show warnings for:
|
|
281
235
|
|
|
282
|
-
|
|
283
|
-
|
|
236
|
+
- `data_server` when `oracle data serve` is not running;
|
|
237
|
+
- `agent_runtime` when optional Hermes is not installed;
|
|
238
|
+
- `hermes_lanes` before optional `oracle init --apply`.
|
|
284
239
|
|
|
285
|
-
-
|
|
286
|
-
|
|
287
|
-
a limit order into a market order.
|
|
288
|
-
- **Risk review** — the strongest model available, because this is the one that
|
|
289
|
-
says no.
|
|
290
|
-
- **Alerts and crons** — small and cheap, running unattended all day.
|
|
240
|
+
A Node-version failure is blocking. Signing warnings are irrelevant to the
|
|
241
|
+
public holder path because signing is not installed there.
|
|
291
242
|
|
|
292
|
-
|
|
293
|
-
its own memory, its own key scope. The research profile can hold no signing key
|
|
294
|
-
at all. The execution profile can hold one but run a fast model. The risk
|
|
295
|
-
profile can be the expensive model that reviews what the others propose.
|
|
243
|
+
## Upgrade
|
|
296
244
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
245
|
+
```bash
|
|
246
|
+
npm i -g @oracle-agent/oracle@latest
|
|
247
|
+
oracle --version
|
|
248
|
+
oracle doctor
|
|
249
|
+
```
|
|
300
250
|
|
|
301
|
-
|
|
302
|
-
-
|
|
303
|
-
than the one being signed
|
|
304
|
-
- a spending guard that authorized any amount when both limit fields were
|
|
305
|
-
omitted
|
|
306
|
-
- a cap passed as a JS number above 2^53 that silently rounded **upward**
|
|
251
|
+
Review release notes before upgrading a machine that also runs private
|
|
252
|
+
owner-operated infrastructure.
|
|
307
253
|
|
|
308
|
-
|
|
309
|
-
routing is what makes running several practical instead of theoretical.
|
|
254
|
+
## Uninstall
|
|
310
255
|
|
|
311
|
-
|
|
312
|
-
|
|
256
|
+
```bash
|
|
257
|
+
npm rm -g @oracle-agent/oracle
|
|
258
|
+
```
|
|
313
259
|
|
|
314
|
-
|
|
260
|
+
The CLI does not silently delete local configuration or credentials. Remove
|
|
261
|
+
those separately only after confirming they are no longer needed.
|
|
315
262
|
|
|
316
|
-
|
|
263
|
+
## Build and test from source
|
|
317
264
|
|
|
318
265
|
```bash
|
|
319
|
-
|
|
320
|
-
|
|
266
|
+
git clone https://github.com/demi-hl/oracle.git
|
|
267
|
+
cd oracle
|
|
268
|
+
npm ci --no-audit --no-fund
|
|
269
|
+
npm run gate:release
|
|
270
|
+
npm run test:boundary
|
|
271
|
+
npm test
|
|
272
|
+
npm run typecheck
|
|
273
|
+
npm run build
|
|
274
|
+
npm run scan:secrets
|
|
321
275
|
```
|
|
322
276
|
|
|
323
|
-
|
|
277
|
+
The repository may be private or ahead of npm while a release is being staged.
|
|
278
|
+
The npm artifact remains the public installation source.
|
|
324
279
|
|
|
325
|
-
##
|
|
280
|
+
## Troubleshooting
|
|
326
281
|
|
|
327
|
-
###
|
|
328
|
-
```js
|
|
329
|
-
const prep = await data.call("hl-perps", "prepareOrder", {
|
|
330
|
-
coin: "xyz:TSLA", side: "buy", type: "limit", price: "250", size: "1",
|
|
331
|
-
});
|
|
332
|
-
await hlSignAndSubmit(prep, { keyFile, userInitiated: true });
|
|
333
|
-
// or signViaDaemon({ surface: "hl", prepared: prep, userInitiated: true })
|
|
334
|
-
```
|
|
282
|
+
### `oracle` says no provider is configured
|
|
335
283
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
const prep = await data.call("hl-outcome", "prepareOrder", {
|
|
339
|
-
outcome: 969, side: "yes", // or coin: "#9690"
|
|
340
|
-
side: "buy", type: "limit", price: "0.42", size: "20",
|
|
341
|
-
});
|
|
342
|
-
await hlSignAndSubmit(prep, { keyFile, userInitiated: true });
|
|
343
|
-
```
|
|
284
|
+
Run `oracle auth login <provider>` or `oracle auth api-key <provider>`, then
|
|
285
|
+
confirm with `oracle auth status`.
|
|
344
286
|
|
|
345
|
-
###
|
|
346
|
-
```js
|
|
347
|
-
const prep = await data.call("poly-clob", "prepareOrder", {
|
|
348
|
-
tokenId, side: "BUY", price: 0.45, size: 10,
|
|
349
|
-
maker: eoa, signer: eoa, tickSize: "0.01",
|
|
350
|
-
});
|
|
351
|
-
// signer process needs POLYMARKET_API_KEY/SECRET/PASSPHRASE + key
|
|
352
|
-
await polySignAndSubmit(prep, { keyFile, userInitiated: true });
|
|
353
|
-
// or signViaDaemon({ surface: "poly", prepared: prep, userInitiated: true })
|
|
354
|
-
```
|
|
287
|
+
### `oracle setup` says the local runtime is missing
|
|
355
288
|
|
|
356
|
-
|
|
289
|
+
Messaging uses optional Hermes. Run `oracle bootstrap`, then retry setup.
|
|
290
|
+
Standalone chat, chain selection, and public read/prepare commands do not require
|
|
291
|
+
Hermes.
|
|
357
292
|
|
|
358
|
-
|
|
293
|
+
### `oracle doctor` says the data server is down
|
|
359
294
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
cd protocols/templates/safe-erc20 && forge install && forge test
|
|
363
|
-
npm run protocol:gate -- safe-erc20
|
|
364
|
-
```
|
|
295
|
+
Start it in another terminal with `oracle data serve`. Do not expose port `8787`
|
|
296
|
+
off-host.
|
|
365
297
|
|
|
366
|
-
|
|
367
|
-
**Not a paid security-firm audit** — see each template `SECURITY.md`.
|
|
298
|
+
### The public API or Buzz endpoint is unreachable
|
|
368
299
|
|
|
300
|
+
Start `oracle public serve --port 8799` and verify `/public/health`. Do not claim
|
|
301
|
+
the API is live based on the static site or source code alone.
|
|
369
302
|
|
|
370
|
-
|
|
303
|
+
### A prepared action cannot be signed
|
|
371
304
|
|
|
372
|
-
|
|
305
|
+
That is expected in the public package. Hand the reviewed artifact to a
|
|
306
|
+
user-controlled wallet. Do not install or request private owner infrastructure
|
|
307
|
+
as a workaround.
|
|
373
308
|
|
|
374
|
-
|
|
375
|
-
# same secret on prepare host and signer host (not in the agent chat)
|
|
376
|
-
export ORACLE_STAMP_HMAC_SECRET='long-random-secret'
|
|
377
|
-
# signer-only: refuse envelopes without MAC
|
|
378
|
-
export ORACLE_STAMP_REQUIRE_MAC=1
|
|
379
|
-
```
|
|
309
|
+
## References
|
|
380
310
|
|
|
381
|
-
|
|
311
|
+
- [CLI reference](docs/cli.md)
|
|
312
|
+
- [Public API and environment surface](docs/public-surface.md)
|
|
313
|
+
- [Locals-holder beta launch gate](docs/holder-beta.md)
|
|
314
|
+
- [Buzz integration](docs/buzz-integration.md)
|
|
315
|
+
- [Architecture](docs/architecture.md)
|
|
316
|
+
- [Security policy](SECURITY.md)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createHash as m}from"node:crypto";import{wordlists as g}from"ethers";var A=1,E=new Set(["privatekey","privkey","secretkey","seedphrase","seed","mnemonic","passphrase","password","keystore","keymaterial","wif","xprv","xpriv","bearer","authorization","signature","apikey","credential"]),x=[/\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,/\bxprv[0-9A-Za-z]{50,}\b/],$=new Set([12,15,18,21,24]);function S(e){let t=String(e).trim().toLowerCase().split(/\s+/).filter(Boolean);return $.has(t.length)&&t.every(r=>g.en.getWordIndex(r)>=0)}var H=/^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/,O=/(hash|digest|root|salt|nonce|proof|commitment|sig|id)(?:e?s)?$/i,j=new Set(["calldata","data","publickey","pubkey","message","payload","input","extradata"]);function T(e){let t=b(e);return j.has(t)||O.test(t)}var f=class extends Error{constructor(t){super(`action receipt refused: secret-bearing field at ${t}`),this.name="ActionReceiptSecretError",this.code="ACTION_RECEIPT_SECRET"}};function b(e){return String(e).replace(/[^a-z0-9]/gi,"").toLowerCase()}function C(e){let t=b(e);return[...E].some(r=>t.includes(r))}function _(e,t,r){if(typeof t=="string"){if(x.some(o=>o.test(t))||S(t))throw new f(r);if(H.test(t)&&!T(e))throw new f(r)}}function a(e,t="$",r=""){if(e==null||typeof e=="boolean")return e;if(typeof e=="string")return _(r,e,t),e;if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError(`action receipt: non-finite number at ${t}`);return e}if(typeof e=="bigint")return e.toString();if(Array.isArray(e))return e.map((n,i)=>a(n,`${t}[${i}]`,r));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError(`action receipt: JSON-like value required at ${t}`);let o={};for(let n of Object.keys(e).sort()){let i=`${t}.${n}`;if(C(n))throw new f(i);e[n]!==void 0&&(o[n]=a(e[n],i,n))}return o}function L(e){return a(e)}function d(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(d).join(",")}]`:`{${Object.keys(e).map(t=>`${JSON.stringify(t)}:${d(e[t])}`).join(",")}}`}function R(e){return d(a(e))}function k(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("action receipt: object required");let{receiptId:t,summary:r,...o}=e;return m("sha256").update(R(o)).digest("hex")}function c(e,...t){for(let r of t)if(e[r]!==void 0)return e[r]}function s(e,t,r){let o=c(e,...t);if(o==null)throw new TypeError(`action receipt: ${r} required`);return o}function I(e){let t=c(e,"balances","balanceChanges"),r=c(e,"beforeBalances","balancesBefore","before"),o=c(e,"afterBalances","balancesAfter","after");return t!==void 0?{balances:t}:r===void 0&&o===void 0?{}:{balances:{...r===void 0?{}:{before:r},...o===void 0?{}:{after:o}}}}function N(e={}){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("action receipt: input object required");a(e);let t=c(e,"txHash","transactionHash"),r=c(e,"phase","stage","resultType")??(t==null?"prepare":"execute");if(r!=="prepare"&&r!=="execute")throw new TypeError('action receipt: phase must be "prepare" or "execute"');let o={receiptVersion:A,phase:r,intent:s(e,["intent"],"intent"),route:s(e,["route"],"route"),decodedAction:s(e,["decodedAction","action"],"decodedAction"),policyChecks:s(e,["policyChecks","checks"],"policyChecks"),allowlistHits:s(e,["allowlistHits","allowlistMatches"],"allowlistHits"),prepareHash:s(e,["prepareHash"],"prepareHash"),...t==null?{}:{txHash:t},...I(e)},n=a(o);return Object.freeze({...n,receiptId:k(n)})}var q=N;function u(e,t=[]){if(typeof e=="string"||typeof e=="number")return String(e);for(let r of t)if(e?.[r]!=null)return String(e[r]);return"recorded"}function y(e){if(typeof e=="boolean")return e;if(e&&typeof e=="object"){if(typeof e.ok=="boolean")return e.ok;if(typeof e.allowed=="boolean")return e.allowed;if(typeof e.passed=="boolean")return e.passed}return null}function z(e){if(!e||typeof e!="object")throw new TypeError("action receipt: object required");let t=u(e.decodedAction,["type","action","method","name"]),r=u(e.route,["name","provider","venue","id"]),o=Array.isArray(e.policyChecks)?e.policyChecks:Object.values(e.policyChecks||{}),n=o.filter(l=>y(l)===!0).length,i=o.filter(l=>y(l)===!1).length,p=Array.isArray(e.allowlistHits)?e.allowlistHits.length:Object.keys(e.allowlistHits||{}).length,h=e.txHash==null?"no transaction hash":`tx ${e.txHash}`,w=e.balances==null?"balances not provided":"before/after balances recorded";return`${e.phase} ${t} via ${r}; policy ${n} passed, ${i} failed; ${p} allowlist hit${p===1?"":"s"}; ${h}; ${w}; receipt ${e.receiptId}`}var F=z;export{A as ACTION_RECEIPT_VERSION,f as ActionReceiptSecretError,L as assertNoReceiptSecrets,R as canonicalReceiptJson,k as computeReceiptId,q as createActionReceipt,F as formatActionReceipt,N as normalizeActionReceipt,z as summarizeActionReceipt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.freeze({ALERT_ONLY:"alert_only",EXECUTE:"execute"}),i=new Set(["watch","watch this","ping","ping me","alert","notify"]),r=new Set(["watching","armed"]);function a(t){if(typeof t!="string"||!t.trim())throw new TypeError("explicit action verb required");let e=t.trim().toLowerCase().replace(/\s+/g," ");if(i.has(e))return o.ALERT_ONLY;if(e==="arm")return o.EXECUTE;throw new TypeError(`unsupported action verb: ${e}`)}function c(t={}){let{verb:e,...n}=t;return{...n,active:!0,actionMode:a(e)}}function u(t){if(!t||typeof t!="object"||typeof t.active!="boolean")throw new TypeError("active must be boolean");if(!Object.values(o).includes(t.actionMode))throw new TypeError("actionMode must be alert_only or execute");return t}function E(t){return t?.active===!0&&t?.actionMode===o.ALERT_ONLY}function s(t){return t?.active===!0&&t?.actionMode===o.EXECUTE}function p(t={}){if(t.actionMode!==void 0&&t.actionMode!==o.ALERT_ONLY)throw new TypeError("non-alert record cannot enter alert-only watch migration");let e=typeof t.active=="boolean"?t.active:r.has(String(t.status||"").toLowerCase());return{...t,active:e,actionMode:o.ALERT_ONLY}}export{o as ACTION_MODES,a as actionModeForVerb,u as assertActionRecord,c as createActionRecord,E as isActiveAlert,s as isActiveExecution,p as migrateLegacyWatchRecord};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import c from"node:fs";import d from"node:path";import{homedir as b}from"node:os";import{join as h}from"node:path";var w=h(b(),".config","oracle"),z=h(b(),".config","mad-desk");function m(e,r,t=""){let o=process.env[e];if(o!=null&&String(o).trim()!=="")return o;let n=r?process.env[r]:void 0;return n!=null&&String(n).trim()!==""?n:t}var g=/^0x[0-9a-fA-F]{40}$/,_=new Set(["privatekey","private_key","secret","seed","mnemonic","passphrase","signature","keystore"]),D=["privatekey","privkey","secretkey","secret","seedphrase","seed","mnemonic","passphrase","password","keystore","keymaterial","signature","wif","xprv","xpriv","apikey","bearer","credential"],O=[/\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,/\bxprv[0-9A-Za-z]{50,}\b/,/\b(?:[a-z]{3,8}\s+){11,}[a-z]{3,8}\b/i],y=/^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/;function I(e){return String(e).toLowerCase().replace(/[^a-z0-9]/g,"")}function L(e,r){let t=I(e);if(_.has(String(e).toLowerCase())||D.some(o=>t.includes(o)))throw new Error(`address-book: ${r} is forbidden; the book stores labels, never key material`)}function N(e,r){if(typeof e=="string"&&(O.some(t=>t.test(e))||y.test(e)))throw new Error(`address-book: ${r} looks like key material; the book stores labels, never key material`)}function E(){let e=m("ORACLE_ADDRESS_BOOK","MAD_ADDRESS_BOOK","");if(e)return d.resolve(e);let r=m("ORACLE_CONFIG_DIR","MAD_CONFIG_DIR",w);return d.join(r,"address-book.json")}function p(e,r="field"){if(Array.isArray(e)){e.forEach((t,o)=>p(t,`${r}[${o}]`));return}if(!e||typeof e!="object"){N(e,r);return}for(let[t,o]of Object.entries(e))L(t,t),p(o,t)}function S(e){let r=String(e||"").trim();if(!g.test(r))throw new Error("address-book: address must be 0x + 40 hex characters");return r.toLowerCase()}function a(e,r){return e==null||e===""?null:String(e).slice(0,r)}function k(){return{version:1,updatedAt:null,entries:[]}}function x(e){return{address:String(e.address).toLowerCase(),label:a(e.label,80)||"unknown",who:a(e.who,120),role:a(e.role,40),chainIds:Array.isArray(e.chainIds)?e.chainIds.map(Number).filter(Number.isFinite):[],notes:a(e.notes,500),source:a(e.source,80),firstSeenAt:e.firstSeenAt||null,lastSeenAt:e.lastSeenAt||null}}function l(){try{let e=JSON.parse(c.readFileSync(E(),"utf8"));if(!e||typeof e!="object")return k();let r=Array.isArray(e.entries)?e.entries:[];return{version:1,updatedAt:e.updatedAt||null,entries:r.filter(t=>t&&typeof t=="object"&&g.test(String(t.address||""))).map(x)}}catch{return k()}}function v(e){let r=E();c.mkdirSync(d.dirname(r),{recursive:!0,mode:448});let t={...e,version:1,updatedAt:new Date().toISOString()},o=d.join(d.dirname(r),`.address-book.${process.pid}.tmp`);c.writeFileSync(o,`${JSON.stringify(t,null,2)}
|
|
2
|
+
`,{mode:384}),c.renameSync(o,r);try{c.chmodSync(r,384)}catch{}return t}function G(e={}){let r=l(),t=r.entries;if(e.role&&(t=t.filter(o=>o.role===String(e.role))),e.who){let o=String(e.who).toLowerCase();t=t.filter(n=>(n.who||"").toLowerCase().includes(o)||(n.label||"").toLowerCase().includes(o))}if(e.q){let o=String(e.q).toLowerCase();t=t.filter(n=>n.address.includes(o)||(n.label||"").toLowerCase().includes(o)||(n.who||"").toLowerCase().includes(o)||(n.notes||"").toLowerCase().includes(o))}return{updatedAt:r.updatedAt,count:t.length,entries:t}}function P(e){let r=S(e),t=l().entries.filter(o=>o.address===r);return{address:r,found:t.length>0,entries:t}}function q(e={}){p(e);let r=S(e.address),t=a(e.label??e.role,80)||"wallet",o=new Date().toISOString(),n=l(),i=n.entries.findIndex(s=>s.address===r&&s.label===t),u=x({address:r,label:t,who:e.who,role:e.role,chainIds:e.chainIds,notes:e.notes,source:e.source||"agent",firstSeenAt:i>=0&&n.entries[i].firstSeenAt||o,lastSeenAt:o});i>=0?n.entries[i]=u:n.entries.push(u);let A=s=>s==="agent"?0:s==="owner"?1:2;n.entries.sort((s,f)=>A(s.role)-A(f.role)||s.label.localeCompare(f.label)||s.address.localeCompare(f.address));let C=v(n);return{ok:!0,entry:u,count:C.entries.length}}function Y(e,r=null){let t=S(e),o=l(),n=o.entries.length;return o.entries=o.entries.filter(i=>i.address!==t?!0:r==null?!1:i.label!==String(r)),v(o),{ok:!0,removed:n-o.entries.length,count:o.entries.length}}export{E as addressBookPath,Y as forgetAddress,G as listAddresses,P as lookupAddress,l as readAddressBook,q as rememberAddress};
|