Skip to main content

qwenpaw-data-host-core

Shared host foundation for QwenPaw Data.

This package owns the non-HTTP QwenPaw Data host runtime:

  • QwenPawDataHost runtime handle for plan, execute, and run
  • AgentScope agent, toolkit, workspace tools, and prompt templates
  • DAG orchestration, session trace storage, and artifact path helpers
  • MCP Context Manager timeout and metadata injection helpers
  • Context Manager HTTP discovery client used by CLI integrations

Concrete host packages such as qwenpaw-data-cli should depend on this package instead of duplicating host orchestration logic.

Headless service (optional [service] extra)

The engine can run as a headless service that any frontend (PawApp, CLI, third parties) consumes over HTTP + SSE:

pip install "qwenpaw-data-host-core[service]" uvicorn
QWENPAW_DATA_API_TOKEN=<token> \
uvicorn --factory 'qwenpaw_data.host.core.api.app:create_app' --workers 1

The service is single-process (in-process event fan-out); always run one worker. Without QWENPAW_DATA_API_TOKEN, only loopback clients are accepted.

API surface (/api/v1)

Route Purpose
POST /sessions · GET /sessions · GET/PATCH/DELETE /sessions/{id} Session lifecycle: create, list (search/filter/sort/pagination), rename, soft-delete
POST /sessions/{sid}/chats Start a turn in an existing session: {"text": ..., "datasource_id": ...} → {"chat": {...}}; 404 without a session, 409 while a turn is active
GET /sessions/{sid}/chats List a session's chats
POST /sessions/{sid}/chats/{cid}/stop Cancel a running turn
GET /sessions/{sid}/chats/{cid}/events SSE stream: replays persisted history, then live events; supports Last-Event-ID (or after_sequence_number) resume
POST /sessions/{sid}/chats/{cid}/steer Inject steering text into the running turn (204; 409 when not active)
POST /sessions/{sid}/chats/{cid}/clarification/answer Deliver an ask_user_question result to the paused turn
GET/PUT/DELETE /preferences/providers[/{id}] · .../models/{id} · GET/PUT /preferences/active-models Model provider credentials (masked in responses), model overrides, active model selection
GET /datasources DataBridge datasource discovery proxied through the service
GET/POST /cron/jobs · GET/PUT/DELETE /cron/jobs/{id} · `POST .../pause resume

Storage backends

The service persists sessions/chats/events/preferences through a store protocol with two interchangeable backends:

  • sqlite (default): <home>/host/host.db (WAL); point QWENPAW_DATA_DB_URL at another SQLAlchemy async URL (e.g. postgres).
  • JSON files: set QWENPAW_DATA_STORE=json for the zero-dependency file layout (<home>/host/{chats,sessions,preferences}/).

A conformance test suite runs every store test against both backends. When no explicit model is passed, the service resolves the local user's configured active model from preferences and falls back to env vars.

SSE stream objects

Each SSE frame carries id (dense per-chat sequence number), event (object type), and a JSON body discriminated on object:

response (created/in_progress/completed/failed/cancelled, terminal frames close the stream) · message / content (assistant text, reasoning, tool calls and outputs, media) · task_status (DAG plan snapshots) · biz_event / segment / artifact.registered / followup.generated (reserved; producers arrive in later waves).

Environment variables

  • QWENPAW_DATA_API_TOKEN — bearer token; unset = loopback-only
  • QWENPAW_DATA_STORE — json to use file-backed stores (default: sqlite)
  • QWENPAW_DATA_DB_URL — SQLAlchemy async URL (default sqlite+aiosqlite:///<home>/host/host.db)
  • QWENPAW_DATA_PREFS_MASTER_SECRET — hex secret (≥32 bytes) to encrypt stored provider API keys at rest
  • QWENPAW_DATA_CORS_ALLOW_ORIGINS — comma-separated origins (default loopback)
  • QWENPAW_DATA_STREAM_SSE_HEARTBEAT_SECONDS — keepalive interval (default 15)
  • QWENPAW_DATA_FOLLOWUP_ENABLED — 0 disables follow-up question recommendation (default on)
  • QWENPAW_DATA_MODEL_PROVIDER / _NAME / _API_KEY / _BASE_URL — model config fallback when no active model is set via preferences

Chat and event history persist in the selected backend, so SSE resume works across service restarts; orphaned running chats are cancelled on startup.

Default local state

qwenpaw-data-host-core resolves its own local state through qwenpaw_data.host.core.paths; it does not use DataBridge path helpers.

${QWENPAW_DATA_HOME:-~/.qwenpaw-data}/host/
├── .secrets/                              # shared durable Host secrets
└── workspace/
    ├── .mcp                               # shared durable MCP config
    ├── skills/                            # shared durable skills
    ├── sessions/
    │   ├── console/                       # session traces
    │   ├── dag/                           # session DAG snapshots
    │   └── {session_id}/                  # AgentScope context/tool offload
    ├── data/                              # shared durable AgentScope blobs
    └── artifacts/
        └── {session_id}/                  # direct-chat artifacts
            └── {graph_id}/{node_id}/      # optional TaskGraph node scope

Directories are created lazily by their writers. The Host does not read or migrate the historical ${QWENPAW_DATA_HOME}/agents/default layout.

Metadata

Release files for qwenpaw-data-host-core 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qwenpaw-data-host-core 0.3.0
File Size Uploaded
qwenpaw_data_host_core-0.3.0.tar.gz 341.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qwenpaw-data-host-core 0.3.0
File Interpreter ABI Platform
qwenpaw_data_host_core-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 664.8 kB

Release files / qwenpaw_data_host_core-0.3.0.tar.gz

Download URL qwenpaw_data_host_core-0.3.0.tar.gz
Size 341.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a3752ca4df668ef511e57790b8c8430df5707141933882d679f6e3ba6d050c80
BLAKE2b-256 checksum
How to use checksums
5b70a548d12763b51ef13e3cb663dec9f011d59724b1c9fc6a83628a03579f72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / qwenpaw_data_host_core-0.3.0-py3-none-any.whl

Download URL qwenpaw_data_host_core-0.3.0-py3-none-any.whl
Size 323.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a8f40cd6efe830713300856be91bdd07cd5867f308d40332c86c1af5da1757e
BLAKE2b-256 checksum
How to use checksums
106c514645623e64c8a5308dde4ceed36735da20a2b0f57cdc6597386a287dfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page