epochal

mcp
Guvenlik Denetimi
Uyari
Health Gecti
  • License — License: Apache-2.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 12 GitHub stars
Code Uyari
  • network request — Outbound network request in python/api/src/epochal/api/_async_client.py
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

Epochal SDKs: Rust and Python clients, an MCP server and a CLI for the Epochal API and its Time Portal.

README.md

Epochal

Clients for the Epochal API: Rust crates, Python packages, an MCP server and
a CLI. epochal-api and epochal-sandbox are on both crates.io and PyPI under those names;
epochal-mcp and epochal-cli are Rust only.

Their one module today is the Time Portal, which serves the web, and Linux sandboxes, as they
stood at a past instant. Search and fetch return only what was published and crawled by then; a
sandbox's clock starts there and its network sees nothing later. Use it to test an agent or a
forecast against the past, with nothing from after that instant leaking in. In each package the
Time Portal is named as such: client.time_portal(as_of), Sandbox::time_portal(as_of),
epochal-mcp --time-portal, epochal time-portal.

Directory Package What it is
api/ epochal-api (Rust) One method per API call; for the Time Portal, web search, web fetch, and the raw sandbox calls
sandbox/ epochal-sandbox (Rust) Sandboxes: build one, run commands, move files, serve its ports from your machine
mcp/ epochal-mcp (Rust) epochal-mcp, an MCP server giving an agent web_search and web_fetch at an instant
cli/ epochal-cli (Rust) epochal: epochal time-portal runs an agent in a sandbox, or searches and fetches from the shell
python/api/ epochal-api (Python) The API client, sync and async
python/sandbox/ epochal-sandbox (Python) Sandboxes, sync and async, with examples
examples/ Experiments from our blog posts, each one script

The pieces stack: the sandbox crates call the API crates; the MCP server uses the Rust API crate;
the CLI uses all three Rust crates. Each directory's README has its setup and examples.

Quick start

Every package reads your API key from EPOCHAL_API_KEY; create one at
https://console.epochal.com/keys. EPOCHAL_BASE_URL overrides the API address (default
https://api.epochal.com). An instant written as a bare day, 2025-03-12, means 23:59:59 UTC that
day, as the API reads it.

export EPOCHAL_API_KEY=...

# From the shell:
cargo install --path cli
epochal time-portal search "fed rate decision" --as-of 2025-03-12
EPOCHAL_LLM_BASE_URL=https://api.anthropic.com EPOCHAL_LLM_API_KEY=... \
  epochal time-portal run --model claude-sonnet-5-5 --as-of 2025-03-12 \
  "Summarize the Fed's latest rate decision"

# As an MCP server for your agent:
cargo install --path mcp
epochal-mcp --time-portal 2025-03-12 --serve http:8788   # streamable HTTP at /mcp

# From Python:
pip install epochal-sandbox
python -c 'from epochal.sandbox import Sandbox
with Sandbox.time_portal("2025-03-12").build() as box:
    print(box.command(["date", "-u"]).output().text)'

From Rust, cargo add epochal-sandbox (or -api); sandbox/ and
api/ have complete examples.

Development

The repository is one Bazel workspace, and CI builds and tests with it.
Install Bazelisk as bazel; it fetches the Bazel that
.bazelversion names, and Bazel fetches Rust 1.88 and Python 3.11 and 3.14 itself. On Windows it
compiles C with clang-cl, so install LLVM alongside the Visual Studio build tools.

bazel test //...                          # every Rust and Python test, on both Pythons
bazel test --config=lint //...            # the same, with clippy and rustfmt
bazel test //python:python_3.14           # ruff, mypy and pytest on one Python
bazel build -c opt //cli:epochal //mcp:epochal-mcp
bazel build //python/api:dist //python/sandbox:dist   # the sdists and wheels

Cargo.toml, Cargo.lock and python/pyproject.toml stay the source of truth for dependencies,
versions and lints, so Cargo and uv still work for a quick loop:

cargo test --workspace
cd python && uv run pytest
uv run python scripts/unasync.py  # after editing an async module or the sync client

Bazel reads the Rust dependencies from Cargo.lock directly. After a change to a Python
dependency, run uv lock and then the command at the top of python/requirements_lock.txt; CI
fails if either is stale.

Each Python package has one hand-written flavour and one generated by scripts/unasync.py: the
async sandbox and the blocking API client are the sources. A test fails if a generated file is
stale.

Tests run against fake API servers in-process, so they need no key and no network.

License

Apache-2.0.

Yorumlar (0)

Sonuc bulunamadi