Skip to main content

Workspace-native local-first agent runtime built on top of ya-agent-sdk

Project description

YA Claw

Workspace-native single-node agent runtime and web service for the ya-mono workspace.

Scope

YA Claw packages a durable runtime shell around ya-agent-sdk with:

  • registered workspaces resolved through WorkspaceProvider
  • reusable agent profiles
  • resumable sessions and runs
  • in-process active state and async task coordination
  • session schedules for timed execution
  • SQLite-first durable state with optional PostgreSQL
  • local filesystem session continuity and exported state
  • a bundled web shell for local and self-hosted use
  • bridge adapters that connect IM channels to the YA Claw service

Current Direction

The target single-node shape runs as one web service. The runtime keeps active session state, live delivery, async tasks, schedule dispatch, and bridge coordination inside one runtime process. SQLite is the default durable store. PostgreSQL remains an optional storage backend for deployments that prefer an external relational database.

Layout

Key areas in this package:

  • .env.example — runtime environment example
  • spec/ — architecture and runtime design documents
  • tests/ — runtime tests
  • ya_claw/api/ — HTTP API surface
  • ya_claw/bridge/ — IM bridge adapters and relay logic
  • ya_claw/app.py and ya_claw/cli.py — application entrypoints
  • ya_claw/config.py — runtime configuration

Runtime Shape

The runtime shape is:

  • one YA Claw web service
  • one in-process runtime state manager
  • one session scheduler
  • one bridge subsystem for external channels
  • one shared bearer token for HTTP access
  • one SQLite database by default
  • optional PostgreSQL
  • one runtime data directory for sensitive session continuity
  • one workspace root for project data
  • one bundled web shell

Quick Start

From the workspace root, start the default runtime flow:

uv sync --all-packages
cp packages/ya-claw/.env.example packages/ya-claw/.env
make run-claw

Set YA_CLAW_API_TOKEN before starting the service. The development server listens on http://127.0.0.1:9042 by default. YA Claw loads YA_CLAW_* settings from packages/ya-claw/.env and the process environment. YA Claw startup also exports provider variables such as GATEWAY_API_KEY and GATEWAY_BASE_URL from packages/ya-claw/.env into the process environment. Use packages/ya-agent-sdk/.env.example for shared SDK and tool environment variables when you want the same keys outside YA Claw startup. Set YA_CLAW_PROFILE_SEED_FILE plus YA_CLAW_AUTO_SEED_PROFILES=true when you want packaged profiles to seed into the database on startup. Set YA_CLAW_EXECUTION_MODEL when you want runs to auto-dispatch through the built-in coordinator. Without that setting, created runs stay queued until another execution path picks them up.

Profile and coordinator settings:

  • YA_CLAW_PROFILE_SEED_FILE=packages/ya-claw/profiles.yaml
  • YA_CLAW_AUTO_SEED_PROFILES=true
  • YA_CLAW_DEFAULT_PROFILE=default
  • YA_CLAW_WORKSPACE_PROVIDER_BACKEND=local|docker
  • YA_CLAW_WORKSPACE_PROVIDER_DOCKER_IMAGE=python:3.11
  • YA_CLAW_EXECUTION_CONTEXT_WINDOW=200000

Profiles can be managed through:

  • REST API: /api/v1/profiles
  • Seed API: POST /api/v1/profiles/seed
  • CLI: ya-claw profiles seed

Default local paths:

  • SQLite database: ~/.ya-claw/ya_claw.sqlite3
  • runtime data root: ~/.ya-claw/data
  • workspace root: ~/.ya-claw/workspace

External Database

Set YA_CLAW_DATABASE_URL in packages/ya-claw/.env when you want an external PostgreSQL database. The default SQLite file stays at ~/.ya-claw/ya_claw.sqlite3.

Database Commands

uv run --package ya-claw ya-claw db upgrade
uv run --package ya-claw ya-claw db current
uv run --package ya-claw ya-claw db history
uv run --package ya-claw ya-claw db revision "add session tables"

Bridge Commands

The CLI owns a top-level bridge command group.

uv run --package ya-claw ya-claw bridge ls
uv run --package ya-claw ya-claw bridge run lark
uv run --package ya-claw ya-claw bridge serve lark

Bridge Relay Modes

  • task relay — a bridge submits work to YA Claw as an async session flow and delivers agent output back through the channel adapter or channel CLI
  • stream relay — a bridge opens a foreground run, consumes SSE from the YA Claw service, and streams channel-ready output directly

Web Shell

Run the web shell from the repository root:

make web-dev

Docker

Build from the repository root:

docker build -f Dockerfile.ya-claw -t ya-claw:dev .

Initial API Surface

Every HTTP route except /healthz expects Authorization: Bearer <YA_CLAW_API_TOKEN>.

  • GET /healthz — service health probe with storage and runtime component status
  • POST /api/v1/sessions — create a session with optional first run
  • GET /api/v1/sessions — list sessions
  • GET /api/v1/sessions/{session_id} — inspect a session plus paginated runs and optional compacted message replay lists
  • POST /api/v1/sessions/{session_id}/runs — create a run under a session
  • POST /api/v1/sessions/{session_id}/steer — steer the active run through the session surface
  • POST /api/v1/sessions/{session_id}/interrupt — interrupt the active run through the session surface
  • POST /api/v1/sessions/{session_id}/cancel — cancel the active run through the session surface
  • POST /api/v1/runs — create a run directly through the low-level surface
  • GET /api/v1/runs/{run_id} — inspect a run plus session summary, committed state, and optional compacted message replay list
  • POST /api/v1/runs/{run_id}/steer — steer a specific active run
  • POST /api/v1/runs/{run_id}/interrupt — interrupt a specific active run
  • POST /api/v1/runs/{run_id}/cancel — cancel a specific active run

Spec Set

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ya_claw-0.58.8.tar.gz (75.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ya_claw-0.58.8-py3-none-any.whl (57.9 kB view details)

Uploaded Python 3

File details

Details for the file ya_claw-0.58.8.tar.gz.

File metadata

  • Download URL: ya_claw-0.58.8.tar.gz
  • Upload date:
  • Size: 75.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for ya_claw-0.58.8.tar.gz
Algorithm Hash digest
SHA256 864f3f4d2f2b76fe8664682eef6ced6db9e01f80c40f44baa805f20f0d971dcd
MD5 10be5b1dc10b734c3cbab0754d2dea7c
BLAKE2b-256 3af229a619e1c6f2cf31e536d756b006dffb76e43d3b61fc602d044d5aedc94d

See more details on using hashes here.

File details

Details for the file ya_claw-0.58.8-py3-none-any.whl.

File metadata

  • Download URL: ya_claw-0.58.8-py3-none-any.whl
  • Upload date:
  • Size: 57.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for ya_claw-0.58.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1a4fe3d57d31a03b950ec84e1f34dde4017c1292285d2262070c433b0cc40a3b
MD5 56527d4b00d766c72225f6f39177e713
BLAKE2b-256 41876cb40b9d8f46639eb5f4aa8c13740947ccdeff40fdb1b270cc34cfd667e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page