@oracle-agent/oracle 0.11.0 → 0.13.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 +13 -516
- package/bin/oracle.mjs +19 -27
- package/package.json +15 -98
- package/CONTRIBUTING.md +0 -98
- package/SECURITY.md +0 -89
- package/SETUP.md +0 -381
- package/artifacts/inscription/oracle-was-here-preview.png +0 -0
- package/artifacts/inscription/oracle-was-here.svg +0 -1
- package/artifacts/specialist-packs/oracle-full-crypto.json +0 -295
- package/bin/desk-server.mjs +0 -440
- package/bin/oracle-data-mcp.mjs +0 -1019
- 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/docs/adding-a-chain.md +0 -229
- package/docs/architecture.md +0 -138
- 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 -151
- package/docs/public-surface.md +0 -133
- 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/public/agent-connect/app.js +0 -84
- package/public/agent-connect/index.html +0 -83
- package/public/agent-connect/styles.css +0 -70
- package/public/index.html +0 -12
- package/public/oracle-console/app.js +0 -272
- package/public/oracle-console/bitcoin-wallets.js +0 -206
- package/public/oracle-console/index.html +0 -91
- package/public/oracle-console/styles.css +0 -239
- package/public/oracle-splash/assets/cli-chain-hyperliquid.jpg +0 -0
- package/public/oracle-splash/assets/hero/orb.avif +0 -0
- package/public/oracle-splash/assets/hero/orb.webm +0 -0
- package/public/oracle-splash/assets/llms/claude.svg +0 -1
- package/public/oracle-splash/assets/llms/codex-icon.svg +0 -1
- package/public/oracle-splash/assets/llms/codex.svg +0 -1
- package/public/oracle-splash/assets/llms/cursor-icon.svg +0 -12
- package/public/oracle-splash/assets/llms/cursor.svg +0 -17
- package/public/oracle-splash/assets/llms/deepseek.svg +0 -1
- package/public/oracle-splash/assets/llms/gemini-icon.svg +0 -1
- package/public/oracle-splash/assets/llms/gemini.svg +0 -1
- package/public/oracle-splash/assets/llms/grok.svg +0 -8
- package/public/oracle-splash/assets/llms/hermes.png +0 -0
- package/public/oracle-splash/assets/llms/kimi-icon.svg +0 -1
- package/public/oracle-splash/assets/llms/kimi.svg +0 -1
- package/public/oracle-splash/assets/llms/manus.svg +0 -18
- package/public/oracle-splash/assets/llms/openclaw.svg +0 -22
- package/public/oracle-splash/assets/llms/perplexity.svg +0 -1
- package/public/oracle-splash/assets/llms/qwen.svg +0 -1
- package/public/oracle-splash/assets/llms/windsurf.svg +0 -1
- package/public/oracle-splash/assets/protocols/abcdex.png +0 -0
- package/public/oracle-splash/assets/protocols/across.png +0 -0
- package/public/oracle-splash/assets/protocols/aerodrome.png +0 -0
- package/public/oracle-splash/assets/protocols/balancer.png +0 -0
- package/public/oracle-splash/assets/protocols/cowswap.png +0 -0
- package/public/oracle-splash/assets/protocols/curve.png +0 -0
- package/public/oracle-splash/assets/protocols/dreamcash.png +0 -0
- package/public/oracle-splash/assets/protocols/felix.png +0 -0
- package/public/oracle-splash/assets/protocols/gmx.png +0 -0
- package/public/oracle-splash/assets/protocols/hyena.png +0 -0
- package/public/oracle-splash/assets/protocols/hyperbeat.png +0 -0
- package/public/oracle-splash/assets/protocols/hyperliquid.png +0 -0
- package/public/oracle-splash/assets/protocols/hyperswap.png +0 -0
- package/public/oracle-splash/assets/protocols/jupiter.png +0 -0
- package/public/oracle-splash/assets/protocols/kinetiq.png +0 -0
- package/public/oracle-splash/assets/protocols/lfj.png +0 -0
- package/public/oracle-splash/assets/protocols/lifi.png +0 -0
- package/public/oracle-splash/assets/protocols/magic-eden.png +0 -0
- package/public/oracle-splash/assets/protocols/morpho.png +0 -0
- package/public/oracle-splash/assets/protocols/odos.png +0 -0
- package/public/oracle-splash/assets/protocols/oneinch.png +0 -0
- package/public/oracle-splash/assets/protocols/opensea.png +0 -0
- package/public/oracle-splash/assets/protocols/pancakeswap.png +0 -0
- package/public/oracle-splash/assets/protocols/paragon.png +0 -0
- package/public/oracle-splash/assets/protocols/paraswap.png +0 -0
- package/public/oracle-splash/assets/protocols/pendle.png +0 -0
- package/public/oracle-splash/assets/protocols/polymarket.png +0 -0
- package/public/oracle-splash/assets/protocols/quickswap.png +0 -0
- package/public/oracle-splash/assets/protocols/relay.png +0 -0
- package/public/oracle-splash/assets/protocols/stargate.png +0 -0
- package/public/oracle-splash/assets/protocols/tradexyz.png +0 -0
- package/public/oracle-splash/assets/protocols/uniswap.png +0 -0
- package/public/oracle-splash/assets/protocols/velodrome.png +0 -0
- package/public/oracle-splash/assets/protocols/ventuals.png +0 -0
- package/public/oracle-splash/assets/wordmarks/across-icon.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/across.svg +0 -4
- package/public/oracle-splash/assets/wordmarks/aerodrome.svg +0 -23
- package/public/oracle-splash/assets/wordmarks/balancer.svg +0 -3
- package/public/oracle-splash/assets/wordmarks/cowswap.svg +0 -1
- package/public/oracle-splash/assets/wordmarks/curve.png +0 -0
- package/public/oracle-splash/assets/wordmarks/gmx.svg +0 -13
- package/public/oracle-splash/assets/wordmarks/hop-icon.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/hyena.svg +0 -7
- package/public/oracle-splash/assets/wordmarks/hyperliquid.svg +0 -21
- package/public/oracle-splash/assets/wordmarks/hyperswap.svg +0 -13
- package/public/oracle-splash/assets/wordmarks/jupiter.svg +0 -35
- package/public/oracle-splash/assets/wordmarks/kinetiq.svg +0 -1
- package/public/oracle-splash/assets/wordmarks/lfj.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/lifi.png +0 -0
- package/public/oracle-splash/assets/wordmarks/magic-eden.svg +0 -1
- package/public/oracle-splash/assets/wordmarks/markets.svg +0 -1
- package/public/oracle-splash/assets/wordmarks/morpho.svg +0 -1
- package/public/oracle-splash/assets/wordmarks/odos.svg +0 -3
- package/public/oracle-splash/assets/wordmarks/oneinch-icon.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/oneinch.svg +0 -6
- package/public/oracle-splash/assets/wordmarks/opensea-icon.svg +0 -17
- package/public/oracle-splash/assets/wordmarks/opensea.svg +0 -1
- package/public/oracle-splash/assets/wordmarks/outcome.svg +0 -16
- package/public/oracle-splash/assets/wordmarks/pancakeswap.svg +0 -18
- package/public/oracle-splash/assets/wordmarks/paragon.svg +0 -9
- package/public/oracle-splash/assets/wordmarks/paraswap.svg +0 -16
- package/public/oracle-splash/assets/wordmarks/pendle.png +0 -0
- package/public/oracle-splash/assets/wordmarks/polymarket.png +0 -0
- package/public/oracle-splash/assets/wordmarks/quickswap.png +0 -0
- package/public/oracle-splash/assets/wordmarks/relay.svg +0 -8
- package/public/oracle-splash/assets/wordmarks/satflow-icon.png +0 -0
- package/public/oracle-splash/assets/wordmarks/stargate-icon.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/stargate.svg +0 -15
- package/public/oracle-splash/assets/wordmarks/uniswap.svg +0 -18
- package/public/oracle-splash/assets/wordmarks/velodrome.svg +0 -84
- package/public/oracle-splash/assets/wordmarks/xyz.svg +0 -12
- package/public/oracle-splash/assets/wordmarks/zerox-icon.webp +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/favicon.ico +0 -0
- package/public/oracle-splash/favicon.svg +0 -6
- package/public/oracle-splash/index.html +0 -1558
- package/public/oracle-splash/mesh-graph.png +0 -0
- package/public/oracle-splash/mesh-graph.svg +0 -216
- package/scripts/adversarial-bench.mjs +0 -114
- package/scripts/build-inscription.py +0 -230
- package/scripts/check-doc-drift.mjs +0 -123
- 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 -265
- 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 -75
- package/src/cli/commands/doctor.mjs +0 -136
- 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 -585
- package/src/data/desk-data.mjs +0 -695
- 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 -225
- 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-venues.mjs +0 -119
- package/src/data/providers/jupiter.mjs +0 -315
- package/src/data/providers/lifi.mjs +0 -151
- package/src/data/providers/magiceden-sol.mjs +0 -406
- package/src/data/providers/morpho.mjs +0 -177
- 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 -188
- 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 -341
- package/src/data/providers/signed-material-guard.mjs +0 -108
- package/src/data/providers/solana-rpc.mjs +0 -197
- package/src/data/providers/uniswap-v3.mjs +0 -349
- package/src/data/providers/uniswap-v4.mjs +0 -414
- 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 -204
- 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 -398
- package/src/router/proposal.mjs +0 -311
- package/src/router/risk-classifier.mjs +0 -119
- package/src/router/route-sources.mjs +0 -364
- 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
|
@@ -1,434 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { spawnSync } from "node:child_process";
|
|
4
|
-
import { PACKAGE_ROOT, hermesRoot, ensureDir } from "../paths.mjs";
|
|
5
|
-
import { activeChainEnv } from "../chain-state.mjs";
|
|
6
|
-
import { readModelConfig } from "../model-config.mjs";
|
|
7
|
-
import { spawnChild } from "../spawn-child.mjs";
|
|
8
|
-
import { resolveHermes } from "../runtime.mjs";
|
|
9
|
-
import { runOracleTui } from "../../tui/app.mjs";
|
|
10
|
-
import { resolveChatBackend } from "../../tui/backend.mjs";
|
|
11
|
-
import { createStandaloneClient, runStandaloneQuery } from "../../tui/standalone-client.mjs";
|
|
12
|
-
import { getOAuthStore } from "../../auth/oauth.mjs";
|
|
13
|
-
|
|
14
|
-
const PROFILE = "oracle";
|
|
15
|
-
const SKIN_NAME = "oracle";
|
|
16
|
-
|
|
17
|
-
function which(bin) {
|
|
18
|
-
if (bin === "hermes") {
|
|
19
|
-
const r = resolveHermes();
|
|
20
|
-
return r.ok ? r.bin : null;
|
|
21
|
-
}
|
|
22
|
-
for (const dir of (process.env.PATH || "").split(path.delimiter)) {
|
|
23
|
-
const c = path.join(dir, bin);
|
|
24
|
-
try {
|
|
25
|
-
if (fs.existsSync(c)) return c;
|
|
26
|
-
} catch {}
|
|
27
|
-
}
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function pythonShebang(file) {
|
|
32
|
-
try {
|
|
33
|
-
const first = fs.readFileSync(file, "utf8").split(/\r?\n/, 1)[0];
|
|
34
|
-
if (!first.startsWith("#!")) return null;
|
|
35
|
-
const parts = first.slice(2).trim().split(/\s+/);
|
|
36
|
-
if (parts[0]?.endsWith("/env") && parts[1]?.startsWith("python")) {
|
|
37
|
-
return { command: parts[0], prefix: [parts[1]] };
|
|
38
|
-
}
|
|
39
|
-
if (path.basename(parts[0] || "").startsWith("python")) {
|
|
40
|
-
return { command: parts[0], prefix: parts.slice(1) };
|
|
41
|
-
}
|
|
42
|
-
} catch {}
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function resolveHermesPython(hermes) {
|
|
47
|
-
const direct = pythonShebang(hermes);
|
|
48
|
-
if (direct) return direct;
|
|
49
|
-
try {
|
|
50
|
-
const body = fs.readFileSync(hermes, "utf8");
|
|
51
|
-
const match = body.match(/["']([^"'\r\n]+\/bin\/hermes)["']/);
|
|
52
|
-
if (match) return pythonShebang(match[1]);
|
|
53
|
-
} catch {}
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function harnessSourcePath() {
|
|
58
|
-
return path.join(PACKAGE_ROOT, "src", "cli", "oracle-harness.py");
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function oracleHarnessInvocation(hermes, args) {
|
|
62
|
-
const harness = harnessSourcePath();
|
|
63
|
-
const runtime = process.env.ORACLE_PLAIN_HARNESS === "0"
|
|
64
|
-
? null
|
|
65
|
-
: resolveHermesPython(hermes);
|
|
66
|
-
if (runtime && fs.existsSync(harness)) {
|
|
67
|
-
return {
|
|
68
|
-
command: runtime.command,
|
|
69
|
-
args: [...runtime.prefix, harness, ...args],
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
return { command: hermes, args };
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function skinSourcePath() {
|
|
76
|
-
return path.join(PACKAGE_ROOT, "skins", "oracle.yaml");
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function ensureOracleProfile(profile = PROFILE) {
|
|
80
|
-
const src = path.join(PACKAGE_ROOT, "profiles", "oracle", "SOUL.md");
|
|
81
|
-
if (!fs.existsSync(src)) return { ok: false, reason: "oracle persona missing from package" };
|
|
82
|
-
const dest = path.join(hermesRoot(), "profiles", profile, "SOUL.md");
|
|
83
|
-
if (fs.existsSync(dest)) {
|
|
84
|
-
const current = fs.readFileSync(dest, "utf8");
|
|
85
|
-
if (!current.startsWith("You are Hermes Agent, an intelligent AI assistant created by Nous Research.")) {
|
|
86
|
-
return { ok: true, reused: true };
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
ensureDir(path.dirname(dest));
|
|
90
|
-
fs.copyFileSync(src, dest);
|
|
91
|
-
return { ok: true, reused: false };
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function ensureOracleSkin(profile = PROFILE) {
|
|
95
|
-
const src = skinSourcePath();
|
|
96
|
-
if (!fs.existsSync(src)) return { ok: false, reason: "skin missing from package" };
|
|
97
|
-
const rootSkins = path.join(hermesRoot(), "skins");
|
|
98
|
-
const profileSkins = path.join(hermesRoot(), "profiles", profile, "skins");
|
|
99
|
-
ensureDir(rootSkins);
|
|
100
|
-
ensureDir(profileSkins);
|
|
101
|
-
const body = fs.readFileSync(src, "utf8");
|
|
102
|
-
fs.writeFileSync(path.join(rootSkins, `${SKIN_NAME}.yaml`), body);
|
|
103
|
-
fs.writeFileSync(path.join(profileSkins, `${SKIN_NAME}.yaml`), body);
|
|
104
|
-
return { ok: true, skin: SKIN_NAME };
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function ensureQuickCommands(profile = PROFILE) {
|
|
108
|
-
// Install /chain and /setup as hermes quick commands that call oracle.
|
|
109
|
-
const cfgPath = path.join(hermesRoot(), "profiles", profile, "config.yaml");
|
|
110
|
-
if (!fs.existsSync(cfgPath)) return { ok: false, reason: "profile config missing" };
|
|
111
|
-
|
|
112
|
-
// Prefer a tiny sidecar json the chat skill can also read; hermes quick_commands
|
|
113
|
-
// live in config.yaml which we must not corrupt with naive YAML mutation.
|
|
114
|
-
// We install a hermes-facing skill command instead (see skills/oracle-chat).
|
|
115
|
-
const oracleBin = which("oracle") || path.join(PACKAGE_ROOT, "bin", "oracle.mjs");
|
|
116
|
-
const markerDir = path.join(hermesRoot(), "profiles", profile, "oracle");
|
|
117
|
-
ensureDir(markerDir);
|
|
118
|
-
const marker = {
|
|
119
|
-
profile,
|
|
120
|
-
skin: SKIN_NAME,
|
|
121
|
-
oracleBin,
|
|
122
|
-
commands: {
|
|
123
|
-
chain: [oracleBin, "chain"],
|
|
124
|
-
setup: [oracleBin, "setup"],
|
|
125
|
-
},
|
|
126
|
-
updatedAt: new Date().toISOString(),
|
|
127
|
-
};
|
|
128
|
-
fs.writeFileSync(
|
|
129
|
-
path.join(markerDir, "chat-surface.json"),
|
|
130
|
-
JSON.stringify(marker, null, 2) + "\n",
|
|
131
|
-
{ mode: 0o600 },
|
|
132
|
-
);
|
|
133
|
-
return { ok: true, marker };
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function ensureSkillCommands(profile = PROFILE) {
|
|
137
|
-
const srcDir = path.join(PACKAGE_ROOT, "skills", "oracle-chat");
|
|
138
|
-
if (!fs.existsSync(srcDir)) return { ok: false, reason: "oracle-chat skill missing" };
|
|
139
|
-
const destRoot = path.join(hermesRoot(), "profiles", profile, "skills", "oracle-chat");
|
|
140
|
-
ensureDir(destRoot);
|
|
141
|
-
for (const name of fs.readdirSync(srcDir)) {
|
|
142
|
-
const from = path.join(srcDir, name);
|
|
143
|
-
const to = path.join(destRoot, name);
|
|
144
|
-
if (fs.statSync(from).isFile()) {
|
|
145
|
-
fs.copyFileSync(from, to);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
// Also install under profile skills root aliases for /chain and /setup.
|
|
149
|
-
for (const slug of ["chain", "setup"]) {
|
|
150
|
-
const aliasDir = path.join(hermesRoot(), "profiles", profile, "skills", slug);
|
|
151
|
-
ensureDir(aliasDir);
|
|
152
|
-
const skillMd = path.join(srcDir, `${slug}.SKILL.md`);
|
|
153
|
-
const fallback = path.join(srcDir, "SKILL.md");
|
|
154
|
-
const body = fs.existsSync(skillMd)
|
|
155
|
-
? fs.readFileSync(skillMd, "utf8")
|
|
156
|
-
: fs.readFileSync(fallback, "utf8");
|
|
157
|
-
fs.writeFileSync(path.join(aliasDir, "SKILL.md"), body);
|
|
158
|
-
}
|
|
159
|
-
return { ok: true };
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function setDisplaySkin(profile = PROFILE) {
|
|
163
|
-
const hermes = which("hermes");
|
|
164
|
-
if (!hermes) return { ok: false, reason: "hermes missing" };
|
|
165
|
-
// hermes config set is safe; avoids hand-editing yaml.
|
|
166
|
-
const r = spawnSync(
|
|
167
|
-
hermes,
|
|
168
|
-
["-p", profile, "config", "set", "display.skin", SKIN_NAME],
|
|
169
|
-
{ encoding: "utf8", timeout: 30_000 },
|
|
170
|
-
);
|
|
171
|
-
if (r.status !== 0) {
|
|
172
|
-
return {
|
|
173
|
-
ok: false,
|
|
174
|
-
reason: (r.stderr || r.stdout || "config set failed").trim(),
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
return { ok: true };
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function hasModelConfig(file) {
|
|
181
|
-
if (!fs.existsSync(file)) return false;
|
|
182
|
-
const text = fs.readFileSync(file, "utf8");
|
|
183
|
-
if (/^model:\s*\S+/m.test(text)) return true;
|
|
184
|
-
const block = text.match(/^model:\s*\n((?:[ \t]+.*(?:\n|$))*)/m)?.[1] || "";
|
|
185
|
-
return /^\s+(?:default|provider):\s*\S+/m.test(block);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function hasProviderCredentials(profile = PROFILE) {
|
|
189
|
-
const root = hermesRoot();
|
|
190
|
-
if (fs.existsSync(path.join(root, "auth.json"))) return true;
|
|
191
|
-
if (fs.existsSync(path.join(root, "profiles", profile, "auth.json"))) return true;
|
|
192
|
-
const keys = [
|
|
193
|
-
"OPENROUTER_API_KEY",
|
|
194
|
-
"ANTHROPIC_API_KEY",
|
|
195
|
-
"OPENAI_API_KEY",
|
|
196
|
-
"XAI_API_KEY",
|
|
197
|
-
"GOOGLE_API_KEY",
|
|
198
|
-
"GEMINI_API_KEY",
|
|
199
|
-
"DEEPSEEK_API_KEY",
|
|
200
|
-
"HF_TOKEN",
|
|
201
|
-
"GLM_API_KEY",
|
|
202
|
-
"KIMI_API_KEY",
|
|
203
|
-
"MINIMAX_API_KEY",
|
|
204
|
-
];
|
|
205
|
-
if (keys.some((key) => process.env[key])) return true;
|
|
206
|
-
for (const file of [path.join(root, ".env"), path.join(root, "profiles", profile, ".env")]) {
|
|
207
|
-
if (!fs.existsSync(file)) continue;
|
|
208
|
-
const text = fs.readFileSync(file, "utf8");
|
|
209
|
-
if (keys.some((key) => new RegExp(`^${key}=.+`, "m").test(text))) return true;
|
|
210
|
-
}
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function modelReady(profile = PROFILE) {
|
|
215
|
-
const root = hermesRoot();
|
|
216
|
-
return (
|
|
217
|
-
hasModelConfig(path.join(root, "config.yaml")) ||
|
|
218
|
-
hasModelConfig(path.join(root, "profiles", profile, "config.yaml")) ||
|
|
219
|
-
hasProviderCredentials(profile)
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function usage() {
|
|
224
|
-
return [
|
|
225
|
-
"oracle chat, filled lowercase oracle chat",
|
|
226
|
-
"",
|
|
227
|
-
" oracle chat open interactive oracle chat",
|
|
228
|
-
" oracle chat -q \"...\" one-shot query",
|
|
229
|
-
" oracle chat --model <m> use a model for this session",
|
|
230
|
-
" oracle chat --print-banner show filled oracle banner only",
|
|
231
|
-
"",
|
|
232
|
-
"inside chat:",
|
|
233
|
-
" /chain list/select chains",
|
|
234
|
-
" /setup messaging setup menu",
|
|
235
|
-
" /model switch models (still one oracle persona)",
|
|
236
|
-
"",
|
|
237
|
-
"brand: filled lowercase oracle / classic boxed layout",
|
|
238
|
-
].join("\n");
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function terminalColumns() {
|
|
242
|
-
const columns = Number(process.stdout?.columns || process.env.COLUMNS || 80);
|
|
243
|
-
return Number.isFinite(columns) && columns > 0 ? Math.floor(columns) : 80;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
function visibleWidth(text) {
|
|
247
|
-
return Array.from(String(text)).length;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function centerBlock(lines, width) {
|
|
251
|
-
const clean = lines.map((line) => line.trimEnd());
|
|
252
|
-
const blockWidth = Math.max(0, ...clean.map((line) => visibleWidth(line)));
|
|
253
|
-
const left = Math.max(0, Math.floor((width - blockWidth) / 2));
|
|
254
|
-
const pad = " ".repeat(left);
|
|
255
|
-
return clean.map((line) => (line ? `${pad}${line}` : ""));
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
function printBanner() {
|
|
259
|
-
const lines = [
|
|
260
|
-
"",
|
|
261
|
-
" ████",
|
|
262
|
-
" ░░███",
|
|
263
|
-
" ██████ ████████ ██████ ██████ ░███ ██████",
|
|
264
|
-
" ███░░███░░███░░███ ░░░░░███ ███░░███ ░███ ███░░███",
|
|
265
|
-
"░███ ░███ ░███ ░░░ ███████ ░███ ░░░ ░███ ░███████",
|
|
266
|
-
"░███ ░███ ░███ ███░░███ ░███ ███ ░███ ░███░░░",
|
|
267
|
-
"░░██████ █████ ░░████████░░██████ █████░░██████",
|
|
268
|
-
" ░░░░░░ ░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░ ░░░░░░",
|
|
269
|
-
"",
|
|
270
|
-
];
|
|
271
|
-
process.stdout.write(centerBlock(lines, terminalColumns()).join("\n") + "\n");
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
function parseLaunchArgs(args) {
|
|
275
|
-
const parsed = { pass: [], query: null, model: null, provider: null };
|
|
276
|
-
for (let i = 0; i < args.length; i += 1) {
|
|
277
|
-
const arg = args[i];
|
|
278
|
-
if ((arg === "--model" || arg === "-m") && args[i + 1]) {
|
|
279
|
-
parsed.model = args[++i];
|
|
280
|
-
parsed.pass.push("--model", parsed.model);
|
|
281
|
-
continue;
|
|
282
|
-
}
|
|
283
|
-
if (arg === "--provider" && args[i + 1]) {
|
|
284
|
-
parsed.provider = args[++i];
|
|
285
|
-
parsed.pass.push("--provider", parsed.provider);
|
|
286
|
-
continue;
|
|
287
|
-
}
|
|
288
|
-
if ((arg === "-q" || arg === "--query") && args[i + 1]) {
|
|
289
|
-
parsed.query = args[++i];
|
|
290
|
-
parsed.pass.push("-q", parsed.query);
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
293
|
-
if (arg === "--quiet" || arg === "-Q") {
|
|
294
|
-
parsed.pass.push("--quiet");
|
|
295
|
-
continue;
|
|
296
|
-
}
|
|
297
|
-
if (arg === "--continue" || arg === "-c") {
|
|
298
|
-
parsed.pass.push("--continue");
|
|
299
|
-
continue;
|
|
300
|
-
}
|
|
301
|
-
parsed.pass.push(arg);
|
|
302
|
-
}
|
|
303
|
-
return parsed;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
export default {
|
|
307
|
-
name: "chat",
|
|
308
|
-
summary: "open the one oracle chat surface (telegram-like, multi-model)",
|
|
309
|
-
group: "read",
|
|
310
|
-
usage: usage(),
|
|
311
|
-
async run(ctx) {
|
|
312
|
-
const args = [...ctx.argv];
|
|
313
|
-
if (args.includes("-h") || args.includes("--help")) {
|
|
314
|
-
process.stdout.write(usage() + "\n");
|
|
315
|
-
return 0;
|
|
316
|
-
}
|
|
317
|
-
if (args.includes("--print-banner")) {
|
|
318
|
-
printBanner();
|
|
319
|
-
return 0;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
const parsed = parseLaunchArgs(args);
|
|
323
|
-
const selectionEnv = {
|
|
324
|
-
...process.env,
|
|
325
|
-
...(parsed.model ? { ORACLE_MODEL: parsed.model } : {}),
|
|
326
|
-
...(parsed.provider ? { ORACLE_PROVIDER: parsed.provider } : {}),
|
|
327
|
-
};
|
|
328
|
-
const authStore = getOAuthStore();
|
|
329
|
-
const backend = resolveChatBackend({
|
|
330
|
-
env: selectionEnv,
|
|
331
|
-
hermes: resolveHermes(),
|
|
332
|
-
storedConfig: readModelConfig(),
|
|
333
|
-
oauthAvailable: (provider) => Boolean(authStore.get(provider)),
|
|
334
|
-
apiKeyResolver: (provider) => authStore.getApiKey(provider),
|
|
335
|
-
});
|
|
336
|
-
if (backend.kind === "unconfigured") {
|
|
337
|
-
process.stderr.write(`${backend.reason}\n`);
|
|
338
|
-
return 1;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
const cleanEnv = activeChainEnv({
|
|
342
|
-
ORACLE_CHAT_SURFACE: "1",
|
|
343
|
-
ORACLE_PROFILE: PROFILE,
|
|
344
|
-
ORACLE_NODE_BIN: process.execPath,
|
|
345
|
-
ORACLE_CLI_ENTRY: path.join(PACKAGE_ROOT, "bin", "oracle.mjs"),
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
if (backend.kind === "standalone") {
|
|
349
|
-
const client = createStandaloneClient({
|
|
350
|
-
config: {
|
|
351
|
-
...backend.config,
|
|
352
|
-
...(parsed.model ? { model: parsed.model } : {}),
|
|
353
|
-
},
|
|
354
|
-
});
|
|
355
|
-
if (parsed.query) {
|
|
356
|
-
try {
|
|
357
|
-
return await runStandaloneQuery({
|
|
358
|
-
client,
|
|
359
|
-
text: parsed.query,
|
|
360
|
-
stdout: process.stdout,
|
|
361
|
-
stderr: process.stderr,
|
|
362
|
-
});
|
|
363
|
-
} catch {
|
|
364
|
-
return 1;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
const native = await runOracleTui({
|
|
368
|
-
client,
|
|
369
|
-
args,
|
|
370
|
-
env: cleanEnv,
|
|
371
|
-
cwd: process.cwd(),
|
|
372
|
-
stdin: process.stdin,
|
|
373
|
-
stdout: process.stdout,
|
|
374
|
-
});
|
|
375
|
-
if (native.native) return native.code;
|
|
376
|
-
process.stderr.write(
|
|
377
|
-
process.env.ORACLE_NATIVE_TUI === "0"
|
|
378
|
-
? "oracle standalone chat requires the native TUI; remove ORACLE_NATIVE_TUI=0\n"
|
|
379
|
-
: "oracle standalone chat requires an interactive TTY or -q <query>\n",
|
|
380
|
-
);
|
|
381
|
-
return 1;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
const hermes = backend.bin;
|
|
385
|
-
ensureOracleProfile(PROFILE);
|
|
386
|
-
ensureOracleSkin(PROFILE);
|
|
387
|
-
ensureSkillCommands(PROFILE);
|
|
388
|
-
const skinSet = setDisplaySkin(PROFILE);
|
|
389
|
-
ensureQuickCommands(PROFILE);
|
|
390
|
-
if (!skinSet.ok && process.env.ORACLE_CLI_DEBUG) {
|
|
391
|
-
process.stderr.write(`oracle chat: skin note: ${skinSet.reason}\n`);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
const explicitModel = Boolean(parsed.model || parsed.provider);
|
|
395
|
-
if (!modelReady(PROFILE) && !explicitModel) {
|
|
396
|
-
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
397
|
-
process.stderr.write("oracle chat needs a configured model\nrun: oracle model\n");
|
|
398
|
-
return 1;
|
|
399
|
-
}
|
|
400
|
-
process.stdout.write("choose oracle's model before first chat\n\n");
|
|
401
|
-
const modelLaunch = oracleHarnessInvocation(hermes, ["-p", PROFILE, "model"]);
|
|
402
|
-
const selected = await spawnChild(
|
|
403
|
-
modelLaunch.command,
|
|
404
|
-
modelLaunch.args,
|
|
405
|
-
{ stdio: "inherit", env: process.env },
|
|
406
|
-
"oracle-model",
|
|
407
|
-
);
|
|
408
|
-
if (selected !== 0 || !modelReady(PROFILE)) return selected || 1;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
const hermesArgs = ["-p", PROFILE, "chat"];
|
|
412
|
-
const hermesPython = resolveHermesPython(hermes);
|
|
413
|
-
const native = await runOracleTui({
|
|
414
|
-
hermesPython,
|
|
415
|
-
args,
|
|
416
|
-
env: cleanEnv,
|
|
417
|
-
cwd: process.cwd(),
|
|
418
|
-
stdin: process.stdin,
|
|
419
|
-
stdout: process.stdout,
|
|
420
|
-
});
|
|
421
|
-
if (native.native) return native.code;
|
|
422
|
-
|
|
423
|
-
const launch = oracleHarnessInvocation(hermes, [...hermesArgs, ...parsed.pass]);
|
|
424
|
-
return spawnChild(
|
|
425
|
-
launch.command,
|
|
426
|
-
launch.args,
|
|
427
|
-
{
|
|
428
|
-
stdio: "inherit",
|
|
429
|
-
env: cleanEnv,
|
|
430
|
-
},
|
|
431
|
-
"oracle-chat",
|
|
432
|
-
);
|
|
433
|
-
},
|
|
434
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
name: "credential",
|
|
3
|
-
summary: "OS credential store glue",
|
|
4
|
-
group: "sign",
|
|
5
|
-
usage: "oracle credential <get|set|delete> ...",
|
|
6
|
-
async run(ctx) {
|
|
7
|
-
return ctx.dispatchOperator("oracle-credential", ctx.argv, { appendHintOnError: true });
|
|
8
|
-
},
|
|
9
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { spawnChild } from "../spawn-child.mjs";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
name: "data-mcp",
|
|
6
|
-
summary: "start the read-only data MCP server",
|
|
7
|
-
group: "read",
|
|
8
|
-
usage: "oracle data-mcp",
|
|
9
|
-
async run(ctx) {
|
|
10
|
-
const bin = path.join(ctx.root, "bin", "oracle-data-mcp.mjs");
|
|
11
|
-
return spawnChild(
|
|
12
|
-
process.execPath,
|
|
13
|
-
[bin, ...ctx.argv],
|
|
14
|
-
{ stdio: "inherit", env: process.env },
|
|
15
|
-
"oracle-data-mcp",
|
|
16
|
-
);
|
|
17
|
-
},
|
|
18
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { parseArgs } from "node:util";
|
|
3
|
-
import { spawnChild } from "../spawn-child.mjs";
|
|
4
|
-
|
|
5
|
-
const DEFAULT_DATA_URL = "http://127.0.0.1:8787";
|
|
6
|
-
|
|
7
|
-
function usage() {
|
|
8
|
-
process.stderr.write(
|
|
9
|
-
"usage: oracle data <serve|call|catalog|health> [args]\n" +
|
|
10
|
-
" oracle data serve [--port N]\n" +
|
|
11
|
-
" oracle data call <provider> <op> [--args '<json>']\n" +
|
|
12
|
-
" oracle data catalog\n" +
|
|
13
|
-
" oracle data health\n",
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async function dataFetch(pathname, { method = "GET", body } = {}) {
|
|
18
|
-
const base = (process.env.ORACLE_DATA_URL || DEFAULT_DATA_URL).replace(/\/$/, "");
|
|
19
|
-
const url = base + pathname;
|
|
20
|
-
try {
|
|
21
|
-
const res = await fetch(url, {
|
|
22
|
-
method,
|
|
23
|
-
headers: body ? { "content-type": "application/json" } : undefined,
|
|
24
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
25
|
-
});
|
|
26
|
-
const text = await res.text();
|
|
27
|
-
process.stdout.write(text.endsWith("\n") ? text : text + "\n");
|
|
28
|
-
return res.ok ? 0 : 1;
|
|
29
|
-
} catch (err) {
|
|
30
|
-
if (err && (err.code === "ECONNREFUSED" || /fetch failed|ECONNREFUSED/i.test(String(err)))) {
|
|
31
|
-
process.stderr.write("oracle: data server not running — start it with 'oracle data serve'\n");
|
|
32
|
-
return 4;
|
|
33
|
-
}
|
|
34
|
-
process.stderr.write(`oracle data: ${err.message || err}\n`);
|
|
35
|
-
return 1;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default {
|
|
40
|
-
name: "data", summary: "desk data plane", group: "read",
|
|
41
|
-
usage: "oracle data serve|call|catalog|health",
|
|
42
|
-
async run(ctx) {
|
|
43
|
-
const verb = ctx.argv[0];
|
|
44
|
-
if (!verb || verb === "--help" || verb === "-h") { usage(); return verb ? 0 : 1; }
|
|
45
|
-
if (verb === "serve") {
|
|
46
|
-
let port = null;
|
|
47
|
-
try {
|
|
48
|
-
const { values } = parseArgs({ args: ctx.argv.slice(1), options: { port: { type: "string" } }, allowPositionals: true, strict: false });
|
|
49
|
-
port = values.port || null;
|
|
50
|
-
} catch {}
|
|
51
|
-
const env = { ...process.env };
|
|
52
|
-
if (port) env.ORACLE_DATA_PORT = String(port);
|
|
53
|
-
const bin = path.join(ctx.root, "bin", "desk-server.mjs");
|
|
54
|
-
return spawnChild(process.execPath, [bin], { stdio: "inherit", env }, "desk-server");
|
|
55
|
-
}
|
|
56
|
-
// The server serves /health; / intentionally 404s with a route list. This
|
|
57
|
-
// probed / and so reported the package's own running server as down.
|
|
58
|
-
if (verb === "health") return dataFetch("/health");
|
|
59
|
-
if (verb === "catalog") return dataFetch("/data/catalog");
|
|
60
|
-
if (verb === "call") {
|
|
61
|
-
const provider = ctx.argv[1];
|
|
62
|
-
const op = ctx.argv[2];
|
|
63
|
-
if (!provider || !op) { usage(); return 1; }
|
|
64
|
-
let argsObj = {};
|
|
65
|
-
const i = ctx.argv.indexOf("--args");
|
|
66
|
-
if (i >= 0) {
|
|
67
|
-
try { argsObj = JSON.parse(ctx.argv[i + 1] || "{}"); }
|
|
68
|
-
catch (err) { process.stderr.write(`oracle data call: invalid --args JSON: ${err.message}\n`); return 1; }
|
|
69
|
-
}
|
|
70
|
-
return dataFetch("/data/call", { method: "POST", body: { provider, op, args: argsObj } });
|
|
71
|
-
}
|
|
72
|
-
usage();
|
|
73
|
-
return 1;
|
|
74
|
-
},
|
|
75
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { DOCTOR_SIGNING_OPTIONAL } from "../first-run.mjs";
|
|
4
|
-
import { resolveHermes } from "../runtime.mjs";
|
|
5
|
-
|
|
6
|
-
function nodeVersionOk() {
|
|
7
|
-
const [maj, min] = process.versions.node.split(".").map(Number);
|
|
8
|
-
return maj > 20 || (maj === 20 && min >= 19);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function loadExecEnv(p) {
|
|
12
|
-
if (!fs.existsSync(p)) return {};
|
|
13
|
-
const out = {};
|
|
14
|
-
for (const line of fs.readFileSync(p, "utf8").split(/\r?\n/)) {
|
|
15
|
-
const m = line.match(/^([A-Z0-9_]+)=(.*)$/);
|
|
16
|
-
if (m) out[m[1]] = m[2];
|
|
17
|
-
}
|
|
18
|
-
return out;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
async function probeDataServer(url) {
|
|
23
|
-
try {
|
|
24
|
-
// The server serves /health; / intentionally 404s with a route list, so
|
|
25
|
-
// probing / reported a healthy server as down.
|
|
26
|
-
const res = await fetch(url.replace(/\/$/, "") + "/health");
|
|
27
|
-
return res.ok;
|
|
28
|
-
} catch {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default {
|
|
34
|
-
name: "doctor",
|
|
35
|
-
summary: "check read plane; checks signer too when installed",
|
|
36
|
-
group: "read",
|
|
37
|
-
usage: "oracle doctor [--json]",
|
|
38
|
-
async run(ctx) {
|
|
39
|
-
const json = ctx.argv.includes("--json");
|
|
40
|
-
const checks = [];
|
|
41
|
-
let failed = false;
|
|
42
|
-
const push = (id, status, detail, fix = null) => {
|
|
43
|
-
checks.push({ id, status, detail, fix });
|
|
44
|
-
if (status === "fail") failed = true;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
push("node", nodeVersionOk() ? "ok" : "fail", `node ${process.versions.node}`,
|
|
48
|
-
nodeVersionOk() ? null : "install node >= 20.19");
|
|
49
|
-
|
|
50
|
-
const execEnvPath = ctx.paths.oracleExecEnvPath();
|
|
51
|
-
const envFile = loadExecEnv(execEnvPath);
|
|
52
|
-
// `oracle init --apply` writes ORACLE_ROUTE_ATTESTATION_SECRET (see
|
|
53
|
-
// bin/oracle-init.mjs), but doctor checked only ORACLE_ATTESTATION_SECRET
|
|
54
|
-
// and ORACLE_STAMP_HMAC_SECRET — so it told the user to rerun an init step
|
|
55
|
-
// that could never satisfy the check.
|
|
56
|
-
const att =
|
|
57
|
-
process.env.ORACLE_ROUTE_ATTESTATION_SECRET ||
|
|
58
|
-
process.env.MAD_ROUTE_ATTESTATION_SECRET ||
|
|
59
|
-
process.env.ORACLE_ATTESTATION_SECRET ||
|
|
60
|
-
process.env.ORACLE_STAMP_HMAC_SECRET ||
|
|
61
|
-
envFile.ORACLE_ROUTE_ATTESTATION_SECRET ||
|
|
62
|
-
envFile.MAD_ROUTE_ATTESTATION_SECRET ||
|
|
63
|
-
envFile.ORACLE_ATTESTATION_SECRET ||
|
|
64
|
-
envFile.ORACLE_STAMP_HMAC_SECRET;
|
|
65
|
-
push("attestation_secret", att ? "ok" : "warn", att ? "present" : "missing",
|
|
66
|
-
att ? null : "run oracle init --apply (writes ~/.config/oracle/exec.env)");
|
|
67
|
-
|
|
68
|
-
const dataUrl = process.env.ORACLE_DATA_URL || "http://127.0.0.1:8787";
|
|
69
|
-
const dataUp = await probeDataServer(dataUrl);
|
|
70
|
-
push("data_server", dataUp ? "ok" : "warn", dataUp ? `reachable ${dataUrl}` : `down ${dataUrl}`,
|
|
71
|
-
dataUp ? null : "oracle data serve");
|
|
72
|
-
|
|
73
|
-
const runtime = resolveHermes();
|
|
74
|
-
push("agent_runtime", runtime.ok ? "ok" : "warn",
|
|
75
|
-
runtime.ok ? `present ${runtime.bin} (${runtime.source})` : "not installed",
|
|
76
|
-
runtime.ok ? null : "oracle bootstrap");
|
|
77
|
-
|
|
78
|
-
const profilesDir = path.join(ctx.paths.hermesRoot(), "profiles");
|
|
79
|
-
let laneCount = 0;
|
|
80
|
-
if (fs.existsSync(profilesDir)) {
|
|
81
|
-
laneCount = fs.readdirSync(profilesDir, { withFileTypes: true }).filter((e) => e.isDirectory()).length;
|
|
82
|
-
}
|
|
83
|
-
push("hermes_lanes", laneCount > 0 ? "ok" : "warn",
|
|
84
|
-
laneCount > 0 ? `${laneCount} profile dir(s)` : "no lane profiles found",
|
|
85
|
-
laneCount > 0 ? null : "oracle init --apply");
|
|
86
|
-
|
|
87
|
-
const operator = ctx.resolveOperator();
|
|
88
|
-
let operatorBlock = { installed: false };
|
|
89
|
-
if (operator.ok) {
|
|
90
|
-
const r = ctx.dispatchOperator("oracle-agentic-doctor", ["--json"], { stdio: "pipe" });
|
|
91
|
-
let detail = { installed: true, version: operator.version, source: operator.source };
|
|
92
|
-
if (r && typeof r === "object" && r.stdout) {
|
|
93
|
-
try {
|
|
94
|
-
const parsed = JSON.parse(r.stdout);
|
|
95
|
-
detail = {
|
|
96
|
-
installed: true,
|
|
97
|
-
version: operator.version,
|
|
98
|
-
source: operator.source,
|
|
99
|
-
signingReady: parsed.signingReady,
|
|
100
|
-
broadcastReady: parsed.broadcastReady,
|
|
101
|
-
executionReady: parsed.executionReady,
|
|
102
|
-
masterKillSwitch: parsed.masterKillSwitch,
|
|
103
|
-
raw: parsed,
|
|
104
|
-
};
|
|
105
|
-
} catch {
|
|
106
|
-
detail.doctorParseError = true;
|
|
107
|
-
detail.doctorExit = r.code;
|
|
108
|
-
}
|
|
109
|
-
} else if (typeof r === "number") {
|
|
110
|
-
detail.doctorExit = r;
|
|
111
|
-
}
|
|
112
|
-
operatorBlock = detail;
|
|
113
|
-
const signingReady = detail.signingReady === true;
|
|
114
|
-
push(
|
|
115
|
-
"signing",
|
|
116
|
-
signingReady ? "ok" : "warn",
|
|
117
|
-
signingReady
|
|
118
|
-
? `operator ${operator.version} ready via ${operator.source}`
|
|
119
|
-
: `operator ${operator.version} installed but signing is not ready`,
|
|
120
|
-
signingReady ? null : "oracle sign doctor --json",
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const report = { ok: !failed, checks, operator: operatorBlock };
|
|
125
|
-
if (json) {
|
|
126
|
-
process.stdout.write(JSON.stringify(report, null, 2) + "\n");
|
|
127
|
-
} else {
|
|
128
|
-
for (const c of checks) {
|
|
129
|
-
process.stdout.write(`${c.status.toUpperCase().padEnd(4)} ${c.id}: ${c.detail}\n`);
|
|
130
|
-
if (c.fix) process.stdout.write(` fix: ${c.fix}\n`);
|
|
131
|
-
}
|
|
132
|
-
if (!operator.ok) process.stdout.write(`INFO ${DOCTOR_SIGNING_OPTIONAL}\n`);
|
|
133
|
-
}
|
|
134
|
-
return failed ? 1 : 0;
|
|
135
|
-
},
|
|
136
|
-
};
|