Compare commits

..

18 Commits

Author SHA1 Message Date
Patrick Buckley 364a49c7fb chore: bump version to 1.4.0 2026-04-16 15:07:21 -07:00
Patrick Buckley b1e7c82e95 docs: add CHANGELOG.md for the 1.4.0 release
Repo previously had no CHANGELOG.  Establishes the file with full
1.4.0 coverage (attachments end-to-end, dashboard composer refactor,
Slack adapter, per-call plan/task model, provider capability
passthrough, Opus 4.7) plus a one-line 1.3.1 entry for the Opus 4.7
backport.  Format follows Keep a Changelog 1.1.0; release-track
guidance up top covers the three stable branches + main.

Operator-relevant call-out at the top of [1.4.0]: migrations 037 +
038 must be applied before starting 1.4.0 against an existing 1.3.x
database.  Both are additive and idempotent.
2026-04-16 15:05:39 -07:00
Patrick Buckley aff449116e feat(ui): dashboard composer polish from PR #362 designer review (#366)
* feat(ui): dashboard composer polish from PR #362 designer review

Three deferred items from the prior designer pass on the unified
dashboard composer.  Pure UX affordances; no server change.

- **Persist Options open/closed in localStorage.**  Power users who
  routinely set non-default model/skill don't have to click "Options"
  on every page load.  Key: `turnstone.dashboard.options_open`.
  Defaults closed for first-time users.  Falls back gracefully when
  localStorage is unavailable (private mode, quota).

- **Active-options summary chip.**  Renders the non-default model /
  judge / skill values inline next to the Options button (mono, dim,
  separated by middots).  Hidden via `[hidden]` when everything is at
  default — no chrome cost in the common case.  Updates on any select
  change via a single delegated handler on the panel.  Hidden on
  narrow viewports (the action row stacks vertically there and the
  chip would push the layout further).

- **"Drop to attach" overlay during drag.**  CSS pseudo-element on
  `.dashboard-composer-drop` overlays a centered "Drop to attach"
  label so dragging a file makes the action explicit instead of just
  showing the dashed-border highlight.  pointer-events: none keeps
  the underlying composer controls reachable; visual only.

* fix(ui): address Copilot review on dashboard composer polish

- _restoreDashboardOptionsState() forced the panel closed every time
  showDashboard() ran when localStorage was unavailable (private mode,
  storage quota), contradicting the comment that promised a per-session
  fallback.  Add a module-scoped _dashOptionsOpenSession variable
  updated by _setDashboardOptionsOpen / _toggleDashboardOptions, and
  only override the visible state from localStorage when the read
  genuinely succeeded.  The session value now preserves the user's
  choice across hide/show cycles in environments where localStorage
  throws.

- Fold the duplicated `.dashboard-composer { position: relative; }`
  block into the existing rule above.  The position context is needed
  for the .dashboard-composer-drop::before overlay; the comment now
  says so.
2026-04-16 14:54:25 -07:00
renovate[bot] ddf7b3c2f0 chore(deps): lock file maintenance 2026-04-16 14:45:22 -07:00
Patrick Buckley a6c6b71d66 feat(console-ui): support Slack channel_type in admin UX
PR #355 added the Slack adapter on the server but missed the console
admin surfaces that talk to channel_type.  Three concrete gaps + a
designer-review polish pass.

Functional bug + UI parity:

- _collectNotifyTargets() in admin.js hardcoded `channel_type: "discord"`
  — even on a Slack-only deployment the skill notify-on-complete form
  always wrote Discord targets, sending notifications to the wrong
  adapter (or nowhere).  Add a per-row channel-type <select> driven by
  a small _NOTIFY_CHANNEL_TYPES table that's the one place to register
  a new platform; collector and populator both read from the dropdown.
  ID-input placeholder updates dynamically when the platform changes.

- The "Link Channel Account" modal only offered Discord — users
  couldn't link a Slack account through the UI at all.  Add a Slack
  <option> and reuse the same dynamic-placeholder helper.  Drop the
  static Discord-shaped HTML placeholder so the JS-driven hint doesn't
  flash a Discord example before the dropdown initializes.

- Skill create/edit modals only showed Discord in the notify-on-complete
  placeholder example.  Show both adapters.

- Per-platform .scope-discord / .scope-slack badge classes so the
  linked-accounts list distinguishes platforms visually instead of all
  rendering as the generic .scope-channel magenta.  Falls back to
  .scope-channel for any future channel_type the stylesheet doesn't
  yet know about.

Designer review polish:

- Theme-aware --discord / --slack / --discord-glow / --slack-glow
  tokens in base.css.  The first pass shipped raw hex (#818cf8 /
  #f472b6) that fails WCAG AA on light theme (1.8:1 and 2.4:1); the
  light variants (#4f46e5 indigo, #be185d rose) pass.  Badge classes
  now reference tokens, matching every other .scope-* rule.

- Notify-row mobile layout: three controls in a row left ~80px for
  the ID input at 360px viewport, truncating snowflakes.  Tighten
  platform select to 76px (labels are short), add flex-wrap, and at
  ≤700px drop the ID input to its own row so it gets full width.

- Per-platform classes apply alone (not co-classed with scope-channel)
  so winning the cascade doesn't depend on stylesheet source order.

- Replace "Discord snowflake" jargon with "Discord ID"; give Slack
  ids concrete examples (C01234567 / U01234567) instead of an
  ambiguous "C0…".
2026-04-16 14:45:01 -07:00
Patrick Buckley 0d3516d6e0 fix(slack): post-merge fixes from Copilot + eous review
Combines the substantive bot.py fixes flagged in both review trails on
PR #355.  Discord parity items grouped here too since they're the same
surface (slack/bot.py).

From Copilot:

- _notify_reply_routes was read on StreamEndEvent but never popped on
  the success path.  Result: one notification reply pinned every later
  response for that ws_id to the notification thread until the bot
  restarted.  Pop after read; combine the surrounding ifs (SIM102).

- PlanReviewEvent embedded raw event.content inside a triple-backtick
  mrkdwn fence without escaping.  A plan with ``` (very common — plans
  often quote code) would break the fence and let later content render
  as live markup, including unintended Slack mentions/links.  Rewrite
  _sanitize_slack_preview to splice a zero-width space inside any ```
  sequence (Slack stops recognizing it as a delimiter) instead of
  escaping every single backtick — keeps single-backtick code snippets
  readable while still protecting the fence.  Apply to plan-review.

- _send_approval_request joined unbounded tool_lines into one mrkdwn
  section, but Slack section.text caps at 3000 chars.  Multi-tool
  batches with large previews silently failed chat_postMessage,
  leaving the user unable to approve/deny.  Cap each preview to 600
  chars under a 2700-char total budget; append "+N more" when truncated.

From eous (parity with Discord):

- Pass `client_type="chat"` from both `get_or_create_workstream` call
  sites (slash-command session + DM).  Without it Slack-routed
  workstreams loaded the web-default prompt; the chat-specific
  system prompt now applies as it does for Discord.

- Add `exc_info=True` to the eleven `log.debug(...)` exception handlers
  so underlying tracebacks are available when debug logging is on
  instead of being silently dropped.  Level stays debug — these are
  benign-by-default sites (chat_update on a deleted message, etc.) so
  only the visibility changes.  Typed-exception handlers
  (RemoteProtocolError, etc.) keep their bare debug log.

- Module docstring on slack/__init__.py so pydoc / import errors have
  human-readable context.

Tests: rewrite the sanitizer test to match the new (more permissive)
single-backtick behaviour; add coverage for the triple-backtick
neutralization + short-input passthrough; patch httpx.AsyncClient at
all five TurnstoneSlackBot construction sites so each test doesn't
leak an unclosed real client.
2026-04-16 14:45:01 -07:00
Patrick Buckley a8dcccafa3 chore(slack): unblock CI + dependency cleanup after #355
- cli.py: ChannelAdapter import is annotation-only; move into
  TYPE_CHECKING block and switch the two cast() calls to string-form
  so the runtime import isn't required (TC001).
- slack/{config,routes}.py: ruff format fixes (whitespace + drop
  redundant string-form annotation now that __future__ annotations
  is in effect).
- pyproject.toml: drop the unused `tests.*` mypy override — `mypy
  turnstone` (the only invocation in CI + local) never matches it,
  so it was pure noise in the "unused section(s)" report.  Other
  optional-dep overrides stay; they're real safety nets when running
  mypy without the [all] extras (e.g. on the test job).
- uv.lock: regenerate to match the slack-bolt + transitive deps the
  pyproject changes resolve to (lock-check was failing on stale hash).
2026-04-16 14:45:01 -07:00
renovate[bot] e19032f369 chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.11.7 (#364)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-16 14:28:22 -07:00
daoxley d3ff5e5ac7 Add Slack channel adapter with Socket Mode support (#355)
* Add Slack channel adapter with Socket Mode support

Adds a Slack channel adapter mirroring the Discord adapter pattern:

- Socket Mode connection
- Per-user session management in channels via configurable slash command
- SSE-based event consumption from server nodes
- Tool approval buttons with policy evaluation support
- DM routing without slash command (requires Slack app DM permissions; not validated in current workspace)
- Session recovery after restart via recoverable route keys

New files:
- turnstone/channels/slack/bot.py
- turnstone/channels/slack/config.py
- turnstone/channels/slack/__init__.py
- tests/test_channel_slack.py

Updated:
- turnstone/channels/cli.py — adds Slack CLI arguments
- pyproject.toml — adds slack extra and mypy overrides

Usage:
- Install with Slack support:

* Fix lint issues and update lock file

* fix: unify channel startup, fix Slack notification reply routing, add plan review UI/actions

* Fixes to notification responses

* Add turnstone/channels/slack/routes.py
Update bot.py to import shared SlackRoute
Update _http.py Slack notify validation

* Add approval guards

* Only creators can approve

* Updated slack test suite

* use integer tuple comparison for Slack timestamp ordering

* suppress mypy no-untyped-call for slack_bolt socket mode handler
2026-04-16 13:45:46 -07:00
Patrick Buckley a0b3c35d28 Feat/attachment followups (#363)
* fix(ui): rehydrate chip strip after queued-message dequeue not_found

The dequeue handler only refreshed the per-pane chip strip when the
DELETE returned status="removed". On status="not_found" (the queued
message already dispatched), chips stayed stale: any reservations that
raced the dispatch could leave the UI showing a different pending set
than the server actually had.

Re-fetch on both paths so the chip strip always reflects the
authoritative server state. The queued-message bubble itself stays
visible on not_found, same as before — the promote loop strips the
queued styling on idle.

* feat: sweep orphan attachment reservations periodically

Process crashes between reserve_attachments and consume/unreserve can
leave attachment rows soft-locked forever (reserved_for_msg_id NOT NULL
with no consumer ever coming back). The worker-thread exception path
in /v1/api/send already handles in-process failures, but a hard kill
or oom mid-send escapes that.

Add sweep_orphan_reservations(older_than_seconds) to the storage
protocol — clears reserved_for_msg_id on rows where message_id IS NULL
and created < now() - threshold. Implemented for SQLite + PostgreSQL
using the same string-comparison form (created is ISO-8601 text in
both backends, lexicographic order matches chronological).

Wire into the server lifespan: run once at startup (catches anything
left over from the previous process), then every 30 minutes as
defense-in-depth. Threshold is 4 hours so we don't race a long-running
dispatch and unreserve rows the worker is still about to consume.

Tests cover sweep semantics: clears old reserved rows, leaves fresh
ones alone, skips already-consumed rows, no-ops on zero/negative
threshold.

* fix: track reserved_at for orphan-reservation sweep

Copilot review on PR #363 flagged a real correctness bug: the sweep
used the attachment row's `created` timestamp (upload time) as the
staleness signal. An attachment uploaded hours ago but reserved fresh
could be unreserved mid-send, after which mark_attachments_consumed
silently drops the row because reserved_for_msg_id no longer matches
the send_id.

Add a dedicated `reserved_at` column (migration 038) set on
reserve_attachments and cleared on mark_attachments_consumed /
unreserve_attachments. The sweep now scopes by `reserved_at < cutoff`,
so reservation age is what's measured, not upload age. Backed by a
partial index `(reserved_at) WHERE reserved_at IS NOT NULL` so the
periodic scan stays cheap as the consumed-history grows.

Threshold dropped from 4h to 1h since it now means "longest realistic
single send" rather than "longest plausible time between upload and
send" — a tighter, more defensible bound.

Tests cover the regression (uploaded long ago + reserved fresh must
not be swept), plus reserved_at clearing on both consume and unreserve.
2026-04-16 13:39:32 -07:00
Patrick Buckley 6cbd3eb2c1 feat: workstream attachments at creation time + SDK + UI parity (#362)
* feat: workstream attachments at creation time + SDK + UI parity

Closes the two big deferred items from PR #356: attaching files as part
of the initial workstream-creation request, and full SDK coverage of the
attachment surface.

Server: POST /v1/api/workstreams/new now accepts multipart/form-data
(meta JSON + 0..N file parts).  Files are validated and saved as pending
under the new ws; when initial_message is also set the create handler
reserves them onto that turn before the dispatch worker fires, mirroring
the /v1/api/send pattern.  Validation failure rolls back the workstream
via delete_workstream so we don't leak orphan rows or emit a phantom
ws_created/ws_closed pair on SSE.  JSON path is unchanged.

Console routing: route_create accepts multipart with ?ws_id=<hex> as a
query parameter (the console hashes the id before the body lands).
Added /v1/api/route/workstreams/{ws_id}/attachments POST/GET/DELETE +
.../{attachment_id}/content GET proxies that forward raw bytes and
preserve upstream headers (Content-Disposition, X-Content-Type-Options,
CSP sandbox).

Python + TypeScript SDKs: AttachmentUpload type, upload_attachment,
list_attachments, get_attachment_content, delete_attachment, and
send(attachment_ids=...).  create_workstream(attachments=...) sends
multipart and pre-generates a ws_id client-side so cluster routing
works.  SDKs reject attachments+target_node combinations since the
multipart route doesn't honor target_node.

Web UI: dashboard composer refactored to a single unified create flow.
Replaced the inconsistent split (Enter created+sent raw, "New Chat"
opened a modal) with one rich composer carrying a textarea, paperclip
+ chip strip, drag-drop, paste-image, and a collapsible Options panel
for model/judge_model/skill.  Submit button dynamically labels Create
vs Send.  New-workstream modal also gained the same paperclip + chip
strip + first-message field for the tab-bar + entry point.

Tests: 30 new tests across server multipart create, console route
multipart + attachment proxies, Python + TS SDK attachment surfaces,
plus regressions for the three review-flagged bugs (Content-Type
boundary preservation, attachments+target_node rejection, no phantom
ws_created on validation failure).

* fix: address Copilot review feedback on PR #362

- web_helpers: docstring now matches behaviour — read_multipart_create_or_400
  does enforce the optional max_per_file_bytes cap as defense-in-depth.
- app.js: drop the duplicated _formatAttachSize definition (one already
  exists earlier for pane chips); add a shared _isAttachmentAllowed helper
  that mirrors the server's classifier (png/jpeg/gif/webp images, text/*
  MIMEs, allowlisted application/* MIMEs, known text extensions) and call
  it from both _newWsAddFiles and _addDashboardFiles so unsupported files
  fail fast client-side instead of after a server roundtrip.
- app.js: dashboardSubmit catch now suppresses the redundant error toast
  on authFetch's "auth" Error and falls back to a generic message when
  err.message is undefined, instead of rendering "Connection error: undefined".
- SendResponse (Pydantic + TS): document and expose attached_ids,
  dropped_attachment_ids, priority, and msg_id so attachment-aware SDK
  callers can detect partial reservations and dequeue queued messages.
- test_server_attachments_on_create: drop the dual `import turnstone.server`
  + `from turnstone.server import` style — use monkeypatch.setattr by
  dotted path for module-level mutation and `from … import …` for the
  helpers, keeping a single import style.
2026-04-16 13:30:25 -07:00
Patrick Buckley 551fc43c15 feat: per-call model selection on plan_agent / task_agent (#361)
* feat: per-call model selection on plan_agent / task_agent

The calling LLM can now pass `model="<alias>"` to plan_agent or
task_agent to override the operator-configured per-kind model for
that one invocation.  Useful when subtask difficulty varies within a
session: the model can downgrade to a cheap alias for trivial work
and reach for a stronger one when the problem is hard.

Tool descriptions list the live registered aliases (refreshed when
the operator hits "sync to nodes" / internal_model_reload), so the
calling LLM always sees the current options.  Bad aliases return a
corrective error dict with the available choices so the LLM retries
cleanly rather than failing silently.

No whitelist — any alias the registry knows is acceptable; cost
control is intentionally ceded to the model.  No per-call effort
override (out of scope; effort stays operator-configured).

Resolution precedence in _run_agent: explicit per-call agent_alias
override > registry per-kind (plan_model/task_model) > legacy
agent_model > session model.  The plan retry path (when
_validate_plan fails) reuses the same alias so coaching reflects
real model behaviour rather than a different model masking the
signal.

Implementation:
- plan_agent.json / task_agent.json: optional `model` parameter.
- ChatSession._validate_agent_model_override extracts and validates
  the arg; mirrors the existing empty-prompt error pattern.
- _prepare_plan / _prepare_task stash the override in
  item["model_override"]; _exec_* pass it through.
- _run_agent gains agent_alias kwarg with defence-in-depth
  ValueError on unknown alias.
- _render_agent_tool_descriptions deep-copies plan/task entries
  before mutating description so the module-level TOOLS constant
  stays untouched across sessions; rebuilds the BM25 tool-search
  index when active so its text matches what the LLM sees.
- server._broadcast_agent_tool_schema_refresh walks active
  workstreams on internal_model_reload so descriptions update
  without restart.

* fix: clarify no-registry placeholder + avoid double BM25 rebuild

Addresses Copilot feedback on PR #361.

1. plan_agent.json / task_agent.json placeholder said the parameter
   falls back to the "operator-configured plan/task model".  That
   text is what no-registry sessions see (registry-bearing sessions
   get the templated description with the live alias list); for
   those single-model sessions, omitting the param falls back to
   the current session model, not an operator-configured one.
   Reword so the no-registry user gets accurate guidance.

2. _on_mcp_tools_changed already calls _rebuild_tool_search after
   merging MCP tools.  _render_agent_tool_descriptions also
   rebuilt the BM25 index when active, so the MCP refresh path
   was rebuilding twice per refresh.  Move the BM25 rebuild out
   of the private render helper into the public
   refresh_agent_tool_schemas wrapper — _on_mcp_tools_changed
   keeps calling the render helper directly (no double rebuild),
   and registry-reload callers go through the wrapper which
   still keeps the index in sync.
2026-04-16 11:50:13 -07:00
Patrick Buckley 6c026710ff feat: ConfigStore + admin UI for plan/task agent model and effort (#360)
* feat: ConfigStore + admin UI for plan/task agent model and effort

Per-kind sub-agent routing was added in #359 but only via config.toml.
Operators can now switch the plan_agent / task_agent model and reasoning
effort at runtime from the admin Model tab without restarting.

Adds four ConfigStore-backed settings:
  model.plan_alias    — alias for plan_agent
  model.task_alias    — alias for task_agent
  model.plan_effort   — reasoning effort for plan_agent
  model.task_effort   — reasoning effort for task_agent

Server startup and internal_model_reload both apply these as overrides
on top of the registry's config.toml-loaded values; the new logic
computes "effective" values for all five model-routing fields and only
calls registry.reload() when at least one differs.

Admin UI: extracts ALIAS_SETTING_KEYS to a const used by both the
dynamic-alias-choice injection and the empty-option label rendering.
Adds INHERIT_EMPTY_LABEL_KEYS so plan_effort / task_effort show
"(inherit)" for empty — distinct from the literal "none" choice (which
actually disables reasoning, very different from leaving unset).

Also fixes Copilot review feedback from #359:
  - _validate_effort treats empty / whitespace as unset rather than
    warning on benign explicit-empty configs (with .strip().lower()
    normalisation; "HIGH" and " low " now parse correctly)
  - turnstone.example.toml's reasoning_effort comment lists the full
    set of accepted values (none, minimal, low, medium, high, xhigh, max)

* fix: apply routing overrides on config-reload + skip no-op model-reload

Addresses Copilot feedback on PR #360.

1. Admin settings updates fan out via /_internal/config-reload, which
   only reloaded the ConfigStore — plan/task routing changes weren't
   visible until a model-reload or restart, defeating the runtime
   configurability this PR is meant to add.

2. /_internal/model-reload always called registry.reload(), churning
   cached clients even when nothing changed. Risky when fanned out
   across nodes (could close in-flight clients).

Extracts two helpers in server.py:
  - _effective_routing(cs, ...)  pure function: overlay CS values on base
  - _apply_routing_overrides(reg, cs)  reload only when something differs

Used by the startup path, config_reload (new), and model_reload (now
short-circuits with a noop response when models + routing are unchanged).
2026-04-16 11:08:26 -07:00
Patrick Buckley 54dd557476 feat: split plan_model and task_model, configurable agent reasoning effort
plan_agent and task_agent previously shared a single agent_model knob and
plan_agent hardcoded reasoning_effort="high" in three call sites. They
have different cost/latency profiles — plan is rare and benefits from a
stronger model, task is frequent and benefits from a cheaper one — so
sharing the knob undertunes both.

ModelRegistry gains plan_model, task_model, plan_effort, task_effort.
Per-kind overrides win over the legacy agent_model, which still works
as the single-knob fallback for both. resolve_agent_alias(kind) and
resolve_agent_effort(kind) centralise the resolution; PLAN_DEFAULT_EFFORT
captures the back-compat "high" default in one place rather than at
every call site.

session._run_agent delegates resolution by label ("plan" vs "task").
The three hardcoded reasoning_effort="high" arguments are removed —
behaviour is identical when no plan_effort is configured.

Loader validates effort against {none,minimal,low,medium,high,xhigh,max}
and warns + drops typos rather than passing them to the provider.

ConfigStore parity and admin UI for the new knobs are deferred to a
follow-up — config.toml-only is enough for the backend split.
2026-04-16 10:26:19 -07:00
Patrick Buckley 87a9af1075 fix: broadcast plan_resolved SSE so other clients dismiss in sync
Previously, resolving a plan on one client (e.g. phone) cleared the
server's pending state and unblocked the worker, but emitted no event
to other connected clients. Their plan-approval modal stayed stuck.

resolve_plan() now enqueues a plan_resolved frame (mirroring the
approval_resolved pattern in resolve_approval) before clearing
_pending_plan_review, so a reconnecting client cannot receive both
the replayed plan_review and the live plan_resolved. Skips the frame
on the cancel-with-no-plan path.

Client adds a plan_resolved handler that dismisses the modal without
re-firing /v1/api/plan, restores keyboard context (skipped on touch
to avoid soft-keyboard pop on mobile), labels the inline plan summary
"(synced)" so remote dismissal is unambiguous, announces via the
existing aria-live #toast for screen-reader parity, and falls back
to an info message if plan_resolved races ahead of plan_review.

Adds PlanResolvedEvent to the Python and TypeScript SDKs with
deserialization and type-guard tests.
2026-04-16 09:56:17 -07:00
Patrick Buckley a6c4abe82a chore: bump version to 1.4.0a4 2026-04-16 09:15:03 -07:00
Patrick Buckley 30c89f46c6 feat: add Claude Opus 4.7 support (#357)
- Add claude-opus-4-7 capability entry (1M ctx, 128K output, adaptive
  thinking, supports_temperature=False, thinking_display=summarized)
- Suppress temperature param for Opus 4.7 (API returns 400)
- Add thinking display opt-in via new ModelCapabilities.thinking_display
  field - Opus 4.7 omits thinking by default, always send summarized
- Add xhigh effort level to mapping and Opus 4.7 effort_levels
- Add xhigh/max options to skill template dropdowns in admin console
- Align reasoning effort label capitalization across all console dropdowns
- Update example config to reference claude-opus-4-7
- 10 new tests with regression guards for Opus 4.6 backward compat

Verified against live API: streaming and completion calls succeed.
2026-04-16 08:55:32 -07:00
Patrick Buckley aaea4d302d chore(security): ignore unfixable jq CVEs in Debian 13.4 base image
Trivy flags two HIGH CVEs in jq/libjq1 1.7.1-6+deb13u1 with no fixed
version yet from Debian:

- CVE-2026-39979: out-of-bounds read in jv_parse_sized() on non-NUL-
  terminated buffers
- CVE-2026-40164: DoS via crafted JSON causing hash collisions

jq is invoked only on trusted CLI/admin paths against
process-controlled JSON input in turnstone — never on untrusted
network bytes — so the NUL-terminated invariant holds and the DoS
vector is not reachable.

Will revisit when Debian publishes a patched libjq1.
2026-04-15 13:41:15 -07:00
67 changed files with 8409 additions and 553 deletions
+13
View File
@@ -38,3 +38,16 @@ CVE-2026-33671
CVE-2026-29786
# https://avd.aquasec.com/nvd/cve-2026-31802
CVE-2026-31802
# jq out-of-bounds read on non-NUL-terminated buffers — no fix in Debian 13 repos yet.
# Affects jq + libjq1 (1.7.1-6+deb13u1). jq is invoked only on trusted
# CLI/admin paths against process-controlled JSON input, never on untrusted
# network bytes, so the NUL-terminated invariant holds in our usage.
# https://avd.aquasec.com/nvd/cve-2026-39979
CVE-2026-39979
# jq DoS via crafted JSON object causing hash collisions — no fix in Debian 13 repos yet.
# Affects jq + libjq1 (1.7.1-6+deb13u1). Same trust boundary as above:
# jq is not exposed to attacker-controlled JSON in turnstone.
# https://avd.aquasec.com/nvd/cve-2026-40164
CVE-2026-40164
+203
View File
@@ -0,0 +1,203 @@
# Changelog
All notable changes to turnstone are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [PEP 440](https://peps.python.org/pep-0440/) for
version numbers (`X.Y.Z`, with `X.Y.ZaN` / `bN` / `rcN` for pre-releases).
Three release tracks are maintained:
- **`stable/1.0`** — patch-only (`v1.0.x`)
- **`stable/1.3`** — patch-only (`v1.3.x`)
- **`stable/1.4`** — patch-only (`v1.4.x`)
- **`main`** — experimental (`v1.5.0aN`)
## [Unreleased]
## [1.4.0]
User-visible additions: a full attachment system (images + text documents,
including pre-creation uploads), a unified dashboard composer, a Slack
channel adapter, per-call plan/task model selection with an admin UI, and
provider capability passthrough.
This release introduces two forward-only schema migrations
(`037_workstream_attachments`, `038_workstream_attachments_reserved_at`)
that the server applies automatically on first startup against an
existing 1.3.x database. Both are additive; no data loss. See
**Database migrations** below for details.
### Added
- **Workstream attachments** — images (png/jpeg/gif/webp, 4 MiB cap) and
text documents (any `text/*` MIME, allowlisted application MIMEs, or
known text extensions; 512 KiB cap; UTF-8 enforced). Magic-byte image
sniffing on upload; per-(ws, user) pending cap of 10. Three-state
lifecycle (`pending → reserved → consumed`) with reservation tokens
threaded through `/v1/api/send` so queued multimodal turns can't lose
files to overlapping sends. Provider-side translation: Anthropic
emits native document blocks; OpenAI Chat Completions inlines them as
escaped `<document>` text blocks; Responses API emits `input_text`
with the same wrapper. (#356)
- **Attachments at workstream-creation time** —
`POST /v1/api/workstreams/new` accepts `multipart/form-data` (one
`meta` JSON field plus 0..N `file` parts). Files are validated and
reserved onto the first turn before the dispatch worker fires; failure
rolls back the fresh workstream so no orphan rows leak. Web UI
(new-workstream modal + dashboard composer), Python SDK, and
TypeScript SDK all gained attachment support. Cluster routing
(`/v1/api/route/workstreams/{ws_id}/attachments`) extended to forward
multipart bodies + preserve upstream headers (CSP, Content-Disposition).
SDKs auto-generate `ws_id` client-side so cluster-routed callers can
bind the body to the owning node before it lands. (#362)
- **Slack channel adapter** (Socket Mode) — mirrors the Discord adapter:
per-user channel sessions via configurable slash command, DM routing,
SSE event consumption, tool approval buttons (with per-user owner
enforcement), plan-review approve / request-changes modal,
notification reply routing back into the workstream, session recovery
after restart. Install with `pip install 'turnstone[slack]'`. (#355)
- **Console admin UX support for Slack** — channel-link modal offers
Slack alongside Discord; skill notify-on-complete forms expose a
per-row channel-type dropdown (and no longer hardcode `discord`);
per-platform `.scope-discord` / `.scope-slack` badge classes with
theme-aware tokens (`--discord` / `--slack`) so light theme passes
WCAG AA. (#365)
- **Per-call plan/task model selection** — `plan_model` and `task_model`
are now distinct from the conversation model and from each other, with
configurable reasoning effort per agent. `ConfigStore` admin tab in
the console UI lets operators set defaults; per-call overrides
available via the `plan_agent` / `task_agent` tools. (#360, #361)
- **Provider capability passthrough** — resolved per-model capabilities
(vision support, reasoning support, native web search, etc.) flow
through to provider clients so feature gating no longer relies on
string matching. Server companion published in the same change. (#352)
- **Claude Opus 4.7 support** — provider capabilities, tokenizer
awareness, and adaptive thinking semantics. (#357 — also in 1.3.1)
- **Dashboard composer refactor** — unified single-flow create from the
per-node dashboard. Multi-line textarea + collapsible Options panel
(model / judge / skill) + paperclip + drag-drop / paste-image + chip
strip. Submit-button label dynamically toggles between `Create`
(empty) and `Send` (text or attachments staged); Enter and click both
go through the same `dashboardSubmit()`. Replaces the inconsistent
prior split where Enter created+sent raw and the button opened a
separate modal. Options panel state persists in `localStorage`;
active non-default selections render as an inline summary chip beside
the Options button; drag-over shows an explicit "Drop to attach"
overlay. (#362, #366)
- **Workstream attachments — orphan reservation sweep** — periodic
background sweep clears `reserved_for_msg_id` on rows whose
`reserved_at` exceeds a 1-hour threshold, self-healing reservations
leaked by process crashes between reserve and consume. Backed by a
partial index on `(reserved_at) WHERE reserved_at IS NOT NULL` so the
scan stays cheap as the consumed-history grows. Threshold tracks
reservation age, not upload age, so a long-pending fresh send can't
be racially unreserved. (#363)
- **`SendResponse` extended** — `attached_ids`,
`dropped_attachment_ids`, `priority`, `msg_id` fields exposed in
Pydantic + TypeScript SDKs so attachment-aware clients can detect
partial reservations and dequeue queued messages. (#365)
### Changed
- **`plan_model` and `task_model` now split** from the conversation
model and from each other — operators who rely on a single model for
all three should set both `plan_model` and `task_model` explicitly in
their config; otherwise both default to the conversation model so
behaviour is unchanged. (#54dd557)
- **Channel notify-on-complete `channel_type` is no longer hardcoded
in the admin UI** — operators creating notify targets through the
skill admin form previously got `channel_type: "discord"` regardless
of what they wanted. Existing skill JSON values are unaffected; only
newly created targets through the form differ. (#365)
- **Slack adapter approval previews** — capped at 600 chars per item
with a 2700-char total budget so multi-tool approval batches never
exceed Slack's 3000-char `section.text` limit. Truncated batches
show a `…and N more (preview truncated)` suffix. (#365)
- **PostgreSQL deployment image** swapped from `bitnami/pgbouncer` to
`edoburu/pgbouncer` to track upstream releases and reduce image size.
No config changes required for typical deployments; review your helm
values if you depend on `bitnami`-specific environment variable
conventions. (#353)
### Fixed
- **`plan_resolved` SSE broadcast** — when one client resolved a plan
approval, other clients viewing the same workstream now have the
approval card dismissed in sync. (#87a9af1)
- **Slack notification reply routing** — one notification reply
previously pinned every later assistant response for that workstream
to the notification thread until the bot restarted. Reply-route
override now clears on `StreamEndEvent`. (#365)
- **Slack plan-review mrkdwn fence** — plan content containing triple
backticks (very common — plans often quote code) no longer breaks the
surrounding fence and lets later content render as live markup. The
shared `_sanitize_slack_preview` helper splices a zero-width space
inside any ``` ``` `` sequence while keeping single backticks
readable. (#365)
- **Slack-routed workstreams now load the chat-specific system prompt**
via `client_type="chat"`, matching Discord. (#365)
- **`/v1/api/workstreams/new` no longer emits a phantom
`ws_created`/`ws_closed` SSE pair** when attachment validation
rejects a multipart create. Validation runs before the broadcast so
failed creates are silent on dashboards. (#362)
- **Multipart Content-Type boundary preservation** in console routing
proxy — `boundary=` parameter is case-sensitive and was being
lowercased before forwarding to the upstream node, breaking parsing
for clients that used mixed-case boundaries (most browsers). (#362)
- **Local-theme contrast for new badge colors** — `.scope-discord` and
`.scope-slack` first shipped with raw hex that failed WCAG AA on
light theme (1.8:1 / 2.4:1). Theme-aware `--discord` / `--slack`
tokens with proper light variants now pass. (#365)
### Security
- **Slack approval per-user authentication** — only the session owner
can click Approve/Deny on a Slack tool-approval card. Without this,
any channel member with view access could approve dangerous tool
calls initiated by someone else. (#355)
- **Attachment ownership masking** — cross-user/cross-workstream
attachment ID lookups return 404 (not 403) so non-owners can't
enumerate workstream existence by response code. (#356)
- Bumped Debian base image; remaining unfixable `jq` CVEs are
documented and exception-listed. (#aaea4d3)
### Database migrations
- **`037_workstream_attachments`** — new `workstream_attachments` table
with the lifecycle columns described above. Indexes for ws_id,
pending lookups, message linkage, and reservation scoping.
- **`038_workstream_attachments_reserved_at`** — adds `reserved_at`
column for the orphan-sweep staleness signal, plus a partial index
on `reserved_at IS NOT NULL` so the periodic scan is cheap.
Both migrations are additive and idempotent, and the server applies
them automatically on first startup against an existing 1.3.x database.
No manual `alembic upgrade` step is required — though running it
manually beforehand (e.g. as part of a phased deploy) remains safe.
### SDK
Python + TypeScript clients gained:
- `AttachmentUpload` type
- `upload_attachment(ws_id, filename, data, mime_type=None)`
- `list_attachments(ws_id)`
- `get_attachment_content(ws_id, attachment_id) → bytes / Blob`
- `delete_attachment(ws_id, attachment_id)`
- `send(message, ws_id, attachment_ids=...)` (extended)
- `create_workstream(..., attachments=[...])` — multipart variant with
client-side `ws_id` generation for cluster-routed callers
- Console SDK: `route_create_workstream(attachments=...)`,
`route_upload_attachment`, `route_list_attachments`,
`route_get_attachment_content`, `route_delete_attachment`
- Refusal of `attachments + target_node` combination at the SDK
boundary (the multipart routing layer doesn't honor `target_node`,
so silently picking the wrong node is now an explicit error)
## [1.3.1]
### Added
- Backport: Claude Opus 4.7 support (provider capabilities, tokenizer,
adaptive thinking). (#357)
+1 -1
View File
@@ -8,7 +8,7 @@ FROM python:3.14-slim
LABEL org.opencontainers.image.title="turnstone" \
org.opencontainers.image.description="Multi-node AI orchestration platform"
COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /usr/local/bin/uv
COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /usr/local/bin/uv
# Remove the slim image's man page exclusion so man-db has actual content
RUN rm -f /etc/dpkg/dpkg.cfg.d/docker
+7 -5
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "turnstone"
version = "1.4.0a3"
version = "1.4.0"
description = "Multi-node AI orchestration platform with tool use, agent routing, and cluster simulation."
readme = "README.md"
license = "BUSL-1.1"
@@ -44,7 +44,7 @@ Repository = "https://github.com/turnstonelabs/turnstone"
Issues = "https://github.com/turnstonelabs/turnstone/issues"
[project.optional-dependencies]
test = ["pytest>=9.0", "pytest-cov>=6.0", "croniter>=3.0"]
test = ["pytest>=9.0", "pytest-cov>=6.0", "croniter>=3.0", "slack-bolt>=1.18", "aiohttp>=3.9"]
dev = ["ruff>=0.9", "mypy>=1.14"]
console = ["croniter>=3.0"]
anthropic = ["anthropic>=0.39"]
@@ -53,7 +53,8 @@ ddg = ["ddgs>=9.0"]
discord = ["discord.py>=2.4"]
tls = ["lacme>=1.0.5"]
sandbox = ["sympy>=1.13", "numpy>=2.0", "scipy>=1.14", "pytest>=9.0"]
all = ["turnstone[console,anthropic,postgres,discord,ddg,tls,sandbox]"]
slack = ["slack-bolt>=1.18", "aiohttp>=3.9"]
all = ["turnstone[console,anthropic,postgres,discord,ddg,tls,sandbox,slack]"]
[project.scripts]
turnstone = "turnstone.cli:main"
@@ -181,5 +182,6 @@ disallow_untyped_decorators = false
warn_unused_ignores = false
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
module = ["slack_bolt", "slack_bolt.*", "slack_sdk", "slack_sdk.*"]
ignore_missing_imports = true
disallow_untyped_calls = false
+9 -9
View File
@@ -55,9 +55,9 @@
"license": "MIT"
},
"node_modules/@napi-rs/wasm-runtime": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.3.tgz",
"integrity": "sha512-xK9sGVbJWYb08+mTJt3/YV24WxvxpXcXtP6B172paPZ+Ts69Re9dAr7lKwJoeIx8OoeuimEiRZ7umkiUVClmmQ==",
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz",
"integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==",
"dev": true,
"license": "MIT",
"optional": true,
@@ -959,9 +959,9 @@
}
},
"node_modules/postcss": {
"version": "8.5.9",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.9.tgz",
"integrity": "sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==",
"version": "8.5.10",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.10.tgz",
"integrity": "sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==",
"dev": true,
"funding": [
{
@@ -1046,9 +1046,9 @@
"license": "MIT"
},
"node_modules/std-env": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/std-env/-/std-env-4.0.0.tgz",
"integrity": "sha512-zUMPtQ/HBY3/50VbpkupYHbRroTRZJPRLvreamgErJVys0ceuzMkD44J/QjqhHjOzK42GQ3QZIeFG1OYfOtKqQ==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/std-env/-/std-env-4.1.0.tgz",
"integrity": "sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==",
"dev": true,
"license": "MIT"
},
+69 -16
View File
@@ -29,6 +29,12 @@ export interface ClientOptions {
export interface RequestOptions {
json?: object;
params?: Record<string, string | number>;
/**
* When set, send as multipart form-data with this body. The runtime's
* fetch sets the Content-Type + boundary itself, so we deliberately do
* not include a Content-Type header in this case.
*/
form?: FormData;
}
export class BaseClient {
@@ -47,36 +53,34 @@ export class BaseClient {
path: string,
options?: RequestOptions,
): Promise<T> {
const headers: Record<string, string> = {
"Content-Type": "application/json",
};
const headers: Record<string, string> = {};
if (!options?.form) {
headers["Content-Type"] = "application/json";
}
if (this.token) {
headers["Authorization"] = `Bearer ${this.token}`;
}
let url = `${this.baseUrl}${path}`;
if (options?.params) {
const searchParams = new URLSearchParams();
for (const [key, value] of Object.entries(options.params)) {
if (value !== undefined && value !== "") {
searchParams.set(key, String(value));
}
}
const qs = searchParams.toString();
if (qs) url += `?${qs}`;
const url = this._buildUrl(path, options?.params);
let body: BodyInit | undefined;
if (options?.form) {
body = options.form;
} else if (options?.json) {
body = JSON.stringify(options.json);
}
const resp = await this.fetchFn(url, {
method,
headers,
body: options?.json ? JSON.stringify(options.json) : undefined,
body,
});
if (!resp.ok) {
let msg = "";
try {
const body = (await resp.json()) as Record<string, unknown>;
msg = (body.error as string) ?? (body.detail as string) ?? "";
const errBody = (await resp.json()) as Record<string, unknown>;
msg = (errBody.error as string) ?? (errBody.detail as string) ?? "";
} catch {
msg = await resp.text().catch(() => "");
}
@@ -86,6 +90,55 @@ export class BaseClient {
return (await resp.json()) as T;
}
protected async requestBytes(
method: string,
path: string,
options?: { params?: Record<string, string | number> },
): Promise<{ bytes: Uint8Array; contentType: string; filename: string }> {
const headers: Record<string, string> = {};
if (this.token) {
headers["Authorization"] = `Bearer ${this.token}`;
}
const url = this._buildUrl(path, options?.params);
const resp = await this.fetchFn(url, { method, headers });
if (!resp.ok) {
let msg = "";
try {
const errBody = (await resp.json()) as Record<string, unknown>;
msg = (errBody.error as string) ?? (errBody.detail as string) ?? "";
} catch {
msg = await resp.text().catch(() => "");
}
throw new TurnstoneAPIError(resp.status, msg || `HTTP ${resp.status}`);
}
const contentType =
resp.headers.get("content-type") ?? "application/octet-stream";
const disposition = resp.headers.get("content-disposition") ?? "";
const match = /filename="?([^";]+)"?/.exec(disposition);
const filename = match ? match[1] : "";
const buf = await resp.arrayBuffer();
return { bytes: new Uint8Array(buf), contentType, filename };
}
private _buildUrl(
path: string,
params?: Record<string, string | number>,
): string {
let url = `${this.baseUrl}${path}`;
if (params) {
const searchParams = new URLSearchParams();
for (const [key, value] of Object.entries(params)) {
if (value !== undefined && value !== "") {
searchParams.set(key, String(value));
}
}
const qs = searchParams.toString();
if (qs) url += `?${qs}`;
}
return url;
}
protected async *streamSSE<T = Record<string, unknown>>(
path: string,
params?: Record<string, string | number>,
+116
View File
@@ -4,6 +4,8 @@ import type {
AdminListMemoriesOptions,
AdminMemoryInfo,
AdminSearchMemoriesOptions,
AttachmentContent,
AttachmentUpload,
AuditQueryOptions,
AuditResponse,
AuthLoginResponse,
@@ -16,6 +18,9 @@ import type {
ConsoleCreateWsRequest,
ConsoleCreateWsResponse,
ConsoleHealthResponse,
CreateWorkstreamRequest,
CreateWorkstreamResponse,
ListAttachmentsResponse,
CreateMcpServerRequest,
CreatePolicyOptions,
CreateRoleOptions,
@@ -55,12 +60,37 @@ import type {
UpdateScheduleRequest,
UpdateSettingOptions,
UpdateSkillRequest,
UploadAttachmentResponse,
UsageQueryOptions,
UsageResponse,
UserRoleInfo,
WorkstreamsOptions,
} from "./types.js";
function generateConsoleWsId(): string {
// 16 bytes => 32 hex chars; matches `secrets.token_hex(16)` server-side.
const buf = new Uint8Array(16);
crypto.getRandomValues(buf);
return Array.from(buf, (b) => b.toString(16).padStart(2, "0")).join("");
}
function consoleAttachmentToBlob(att: AttachmentUpload): Blob {
if (att.data instanceof Blob) {
return att.mimeType
? new Blob([att.data], { type: att.mimeType })
: att.data;
}
// Copy bytes into a fresh ArrayBuffer-backed Uint8Array. The Blob
// BlobPart type rejects ArrayBufferLike views (could be backed by
// SharedArrayBuffer); a freshly allocated buffer is plainly ArrayBuffer.
const src = att.data;
const fresh = new Uint8Array(new ArrayBuffer(src.byteLength));
fresh.set(src);
return new Blob([fresh], {
type: att.mimeType ?? "application/octet-stream",
});
}
/** Async client for the turnstone console API. */
export class TurnstoneConsole extends BaseClient {
constructor(options: ClientOptions) {
@@ -113,6 +143,92 @@ export class TurnstoneConsole extends BaseClient {
});
}
// -- Routing proxy --------------------------------------------------------
/**
* Create a workstream via the console hash-ring router.
*
* When `attachments` is non-empty the request is sent as
* multipart/form-data and the console routes via `?ws_id=<hex>`
* (auto-generated when not supplied) so the body lands on the
* owning node directly.
*/
async routeCreateWorkstream(
opts?: CreateWorkstreamRequest & { target_node?: string },
): Promise<
CreateWorkstreamResponse & { node_url?: string; node_id?: string }
> {
const attachments = opts?.attachments;
if (attachments && attachments.length > 0) {
// The console's multipart route_create routes by `?ws_id=` only —
// it does not parse the body to honor `target_node`. Refuse the
// combination at the SDK boundary so callers don't silently get
// routed to the wrong node.
if (opts?.target_node) {
throw new Error(
"target_node is not supported with attachments; " +
"use ws_id (caller-generated to hash to the desired node) instead",
);
}
const meta: Record<string, unknown> = { ...opts };
delete (meta as { attachments?: unknown }).attachments;
let wsId = (meta.ws_id as string | undefined) ?? "";
if (!wsId) {
wsId = generateConsoleWsId();
meta.ws_id = wsId;
}
const form = new FormData();
form.append("meta", JSON.stringify(meta));
for (const att of attachments) {
form.append("file", consoleAttachmentToBlob(att), att.filename);
}
return this.request("POST", "/v1/api/route/workstreams/new", {
form,
params: { ws_id: wsId },
});
}
return this.request("POST", "/v1/api/route/workstreams/new", {
json: opts ?? {},
});
}
async routeUploadAttachment(
wsId: string,
file: AttachmentUpload,
): Promise<UploadAttachmentResponse> {
const form = new FormData();
form.append("file", consoleAttachmentToBlob(file), file.filename);
return this.request(
"POST",
`/v1/api/route/workstreams/${wsId}/attachments`,
{ form },
);
}
async routeListAttachments(wsId: string): Promise<ListAttachmentsResponse> {
return this.request("GET", `/v1/api/route/workstreams/${wsId}/attachments`);
}
async routeGetAttachmentContent(
wsId: string,
attachmentId: string,
): Promise<AttachmentContent> {
return this.requestBytes(
"GET",
`/v1/api/route/workstreams/${wsId}/attachments/${attachmentId}/content`,
);
}
async routeDeleteAttachment(
wsId: string,
attachmentId: string,
): Promise<StatusResponse> {
return this.request(
"DELETE",
`/v1/api/route/workstreams/${wsId}/attachments/${attachmentId}`,
);
}
// -- Streaming ------------------------------------------------------------
async *clusterEvents(): AsyncIterableIterator<ClusterEvent> {
+10
View File
@@ -92,6 +92,11 @@ export interface PlanReviewEvent {
content: string;
}
export interface PlanResolvedEvent {
type: "plan_resolved";
feedback: string;
}
export interface InfoEvent {
type: "info";
message: string;
@@ -165,6 +170,7 @@ export type ServerEvent =
| ToolOutputChunkEvent
| StatusEvent
| PlanReviewEvent
| PlanResolvedEvent
| InfoEvent
| ErrorEvent
| BusyErrorEvent
@@ -283,6 +289,10 @@ export function isPlanReviewEvent(e: ServerEvent): e is PlanReviewEvent {
return e.type === "plan_review";
}
export function isPlanResolvedEvent(e: ServerEvent): e is PlanResolvedEvent {
return e.type === "plan_resolved";
}
export function isCancelledEvent(e: ServerEvent): e is CancelledEvent {
return e.type === "cancelled";
}
+6
View File
@@ -183,6 +183,12 @@ export type {
SkillInstallRequest,
SkillInstallResponse,
SkillInstallSkipped,
// Attachment types
AttachmentUpload,
AttachmentInfo,
UploadAttachmentResponse,
ListAttachmentsResponse,
AttachmentContent,
} from "./types.js";
// SSE parser (for advanced usage)
+96 -5
View File
@@ -1,6 +1,8 @@
import { BaseClient, type ClientOptions } from "./base.js";
import type { ServerEvent } from "./events.js";
import type {
AttachmentContent,
AttachmentUpload,
AuthLoginResponse,
AuthSetupResponse,
AuthStatusResponse,
@@ -9,20 +11,46 @@ import type {
DashboardResponse,
DeleteMemoryOptions,
HealthResponse,
ListAttachmentsResponse,
ListMemoriesOptions,
ListMemoriesResponse,
ListSavedWorkstreamsResponse,
SkillSummary,
ListWorkstreamsResponse,
MemoryInfo,
SaveMemoryRequest,
SearchMemoriesRequest,
SendAndWaitOptions,
SendResponse,
SkillSummary,
StatusResponse,
TurnResult,
UploadAttachmentResponse,
} from "./types.js";
function generateWsId(): string {
// 16 bytes => 32 hex chars; matches `secrets.token_hex(16)` server-side.
const buf = new Uint8Array(16);
crypto.getRandomValues(buf);
return Array.from(buf, (b) => b.toString(16).padStart(2, "0")).join("");
}
function attachmentToBlob(att: AttachmentUpload): Blob {
if (att.data instanceof Blob) {
return att.mimeType
? new Blob([att.data], { type: att.mimeType })
: att.data;
}
// Copy bytes into a fresh ArrayBuffer-backed Uint8Array. The Blob
// BlobPart type rejects ArrayBufferLike views (could be backed by
// SharedArrayBuffer); a freshly allocated buffer is plainly ArrayBuffer.
const src = att.data;
const fresh = new Uint8Array(new ArrayBuffer(src.byteLength));
fresh.set(src);
return new Blob([fresh], {
type: att.mimeType ?? "application/octet-stream",
});
}
/** Async client for the turnstone server API. */
export class TurnstoneServer extends BaseClient {
constructor(options: ClientOptions) {
@@ -42,7 +70,27 @@ export class TurnstoneServer extends BaseClient {
async createWorkstream(
opts?: CreateWorkstreamRequest,
): Promise<CreateWorkstreamResponse> {
return this.request("POST", "/v1/api/workstreams/new", { json: opts });
const attachments = opts?.attachments;
if (attachments && attachments.length > 0) {
// Multipart variant: pre-generate ws_id so cluster routers can
// hash to the owning node before this body lands. Server accepts
// either a server-generated id (when meta.ws_id is empty) or the
// caller-supplied one.
const meta: Record<string, unknown> = { ...opts };
delete (meta as { attachments?: unknown }).attachments;
if (!meta.ws_id) {
meta.ws_id = generateWsId();
}
const form = new FormData();
form.append("meta", JSON.stringify(meta));
for (const att of attachments) {
form.append("file", attachmentToBlob(att), att.filename);
}
return this.request("POST", "/v1/api/workstreams/new", { form });
}
return this.request("POST", "/v1/api/workstreams/new", {
json: opts ?? {},
});
}
async closeWorkstream(wsId: string): Promise<StatusResponse> {
@@ -53,12 +101,55 @@ export class TurnstoneServer extends BaseClient {
// -- Chat interaction -----------------------------------------------------
async send(message: string, wsId: string): Promise<SendResponse> {
return this.request("POST", "/v1/api/send", {
json: { message, ws_id: wsId },
async send(
message: string,
wsId: string,
opts?: { attachmentIds?: string[] },
): Promise<SendResponse> {
const body: Record<string, unknown> = { message, ws_id: wsId };
if (opts?.attachmentIds !== undefined) {
body.attachment_ids = opts.attachmentIds;
}
return this.request("POST", "/v1/api/send", { json: body });
}
// -- Attachments ----------------------------------------------------------
async uploadAttachment(
wsId: string,
file: AttachmentUpload,
): Promise<UploadAttachmentResponse> {
const form = new FormData();
form.append("file", attachmentToBlob(file), file.filename);
return this.request("POST", `/v1/api/workstreams/${wsId}/attachments`, {
form,
});
}
async listAttachments(wsId: string): Promise<ListAttachmentsResponse> {
return this.request("GET", `/v1/api/workstreams/${wsId}/attachments`);
}
async getAttachmentContent(
wsId: string,
attachmentId: string,
): Promise<AttachmentContent> {
return this.requestBytes(
"GET",
`/v1/api/workstreams/${wsId}/attachments/${attachmentId}/content`,
);
}
async deleteAttachment(
wsId: string,
attachmentId: string,
): Promise<StatusResponse> {
return this.request(
"DELETE",
`/v1/api/workstreams/${wsId}/attachments/${attachmentId}`,
);
}
async approve(opts: {
wsId: string;
approved?: boolean;
+73
View File
@@ -50,10 +50,67 @@ export interface AuthSetupResponse {
export interface SendRequest {
message: string;
ws_id: string;
/**
* Explicit list of pending attachment ids to inject into this turn.
* When omitted, any pending attachments for the caller on the
* workstream are auto-consumed; an empty list disables auto-consume.
*/
attachment_ids?: string[];
}
export interface SendResponse {
/** "ok" | "busy" | "queued" | "queue_full". */
status: string;
/**
* Attachment ids actually reserved onto this turn. Subset of the
* request's `attachment_ids` (or the auto-consumed pending set).
*/
attached_ids?: string[];
/**
* Attachment ids the caller requested that the server could not
* reserve (lost a race, already consumed, or cross-scope). The
* request still proceeds with whatever was reserved.
*/
dropped_attachment_ids?: string[];
/** Set on "queued" responses: relative priority of the queued message. */
priority?: string | null;
/** Set on "queued" responses: id used to dequeue the message. */
msg_id?: string | null;
}
// ---------------------------------------------------------------------------
// Server API — Attachments
// ---------------------------------------------------------------------------
/** A file to upload as an attachment. */
export interface AttachmentUpload {
filename: string;
/** Raw file bytes; use a `Blob` in browsers and a `Uint8Array` in Node. */
data: Blob | Uint8Array;
/** Optional advisory MIME type; the server applies its own validation. */
mimeType?: string;
}
export interface AttachmentInfo {
attachment_id: string;
filename: string;
mime_type: string;
size_bytes: number;
/** "image" or "text". */
kind: string;
}
export type UploadAttachmentResponse = AttachmentInfo;
export interface ListAttachmentsResponse {
attachments: AttachmentInfo[];
}
/** Raw bytes returned from the attachment `/content` endpoint. */
export interface AttachmentContent {
bytes: Uint8Array;
contentType: string;
filename: string;
}
export interface ApproveRequest {
@@ -79,6 +136,20 @@ export interface CreateWorkstreamRequest {
auto_approve?: boolean;
resume_ws?: string;
skill?: string;
/** First user message dispatched in a background worker after creation. */
initial_message?: string;
/**
* Caller-supplied workstream id (32-hex). Auto-generated when omitted.
* Required for cluster-routed multipart creates so the console can
* hash to the owning node before the body lands.
*/
ws_id?: string;
/**
* Files to attach to the first turn. When non-empty the request is
* sent as multipart/form-data and (with `initial_message`) reserved
* onto that turn before the worker dispatches.
*/
attachments?: AttachmentUpload[];
}
export interface CreateWorkstreamResponse {
@@ -86,6 +157,8 @@ export interface CreateWorkstreamResponse {
name: string;
resumed?: boolean;
message_count?: number;
/** Ids of attachments saved by this request (multipart variant only). */
attachment_ids?: string[];
}
export interface CloseWorkstreamRequest {
+22
View File
@@ -62,6 +62,28 @@ describe("TurnstoneConsole", () => {
expect(url).toContain("page=2");
});
it("routeCreateWorkstream rejects attachments + target_node", async () => {
const fetchFn = vi.fn().mockResolvedValue(
new Response("{}", {
status: 500,
headers: { "content-type": "application/json" },
}),
);
const client = new TurnstoneConsole({
baseUrl: "http://test",
fetch: fetchFn,
});
const data = new TextEncoder().encode("hi");
await expect(
client.routeCreateWorkstream({
name: "x",
target_node: "n1",
attachments: [{ filename: "a.txt", data }],
}),
).rejects.toThrow(/target_node/);
expect(fetchFn).not.toHaveBeenCalled();
});
it("health returns parsed response", async () => {
const fetchFn = mockFetch({
status: "ok",
+6
View File
@@ -8,6 +8,7 @@ import {
isApproveRequestEvent,
isApprovalResolvedEvent,
isPlanReviewEvent,
isPlanResolvedEvent,
isReasoningEvent,
} from "../src/events.js";
import type { ServerEvent } from "../src/events.js";
@@ -76,4 +77,9 @@ describe("event type guards", () => {
const e: ServerEvent = { type: "plan_review", content: "## Plan" };
expect(isPlanReviewEvent(e)).toBe(true);
});
it("isPlanResolvedEvent", () => {
const e: ServerEvent = { type: "plan_resolved", feedback: "approved" };
expect(isPlanResolvedEvent(e)).toBe(true);
});
});
@@ -0,0 +1,168 @@
import { describe, expect, it, vi } from "vitest";
import { TurnstoneServer } from "../src/server.js";
function mockFetch(response: object, status = 200): typeof globalThis.fetch {
return vi.fn().mockResolvedValue(
new Response(JSON.stringify(response), {
status,
headers: { "content-type": "application/json" },
}),
);
}
function mockFetchBytes(
body: Uint8Array,
contentType: string,
filename = "",
): typeof globalThis.fetch {
const headers: Record<string, string> = { "content-type": contentType };
if (filename)
headers["content-disposition"] = `inline; filename="${filename}"`;
return vi
.fn()
.mockResolvedValue(new Response(body, { status: 200, headers }));
}
describe("TurnstoneServer attachments", () => {
it("uploadAttachment sends multipart with filename", async () => {
const fetchFn = mockFetch({
attachment_id: "att-1",
filename: "a.txt",
mime_type: "text/plain",
size_bytes: 5,
kind: "text",
});
const client = new TurnstoneServer({
baseUrl: "http://test",
fetch: fetchFn,
});
const data = new TextEncoder().encode("hello");
const result = await client.uploadAttachment("ws-X", {
filename: "a.txt",
data,
mimeType: "text/plain",
});
expect(result.attachment_id).toBe("att-1");
const [url, init] = (fetchFn as ReturnType<typeof vi.fn>).mock.calls[0];
expect(url).toBe("http://test/v1/api/workstreams/ws-X/attachments");
expect(init.method).toBe("POST");
expect(init.body).toBeInstanceOf(FormData);
// Browser/Node fetch sets the Content-Type header from FormData itself
expect(init.headers["Content-Type"]).toBeUndefined();
});
it("listAttachments hits the GET endpoint", async () => {
const fetchFn = mockFetch({ attachments: [] });
const client = new TurnstoneServer({
baseUrl: "http://test",
fetch: fetchFn,
});
const resp = await client.listAttachments("ws-X");
expect(resp.attachments).toEqual([]);
const [url, init] = (fetchFn as ReturnType<typeof vi.fn>).mock.calls[0];
expect(url).toBe("http://test/v1/api/workstreams/ws-X/attachments");
expect(init.method).toBe("GET");
});
it("getAttachmentContent returns raw bytes + parsed headers", async () => {
const bytes = new TextEncoder().encode("hello world");
const fetchFn = mockFetchBytes(
bytes,
"text/plain; charset=utf-8",
"notes.md",
);
const client = new TurnstoneServer({
baseUrl: "http://test",
fetch: fetchFn,
});
const result = await client.getAttachmentContent("ws-X", "att-1");
expect(new TextDecoder().decode(result.bytes)).toBe("hello world");
expect(result.contentType).toBe("text/plain; charset=utf-8");
expect(result.filename).toBe("notes.md");
});
it("deleteAttachment hits the DELETE endpoint", async () => {
const fetchFn = mockFetch({ status: "deleted" });
const client = new TurnstoneServer({
baseUrl: "http://test",
fetch: fetchFn,
});
const resp = await client.deleteAttachment("ws-X", "att-1");
expect(resp.status).toBe("deleted");
const [, init] = (fetchFn as ReturnType<typeof vi.fn>).mock.calls[0];
expect(init.method).toBe("DELETE");
});
it("send threads attachment_ids when provided", async () => {
const fetchFn = mockFetch({ status: "ok" });
const client = new TurnstoneServer({
baseUrl: "http://test",
fetch: fetchFn,
});
await client.send("hi", "ws-X", { attachmentIds: ["a1", "a2"] });
const [, init] = (fetchFn as ReturnType<typeof vi.fn>).mock.calls[0];
expect(JSON.parse(init.body)).toEqual({
message: "hi",
ws_id: "ws-X",
attachment_ids: ["a1", "a2"],
});
});
it("send omits attachment_ids when not supplied", async () => {
const fetchFn = mockFetch({ status: "ok" });
const client = new TurnstoneServer({
baseUrl: "http://test",
fetch: fetchFn,
});
await client.send("hi", "ws-X");
const [, init] = (fetchFn as ReturnType<typeof vi.fn>).mock.calls[0];
expect(JSON.parse(init.body)).toEqual({ message: "hi", ws_id: "ws-X" });
});
it("createWorkstream with attachments sends multipart and auto-generates ws_id", async () => {
const fetchFn = mockFetch({
ws_id: "00ff00000000000000000000000000ff",
name: "demo",
attachment_ids: ["att-1"],
});
const client = new TurnstoneServer({
baseUrl: "http://test",
fetch: fetchFn,
});
const data = new TextEncoder().encode("hello");
const resp = await client.createWorkstream({
name: "demo",
initial_message: "describe",
attachments: [{ filename: "a.txt", data, mimeType: "text/plain" }],
});
expect(resp.attachment_ids).toEqual(["att-1"]);
const [url, init] = (fetchFn as ReturnType<typeof vi.fn>).mock.calls[0];
expect(url).toBe("http://test/v1/api/workstreams/new");
expect(init.method).toBe("POST");
expect(init.body).toBeInstanceOf(FormData);
const form = init.body as FormData;
const meta = JSON.parse(form.get("meta") as string);
expect(meta.name).toBe("demo");
expect(meta.initial_message).toBe("describe");
expect(meta.ws_id).toMatch(/^[0-9a-f]{32}$/);
expect(meta.attachments).toBeUndefined();
const file = form.get("file");
expect(file).toBeInstanceOf(Blob);
});
it("createWorkstream without attachments uses JSON body", async () => {
const fetchFn = mockFetch({ ws_id: "ws-json", name: "j" });
const client = new TurnstoneServer({
baseUrl: "http://test",
fetch: fetchFn,
});
await client.createWorkstream({ name: "j" });
const [, init] = (fetchFn as ReturnType<typeof vi.fn>).mock.calls[0];
expect(init.headers["Content-Type"]).toBe("application/json");
expect(JSON.parse(init.body)).toEqual({ name: "j" });
});
});
File diff suppressed because it is too large Load Diff
+12
View File
@@ -90,6 +90,18 @@ class TestSetGetRoundTrip:
store.set("model.default_alias", "gpt5-prod")
assert store.get("model.default_alias") == "gpt5-prod"
def test_plan_task_alias(self, store):
store.set("model.plan_alias", "smart")
store.set("model.task_alias", "fast")
assert store.get("model.plan_alias") == "smart"
assert store.get("model.task_alias") == "fast"
def test_plan_task_effort(self, store):
store.set("model.plan_effort", "max")
store.set("model.task_effort", "low")
assert store.get("model.plan_effort") == "max"
assert store.get("model.task_effort") == "low"
# ---------------------------------------------------------------------------
# delete()
+353
View File
@@ -0,0 +1,353 @@
"""Tests for console routing of attachment endpoints + multipart route_create.
Covers the cluster-routing surface added alongside the workstream
attachment-on-create feature: the multipart variant of route_create and
the four ws-id-keyed attachment proxies under /v1/api/route/.
"""
from __future__ import annotations
from typing import Any
from unittest.mock import MagicMock
import httpx
from starlette.testclient import TestClient
from turnstone.console.collector import ClusterCollector
from turnstone.console.router import ConsoleRouter, NodeRef
_TEST_JWT_SECRET = "test-jwt-secret-minimum-32-chars!"
def _test_jwt() -> str:
from turnstone.core.auth import JWT_AUD_CONSOLE, create_jwt
return create_jwt(
user_id="test-routing",
scopes=frozenset({"read", "write", "approve", "service"}),
source="test",
secret=_TEST_JWT_SECRET,
audience=JWT_AUD_CONSOLE,
)
_AUTH: dict[str, str] = {"Authorization": f"Bearer {_test_jwt()}"}
def _make_app(router: Any) -> Any:
from turnstone.console.server import _load_static, create_app
_load_static()
collector = MagicMock(spec=ClusterCollector)
return create_app(
collector=collector,
jwt_secret=_TEST_JWT_SECRET,
router=router,
)
def _make_router() -> MagicMock:
router = MagicMock(spec=ConsoleRouter)
router.is_ready.return_value = True
router.route.return_value = NodeRef("node-a", "http://a:8080")
return router
# ---------------------------------------------------------------------------
# route_create multipart
# ---------------------------------------------------------------------------
class TestRouteCreateMultipart:
def test_multipart_requires_ws_id_query(self):
router = _make_router()
app = _make_app(router=router)
app.state.proxy_client = MagicMock(spec=httpx.AsyncClient)
client = TestClient(app, raise_server_exceptions=False)
try:
resp = client.post(
"/v1/api/route/workstreams/new",
files=[("file", ("a.txt", b"hello", "text/plain"))],
data={"meta": "{}"},
headers=_AUTH,
)
assert resp.status_code == 400
assert "ws_id" in resp.json()["error"]
finally:
client.close()
def test_multipart_forwards_raw_body_to_routed_node(self):
router = _make_router()
app = _make_app(router=router)
captured: dict[str, Any] = {}
async def _mock_post(*args: Any, **kwargs: Any) -> httpx.Response:
captured["url"] = args[0] if args else ""
captured["headers"] = kwargs.get("headers") or {}
captured["content"] = kwargs.get("content")
return httpx.Response(
200,
json={"ws_id": "00ff" + "0" * 28, "name": "demo"},
request=httpx.Request("POST", args[0] if args else "http://test"),
)
mock_proxy = MagicMock(spec=httpx.AsyncClient)
mock_proxy.post = MagicMock(side_effect=_mock_post)
app.state.proxy_client = mock_proxy
client = TestClient(app, raise_server_exceptions=False)
try:
ws_id = "00ff" + "0" * 28
resp = client.post(
f"/v1/api/route/workstreams/new?ws_id={ws_id}",
files=[("file", ("a.txt", b"hello", "text/plain"))],
data={"meta": '{"name":"demo"}'},
headers=_AUTH,
)
assert resp.status_code == 200, resp.text
data = resp.json()
assert data["node_id"] == "node-a"
# Forwarded multipart Content-Type
assert captured["headers"].get("Content-Type", "").startswith("multipart/form-data")
# Body bytes were forwarded raw
assert isinstance(captured["content"], (bytes, bytearray))
assert b"hello" in bytes(captured["content"])
router.route.assert_called_with(ws_id)
finally:
client.close()
def test_multipart_preserves_mixed_case_boundary(self):
"""The boundary= param is case-sensitive — must match body bytes verbatim.
Regression for an earlier bug where route_create lowercased the
whole Content-Type header before forwarding, mangling boundaries
like ``WebKitFormBoundary7MA4YWxkTrZu0gW``.
"""
router = _make_router()
app = _make_app(router=router)
captured: dict[str, Any] = {}
async def _mock_post(*args: Any, **kwargs: Any) -> httpx.Response:
captured["headers"] = kwargs.get("headers") or {}
captured["content"] = kwargs.get("content")
return httpx.Response(
200,
json={"ws_id": "00ff" + "0" * 28, "name": "ok"},
request=httpx.Request("POST", args[0] if args else "http://test"),
)
mock_proxy = MagicMock(spec=httpx.AsyncClient)
mock_proxy.post = MagicMock(side_effect=_mock_post)
app.state.proxy_client = mock_proxy
client = TestClient(app, raise_server_exceptions=False)
try:
ws_id = "00ff" + "0" * 28
boundary = "WebKitFormBoundary7MA4YWxkTrZu0gW" # mixed-case
body = (
f"--{boundary}\r\n"
f'Content-Disposition: form-data; name="meta"\r\n\r\n'
f'{{"name":"demo"}}\r\n'
f"--{boundary}\r\n"
f'Content-Disposition: form-data; name="file"; filename="a.txt"\r\n'
f"Content-Type: text/plain\r\n\r\n"
f"hello\r\n"
f"--{boundary}--\r\n"
).encode()
resp = client.post(
f"/v1/api/route/workstreams/new?ws_id={ws_id}",
content=body,
headers={
**_AUTH,
"Content-Type": f"multipart/form-data; boundary={boundary}",
},
)
assert resp.status_code == 200, resp.text
forwarded = captured["headers"].get("Content-Type", "")
assert boundary in forwarded, (
f"boundary mangled in upstream Content-Type: {forwarded!r}"
)
# Body bytes still contain the mixed-case boundary
assert boundary.encode() in bytes(captured["content"])
finally:
client.close()
def test_json_path_unchanged(self):
"""Existing JSON callers should continue to work as before."""
router = _make_router()
app = _make_app(router=router)
async def _mock_post(*args: Any, **kwargs: Any) -> httpx.Response:
return httpx.Response(
200,
json={"ws_id": "abc123", "name": "json"},
request=httpx.Request("POST", args[0] if args else "http://test"),
)
mock_proxy = MagicMock(spec=httpx.AsyncClient)
mock_proxy.post = MagicMock(side_effect=_mock_post)
app.state.proxy_client = mock_proxy
client = TestClient(app, raise_server_exceptions=False)
try:
resp = client.post(
"/v1/api/route/workstreams/new",
json={"name": "json"},
headers=_AUTH,
)
assert resp.status_code == 200
assert resp.json()["ws_id"] == "abc123"
# JSON path uses json= kwarg, not content=
call_kwargs = mock_proxy.post.call_args.kwargs
assert "json" in call_kwargs
assert "content" not in call_kwargs
finally:
client.close()
# ---------------------------------------------------------------------------
# route_attachment_proxy
# ---------------------------------------------------------------------------
class TestRouteAttachmentProxy:
def _wire(self, mock_request_fn) -> tuple[Any, MagicMock]:
router = _make_router()
app = _make_app(router=router)
mock_proxy = MagicMock(spec=httpx.AsyncClient)
mock_proxy.request = MagicMock(side_effect=mock_request_fn)
mock_proxy.get = MagicMock(side_effect=mock_request_fn)
mock_proxy.post = MagicMock(side_effect=mock_request_fn)
app.state.proxy_client = mock_proxy
return app, mock_proxy
def test_upload_proxies_multipart(self):
captured: dict[str, Any] = {}
async def _mock(*args: Any, **kwargs: Any) -> httpx.Response:
captured["method"] = args[0] if args else kwargs.get("method")
captured["url"] = args[1] if len(args) > 1 else kwargs.get("url", "")
captured["headers"] = kwargs.get("headers") or {}
captured["content"] = kwargs.get("content")
return httpx.Response(
200,
json={
"attachment_id": "att-1",
"filename": "a.txt",
"mime_type": "text/plain",
"size_bytes": 5,
"kind": "text",
},
request=httpx.Request("POST", "http://a:8080/x"),
)
app, _ = self._wire(_mock)
client = TestClient(app, raise_server_exceptions=False)
try:
resp = client.post(
"/v1/api/route/workstreams/ws-X/attachments",
files=[("file", ("a.txt", b"hello", "text/plain"))],
headers=_AUTH,
)
assert resp.status_code == 200
assert resp.json()["attachment_id"] == "att-1"
assert "/v1/api/workstreams/ws-X/attachments" in captured["url"]
assert "/route/" not in captured["url"]
assert captured["headers"].get("Content-Type", "").startswith("multipart/form-data")
finally:
client.close()
def test_list_proxies_get(self):
async def _mock(*args: Any, **kwargs: Any) -> httpx.Response:
return httpx.Response(
200,
json={"attachments": []},
request=httpx.Request("GET", "http://a:8080/x"),
)
app, mock_proxy = self._wire(_mock)
client = TestClient(app, raise_server_exceptions=False)
try:
resp = client.get(
"/v1/api/route/workstreams/ws-X/attachments",
headers=_AUTH,
)
assert resp.status_code == 200
assert resp.json() == {"attachments": []}
mock_proxy.get.assert_called()
finally:
client.close()
def test_get_content_preserves_upstream_headers(self):
async def _mock(*args: Any, **kwargs: Any) -> httpx.Response:
return httpx.Response(
200,
content=b"hello world",
headers={
"Content-Type": "text/plain; charset=utf-8",
"Content-Disposition": 'inline; filename="notes.md"',
"X-Content-Type-Options": "nosniff",
},
request=httpx.Request("GET", "http://a:8080/x"),
)
app, _ = self._wire(_mock)
client = TestClient(app, raise_server_exceptions=False)
try:
resp = client.get(
"/v1/api/route/workstreams/ws-X/attachments/att-1/content",
headers=_AUTH,
)
assert resp.status_code == 200
assert resp.content == b"hello world"
assert resp.headers.get("X-Content-Type-Options") == "nosniff"
assert "filename" in resp.headers.get("Content-Disposition", "")
finally:
client.close()
def test_delete_proxies_method(self):
captured: dict[str, Any] = {}
async def _mock(*args: Any, **kwargs: Any) -> httpx.Response:
captured["method"] = args[0] if args else ""
captured["url"] = args[1] if len(args) > 1 else ""
return httpx.Response(
200,
json={"status": "deleted"},
request=httpx.Request("DELETE", "http://a:8080/x"),
)
app, _ = self._wire(_mock)
client = TestClient(app, raise_server_exceptions=False)
try:
resp = client.delete(
"/v1/api/route/workstreams/ws-X/attachments/att-1",
headers=_AUTH,
)
assert resp.status_code == 200
assert resp.json() == {"status": "deleted"}
assert captured["method"] == "DELETE"
finally:
client.close()
# ---------------------------------------------------------------------------
# Routing-failure paths
# ---------------------------------------------------------------------------
class TestRoutingFailures:
def test_router_not_ready_returns_503(self):
router = MagicMock(spec=ConsoleRouter)
router.is_ready.return_value = False
router.refresh_cache.return_value = None
app = _make_app(router=router)
app.state.proxy_client = MagicMock(spec=httpx.AsyncClient)
client = TestClient(app, raise_server_exceptions=False)
try:
resp = client.get(
"/v1/api/route/workstreams/ws-X/attachments",
headers=_AUTH,
)
assert resp.status_code == 503
finally:
client.close()
+409
View File
@@ -188,6 +188,59 @@ class TestModelRegistry:
reg = self._make_registry(agent_model="cheap")
assert reg.agent_model == "cheap"
def test_plan_task_models_default_none(self) -> None:
reg = self._make_registry()
assert reg.plan_model is None
assert reg.task_model is None
assert reg.plan_effort is None
assert reg.task_effort is None
def test_resolve_agent_alias_falls_back_to_agent_model(self) -> None:
reg = self._make_registry(agent_model="cheap")
assert reg.resolve_agent_alias("plan") == "cheap"
assert reg.resolve_agent_alias("task") == "cheap"
def test_resolve_agent_alias_per_kind_overrides(self) -> None:
models = {
"default": ModelConfig("default", "http://x/v1", "k", "m"),
"smart": ModelConfig("smart", "http://x/v1", "k", "m"),
"fast": ModelConfig("fast", "http://x/v1", "k", "m"),
"shared": ModelConfig("shared", "http://x/v1", "k", "m"),
}
reg = ModelRegistry(
models=models,
default="default",
agent_model="shared",
plan_model="smart",
task_model="fast",
)
assert reg.resolve_agent_alias("plan") == "smart"
assert reg.resolve_agent_alias("task") == "fast"
def test_resolve_agent_alias_returns_none_when_unconfigured(self) -> None:
reg = self._make_registry()
assert reg.resolve_agent_alias("plan") is None
assert reg.resolve_agent_alias("task") is None
def test_resolve_agent_effort_plan_back_compat_default(self) -> None:
reg = self._make_registry()
assert reg.resolve_agent_effort("plan") == ModelRegistry.PLAN_DEFAULT_EFFORT
assert reg.resolve_agent_effort("plan") == "high"
def test_resolve_agent_effort_plan_override(self) -> None:
models = {"a": ModelConfig("a", "x", "x", "x")}
reg = ModelRegistry(models=models, default="a", plan_effort="max")
assert reg.resolve_agent_effort("plan") == "max"
def test_resolve_agent_effort_task_returns_none_to_inherit(self) -> None:
reg = self._make_registry()
assert reg.resolve_agent_effort("task") is None
def test_resolve_agent_effort_task_override(self) -> None:
models = {"a": ModelConfig("a", "x", "x", "x")}
reg = ModelRegistry(models=models, default="a", task_effort="low")
assert reg.resolve_agent_effort("task") == "low"
class TestModelRegistryValidation:
def test_empty_models_raises(self) -> None:
@@ -209,6 +262,16 @@ class TestModelRegistryValidation:
with pytest.raises(ValueError, match="Agent model 'bad'"):
ModelRegistry(models=models, default="a", agent_model="bad")
def test_invalid_plan_model_raises(self) -> None:
models = {"a": ModelConfig("a", "x", "x", "x")}
with pytest.raises(ValueError, match="Plan model 'bad'"):
ModelRegistry(models=models, default="a", plan_model="bad")
def test_invalid_task_model_raises(self) -> None:
models = {"a": ModelConfig("a", "x", "x", "x")}
with pytest.raises(ValueError, match="Task model 'bad'"):
ModelRegistry(models=models, default="a", task_model="bad")
# ---------------------------------------------------------------------------
# load_model_registry
@@ -297,6 +360,69 @@ class TestLoadModelRegistry:
reg = load_model_registry("http://x/v1", "x", "x")
assert reg.agent_model is None
def test_plan_task_models_from_config(self) -> None:
fake_cfg: dict[str, Any] = {
"models": {
"smart": {"base_url": "http://s/v1", "model": "s"},
"fast": {"base_url": "http://f/v1", "model": "f"},
},
"model": {
"plan_model": "smart",
"task_model": "fast",
"plan_effort": "max",
"task_effort": "low",
},
}
with patch("turnstone.core.model_registry.load_config", return_value=fake_cfg):
reg = load_model_registry("http://x/v1", "x", "x")
assert reg.plan_model == "smart"
assert reg.task_model == "fast"
assert reg.plan_effort == "max"
assert reg.task_effort == "low"
def test_invalid_plan_task_models_ignored(self) -> None:
fake_cfg: dict[str, Any] = {
"model": {"plan_model": "nope", "task_model": "alsonope"},
}
with patch("turnstone.core.model_registry.load_config", return_value=fake_cfg):
reg = load_model_registry("http://x/v1", "x", "x")
assert reg.plan_model is None
assert reg.task_model is None
def test_invalid_effort_values_dropped_with_warning(self) -> None:
"""Typos in plan_effort/task_effort shouldn't silently flow to providers."""
fake_cfg: dict[str, Any] = {
"model": {"plan_effort": "hihg", "task_effort": "extreme"},
}
with patch("turnstone.core.model_registry.load_config", return_value=fake_cfg):
reg = load_model_registry("http://x/v1", "x", "x")
assert reg.plan_effort is None
assert reg.task_effort is None
def test_valid_effort_values_accepted(self) -> None:
for level in ("none", "minimal", "low", "medium", "high", "xhigh", "max"):
fake_cfg: dict[str, Any] = {"model": {"plan_effort": level}}
with patch("turnstone.core.model_registry.load_config", return_value=fake_cfg):
reg = load_model_registry("http://x/v1", "x", "x")
assert reg.plan_effort == level, f"level={level} not accepted"
def test_empty_or_whitespace_effort_treated_as_unset(self) -> None:
"""Operators write `plan_effort = ""` to make "unset" explicit;
warning on benign empty values would be noise."""
for value in ("", " ", "\t"):
fake_cfg: dict[str, Any] = {"model": {"plan_effort": value, "task_effort": value}}
with patch("turnstone.core.model_registry.load_config", return_value=fake_cfg):
reg = load_model_registry("http://x/v1", "x", "x")
assert reg.plan_effort is None, f"empty value {value!r} not treated as unset"
assert reg.task_effort is None
def test_effort_normalised_to_lowercase(self) -> None:
fake_cfg: dict[str, Any] = {"model": {"plan_effort": "HIGH", "task_effort": " Low "}}
with patch("turnstone.core.model_registry.load_config", return_value=fake_cfg):
reg = load_model_registry("http://x/v1", "x", "x")
assert reg.plan_effort == "high"
assert reg.task_effort == "low"
def test_invalid_default_falls_back(self) -> None:
fake_cfg: dict[str, Any] = {
"model": {"default": "nonexistent"},
@@ -711,6 +837,7 @@ class _FakeUI:
def _make_session(
registry: ModelRegistry | None = None,
model_alias: str | None = None,
reasoning_effort: str = "medium",
) -> Any:
"""Create a ChatSession with a mock client and optional registry."""
from turnstone.core.session import ChatSession
@@ -726,6 +853,7 @@ def _make_session(
tool_timeout=30,
registry=registry,
model_alias=model_alias,
reasoning_effort=reasoning_effort,
)
@@ -914,6 +1042,163 @@ class TestSessionAgentModel:
session._run_agent(agent_msgs)
assert captured_model == "agent-model"
@staticmethod
def _capture_on(client: Any) -> dict[str, Any]:
"""Patch *client* (registry-resolved or session.client) to capture kwargs."""
captured: dict[str, Any] = {}
mock_response = MagicMock()
mock_response.choices = [MagicMock()]
mock_response.choices[0].message.content = "done"
mock_response.choices[0].message.tool_calls = None
mock_response.choices[0].finish_reason = "stop"
def fake_create(**kwargs: Any) -> Any:
captured.update(kwargs)
return mock_response
client.chat.completions.create = fake_create
return captured
def _capture(self, reg: ModelRegistry, alias: str) -> dict[str, Any]:
return self._capture_on(reg.get_client(alias))
@staticmethod
def _captured_effort(captured: dict[str, Any]) -> str | None:
"""Pull reasoning_effort out of provider-specific shapes.
openai-compatible servers receive it via extra_body.chat_template_kwargs;
commercial providers receive it as a top-level kwarg.
"""
eb = captured.get("extra_body") or {}
ctk = eb.get("chat_template_kwargs") or {}
return ctk.get("reasoning_effort") or captured.get("reasoning_effort")
def _three_model_registry(self, **kwargs: Any) -> ModelRegistry:
return ModelRegistry(
models={
"main": ModelConfig(
"main", "http://m/v1", "k", "main-model", provider="openai-compatible"
),
"smart": ModelConfig(
"smart", "http://s/v1", "k", "smart-model", provider="openai-compatible"
),
"fast": ModelConfig(
"fast", "http://f/v1", "k", "fast-model", provider="openai-compatible"
),
},
default="main",
**kwargs,
)
def test_plan_model_overrides_agent_model(self) -> None:
reg = self._three_model_registry(agent_model="fast", plan_model="smart")
session = _make_session(registry=reg, model_alias="main")
captured = self._capture(reg, "smart")
session._run_agent([{"role": "user", "content": "x"}], label="plan")
assert captured["model"] == "smart-model"
def test_task_model_overrides_agent_model(self) -> None:
reg = self._three_model_registry(agent_model="smart", task_model="fast")
session = _make_session(registry=reg, model_alias="main")
captured = self._capture(reg, "fast")
session._run_agent([{"role": "user", "content": "x"}], label="task")
assert captured["model"] == "fast-model"
def test_plan_falls_back_to_agent_model(self) -> None:
reg = self._three_model_registry(agent_model="fast")
session = _make_session(registry=reg, model_alias="main")
captured = self._capture(reg, "fast")
session._run_agent([{"role": "user", "content": "x"}], label="plan")
assert captured["model"] == "fast-model"
def test_plan_uses_session_model_when_no_overrides(self) -> None:
# No agent_model/plan_model configured — _run_agent falls through to
# session.client (the test's MagicMock) and session.model ("test-model").
reg = self._three_model_registry()
session = _make_session(registry=reg, model_alias="main")
captured = self._capture_on(session.client)
session._run_agent([{"role": "user", "content": "x"}], label="plan")
assert captured["model"] == "test-model"
def test_plan_default_reasoning_effort_is_high(self) -> None:
"""Back-compat: plan_agent always got "high" before; the default must
survive the migration even when no plan_effort is configured."""
reg = self._three_model_registry()
session = _make_session(registry=reg, model_alias="main")
captured = self._capture_on(session.client)
session._run_agent([{"role": "user", "content": "x"}], label="plan")
assert self._captured_effort(captured) == "high"
def test_plan_effort_from_registry_overrides_default(self) -> None:
reg = self._three_model_registry(plan_effort="max")
session = _make_session(registry=reg, model_alias="main")
captured = self._capture_on(session.client)
session._run_agent([{"role": "user", "content": "x"}], label="plan")
assert self._captured_effort(captured) == "max"
def test_task_effort_inherits_session_when_unset(self) -> None:
# Task with no task_effort override must inherit whatever the SESSION
# is configured for — assert against an explicit value rather than
# the constructor default so the invariant is unambiguous if someone
# changes ChatSession's default later.
reg = self._three_model_registry()
session = _make_session(registry=reg, model_alias="main", reasoning_effort="low")
captured = self._capture_on(session.client)
session._run_agent([{"role": "user", "content": "x"}], label="task")
assert self._captured_effort(captured) == "low"
def test_agent_model_routes_both_plan_and_task(self) -> None:
"""Back-compat invariant via _run_agent: with only the legacy
agent_model knob set, both plan and task labels must route through it."""
reg = self._three_model_registry(agent_model="fast")
session = _make_session(registry=reg, model_alias="main")
plan_captured = self._capture(reg, "fast")
session._run_agent([{"role": "user", "content": "x"}], label="plan")
assert plan_captured["model"] == "fast-model"
task_captured = self._capture(reg, "fast")
session._run_agent([{"role": "user", "content": "y"}], label="task")
assert task_captured["model"] == "fast-model"
def test_explicit_effort_wins_over_registry(self) -> None:
reg = self._three_model_registry(plan_effort="low")
session = _make_session(registry=reg, model_alias="main")
captured = self._capture_on(session.client)
session._run_agent(
[{"role": "user", "content": "x"}], label="plan", reasoning_effort="minimal"
)
assert self._captured_effort(captured) == "minimal"
# -- per-call agent_alias override (LLM passes model="<alias>") ----------
def test_run_agent_uses_explicit_alias_override(self) -> None:
"""agent_alias kwarg routes the agent call to the chosen client/model."""
reg = self._three_model_registry()
session = _make_session(registry=reg, model_alias="main")
captured = self._capture(reg, "fast")
session._run_agent([{"role": "user", "content": "x"}], label="task", agent_alias="fast")
assert captured["model"] == "fast-model"
def test_explicit_alias_overrides_registry_plan_model(self) -> None:
"""Per-call alias wins over the configured per-kind plan_model."""
reg = self._three_model_registry(plan_model="smart")
session = _make_session(registry=reg, model_alias="main")
# Without override the call would route to "smart"; we ask for "fast".
captured = self._capture(reg, "fast")
session._run_agent([{"role": "user", "content": "x"}], label="plan", agent_alias="fast")
assert captured["model"] == "fast-model"
def test_invalid_alias_raises_in_run_agent(self) -> None:
"""Defence-in-depth: _prepare_* validates first, but _run_agent
rejects unknown aliases too rather than silently falling back."""
reg = self._three_model_registry()
session = _make_session(registry=reg, model_alias="main")
with pytest.raises(ValueError, match="Unknown agent_alias"):
session._run_agent(
[{"role": "user", "content": "x"}], label="plan", agent_alias="bogus"
)
# ---------------------------------------------------------------------------
# Workstream integration
@@ -1178,3 +1463,127 @@ class TestLoadModelRegistryDBOnly:
with patch("turnstone.core.model_registry.load_config", return_value={}):
reg = load_model_registry(model="", storage=storage)
assert not reg.has_alias("default")
# ---------------------------------------------------------------------------
# server._effective_routing / _apply_routing_overrides
# ---------------------------------------------------------------------------
class _FakeCS:
"""Minimal ConfigStore stand-in: dict-backed get()."""
def __init__(self, **values: str) -> None:
self._values = values
def get(self, key: str, default: Any = None) -> Any:
return self._values.get(key, default if default is not None else "")
class TestEffectiveRouting:
"""Pure-function helper that overlays ConfigStore values on a base."""
def _models(self) -> dict[str, ModelConfig]:
return {
"default": ModelConfig("default", "x", "x", "m"),
"smart": ModelConfig("smart", "x", "x", "m"),
"fast": ModelConfig("fast", "x", "x", "m"),
}
def test_returns_base_when_cs_is_none(self) -> None:
from turnstone.server import _effective_routing
result = _effective_routing(None, self._models(), "default", "smart", "fast", "high", "low")
assert result == ("default", "smart", "fast", "high", "low")
def test_cs_alias_overrides_base(self) -> None:
from turnstone.server import _effective_routing
cs = _FakeCS(**{"model.plan_alias": "fast", "model.task_alias": "smart"})
result = _effective_routing(cs, self._models(), "default", "smart", "fast", "high", "low")
assert result == ("default", "fast", "smart", "high", "low")
def test_cs_alias_silently_dropped_when_unknown(self) -> None:
from turnstone.server import _effective_routing
cs = _FakeCS(**{"model.plan_alias": "nonexistent"})
result = _effective_routing(cs, self._models(), "default", "smart", None, None, None)
assert result == ("default", "smart", None, None, None) # falls back to base
def test_cs_empty_string_treated_as_unset(self) -> None:
from turnstone.server import _effective_routing
cs = _FakeCS(
**{
"model.default_alias": "",
"model.plan_alias": "",
"model.task_alias": "",
"model.plan_effort": "",
"model.task_effort": "",
}
)
result = _effective_routing(cs, self._models(), "default", "smart", "fast", "high", "low")
assert result == ("default", "smart", "fast", "high", "low")
def test_cs_effort_overrides_base(self) -> None:
from turnstone.server import _effective_routing
cs = _FakeCS(**{"model.plan_effort": "max", "model.task_effort": "minimal"})
result = _effective_routing(cs, self._models(), "default", None, None, "high", None)
assert result == ("default", None, None, "max", "minimal")
class TestApplyRoutingOverrides:
"""Decides whether to call registry.reload based on effective vs current."""
def _registry(self, **kwargs: Any) -> ModelRegistry:
return ModelRegistry(
models={
"default": ModelConfig("default", "x", "x", "m"),
"smart": ModelConfig("smart", "x", "x", "m"),
"fast": ModelConfig("fast", "x", "x", "m"),
},
default="default",
**kwargs,
)
def test_no_reload_when_cs_matches_registry(self) -> None:
from turnstone.server import _apply_routing_overrides
reg = self._registry(plan_model="smart", task_model="fast")
cs = _FakeCS(**{"model.plan_alias": "smart", "model.task_alias": "fast"})
# Patch reload to detect calls
called = {"count": 0}
original_reload = reg.reload
reg.reload = lambda *a, **kw: (
called.update(count=called["count"] + 1)
or original_reload( # type: ignore[method-assign]
*a, **kw
)
)
assert _apply_routing_overrides(reg, cs) is False
assert called["count"] == 0
def test_reload_when_cs_differs(self) -> None:
from turnstone.server import _apply_routing_overrides
reg = self._registry() # plan_model=None
cs = _FakeCS(**{"model.plan_alias": "smart"})
assert _apply_routing_overrides(reg, cs) is True
assert reg.plan_model == "smart"
def test_no_reload_when_cs_is_none(self) -> None:
from turnstone.server import _apply_routing_overrides
reg = self._registry()
assert _apply_routing_overrides(reg, None) is False
def test_unknown_alias_does_not_trigger_reload(self) -> None:
"""Invalid CS aliases are silently dropped — no spurious reload."""
from turnstone.server import _apply_routing_overrides
reg = self._registry()
cs = _FakeCS(**{"model.plan_alias": "nonexistent"})
assert _apply_routing_overrides(reg, cs) is False
assert reg.plan_model is None # unchanged
+134
View File
@@ -1246,6 +1246,31 @@ class TestAnthropicHelpers:
assert caps.token_param == "max_tokens"
assert caps.thinking_mode == "adaptive"
def test_capabilities_opus_4_7(self) -> None:
from turnstone.core.providers._anthropic import AnthropicProvider
provider = AnthropicProvider()
caps = provider.get_capabilities("claude-opus-4-7")
assert caps.context_window == 1000000
assert caps.max_output_tokens == 128000
assert caps.thinking_mode == "adaptive"
assert caps.supports_effort is True
assert "xhigh" in caps.effort_levels
assert caps.supports_temperature is False
assert caps.thinking_display == "summarized"
assert caps.supports_web_search is True
assert caps.supports_tool_search is True
assert caps.supports_vision is True
def test_capabilities_opus_4_7_dated(self) -> None:
from turnstone.core.providers._anthropic import AnthropicProvider
provider = AnthropicProvider()
caps = provider.get_capabilities("claude-opus-4-7-20260416")
assert caps.context_window == 1000000
assert caps.supports_temperature is False
assert caps.thinking_display == "summarized"
def test_capabilities_lookup_unknown(self) -> None:
from turnstone.core.providers._anthropic import AnthropicProvider
@@ -1956,6 +1981,18 @@ class TestAnthropicReasoningNone:
assert "thinking" in result
assert result["thinking"]["budget_tokens"] == 1024
def test_map_xhigh_effort(self) -> None:
from turnstone.core.providers._anthropic import _map_reasoning_to_effort
result = _map_reasoning_to_effort("xhigh", ("low", "medium", "high", "xhigh", "max"))
assert result == "xhigh"
def test_map_xhigh_rejected_by_model_without_it(self) -> None:
from turnstone.core.providers._anthropic import _map_reasoning_to_effort
result = _map_reasoning_to_effort("xhigh", ("low", "medium", "high", "max"))
assert result is None
# ===========================================================================
# TestWebSearch — provider-native web search
@@ -3114,6 +3151,103 @@ class TestAnthropicPromptCaching:
assert "cache_control" in kwargs
assert kwargs["cache_control"] == {"type": "ephemeral"}
def test_opus_4_7_no_temperature_in_kwargs(self) -> None:
"""Opus 4.7 rejects temperature — must not appear in kwargs."""
caps = self.provider.get_capabilities("claude-opus-4-7")
kwargs = self.provider._build_thinking_and_kwargs(
caps=caps,
reasoning_effort="high",
extra_params=None,
max_tokens=8192,
temperature=0.5,
converted_msgs=[{"role": "user", "content": "hi"}],
system_prompt="",
model="claude-opus-4-7",
tools=None,
)
assert "temperature" not in kwargs
def test_opus_4_6_still_has_temperature(self) -> None:
"""Opus 4.6 must still send temperature (regression guard)."""
caps = self.provider.get_capabilities("claude-opus-4-6")
kwargs = self.provider._build_thinking_and_kwargs(
caps=caps,
reasoning_effort="high",
extra_params=None,
max_tokens=8192,
temperature=0.5,
converted_msgs=[{"role": "user", "content": "hi"}],
system_prompt="",
model="claude-opus-4-6",
tools=None,
)
assert "temperature" in kwargs
assert kwargs["temperature"] == 1.0 # forced for adaptive thinking
def test_opus_4_7_thinking_display_summarized(self) -> None:
"""Opus 4.7 must opt in to thinking display with 'summarized'."""
caps = self.provider.get_capabilities("claude-opus-4-7")
kwargs = self.provider._build_thinking_and_kwargs(
caps=caps,
reasoning_effort="high",
extra_params=None,
max_tokens=8192,
temperature=0.5,
converted_msgs=[{"role": "user", "content": "hi"}],
system_prompt="",
model="claude-opus-4-7",
tools=None,
)
assert kwargs["thinking"] == {"type": "adaptive", "display": "summarized"}
def test_opus_4_6_thinking_no_display(self) -> None:
"""Opus 4.6 adaptive thinking should not include display key."""
caps = self.provider.get_capabilities("claude-opus-4-6")
kwargs = self.provider._build_thinking_and_kwargs(
caps=caps,
reasoning_effort="high",
extra_params=None,
max_tokens=8192,
temperature=0.5,
converted_msgs=[{"role": "user", "content": "hi"}],
system_prompt="",
model="claude-opus-4-6",
tools=None,
)
assert kwargs["thinking"] == {"type": "adaptive"}
def test_opus_4_7_xhigh_effort(self) -> None:
"""Opus 4.7 xhigh effort passes through to output_config."""
caps = self.provider.get_capabilities("claude-opus-4-7")
kwargs = self.provider._build_thinking_and_kwargs(
caps=caps,
reasoning_effort="xhigh",
extra_params=None,
max_tokens=8192,
temperature=0.5,
converted_msgs=[{"role": "user", "content": "hi"}],
system_prompt="",
model="claude-opus-4-7",
tools=None,
)
assert kwargs["output_config"] == {"effort": "xhigh"}
def test_xhigh_effort_not_applied_to_opus_4_6(self) -> None:
"""xhigh is not a valid effort level for Opus 4.6 — should be ignored."""
caps = self.provider.get_capabilities("claude-opus-4-6")
kwargs = self.provider._build_thinking_and_kwargs(
caps=caps,
reasoning_effort="xhigh",
extra_params=None,
max_tokens=8192,
temperature=0.5,
converted_msgs=[{"role": "user", "content": "hi"}],
system_prompt="",
model="claude-opus-4-6",
tools=None,
)
assert "output_config" not in kwargs
@patch("turnstone.core.providers._anthropic._ensure_anthropic")
def test_streaming_message_start_cache_metrics(self, mock_ensure: MagicMock) -> None:
"""Cache metrics from message_start flow into UsageInfo."""
+21
View File
@@ -467,6 +467,27 @@ async def test_route_create_workstream():
assert captured_body["user_id"] == "u1"
@pytest.mark.anyio
async def test_route_create_workstream_rejects_attachments_with_target_node():
"""Regression: target_node has no effect on multipart route_create
(which routes by ?ws_id=) refuse the combination at the SDK boundary
instead of silently routing to the wrong node.
"""
from turnstone.sdk._types import AttachmentUpload
transport = httpx.MockTransport(
lambda req: _json_response({"error": "should not be called"}, status=500)
)
async with httpx.AsyncClient(transport=transport, base_url="http://test") as hc:
client = AsyncTurnstoneConsole(httpx_client=hc)
with pytest.raises(ValueError, match="target_node"):
await client.route_create_workstream(
name="x",
target_node="n1",
attachments=[AttachmentUpload(filename="a.txt", data=b"hi")],
)
@pytest.mark.anyio
async def test_route_create_workstream_omits_defaults():
captured_body: dict = {}
+7
View File
@@ -17,6 +17,7 @@ from turnstone.sdk.events import (
InfoEvent,
NodeJoinedEvent,
NodeLostEvent,
PlanResolvedEvent,
PlanReviewEvent,
ReasoningEvent,
ServerEvent,
@@ -143,6 +144,12 @@ def test_plan_review_event():
assert "Plan" in e.content
def test_plan_resolved_event():
e = ServerEvent.from_dict({"type": "plan_resolved", "feedback": "approved"})
assert isinstance(e, PlanResolvedEvent)
assert e.feedback == "approved"
def test_info_event():
e = ServerEvent.from_dict({"type": "info", "message": "[compacted]"})
assert isinstance(e, InfoEvent)
+229
View File
@@ -0,0 +1,229 @@
"""Tests for the attachment surface of turnstone.sdk.server (async + sync).
Uses ``httpx.MockTransport`` to record what the SDK sends so we can
assert on multipart bodies, the auto-generated ws_id, etc.
"""
from __future__ import annotations
import json
import re
import httpx
import pytest
from turnstone.sdk._types import AttachmentUpload
from turnstone.sdk.server import AsyncTurnstoneServer
PNG_1x1 = (
b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01"
b"\x08\x06\x00\x00\x00\x1f\x15\xc4\x89\x00\x00\x00\rIDATx\x9cc\xfc\xcf"
b"\xc0\xc0\xc0\x00\x00\x00\x05\x00\x01\xa5\xf6E@\x00\x00\x00\x00IEND\xaeB`\x82"
)
def _capturing_transport(response: httpx.Response) -> tuple[httpx.MockTransport, list]:
captured: list[httpx.Request] = []
def handler(request: httpx.Request) -> httpx.Response:
captured.append(request)
return response
return httpx.MockTransport(handler), captured
# ---------------------------------------------------------------------------
# upload / list / get_content / delete
# ---------------------------------------------------------------------------
@pytest.mark.anyio
async def test_upload_attachment_sends_multipart():
response = httpx.Response(
200,
json={
"attachment_id": "att-1",
"filename": "tiny.png",
"mime_type": "image/png",
"size_bytes": len(PNG_1x1),
"kind": "image",
},
)
transport, captured = _capturing_transport(response)
async with httpx.AsyncClient(transport=transport, base_url="http://t") as hc:
client = AsyncTurnstoneServer(httpx_client=hc)
result = await client.upload_attachment("ws-X", "tiny.png", PNG_1x1, mime_type="image/png")
assert result.attachment_id == "att-1"
assert result.kind == "image"
assert len(captured) == 1
req = captured[0]
assert req.method == "POST"
assert req.url.path == "/v1/api/workstreams/ws-X/attachments"
ct = req.headers.get("content-type", "")
assert ct.startswith("multipart/form-data")
body = bytes(req.content)
assert b"tiny.png" in body
assert PNG_1x1 in body
@pytest.mark.anyio
async def test_list_attachments_returns_pending():
response = httpx.Response(
200,
json={
"attachments": [
{
"attachment_id": "att-1",
"filename": "a.txt",
"mime_type": "text/plain",
"size_bytes": 5,
"kind": "text",
}
]
},
)
transport, captured = _capturing_transport(response)
async with httpx.AsyncClient(transport=transport, base_url="http://t") as hc:
client = AsyncTurnstoneServer(httpx_client=hc)
result = await client.list_attachments("ws-X")
assert len(result.attachments) == 1
assert result.attachments[0].attachment_id == "att-1"
assert captured[0].method == "GET"
@pytest.mark.anyio
async def test_get_attachment_content_returns_bytes():
response = httpx.Response(
200,
content=b"hello world",
headers={"Content-Type": "text/plain; charset=utf-8"},
)
transport, captured = _capturing_transport(response)
async with httpx.AsyncClient(transport=transport, base_url="http://t") as hc:
client = AsyncTurnstoneServer(httpx_client=hc)
data = await client.get_attachment_content("ws-X", "att-1")
assert data == b"hello world"
assert captured[0].url.path == "/v1/api/workstreams/ws-X/attachments/att-1/content"
@pytest.mark.anyio
async def test_delete_attachment():
response = httpx.Response(200, json={"status": "deleted"})
transport, captured = _capturing_transport(response)
async with httpx.AsyncClient(transport=transport, base_url="http://t") as hc:
client = AsyncTurnstoneServer(httpx_client=hc)
result = await client.delete_attachment("ws-X", "att-1")
assert result.status == "deleted"
assert captured[0].method == "DELETE"
# ---------------------------------------------------------------------------
# send(attachment_ids=...)
# ---------------------------------------------------------------------------
@pytest.mark.anyio
async def test_send_with_attachment_ids():
response = httpx.Response(200, json={"status": "ok"})
transport, captured = _capturing_transport(response)
async with httpx.AsyncClient(transport=transport, base_url="http://t") as hc:
client = AsyncTurnstoneServer(httpx_client=hc)
await client.send("hi", "ws-X", attachment_ids=["a1", "a2"])
body = json.loads(bytes(captured[0].content))
assert body["attachment_ids"] == ["a1", "a2"]
assert body["message"] == "hi"
@pytest.mark.anyio
async def test_send_omits_attachment_ids_when_none():
response = httpx.Response(200, json={"status": "ok"})
transport, captured = _capturing_transport(response)
async with httpx.AsyncClient(transport=transport, base_url="http://t") as hc:
client = AsyncTurnstoneServer(httpx_client=hc)
await client.send("hi", "ws-X")
body = json.loads(bytes(captured[0].content))
assert "attachment_ids" not in body
# ---------------------------------------------------------------------------
# create_workstream(attachments=...)
# ---------------------------------------------------------------------------
@pytest.mark.anyio
async def test_create_workstream_with_attachments_sends_multipart():
response = httpx.Response(
200,
json={
"ws_id": "00ff" + "0" * 28,
"name": "demo",
"resumed": False,
"message_count": 0,
"attachment_ids": ["att-1"],
},
)
transport, captured = _capturing_transport(response)
async with httpx.AsyncClient(transport=transport, base_url="http://t") as hc:
client = AsyncTurnstoneServer(httpx_client=hc)
resp = await client.create_workstream(
name="demo",
initial_message="describe",
attachments=[AttachmentUpload(filename="hi.png", data=PNG_1x1, mime_type="image/png")],
)
assert resp.ws_id
assert resp.attachment_ids == ["att-1"]
req = captured[0]
assert req.method == "POST"
assert req.url.path == "/v1/api/workstreams/new"
ct = req.headers.get("content-type", "")
assert ct.startswith("multipart/form-data")
body = bytes(req.content)
# `meta` field carries the JSON metadata including the auto-generated ws_id
meta_match = re.search(rb'name="meta"\r\n\r\n(\{[^}]*\})', body)
assert meta_match, body
meta = json.loads(meta_match.group(1))
assert meta["name"] == "demo"
assert meta["initial_message"] == "describe"
assert re.fullmatch(r"[0-9a-f]{32}", meta["ws_id"])
# PNG bytes appear in the body as a file part
assert PNG_1x1 in body
@pytest.mark.anyio
async def test_create_workstream_caller_supplied_ws_id_used():
response = httpx.Response(
200,
json={
"ws_id": "deadbeef" * 4,
"name": "demo",
"resumed": False,
"message_count": 0,
"attachment_ids": [],
},
)
transport, captured = _capturing_transport(response)
async with httpx.AsyncClient(transport=transport, base_url="http://t") as hc:
client = AsyncTurnstoneServer(httpx_client=hc)
await client.create_workstream(
name="demo",
ws_id="deadbeef" * 4,
attachments=[AttachmentUpload(filename="a.txt", data=b"hi")],
)
body = bytes(captured[0].content)
meta_match = re.search(rb'name="meta"\r\n\r\n(\{[^}]*\})', body)
assert meta_match
meta = json.loads(meta_match.group(1))
assert meta["ws_id"] == "deadbeef" * 4
@pytest.mark.anyio
async def test_create_workstream_without_attachments_uses_json():
"""Back-compat: callers that don't pass attachments still get the JSON path."""
response = httpx.Response(200, json={"ws_id": "ws-json", "name": "j", "attachment_ids": []})
transport, captured = _capturing_transport(response)
async with httpx.AsyncClient(transport=transport, base_url="http://t") as hc:
client = AsyncTurnstoneServer(httpx_client=hc)
await client.create_workstream(name="j")
req = captured[0]
assert req.headers.get("content-type", "").startswith("application/json")
+425
View File
@@ -0,0 +1,425 @@
"""Tests for the multipart variant of POST /v1/api/workstreams/new.
Exercises:
- The pure helpers `_validate_and_save_uploaded_files` and
`_reserve_and_resolve_attachments` (added alongside the multipart path).
- The full create endpoint via TestClient with a FakeSession factory so
the initial-message dispatch thread runs end-to-end without an LLM.
"""
from __future__ import annotations
import json
import queue
import threading
import time
import pytest
from starlette.testclient import TestClient
# Magic-byte-valid 1x1 PNG (matches the fixture in test_server_attachments_endpoints.py)
PNG_1x1 = (
b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01"
b"\x08\x06\x00\x00\x00\x1f\x15\xc4\x89\x00\x00\x00\rIDATx\x9cc\xfc\xcf"
b"\xc0\xc0\xc0\x00\x00\x00\x05\x00\x01\xa5\xf6E@\x00\x00\x00\x00IEND\xaeB`\x82"
)
_TEST_JWT_SECRET = "test-jwt-secret-minimum-32-chars!"
def _make_jwt(user_id: str) -> str:
from turnstone.core.auth import JWT_AUD_SERVER, create_jwt
return create_jwt(
user_id=user_id,
scopes=frozenset({"read", "write"}),
source="test",
secret=_TEST_JWT_SECRET,
audience=JWT_AUD_SERVER,
)
def _auth(user: str) -> dict[str, str]:
return {"Authorization": f"Bearer {_make_jwt(user)}"}
# ---------------------------------------------------------------------------
# Pure helper tests
# ---------------------------------------------------------------------------
class TestValidateAndSaveUploadedFiles:
def test_saves_image_and_text(self, tmp_path):
from turnstone.core.memory import list_pending_attachments
from turnstone.core.storage import init_storage, reset_storage
from turnstone.server import _validate_and_save_uploaded_files
reset_storage()
init_storage("sqlite", path=str(tmp_path / "t.db"), run_migrations=False)
try:
files = [
("hi.png", "image/png", PNG_1x1),
("notes.md", "text/markdown", b"# Hello\n"),
]
ids, err = _validate_and_save_uploaded_files(files, "ws-X", "userA")
assert err is None
assert len(ids) == 2
pending = list_pending_attachments("ws-X", "userA")
assert len(pending) == 2
kinds = {p["kind"] for p in pending}
assert kinds == {"image", "text"}
finally:
reset_storage()
def test_rejects_oversized_image(self, tmp_path):
from turnstone.core.attachments import IMAGE_SIZE_CAP
from turnstone.core.storage import init_storage, reset_storage
from turnstone.server import _validate_and_save_uploaded_files
reset_storage()
init_storage("sqlite", path=str(tmp_path / "t.db"), run_migrations=False)
try:
# Magic-byte-valid PNG header padded past the cap.
oversized = PNG_1x1 + b"\x00" * (IMAGE_SIZE_CAP + 1)
files = [("big.png", "image/png", oversized)]
ids, err = _validate_and_save_uploaded_files(files, "ws-X", "userA")
assert err is not None
assert err.status_code == 413
assert ids == []
finally:
reset_storage()
def test_rejects_unsupported_text(self, tmp_path):
from turnstone.core.storage import init_storage, reset_storage
from turnstone.server import _validate_and_save_uploaded_files
reset_storage()
init_storage("sqlite", path=str(tmp_path / "t.db"), run_migrations=False)
try:
# No image magic, MIME isn't text/*, extension not allowlisted
files = [("evil.bin", "application/octet-stream", b"\x00\x01\x02")]
ids, err = _validate_and_save_uploaded_files(files, "ws-X", "userA")
assert err is not None
assert err.status_code == 400
assert ids == []
finally:
reset_storage()
def test_pending_cap_returns_409(self, tmp_path):
from turnstone.core.attachments import MAX_PENDING_ATTACHMENTS_PER_USER_WS
from turnstone.core.memory import save_attachment
from turnstone.core.storage import init_storage, reset_storage
from turnstone.server import _validate_and_save_uploaded_files
reset_storage()
init_storage("sqlite", path=str(tmp_path / "t.db"), run_migrations=False)
try:
# Saturate the pending cap
for i in range(MAX_PENDING_ATTACHMENTS_PER_USER_WS):
save_attachment(
f"pre-{i}", "ws-X", "userA", f"f{i}.txt", "text/plain", 1, "text", b"x"
)
files = [("notes.md", "text/markdown", b"hello")]
ids, err = _validate_and_save_uploaded_files(files, "ws-X", "userA")
assert err is not None
assert err.status_code == 409
assert ids == []
finally:
reset_storage()
class TestReserveAndResolveAttachments:
def test_reserves_and_returns_attachments(self, tmp_path):
from turnstone.core.attachments import Attachment
from turnstone.core.memory import save_attachment
from turnstone.core.storage import init_storage, reset_storage
from turnstone.server import _reserve_and_resolve_attachments
reset_storage()
init_storage("sqlite", path=str(tmp_path / "t.db"), run_migrations=False)
try:
save_attachment("a1", "ws-X", "userA", "a.txt", "text/plain", 5, "text", b"hello")
save_attachment("a2", "ws-X", "userA", "b.png", "image/png", 91, "image", PNG_1x1)
resolved, ordered, dropped = _reserve_and_resolve_attachments(
["a1", "a2"], "send-1", "ws-X", "userA"
)
assert ordered == ["a1", "a2"]
assert dropped == []
assert len(resolved) == 2
assert all(isinstance(a, Attachment) for a in resolved)
kinds = [a.kind for a in resolved]
assert kinds == ["text", "image"]
finally:
reset_storage()
def test_double_reserve_drops_second(self, tmp_path):
from turnstone.core.memory import save_attachment
from turnstone.core.storage import init_storage, reset_storage
from turnstone.server import _reserve_and_resolve_attachments
reset_storage()
init_storage("sqlite", path=str(tmp_path / "t.db"), run_migrations=False)
try:
save_attachment("a1", "ws-X", "userA", "a.txt", "text/plain", 5, "text", b"hello")
r1, ord1, _ = _reserve_and_resolve_attachments(["a1"], "send-A", "ws-X", "userA")
assert len(r1) == 1
r2, ord2, drop2 = _reserve_and_resolve_attachments(["a1"], "send-B", "ws-X", "userA")
assert r2 == []
assert ord2 == []
assert drop2 == ["a1"]
finally:
reset_storage()
# ---------------------------------------------------------------------------
# End-to-end create endpoint tests (multipart variant)
# ---------------------------------------------------------------------------
class _FakeSession:
"""Minimal stand-in: records send() invocations from the dispatch thread.
Knows its own ``ws_id`` and ``user_id`` so it can faithfully simulate the
real ChatSession's attachment-consume step against storage. Tests then
assert that pending attachments are gone after dispatch.
"""
def __init__(self, ws_id: str = "", user_id: str = ""):
self.ws_id = ws_id
self.user_id = user_id
self.model = "test-model"
self.model_alias = "test-model"
self.messages = []
self.sends: list[tuple[str, list, str | None]] = []
self._lock = threading.Lock()
self._cancel_event = threading.Event()
self.notify_targets = ""
self._notify_on_complete = "[]"
def send(self, text, attachments=None, send_id=None):
with self._lock:
self.sends.append((text, list(attachments or []), send_id))
# Simulate the real ChatSession's consume step against storage
# so callers can assert the lifecycle landed.
if attachments and send_id and self.ws_id and self.user_id:
import uuid as _uuid
from turnstone.core.memory import mark_attachments_consumed
ids = [a.attachment_id for a in attachments]
mark_attachments_consumed(
ids,
_uuid.uuid4().hex, # synthetic conversation message id
self.ws_id,
self.user_id,
reserved_for_msg_id=send_id,
)
# Methods the create handler may call but we don't care about
def set_watch_runner(self, *_a, **_kw):
pass
def queue_message(self, *_a, **_kw):
return ("", "normal", "msg-x")
def request_title_refresh(self, *_a, **_kw):
pass
def resume(self, *_a, **_kw):
return False
class _FakeUI:
def __init__(self, ws_id="", user_id=""):
self.ws_id = ws_id
self._user_id = user_id
self.auto_approve = False
self.auto_approve_tools: set[str] = set()
self.events: list[dict] = []
self._enqueued: list[dict] = []
def _enqueue(self, ev):
self._enqueued.append(ev)
def on_stream_end(self):
pass
def on_state_change(self, state):
self.events.append({"type": "state_change", "state": state})
def on_error(self, msg):
self.events.append({"type": "error", "message": msg})
@pytest.fixture
def app_client(tmp_path, monkeypatch):
"""End-to-end app with a fake session factory + WorkstreamManager."""
from turnstone.core.metrics import MetricsCollector
from turnstone.core.storage import init_storage, reset_storage
from turnstone.core.workstream import WorkstreamManager
from turnstone.server import create_app
reset_storage()
init_storage("sqlite", path=str(tmp_path / "t.db"), run_migrations=False)
metrics = MetricsCollector()
metrics.model = "test-model"
monkeypatch.setattr("turnstone.server._metrics", metrics)
# Replace WebUI with our fake so the create handler's isinstance check passes.
monkeypatch.setattr("turnstone.server.WebUI", _FakeUI)
fake_sessions: list[_FakeSession] = []
def _factory(ui, _model, ws_id, **_kw):
# The user_id rides on the WebUI factory closure; pull it off the
# ui instance so the FakeSession's consume step uses the right scope.
user_id = getattr(ui, "_user_id", "")
s = _FakeSession(ws_id=ws_id, user_id=user_id)
fake_sessions.append(s)
return s
mgr = WorkstreamManager(_factory, max_workstreams=10, node_id="node-test")
gq: queue.Queue[dict] = queue.Queue()
app = create_app(
workstreams=mgr,
global_queue=gq,
global_listeners=[],
global_listeners_lock=threading.Lock(),
skip_permissions=False,
jwt_secret=_TEST_JWT_SECRET,
)
client = TestClient(app, raise_server_exceptions=False)
try:
yield client, fake_sessions, gq
finally:
client.close()
reset_storage()
class TestCreateMultipart:
def test_create_with_image_and_initial_message(self, app_client):
from turnstone.core.memory import list_pending_attachments
client, sessions, _gq = app_client
meta = {"name": "demo", "initial_message": "describe this image"}
resp = client.post(
"/v1/api/workstreams/new",
data={"meta": json.dumps(meta)},
files=[("file", ("tiny.png", PNG_1x1, "image/png"))],
headers=_auth("userA"),
)
assert resp.status_code == 200, resp.text
data = resp.json()
ws_id = data["ws_id"]
assert ws_id
assert len(data["attachment_ids"]) == 1
# Wait briefly for the dispatch thread
deadline = time.time() + 2.0
while time.time() < deadline and not sessions:
time.sleep(0.02)
deadline = time.time() + 2.0
while time.time() < deadline and not sessions[0].sends:
time.sleep(0.02)
assert sessions
assert sessions[0].sends, "session.send was not invoked"
text, atts, send_id = sessions[0].sends[0]
assert text == "describe this image"
assert send_id # reservation token threaded through
assert len(atts) == 1
assert atts[0].kind == "image"
# Lifecycle: the FakeSession marks them consumed via storage —
# so the pending-list for this ws should be empty after dispatch.
assert list_pending_attachments(ws_id, "userA") == []
def test_create_with_attachments_no_initial_message_keeps_pending(self, app_client):
from turnstone.core.memory import list_pending_attachments
client, _, _gq = app_client
meta = {"name": "stash"}
resp = client.post(
"/v1/api/workstreams/new",
data={"meta": json.dumps(meta)},
files=[("file", ("notes.md", b"# hello\n", "text/markdown"))],
headers=_auth("userA"),
)
assert resp.status_code == 200, resp.text
data = resp.json()
ws_id = data["ws_id"]
pending = list_pending_attachments(ws_id, "userA")
assert len(pending) == 1
assert pending[0]["filename"] == "notes.md"
def test_create_rejects_oversized_image_and_rolls_back(self, app_client):
from turnstone.core.attachments import IMAGE_SIZE_CAP
client, _, gq = app_client
oversized = PNG_1x1 + b"\x00" * (IMAGE_SIZE_CAP + 1)
meta = {"name": "fails"}
resp = client.post(
"/v1/api/workstreams/new",
data={"meta": json.dumps(meta)},
files=[("file", ("big.png", oversized, "image/png"))],
headers=_auth("userA"),
)
assert resp.status_code == 413
# Regression: ws_created must NOT have been emitted for a request
# that's about to be rejected. Otherwise SSE consumers see a
# phantom workstream flash on dashboards.
events: list[dict] = []
while not gq.empty():
events.append(gq.get_nowait())
kinds = {e.get("type") for e in events}
assert "ws_created" not in kinds, f"phantom ws_created emitted for failed create: {events}"
def test_create_missing_meta_returns_400(self, app_client):
client, _, _gq = app_client
resp = client.post(
"/v1/api/workstreams/new",
files=[("file", ("notes.md", b"hello", "text/markdown"))],
headers=_auth("userA"),
)
assert resp.status_code == 400
def test_create_invalid_meta_json_returns_400(self, app_client):
client, _, _gq = app_client
resp = client.post(
"/v1/api/workstreams/new",
data={"meta": "{not json}"},
files=[],
headers=_auth("userA"),
)
assert resp.status_code == 400
def test_attachments_with_resume_ws_returns_400(self, app_client):
from turnstone.core.memory import register_workstream
client, _, _gq = app_client
register_workstream("ws-resume-target", name="resume target")
meta = {"name": "fork", "resume_ws": "ws-resume-target"}
resp = client.post(
"/v1/api/workstreams/new",
data={"meta": json.dumps(meta)},
files=[("file", ("notes.md", b"hello", "text/markdown"))],
headers=_auth("userA"),
)
assert resp.status_code == 400
class TestCreateJsonStillWorks:
"""The JSON path must remain byte-for-byte identical (back-compat)."""
def test_create_json_no_attachments(self, app_client):
client, _, _gq = app_client
resp = client.post(
"/v1/api/workstreams/new",
json={"name": "json-only"},
headers=_auth("userA"),
)
assert resp.status_code == 200, resp.text
data = resp.json()
assert data["ws_id"]
# New optional field, but always emitted (empty list when absent)
assert data["attachment_ids"] == []
+136
View File
@@ -366,6 +366,142 @@ class TestPlanExec:
assert messages[0]["content"] == ChatSession._PLAN_IDENTITY
# ---------------------------------------------------------------------------
# Per-call model override on plan_agent / task_agent
# ---------------------------------------------------------------------------
class TestAgentModelOverride:
"""Tests for the optional `model` arg on plan_agent / task_agent tools."""
@staticmethod
def _registry():
from turnstone.core.model_registry import ModelConfig, ModelRegistry
return ModelRegistry(
models={
"default": ModelConfig("default", "x", "x", "m"),
"smart": ModelConfig("smart", "x", "x", "m"),
"fast": ModelConfig("fast", "x", "x", "m"),
},
default="default",
)
# ---- _prepare_plan ----
def test_prepare_plan_extracts_model_override(self, tmp_db) -> None:
session = _make_session(registry=self._registry(), model_alias="default")
item = session._prepare_plan("c1", {"goal": "do x", "model": "smart"})
assert item["model_override"] == "smart"
assert "error" not in item
def test_prepare_plan_missing_model_arg_means_no_override(self, tmp_db) -> None:
session = _make_session(registry=self._registry(), model_alias="default")
item = session._prepare_plan("c1", {"goal": "do x"})
assert item["model_override"] is None
def test_prepare_plan_empty_string_model_means_no_override(self, tmp_db) -> None:
# LLMs sometimes echo "" rather than omit the field; treat as unset.
session = _make_session(registry=self._registry(), model_alias="default")
item = session._prepare_plan("c1", {"goal": "do x", "model": ""})
assert item["model_override"] is None
def test_prepare_plan_unknown_model_returns_error(self, tmp_db) -> None:
session = _make_session(registry=self._registry(), model_alias="default")
item = session._prepare_plan("c1", {"goal": "do x", "model": "bogus"})
assert item.get("needs_approval") is False
assert "error" in item
assert "unknown model alias 'bogus'" in item["error"]
# The error guidance must list the available aliases so the LLM can retry.
for alias in ("default", "smart", "fast"):
assert alias in item["error"]
# ---- _prepare_task ----
def test_prepare_task_extracts_model_override(self, tmp_db) -> None:
session = _make_session(registry=self._registry(), model_alias="default")
item = session._prepare_task("c1", {"prompt": "do x", "model": "fast"})
assert item["model_override"] == "fast"
def test_prepare_task_missing_model_arg_means_no_override(self, tmp_db) -> None:
session = _make_session(registry=self._registry(), model_alias="default")
item = session._prepare_task("c1", {"prompt": "do x"})
assert item["model_override"] is None
def test_prepare_task_unknown_model_returns_error(self, tmp_db) -> None:
session = _make_session(registry=self._registry(), model_alias="default")
item = session._prepare_task("c1", {"prompt": "do x", "model": "bogus"})
assert item.get("needs_approval") is False
assert "error" in item
assert "unknown model alias 'bogus'" in item["error"]
# ---- tool description rendering ----
@staticmethod
def _agent_tool(session, name):
"""Return the plan_agent / task_agent dict from the main tool set."""
for t in session._tools:
fn = t.get("function") or {}
if fn.get("name") == name:
return t
return None
def test_render_injects_alias_list_into_descriptions(self, tmp_db) -> None:
session = _make_session(registry=self._registry(), model_alias="default")
for name in ("plan_agent", "task_agent"):
tool = self._agent_tool(session, name)
assert tool is not None, f"{name} missing from session tools"
desc = tool["function"]["parameters"]["properties"]["model"]["description"]
for alias in ("default", "smart", "fast"):
assert f"`{alias}`" in desc, f"alias {alias} missing from {desc!r}"
def test_render_no_op_without_registry(self, tmp_db) -> None:
"""No registry → leave the placeholder description untouched."""
session = _make_session() # no registry
plan_tool = self._agent_tool(session, "plan_agent")
assert plan_tool is not None
desc = plan_tool["function"]["parameters"]["properties"]["model"]["description"]
assert "No alternative aliases configured" in desc
def test_refresh_picks_up_new_aliases(self, tmp_db) -> None:
"""Adding a new model and calling refresh_agent_tool_schemas updates
the description without requiring a fresh session."""
from turnstone.core.model_registry import ModelConfig
reg = self._registry()
session = _make_session(registry=reg, model_alias="default")
# Mutate the registry to add a new alias (simulates admin model add
# followed by sync-to-nodes / internal_model_reload).
new_models = dict(reg.models)
new_models["bigboi"] = ModelConfig("bigboi", "x", "x", "m")
reg.reload(new_models, reg.default, reg.fallback, reg.agent_model)
session.refresh_agent_tool_schemas()
plan_tool = self._agent_tool(session, "plan_agent")
assert plan_tool is not None
desc = plan_tool["function"]["parameters"]["properties"]["model"]["description"]
assert "`bigboi`" in desc
def test_module_level_constants_not_mutated(self, tmp_db) -> None:
"""Rendering must not pollute the module-level TOOLS list shared
across all sessions."""
from turnstone.core.tools import TOOLS
# Construct purely for the side effect of rendering on init.
_make_session(registry=self._registry(), model_alias="default")
for t in TOOLS:
fn = t.get("function") or {}
if fn.get("name") not in ("plan_agent", "task_agent"):
continue
desc = fn["parameters"]["properties"]["model"]["description"]
assert "No alternative aliases configured" in desc, (
f"module-level {fn['name']} description was mutated to: {desc!r}"
)
# ---------------------------------------------------------------------------
# Plan validation
# ---------------------------------------------------------------------------
+30
View File
@@ -122,6 +122,26 @@ class TestValidateValueChoices:
for ch in ("", "none", "low", "medium", "high", "max"):
assert validate_value("model.reasoning_effort", ch) == ch
def test_plan_task_alias_accept_any_string(self):
# plan/task aliases are validated dynamically against live registry
# at apply time; here we just confirm the static validator accepts
# arbitrary strings (including "" for "use server default").
assert validate_value("model.plan_alias", "") == ""
assert validate_value("model.task_alias", "") == ""
assert validate_value("model.plan_alias", "smart") == "smart"
assert validate_value("model.task_alias", "fast") == "fast"
def test_plan_task_effort_choices(self):
for ch in ("", "none", "minimal", "low", "medium", "high", "xhigh", "max"):
assert validate_value("model.plan_effort", ch) == ch
assert validate_value("model.task_effort", ch) == ch
def test_plan_task_effort_invalid(self):
with pytest.raises(ValueError, match="not in"):
validate_value("model.plan_effort", "extreme")
with pytest.raises(ValueError, match="not in"):
validate_value("model.task_effort", "supercharged")
# ---------------------------------------------------------------------------
# serialize / deserialize round-trip
@@ -148,6 +168,16 @@ class TestSerializeDeserialize:
def test_str_round_trip_empty(self):
assert deserialize_value("model.default_alias", serialize_value("")) == ""
def test_plan_task_round_trip(self):
for k in (
"model.plan_alias",
"model.task_alias",
"model.plan_effort",
"model.task_effort",
):
assert deserialize_value(k, serialize_value("")) == ""
assert deserialize_value(k, serialize_value("high")) == "high"
# ---------------------------------------------------------------------------
# Registry integrity
+145
View File
@@ -394,3 +394,148 @@ class TestParametrizedKind:
assert len(rows) == 1
assert rows[0]["content"] == payload
assert rows[0]["kind"] == kind
class TestSweepOrphanReservations:
"""Defensive sweep for reservations leaked by process crashes between
reserve_attachments and consume/unreserve."""
def _backdate(self, backend, attachment_id, *, created_ago=None, reserved_ago=None):
"""Rewrite the row's `created` and/or `reserved_at` columns so the
sweep sees them as older than they really are.
Works against the same string format the storage layer writes
(ISO-8601 truncated to seconds).
"""
from datetime import UTC, datetime, timedelta
import sqlalchemy as sa
from turnstone.core.storage._schema import workstream_attachments
values: dict[str, str] = {}
if created_ago is not None:
values["created"] = (datetime.now(UTC) - timedelta(seconds=created_ago)).strftime(
"%Y-%m-%dT%H:%M:%S"
)
if reserved_ago is not None:
values["reserved_at"] = (datetime.now(UTC) - timedelta(seconds=reserved_ago)).strftime(
"%Y-%m-%dT%H:%M:%S"
)
if not values:
return
with backend._conn() as conn:
conn.execute(
sa.update(workstream_attachments)
.where(workstream_attachments.c.attachment_id == attachment_id)
.values(**values)
)
conn.commit()
def test_clears_old_reserved_rows(self, backend):
backend.register_workstream("ws-sw")
aid = _aid()
backend.save_attachment(aid, "ws-sw", "u", "a.txt", "text/plain", 5, "text", b"hello")
reserved = backend.reserve_attachments([aid], "send-old", "ws-sw", "u")
assert reserved == [aid]
# Backdate the reservation timestamp so the sweep considers it stale
self._backdate(backend, aid, reserved_ago=7200)
n = backend.sweep_orphan_reservations(older_than_seconds=3600)
assert n == 1
# The row is back in pending — list_pending_attachments will surface it
pending = backend.list_pending_attachments("ws-sw", "u")
assert any(p["attachment_id"] == aid for p in pending)
def test_leaves_fresh_reservations_alone(self, backend):
backend.register_workstream("ws-sw2")
aid = _aid()
backend.save_attachment(aid, "ws-sw2", "u", "a.txt", "text/plain", 5, "text", b"hello")
backend.reserve_attachments([aid], "send-fresh", "ws-sw2", "u")
# No backdating — reservation was just created
n = backend.sweep_orphan_reservations(older_than_seconds=3600)
assert n == 0
# Reservation still held
pending = backend.list_pending_attachments("ws-sw2", "u")
assert pending == []
def test_old_upload_with_fresh_reservation_is_preserved(self, backend):
"""Regression: an attachment uploaded long ago but reserved just
now must NOT be swept. ``reserved_at`` (set on reserve) is the
staleness signal not ``created`` (upload time)."""
backend.register_workstream("ws-sw-mix")
aid = _aid()
backend.save_attachment(aid, "ws-sw-mix", "u", "a.txt", "text/plain", 5, "text", b"hello")
# Backdate the upload by a day, but reserve fresh.
self._backdate(backend, aid, created_ago=86_400)
reserved = backend.reserve_attachments([aid], "send-fresh", "ws-sw-mix", "u")
assert reserved == [aid]
n = backend.sweep_orphan_reservations(older_than_seconds=3600)
assert n == 0
# Reservation still held — pending list is empty
assert backend.list_pending_attachments("ws-sw-mix", "u") == []
# And consume against the original send_id still succeeds
msg_id = backend.save_message("ws-sw-mix", "user", "after fresh reserve")
backend.mark_attachments_consumed(
[aid], msg_id, "ws-sw-mix", "u", reserved_for_msg_id="send-fresh"
)
row = backend.get_attachment(aid)
assert row is not None
assert row["message_id"] == msg_id
def test_consume_clears_reserved_at(self, backend):
"""Once consumed, the row's reservation metadata must be wiped so
a follow-up sweep can't accidentally match on it."""
backend.register_workstream("ws-sw-consume")
aid = _aid()
backend.save_attachment(
aid, "ws-sw-consume", "u", "a.txt", "text/plain", 5, "text", b"hello"
)
backend.reserve_attachments([aid], "send-c", "ws-sw-consume", "u")
msg_id = backend.save_message("ws-sw-consume", "user", "consumed")
backend.mark_attachments_consumed(
[aid], msg_id, "ws-sw-consume", "u", reserved_for_msg_id="send-c"
)
row = backend.get_attachment(aid)
assert row is not None
assert row["reserved_at"] is None
assert row["reserved_for_msg_id"] is None
def test_unreserve_clears_reserved_at(self, backend):
backend.register_workstream("ws-sw-unres")
aid = _aid()
backend.save_attachment(aid, "ws-sw-unres", "u", "a.txt", "text/plain", 5, "text", b"hello")
backend.reserve_attachments([aid], "send-u", "ws-sw-unres", "u")
backend.unreserve_attachments("send-u", "ws-sw-unres", "u")
row = backend.get_attachment(aid)
assert row is not None
assert row["reserved_at"] is None
assert row["reserved_for_msg_id"] is None
def test_skips_consumed_rows(self, backend):
backend.register_workstream("ws-sw3")
aid = _aid()
backend.save_attachment(aid, "ws-sw3", "u", "a.txt", "text/plain", 5, "text", b"hello")
backend.reserve_attachments([aid], "send-c", "ws-sw3", "u")
msg_id = backend.save_message("ws-sw3", "user", "consumed turn")
backend.mark_attachments_consumed(
[aid], msg_id, "ws-sw3", "u", reserved_for_msg_id="send-c"
)
# Even backdating both timestamps shouldn't matter — the sweep
# excludes consumed rows.
self._backdate(backend, aid, created_ago=7200, reserved_ago=7200)
n = backend.sweep_orphan_reservations(older_than_seconds=3600)
assert n == 0
def test_zero_threshold_is_noop(self, backend):
# Defensive guard against accidental "sweep everything" calls
n = backend.sweep_orphan_reservations(older_than_seconds=0)
assert n == 0
n = backend.sweep_orphan_reservations(older_than_seconds=-5)
assert n == 0
+47
View File
@@ -751,6 +751,53 @@ class TestWebUI:
ui.resolve_plan("ok")
assert ui._pending_plan_review is None
def test_resolve_plan_broadcasts_plan_resolved(self):
"""resolve_plan emits a plan_resolved SSE so other clients dismiss.
Also verifies _pending_plan_review is cleared BEFORE the event is
enqueued, so a reconnecting client cannot get both the replayed
plan_review and the live plan_resolved.
"""
from turnstone.server import WebUI
ui = WebUI(ws_id="test")
ui._pending_plan_review = {"type": "plan_review", "content": "x"}
listener = ui._register_listener()
try:
ui.resolve_plan("approved")
events = []
while not listener.empty():
events.append(listener.get_nowait())
finally:
ui._unregister_listener(listener)
resolved = [e for e in events if e.get("type") == "plan_resolved"]
assert len(resolved) == 1
assert resolved[0]["feedback"] == "approved"
# Critical ordering invariant: pending cleared before broadcast.
assert ui._pending_plan_review is None
def test_resolve_plan_skips_broadcast_when_no_plan_pending(self):
"""cancel_generation calls resolve_plan unconditionally — don't
emit a stray plan_resolved frame when no modal was ever shown."""
from turnstone.server import WebUI
ui = WebUI(ws_id="test")
assert ui._pending_plan_review is None
listener = ui._register_listener()
try:
ui.resolve_plan("reject") # cancel path with no pending plan
events = []
while not listener.empty():
events.append(listener.get_nowait())
finally:
ui._unregister_listener(listener)
assert not [e for e in events if e.get("type") == "plan_resolved"]
# Wait must still unblock so the worker thread can return.
assert ui._plan_event.is_set()
assert ui._plan_result == "reject"
# ---------------------------------------------------------------------------
# WebUI SSE fan-out
+17 -2
View File
@@ -20,9 +20,24 @@
[model]
# name = "" # Model ID; empty = provider default (gpt-5 / claude-sonnet-4)
# temperature = 0.0 # 0 = provider default
# reasoning_effort = "" # "low", "medium", "high", "max"
# reasoning_effort = "" # "none", "minimal", "low", "medium", "high", "xhigh", "max"
# context_window = 0 # 0 = auto-detect from provider capabilities
# max_tokens = 0 # 0 = provider default
#
# Sub-agent routing (plan_agent, task_agent tools). Each falls back to
# agent_model when unset, then to the session model. Use this to point
# the rare-but-expensive plan agent at a stronger model than the
# frequent task agent.
# agent_model = "" # legacy single-knob: both plan and task share this
# plan_model = "" # plan_agent override (e.g. "claude" for a smart planner)
# task_model = "" # task_agent override (e.g. "local" for cheap subtasks)
# plan_effort = "" # reasoning effort for plan_agent (default: "high")
# task_effort = "" # reasoning effort for task_agent (default: inherit session)
#
# At call time, the calling LLM may also pass `model="<alias>"` to
# plan_agent / task_agent to override these per-invocation. Tool
# descriptions list available aliases dynamically; bad aliases return
# an error so the model retries with a valid choice.
# --- Named Models (turnstone, node, eval) ---
# Define model aliases with per-model overrides. Useful for local model
@@ -39,7 +54,7 @@
# supports_web_search = false
#
# [models.claude]
# name = "claude-opus-4-6"
# name = "claude-opus-4-7"
# provider = "anthropic"
# --- Database (turnstone, node, console) ---
+1 -1
View File
@@ -1,3 +1,3 @@
"""turnstone - Multi-node AI orchestration platform with tool use, agent routing, and cluster simulation."""
__version__ = "1.4.0a3"
__version__ = "1.4.0"
+54 -1
View File
@@ -26,7 +26,35 @@ class SendRequest(BaseModel):
class SendResponse(BaseModel):
status: str = Field(description="'ok' or 'busy'", examples=["ok", "busy"])
status: str = Field(
description="'ok', 'busy', 'queued', or 'queue_full'",
examples=["ok", "busy", "queued", "queue_full"],
)
attached_ids: list[str] = Field(
default_factory=list,
description=(
"Attachment ids actually reserved onto this turn. Subset of "
"the request's `attachment_ids` (or the auto-consumed pending "
"set). Empty when the send carries no attachments."
),
)
dropped_attachment_ids: list[str] = Field(
default_factory=list,
description=(
"Attachment ids the caller requested that the server could "
"not reserve (lost a race, already consumed, or cross-scope). "
"The request still proceeds with whatever was reserved; the "
"client can retry uploads or surface a partial-attach warning."
),
)
priority: str | None = Field(
default=None,
description="Set on `queued` responses: relative priority of the queued message.",
)
msg_id: str | None = Field(
default=None,
description="Set on `queued` responses: id used to dequeue the message.",
)
class AttachmentInfo(BaseModel):
@@ -95,6 +123,23 @@ class CreateWorkstreamRequest(BaseModel):
default="",
description="Client surface type (web, cli, chat). Defaults to web for server-created sessions.",
)
initial_message: str = Field(
default="",
description=(
"Optional first user message dispatched as a background turn after "
"the workstream is created. When attachments are also provided "
"(via the multipart variant), they are reserved onto this turn."
),
)
ws_id: str = Field(
default="",
description=(
"Optional caller-supplied workstream id (32-hex). Required when "
"creating with attachments via the cluster routing layer so the "
"console can hash to the owning node before the multipart body "
"lands. Auto-generated when omitted."
),
)
class CreateWorkstreamResponse(BaseModel):
@@ -104,6 +149,14 @@ class CreateWorkstreamResponse(BaseModel):
message_count: int = Field(
default=0, description="Number of messages in the resumed workstream"
)
attachment_ids: list[str] = Field(
default_factory=list,
description=(
"Ids of attachments saved by this request (multipart variant only). "
"Already reserved onto the initial_message turn when one was provided; "
"otherwise left pending for a follow-up POST /v1/api/send."
),
)
class CloseWorkstreamRequest(BaseModel):
+11 -1
View File
@@ -64,9 +64,19 @@ SERVER_ENDPOINTS: list[EndpointSpec] = [
"/v1/api/workstreams/new",
"POST",
"Create a new workstream",
description=(
"Accepts two content types. Default is `application/json` with a "
"`CreateWorkstreamRequest` body. Alternatively, `multipart/form-data` "
"with one `meta` field (JSON-encoded `CreateWorkstreamRequest` shape) "
"plus zero-or-more `file` parts saves each file as an attachment "
"under the new workstream. When `initial_message` is also set, "
"attachments are reserved onto that turn before the worker thread "
"dispatches; otherwise they remain pending for a follow-up "
"`POST /v1/api/send`."
),
request_model=CreateWorkstreamRequest,
response_model=CreateWorkstreamResponse,
error_codes=[400],
error_codes=[400, 409, 413],
tags=["Workstreams"],
),
EndpointSpec(
+20 -1
View File
@@ -25,6 +25,8 @@ if TYPE_CHECKING:
from turnstone.channels._protocol import ChannelAdapter
from turnstone.core.storage._protocol import StorageBackend
from turnstone.channels.slack.routes import SlackRoute
log = get_logger(__name__)
_NOTIFY_ADAPTER_TIMEOUT: float = 30.0
@@ -108,7 +110,24 @@ async def _handle_notify(request: Request) -> JSONResponse:
status_code=404,
)
elif "channel_type" in target and "channel_id" in target:
targets.append((target["channel_type"], target["channel_id"]))
channel_type = target["channel_type"]
channel_id = target["channel_id"]
if channel_type == "slack":
route = SlackRoute.parse(channel_id)
if ws_id and (not route.channel or not route.user_id):
return JSONResponse(
{
"error": (
"slack notification targets with ws_id must use "
"channel_id in the form 'channel:user_id' or "
"'channel:user_id:thread_ts'"
)
},
status_code=400,
)
targets.append((channel_type, channel_id))
else:
return JSONResponse(
{"error": "target must have username or channel_type+channel_id"},
+147 -98
View File
@@ -54,6 +54,28 @@ def main() -> None:
help="Comma-separated list of allowed Discord channel IDs (default: all)",
)
# -- Slack ---------------------------------------------------------------
parser.add_argument(
"--slack-token",
default=os.environ.get("TURNSTONE_SLACK_TOKEN", ""),
help="Slack bot token (default: $TURNSTONE_SLACK_TOKEN)",
)
parser.add_argument(
"--slack-app-token",
default=os.environ.get("TURNSTONE_SLACK_APP_TOKEN", ""),
help="Slack app-level token for Socket Mode (default: $TURNSTONE_SLACK_APP_TOKEN)",
)
parser.add_argument(
"--slack-channels",
default=os.environ.get("TURNSTONE_SLACK_CHANNELS", ""),
help="Comma-separated list of allowed Slack channel IDs (default: all)",
)
parser.add_argument(
"--slack-slash-command",
default=os.environ.get("TURNSTONE_SLACK_SLASH_COMMAND", "/turnstone"),
help="Slack slash command name (default: /turnstone)",
)
# -- HTTP server ---------------------------------------------------------
parser.add_argument(
"--http-host",
@@ -101,7 +123,7 @@ def main() -> None:
log = get_logger(__name__)
# -- Storage -------------------------------------------------------------
from turnstone.core.storage._registry import init_storage
from turnstone.core.storage._registry import get_storage, init_storage
db_backend = os.environ.get("TURNSTONE_DB_BACKEND", "sqlite")
db_url = os.environ.get("TURNSTONE_DB_URL", "")
@@ -191,27 +213,35 @@ def main() -> None:
sys.exit(1)
# -- Adapter selection ---------------------------------------------------
adapters_configured = False
if args.discord_token:
adapters_configured = True
if not adapters_configured:
if not args.discord_token and not args.slack_token:
print(
"Error: no channel adapters configured. "
"Set --discord-token or $TURNSTONE_DISCORD_TOKEN.",
"Set --discord-token / $TURNSTONE_DISCORD_TOKEN "
"or --slack-token / $TURNSTONE_SLACK_TOKEN.",
file=sys.stderr,
)
sys.exit(1)
# -- Run -----------------------------------------------------------------
if args.discord_token:
import asyncio
# Slack config validation (fail fast)
if bool(args.slack_token) != bool(args.slack_app_token):
raise SystemExit("--slack-token and --slack-app-token must be provided together")
from turnstone.channels._http import _get_service_id, create_channel_app
# -- Run -----------------------------------------------------------------
import asyncio
import contextlib
from typing import TYPE_CHECKING, cast
from turnstone.channels._http import _get_service_id, create_channel_app
if TYPE_CHECKING:
from turnstone.channels._protocol import ChannelAdapter
storage = get_storage()
adapters: dict[str, ChannelAdapter] = {}
if args.discord_token:
from turnstone.channels.discord.bot import TurnstoneBot
from turnstone.channels.discord.config import DiscordConfig
from turnstone.core.storage._registry import get_storage
allowed_channels: list[int] = []
if args.discord_channels:
@@ -219,7 +249,7 @@ def main() -> None:
int(c.strip()) for c in args.discord_channels.split(",") if c.strip()
]
config = DiscordConfig(
discord_config = DiscordConfig(
server_url=server_url,
model=args.model,
auto_approve=args.auto_approve,
@@ -227,109 +257,128 @@ def main() -> None:
guild_id=args.discord_guild,
allowed_channels=allowed_channels,
)
storage = get_storage()
bot = TurnstoneBot(
config,
discord_bot = TurnstoneBot(
discord_config,
server_url,
storage,
console_url=console_url,
console_token_factory=_console_token_factory,
server_token_factory=_server_token_factory,
)
adapters = {"discord": bot}
adapters[discord_bot.channel_type] = cast("ChannelAdapter", discord_bot)
# Create HTTP app for notification delivery
channel_app = create_channel_app(
adapters, # type: ignore[arg-type]
storage,
jwt_secret=jwt_secret,
if args.slack_token:
from turnstone.channels.slack.bot import TurnstoneSlackBot
from turnstone.channels.slack.config import SlackConfig
slack_config = SlackConfig(
model=args.model,
auto_approve=args.auto_approve,
bot_token=args.slack_token,
app_token=args.slack_app_token,
allowed_channels=[c.strip() for c in args.slack_channels.split(",") if c.strip()],
slash_command=args.slack_slash_command,
)
log.info(
"channel.starting",
adapter="discord",
guild_id=config.guild_id,
http_port=args.http_port,
slack_bot = TurnstoneSlackBot(
slack_config,
server_url=server_url,
storage=storage,
console_url=console_url,
console_token_factory=_console_token_factory,
server_token_factory=_server_token_factory,
)
adapters[slack_bot.channel_type] = cast("ChannelAdapter", slack_bot)
channel_app = create_channel_app(
adapters,
storage,
jwt_secret=jwt_secret,
)
log.info(
"channel.starting",
adapters=list(adapters.keys()),
http_port=args.http_port,
server_url=server_url,
)
async def _run_all() -> None:
"""Run all adapters + HTTP server + service heartbeat concurrently."""
import uvicorn
service_id = _get_service_id()
# Resolve advertise URL — env override for Docker/K8s,
# otherwise derive from bind address.
advertise_url = os.environ.get("TURNSTONE_CHANNEL_ADVERTISE_URL", "").strip()
if not advertise_url:
if args.http_host in ("0.0.0.0", "::"):
advertise_host = socket.gethostname()
else:
advertise_host = args.http_host
scheme = "https" if args.ssl_certfile else "http"
advertise_url = f"{scheme}://{advertise_host}:{args.http_port}"
service_url = advertise_url
# Register in service registry
storage.register_service("channel", service_id, service_url)
log.info(
"channel.service_registered",
service_id=service_id,
url=service_url,
)
async def _run_all() -> None:
"""Run Discord bot + HTTP server + service heartbeat concurrently."""
import uvicorn
async def _heartbeat_loop() -> None:
"""Periodically update service heartbeat."""
from turnstone.core.storage._registry import StorageUnavailableError
service_id = _get_service_id()
while True:
await asyncio.sleep(30)
try:
await asyncio.to_thread(storage.heartbeat_service, "channel", service_id)
except StorageUnavailableError:
pass # already logged by storage layer
except Exception:
log.exception("channel.heartbeat_failed")
# Resolve advertise URL — env override for Docker/K8s,
# otherwise derive from bind address.
advertise_url = os.environ.get("TURNSTONE_CHANNEL_ADVERTISE_URL", "").strip()
if not advertise_url:
if args.http_host in ("0.0.0.0", "::"):
advertise_host = socket.gethostname()
else:
advertise_host = args.http_host
scheme = "https" if args.ssl_certfile else "http"
advertise_url = f"{scheme}://{advertise_host}:{args.http_port}"
service_url = advertise_url
# Register in service registry
storage.register_service("channel", service_id, service_url)
log.info(
"channel.service_registered",
service_id=service_id,
url=service_url,
# TLS: use cert files if available (from bootstrap or TLSClient)
ssl_certfile = getattr(args, "ssl_certfile", None)
ssl_keyfile = getattr(args, "ssl_keyfile", None)
ssl_ca_certs = getattr(args, "ssl_ca_certs", None)
if bool(ssl_certfile) != bool(ssl_keyfile):
print(
"Both --ssl-certfile and --ssl-keyfile are required for TLS",
file=sys.stderr,
)
sys.exit(1)
async def _heartbeat_loop() -> None:
"""Periodically update service heartbeat."""
from turnstone.core.storage._registry import StorageUnavailableError
uv_config = uvicorn.Config(
channel_app,
host=args.http_host,
port=args.http_port,
log_level="warning",
ssl_certfile=ssl_certfile,
ssl_keyfile=ssl_keyfile,
ssl_ca_certs=ssl_ca_certs,
)
server = uvicorn.Server(uv_config)
while True:
await asyncio.sleep(30)
try:
await asyncio.to_thread(storage.heartbeat_service, "channel", service_id)
except StorageUnavailableError:
pass # already logged by storage layer
except Exception:
log.exception("channel.heartbeat_failed")
# TLS: use cert files if available (from bootstrap or TLSClient)
ssl_certfile = getattr(args, "ssl_certfile", None)
ssl_keyfile = getattr(args, "ssl_keyfile", None)
ssl_ca_certs = getattr(args, "ssl_ca_certs", None)
if bool(ssl_certfile) != bool(ssl_keyfile):
print(
"Both --ssl-certfile and --ssl-keyfile are required for TLS",
file=sys.stderr,
)
sys.exit(1)
uv_config = uvicorn.Config(
channel_app,
host=args.http_host,
port=args.http_port,
log_level="warning",
ssl_certfile=ssl_certfile,
ssl_keyfile=ssl_keyfile,
ssl_ca_certs=ssl_ca_certs,
heartbeat_task = asyncio.create_task(_heartbeat_loop())
try:
await asyncio.gather(
*(adapter.start() for adapter in adapters.values()),
server.serve(),
)
server = uvicorn.Server(uv_config)
finally:
heartbeat_task.cancel()
with contextlib.suppress(asyncio.CancelledError):
await heartbeat_task
heartbeat_task = asyncio.create_task(_heartbeat_loop())
try:
await asyncio.gather(
bot.start(),
server.serve(),
)
finally:
heartbeat_task.cancel()
await asyncio.to_thread(storage.deregister_service, "channel", service_id)
log.info("channel.service_deregistered", service_id=service_id)
await asyncio.to_thread(storage.deregister_service, "channel", service_id)
log.info("channel.service_deregistered", service_id=service_id)
import contextlib
with contextlib.suppress(KeyboardInterrupt):
asyncio.run(_run_all())
with contextlib.suppress(KeyboardInterrupt):
asyncio.run(_run_all())
if __name__ == "__main__":
+11
View File
@@ -0,0 +1,11 @@
"""Slack channel adapter (Socket Mode).
Bridges Slack channel mentions, slash-command sessions, and DMs to
turnstone workstreams. The :class:`TurnstoneSlackBot` runs over
slack-bolt's Socket Mode (no public URL or signing-secret needed)
and shares the per-user routing, approvals, and SSE-event consumption
patterns established by the Discord adapter.
See ``turnstone/channels/cli.py`` for the gateway entry point and
``turnstone/channels/slack/config.py`` for app + token setup.
"""
File diff suppressed because it is too large Load Diff
+37
View File
@@ -0,0 +1,37 @@
"""Slack-specific configuration."""
from __future__ import annotations
from dataclasses import dataclass, field
from turnstone.channels._config import ChannelConfig
@dataclass
class SlackConfig(ChannelConfig):
"""Configuration for the Slack channel adapter.
Uses Socket Mode so no public URL or API Gateway is required
Slack connects outbound to the instance via a WebSocket.
Requires two tokens:
- bot_token (xoxb-...): for posting messages via the Web API
- app_token (xapp-...): for Socket Mode WebSocket connection
To create these:
1. Go to https://api.slack.com/apps and create a new app
2. Enable Socket Mode under Settings > Socket Mode this generates the app_token
3. Under OAuth & Permissions add bot scopes:
chat:write, chat:write.public, channels:history, im:history,
groups:history, mpim:history, reactions:write
4. Under Event Subscriptions (via Socket Mode) subscribe to:
message.channels, message.im, message.groups
5. Install the app to your workspace to get the bot_token
"""
bot_token: str = "" # xoxb-... (Bot User OAuth Token)
app_token: str = "" # xapp-... (App-Level Token for Socket Mode)
allowed_channels: list[str] = field(default_factory=list) # empty = all
max_message_length: int = 3000
streaming_edit_interval: float = 1.5 # seconds between message edits
slash_command: str = "/turnstone"
+33
View File
@@ -0,0 +1,33 @@
from __future__ import annotations
from dataclasses import dataclass
@dataclass(frozen=True)
class SlackRoute:
channel: str
user_id: str | None = None
thread_ts: str | None = None
@classmethod
def parse(cls, channel_id: str) -> SlackRoute:
parts = channel_id.split(":", 2)
channel = parts[0] if parts else ""
user_id = parts[1] if len(parts) >= 2 and parts[1] else None
thread_ts = parts[2] if len(parts) == 3 and parts[2] else None
return cls(channel=channel, user_id=user_id, thread_ts=thread_ts)
def to_channel_id(self) -> str:
if self.thread_ts:
return f"{self.channel}:{self.user_id or ''}:{self.thread_ts}"
if self.user_id:
return f"{self.channel}:{self.user_id}"
return self.channel
@property
def has_user(self) -> bool:
return bool(self.user_id)
@property
def has_thread(self) -> bool:
return bool(self.thread_ts)
+278 -73
View File
@@ -625,7 +625,13 @@ def _record_route(
async def route_create(request: Request) -> Response:
"""POST /v1/api/route/workstreams/new — create via hash-ring routing."""
"""POST /v1/api/route/workstreams/new — create via hash-ring routing.
Accepts both `application/json` and `multipart/form-data`. Multipart
callers must include ``?ws_id=<hex>`` in the URL query string so the
console can hash to the owning node before the multipart body lands
we do not parse the body just to peek at the metadata.
"""
t0 = time.monotonic()
router: ConsoleRouter | None = request.app.state.router
ring_ready = router is not None and router.is_ready()
@@ -649,88 +655,102 @@ async def route_create(request: Request) -> Response:
)
assert router is not None
try:
body = await request.json()
except Exception:
return _record_route(
request,
"create",
400,
t0,
JSONResponse(
{"error": "Invalid JSON body"},
status_code=400,
),
)
raw_content_type = request.headers.get("content-type") or ""
is_multipart = raw_content_type.lower().startswith("multipart/form-data")
client: httpx.AsyncClient = request.app.state.proxy_client
headers = _proxy_auth_headers(request)
pin = False
body: dict[str, Any] = {}
raw_body: bytes = b""
try:
if body.get("resume_ws"):
ref = router.route(body["resume_ws"])
elif body.get("target_node"):
ws_id = router.generate_ws_id_for_node(body["target_node"])
body["ws_id"] = ws_id
ref = router.route(ws_id)
pin = True
else:
ws_id = secrets.token_hex(16)
body["ws_id"] = ws_id
ref = router.route(ws_id)
except NoAvailableNodeError:
return _record_route(
request,
"create",
503,
t0,
JSONResponse(
{"error": "No available node for routing"},
status_code=503,
),
)
try:
resp = await client.post(f"{ref.url}/v1/api/workstreams/new", json=body, headers=headers)
except httpx.HTTPError:
return _record_route(
request,
"create",
502,
t0,
JSONResponse(
{"error": f"upstream node {ref.node_id} unreachable"},
status_code=502,
),
)
# 503 retry with a new ws_id that hashes to a different node
if resp.status_code == 503 and not pin and not body.get("resume_ws"):
failed_node = ref.node_id
found_alt = False
for _ in range(10):
ws_id = secrets.token_hex(16)
try:
ref = router.route(ws_id)
except NoAvailableNodeError:
break
if ref.node_id != failed_node:
found_alt = True
break
if not found_alt:
if is_multipart:
# Multipart: caller must pass ws_id as a query param so we can
# route without parsing the body. Stream the raw bytes through
# to the upstream so we don't lose the multipart framing.
ws_id = request.query_params.get("ws_id", "").strip()
if not ws_id:
return _record_route(
request,
"create",
resp.status_code,
400,
t0,
Response(
content=resp.content,
status_code=resp.status_code,
headers=dict(resp.headers),
JSONResponse(
{"error": "ws_id query parameter required for multipart create"},
status_code=400,
),
)
body["ws_id"] = ws_id
try:
ref = router.route(ws_id)
except NoAvailableNodeError:
return _record_route(
request,
"create",
503,
t0,
JSONResponse(
{"error": "No available node for routing"},
status_code=503,
),
)
raw_body = await request.body()
# Forward the raw header verbatim — the multipart `boundary=` parameter
# is case-sensitive and must match the bytes in the body exactly.
upstream_headers = {**headers, "Content-Type": raw_content_type}
try:
resp = await client.post(
f"{ref.url}/v1/api/workstreams/new",
content=raw_body,
headers=upstream_headers,
)
except httpx.HTTPError:
return _record_route(
request,
"create",
502,
t0,
JSONResponse(
{"error": f"upstream node {ref.node_id} unreachable"},
status_code=502,
),
)
else:
try:
body = await request.json()
except Exception:
return _record_route(
request,
"create",
400,
t0,
JSONResponse(
{"error": "Invalid JSON body"},
status_code=400,
),
)
try:
if body.get("resume_ws"):
ref = router.route(body["resume_ws"])
elif body.get("target_node"):
ws_id = router.generate_ws_id_for_node(body["target_node"])
body["ws_id"] = ws_id
ref = router.route(ws_id)
pin = True
else:
ws_id = secrets.token_hex(16)
body["ws_id"] = ws_id
ref = router.route(ws_id)
except NoAvailableNodeError:
return _record_route(
request,
"create",
503,
t0,
JSONResponse(
{"error": "No available node for routing"},
status_code=503,
),
)
try:
resp = await client.post(
f"{ref.url}/v1/api/workstreams/new", json=body, headers=headers
@@ -747,6 +767,50 @@ async def route_create(request: Request) -> Response:
),
)
# 503 retry with a new ws_id that hashes to a different node.
# Multipart variant skips this branch — the body is bound to the
# ws_id the caller chose, so re-routing would mean re-uploading.
if resp.status_code == 503 and not pin and not body.get("resume_ws"):
failed_node = ref.node_id
found_alt = False
for _ in range(10):
ws_id = secrets.token_hex(16)
try:
ref = router.route(ws_id)
except NoAvailableNodeError:
break
if ref.node_id != failed_node:
found_alt = True
break
if not found_alt:
return _record_route(
request,
"create",
resp.status_code,
t0,
Response(
content=resp.content,
status_code=resp.status_code,
headers=dict(resp.headers),
),
)
body["ws_id"] = ws_id
try:
resp = await client.post(
f"{ref.url}/v1/api/workstreams/new", json=body, headers=headers
)
except httpx.HTTPError:
return _record_route(
request,
"create",
502,
t0,
JSONResponse(
{"error": f"upstream node {ref.node_id} unreachable"},
status_code=502,
),
)
if resp.status_code == 200:
data = resp.json()
data["node_url"] = ref.url
@@ -765,6 +829,132 @@ async def route_create(request: Request) -> Response:
)
async def route_attachment_proxy(request: Request) -> Response:
"""Proxy ws-id-keyed attachment endpoints through the hash-ring router.
Handles all four shapes mounted under
``/v1/api/route/workstreams/{ws_id}/attachments[/...]``:
- ``POST .../attachments`` multipart upload (raw-body forward)
- ``GET .../attachments`` list pending (JSON pass-through)
- ``GET .../attachments/{attachment_id}/content`` raw bytes
- ``DELETE .../attachments/{attachment_id}`` JSON pass-through
All variants forward ``Content-Type`` + auth headers so multipart
framing survives, and propagate upstream response headers so the
``Content-Disposition`` / ``X-Content-Type-Options`` set by
``get_attachment_content`` reach the original caller intact.
"""
method = "attach"
t0 = time.monotonic()
router: ConsoleRouter | None = request.app.state.router
ring_ready = router is not None and router.is_ready()
if not ring_ready:
if router is not None:
await asyncio.to_thread(router.refresh_cache)
ring_ready = router.is_ready()
if not ring_ready:
return _record_route(
request,
method,
503,
t0,
JSONResponse(
{"error": "Cluster routing not initialized"},
status_code=503,
),
)
assert router is not None
ws_id = request.path_params.get("ws_id", "").strip()
if not ws_id:
return _record_route(
request,
method,
400,
t0,
JSONResponse({"error": "ws_id required"}, status_code=400),
)
try:
ref = router.route(ws_id)
except (NoAvailableNodeError, ValueError):
return _record_route(
request,
method,
503,
t0,
JSONResponse({"error": "routing failed"}, status_code=503),
)
upstream_path = request.url.path.replace("/api/route/", "/api/", 1)
if request.url.query:
upstream_path += f"?{request.url.query}"
client: httpx.AsyncClient = request.app.state.proxy_client
headers = _proxy_auth_headers(request)
upstream_headers: dict[str, str] = dict(headers)
if request.method in ("POST", "PUT", "DELETE"):
upstream_headers["Content-Type"] = request.headers.get(
"content-type", "application/octet-stream"
)
body = await request.body()
try:
resp = await client.request(
request.method,
f"{ref.url}{upstream_path}",
content=body,
headers=upstream_headers,
)
except httpx.HTTPError:
return _record_route(
request,
method,
502,
t0,
JSONResponse(
{"error": f"upstream node {ref.node_id} unreachable"},
status_code=502,
),
)
else:
try:
resp = await client.get(f"{ref.url}{upstream_path}", headers=upstream_headers)
except httpx.HTTPError:
return _record_route(
request,
method,
502,
t0,
JSONResponse(
{"error": f"upstream node {ref.node_id} unreachable"},
status_code=502,
),
)
# Preserve upstream headers — Content-Disposition + CSP set by the
# /content handler must reach the original caller, and the upstream
# already produced the correct Content-Type for both JSON and binary
# payloads. Drop hop-by-hop headers that the underlying transport
# will manage itself.
response_headers = {
k: v
for k, v in resp.headers.items()
if k.lower()
not in {"transfer-encoding", "content-encoding", "connection", "content-length"}
}
return _record_route(
request,
method,
resp.status_code,
t0,
Response(
content=resp.content,
status_code=resp.status_code,
headers=response_headers,
),
)
async def route_proxy(request: Request) -> Response:
"""Generic routing proxy for send/approve/cancel/command/close."""
t0 = time.monotonic()
@@ -7453,6 +7643,21 @@ def create_app(
Route("/api/route/command", route_proxy, methods=["POST"]),
Route("/api/route/plan", route_proxy, methods=["POST"]),
Route("/api/route/workstreams/close", route_proxy, methods=["POST"]),
Route(
"/api/route/workstreams/{ws_id}/attachments",
route_attachment_proxy,
methods=["POST", "GET"],
),
Route(
"/api/route/workstreams/{ws_id}/attachments/{attachment_id}",
route_attachment_proxy,
methods=["DELETE"],
),
Route(
"/api/route/workstreams/{ws_id}/attachments/{attachment_id}/content",
route_attachment_proxy,
methods=["GET"],
),
Route("/api/route", route_lookup, methods=["GET"]),
Route("/api/models", list_available_models),
Route("/api/skills", list_skills_summary),
+97 -20
View File
@@ -15,6 +15,21 @@ var _confirmCallbackFn = null;
var _confirmTriggerEl = null;
var _mobileSidebarOpen = false;
// Settings whose choices are populated dynamically from the live model
// alias list, and whose empty-string option renders as "(server default)".
var ALIAS_SETTING_KEYS = [
"model.default_alias",
"model.plan_alias",
"model.task_alias",
"channels.default_model_alias",
];
// Settings whose empty option means "inherit from a fallback chain", as
// opposed to "no value" — distinct from the literal "none" choice (e.g.
// reasoning_effort="none" actually disables reasoning, very different
// from leaving it unset).
var INHERIT_EMPTY_LABEL_KEYS = ["model.plan_effort", "model.task_effort"];
// ---------------------------------------------------------------------------
// View switching (called from app.js showOverview/drillDown pattern)
// ---------------------------------------------------------------------------
@@ -844,9 +859,20 @@ function _renderChannels(channels) {
var html = "";
for (var i = 0; i < channels.length; i++) {
var c = channels[i];
// Per-platform badge class (scope-discord / scope-slack) so different
// adapters render with their own color. Falls back to the generic
// scope-channel for unknown platforms; the per-platform class wins
// by being the only class set, not by source order.
var ctSlug = (c.channel_type || "").toLowerCase().replace(/[^a-z0-9]/g, "");
var ctClass =
ctSlug && (ctSlug === "discord" || ctSlug === "slack")
? "scope-badge scope-" + ctSlug
: "scope-badge scope-channel";
html +=
'<div class="admin-row" role="listitem">' +
'<span class="admin-col admin-col-chtype"><span class="scope-badge scope-channel">' +
'<span class="admin-col admin-col-chtype"><span class="' +
ctClass +
'">' +
escapeHtml(c.channel_type) +
"</span></span>" +
'<span class="admin-col admin-col-chuid"><code>' +
@@ -1118,13 +1144,50 @@ function _populateScheduleSelect(selectId, url, labelKey, valueKey, opts) {
});
}
function _addNotifyRow(prefix, targetType, targetId) {
// Channel platforms shown in admin notify-target rows. Mirror server-side
// channel adapters; expand here when a new adapter ships (Discord / Slack
// today, MS Teams / etc. later).
var _NOTIFY_CHANNEL_TYPES = [
{
value: "discord",
label: "Discord",
id_hint: "Discord ID (e.g. 123456789012345678)",
},
{
value: "slack",
label: "Slack",
id_hint: "Slack ID (e.g. C01234567 or U01234567)",
},
];
function _notifyIdPlaceholder(channelType) {
for (var i = 0; i < _NOTIFY_CHANNEL_TYPES.length; i++) {
if (_NOTIFY_CHANNEL_TYPES[i].value === channelType) {
return _NOTIFY_CHANNEL_TYPES[i].id_hint;
}
}
return "ID";
}
function _addNotifyRow(prefix, targetType, targetId, channelType) {
var container = document.getElementById(prefix + "-notify-rows");
var row = document.createElement("div");
row.className = "notify-row";
var ctSel = document.createElement("select");
ctSel.setAttribute("aria-label", "Channel platform");
ctSel.className = "notify-row-ct";
for (var i = 0; i < _NOTIFY_CHANNEL_TYPES.length; i++) {
var ctOpt = document.createElement("option");
ctOpt.value = _NOTIFY_CHANNEL_TYPES[i].value;
ctOpt.textContent = _NOTIFY_CHANNEL_TYPES[i].label;
ctSel.appendChild(ctOpt);
}
ctSel.value = channelType || "discord";
var typeSel = document.createElement("select");
typeSel.setAttribute("aria-label", "Target type");
typeSel.className = "notify-row-target";
var optCh = document.createElement("option");
optCh.value = "channel_id";
optCh.textContent = "Channel";
@@ -1137,11 +1200,18 @@ function _addNotifyRow(prefix, targetType, targetId) {
var idInput = document.createElement("input");
idInput.type = "text";
idInput.placeholder = "Discord ID";
idInput.setAttribute("aria-label", "Discord ID");
idInput.className = "notify-row-id";
idInput.placeholder = _notifyIdPlaceholder(ctSel.value);
idInput.setAttribute("aria-label", "Channel/user ID");
idInput.spellcheck = false;
if (targetId) idInput.value = targetId;
// Re-hint the ID input when the platform changes — e.g. Discord
// snowflakes vs Slack C…/U… ids.
ctSel.addEventListener("change", function () {
idInput.placeholder = _notifyIdPlaceholder(ctSel.value);
});
var removeBtn = document.createElement("button");
removeBtn.type = "button";
removeBtn.className = "notify-row-remove";
@@ -1151,6 +1221,7 @@ function _addNotifyRow(prefix, targetType, targetId) {
row.remove();
};
row.appendChild(ctSel);
row.appendChild(typeSel);
row.appendChild(idInput);
row.appendChild(removeBtn);
@@ -1164,10 +1235,13 @@ function _collectNotifyTargets(prefix) {
.querySelectorAll(".notify-row");
var targets = [];
for (var i = 0; i < rows.length; i++) {
var type = rows[i].querySelector("select").value;
var id = (rows[i].querySelector("input").value || "").trim();
var ct = (rows[i].querySelector(".notify-row-ct") || {}).value || "discord";
var type =
(rows[i].querySelector(".notify-row-target") || {}).value || "channel_id";
var idEl = rows[i].querySelector(".notify-row-id");
var id = ((idEl && idEl.value) || "").trim();
if (!id) continue;
var t = { channel_type: "discord" };
var t = { channel_type: ct };
t[type] = id;
targets.push(t);
}
@@ -1181,7 +1255,7 @@ function _populateNotifyRows(prefix, targets) {
targets.forEach(function (t) {
var targetType = "channel_id" in t ? "channel_id" : "user_id";
var targetId = t[targetType] || "";
_addNotifyRow(prefix, targetType, targetId);
_addNotifyRow(prefix, targetType, targetId, t.channel_type || "discord");
});
}
@@ -1768,13 +1842,19 @@ function showCreateChannelModal() {
var overlay = document.getElementById("create-channel-overlay");
overlay.style.display = "flex";
document.getElementById("create-channel-error").style.display = "none";
document.getElementById("cc-type").value = "discord";
document.getElementById("cc-uid").value = "";
var ctSel = document.getElementById("cc-type");
var uidInput = document.getElementById("cc-uid");
ctSel.value = "discord";
uidInput.value = "";
uidInput.placeholder = _notifyIdPlaceholder(ctSel.value);
ctSel.onchange = function () {
uidInput.placeholder = _notifyIdPlaceholder(ctSel.value);
};
document.getElementById("cc-submit").disabled = false;
document.getElementById("cc-submit").textContent = "Link";
_ccTrapHandler = _installTrap("create-channel-overlay", "create-channel-box");
setTimeout(function () {
document.getElementById("cc-uid").focus();
uidInput.focus();
}, 50);
}
@@ -2577,11 +2657,9 @@ function loadSettings() {
if (modelDefs[m].enabled) enabledAliases.push(modelDefs[m].alias);
}
if (enabledAliases.length > 1) {
if (merged["model.default_alias"]) {
merged["model.default_alias"].choices = enabledAliases;
}
if (merged["channels.default_model_alias"]) {
merged["channels.default_model_alias"].choices = enabledAliases;
for (var ak = 0; ak < ALIAS_SETTING_KEYS.length; ak++) {
var aliasKey = ALIAS_SETTING_KEYS[ak];
if (merged[aliasKey]) merged[aliasKey].choices = enabledAliases;
}
}
@@ -2757,11 +2835,10 @@ function _renderSettingRow(item) {
var label;
if (item.choices[c] !== "") {
label = escapeHtml(item.choices[c]);
} else if (
item.key === "model.default_alias" ||
item.key === "channels.default_model_alias"
) {
} else if (ALIAS_SETTING_KEYS.indexOf(item.key) !== -1) {
label = "(server default)";
} else if (INHERIT_EMPTY_LABEL_KEYS.indexOf(item.key) !== -1) {
label = "(inherit)";
} else {
label = "(none)";
}
+15 -10
View File
@@ -914,9 +914,10 @@ window.TURNSTONE_KB_SHORTCUTS = [
<label for="cc-type">Channel type</label>
<select id="cc-type">
<option value="discord">Discord</option>
<option value="slack">Slack</option>
</select>
<label for="cc-uid">External user ID <span class="label-hint">the user's ID on the platform</span></label>
<input id="cc-uid" type="text" placeholder="e.g. 123456789012345678" autocomplete="off" spellcheck="false">
<input id="cc-uid" type="text" autocomplete="off" spellcheck="false">
<div class="modal-buttons">
<button class="modal-cancel" onclick="hideCreateChannelModal()">Cancel</button>
<button id="cc-submit" class="modal-submit" onclick="submitCreateChannel()">Link</button>
@@ -1280,6 +1281,8 @@ window.TURNSTONE_KB_SHORTCUTS = [
<option value="low">Low</option>
<option value="medium">Medium</option>
<option value="high">High</option>
<option value="xhigh">Extra High</option>
<option value="max">Max</option>
</select>
</div>
<div><label for="csk-max-tokens">Max Tokens</label><input id="csk-max-tokens" type="number" min="1" placeholder="System default"></div>
@@ -1290,7 +1293,7 @@ window.TURNSTONE_KB_SHORTCUTS = [
<label for="csk-allowed-tools">Allowed Tools <span class="label-hint">comma-separated tool names for auto-approve</span></label>
<input id="csk-allowed-tools" type="text" placeholder="bash, read_file, write_file">
<label for="csk-notify-on-complete">Notify on completion <span class="label-hint">optional</span></label>
<textarea id="csk-notify-on-complete" rows="2" placeholder='[{"channel_type":"discord","channel_id":"123..."}]' spellcheck="false" aria-describedby="csk-notify-hint" style="font-family:var(--font-mono);font-size:12px"></textarea>
<textarea id="csk-notify-on-complete" rows="2" placeholder='[{"channel_type":"discord","channel_id":"123..."},{"channel_type":"slack","channel_id":"C0..."}]' spellcheck="false" aria-describedby="csk-notify-hint" style="font-family:var(--font-mono);font-size:12px"></textarea>
<span id="csk-notify-hint" class="label-hint" style="display:block;margin-top:3px">JSON array. Each: channel_type + channel_id or user_id</span>
<label class="admin-checkbox"><input id="csk-enabled" type="checkbox" checked> Enabled</label>
</details>
@@ -1399,6 +1402,8 @@ window.TURNSTONE_KB_SHORTCUTS = [
<option value="low">Low</option>
<option value="medium">Medium</option>
<option value="high">High</option>
<option value="xhigh">Extra High</option>
<option value="max">Max</option>
</select>
</div>
<div><label for="esk-max-tokens">Max Tokens</label><input id="esk-max-tokens" type="number" min="1" placeholder="System default"></div>
@@ -1409,7 +1414,7 @@ window.TURNSTONE_KB_SHORTCUTS = [
<label for="esk-allowed-tools">Allowed Tools <span class="label-hint">comma-separated tool names for auto-approve</span></label>
<input id="esk-allowed-tools" type="text" placeholder="bash, read_file, write_file">
<label for="esk-notify-on-complete">Notify on completion <span class="label-hint">optional</span></label>
<textarea id="esk-notify-on-complete" rows="2" placeholder='[{"channel_type":"discord","channel_id":"123..."}]' spellcheck="false" aria-describedby="esk-notify-hint" style="font-family:var(--font-mono);font-size:12px"></textarea>
<textarea id="esk-notify-on-complete" rows="2" placeholder='[{"channel_type":"discord","channel_id":"123..."},{"channel_type":"slack","channel_id":"C0..."}]' spellcheck="false" aria-describedby="esk-notify-hint" style="font-family:var(--font-mono);font-size:12px"></textarea>
<span id="esk-notify-hint" class="label-hint" style="display:block;margin-top:3px">JSON array. Each: channel_type + channel_id or user_id</span>
<label class="admin-checkbox"><input id="esk-enabled" type="checkbox" checked> Enabled</label>
</details>
@@ -1559,13 +1564,13 @@ window.TURNSTONE_KB_SHORTCUTS = [
<label for="model-reasoning-effort">Reasoning Effort <span style="font-weight:400;text-transform:none">(empty = use global default)</span></label>
<select id="model-reasoning-effort">
<option value="">Global default</option>
<option value="none">none</option>
<option value="minimal">minimal</option>
<option value="low">low</option>
<option value="medium">medium</option>
<option value="high">high</option>
<option value="xhigh">xhigh</option>
<option value="max">max</option>
<option value="none">None</option>
<option value="minimal">Minimal</option>
<option value="low">Low</option>
<option value="medium">Medium</option>
<option value="high">High</option>
<option value="xhigh">Extra High</option>
<option value="max">Max</option>
</select>
<div id="model-server-compat-section" style="display:none">
<div class="modal-section-divider" role="separator">Server Compatibility</div>
+21 -3
View File
@@ -988,7 +988,13 @@
}
.scope-write { color: var(--cyan); border-color: rgba(103, 232, 249, 0.2); }
.scope-approve { color: var(--accent); border-color: var(--accent-dim); }
.scope-channel { color: var(--magenta); border-color: rgba(192, 132, 252, 0.25); }
/* Per-platform channel badges first a row uses scope-discord OR
scope-slack OR (for unknown platforms) the generic scope-channel
fallback below. Source order matters less now that the per-platform
classes are exclusive of scope-channel; keeping it tidy regardless. */
.scope-discord { color: var(--discord); border-color: var(--discord-glow); }
.scope-slack { color: var(--slack); border-color: var(--slack-glow); }
.scope-channel { color: var(--magenta); border-color: var(--magenta-glow); }
.scope-mcp { color: var(--magenta); border-color: rgba(192, 132, 252, 0.25); }
.scope-deny { color: var(--red); border-color: rgba(255, 80, 80, 0.25); }
.scope-scan-safe { color: var(--green); border-color: var(--green-glow); }
@@ -1227,20 +1233,32 @@
.admin-inline-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.notify-row {
display: flex; gap: 6px; margin-bottom: 4px; align-items: center;
flex-wrap: wrap;
}
.notify-row select, .notify-row input {
padding: 7px 8px;
background: var(--bg); border: 1px solid var(--border-strong);
border-radius: var(--radius-sm); color: var(--fg); font: inherit; font-size: 12px;
}
.notify-row select { width: 90px; flex-shrink: 0; }
.notify-row input { flex: 1; min-width: 0; }
/* Tighter platform select — labels are short ("Discord"/"Slack") */
.notify-row-ct { width: 76px; flex-shrink: 0; }
.notify-row-target { width: 90px; flex-shrink: 0; }
.notify-row-id { flex: 1 1 140px; min-width: 0; }
/* Older rows that didn't get the per-element classes still need to size */
.notify-row select:not([class*="notify-row-"]) { width: 90px; flex-shrink: 0; }
.notify-row input:not([class*="notify-row-"]) { flex: 1; min-width: 0; }
.notify-row-remove {
background: none; border: none; color: var(--fg-dim); cursor: pointer;
font-size: 16px; padding: 0 4px; line-height: 1; flex-shrink: 0;
}
.notify-row-remove:hover { color: var(--red); }
.notify-row-remove:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
/* Narrow viewports drop the ID input to its own line so snowflakes
and Slack ids aren't truncated to ~80px on phones. */
@media (max-width: 700px) {
.notify-row-id { flex-basis: 100%; order: 3; }
.notify-row-remove { order: 2; margin-left: auto; }
}
.admin-details { margin-top: 12px; border: 1px solid var(--border); border-radius: 6px; padding: 0 12px; }
.admin-details[open] { padding-bottom: 12px; }
+16
View File
@@ -219,6 +219,22 @@ def unreserve_attachments(queue_msg_id: str, ws_id: str, user_id: str) -> None:
log.warning("Failed to unreserve attachments", exc_info=True)
def sweep_orphan_reservations(older_than_seconds: int) -> int:
"""Clear ``reserved_for_msg_id`` on stale attachment rows.
Defensive cleanup for reservations leaked by process crashes between
``reserve_attachments`` and ``mark_attachments_consumed`` /
``unreserve_attachments``. Returns count of rows swept.
"""
if older_than_seconds <= 0:
return 0
try:
return get_storage().sweep_orphan_reservations(older_than_seconds)
except Exception:
log.warning("Failed to sweep orphan reservations", exc_info=True)
return 0
def load_attachments_for_messages(ws_id: str) -> dict[int, list[dict[str, Any]]]:
"""Return attachments grouped by ``message_id`` for history replay."""
try:
+117 -4
View File
@@ -56,7 +56,16 @@ class ModelRegistry:
models: Mapping of alias ModelConfig.
default: Alias of the default model.
fallback: Ordered list of aliases to try when the primary model fails.
agent_model: Optional alias for plan/task sub-agents.
agent_model: Optional alias for plan/task sub-agents (single-knob
fallback used when ``plan_model``/``task_model`` are unset).
plan_model: Optional alias for the plan_agent sub-agent. Overrides
``agent_model`` for plan calls; falls back to it when unset.
task_model: Optional alias for the task_agent sub-agent. Overrides
``agent_model`` for task calls; falls back to it when unset.
plan_effort: Reasoning effort for plan_agent. ``None`` means use the
built-in default of ``"high"`` (preserves prior behaviour).
task_effort: Reasoning effort for task_agent. ``None`` means inherit
the parent session's reasoning effort.
"""
def __init__(
@@ -65,6 +74,10 @@ class ModelRegistry:
default: str,
fallback: list[str] | None = None,
agent_model: str | None = None,
plan_model: str | None = None,
task_model: str | None = None,
plan_effort: str | None = None,
task_effort: str | None = None,
) -> None:
if not models:
raise ValueError("ModelRegistry requires at least one model config")
@@ -76,11 +89,19 @@ class ModelRegistry:
raise ValueError(f"Fallback model '{alias}' not found in registry")
if agent_model and agent_model not in models:
raise ValueError(f"Agent model '{agent_model}' not found in registry")
if plan_model and plan_model not in models:
raise ValueError(f"Plan model '{plan_model}' not found in registry")
if task_model and task_model not in models:
raise ValueError(f"Task model '{task_model}' not found in registry")
self._models = dict(models)
self.default = default
self.fallback = list(fallback) if fallback else []
self.agent_model = agent_model
self.plan_model = plan_model
self.task_model = task_model
self.plan_effort = plan_effort
self.task_effort = task_effort
self._clients: dict[str, Any] = {}
self._providers: dict[str, LLMProvider] = {}
self._client_lock = threading.Lock()
@@ -132,6 +153,40 @@ class ModelRegistry:
cfg = self.get_config(alias)
return self.get_client(alias), cfg.model, cfg
def resolve_agent_alias(self, kind: str) -> str | None:
"""Return the configured alias for a sub-agent ``kind``.
Per-kind overrides (``plan_model``/``task_model``) win over the
legacy single-knob ``agent_model``. Returns ``None`` when nothing
is configured (caller should fall back to the session model).
Recognised kinds: ``"plan"``, ``"task"``. Any other value (e.g.
``"agent"``, eval/utility paths) returns the legacy ``agent_model``
as-is preserves prior behaviour for non-plan/task callers.
"""
if kind == "plan":
return self.plan_model or self.agent_model
if kind == "task":
return self.task_model or self.agent_model
return self.agent_model
# Built-in default effort for plan_agent — preserves the value the three
# plan call sites used to pass explicitly before the split.
PLAN_DEFAULT_EFFORT = "high"
def resolve_agent_effort(self, kind: str) -> str | None:
"""Return the reasoning effort for a sub-agent ``kind``.
Plan defaults to :attr:`PLAN_DEFAULT_EFFORT` (back-compat with the
previously hardcoded ``"high"``). Task returns ``None`` to indicate
the caller should fall through to the session default.
"""
if kind == "plan":
return self.plan_effort or self.PLAN_DEFAULT_EFFORT
if kind == "task":
return self.task_effort
return None
@property
def count(self) -> int:
"""Number of registered models."""
@@ -150,6 +205,10 @@ class ModelRegistry:
default: str,
fallback: list[str] | None = None,
agent_model: str | None = None,
plan_model: str | None = None,
task_model: str | None = None,
plan_effort: str | None = None,
task_effort: str | None = None,
) -> None:
"""Hot-reload all model configs. Thread-safe; clears cached clients.
@@ -166,11 +225,19 @@ class ModelRegistry:
raise ValueError(f"Fallback model '{alias}' not found in registry")
if agent_model and agent_model not in models:
raise ValueError(f"Agent model '{agent_model}' not found in registry")
if plan_model and plan_model not in models:
raise ValueError(f"Plan model '{plan_model}' not found in registry")
if task_model and task_model not in models:
raise ValueError(f"Task model '{task_model}' not found in registry")
with self._client_lock:
self._models = dict(models)
self.default = default
self.fallback = list(fallback) if fallback else []
self.agent_model = agent_model
self.plan_model = plan_model
self.task_model = task_model
self.plan_effort = plan_effort
self.task_effort = task_effort
for client in self._clients.values():
if hasattr(client, "close"):
client.close()
@@ -245,8 +312,11 @@ def load_model_registry(
*storage* is provided.
3. CLI ``--base-url`` / ``--api-key`` / ``--model`` always create a
``"default"`` entry.
4. ``[model].default``, ``[model].fallback``, ``[model].agent_model``
control routing.
4. ``[model].default``, ``[model].fallback``, ``[model].agent_model``,
``[model].plan_model``, ``[model].task_model``,
``[model].plan_effort``, ``[model].task_effort`` control routing.
``plan_model``/``task_model`` override ``agent_model`` per sub-agent
role; both fall back to it when unset.
"""
import json as _json
@@ -406,17 +476,60 @@ def load_model_registry(
else:
log.warning("Fallback alias '%s' not found in models, ignoring", alias)
# Agent model
# Agent model (legacy single-knob shared between plan_agent and task_agent)
agent_model = model_section.get("agent_model")
if agent_model and agent_model not in configs:
log.warning("Configured agent_model '%s' not found, ignoring", agent_model)
agent_model = None
# Per-kind sub-agent models — override agent_model for each role
plan_model = model_section.get("plan_model")
if plan_model and plan_model not in configs:
log.warning("Configured plan_model '%s' not found, ignoring", plan_model)
plan_model = None
task_model = model_section.get("task_model")
if task_model and task_model not in configs:
log.warning("Configured task_model '%s' not found, ignoring", task_model)
task_model = None
# Per-kind reasoning effort. None means: plan defaults to "high" (back-
# compat with the previous hardcoded value); task inherits the session.
# Typos in config.toml shouldn't silently flow to the provider — log and
# drop unknown values, mirroring the model-not-found warning above.
valid_efforts = {"none", "minimal", "low", "medium", "high", "xhigh", "max"}
def _validate_effort(value: Any, key: str) -> str | None:
if value is None:
return None
# Treat empty / whitespace as unset. Operators commonly write
# `plan_effort = ""` to make "leave it default" explicit; warning
# on that benign case would just be noise.
coerced = str(value).strip().lower()
if not coerced:
return None
if coerced not in valid_efforts:
log.warning(
"Configured %s '%s' is not a recognised effort level "
"(expected one of %s), ignoring",
key,
coerced,
sorted(valid_efforts),
)
return None
return coerced
plan_effort = _validate_effort(model_section.get("plan_effort"), "plan_effort")
task_effort = _validate_effort(model_section.get("task_effort"), "task_effort")
return ModelRegistry(
models=configs,
default=default_alias,
fallback=fallback,
agent_model=agent_model,
plan_model=plan_model,
task_model=task_model,
plan_effort=plan_effort,
task_effort=task_effort,
)
+23 -5
View File
@@ -83,6 +83,19 @@ _ANTHROPIC_DEFAULT = ModelCapabilities(
)
_ANTHROPIC_CAPABILITIES: dict[str, ModelCapabilities] = {
"claude-opus-4-7": ModelCapabilities(
context_window=1000000,
max_output_tokens=128000,
token_param="max_tokens",
thinking_mode="adaptive",
supports_effort=True,
effort_levels=("low", "medium", "high", "xhigh", "max"),
supports_web_search=True,
supports_tool_search=True,
supports_vision=True,
supports_temperature=False,
thinking_display="summarized",
),
"claude-opus-4-6": ModelCapabilities(
context_window=1000000,
max_output_tokens=128000,
@@ -139,7 +152,7 @@ def _map_reasoning_to_effort(
valid_levels: tuple[str, ...],
) -> str | None:
"""Map turnstone reasoning_effort to Anthropic effort parameter."""
mapping = {"low": "low", "medium": "medium", "high": "high", "max": "max"}
mapping = {"low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh", "max": "max"}
effort = mapping.get(reasoning_effort)
if effort and effort in valid_levels:
return effort
@@ -226,8 +239,12 @@ class AnthropicProvider:
"""Build the full kwargs dict with thinking mode and effort params."""
thinking_params: dict[str, Any] = {}
if caps.thinking_mode == "adaptive":
thinking_params = {"thinking": {"type": "adaptive"}}
temperature = 1.0 # Required with thinking
thinking_dict: dict[str, Any] = {"type": "adaptive"}
if caps.thinking_display:
thinking_dict["display"] = caps.thinking_display
thinking_params = {"thinking": thinking_dict}
if caps.supports_temperature:
temperature = 1.0 # Required with thinking
elif caps.thinking_mode == "manual":
thinking_params = self._reasoning_params(reasoning_effort, extra_params, max_tokens)
if thinking_params:
@@ -237,12 +254,13 @@ class AnthropicProvider:
"model": model,
"messages": converted_msgs,
caps.token_param: max_tokens,
"temperature": temperature,
# Automatic prompt caching — the API places the cache breakpoint
# on the last cacheable block and advances it as conversation grows.
# 90% input cost reduction on cache hits; 1.25x write on first turn.
"cache_control": {"type": "ephemeral"},
}
if caps.supports_temperature:
kwargs["temperature"] = temperature
if system_prompt:
kwargs["system"] = system_prompt
if tools:
@@ -252,7 +270,7 @@ class AnthropicProvider:
kwargs["tools"] = anthropic_tools
kwargs.update(thinking_params)
# Effort param for models that support it (Opus 4.6, Sonnet 4.6, Opus 4.5)
# Effort param for models that support it (Opus 4.7, Opus 4.6, Sonnet 4.6, Opus 4.5)
if caps.supports_effort and reasoning_effort:
effort = _map_reasoning_to_effort(reasoning_effort, caps.effort_levels)
if effort:
+1
View File
@@ -87,6 +87,7 @@ class ModelCapabilities:
supports_tool_search: bool = False
supports_vision: bool = False
supports_tool_advisories: bool = True
thinking_display: str = "" # "summarized" for models that omit thinking by default
def _lookup_capabilities(
+142 -11
View File
@@ -12,6 +12,7 @@ import base64
import collections
import concurrent.futures
import contextlib
import copy
import dataclasses
import difflib
import hashlib
@@ -456,6 +457,11 @@ class ChatSession:
self._tools = TOOLS
self._task_tools = TASK_AGENT_TOOLS
self._agent_tools = AGENT_TOOLS
# Inject the live alias list into plan_agent / task_agent tool
# descriptions so the calling LLM sees its `model` parameter options.
# Replaces affected tool dicts with deep copies — module-level
# constants are not mutated.
self._render_agent_tool_descriptions()
# Web search backend (pluggable: auto/tavily/ddg/mcp:server:tool)
self._web_search_backend = web_search_backend
# Dynamic tool search: defer MCP tools when tool count is high
@@ -780,8 +786,69 @@ class ChatSession:
self._tools = merge_mcp_tools(TOOLS, mcp_tools)
self._task_tools = merge_mcp_tools(TASK_AGENT_TOOLS, mcp_tools)
self._agent_tools = merge_mcp_tools(AGENT_TOOLS, mcp_tools)
self._render_agent_tool_descriptions()
self._rebuild_tool_search()
def _render_agent_tool_descriptions(self) -> None:
"""Inject the live alias list into the ``model`` parameter description
on plan_agent / task_agent tools.
Lets the calling LLM see which aliases are valid right now.
Called on session init and on registry reload (via
``refresh_agent_tool_schemas``). No-op when no registry is
configured (CLI single-model case).
Replaces affected tool dicts with deep copies so the module-level
``TOOLS`` constant stays untouched across sessions.
plan_agent and task_agent live in ``self._tools`` (the main session's
tool set) not in ``self._agent_tools`` / ``self._task_tools``,
which are what *sub-agents* see (sub-agents don't get delegation
tools to avoid infinite recursion).
"""
if self._registry is None:
return
aliases = sorted(self._registry.list_aliases())
if not aliases:
return
aliases_str = ", ".join(f"`{a}`" for a in aliases)
new_tools: list[dict[str, Any]] = []
for tool in self._tools:
fn = tool.get("function") or {}
name = fn.get("name", "")
if name not in ("plan_agent", "task_agent"):
new_tools.append(tool)
continue
kind = "plan model" if name == "plan_agent" else "task model"
new_tool = copy.deepcopy(tool)
props = new_tool.get("function", {}).get("parameters", {}).get("properties", {})
if "model" in props:
props["model"]["description"] = (
f"Optional model alias to run this {name} on. "
f"Omit to use the operator-configured {kind}. "
f"Available aliases: {aliases_str}."
)
new_tools.append(new_tool)
self._tools = new_tools
def refresh_agent_tool_schemas(self) -> None:
"""Public entry point: re-render plan_agent / task_agent tool
descriptions to reflect the current ModelRegistry state, and
rebuild the BM25 tool-search index so its text matches.
Called by the server after a registry reload (sync-to-nodes /
admin model edits) so active sessions pick up the new alias
list on their next LLM turn.
``_on_mcp_tools_changed`` calls ``_render_agent_tool_descriptions``
directly (not this) because it already rebuilds the tool-search
index right after calling this wrapper would do that twice.
"""
self._render_agent_tool_descriptions()
if getattr(self, "_tool_search", None) is not None:
self._rebuild_tool_search()
def _on_mcp_resources_changed(self) -> None:
"""Callback from MCPClientManager when the resource list changes.
@@ -4476,6 +4543,35 @@ class ChatSession:
output = self._tool_search.format_search_results(results)
return item["call_id"], output
def _validate_agent_model_override(
self, call_id: str, func_name: str, args: dict[str, Any]
) -> tuple[str | None, dict[str, Any] | None]:
"""Pull and validate the optional `model` arg for plan/task agents.
Returns (alias, error_item). When the caller passed a `model` and
it isn't in the registry, returns an error_item shaped like the
existing _prepare_* error dicts so the LLM gets corrective guidance
and retries. When no override was passed, returns (None, None).
"""
raw = args.get("model")
if raw is None or raw == "":
return None, None
alias = str(raw).strip()
if not alias:
return None, None
if self._registry is None or not self._registry.has_alias(alias):
available = sorted(self._registry.list_aliases()) if self._registry is not None else []
available_str = ", ".join(available) if available else "(no registry configured)"
return None, {
"call_id": call_id,
"func_name": func_name,
"header": f"\u2717 {func_name}: unknown model alias",
"preview": "",
"needs_approval": False,
"error": f"Error: unknown model alias '{alias}'. Available: {available_str}",
}
return alias, None
def _prepare_task(self, call_id: str, args: dict[str, Any]) -> dict[str, Any]:
"""Prepare a general-purpose sub-agent task for approval."""
prompt = (args.get("prompt") or "").strip()
@@ -4488,6 +4584,9 @@ class ChatSession:
"needs_approval": False,
"error": "Error: empty prompt",
}
model_override, err = self._validate_agent_model_override(call_id, "task_agent", args)
if err is not None:
return err
preview_text = prompt[:300] + ("..." if len(prompt) > 300 else "")
return {
"call_id": call_id,
@@ -4498,6 +4597,7 @@ class ChatSession:
"approval_label": "task_agent",
"execute": self._exec_task,
"prompt": prompt,
"model_override": model_override,
}
def _prepare_plan(self, call_id: str, args: dict[str, Any]) -> dict[str, Any]:
@@ -4512,6 +4612,9 @@ class ChatSession:
"needs_approval": False,
"error": "Error: empty goal",
}
model_override, err = self._validate_agent_model_override(call_id, "plan_agent", args)
if err is not None:
return err
preview_text = goal[:300] + ("..." if len(goal) > 300 else "")
return {
"call_id": call_id,
@@ -4522,6 +4625,7 @@ class ChatSession:
"approval_label": "plan_agent",
"execute": self._exec_plan,
"prompt": goal,
"model_override": model_override,
}
def _resolve_scope_id(self, scope: str) -> str:
@@ -5651,6 +5755,7 @@ class ChatSession:
tools: list[dict[str, Any]] | None = None,
auto_tools: set[str] | None = None,
reasoning_effort: str | None = None,
agent_alias: str | None = None,
) -> str:
"""Run an autonomous agent loop.
@@ -5660,6 +5765,11 @@ class ChatSession:
tools: Tool definitions to send to the API. Defaults to AGENT_TOOLS (read-only).
auto_tools: Set of tool names the agent may execute. Defaults to AGENT_AUTO_TOOLS.
reasoning_effort: Override reasoning effort for this agent.
agent_alias: Per-call model alias override (the LLM passed
``model="<alias>"`` to plan_agent/task_agent). Wins over
the registry's per-kind resolution when set. Caller is
expected to have validated the alias against the registry;
an unknown alias here raises ``ValueError``.
Returns:
Final content string from the agent.
@@ -5670,16 +5780,36 @@ class ChatSession:
auto_tools = AGENT_AUTO_TOOLS
max_tool_turns = self.agent_max_turns
# Resolve agent model and provider: use registry.agent_model if configured
agent_client = self.client
agent_model = self.model
agent_provider = self._provider
if self._registry and self._registry.agent_model:
agent_client, agent_model, _ = self._registry.resolve(self._registry.agent_model)
agent_provider = self._registry.get_provider(self._registry.agent_model)
# Resolve agent model: explicit per-call override wins, then per-kind
# registry override (plan_model/task_model), then the legacy single-
# knob agent_model, then the session's primary model.
if agent_alias is not None:
if self._registry is None or not self._registry.has_alias(agent_alias):
raise ValueError(f"Unknown agent_alias '{agent_alias}'")
else:
agent_alias = self._registry.resolve_agent_alias(label) if self._registry else None
if self._registry and agent_alias:
agent_client, agent_model, _ = self._registry.resolve(agent_alias)
agent_provider = self._registry.get_provider(agent_alias)
else:
agent_client = self.client
agent_model = self.model
agent_provider = self._provider
# Per-kind reasoning effort. Explicit caller arg wins; otherwise
# delegate to the registry which knows the per-kind default (plan
# gets the back-compat "high", task returns None to inherit the
# session). When no registry exists, apply the plan back-compat
# default directly so single-process callers keep prior behaviour.
if reasoning_effort is None:
if self._registry:
reasoning_effort = self._registry.resolve_agent_effort(label)
elif label == "plan":
from turnstone.core.model_registry import ModelRegistry
reasoning_effort = ModelRegistry.PLAN_DEFAULT_EFFORT
# Gate web_search: remove when no backend exists for the agent model
agent_alias = self._registry.agent_model if self._registry else None
agent_caps = self._resolve_capabilities(agent_provider, agent_model, agent_alias)
if not agent_caps.supports_web_search and not self._resolve_search_client():
tools = _without_tool(tools, "web_search")
@@ -5881,6 +6011,7 @@ class ChatSession:
label="task",
tools=self._task_tools,
auto_tools=TASK_AUTO_TOOLS,
agent_alias=item.get("model_override"),
)
except (KeyboardInterrupt, GenerationCancelled):
return call_id, "(task interrupted by user)"
@@ -5995,11 +6126,12 @@ class ChatSession:
agent_messages.extend(prior_plan_msgs)
agent_messages.append({"role": "user", "content": prompt})
plan_alias = item.get("model_override")
try:
content = self._run_agent(
agent_messages,
label="plan",
reasoning_effort="high",
agent_alias=plan_alias,
)
except (KeyboardInterrupt, GenerationCancelled):
return call_id, "(plan interrupted by user)"
@@ -6029,7 +6161,7 @@ class ChatSession:
content = self._run_agent(
agent_messages,
label="plan",
reasoning_effort="high",
agent_alias=plan_alias,
)
except (KeyboardInterrupt, GenerationCancelled):
return call_id, "(plan interrupted by user)"
@@ -6097,7 +6229,6 @@ class ChatSession:
content = self._run_agent(
agent_messages,
label="plan",
reasoning_effort="high",
)
valid, issues = self._validate_plan(content, original_goal)
+48
View File
@@ -83,6 +83,54 @@ def _build_registry() -> dict[str, SettingDef]:
"Higher effort improves quality on complex tasks but is slower and uses more "
"tokens. Per-model overrides can be set in the Models tab.",
),
SettingDef(
"model.plan_alias",
"str",
"",
"Model alias for plan_agent (empty = inherit from config / session)",
"model",
help="Which model the plan_agent sub-agent uses. When empty, falls back to "
"[model].plan_model in config.toml, then [model].agent_model, then the session "
"model. Plan_agent runs rarely but benefits from a stronger model for "
"high-quality plans \u2014 point this at your strongest reasoner.",
),
SettingDef(
"model.task_alias",
"str",
"",
"Model alias for task_agent (empty = inherit from config / session)",
"model",
help="Which model the task_agent sub-agent uses. When empty, falls back to "
"[model].task_model in config.toml, then [model].agent_model, then the session "
"model. Task_agent fires frequently for autonomous subtasks \u2014 point this "
"at a cheaper/faster model than your plan_agent.",
),
SettingDef(
"model.plan_effort",
"str",
"",
"Reasoning effort for plan_agent (empty = inherit from config; default \u2018high\u2019)",
"model",
choices=["", "none", "minimal", "low", "medium", "high", "xhigh", "max"],
help="Reasoning effort for plan_agent specifically. When empty, falls back to "
"[model].plan_effort in config.toml, then to the built-in default \u2018high\u2019. "
"Use \u2018xhigh\u2019 or \u2018max\u2019 with models that support deeper reasoning "
"for higher-quality plans. (Empty here means \u201cinherit\u201d \u2014 use "
"\u2018none\u2019 to actually disable reasoning.)",
),
SettingDef(
"model.task_effort",
"str",
"",
"Reasoning effort for task_agent (empty = inherit from config / session)",
"model",
choices=["", "none", "minimal", "low", "medium", "high", "xhigh", "max"],
help="Reasoning effort for task_agent specifically. When empty, falls back to "
"[model].task_effort in config.toml, then inherits the session\u2019s effort. "
"Set to \u2018low\u2019 or \u2018minimal\u2019 if your task_agent runs many "
"fast subtasks where deep reasoning is wasteful. (Empty here means \u201cinherit\u201d "
"\u2014 use \u2018none\u2019 to actually disable reasoning.)",
),
# -- session --------------------------------------------------------
SettingDef(
"session.instructions",
+30 -3
View File
@@ -669,7 +669,11 @@ class PostgreSQLBackend:
conn.execute(
sa.update(workstream_attachments)
.where(predicate)
.values(message_id=message_id, reserved_for_msg_id=None)
.values(
message_id=message_id,
reserved_for_msg_id=None,
reserved_at=None,
)
)
conn.commit()
@@ -682,6 +686,7 @@ class PostgreSQLBackend:
) -> list[str]:
if not attachment_ids or not queue_msg_id:
return []
now = datetime.now(UTC).strftime("%Y-%m-%dT%H:%M:%S")
with self._conn() as conn:
conn.execute(
sa.update(workstream_attachments)
@@ -694,7 +699,7 @@ class PostgreSQLBackend:
workstream_attachments.c.reserved_for_msg_id.is_(None),
)
)
.values(reserved_for_msg_id=queue_msg_id)
.values(reserved_for_msg_id=queue_msg_id, reserved_at=now)
)
rows = conn.execute(
sa.select(workstream_attachments.c.attachment_id).where(
@@ -722,10 +727,32 @@ class PostgreSQLBackend:
workstream_attachments.c.reserved_for_msg_id == queue_msg_id,
)
)
.values(reserved_for_msg_id=None)
.values(reserved_for_msg_id=None, reserved_at=None)
)
conn.commit()
def sweep_orphan_reservations(self, older_than_seconds: int) -> int:
if older_than_seconds <= 0:
return 0
cutoff = (datetime.now(UTC) - timedelta(seconds=older_than_seconds)).strftime(
"%Y-%m-%dT%H:%M:%S"
)
with self._conn() as conn:
result = conn.execute(
sa.update(workstream_attachments)
.where(
sa.and_(
workstream_attachments.c.reserved_for_msg_id.is_not(None),
workstream_attachments.c.message_id.is_(None),
workstream_attachments.c.reserved_at.is_not(None),
workstream_attachments.c.reserved_at < cutoff,
)
)
.values(reserved_for_msg_id=None, reserved_at=None)
)
conn.commit()
return int(result.rowcount or 0)
def load_attachments_for_messages(self, ws_id: str) -> dict[int, list[dict[str, Any]]]:
with self._conn() as conn:
rows = conn.execute(
+16
View File
@@ -148,6 +148,22 @@ class StorageBackend(Protocol):
"""
...
def sweep_orphan_reservations(self, older_than_seconds: int) -> int:
"""Clear ``reserved_for_msg_id`` on stale reservations.
Targets rows with ``reserved_for_msg_id IS NOT NULL`` AND
``message_id IS NULL`` AND ``reserved_at`` older than the cutoff.
Self-heals reservations leaked by process crashes between
``reserve_attachments`` and ``mark_attachments_consumed`` /
``unreserve_attachments``.
Uses ``reserved_at`` (set on reserve, cleared on consume /
unreserve) rather than ``created`` (upload time) so an attachment
that sat pending for hours before being reserved is not
mistakenly unreserved mid-send. Returns the row count swept.
"""
...
def load_attachments_for_messages(self, ws_id: str) -> dict[int, list[dict[str, Any]]]:
"""Return attachments grouped by ``message_id`` for history replay.
+13
View File
@@ -431,6 +431,11 @@ workstream_attachments = sa.Table(
# reserved : message_id IS NULL AND reserved_for_msg_id = <queue-msg-id>
# consumed : message_id IS NOT NULL (reservation cleared on transition)
sa.Column("reserved_for_msg_id", sa.Text, nullable=True),
# When the row last transitioned into reserved state. Cleared on
# consume / unreserve. Set independently of `created` (upload time)
# so the orphan-reservation sweep can target only reservations that
# have actually been held longer than the threshold.
sa.Column("reserved_at", sa.Text, nullable=True),
sa.Column("created", sa.Text, nullable=False),
)
@@ -448,6 +453,14 @@ sa.Index(
workstream_attachments.c.user_id,
workstream_attachments.c.reserved_for_msg_id,
)
# Partial index — only reserved rows participate, so the sweep scan
# stays cheap as the consumed-history grows.
sa.Index(
"idx_ws_attachments_reserved_at",
workstream_attachments.c.reserved_at,
sqlite_where=workstream_attachments.c.reserved_at.is_not(None),
postgresql_where=workstream_attachments.c.reserved_at.is_not(None),
)
# ---------------------------------------------------------------------------
# Skill versions — version history for skills
+30 -3
View File
@@ -764,7 +764,11 @@ class SQLiteBackend:
conn.execute(
sa.update(workstream_attachments)
.where(predicate)
.values(message_id=message_id, reserved_for_msg_id=None)
.values(
message_id=message_id,
reserved_for_msg_id=None,
reserved_at=None,
)
)
conn.commit()
@@ -777,6 +781,7 @@ class SQLiteBackend:
) -> list[str]:
if not attachment_ids or not queue_msg_id:
return []
now = datetime.now(UTC).strftime("%Y-%m-%dT%H:%M:%S")
with self._conn() as conn:
conn.execute(
sa.update(workstream_attachments)
@@ -789,7 +794,7 @@ class SQLiteBackend:
workstream_attachments.c.reserved_for_msg_id.is_(None),
)
)
.values(reserved_for_msg_id=queue_msg_id)
.values(reserved_for_msg_id=queue_msg_id, reserved_at=now)
)
# Echo back which ids are now reserved for this msg id (race-
# safe confirmation for the caller).
@@ -819,10 +824,32 @@ class SQLiteBackend:
workstream_attachments.c.reserved_for_msg_id == queue_msg_id,
)
)
.values(reserved_for_msg_id=None)
.values(reserved_for_msg_id=None, reserved_at=None)
)
conn.commit()
def sweep_orphan_reservations(self, older_than_seconds: int) -> int:
if older_than_seconds <= 0:
return 0
cutoff = (datetime.now(UTC) - timedelta(seconds=older_than_seconds)).strftime(
"%Y-%m-%dT%H:%M:%S"
)
with self._conn() as conn:
result = conn.execute(
sa.update(workstream_attachments)
.where(
sa.and_(
workstream_attachments.c.reserved_for_msg_id.is_not(None),
workstream_attachments.c.message_id.is_(None),
workstream_attachments.c.reserved_at.is_not(None),
workstream_attachments.c.reserved_at < cutoff,
)
)
.values(reserved_for_msg_id=None, reserved_at=None)
)
conn.commit()
return int(result.rowcount or 0)
def load_attachments_for_messages(self, ws_id: str) -> dict[int, list[dict[str, Any]]]:
with self._conn() as conn:
rows = conn.execute(
@@ -0,0 +1,49 @@
"""Add reserved_at column to workstream_attachments.
The orphan-reservation sweep (see ``sweep_orphan_reservations``) needs a
staleness signal that reflects *reservation* age, not *upload* age. Using
``created`` (upload time) as a proxy can incorrectly clear active
reservations for attachments that sit pending a long time before being
reserved a real race when a user uploads a file, returns hours later,
then sends. ``reserved_at`` is set on ``reserve_attachments`` and cleared
on ``mark_attachments_consumed`` / ``unreserve_attachments``, so the sweep
can target only reservations that have actually been held longer than the
configured threshold.
A partial index on ``(reserved_at)`` keeps the periodic scan cheap as the
table grows; pending and consumed rows (NULL reserved_at) don't bloat it.
Revision ID: 038
Revises: 037
Create Date: 2026-04-16
"""
import sqlalchemy as sa
from alembic import op
revision = "038"
down_revision = "037"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column(
"workstream_attachments",
sa.Column("reserved_at", sa.Text, nullable=True),
)
# Partial index — only reserved rows participate, so the sweep scan
# stays small even as the consumed-history grows. SQLite supports
# partial indexes with the same syntax as PostgreSQL.
op.create_index(
"idx_ws_attachments_reserved_at",
"workstream_attachments",
["reserved_at"],
postgresql_where=sa.text("reserved_at IS NOT NULL"),
sqlite_where=sa.text("reserved_at IS NOT NULL"),
)
def downgrade() -> None:
op.drop_index("idx_ws_attachments_reserved_at", table_name="workstream_attachments")
op.drop_column("workstream_attachments", "reserved_at")
+114
View File
@@ -37,6 +37,120 @@ async def read_json_or_400(request: Request) -> dict[str, Any] | JSONResponse:
return _JSONResponse({"error": "Failed to read request body"}, status_code=500)
async def read_multipart_create_or_400(
request: Request,
*,
meta_field: str = "meta",
file_field: str = "file",
max_files: int = 10,
max_per_file_bytes: int | None = None,
max_total_bytes: int | None = None,
) -> tuple[dict[str, Any], list[tuple[str, str, bytes]]] | JSONResponse:
"""Parse a multipart create-with-attachments body.
Expects one ``meta`` field (JSON-encoded object with create metadata)
and zero-or-more ``file`` parts (standard UploadFile objects). Returns
``(meta_dict, [(filename, content_type, bytes), ...])`` on success or a
``JSONResponse`` (400/413) on failure.
Enforces a cheap ``Content-Length`` pre-check against *max_total_bytes*
when the header is sensible, and (when ``max_per_file_bytes`` is set) a
generic per-file cap as a defense-in-depth gate. The caller still
classifies each file and applies any kind-specific cap on top.
"""
from starlette.datastructures import UploadFile
from starlette.responses import JSONResponse as _JSONResponse
if max_total_bytes is not None:
cl_raw = request.headers.get("content-length")
if cl_raw:
try:
cl = int(cl_raw)
except ValueError:
cl = -1
if cl > int(max_total_bytes * 1.1):
return _JSONResponse(
{
"error": (
f"Request body too large ({cl:,} bytes by Content-Length); "
f"cap is {max_total_bytes:,} bytes."
),
"code": "too_large",
},
status_code=413,
)
try:
form = await request.form()
except Exception:
import structlog
structlog.get_logger(__name__).warning(
"read_multipart_create_or_400.parse_failed", exc_info=True
)
return _JSONResponse({"error": "Invalid multipart body"}, status_code=400)
meta_raw = form.get(meta_field)
if not isinstance(meta_raw, str):
return _JSONResponse({"error": f"Missing '{meta_field}' JSON field"}, status_code=400)
try:
meta: dict[str, Any] = json.loads(meta_raw)
except (ValueError, json.JSONDecodeError):
return _JSONResponse({"error": f"'{meta_field}' field must be valid JSON"}, status_code=400)
if not isinstance(meta, dict):
return _JSONResponse({"error": f"'{meta_field}' must be a JSON object"}, status_code=400)
uploads = [v for v in form.getlist(file_field) if isinstance(v, UploadFile)]
if len(uploads) > max_files:
return _JSONResponse(
{
"error": (f"Too many files ({len(uploads)}); max {max_files} per request"),
"code": "too_many",
},
status_code=400,
)
files: list[tuple[str, str, bytes]] = []
running_total = 0
try:
for upload in uploads:
filename = upload.filename or ""
content_type = upload.content_type or "application/octet-stream"
try:
data = await upload.read()
except Exception:
return _JSONResponse({"error": "Failed to read upload"}, status_code=400)
if max_per_file_bytes is not None and len(data) > max_per_file_bytes:
return _JSONResponse(
{
"error": (
f"File too large ({len(data):,} bytes); "
f"cap is {max_per_file_bytes:,} bytes."
),
"code": "too_large",
},
status_code=413,
)
running_total += len(data)
if max_total_bytes is not None and running_total > max_total_bytes:
return _JSONResponse(
{
"error": (
f"Request body too large ({running_total:,} bytes total); "
f"cap is {max_total_bytes:,} bytes."
),
"code": "too_large",
},
status_code=413,
)
files.append((filename, content_type, data))
finally:
for upload in uploads:
await upload.close()
return meta, files
async def read_multipart_file_or_400(
request: Request,
field: str = "file",
+2 -1
View File
@@ -12,7 +12,7 @@ Quick start::
from __future__ import annotations
from turnstone.sdk._types import TurnResult, TurnstoneAPIError
from turnstone.sdk._types import AttachmentUpload, TurnResult, TurnstoneAPIError
from turnstone.sdk.console import AsyncTurnstoneConsole, TurnstoneConsole
from turnstone.sdk.events import (
ApproveRequestEvent,
@@ -54,6 +54,7 @@ __all__ = [
"AsyncTurnstoneConsole",
"TurnstoneConsole",
# Result types
"AttachmentUpload",
"TurnResult",
"TurnstoneAPIError",
# Server events
+60 -11
View File
@@ -83,6 +83,8 @@ class _BaseClient:
*,
json_body: dict[str, Any] | None = ...,
params: dict[str, Any] | None = ...,
files: list[tuple[str, tuple[str, bytes, str]]] | None = ...,
data: dict[str, Any] | None = ...,
response_model: type[T],
) -> T: ...
@@ -94,6 +96,8 @@ class _BaseClient:
*,
json_body: dict[str, Any] | None = ...,
params: dict[str, Any] | None = ...,
files: list[tuple[str, tuple[str, bytes, str]]] | None = ...,
data: dict[str, Any] | None = ...,
response_model: None = ...,
) -> dict[str, Any]: ...
@@ -104,22 +108,40 @@ class _BaseClient:
*,
json_body: dict[str, Any] | None = None,
params: dict[str, Any] | None = None,
files: list[tuple[str, tuple[str, bytes, str]]] | None = None,
data: dict[str, Any] | None = None,
response_model: type[Any] | None = None,
) -> Any:
"""Execute an HTTP request and return parsed response data.
Raises :class:`TurnstoneAPIError` on non-2xx responses.
When *files* is provided, the request is sent as
``multipart/form-data`` with the named file parts (and any
*data* fields as plain form fields). Mutually exclusive with
*json_body*. Raises :class:`TurnstoneAPIError` on non-2xx
responses.
"""
headers: dict[str, str] | None = None
if self._token_factory is not None:
headers = {"Authorization": f"Bearer {self._token_factory()}"}
resp = await self._client.request(
method,
path,
json=json_body,
params=params,
headers=headers,
)
if files is not None:
# httpx infers multipart from the files= kwarg and sets the
# Content-Type + boundary itself; do not pass json= alongside.
resp = await self._client.request(
method,
path,
files=files,
data=data,
params=params,
headers=headers,
)
else:
resp = await self._client.request(
method,
path,
json=json_body,
params=params,
headers=headers,
)
if resp.status_code >= 400:
# Try to extract error message from JSON body
msg = ""
@@ -129,10 +151,37 @@ class _BaseClient:
if not msg:
msg = resp.text[:200]
raise TurnstoneAPIError(resp.status_code, msg)
data: dict[str, Any] = resp.json()
body_data: dict[str, Any] = resp.json()
if response_model is not None:
return response_model.model_validate(data)
return data
return response_model.model_validate(body_data)
return body_data
async def _request_bytes(
self,
method: str,
path: str,
*,
params: dict[str, Any] | None = None,
) -> bytes:
"""Execute a request and return the raw response bytes.
Used for endpoints like the attachment ``/content`` route that
return arbitrary binary or text payloads with their own
``Content-Type``. Raises :class:`TurnstoneAPIError` on non-2xx.
"""
headers: dict[str, str] | None = None
if self._token_factory is not None:
headers = {"Authorization": f"Bearer {self._token_factory()}"}
resp = await self._client.request(method, path, params=params, headers=headers)
if resp.status_code >= 400:
msg = ""
with contextlib.suppress(Exception):
body = resp.json()
msg = body.get("error", body.get("detail", ""))
if not msg:
msg = resp.text[:200]
raise TurnstoneAPIError(resp.status_code, msg)
return resp.content
async def _stream_sse(
self,
+15
View File
@@ -5,6 +5,21 @@ from __future__ import annotations
from dataclasses import dataclass, field
@dataclass
class AttachmentUpload:
"""A file to upload as an attachment.
Used by ``upload_attachment`` and by ``create_workstream(attachments=...)``.
``mime_type`` is advisory the server applies its own magic-byte
sniffing for images and UTF-8 validation for text documents and
rejects anything that doesn't match its allowlist.
"""
filename: str
data: bytes
mime_type: str | None = None
@dataclass
class TurnResult:
"""Aggregated result of a send_and_wait call.
+121 -2
View File
@@ -11,6 +11,7 @@ Usage::
from __future__ import annotations
import secrets
from typing import TYPE_CHECKING, Any
from turnstone.api.console_schemas import (
@@ -57,6 +58,10 @@ from turnstone.api.schemas import (
ScheduleInfo,
StatusResponse,
)
from turnstone.api.server_schemas import (
ListAttachmentsResponse,
UploadAttachmentResponse,
)
from turnstone.sdk._base import _BaseClient
from turnstone.sdk._sync import _SyncRunner
from turnstone.sdk.events import ClusterEvent
@@ -68,6 +73,8 @@ if TYPE_CHECKING:
import httpx
from turnstone.sdk._types import AttachmentUpload
class AsyncTurnstoneConsole(_BaseClient):
"""Async client for the turnstone console API."""
@@ -209,11 +216,16 @@ class AsyncTurnstoneConsole(_BaseClient):
target_node: str = "",
user_id: str = "",
client_type: str = "",
ws_id: str = "",
attachments: list[AttachmentUpload] | None = None,
) -> dict[str, Any]:
"""Create a workstream via the console's routing proxy.
Posts to /v1/api/route/workstreams/new. Returns the full response
dict including node_url and node_id.
Posts to /v1/api/route/workstreams/new. When *attachments* is
non-empty, the request is sent as multipart and the console
routes via ``?ws_id=<hex>`` (auto-generated when not supplied)
so the body lands on the owning node directly. Returns the
full response dict including ``node_url`` and ``node_id``.
"""
body: dict[str, Any] = {}
if name:
@@ -236,8 +248,88 @@ class AsyncTurnstoneConsole(_BaseClient):
body["user_id"] = user_id
if client_type:
body["client_type"] = client_type
if attachments:
# The console's multipart route_create routes by `?ws_id=` only —
# it does not parse the body to honor `target_node`. Refuse the
# combination at the SDK boundary so callers don't silently get
# routed to the wrong node.
if target_node:
raise ValueError(
"target_node is not supported with attachments; "
"use ws_id (caller-generated to hash to the desired node) instead"
)
if not ws_id:
ws_id = secrets.token_hex(16)
body["ws_id"] = ws_id
import json as _json
files: list[tuple[str, tuple[str, bytes, str]]] = [
(
"file",
(
att.filename,
att.data,
att.mime_type or "application/octet-stream",
),
)
for att in attachments
]
return await self._request(
"POST",
"/v1/api/route/workstreams/new",
files=files,
data={"meta": _json.dumps(body)},
params={"ws_id": ws_id},
)
if ws_id:
body["ws_id"] = ws_id
return await self._request("POST", "/v1/api/route/workstreams/new", json_body=body)
# -- routing proxy: attachments -----------------------------------------
async def route_upload_attachment(
self,
ws_id: str,
filename: str,
data: bytes,
*,
mime_type: str | None = None,
) -> UploadAttachmentResponse:
files: list[tuple[str, tuple[str, bytes, str]]] = [
(
"file",
(filename, data, mime_type or "application/octet-stream"),
)
]
return await self._request(
"POST",
f"/v1/api/route/workstreams/{ws_id}/attachments",
files=files,
response_model=UploadAttachmentResponse,
)
async def route_list_attachments(self, ws_id: str) -> ListAttachmentsResponse:
return await self._request(
"GET",
f"/v1/api/route/workstreams/{ws_id}/attachments",
response_model=ListAttachmentsResponse,
)
async def route_get_attachment_content(self, ws_id: str, attachment_id: str) -> bytes:
return await self._request_bytes(
"GET",
f"/v1/api/route/workstreams/{ws_id}/attachments/{attachment_id}/content",
)
async def route_delete_attachment(self, ws_id: str, attachment_id: str) -> StatusResponse:
return await self._request(
"DELETE",
f"/v1/api/route/workstreams/{ws_id}/attachments/{attachment_id}",
response_model=StatusResponse,
)
async def route_send(self, message: str, ws_id: str) -> dict[str, Any]:
"""Send a message via the routing proxy."""
return await self._request(
@@ -1079,6 +1171,8 @@ class TurnstoneConsole:
target_node: str = "",
user_id: str = "",
client_type: str = "",
ws_id: str = "",
attachments: list[AttachmentUpload] | None = None,
) -> dict[str, Any]:
return self._runner.run(
self._async.route_create_workstream(
@@ -1092,12 +1186,37 @@ class TurnstoneConsole:
target_node=target_node,
user_id=user_id,
client_type=client_type,
ws_id=ws_id,
attachments=attachments,
)
)
def route_send(self, message: str, ws_id: str) -> dict[str, Any]:
return self._runner.run(self._async.route_send(message, ws_id))
# -- routing proxy: attachments -----------------------------------------
def route_upload_attachment(
self,
ws_id: str,
filename: str,
data: bytes,
*,
mime_type: str | None = None,
) -> UploadAttachmentResponse:
return self._runner.run(
self._async.route_upload_attachment(ws_id, filename, data, mime_type=mime_type)
)
def route_list_attachments(self, ws_id: str) -> ListAttachmentsResponse:
return self._runner.run(self._async.route_list_attachments(ws_id))
def route_get_attachment_content(self, ws_id: str, attachment_id: str) -> bytes:
return self._runner.run(self._async.route_get_attachment_content(ws_id, attachment_id))
def route_delete_attachment(self, ws_id: str, attachment_id: str) -> StatusResponse:
return self._runner.run(self._async.route_delete_attachment(ws_id, attachment_id))
def route_approve(
self,
*,
+7
View File
@@ -137,6 +137,12 @@ class PlanReviewEvent(ServerEvent):
content: str = ""
@dataclass
class PlanResolvedEvent(ServerEvent):
type: str = "plan_resolved"
feedback: str = ""
@dataclass
class InfoEvent(ServerEvent):
type: str = "info"
@@ -360,6 +366,7 @@ _SERVER_REGISTRY: dict[str, type[ServerEvent]] = {
ToolOutputChunkEvent,
StatusEvent,
PlanReviewEvent,
PlanResolvedEvent,
InfoEvent,
ErrorEvent,
BusyErrorEvent,
+141 -7
View File
@@ -14,6 +14,7 @@ from __future__ import annotations
import asyncio
import contextlib
import secrets
from typing import TYPE_CHECKING, Any
from turnstone.api.schemas import (
@@ -26,6 +27,7 @@ from turnstone.api.server_schemas import (
CreateWorkstreamResponse,
DashboardResponse,
HealthResponse,
ListAttachmentsResponse,
ListAvailableModelsResponse,
ListMemoriesResponse,
ListSavedWorkstreamsResponse,
@@ -33,10 +35,11 @@ from turnstone.api.server_schemas import (
ListWorkstreamsResponse,
MemoryInfo,
SendResponse,
UploadAttachmentResponse,
)
from turnstone.sdk._base import _BaseClient
from turnstone.sdk._sync import _SyncRunner
from turnstone.sdk._types import TurnResult
from turnstone.sdk._types import AttachmentUpload, TurnResult
from turnstone.sdk.events import (
ClusterEvent,
ContentEvent,
@@ -108,7 +111,19 @@ class AsyncTurnstoneServer(_BaseClient):
ws_id: str = "",
client_type: str = "",
notify_targets: str = "",
attachments: list[AttachmentUpload] | None = None,
) -> CreateWorkstreamResponse:
"""Create a new workstream.
When *attachments* is non-empty the request is sent as
``multipart/form-data`` with the metadata in a ``meta`` JSON
field and one ``file`` part per attachment. A ws_id is
auto-generated client-side when not supplied so cluster-routed
callers can bind the body to the owning node up front. When
*initial_message* is also set, the server reserves the
attachments onto that turn before its background worker
dispatches.
"""
body: dict[str, Any] = {}
if name:
body["name"] = name
@@ -126,12 +141,38 @@ class AsyncTurnstoneServer(_BaseClient):
body["auto_approve_tools"] = auto_approve_tools
if user_id:
body["user_id"] = user_id
if ws_id:
body["ws_id"] = ws_id
if client_type:
body["client_type"] = client_type
if notify_targets and notify_targets != "[]":
body["notify_targets"] = notify_targets
if attachments:
if not ws_id:
ws_id = secrets.token_hex(16)
body["ws_id"] = ws_id
import json as _json
files: list[tuple[str, tuple[str, bytes, str]]] = [
(
"file",
(
att.filename,
att.data,
att.mime_type or "application/octet-stream",
),
)
for att in attachments
]
return await self._request(
"POST",
"/v1/api/workstreams/new",
files=files,
data={"meta": _json.dumps(body)},
response_model=CreateWorkstreamResponse,
)
if ws_id:
body["ws_id"] = ws_id
return await self._request(
"POST",
"/v1/api/workstreams/new",
@@ -149,14 +190,76 @@ class AsyncTurnstoneServer(_BaseClient):
# -- chat interaction ----------------------------------------------------
async def send(self, message: str, ws_id: str) -> SendResponse:
async def send(
self,
message: str,
ws_id: str,
*,
attachment_ids: list[str] | None = None,
) -> SendResponse:
body: dict[str, Any] = {"message": message, "ws_id": ws_id}
if attachment_ids is not None:
body["attachment_ids"] = list(attachment_ids)
return await self._request(
"POST",
"/v1/api/send",
json_body={"message": message, "ws_id": ws_id},
json_body=body,
response_model=SendResponse,
)
# -- attachments ---------------------------------------------------------
async def upload_attachment(
self,
ws_id: str,
filename: str,
data: bytes,
*,
mime_type: str | None = None,
) -> UploadAttachmentResponse:
"""Upload one file as a pending attachment for this workstream.
The server validates size + MIME (magic-byte sniff for images,
UTF-8 decode for text) and rejects with 400/413 on any mismatch.
Returns the persisted ``AttachmentInfo`` so the caller can pass
the id into a subsequent ``send(attachment_ids=...)``.
"""
files: list[tuple[str, tuple[str, bytes, str]]] = [
(
"file",
(filename, data, mime_type or "application/octet-stream"),
)
]
return await self._request(
"POST",
f"/v1/api/workstreams/{ws_id}/attachments",
files=files,
response_model=UploadAttachmentResponse,
)
async def list_attachments(self, ws_id: str) -> ListAttachmentsResponse:
"""List the caller's pending (unconsumed) attachments for *ws_id*."""
return await self._request(
"GET",
f"/v1/api/workstreams/{ws_id}/attachments",
response_model=ListAttachmentsResponse,
)
async def get_attachment_content(self, ws_id: str, attachment_id: str) -> bytes:
"""Return the raw bytes of an attachment."""
return await self._request_bytes(
"GET",
f"/v1/api/workstreams/{ws_id}/attachments/{attachment_id}/content",
)
async def delete_attachment(self, ws_id: str, attachment_id: str) -> StatusResponse:
"""Remove a pending attachment. Consumed attachments return 404."""
return await self._request(
"DELETE",
f"/v1/api/workstreams/{ws_id}/attachments/{attachment_id}",
response_model=StatusResponse,
)
async def approve(
self,
*,
@@ -494,6 +597,7 @@ class TurnstoneServer:
ws_id: str = "",
client_type: str = "",
notify_targets: str = "",
attachments: list[AttachmentUpload] | None = None,
) -> CreateWorkstreamResponse:
return self._runner.run(
self._async.create_workstream(
@@ -508,6 +612,7 @@ class TurnstoneServer:
ws_id=ws_id,
client_type=client_type,
notify_targets=notify_targets,
attachments=attachments,
)
)
@@ -516,8 +621,37 @@ class TurnstoneServer:
# -- chat interaction ----------------------------------------------------
def send(self, message: str, ws_id: str) -> SendResponse:
return self._runner.run(self._async.send(message, ws_id))
def send(
self,
message: str,
ws_id: str,
*,
attachment_ids: list[str] | None = None,
) -> SendResponse:
return self._runner.run(self._async.send(message, ws_id, attachment_ids=attachment_ids))
# -- attachments ---------------------------------------------------------
def upload_attachment(
self,
ws_id: str,
filename: str,
data: bytes,
*,
mime_type: str | None = None,
) -> UploadAttachmentResponse:
return self._runner.run(
self._async.upload_attachment(ws_id, filename, data, mime_type=mime_type)
)
def list_attachments(self, ws_id: str) -> ListAttachmentsResponse:
return self._runner.run(self._async.list_attachments(ws_id))
def get_attachment_content(self, ws_id: str, attachment_id: str) -> bytes:
return self._runner.run(self._async.get_attachment_content(ws_id, attachment_id))
def delete_attachment(self, ws_id: str, attachment_id: str) -> StatusResponse:
return self._runner.run(self._async.delete_attachment(ws_id, attachment_id))
def approve(
self,
+461 -27
View File
@@ -76,6 +76,14 @@ _VALID_WS_ID = re.compile(r"^[0-9a-f]{32}$")
_MAX_TURN_CONTENT_CHARS = 256 * 1024 # cap piggybacked content on idle events
# Orphan-attachment-reservation sweep cadence. Threshold is measured
# against the storage layer's `reserved_at` column (time the row last
# transitioned into reserved state, NOT upload time), so a 1-hour cap
# is safely longer than any realistic single send without risking the
# unreservation of attachments uploaded long ago but reserved fresh.
_ORPHAN_SWEEP_INTERVAL_S = 30 * 60
_ORPHAN_SWEEP_THRESHOLD_S = 1 * 3600
class WebUI:
"""Browser-based UI using SSE for streaming and HTTP POST for actions.
@@ -642,8 +650,20 @@ class WebUI:
def resolve_plan(self, feedback: str) -> None:
"""Called by the HTTP handler when the user responds to a plan."""
self._pending_plan_review = None
self._plan_result = feedback
if self._pending_plan_review is None:
# cancel_generation calls us unconditionally to unblock any wait.
# No plan pending — just signal and skip the broadcast frame.
self._plan_event.set()
return
# Clear pending BEFORE broadcasting so a client reconnecting in the
# window between enqueue and clear cannot receive both the replayed
# plan_review (SSE re-injection at the connect handler) AND the live
# plan_resolved. Broadcast lets other clients (e.g. desktop while
# phone approved) dismiss their plan modals in sync — mirrors the
# approval_resolved pattern used by resolve_approval().
self._pending_plan_review = None
self._enqueue({"type": "plan_resolved", "feedback": feedback})
self._plan_event.set()
@@ -2069,14 +2089,196 @@ def _deliver_notification(
time.sleep(1.0 if attempt == 0 else 3.0)
async def create_workstream(request: Request) -> JSONResponse:
"""POST /v1/api/workstreams/new — create a new workstream."""
from turnstone.core.memory import get_workstream_display_name
from turnstone.core.web_helpers import read_json_or_400
def _reserve_and_resolve_attachments(
requested_ids: list[str],
send_id: str,
ws_id: str,
user_id: str,
) -> tuple[list[Any], list[str], list[str]]:
"""Reserve attachment ids for ``send_id`` and resolve to Attachment objects.
body = await read_json_or_400(request)
if isinstance(body, JSONResponse):
return body
Returns ``(resolved, ordered_reserved, dropped)``. ``dropped`` is the
subset of *requested_ids* that could not be reserved (already consumed,
lost a race, or cross-scope). Used by the create-with-attachments
path; ``send_message`` has its own inlined variant with an
auto-consume fast path that reuses bytes fetched during selection.
"""
from turnstone.core.attachments import Attachment
from turnstone.core.memory import get_attachments as _get_attachments
from turnstone.core.memory import reserve_attachments as _reserve
if not requested_ids:
return [], [], []
reserved_ids: list[str] = _reserve(requested_ids, send_id, ws_id, user_id)
reserved_set = set(reserved_ids)
ordered_reserved: list[str] = [aid for aid in requested_ids if aid in reserved_set]
dropped: list[str] = [aid for aid in requested_ids if aid not in reserved_set]
resolved: list[Any] = []
if ordered_reserved:
rows = _get_attachments(ordered_reserved)
rows_by_id = {str(r["attachment_id"]): r for r in rows}
for aid in ordered_reserved:
r = rows_by_id.get(aid)
if not r:
continue
if (
r.get("ws_id") != ws_id
or r.get("user_id") != user_id
or r.get("message_id") is not None
or r.get("reserved_for_msg_id") != send_id
):
continue
content = r.get("content")
if not isinstance(content, bytes):
continue
resolved.append(
Attachment(
attachment_id=str(r["attachment_id"]),
filename=str(r.get("filename") or ""),
mime_type=str(r.get("mime_type") or "application/octet-stream"),
kind=str(r.get("kind") or ""),
content=content,
)
)
return resolved, ordered_reserved, dropped
def _validate_and_save_uploaded_files(
files: list[tuple[str, str, bytes]],
ws_id: str,
user_id: str,
) -> tuple[list[str], JSONResponse | None]:
"""Classify + save a list of ``(filename, claimed_mime, data)`` tuples.
Applies the same validation rules as ``upload_attachment`` (magic-byte
image sniffing, UTF-8 text decode, per-kind size cap, per-(ws,user)
pending cap) under the shared ``_attachment_upload_lock``.
Returns ``(attachment_ids, None)`` on success or ``(ids_saved_so_far,
JSONResponse)`` on the first failure so the caller can roll back any
partial state.
"""
from turnstone.core.attachments import (
IMAGE_SIZE_CAP,
MAX_PENDING_ATTACHMENTS_PER_USER_WS,
TEXT_DOC_SIZE_CAP,
)
from turnstone.core.memory import list_pending_attachments, save_attachment
saved_ids: list[str] = []
if not files:
return saved_ids, None
lock = _attachment_upload_lock(ws_id, user_id)
with lock:
pending_count = len(list_pending_attachments(ws_id, user_id))
for filename, claimed_mime, data in files:
if not data:
return saved_ids, JSONResponse({"error": "Empty file"}, status_code=400)
sniffed_image = _sniff_image_mime(data)
if sniffed_image is not None:
if len(data) > IMAGE_SIZE_CAP:
return saved_ids, JSONResponse(
{
"error": (
f"Image too large ({len(data):,} bytes); "
f"cap is {IMAGE_SIZE_CAP:,} bytes."
),
"code": "too_large",
},
status_code=413,
)
kind = "image"
mime = sniffed_image
else:
if len(data) > TEXT_DOC_SIZE_CAP:
return saved_ids, JSONResponse(
{
"error": (
f"Text document too large ({len(data):,} bytes); "
f"cap is {TEXT_DOC_SIZE_CAP:,} bytes."
),
"code": "too_large",
},
status_code=413,
)
mime_or_err = _classify_text_attachment(filename, claimed_mime, data)
if mime_or_err[0] is None:
return saved_ids, JSONResponse(
{"error": mime_or_err[1], "code": "unsupported"},
status_code=400,
)
kind = "text"
mime = mime_or_err[0]
if pending_count + 1 > MAX_PENDING_ATTACHMENTS_PER_USER_WS:
return saved_ids, JSONResponse(
{
"error": (
f"Too many pending attachments "
f"(max {MAX_PENDING_ATTACHMENTS_PER_USER_WS} pending per workstream)"
),
"code": "too_many",
},
status_code=409,
)
attachment_id = uuid.uuid4().hex
save_attachment(
attachment_id,
ws_id,
user_id,
filename,
mime,
len(data),
kind,
data,
)
saved_ids.append(attachment_id)
pending_count += 1
return saved_ids, None
async def create_workstream(request: Request) -> JSONResponse:
"""POST /v1/api/workstreams/new — create a new workstream.
Accepts two content types:
- ``application/json`` (default): body is a :class:`CreateWorkstreamRequest`.
- ``multipart/form-data``: one ``meta`` field (JSON object, same shape
as the JSON body) plus zero-or-more ``file`` parts. Files are saved
as attachments under the new workstream and reserved onto the first
``initial_message`` turn (if provided) before the worker dispatches.
"""
from turnstone.core.attachments import IMAGE_SIZE_CAP
from turnstone.core.memory import get_workstream_display_name
from turnstone.core.web_helpers import (
read_json_or_400,
read_multipart_create_or_400,
)
content_type = (request.headers.get("content-type") or "").lower()
uploaded_files: list[tuple[str, str, bytes]] = []
body: dict[str, Any]
if content_type.startswith("multipart/form-data"):
# Multipart cap: up to MAX_PENDING × image cap, plus slack for
# JSON meta + multipart framing. Per-file size is enforced in
# _validate_and_save_uploaded_files against the kind-specific cap.
parsed = await read_multipart_create_or_400(
request,
max_files=10,
max_per_file_bytes=IMAGE_SIZE_CAP,
max_total_bytes=10 * IMAGE_SIZE_CAP,
)
if isinstance(parsed, JSONResponse):
return parsed
body, uploaded_files = parsed
else:
json_body = await read_json_or_400(request)
if isinstance(json_body, JSONResponse):
return json_body
body = json_body
mgr: WorkstreamManager = request.app.state.workstreams
skip: bool = request.app.state.skip_permissions
auth = getattr(getattr(request, "state", None), "auth_result", None)
@@ -2122,6 +2324,16 @@ async def create_workstream(request: Request) -> JSONResponse:
requested_ws_id = ""
if requested_ws_id and not _VALID_WS_ID.match(requested_ws_id):
return JSONResponse({"error": "invalid ws_id format"}, status_code=400)
# Disallow attachments + resume_ws in the same request — semantics
# are unclear (resume forks an existing ws, but attachments are for
# the *fresh* turn). Caller should resume first, then upload via
# the standard endpoint. Checked before mgr.create() so we don't
# waste work on a request we'll reject.
if uploaded_files and resume_ws_id:
return JSONResponse(
{"error": "attachments cannot be combined with resume_ws"},
status_code=400,
)
try:
ws = mgr.create(
name=body.get("name", ""),
@@ -2144,9 +2356,29 @@ async def create_workstream(request: Request) -> JSONResponse:
ws.session.set_watch_runner(
runner, dispatch_fn=_make_watch_dispatch(ws, ws.session, ws.ui)
)
# Emit creation event on global queue for SSE consumers (console)
display_name = get_workstream_display_name(ws.id) or ws.name
gq: queue.Queue[dict[str, Any]] = request.app.state.global_queue
# Save attachments BEFORE the ws_created broadcast so failed
# validation doesn't make SSE consumers flash a workstream that
# never really existed. Validate + save happens early; rollback
# is silent (no ws_created → no ws_closed needed).
attachment_ids: list[str] = []
if uploaded_files:
saved_ids, save_err = _validate_and_save_uploaded_files(uploaded_files, ws.id, uid)
if save_err is not None:
from turnstone.core.memory import delete_workstream as _delete_ws
with contextlib.suppress(Exception):
mgr.close(ws.id)
with contextlib.suppress(Exception):
_delete_ws(ws.id)
return save_err
attachment_ids = saved_ids
# Emit creation event on global queue for SSE consumers (console).
# Deferred until past attachment validation so a rejected create
# doesn't surface a phantom create→close pair.
display_name = get_workstream_display_name(ws.id) or ws.name
with contextlib.suppress(queue.Full):
gq.put_nowait(
{
@@ -2272,11 +2504,33 @@ async def create_workstream(request: Request) -> JSONResponse:
initial_message = body.get("initial_message", "").strip()
if initial_message and ws.session is not None:
session = ws.session
# Reserve any attachments uploaded in this request before the
# worker dispatches. Mirrors the /send endpoint pattern: the
# send_id token scopes both the reservation and the eventual
# consume. Unreserve on worker failure so the rows don't stay
# soft-locked forever.
send_id = uuid.uuid4().hex
resolved_atts: list[Any] = []
if attachment_ids:
resolved_atts, _ord, _drop = _reserve_and_resolve_attachments(
attachment_ids, send_id, ws.id, uid
)
def _run_initial() -> None:
try:
session.send(initial_message)
session.send(
initial_message,
attachments=resolved_atts or None,
send_id=send_id if resolved_atts else None,
)
except (Exception, GenerationCancelled):
if attachment_ids:
from turnstone.core.memory import (
unreserve_attachments as _unreserve,
)
with contextlib.suppress(Exception):
_unreserve(send_id, ws.id, uid)
if isinstance(ws.ui, WebUI):
ws.ui.on_stream_end()
ws.ui.on_state_change("idle")
@@ -2297,6 +2551,7 @@ async def create_workstream(request: Request) -> JSONResponse:
"name": ws.name,
"resumed": resumed,
"message_count": message_count,
"attachment_ids": attachment_ids,
}
)
except RuntimeError as e:
@@ -3226,6 +3481,12 @@ def config_reload(request: Request) -> JSONResponse:
if not cs:
return JSONResponse({"status": "noop"})
cs.reload()
# Apply routing overrides to the live registry — admin settings updates
# fan out via this endpoint and would otherwise not affect plan/task
# routing until a model-reload or restart.
registry = getattr(request.app.state, "registry", None)
if registry is not None:
_apply_routing_overrides(registry, cs)
# Broadcast settings_changed event to all connected clients
if gq is not None:
with contextlib.suppress(queue.Full):
@@ -3271,6 +3532,110 @@ def internal_mcp_status(request: Request) -> JSONResponse:
# -- internal model management -----------------------------------------------
def _effective_routing(
cs: Any,
base_models: dict[str, Any],
base_default: str,
base_plan_model: str | None,
base_task_model: str | None,
base_plan_effort: str | None,
base_task_effort: str | None,
) -> tuple[str, str | None, str | None, str | None, str | None]:
"""Compute (default, plan_model, task_model, plan_effort, task_effort)
after layering ConfigStore overrides on top of the supplied base values.
Aliases require existence in *base_models* (silently dropped otherwise);
effort values were validated against SettingDef choices on write, so a
truthiness check is sufficient at apply time.
Returns the base values unchanged when *cs* is None.
"""
eff_default = base_default
eff_plan_model = base_plan_model
eff_task_model = base_task_model
eff_plan_effort = base_plan_effort
eff_task_effort = base_task_effort
if cs is not None:
cs_default = cs.get("model.default_alias")
if cs_default and cs_default in base_models:
eff_default = cs_default
cs_plan_alias = cs.get("model.plan_alias")
if cs_plan_alias and cs_plan_alias in base_models:
eff_plan_model = cs_plan_alias
cs_task_alias = cs.get("model.task_alias")
if cs_task_alias and cs_task_alias in base_models:
eff_task_model = cs_task_alias
cs_plan_effort = cs.get("model.plan_effort")
if cs_plan_effort:
eff_plan_effort = cs_plan_effort
cs_task_effort = cs.get("model.task_effort")
if cs_task_effort:
eff_task_effort = cs_task_effort
return eff_default, eff_plan_model, eff_task_model, eff_plan_effort, eff_task_effort
def _broadcast_agent_tool_schema_refresh(app_state: Any) -> None:
"""Tell every active session on this node to re-render its plan_agent /
task_agent tool descriptions. Best-effort: a session that lacks the
method (older code path or test stub) is skipped silently.
Called after a registry reload that may have added/removed model
aliases, so the calling LLMs see an updated `model` parameter
description on their next turn.
"""
mgr = getattr(app_state, "workstreams", None)
if mgr is None:
return
try:
workstreams = mgr.list_all()
except Exception:
return
for ws in workstreams:
session = getattr(ws, "session", None)
refresh = getattr(session, "refresh_agent_tool_schemas", None)
if refresh is None:
continue
with contextlib.suppress(Exception):
refresh()
def _apply_routing_overrides(registry: Any, cs: Any) -> bool:
"""Apply ConfigStore routing overrides to a live *registry* in place.
Used by the startup path and by ``config_reload`` (admin settings
update fan-out) both keep the existing model definitions and only
rewrite routing fields. Returns True when a reload happened.
"""
eff = _effective_routing(
cs,
registry.models,
registry.default,
registry.plan_model,
registry.task_model,
registry.plan_effort,
registry.task_effort,
)
if (
eff[0] != registry.default
or eff[1] != registry.plan_model
or eff[2] != registry.task_model
or eff[3] != registry.plan_effort
or eff[4] != registry.task_effort
):
registry.reload(
registry.models,
eff[0],
registry.fallback,
registry.agent_model,
plan_model=eff[1],
task_model=eff[2],
plan_effort=eff[3],
task_effort=eff[4],
)
return True
return False
def internal_model_reload(request: Request) -> JSONResponse:
"""POST /v1/api/_internal/model-reload — rebuild registry from DB + config."""
from turnstone.core.model_registry import load_model_registry
@@ -3289,26 +3654,53 @@ def internal_model_reload(request: Request) -> JSONResponse:
provider=cli_args["provider"],
storage=get_storage(),
)
# Allow runtime override of the default alias via ConfigStore
effective_default = new_registry.default
cs = getattr(request.app.state, "config_store", None)
if cs:
if cs is not None:
cs.reload() # Ensure latest settings from DB
cs_alias = cs.get("model.default_alias")
if cs_alias and cs_alias in new_registry.models:
effective_default = cs_alias
log.info(
"ConfigStore override: using '%s' as default model (registry had '%s')",
effective_default,
new_registry.default,
)
eff_default, eff_plan_model, eff_task_model, eff_plan_effort, eff_task_effort = (
_effective_routing(
cs,
new_registry.models,
new_registry.default,
new_registry.plan_model,
new_registry.task_model,
new_registry.plan_effort,
new_registry.task_effort,
)
)
if eff_default != new_registry.default:
log.info(
"ConfigStore override: using '%s' as default model (registry had '%s')",
eff_default,
new_registry.default,
)
# No-op fast path: skip reload when nothing changed (avoids client churn
# on broadcast model-reloads where this node has no pending changes).
unchanged = (
new_registry.models == registry.models
and new_registry.fallback == registry.fallback
and new_registry.agent_model == registry.agent_model
and eff_default == registry.default
and eff_plan_model == registry.plan_model
and eff_task_model == registry.task_model
and eff_plan_effort == registry.plan_effort
and eff_task_effort == registry.task_effort
)
if unchanged:
new_registry.shutdown()
return JSONResponse({"status": "ok", "aliases": registry.list_aliases(), "noop": True})
try:
registry.reload(
new_registry.models,
effective_default,
eff_default,
new_registry.fallback,
new_registry.agent_model,
plan_model=eff_plan_model,
task_model=eff_task_model,
plan_effort=eff_plan_effort,
task_effort=eff_task_effort,
)
except ValueError as exc:
return JSONResponse({"status": "error", "reason": str(exc)}, status_code=422)
@@ -3322,6 +3714,10 @@ def internal_model_reload(request: Request) -> JSONResponse:
cfg = registry.get_config(alias)
health_reg.get_tracker(provider=cfg.provider, base_url=cfg.base_url)
# Push the new alias list into active sessions so plan_agent/task_agent
# `model` parameter descriptions reflect the current registry.
_broadcast_agent_tool_schema_refresh(request.app.state)
return JSONResponse({"status": "ok", "aliases": registry.list_aliases()})
@@ -3547,6 +3943,37 @@ async def _lifespan(app: Starlette) -> AsyncGenerator[None, None]:
# Start watch runner (periodic command polling)
if app.state.watch_runner:
app.state.watch_runner.start()
# Sweep stale attachment reservations left over from process crashes
# between reserve_attachments and consume/unreserve. Run once at
# startup (catches anything orphaned by the previous process), then
# periodically as defense-in-depth.
from turnstone.core.memory import sweep_orphan_reservations as _sweep_orphans
try:
n = await asyncio.to_thread(_sweep_orphans, _ORPHAN_SWEEP_THRESHOLD_S)
if n:
log.info("attachments.orphan_sweep.startup", swept=n)
except Exception:
log.warning("attachments.orphan_sweep.startup_failed", exc_info=True)
_orphan_sweep_stop = asyncio.Event()
async def _orphan_sweep_loop() -> None:
while not _orphan_sweep_stop.is_set():
try:
await asyncio.wait_for(_orphan_sweep_stop.wait(), timeout=_ORPHAN_SWEEP_INTERVAL_S)
return # stop event fired
except TimeoutError:
pass
try:
n = await asyncio.to_thread(_sweep_orphans, _ORPHAN_SWEEP_THRESHOLD_S)
if n:
log.info("attachments.orphan_sweep.periodic", swept=n)
except Exception:
log.warning("attachments.orphan_sweep.periodic_failed", exc_info=True)
_orphan_sweep_task = asyncio.create_task(_orphan_sweep_loop())
# OIDC discovery (if configured)
oidc_config = app.state.oidc_config
if oidc_config.enabled:
@@ -3654,6 +4081,10 @@ async def _lifespan(app: Starlette) -> AsyncGenerator[None, None]:
await tls_client.stop_renewal()
if app.state.watch_runner:
app.state.watch_runner.stop()
# Stop the orphan-reservation sweep loop
_orphan_sweep_stop.set()
with contextlib.suppress(asyncio.CancelledError, Exception):
await _orphan_sweep_task
# health_registry is stateless (no background threads) — nothing to stop
if app.state.mcp_client:
app.state.mcp_client.shutdown()
@@ -4030,10 +4461,13 @@ def main() -> None:
storage=_get_storage(),
)
# Apply runtime default alias override from ConfigStore (if set)
cs_default_alias = config_store.get("model.default_alias")
if cs_default_alias and registry.has_alias(cs_default_alias):
registry.reload(registry.models, cs_default_alias, registry.fallback, registry.agent_model)
# Apply runtime overrides from ConfigStore for default alias plus the
# per-kind sub-agent routing. Only triggers a reload when at least one
# ConfigStore value differs from what the registry loaded from disk.
# ConfigStore returns the SettingDef default ("" for these keys) when
# unset — distinct from the registry's None for unconfigured fields.
config_store.reload() # symmetry with internal_model_reload's cs.reload()
_apply_routing_overrides(registry, config_store)
# Initialize MCP client (connects to configured MCP servers, if any)
from turnstone.core.mcp_client import create_mcp_client
+12
View File
@@ -31,6 +31,12 @@
--blue: #38bdf8;
--on-color: var(--bg);
/* Channel-platform accents kept distinct from --magenta (generic
channel) and from each other so per-platform badges read at a glance.
Light-theme variants live in [data-theme="light"] below. */
--discord: #818cf8;
--slack: #f472b6;
/* Glow variants for LED effects */
--green-glow: rgba(52, 211, 153, 0.25);
--red-glow: rgba(248, 113, 113, 0.25);
@@ -39,6 +45,8 @@
--cyan-glow: rgba(103, 232, 249, 0.2);
--magenta-glow: rgba(192, 132, 252, 0.25);
--blue-glow: rgba(56, 189, 248, 0.25);
--discord-glow: rgba(129, 140, 248, 0.3);
--slack-glow: rgba(244, 114, 182, 0.3);
/* Structure */
--border: rgba(255, 255, 255, 0.06);
@@ -71,6 +79,8 @@
--cyan: #0e7490;
--magenta: #7c3aed;
--blue: #0369a1;
--discord: #4f46e5; /* darker indigo on white surface — passes WCAG AA */
--slack: #be185d; /* darker rose */
--on-color: #ffffff;
--green-glow: rgba(4, 120, 87, 0.25);
--red-glow: rgba(220, 38, 38, 0.25);
@@ -79,6 +89,8 @@
--cyan-glow: rgba(14, 116, 144, 0.2);
--magenta-glow: rgba(124, 58, 237, 0.2);
--blue-glow: rgba(3, 105, 161, 0.2);
--discord-glow: rgba(79, 70, 229, 0.2);
--slack-glow: rgba(190, 24, 93, 0.2);
--border: rgba(0, 0, 0, 0.08);
--border-strong: rgba(0, 0, 0, 0.12);
--code-bg: #f0f1f5;
+4
View File
@@ -7,6 +7,10 @@
"goal": {
"type": "string",
"description": "The goal and scope of the plan, including any constraints."
},
"model": {
"type": "string",
"description": "Optional model alias to run this plan agent on. Omit to use the current session model. (No alternative aliases configured in this session.)"
}
},
"required": ["goal"]
+4
View File
@@ -7,6 +7,10 @@
"prompt": {
"type": "string",
"description": "Complete task description for the sub-agent."
},
"model": {
"type": "string",
"description": "Optional model alias to run this task agent on. Omit to use the current session model. (No alternative aliases configured in this session.)"
}
},
"required": ["prompt"]
+652 -51
View File
@@ -851,6 +851,14 @@ Pane.prototype.handleEvent = function (evt) {
showPlanDialog(evt.content);
break;
case "plan_resolved":
// Plan was resolved on another client (or by server-initiated cancel).
// Only act if our modal is for this pane's workstream.
if (_planWsId === this.wsId) {
dismissPlanDialog(evt.feedback);
}
break;
case "info":
this.addInfoMessage(evt.message);
break;
@@ -1059,13 +1067,14 @@ Pane.prototype._dequeueMessage = function (el) {
.then(function (data) {
if (data.status === "removed") {
el.remove();
// The queued message had its attachments reserved; dequeue
// releases the reservation server-side, so refresh the chip
// strip to show them as available again.
self.rehydrateAttachments();
}
// "not_found" means already injected — leave the message visible.
// The promote loop will strip the queued styling on idle.
// Either path warrants a chip-strip refresh: a successful remove
// unreserves the attachments server-side, and a "not_found" means
// dispatch raced us so the actual pending state may differ from
// what the UI last saw. Re-fetch to stay in sync. (Leave the
// message bubble visible on not_found — the promote loop strips
// the queued styling on idle.)
self.rehydrateAttachments();
})
.catch(function () {
// Network error — don't remove, message may have been injected
@@ -3139,6 +3148,141 @@ function switchTab(wsId) {
var _newWsTrapHandler = null;
var _forkFromWsId = "";
// Staged files for the new-workstream modal. Distinct from the pane's
// chip strip: there's no ws_id yet, so we hold File objects in memory
// and ship them all in one multipart create request on submit.
var _newWsStagedFiles = [];
// Per-kind size caps (mirrored from turnstone/core/attachments.py so the
// browser can fail fast before uploading). Keep in sync.
var _NEW_WS_IMAGE_CAP = 4 * 1024 * 1024;
var _NEW_WS_TEXT_CAP = 512 * 1024;
var _NEW_WS_MAX_FILES = 10;
function _newWsRenderChips() {
var chipsEl = document.getElementById("new-ws-attach-chips");
if (!chipsEl) return;
chipsEl.textContent = "";
for (var i = 0; i < _newWsStagedFiles.length; i++) {
(function (idx) {
var f = _newWsStagedFiles[idx];
var chip = document.createElement("span");
chip.className = "new-ws-attach-chip";
chip.setAttribute("role", "listitem");
var label = document.createElement("span");
label.className = "new-ws-attach-chip-name";
label.textContent = f.name;
label.title = f.name + " (" + f.size + " bytes)";
chip.appendChild(label);
var size = document.createElement("span");
size.className = "new-ws-attach-chip-size";
size.textContent = _formatAttachSize(f.size);
chip.appendChild(size);
var rm = document.createElement("button");
rm.type = "button";
rm.className = "new-ws-attach-chip-remove";
rm.setAttribute("aria-label", "Remove " + f.name);
rm.textContent = "\u00d7";
rm.onclick = function () {
_newWsStagedFiles.splice(idx, 1);
_newWsRenderChips();
};
chip.appendChild(rm);
chipsEl.appendChild(chip);
})(i);
}
}
// Mirrors turnstone/server.py classifier — magic-byte image allowlist plus
// text/* MIMEs, allowlisted application/* MIMEs, and known text extensions.
// Surfaces unsupported types client-side so the user sees a clear error
// instead of a generic create failure after the server rejects.
var _ATTACH_IMAGE_MIMES = [
"image/png",
"image/jpeg",
"image/gif",
"image/webp",
];
var _ATTACH_TEXT_APP_MIMES = [
"application/json",
"application/xml",
"application/x-yaml",
"application/yaml",
"application/toml",
];
var _ATTACH_TEXT_EXTENSIONS = [
".c",
".conf",
".cpp",
".css",
".go",
".h",
".hpp",
".html",
".ini",
".java",
".js",
".json",
".jsx",
".md",
".py",
".rs",
".sh",
".sql",
".toml",
".ts",
".tsx",
".txt",
".xml",
".yaml",
".yml",
];
function _isAttachmentAllowed(file) {
var mime = (file.type || "").toLowerCase();
if (_ATTACH_IMAGE_MIMES.indexOf(mime) !== -1) return true;
if (mime.indexOf("text/") === 0) return true;
if (_ATTACH_TEXT_APP_MIMES.indexOf(mime) !== -1) return true;
var name = (file.name || "").toLowerCase();
var dot = name.lastIndexOf(".");
if (dot >= 0 && _ATTACH_TEXT_EXTENSIONS.indexOf(name.substr(dot)) !== -1) {
return true;
}
return false;
}
function _newWsAddFiles(files) {
var errEl = document.getElementById("new-ws-error");
for (var i = 0; i < files.length; i++) {
var f = files[i];
if (_newWsStagedFiles.length >= _NEW_WS_MAX_FILES) {
errEl.textContent =
"At most " + _NEW_WS_MAX_FILES + " attachments per workstream";
errEl.style.display = "block";
return;
}
if (!_isAttachmentAllowed(f)) {
errEl.textContent =
"Unsupported file type: " +
f.name +
" (allowed: png/jpeg/gif/webp images, text)";
errEl.style.display = "block";
return;
}
var isImage = (f.type || "").indexOf("image/") === 0;
var cap = isImage ? _NEW_WS_IMAGE_CAP : _NEW_WS_TEXT_CAP;
if (f.size > cap) {
errEl.textContent =
f.name + " exceeds the " + _formatAttachSize(cap) + " cap";
errEl.style.display = "block";
return;
}
_newWsStagedFiles.push(f);
}
errEl.style.display = "none";
_newWsRenderChips();
}
function newWorkstream() {
showNewWsModal();
}
@@ -3236,6 +3380,8 @@ function showNewWsModal(forkFromWsId) {
});
document.getElementById("new-ws-name").value = "";
var initEl = document.getElementById("new-ws-initial-message");
if (initEl) initEl.value = "";
var errEl = document.getElementById("new-ws-error");
errEl.style.display = "none";
errEl.textContent = "";
@@ -3243,6 +3389,28 @@ function showNewWsModal(forkFromWsId) {
submitBtn.disabled = false;
submitBtn.textContent = _forkFromWsId ? "Fork" : "Create";
// Reset attachment staging. Forks don't carry attachments —
// disable the attach UI in that case (the fork inherits its
// parent's history; new attachments go on the next manual send).
_newWsStagedFiles = [];
var attachRow = document.getElementById("new-ws-attach-row");
var attachInput = document.getElementById("new-ws-attach-input");
var attachBtn = document.getElementById("new-ws-attach-btn");
if (attachRow) attachRow.style.display = _forkFromWsId ? "none" : "";
if (attachInput) attachInput.value = "";
_newWsRenderChips();
if (attachBtn && attachInput) {
attachBtn.onclick = function () {
attachInput.click();
};
attachInput.onchange = function () {
if (attachInput.files && attachInput.files.length) {
_newWsAddFiles(attachInput.files);
}
attachInput.value = "";
};
}
document.getElementById("new-ws-cancel").onclick = hideNewWsModal;
submitBtn.onclick = submitNewWs;
@@ -3309,20 +3477,37 @@ function submitNewWs() {
var model = document.getElementById("new-ws-model").value.trim();
var judge_model = document.getElementById("new-ws-judge-model").value.trim();
var skill = document.getElementById("new-ws-skill").value;
var initEl = document.getElementById("new-ws-initial-message");
var initial_message = initEl ? initEl.value.trim() : "";
if (name) body.name = name;
if (model) body.model = model;
if (judge_model) body.judge_model = judge_model;
if (skill && !_forkFromWsId) body.skill = skill;
if (_forkFromWsId) body.resume_ws = _forkFromWsId;
if (initial_message) body.initial_message = initial_message;
var errEl = document.getElementById("new-ws-error");
errEl.style.display = "none";
authFetch("/v1/api/workstreams/new", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
})
var fetchOpts;
var staged = _forkFromWsId ? [] : _newWsStagedFiles.slice();
if (staged.length > 0) {
var form = new FormData();
form.append("meta", JSON.stringify(body));
for (var i = 0; i < staged.length; i++) {
form.append("file", staged[i], staged[i].name);
}
// Don't set Content-Type — the browser adds the correct boundary.
fetchOpts = { method: "POST", body: form };
} else {
fetchOpts = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
};
}
authFetch("/v1/api/workstreams/new", fetchOpts)
.then(function (r) {
return r.json();
})
@@ -3336,6 +3521,7 @@ function submitNewWs() {
}
if (data.ws_id) {
workstreams[data.ws_id] = { name: data.name, state: "idle" };
_newWsStagedFiles = [];
hideNewWsModal();
switchTab(data.ws_id);
}
@@ -3534,6 +3720,10 @@ function showDashboard() {
document.getElementById("tab-bar").inert = true;
document.getElementById("split-root").inert = true;
loadDashboard();
_loadDashboardOptionsLists();
_restoreDashboardOptionsState();
_refreshDashboardOptionsSummary();
_refreshDashboardSubmitLabel();
setTimeout(function () {
document.getElementById("dashboard-input").focus();
}, 50);
@@ -3546,6 +3736,9 @@ function hideDashboard() {
document.getElementById("tab-bar").inert = false;
document.getElementById("split-root").inert = false;
document.getElementById("dashboard-input").value = "";
_dashboardStagedFiles = [];
_renderDashboardChips();
_refreshDashboardSubmitLabel();
var pane = getFocusedPane();
if (pane) pane.inputEl.focus();
}
@@ -4315,57 +4508,321 @@ function dashboardResumeSession(wsId) {
});
}
function dashboardNewChat() {
hideDashboard();
newWorkstream();
// Staged files for the dashboard composer. Reuses the same file-list pattern
// as the new-workstream modal but lives independently so the two flows don't
// stomp on each other's state.
var _dashboardStagedFiles = [];
// Per-kind size caps mirrored from turnstone/core/attachments.py — keep in sync.
var _DASH_IMAGE_CAP = 4 * 1024 * 1024;
var _DASH_TEXT_CAP = 512 * 1024;
var _DASH_MAX_FILES = 10;
function _renderDashboardChips() {
var chipsEl = document.getElementById("dashboard-attach-chips");
if (!chipsEl) return;
chipsEl.textContent = "";
for (var i = 0; i < _dashboardStagedFiles.length; i++) {
(function (idx) {
var f = _dashboardStagedFiles[idx];
var chip = document.createElement("span");
chip.className = "new-ws-attach-chip";
chip.setAttribute("role", "listitem");
var label = document.createElement("span");
label.className = "new-ws-attach-chip-name";
label.textContent = f.name;
label.title = f.name + " (" + f.size + " bytes)";
chip.appendChild(label);
var size = document.createElement("span");
size.className = "new-ws-attach-chip-size";
size.textContent = _formatAttachSize(f.size);
chip.appendChild(size);
var rm = document.createElement("button");
rm.type = "button";
rm.className = "new-ws-attach-chip-remove";
rm.setAttribute("aria-label", "Remove " + f.name);
rm.textContent = "\u00d7";
rm.onclick = function () {
_dashboardStagedFiles.splice(idx, 1);
_renderDashboardChips();
_refreshDashboardSubmitLabel();
};
chip.appendChild(rm);
chipsEl.appendChild(chip);
})(i);
}
}
function dashboardSendMessage() {
function _addDashboardFiles(files) {
for (var i = 0; i < files.length; i++) {
var f = files[i];
if (_dashboardStagedFiles.length >= _DASH_MAX_FILES) {
_dashboardError(
"At most " + _DASH_MAX_FILES + " attachments per workstream",
);
return;
}
// Drag-drop bypasses the <input accept="..."> filter, so re-check
// against the server's allowlist before the upload roundtrip.
if (!_isAttachmentAllowed(f)) {
_dashboardError(
"Unsupported file type: " +
f.name +
" (allowed: png/jpeg/gif/webp images, text)",
);
return;
}
var isImage = (f.type || "").indexOf("image/") === 0;
var cap = isImage ? _DASH_IMAGE_CAP : _DASH_TEXT_CAP;
if (f.size > cap) {
_dashboardError(
f.name + " exceeds the " + _formatAttachSize(cap) + " cap",
);
return;
}
_dashboardStagedFiles.push(f);
}
_renderDashboardChips();
_refreshDashboardSubmitLabel();
}
var _dashboardErrorTimer = null;
function _dashboardError(msg) {
// Live-region message + outline. title= alone is invisible to screen
// readers and on touch devices, so we surface the message visibly
// beneath the textarea via aria-live="polite".
var input = document.getElementById("dashboard-input");
var errEl = document.getElementById("dashboard-error");
if (errEl) {
errEl.textContent = msg;
}
if (input) {
input.classList.add("dashboard-input-error");
}
if (_dashboardErrorTimer) clearTimeout(_dashboardErrorTimer);
_dashboardErrorTimer = setTimeout(function () {
if (input) input.classList.remove("dashboard-input-error");
if (errEl) errEl.textContent = "";
_dashboardErrorTimer = null;
}, 5000);
}
function _refreshDashboardSubmitLabel() {
var btn = document.getElementById("dashboard-submit-btn");
if (!btn) return;
var input = document.getElementById("dashboard-input");
var hasText = input && input.value.trim().length > 0;
var hasFiles = _dashboardStagedFiles.length > 0;
btn.textContent = hasText || hasFiles ? "Send" : "Create";
}
function _loadDashboardOptionsLists() {
// Models
var modelSel = document.getElementById("dashboard-model");
var judgeSel = document.getElementById("dashboard-judge-model");
if (modelSel && modelSel.options.length <= 1) {
authFetch("/v1/api/models")
.then(function (r) {
return r.json();
})
.then(function (data) {
(data.models || []).forEach(function (m) {
var opt = document.createElement("option");
opt.value = m.alias;
opt.textContent =
m.alias === m.model ? m.alias : m.alias + " (" + m.model + ")";
modelSel.appendChild(opt);
if (judgeSel) {
var jOpt = document.createElement("option");
jOpt.value = m.alias;
jOpt.textContent = opt.textContent;
judgeSel.appendChild(jOpt);
}
});
})
.catch(function () {
/* default model still works */
});
}
// Skills
var skillSel = document.getElementById("dashboard-skill");
if (skillSel && skillSel.options.length <= 1) {
authFetch("/v1/api/skills")
.then(function (r) {
return r.json();
})
.then(function (data) {
(data.skills || []).forEach(function (t) {
var opt = document.createElement("option");
opt.value = t.name;
var label = t.name;
if (t.is_default) label += " (default)";
if (t.origin === "mcp") label += " [MCP]";
opt.textContent = label;
skillSel.appendChild(opt);
});
})
.catch(function () {
/* ignore */
});
}
}
// localStorage key for the dashboard composer's Options-panel disclosure
// state — power users who set non-default model/skill repeatedly want the
// panel to stay open across reloads instead of clicking it every time.
var _DASH_OPTIONS_LS_KEY = "turnstone.dashboard.options_open";
// In-memory fallback for environments where localStorage throws (private
// mode, storage quota, embedded WebViews). null means "no preference
// recorded this session yet — use the closed default".
var _dashOptionsOpenSession = null;
function _setDashboardOptionsOpen(open) {
var panel = document.getElementById("dashboard-options");
var btn = document.getElementById("dashboard-options-btn");
if (!panel || !btn) return;
if (open) {
panel.removeAttribute("hidden");
btn.setAttribute("aria-expanded", "true");
} else {
panel.setAttribute("hidden", "");
btn.setAttribute("aria-expanded", "false");
}
}
function _toggleDashboardOptions() {
var panel = document.getElementById("dashboard-options");
if (!panel) return;
var nextOpen = panel.hasAttribute("hidden");
_setDashboardOptionsOpen(nextOpen);
_dashOptionsOpenSession = nextOpen;
try {
localStorage.setItem(_DASH_OPTIONS_LS_KEY, nextOpen ? "1" : "0");
} catch (_) {
/* localStorage unavailable _dashOptionsOpenSession above keeps the
state for this session so a hide/show cycle preserves the choice. */
}
}
function _restoreDashboardOptionsState() {
// Read order: localStorage (cross-session) → in-memory session value
// → closed default. Only override based on a genuinely-successful
// localStorage read; on throw, fall back to the session value so the
// panel stays where the user last put it within the same tab.
var saved = null;
var lsAvailable = true;
try {
saved = localStorage.getItem(_DASH_OPTIONS_LS_KEY);
} catch (_) {
lsAvailable = false;
}
var open;
if (lsAvailable && saved !== null) {
open = saved === "1";
} else if (_dashOptionsOpenSession !== null) {
open = _dashOptionsOpenSession;
} else {
open = false;
}
_setDashboardOptionsOpen(open);
}
// Update the inline summary chip beside the Options button when any of
// model / judge_model / skill is non-default. Helps users see at a
// glance that they've overridden defaults — without having to expand
// the panel. Hidden when everything is default.
function _refreshDashboardOptionsSummary() {
var summary = document.getElementById("dashboard-options-summary");
if (!summary) return;
var bits = [];
var modelSel = document.getElementById("dashboard-model");
var judgeSel = document.getElementById("dashboard-judge-model");
var skillSel = document.getElementById("dashboard-skill");
if (modelSel && modelSel.value) bits.push(modelSel.value);
if (judgeSel && judgeSel.value) bits.push("judge: " + judgeSel.value);
if (skillSel && skillSel.value) bits.push(skillSel.value);
if (bits.length === 0) {
summary.textContent = "";
summary.setAttribute("hidden", "");
return;
}
summary.textContent = bits.join(" · ");
summary.removeAttribute("hidden");
}
// Unified dashboard submit. Replaces the old "click button → modal" +
// "press Enter → quick-send-empty-config" split. One path: build the
// create payload from text + attachments + options, send it, switch.
function dashboardSubmit() {
var input = document.getElementById("dashboard-input");
var btn = document.getElementById("dashboard-submit-btn");
var text = input.value.trim();
if (!text) return;
var staged = _dashboardStagedFiles.slice();
var body = {};
var model = document.getElementById("dashboard-model").value.trim();
var judge = document.getElementById("dashboard-judge-model").value.trim();
var skill = document.getElementById("dashboard-skill").value;
if (model) body.model = model;
if (judge) body.judge_model = judge;
if (skill) body.skill = skill;
if (text) body.initial_message = text;
input.disabled = true;
var btn = document.querySelector(".dashboard-new-btn");
btn.disabled = true;
authFetch("/v1/api/workstreams/new", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: "{}",
})
var fetchOpts;
if (staged.length > 0) {
var form = new FormData();
form.append("meta", JSON.stringify(body));
for (var i = 0; i < staged.length; i++) {
form.append("file", staged[i], staged[i].name);
}
fetchOpts = { method: "POST", body: form };
} else {
fetchOpts = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
};
}
authFetch("/v1/api/workstreams/new", fetchOpts)
.then(function (r) {
return r.json();
})
.then(function (data) {
if (!data.ws_id) {
input.disabled = false;
btn.disabled = false;
input.disabled = false;
btn.disabled = false;
if (data.error || !data.ws_id) {
_dashboardError(data.error || "Failed to create workstream");
return;
}
workstreams[data.ws_id] = { name: data.name, state: "idle" };
switchTab(data.ws_id);
hideDashboard();
input.disabled = false;
btn.disabled = false;
var pane = getFocusedPane();
if (pane) {
pane.setBusy(true);
pane.addUserMessage(text);
}
authFetch("/v1/api/send", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ message: text, ws_id: data.ws_id }),
}).catch(function (err) {
var p = getFocusedPane();
if (p) {
p.addErrorMessage("Connection error: " + err.message);
p.setBusy(false);
// If we sent an initial_message, the server's worker thread already
// dispatched it. Echo into the pane so the user sees their own text
// immediately rather than waiting for SSE to backfill.
if (text) {
var pane = getFocusedPane();
if (pane) {
pane.setBusy(true);
pane.addUserMessage(text);
}
});
}
})
.catch(function () {
.catch(function (err) {
input.disabled = false;
btn.disabled = false;
// authFetch throws Error("auth") when the user is signed out and the
// login modal has already been surfaced; suppress the redundant
// error toast in that case. Otherwise fall back to a generic
// string so we never render "Connection error: undefined".
if (err && err.message === "auth") return;
var detail = (err && err.message) || "Unable to reach the server";
_dashboardError("Connection error: " + detail);
});
}
@@ -5056,6 +5513,8 @@ function _updatePlanRejectBtn() {
function resolvePlan(defaultFeedback) {
var feedback = document.getElementById("plan-feedback").value.trim();
if (!feedback && defaultFeedback) feedback = defaultFeedback;
// Removing 'active' synchronously is what lets dismissPlanDialog's
// early-return guard treat the server's echoed plan_resolved as a no-op.
document.getElementById("plan-overlay").classList.remove("active");
var pane = panes[_planPaneId];
@@ -5095,7 +5554,70 @@ function resolvePlan(defaultFeedback) {
}
}
function _addInlinePlan(content, action, feedback) {
function dismissPlanDialog(feedback) {
// Sync-dismiss: another client (or the server) already resolved the plan.
// Do NOT call /v1/api/plan — the server has already moved on. The early
// return also handles self-receipt: the client that called resolvePlan()
// already removed the active class, so this is a no-op for that client.
var overlay = document.getElementById("plan-overlay");
if (!overlay.classList.contains("active")) return;
overlay.classList.remove("active");
var pane = panes[_planPaneId];
if (pane) {
pane.inputEl.disabled = false;
pane.sendBtn.disabled = false;
// Restore keyboard context — but skip on touch so we don't surprise the
// mobile user with a soft-keyboard pop after a remote approval.
if (!matchMedia("(pointer: coarse)").matches) pane.inputEl.focus();
}
var fb = feedback || "";
var isReject = fb === "reject";
var isAmend = fb && !isReject;
var action = isReject ? "rejected" : isAmend ? "amending" : "approved";
// Race fallback: if plan_resolved arrives before plan_review (e.g. SSE
// reconnect ordering), _planContent is empty and _addInlinePlan early-
// returns silently. Surface a one-line info message so the user sees
// what happened.
if (_planContent) {
try {
_addInlinePlan(_planContent, action, fb, "remote");
} catch (err) {
console.error("Failed to render inline plan:", err);
if (pane) pane.addInfoMessage("Plan " + action + " on another device");
}
} else if (pane) {
pane.addInfoMessage("Plan " + action + " on another device");
}
// SR announcement (visible toast styling deferred — #toast already has
// aria-live="polite" in markup, this just gives screen-reader parity).
_announce("Plan " + action + " on another device");
if (pane) {
pane.setBusy(true);
pane.addThinkingIndicator();
}
_planContent = "";
_planPaneId = null;
_planWsId = null;
}
function _announce(text) {
var el = document.getElementById("toast");
if (!el) return;
// Re-set textContent in two ticks so screen readers re-announce even
// when the message is identical to the previous one.
el.textContent = "";
setTimeout(function () {
el.textContent = text;
}, 50);
}
function _addInlinePlan(content, action, feedback, origin) {
if (!content) return;
var pane = panes[_planPaneId];
if (!pane) return;
@@ -5111,8 +5633,13 @@ function _addInlinePlan(content, action, feedback) {
: action === "amending"
? "Plan \u2014 amending"
: "Plan approved";
header.innerHTML =
'<span class="plan-inline-label plan-' + action + '">' + label + "</span>";
// Disambiguate remote dismissal — otherwise the desktop user sees "Plan
// approved" with no attribution and may wonder if the agent self-approved.
if (origin === "remote") label += " (synced)";
var labelEl = document.createElement("span");
labelEl.className = "plan-inline-label plan-" + action;
labelEl.textContent = label;
header.appendChild(labelEl);
wrapper.appendChild(header);
var body = document.createElement("div");
@@ -5151,14 +5678,88 @@ document
.getElementById("plan-feedback")
.addEventListener("input", _updatePlanRejectBtn);
document
.getElementById("dashboard-input")
.addEventListener("keydown", function (e) {
if (e.key === "Enter" && !e.shiftKey) {
// Dashboard composer wiring — Enter (no shift) submits, input refreshes the
// button label, paperclip + drag-drop + paste-image stage files, options
// toggle expands the dropdown panel.
(function () {
var input = document.getElementById("dashboard-input");
var attachBtn = document.getElementById("dashboard-attach-btn");
var attachInput = document.getElementById("dashboard-attach-input");
var optionsBtn = document.getElementById("dashboard-options-btn");
var composer = document.getElementById("dashboard-composer");
if (!input) return;
input.addEventListener("keydown", function (e) {
if (e.key === "Enter" && !e.shiftKey && !e.altKey) {
e.preventDefault();
dashboardSendMessage();
dashboardSubmit();
}
});
input.addEventListener("input", _refreshDashboardSubmitLabel);
input.addEventListener("paste", function (e) {
if (!e.clipboardData) return;
var items = e.clipboardData.items || [];
var pasted = [];
for (var i = 0; i < items.length; i++) {
if (items[i].kind === "file") {
var f = items[i].getAsFile();
if (f) pasted.push(f);
}
}
if (pasted.length) {
e.preventDefault();
_addDashboardFiles(pasted);
}
});
if (attachBtn && attachInput) {
attachBtn.addEventListener("click", function () {
attachInput.click();
});
attachInput.addEventListener("change", function () {
if (attachInput.files && attachInput.files.length) {
_addDashboardFiles(attachInput.files);
}
attachInput.value = "";
});
}
if (optionsBtn) {
optionsBtn.addEventListener("click", _toggleDashboardOptions);
}
// Keep the inline summary chip in sync with whichever non-default
// model / judge / skill is selected. Listening on the options panel
// catches all three selects with one handler.
var optionsPanel = document.getElementById("dashboard-options");
if (optionsPanel) {
optionsPanel.addEventListener("change", _refreshDashboardOptionsSummary);
}
if (composer) {
composer.addEventListener("dragover", function (e) {
if (
e.dataTransfer &&
Array.from(e.dataTransfer.types || []).includes("Files")
) {
e.preventDefault();
composer.classList.add("dashboard-composer-drop");
}
});
composer.addEventListener("dragleave", function (e) {
if (e.target === composer)
composer.classList.remove("dashboard-composer-drop");
});
composer.addEventListener("drop", function (e) {
composer.classList.remove("dashboard-composer-drop");
if (
e.dataTransfer &&
e.dataTransfer.files &&
e.dataTransfer.files.length
) {
e.preventDefault();
_addDashboardFiles(e.dataTransfer.files);
}
});
}
})();
document.addEventListener("keydown", function (e) {
// Defer to modal's own keydown handler when any modal is open
+42 -4
View File
@@ -28,10 +28,39 @@
<div id="dashboard" class="dashboard-overlay" role="dialog" aria-modal="true" aria-label="Dashboard">
<div class="dashboard-content">
<div class="dashboard-input-row">
<input type="text" id="dashboard-input" class="dashboard-input"
placeholder="What are you working on?" aria-label="Start a new conversation">
<button class="dashboard-new-btn" onclick="dashboardNewChat()" aria-label="New empty chat">New Chat</button>
<div class="dashboard-composer" id="dashboard-composer">
<textarea id="dashboard-input" class="dashboard-input" rows="3"
placeholder="What are you working on?"
aria-label="Start a new conversation"></textarea>
<div class="dashboard-composer-row">
<div class="dashboard-composer-actions">
<button id="dashboard-attach-btn" class="dashboard-icon-btn" type="button"
title="Attach files" aria-label="Attach files">
<span aria-hidden="true">&#128206;</span>
</button>
<input id="dashboard-attach-input" type="file" multiple style="display:none"
accept="image/png,image/jpeg,image/gif,image/webp,text/*,.md,.txt,.json,.yaml,.yml,.toml,.xml,.html,.css,.js,.jsx,.ts,.tsx,.py,.go,.rs,.java,.c,.cpp,.h,.hpp,.sh,.sql,.ini,.conf">
<button id="dashboard-options-btn" class="dashboard-icon-btn dashboard-options-btn" type="button"
title="Options" aria-label="Toggle options" aria-expanded="false"
aria-controls="dashboard-options">
Options <span aria-hidden="true" class="dashboard-options-caret">&#9662;</span>
</button>
<span id="dashboard-options-summary" class="dashboard-options-summary" aria-live="polite" hidden></span>
</div>
<button id="dashboard-submit-btn" class="dashboard-new-btn" type="button"
onclick="dashboardSubmit()" aria-label="Create workstream">Create</button>
</div>
<div id="dashboard-error" class="dashboard-error" role="status" aria-live="polite"></div>
<div id="dashboard-attach-chips" role="list" aria-label="Pending attachments" aria-live="polite"></div>
<div id="dashboard-options" class="dashboard-options"
role="region" aria-labelledby="dashboard-options-btn" hidden>
<label for="dashboard-model">Model</label>
<select id="dashboard-model"><option value="">Default model</option></select>
<label for="dashboard-judge-model">Judge Model</label>
<select id="dashboard-judge-model"><option value="">Default (agent model)</option></select>
<label for="dashboard-skill">Skill</label>
<select id="dashboard-skill"><option value="">Use defaults</option></select>
</div>
</div>
<div class="dash-header">
<span class="dash-header-title">WORKSTREAMS</span>
@@ -82,6 +111,15 @@
<select id="new-ws-judge-model"><option value="">Default (agent model)</option></select>
<label for="new-ws-skill">Skill <span class="nws-hint">optional</span></label>
<select id="new-ws-skill"><option value="">Use defaults</option></select>
<label for="new-ws-initial-message">First message <span class="nws-hint">optional</span></label>
<textarea id="new-ws-initial-message" rows="3" placeholder="Sent as the first turn after the workstream is created"></textarea>
<div id="new-ws-attach-row">
<button id="new-ws-attach-btn" type="button" title="Attach files to the first turn" aria-label="Attach files">
<span aria-hidden="true">&#128206;</span> Attach
</button>
<input id="new-ws-attach-input" type="file" multiple style="display:none" accept="image/png,image/jpeg,image/gif,image/webp,text/*,.md,.txt,.json,.yaml,.yml,.toml,.xml,.html,.css,.js,.jsx,.ts,.tsx,.py,.go,.rs,.java,.c,.cpp,.h,.hpp,.sh,.sql,.ini,.conf">
<div id="new-ws-attach-chips" role="list" aria-label="Pending attachments"></div>
</div>
<div id="new-ws-buttons">
<button id="new-ws-cancel" type="button">Cancel</button>
<button id="new-ws-submit" type="button">Create</button>
+243 -9
View File
@@ -1025,6 +1025,78 @@ body { position: static; }
.pane-attach-chip-remove:hover { color: var(--red, #c94040); background: var(--bg-surface); }
.pane-attach-chip-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* New-workstream modal: attachment row + chips */
#new-ws-attach-row {
display: flex;
flex-direction: column;
gap: 6px;
margin: 6px 0 4px;
}
#new-ws-attach-btn {
align-self: flex-start;
padding: 4px 10px;
font-family: var(--font-mono);
font-size: 12px;
background: var(--bg);
color: var(--fg);
border: 1px solid var(--border-strong);
border-radius: 4px;
cursor: pointer;
}
#new-ws-attach-btn:hover { background: var(--bg-surface); }
#new-ws-attach-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#new-ws-attach-chips {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
#new-ws-attach-chips:empty { display: none; }
.new-ws-attach-chip {
display: inline-flex;
align-items: center;
gap: 6px;
background: var(--bg);
color: var(--fg);
border: 1px solid var(--border-strong);
border-radius: 999px;
padding: 3px 8px 3px 10px;
font-family: var(--font-mono);
font-size: 11px;
max-width: 280px;
}
.new-ws-attach-chip-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 180px;
}
.new-ws-attach-chip-size { color: var(--fg-dim, var(--fg)); opacity: 0.65; font-size: 10px; }
.new-ws-attach-chip-remove {
background: transparent;
color: var(--fg-dim, var(--fg));
border: none;
padding: 0 4px;
font-size: 14px;
line-height: 1;
cursor: pointer;
border-radius: 50%;
}
.new-ws-attach-chip-remove:hover { color: var(--red, #c94040); background: var(--bg-surface); }
.new-ws-attach-chip-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#new-ws-initial-message {
width: 100%;
font-family: var(--font-mono);
font-size: 13px;
resize: vertical;
min-height: 60px;
background: var(--bg);
color: var(--fg);
border: 1px solid var(--border-strong);
border-radius: 4px;
padding: 6px 8px;
box-sizing: border-box;
}
/* Drag-and-drop visual state on the pane */
.pane.pane-drop-target {
outline: 2px dashed var(--accent);
@@ -1538,21 +1610,176 @@ audio.media-player {
.dashboard-overlay { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 50; overflow-y: auto; }
.dashboard-overlay.active { display: flex; justify-content: center; align-items: flex-start; }
.dashboard-content { width: 100%; max-width: 960px; padding: 32px 20px 24px; }
.dashboard-input-row { display: flex; gap: 8px; margin-bottom: 24px; }
.dashboard-input {
flex: 1;
.dashboard-composer {
display: flex;
flex-direction: column;
gap: 8px;
margin-bottom: 24px;
background: var(--bg-surface);
color: var(--fg);
border: 1px solid var(--border-strong);
border-radius: var(--radius);
padding: 12px 16px;
padding: 10px;
/* position context for the .dashboard-composer-drop::before overlay */
position: relative;
transition: border-color 0.15s, box-shadow 0.15s;
}
.dashboard-composer:focus-within {
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-dim);
}
.dashboard-composer-drop {
border-style: dashed;
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-glow-strong);
background: var(--accent-glow);
}
/* Drag-over affordance make the action explicit so users know what
dropping does. Pseudo-element so the markup stays clean; the inner
composer controls remain interactive. */
.dashboard-composer-drop::before {
content: "Drop to attach";
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
font-family: var(--font-display);
font-size: 14px;
font-weight: 600;
letter-spacing: 0.06em;
color: var(--accent);
background: var(--bg-surface);
opacity: 0.92;
border-radius: var(--radius);
pointer-events: none;
z-index: 1;
}
.dashboard-input {
background: transparent;
color: var(--fg);
border: none;
/* Hairline below the textarea so it reads as an input even before focus */
border-bottom: 1px solid var(--border);
border-radius: 0;
padding: 6px 8px;
font: inherit;
font-size: 14px;
outline: none;
transition: border-color 0.15s, box-shadow 0.15s;
resize: vertical;
min-height: 60px;
font-family: var(--font-mono);
}
.dashboard-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.dashboard-input::placeholder { color: var(--fg-dim); }
.dashboard-input.dashboard-input-error {
outline: 2px solid var(--red);
outline-offset: -1px;
}
.dashboard-error {
color: var(--red);
font-family: var(--font-mono);
font-size: 11px;
min-height: 14px;
padding: 0 4px;
}
.dashboard-error:empty { display: none; }
.dashboard-options-caret {
font-size: 9px;
opacity: 0.7;
transition: transform 0.15s;
}
.dashboard-options-btn[aria-expanded="true"] .dashboard-options-caret {
transform: rotate(180deg);
display: inline-block;
}
/* Inline summary of non-default options so users see at a glance which
defaults they've overridden, without having to expand the panel.
Hidden via [hidden] when everything is default. */
.dashboard-options-summary {
font-family: var(--font-mono);
font-size: 11px;
color: var(--fg-dim);
padding: 2px 6px;
border-left: 1px solid var(--border-strong);
margin-left: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 280px;
}
.dashboard-options-summary[hidden] { display: none; }
@media (max-width: 600px) {
/* On phones the action row stacks; the summary hides to keep the
row compact power users on mobile can expand the panel itself. */
.dashboard-options-summary { display: none; }
}
.dashboard-composer-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 0 4px;
}
.dashboard-composer-actions {
display: flex;
align-items: center;
gap: 6px;
}
.dashboard-icon-btn {
background: transparent;
color: var(--fg-dim, var(--fg));
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
padding: 6px 10px;
font-family: var(--font-mono);
font-size: 12px;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 4px;
/* Larger comfortable hit target without growing the visible chrome */
min-height: 28px;
}
.dashboard-icon-btn:hover { color: var(--fg); background: var(--bg); }
.dashboard-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dashboard-options-btn[aria-expanded="true"] {
color: var(--fg);
background: var(--bg);
}
#dashboard-attach-chips {
display: flex;
flex-wrap: wrap;
gap: 6px;
padding: 0 4px;
}
#dashboard-attach-chips:empty { display: none; }
.dashboard-options {
display: grid;
grid-template-columns: auto 1fr;
gap: 6px 12px;
align-items: center;
padding: 8px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
font-family: var(--font-mono);
font-size: 12px;
}
.dashboard-options[hidden] { display: none; }
.dashboard-options label {
color: var(--fg-dim, var(--fg));
text-transform: uppercase;
font-size: 10px;
letter-spacing: 0.05em;
}
.dashboard-options select {
background: var(--bg-surface);
color: var(--fg);
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
padding: 4px 6px;
font-family: var(--font-mono);
font-size: 12px;
}
.dashboard-new-btn {
background: var(--accent);
color: var(--bg);
@@ -1779,8 +2006,15 @@ audio.media-player {
.dash-row-sub { padding-left: 76px; }
}
@media (max-width: 600px) {
.dashboard-input-row { flex-direction: column; }
.dashboard-new-btn { width: 100%; }
/* Drop the row constraint and let composer children flow vertically so
Send can naturally come after chips + options instead of breaking the
reading order with a giant button mid-card. */
.dashboard-composer-row { display: contents; }
.dashboard-composer-actions { order: 2; justify-content: flex-start; }
.dashboard-composer #dashboard-error { order: 3; }
.dashboard-composer #dashboard-attach-chips { order: 4; }
.dashboard-composer .dashboard-options { order: 5; }
.dashboard-composer .dashboard-new-btn { order: 6; width: 100%; }
}
@media (max-width: 480px) {
.dashboard-content { padding: 24px 12px 16px; }
Generated
+207 -169
View File
@@ -155,7 +155,7 @@ wheels = [
[[package]]
name = "anthropic"
version = "0.94.0"
version = "0.96.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
@@ -167,9 +167,9 @@ dependencies = [
{ name = "sniffio" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/60/d7/11a649b986da06aaeb81334632f1843d70e3797f54ca4a9c5d604b7987d0/anthropic-0.94.0.tar.gz", hash = "sha256:dde8c57de73538c5136c1bca9b16da92e75446b53a73562cc911574e4934435c", size = 654236, upload-time = "2026-04-10T22:27:59.853Z" }
sdist = { url = "https://files.pythonhosted.org/packages/b9/7e/672f533dee813028d2c699bfd2a7f52c9118d7353680d9aa44b9e23f717f/anthropic-0.96.0.tar.gz", hash = "sha256:9de947b737f39452f68aa520f1c2239d44119c9b73b0fb6d4e6ca80f00279ee6", size = 658210, upload-time = "2026-04-16T14:28:02.846Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/0c/ac/7185750e8688f6ff79b0e3d6a61372c88b81ba81fcda8798c70598e18aca/anthropic-0.94.0-py3-none-any.whl", hash = "sha256:42550b401eed8fcd7f6654234560f99c428306301bca726d32bca4bfb6feb748", size = 627519, upload-time = "2026-04-10T22:27:57.541Z" },
{ url = "https://files.pythonhosted.org/packages/48/5a/72f33204064b6e87601a71a6baf8d855769f8a0c1eaae8d06a1094872371/anthropic-0.96.0-py3-none-any.whl", hash = "sha256:9a6e335a354602a521cd9e777e92bfd46ba6e115bf9bbfe6135311e8fb2015b2", size = 635930, upload-time = "2026-04-16T14:28:01.436Z" },
]
[[package]]
@@ -597,16 +597,16 @@ wheels = [
[[package]]
name = "ddgs"
version = "9.13.0"
version = "9.13.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "click" },
{ name = "lxml" },
{ name = "primp" },
]
sdist = { url = "https://files.pythonhosted.org/packages/b0/23/d792684ee325a5965ed9af3fde30af456ca6367529bf137d7582735b3708/ddgs-9.13.0.tar.gz", hash = "sha256:b0b9db0895917d4c6dda54b730cdb1a27501ae4350e8b48182b9c3e87b9dbd84", size = 37311, upload-time = "2026-04-06T15:00:38.075Z" }
sdist = { url = "https://files.pythonhosted.org/packages/11/04/2a40c5253e6772d9a4bf4a3036976d411fc3c3592fdcf0ce555733e08ddc/ddgs-9.13.1.tar.gz", hash = "sha256:b7149326396f9006e6ad5c565ea60cfd643deb4a936f5d2ca6db8f6b29fe26fa", size = 37300, upload-time = "2026-04-14T10:40:03.424Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ff/8d/ea7dba889bc5520f7a40ef191a48b62e59a265f0fdb5973046513f9e94f4/ddgs-9.13.0-py3-none-any.whl", hash = "sha256:3182c2853e7b0cfc030f50cbebee382fa44d6dd258fa55e5d24789ae1e4c6a93", size = 46437, upload-time = "2026-04-06T15:00:36.901Z" },
{ url = "https://files.pythonhosted.org/packages/c1/c7/090c37ec80916da9abc0d88335a5df7efce4755287ddd54bcf3c02b113dd/ddgs-9.13.1-py3-none-any.whl", hash = "sha256:32282cb8ec8f70ef9e4d24ff5c9886c60b17a3b00ef927c75cb76275289a9802", size = 46427, upload-time = "2026-04-14T10:40:02.458Z" },
]
[[package]]
@@ -633,11 +633,11 @@ wheels = [
[[package]]
name = "docstring-parser"
version = "0.17.0"
version = "0.18.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/b2/9d/c3b43da9515bd270df0f80548d9944e389870713cc1fe2b8fb35fe2bcefd/docstring_parser-0.17.0.tar.gz", hash = "sha256:583de4a309722b3315439bb31d64ba3eebada841f2e2cee23b99df001434c912", size = 27442, upload-time = "2025-07-21T07:35:01.868Z" }
sdist = { url = "https://files.pythonhosted.org/packages/e0/4d/f332313098c1de1b2d2ff91cf2674415cc7cddab2ca1b01ae29774bd5fdf/docstring_parser-0.18.0.tar.gz", hash = "sha256:292510982205c12b1248696f44959db3cdd1740237a968ea1e2e7a900eeb2015", size = 29341, upload-time = "2026-04-14T04:09:19.867Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/55/e2/2537ebcff11c1ee1ff17d8d0b6f4db75873e3b0fb32c2d4a2ee31ecb310a/docstring_parser-0.17.0-py3-none-any.whl", hash = "sha256:cf2569abd23dce8099b300f9b4fa8191e9582dda731fd533daf54c4551658708", size = 36896, upload-time = "2025-07-21T07:35:00.684Z" },
{ url = "https://files.pythonhosted.org/packages/a7/5f/ed01f9a3cdffbd5a008556fc7b2a08ddb1cc6ace7effa7340604b1d16699/docstring_parser-0.18.0-py3-none-any.whl", hash = "sha256:b3fcbed555c47d8479be0796ef7e19c2670d428d72e96da63f3a40122860374b", size = 22484, upload-time = "2026-04-14T04:09:18.638Z" },
]
[[package]]
@@ -1173,14 +1173,14 @@ wheels = [
[[package]]
name = "mako"
version = "1.3.10"
version = "1.3.11"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "markupsafe" },
]
sdist = { url = "https://files.pythonhosted.org/packages/9e/38/bd5b78a920a64d708fe6bc8e0a2c075e1389d53bef8413725c63ba041535/mako-1.3.10.tar.gz", hash = "sha256:99579a6f39583fa7e5630a28c3c1f440e4e97a414b80372649c0ce338da2ea28", size = 392474, upload-time = "2025-04-10T12:44:31.16Z" }
sdist = { url = "https://files.pythonhosted.org/packages/59/8a/805404d0c0b9f3d7a326475ca008db57aea9c5c9f2e1e39ed0faa335571c/mako-1.3.11.tar.gz", hash = "sha256:071eb4ab4c5010443152255d77db7faa6ce5916f35226eb02dc34479b6858069", size = 399811, upload-time = "2026-04-14T20:19:51.493Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/87/fb/99f81ac72ae23375f22b7afdb7642aba97c00a713c217124420147681a2f/mako-1.3.10-py3-none-any.whl", hash = "sha256:baef24a52fc4fc514a0887ac600f9f1cff3d82c61d4d700a1fa84d597b88db59", size = 78509, upload-time = "2025-04-10T12:50:53.297Z" },
{ url = "https://files.pythonhosted.org/packages/68/a5/19d7aaa7e433713ffe881df33705925a196afb9532efc8475d26593921a6/mako-1.3.11-py3-none-any.whl", hash = "sha256:e372c6e333cf004aa736a15f425087ec977e1fcbd2966aae7f17c8dc1da27a77", size = 78503, upload-time = "2026-04-14T20:19:53.233Z" },
]
[[package]]
@@ -1410,7 +1410,7 @@ wheels = [
[[package]]
name = "mypy"
version = "1.20.0"
version = "1.20.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "librt", marker = "platform_python_implementation != 'PyPy'" },
@@ -1418,44 +1418,44 @@ dependencies = [
{ name = "pathspec" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/f8/5c/b0089fe7fef0a994ae5ee07029ced0526082c6cfaaa4c10d40a10e33b097/mypy-1.20.0.tar.gz", hash = "sha256:eb96c84efcc33f0b5e0e04beacf00129dd963b67226b01c00b9dfc8affb464c3", size = 3815028, upload-time = "2026-03-31T16:55:14.959Z" }
sdist = { url = "https://files.pythonhosted.org/packages/0b/3d/5b373635b3146264eb7a68d09e5ca11c305bbb058dfffbb47c47daf4f632/mypy-1.20.1.tar.gz", hash = "sha256:6fc3f4ecd52de81648fed1945498bf42fa2993ddfad67c9056df36ae5757f804", size = 3815892, upload-time = "2026-04-13T02:46:51.474Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/6e/1c/74cb1d9993236910286865679d1c616b136b2eae468493aa939431eda410/mypy-1.20.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4525e7010b1b38334516181c5b81e16180b8e149e6684cee5a727c78186b4e3b", size = 14343972, upload-time = "2026-03-31T16:49:04.887Z" },
{ url = "https://files.pythonhosted.org/packages/d5/0d/01399515eca280386e308cf57901e68d3a52af18691941b773b3380c1df8/mypy-1.20.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a17c5d0bdcca61ce24a35beb828a2d0d323d3fcf387d7512206888c900193367", size = 13225007, upload-time = "2026-03-31T16:50:08.151Z" },
{ url = "https://files.pythonhosted.org/packages/56/ac/b4ba5094fb2d7fe9d2037cd8d18bbe02bcf68fd22ab9ff013f55e57ba095/mypy-1.20.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f75ff57defcd0f1d6e006d721ccdec6c88d4f6a7816eb92f1c4890d979d9ee62", size = 13663752, upload-time = "2026-03-31T16:49:26.064Z" },
{ url = "https://files.pythonhosted.org/packages/db/a7/460678d3cf7da252d2288dad0c602294b6ec22a91932ec368cc11e44bb6e/mypy-1.20.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b503ab55a836136b619b5fc21c8803d810c5b87551af8600b72eecafb0059cb0", size = 14532265, upload-time = "2026-03-31T16:53:55.077Z" },
{ url = "https://files.pythonhosted.org/packages/a3/3e/051cca8166cf0438ae3ea80e0e7c030d7a8ab98dffc93f80a1aa3f23c1a2/mypy-1.20.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1973868d2adbb4584a3835780b27436f06d1dc606af5be09f187aaa25be1070f", size = 14768476, upload-time = "2026-03-31T16:50:34.587Z" },
{ url = "https://files.pythonhosted.org/packages/be/66/8e02ec184f852ed5c4abb805583305db475930854e09964b55e107cdcbc4/mypy-1.20.0-cp311-cp311-win_amd64.whl", hash = "sha256:2fcedb16d456106e545b2bfd7ef9d24e70b38ec252d2a629823a4d07ebcdb69e", size = 10818226, upload-time = "2026-03-31T16:53:15.624Z" },
{ url = "https://files.pythonhosted.org/packages/13/4b/383ad1924b28f41e4879a74151e7a5451123330d45652da359f9183bcd45/mypy-1.20.0-cp311-cp311-win_arm64.whl", hash = "sha256:379edf079ce44ac8d2805bcf9b3dd7340d4f97aad3a5e0ebabbf9d125b84b442", size = 9750091, upload-time = "2026-03-31T16:54:12.162Z" },
{ url = "https://files.pythonhosted.org/packages/be/dd/3afa29b58c2e57c79116ed55d700721c3c3b15955e2b6251dd165d377c0e/mypy-1.20.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:002b613ae19f4ac7d18b7e168ffe1cb9013b37c57f7411984abbd3b817b0a214", size = 14509525, upload-time = "2026-03-31T16:55:01.824Z" },
{ url = "https://files.pythonhosted.org/packages/54/eb/227b516ab8cad9f2a13c5e7a98d28cd6aa75e9c83e82776ae6c1c4c046c7/mypy-1.20.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a9336b5e6712f4adaf5afc3203a99a40b379049104349d747eb3e5a3aa23ac2e", size = 13326469, upload-time = "2026-03-31T16:51:41.23Z" },
{ url = "https://files.pythonhosted.org/packages/57/d4/1ddb799860c1b5ac6117ec307b965f65deeb47044395ff01ab793248a591/mypy-1.20.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f13b3e41bce9d257eded794c0f12878af3129d80aacd8a3ee0dee51f3a978651", size = 13705953, upload-time = "2026-03-31T16:48:55.69Z" },
{ url = "https://files.pythonhosted.org/packages/c5/b7/54a720f565a87b893182a2a393370289ae7149e4715859e10e1c05e49154/mypy-1.20.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9804c3ad27f78e54e58b32e7cb532d128b43dbfb9f3f9f06262b821a0f6bd3f5", size = 14710363, upload-time = "2026-03-31T16:53:26.948Z" },
{ url = "https://files.pythonhosted.org/packages/b2/2a/74810274848d061f8a8ea4ac23aaad43bd3d8c1882457999c2e568341c57/mypy-1.20.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:697f102c5c1d526bdd761a69f17c6070f9892eebcb94b1a5963d679288c09e78", size = 14947005, upload-time = "2026-03-31T16:50:17.591Z" },
{ url = "https://files.pythonhosted.org/packages/77/91/21b8ba75f958bcda75690951ce6fa6b7138b03471618959529d74b8544e2/mypy-1.20.0-cp312-cp312-win_amd64.whl", hash = "sha256:0ecd63f75fdd30327e4ad8b5704bd6d91fc6c1b2e029f8ee14705e1207212489", size = 10880616, upload-time = "2026-03-31T16:52:19.986Z" },
{ url = "https://files.pythonhosted.org/packages/8a/15/3d8198ef97c1ca03aea010cce4f1d4f3bc5d9849e8c0140111ca2ead9fdd/mypy-1.20.0-cp312-cp312-win_arm64.whl", hash = "sha256:f194db59657c58593a3c47c6dfd7bad4ef4ac12dbc94d01b3a95521f78177e33", size = 9813091, upload-time = "2026-03-31T16:53:44.385Z" },
{ url = "https://files.pythonhosted.org/packages/d6/a7/f64ea7bd592fa431cb597418b6dec4a47f7d0c36325fec7ac67bc8402b94/mypy-1.20.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b20c8b0fd5877abdf402e79a3af987053de07e6fb208c18df6659f708b535134", size = 14485344, upload-time = "2026-03-31T16:49:16.78Z" },
{ url = "https://files.pythonhosted.org/packages/bb/72/8927d84cfc90c6abea6e96663576e2e417589347eb538749a464c4c218a0/mypy-1.20.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:367e5c993ba34d5054d11937d0485ad6dfc60ba760fa326c01090fc256adf15c", size = 13327400, upload-time = "2026-03-31T16:53:08.02Z" },
{ url = "https://files.pythonhosted.org/packages/ab/4a/11ab99f9afa41aa350178d24a7d2da17043228ea10f6456523f64b5a6cf6/mypy-1.20.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f799d9db89fc00446f03281f84a221e50018fc40113a3ba9864b132895619ebe", size = 13706384, upload-time = "2026-03-31T16:52:28.577Z" },
{ url = "https://files.pythonhosted.org/packages/42/79/694ca73979cfb3535ebfe78733844cd5aff2e63304f59bf90585110d975a/mypy-1.20.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:555658c611099455b2da507582ea20d2043dfdfe7f5ad0add472b1c6238b433f", size = 14700378, upload-time = "2026-03-31T16:48:45.527Z" },
{ url = "https://files.pythonhosted.org/packages/84/24/a022ccab3a46e3d2cdf2e0e260648633640eb396c7e75d5a42818a8d3971/mypy-1.20.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:efe8d70949c3023698c3fca1e94527e7e790a361ab8116f90d11221421cd8726", size = 14932170, upload-time = "2026-03-31T16:49:36.038Z" },
{ url = "https://files.pythonhosted.org/packages/d8/9b/549228d88f574d04117e736f55958bd4908f980f9f5700a07aeb85df005b/mypy-1.20.0-cp313-cp313-win_amd64.whl", hash = "sha256:f49590891d2c2f8a9de15614e32e459a794bcba84693c2394291a2038bbaaa69", size = 10888526, upload-time = "2026-03-31T16:50:59.827Z" },
{ url = "https://files.pythonhosted.org/packages/91/17/15095c0e54a8bc04d22d4ff06b2139d5f142c2e87520b4e39010c4862771/mypy-1.20.0-cp313-cp313-win_arm64.whl", hash = "sha256:76a70bf840495729be47510856b978f1b0ec7d08f257ca38c9d932720bf6b43e", size = 9816456, upload-time = "2026-03-31T16:49:59.537Z" },
{ url = "https://files.pythonhosted.org/packages/4e/0e/6ca4a84cbed9e62384bc0b2974c90395ece5ed672393e553996501625fc5/mypy-1.20.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:0f42dfaab7ec1baff3b383ad7af562ab0de573c5f6edb44b2dab016082b89948", size = 14483331, upload-time = "2026-03-31T16:52:57.999Z" },
{ url = "https://files.pythonhosted.org/packages/7d/c5/5fe9d8a729dd9605064691816243ae6c49fde0bd28f6e5e17f6a24203c43/mypy-1.20.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:31b5dbb55293c1bd27c0fc813a0d2bb5ceef9d65ac5afa2e58f829dab7921fd5", size = 13342047, upload-time = "2026-03-31T16:54:21.555Z" },
{ url = "https://files.pythonhosted.org/packages/4c/33/e18bcfa338ca4e6b2771c85d4c5203e627d0c69d9de5c1a2cf2ba13320ba/mypy-1.20.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49d11c6f573a5a08f77fad13faff2139f6d0730ebed2cfa9b3d2702671dd7188", size = 13719585, upload-time = "2026-03-31T16:51:53.89Z" },
{ url = "https://files.pythonhosted.org/packages/6b/8d/93491ff7b79419edc7eabf95cb3b3f7490e2e574b2855c7c7e7394ff933f/mypy-1.20.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7d3243c406773185144527f83be0e0aefc7bf4601b0b2b956665608bf7c98a83", size = 14685075, upload-time = "2026-03-31T16:54:04.464Z" },
{ url = "https://files.pythonhosted.org/packages/b5/9d/d924b38a4923f8d164bf2b4ec98bf13beaf6e10a5348b4b137eadae40a6e/mypy-1.20.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a79c1eba7ac4209f2d850f0edd0a2f8bba88cbfdfefe6fb76a19e9d4fe5e71a2", size = 14919141, upload-time = "2026-03-31T16:54:51.785Z" },
{ url = "https://files.pythonhosted.org/packages/59/98/1da9977016678c0b99d43afe52ed00bb3c1a0c4c995d3e6acca1a6ebb9b4/mypy-1.20.0-cp314-cp314-win_amd64.whl", hash = "sha256:00e047c74d3ec6e71a2eb88e9ea551a2edb90c21f993aefa9e0d2a898e0bb732", size = 11050925, upload-time = "2026-03-31T16:51:30.758Z" },
{ url = "https://files.pythonhosted.org/packages/5e/e3/ba0b7a3143e49a9c4f5967dde6ea4bf8e0b10ecbbcca69af84027160ee89/mypy-1.20.0-cp314-cp314-win_arm64.whl", hash = "sha256:931a7630bba591593dcf6e97224a21ff80fb357e7982628d25e3c618e7f598ef", size = 10001089, upload-time = "2026-03-31T16:49:43.632Z" },
{ url = "https://files.pythonhosted.org/packages/12/28/e617e67b3be9d213cda7277913269c874eb26472489f95d09d89765ce2d8/mypy-1.20.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:26c8b52627b6552f47ff11adb4e1509605f094e29815323e487fc0053ebe93d1", size = 15534710, upload-time = "2026-03-31T16:52:12.506Z" },
{ url = "https://files.pythonhosted.org/packages/6e/0c/3b5f2d3e45dc7169b811adce8451679d9430399d03b168f9b0489f43adaa/mypy-1.20.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:39362cdb4ba5f916e7976fccecaab1ba3a83e35f60fa68b64e9a70e221bb2436", size = 14393013, upload-time = "2026-03-31T16:54:41.186Z" },
{ url = "https://files.pythonhosted.org/packages/a3/49/edc8b0aa145cc09c1c74f7ce2858eead9329931dcbbb26e2ad40906daa4e/mypy-1.20.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:34506397dbf40c15dc567635d18a21d33827e9ab29014fb83d292a8f4f8953b6", size = 15047240, upload-time = "2026-03-31T16:54:31.955Z" },
{ url = "https://files.pythonhosted.org/packages/42/37/a946bb416e37a57fa752b3100fd5ede0e28df94f92366d1716555d47c454/mypy-1.20.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:555493c44a4f5a1b58d611a43333e71a9981c6dbe26270377b6f8174126a0526", size = 15858565, upload-time = "2026-03-31T16:53:36.997Z" },
{ url = "https://files.pythonhosted.org/packages/2f/99/7690b5b5b552db1bd4ff362e4c0eb3107b98d680835e65823fbe888c8b78/mypy-1.20.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:2721f0ce49cb74a38f00c50da67cb7d36317b5eda38877a49614dc018e91c787", size = 16087874, upload-time = "2026-03-31T16:52:48.313Z" },
{ url = "https://files.pythonhosted.org/packages/aa/76/53e893a498138066acd28192b77495c9357e5a58cc4be753182846b43315/mypy-1.20.0-cp314-cp314t-win_amd64.whl", hash = "sha256:47781555a7aa5fedcc2d16bcd72e0dc83eb272c10dd657f9fb3f9cc08e2e6abb", size = 12572380, upload-time = "2026-03-31T16:49:52.454Z" },
{ url = "https://files.pythonhosted.org/packages/76/9c/6dbdae21f01b7aacddc2c0bbf3c5557aa547827fdf271770fe1e521e7093/mypy-1.20.0-cp314-cp314t-win_arm64.whl", hash = "sha256:c70380fe5d64010f79fb863b9081c7004dd65225d2277333c219d93a10dad4dd", size = 10381174, upload-time = "2026-03-31T16:51:20.179Z" },
{ url = "https://files.pythonhosted.org/packages/21/66/4d734961ce167f0fd8380769b3b7c06dbdd6ff54c2190f3f2ecd22528158/mypy-1.20.0-py3-none-any.whl", hash = "sha256:a6e0641147cbfa7e4e94efdb95c2dab1aff8cfc159ded13e07f308ddccc8c48e", size = 2636365, upload-time = "2026-03-31T16:51:44.911Z" },
{ url = "https://files.pythonhosted.org/packages/82/0d/555ab7453cc4a4a8643b7f21c842b1a84c36b15392061ae7b052ee119320/mypy-1.20.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c01eb9bac2c6a962d00f9d23421cd2913840e65bba365167d057bd0b4171a92e", size = 14336012, upload-time = "2026-04-13T02:45:39.935Z" },
{ url = "https://files.pythonhosted.org/packages/57/26/85a28893f7db8a16ebb41d1e9dfcb4475844d06a88480b6639e32a74d6ef/mypy-1.20.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:55d12ddbd8a9cac5b276878bd534fa39fff5bf543dc6ae18f25d30c8d7d27fca", size = 13224636, upload-time = "2026-04-13T02:45:49.659Z" },
{ url = "https://files.pythonhosted.org/packages/93/41/bd4cd3c2caeb6c448b669222b8cfcbdee4a03b89431527b56fca9e56b6f3/mypy-1.20.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c0aa322c1468b6cdfc927a44ce130f79bb44bcd34eb4a009eb9f96571fd80955", size = 13663471, upload-time = "2026-04-13T02:46:20.276Z" },
{ url = "https://files.pythonhosted.org/packages/3e/56/7ee8c471e10402d64b6517ae10434541baca053cffd81090e4097d5609d4/mypy-1.20.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3f8bc95899cf676b6e2285779a08a998cc3a7b26f1026752df9d2741df3c79e8", size = 14532344, upload-time = "2026-04-13T02:46:44.205Z" },
{ url = "https://files.pythonhosted.org/packages/b5/95/b37d1fa859a433f6156742e12f62b0bb75af658544fb6dada9363918743a/mypy-1.20.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:47c2b90191a870a04041e910277494b0d92f0711be9e524d45c074fe60c00b65", size = 14776670, upload-time = "2026-04-13T02:45:52.481Z" },
{ url = "https://files.pythonhosted.org/packages/03/77/b302e4cb0b80d2bdf6bf4fce5864bb4cbfa461f7099cea544eaf2457df78/mypy-1.20.1-cp311-cp311-win_amd64.whl", hash = "sha256:9857dc8d2ec1a392ffbda518075beb00ac58859979c79f9e6bdcb7277082c2f2", size = 10816524, upload-time = "2026-04-13T02:45:37.711Z" },
{ url = "https://files.pythonhosted.org/packages/7f/21/d969d7a68eb964993ebcc6170d5ecaf0cf65830c58ac3344562e16dc42a9/mypy-1.20.1-cp311-cp311-win_arm64.whl", hash = "sha256:09d8df92bb25b6065ab91b178da843dda67b33eb819321679a6e98a907ce0e10", size = 9750419, upload-time = "2026-04-13T02:45:08.542Z" },
{ url = "https://files.pythonhosted.org/packages/69/1b/75a7c825a02781ca10bc2f2f12fba2af5202f6d6005aad8d2d1f264d8d78/mypy-1.20.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:36ee2b9c6599c230fea89bbd79f401f9f9f8e9fcf0c777827789b19b7da90f51", size = 14494077, upload-time = "2026-04-13T02:45:55.085Z" },
{ url = "https://files.pythonhosted.org/packages/b0/54/5e5a569ea5c2b4d48b729fb32aa936eeb4246e4fc3e6f5b3d36a2dfbefb9/mypy-1.20.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fba3fb0968a7b48806b0c90f38d39296f10766885a94c83bd21399de1e14eb28", size = 13319495, upload-time = "2026-04-13T02:45:29.674Z" },
{ url = "https://files.pythonhosted.org/packages/6f/a4/a1945b19f33e91721b59deee3abb484f2fa5922adc33bb166daf5325d76d/mypy-1.20.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ef1415a637cd3627d6304dfbeddbadd21079dafc2a8a753c477ce4fc0c2af54f", size = 13696948, upload-time = "2026-04-13T02:46:15.006Z" },
{ url = "https://files.pythonhosted.org/packages/b2/c6/75e969781c2359b2f9c15b061f28ec6d67c8b61865ceda176e85c8e7f2de/mypy-1.20.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ef3461b1ad5cd446e540016e90b5984657edda39f982f4cc45ca317b628f5a37", size = 14706744, upload-time = "2026-04-13T02:46:00.482Z" },
{ url = "https://files.pythonhosted.org/packages/a8/6e/b221b1de981fc4262fe3e0bf9ec272d292dfe42394a689c2d49765c144c4/mypy-1.20.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:542dd63c9e1339b6092eb25bd515f3a32a1453aee8c9521d2ddb17dacd840237", size = 14949035, upload-time = "2026-04-13T02:45:06.021Z" },
{ url = "https://files.pythonhosted.org/packages/ca/4b/298ba2de0aafc0da3ff2288da06884aae7ba6489bc247c933f87847c41b3/mypy-1.20.1-cp312-cp312-win_amd64.whl", hash = "sha256:1d55c7cd8ca22e31f93af2a01160a9e95465b5878de23dba7e48116052f20a8d", size = 10883216, upload-time = "2026-04-13T02:45:47.232Z" },
{ url = "https://files.pythonhosted.org/packages/c7/f9/5e25b8f0b8cb92f080bfed9c21d3279b2a0b6a601cdca369a039ba84789d/mypy-1.20.1-cp312-cp312-win_arm64.whl", hash = "sha256:f5b84a79070586e0d353ee07b719d9d0a4aa7c8ee90c0ea97747e98cbe193019", size = 9814299, upload-time = "2026-04-13T02:45:21.934Z" },
{ url = "https://files.pythonhosted.org/packages/21/e8/ef0991aa24c8f225df10b034f3c2681213cb54cf247623c6dec9a5744e70/mypy-1.20.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8f3886c03e40afefd327bd70b3f634b39ea82e87f314edaa4d0cce4b927ddcc1", size = 14500739, upload-time = "2026-04-13T02:46:05.442Z" },
{ url = "https://files.pythonhosted.org/packages/23/73/416ebec3047636ed89fa871dc8c54bf05e9e20aa9499da59790d7adb312d/mypy-1.20.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e860eb3904f9764e83bafd70c8250bdffdc7dde6b82f486e8156348bf7ceb184", size = 13314735, upload-time = "2026-04-13T02:46:47.154Z" },
{ url = "https://files.pythonhosted.org/packages/10/1e/1505022d9c9ac2e014a384eb17638fb37bf8e9d0a833ea60605b66f8f7ba/mypy-1.20.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a4b5aac6e785719da51a84f5d09e9e843d473170a9045b1ea7ea1af86225df4b", size = 13704356, upload-time = "2026-04-13T02:45:19.773Z" },
{ url = "https://files.pythonhosted.org/packages/98/91/275b01f5eba5c467a3318ec214dd865abb66e9c811231c8587287b92876a/mypy-1.20.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f37b6cd0fe2ad3a20f05ace48ca3523fc52ff86940e34937b439613b6854472e", size = 14696420, upload-time = "2026-04-13T02:45:24.205Z" },
{ url = "https://files.pythonhosted.org/packages/a1/57/b3779e134e1b7250d05f874252780d0a88c068bc054bcff99ca20a3a2986/mypy-1.20.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e4bbb0f6b54ce7cc350ef4a770650d15fa70edd99ad5267e227133eda9c94218", size = 14936093, upload-time = "2026-04-13T02:45:32.087Z" },
{ url = "https://files.pythonhosted.org/packages/be/33/81b64991b0f3f278c3b55c335888794af190b2d59031a5ad1401bcb69f1e/mypy-1.20.1-cp313-cp313-win_amd64.whl", hash = "sha256:c3dc20f8ec76eecd77148cdd2f1542ed496e51e185713bf488a414f862deb8f2", size = 10889659, upload-time = "2026-04-13T02:46:02.926Z" },
{ url = "https://files.pythonhosted.org/packages/1b/fd/7adcb8053572edf5ef8f3db59599dfeeee3be9cc4c8c97e2d28f66f42ac5/mypy-1.20.1-cp313-cp313-win_arm64.whl", hash = "sha256:a9d62bbac5d6d46718e2b0330b25e6264463ed832722b8f7d4440ff1be3ca895", size = 9815515, upload-time = "2026-04-13T02:46:32.103Z" },
{ url = "https://files.pythonhosted.org/packages/40/cd/db831e84c81d57d4886d99feee14e372f64bbec6a9cb1a88a19e243f2ef5/mypy-1.20.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:12927b9c0ed794daedcf1dab055b6c613d9d5659ac511e8d936d96f19c087d12", size = 14483064, upload-time = "2026-04-13T02:45:26.901Z" },
{ url = "https://files.pythonhosted.org/packages/d5/82/74e62e7097fa67da328ac8ece8de09133448c04d20ddeaeba251a3000f01/mypy-1.20.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:752507dd481e958b2c08fc966d3806c962af5a9433b5bf8f3bdd7175c20e34fe", size = 13335694, upload-time = "2026-04-13T02:46:12.514Z" },
{ url = "https://files.pythonhosted.org/packages/74/c4/97e9a0abe4f3cdbbf4d079cb87a03b786efeccf5bf2b89fe4f96939ab2e6/mypy-1.20.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c614655b5a065e56274c6cbbe405f7cf7e96c0654db7ba39bc680238837f7b08", size = 13726365, upload-time = "2026-04-13T02:45:17.422Z" },
{ url = "https://files.pythonhosted.org/packages/d7/aa/a19d884a8d28fcd3c065776323029f204dbc774e70ec9c85eba228b680de/mypy-1.20.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2c3f6221a76f34d5100c6d35b3ef6b947054123c3f8d6938a4ba00b1308aa572", size = 14693472, upload-time = "2026-04-13T02:46:41.253Z" },
{ url = "https://files.pythonhosted.org/packages/84/44/cc9324bd21cf786592b44bf3b5d224b3923c1230ec9898d508d00241d465/mypy-1.20.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:4bdfc06303ac06500af71ea0cdbe995c502b3c9ba32f3f8313523c137a25d1b6", size = 14919266, upload-time = "2026-04-13T02:46:28.37Z" },
{ url = "https://files.pythonhosted.org/packages/6e/dc/779abb25a8c63e8f44bf5a336217fa92790fa17e0c40e0c725d10cb01bbd/mypy-1.20.1-cp314-cp314-win_amd64.whl", hash = "sha256:0131edd7eba289973d1ba1003d1a37c426b85cdef76650cd02da6420898a5eb3", size = 11049713, upload-time = "2026-04-13T02:45:57.673Z" },
{ url = "https://files.pythonhosted.org/packages/28/08/4172be2ad7de9119b5a92ca36abbf641afdc5cb1ef4ae0c3a8182f29674f/mypy-1.20.1-cp314-cp314-win_arm64.whl", hash = "sha256:33f02904feb2c07e1fdf7909026206396c9deeb9e6f34d466b4cfedb0aadbbe4", size = 9999819, upload-time = "2026-04-13T02:46:35.039Z" },
{ url = "https://files.pythonhosted.org/packages/2d/af/af9e46b0c8eabbce9fc04a477564170f47a1c22b308822282a59b7ff315f/mypy-1.20.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:168472149dd8cc505c98cefd21ad77e4257ed6022cd5ed2fe2999bed56977a5a", size = 15547508, upload-time = "2026-04-13T02:46:25.588Z" },
{ url = "https://files.pythonhosted.org/packages/a7/cd/39c9e4ad6ba33e069e5837d772a9e6c304b4a5452a14a975d52b36444650/mypy-1.20.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:eb674600309a8f22790cca883a97c90299f948183ebb210fbef6bcee07cb1986", size = 14399557, upload-time = "2026-04-13T02:46:10.021Z" },
{ url = "https://files.pythonhosted.org/packages/83/c1/3fd71bdc118ffc502bf57559c909927bb7e011f327f7bb8e0488e98a5870/mypy-1.20.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ef2b2e4cc464ba9795459f2586923abd58a0055487cbe558cb538ea6e6bc142a", size = 15045789, upload-time = "2026-04-13T02:45:10.81Z" },
{ url = "https://files.pythonhosted.org/packages/8e/73/6f07ff8b57a7d7b3e6e5bf34685d17632382395c8bb53364ec331661f83e/mypy-1.20.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dee461d396dd46b3f0ed5a098dbc9b8860c81c46ad44fa071afcfbc149f167c9", size = 15850795, upload-time = "2026-04-13T02:45:03.349Z" },
{ url = "https://files.pythonhosted.org/packages/ec/e2/f7dffec1c7767078f9e9adf0c786d1fe0ff30964a77eb213c09b8b58cb76/mypy-1.20.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:e364926308b3e66f1361f81a566fc1b2f8cd47fc8525e8136d4058a65a4b4f02", size = 16088539, upload-time = "2026-04-13T02:46:17.841Z" },
{ url = "https://files.pythonhosted.org/packages/1a/76/e0dee71035316e75a69d73aec2f03c39c21c967b97e277fd0ef8fd6aec66/mypy-1.20.1-cp314-cp314t-win_amd64.whl", hash = "sha256:a0c17fbd746d38c70cbc42647cfd884f845a9708a4b160a8b4f7e70d41f4d7fa", size = 12575567, upload-time = "2026-04-13T02:45:34.795Z" },
{ url = "https://files.pythonhosted.org/packages/22/a8/7ed43c9d9c3d1468f86605e323a5d97e411a448790a00f07e779f3211a46/mypy-1.20.1-cp314-cp314t-win_arm64.whl", hash = "sha256:db2cb89654626a912efda69c0d5c1d22d948265e2069010d3dde3abf751c7d08", size = 10378823, upload-time = "2026-04-13T02:45:13.35Z" },
{ url = "https://files.pythonhosted.org/packages/d8/28/926bd972388e65a39ee98e188ccf67e81beb3aacfd5d6b310051772d974b/mypy-1.20.1-py3-none-any.whl", hash = "sha256:1aae28507f253fe82d883790d1c0a0d35798a810117c88184097fe8881052f06", size = 2636553, upload-time = "2026-04-13T02:46:30.45Z" },
]
[[package]]
@@ -1548,7 +1548,7 @@ wheels = [
[[package]]
name = "openai"
version = "2.31.0"
version = "2.32.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
@@ -1560,18 +1560,18 @@ dependencies = [
{ name = "tqdm" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/94/fe/64b3d035780b3188f86c4f6f1bc202e7bb74757ef028802112273b9dcacf/openai-2.31.0.tar.gz", hash = "sha256:43ca59a88fc973ad1848d86b98d7fac207e265ebbd1828b5e4bdfc85f79427a5", size = 684772, upload-time = "2026-04-08T21:01:41.797Z" }
sdist = { url = "https://files.pythonhosted.org/packages/ed/59/bdcc6b759b8c42dd73afaf5bf8f902c04b37987a5514dbc1c64dba390fef/openai-2.32.0.tar.gz", hash = "sha256:c54b27a9e4cb8d51f0dd94972ffd1a04437efeb259a9e60d8922b8bd26fe55e0", size = 693286, upload-time = "2026-04-15T22:28:19.434Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/66/bc/a8f7c3aa03452fedbb9af8be83e959adba96a6b4a35e416faffcc959c568/openai-2.31.0-py3-none-any.whl", hash = "sha256:44e1344d87e56a493d649b17e2fac519d1368cbb0745f59f1957c4c26de50a0a", size = 1153479, upload-time = "2026-04-08T21:01:39.217Z" },
{ url = "https://files.pythonhosted.org/packages/1e/c1/d6e64ccd0536bf616556f0cad2b6d94a8125f508d25cfd814b1d2db4e2f1/openai-2.32.0-py3-none-any.whl", hash = "sha256:4dcc9badeb4bf54ad0d187453742f290226d30150890b7890711bda4f32f192f", size = 1162570, upload-time = "2026-04-15T22:28:17.714Z" },
]
[[package]]
name = "packaging"
version = "26.0"
version = "26.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/65/ee/299d360cdc32edc7d2cf530f3accf79c4fca01e96ffc950d8a52213bd8e4/packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4", size = 143416, upload-time = "2026-01-21T20:50:39.064Z" }
sdist = { url = "https://files.pythonhosted.org/packages/df/de/0d2b39fb4af88a0258f3bac87dfcbb48e73fbdea4a2ed0e2213f9a4c2f9a/packaging-26.1.tar.gz", hash = "sha256:f042152b681c4bfac5cae2742a55e103d27ab2ec0f3d88037136b6bfe7c9c5de", size = 215519, upload-time = "2026-04-14T21:12:49.362Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529", size = 74366, upload-time = "2026-01-21T20:50:37.788Z" },
{ url = "https://files.pythonhosted.org/packages/7a/c2/920ef838e2f0028c8262f16101ec09ebd5969864e5a64c4c05fad0617c56/packaging-26.1-py3-none-any.whl", hash = "sha256:5d9c0669c6285e491e0ced2eee587eaf67b670d94a19e94e3984a481aba6802f", size = 95831, upload-time = "2026-04-14T21:12:47.56Z" },
]
[[package]]
@@ -1809,7 +1809,7 @@ wheels = [
[[package]]
name = "pydantic"
version = "2.12.5"
version = "2.13.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "annotated-types" },
@@ -1817,106 +1817,111 @@ dependencies = [
{ name = "typing-extensions" },
{ name = "typing-inspection" },
]
sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" }
sdist = { url = "https://files.pythonhosted.org/packages/f3/6b/1353beb3d1cd5cf61cdec5b6f87a9872399de3bc5cae0b7ce07ff4de2ab0/pydantic-2.13.1.tar.gz", hash = "sha256:a0f829b279ddd1e39291133fe2539d2aa46cc6b150c1706a270ff0879e3774d2", size = 843746, upload-time = "2026-04-15T14:57:19.398Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" },
{ url = "https://files.pythonhosted.org/packages/81/5a/2225f4c176dbfed0d809e848b50ef08f70e61daa667b7fa14b0d311ae44d/pydantic-2.13.1-py3-none-any.whl", hash = "sha256:9557ecc2806faaf6037f85b1fbd963d01e30511c48085f0d573650fdeaad378a", size = 471917, upload-time = "2026-04-15T14:57:17.277Z" },
]
[[package]]
name = "pydantic-core"
version = "2.41.5"
version = "2.46.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" }
sdist = { url = "https://files.pythonhosted.org/packages/a1/93/f97a86a7eb28faa1d038af2fd5d6166418b4433659108a4c311b57128b2d/pydantic_core-2.46.1.tar.gz", hash = "sha256:d408153772d9f298098fb5d620f045bdf0f017af0d5cb6e309ef8c205540caa4", size = 471230, upload-time = "2026-04-15T14:49:34.52Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/e8/72/74a989dd9f2084b3d9530b0915fdda64ac48831c30dbf7c72a41a5232db8/pydantic_core-2.41.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a3a52f6156e73e7ccb0f8cced536adccb7042be67cb45f9562e12b319c119da6", size = 2105873, upload-time = "2025-11-04T13:39:31.373Z" },
{ url = "https://files.pythonhosted.org/packages/12/44/37e403fd9455708b3b942949e1d7febc02167662bf1a7da5b78ee1ea2842/pydantic_core-2.41.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7f3bf998340c6d4b0c9a2f02d6a400e51f123b59565d74dc60d252ce888c260b", size = 1899826, upload-time = "2025-11-04T13:39:32.897Z" },
{ url = "https://files.pythonhosted.org/packages/33/7f/1d5cab3ccf44c1935a359d51a8a2a9e1a654b744b5e7f80d41b88d501eec/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:378bec5c66998815d224c9ca994f1e14c0c21cb95d2f52b6021cc0b2a58f2a5a", size = 1917869, upload-time = "2025-11-04T13:39:34.469Z" },
{ url = "https://files.pythonhosted.org/packages/6e/6a/30d94a9674a7fe4f4744052ed6c5e083424510be1e93da5bc47569d11810/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b576130c69225432866fe2f4a469a85a54ade141d96fd396dffcf607b558f8", size = 2063890, upload-time = "2025-11-04T13:39:36.053Z" },
{ url = "https://files.pythonhosted.org/packages/50/be/76e5d46203fcb2750e542f32e6c371ffa9b8ad17364cf94bb0818dbfb50c/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6cb58b9c66f7e4179a2d5e0f849c48eff5c1fca560994d6eb6543abf955a149e", size = 2229740, upload-time = "2025-11-04T13:39:37.753Z" },
{ url = "https://files.pythonhosted.org/packages/d3/ee/fed784df0144793489f87db310a6bbf8118d7b630ed07aa180d6067e653a/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88942d3a3dff3afc8288c21e565e476fc278902ae4d6d134f1eeda118cc830b1", size = 2350021, upload-time = "2025-11-04T13:39:40.94Z" },
{ url = "https://files.pythonhosted.org/packages/c8/be/8fed28dd0a180dca19e72c233cbf58efa36df055e5b9d90d64fd1740b828/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f31d95a179f8d64d90f6831d71fa93290893a33148d890ba15de25642c5d075b", size = 2066378, upload-time = "2025-11-04T13:39:42.523Z" },
{ url = "https://files.pythonhosted.org/packages/b0/3b/698cf8ae1d536a010e05121b4958b1257f0b5522085e335360e53a6b1c8b/pydantic_core-2.41.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c1df3d34aced70add6f867a8cf413e299177e0c22660cc767218373d0779487b", size = 2175761, upload-time = "2025-11-04T13:39:44.553Z" },
{ url = "https://files.pythonhosted.org/packages/b8/ba/15d537423939553116dea94ce02f9c31be0fa9d0b806d427e0308ec17145/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:4009935984bd36bd2c774e13f9a09563ce8de4abaa7226f5108262fa3e637284", size = 2146303, upload-time = "2025-11-04T13:39:46.238Z" },
{ url = "https://files.pythonhosted.org/packages/58/7f/0de669bf37d206723795f9c90c82966726a2ab06c336deba4735b55af431/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:34a64bc3441dc1213096a20fe27e8e128bd3ff89921706e83c0b1ac971276594", size = 2340355, upload-time = "2025-11-04T13:39:48.002Z" },
{ url = "https://files.pythonhosted.org/packages/e5/de/e7482c435b83d7e3c3ee5ee4451f6e8973cff0eb6007d2872ce6383f6398/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c9e19dd6e28fdcaa5a1de679aec4141f691023916427ef9bae8584f9c2fb3b0e", size = 2319875, upload-time = "2025-11-04T13:39:49.705Z" },
{ url = "https://files.pythonhosted.org/packages/fe/e6/8c9e81bb6dd7560e33b9053351c29f30c8194b72f2d6932888581f503482/pydantic_core-2.41.5-cp311-cp311-win32.whl", hash = "sha256:2c010c6ded393148374c0f6f0bf89d206bf3217f201faa0635dcd56bd1520f6b", size = 1987549, upload-time = "2025-11-04T13:39:51.842Z" },
{ url = "https://files.pythonhosted.org/packages/11/66/f14d1d978ea94d1bc21fc98fcf570f9542fe55bfcc40269d4e1a21c19bf7/pydantic_core-2.41.5-cp311-cp311-win_amd64.whl", hash = "sha256:76ee27c6e9c7f16f47db7a94157112a2f3a00e958bc626e2f4ee8bec5c328fbe", size = 2011305, upload-time = "2025-11-04T13:39:53.485Z" },
{ url = "https://files.pythonhosted.org/packages/56/d8/0e271434e8efd03186c5386671328154ee349ff0354d83c74f5caaf096ed/pydantic_core-2.41.5-cp311-cp311-win_arm64.whl", hash = "sha256:4bc36bbc0b7584de96561184ad7f012478987882ebf9f9c389b23f432ea3d90f", size = 1972902, upload-time = "2025-11-04T13:39:56.488Z" },
{ url = "https://files.pythonhosted.org/packages/5f/5d/5f6c63eebb5afee93bcaae4ce9a898f3373ca23df3ccaef086d0233a35a7/pydantic_core-2.41.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f41a7489d32336dbf2199c8c0a215390a751c5b014c2c1c5366e817202e9cdf7", size = 2110990, upload-time = "2025-11-04T13:39:58.079Z" },
{ url = "https://files.pythonhosted.org/packages/aa/32/9c2e8ccb57c01111e0fd091f236c7b371c1bccea0fa85247ac55b1e2b6b6/pydantic_core-2.41.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:070259a8818988b9a84a449a2a7337c7f430a22acc0859c6b110aa7212a6d9c0", size = 1896003, upload-time = "2025-11-04T13:39:59.956Z" },
{ url = "https://files.pythonhosted.org/packages/68/b8/a01b53cb0e59139fbc9e4fda3e9724ede8de279097179be4ff31f1abb65a/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e96cea19e34778f8d59fe40775a7a574d95816eb150850a85a7a4c8f4b94ac69", size = 1919200, upload-time = "2025-11-04T13:40:02.241Z" },
{ url = "https://files.pythonhosted.org/packages/38/de/8c36b5198a29bdaade07b5985e80a233a5ac27137846f3bc2d3b40a47360/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed2e99c456e3fadd05c991f8f437ef902e00eedf34320ba2b0842bd1c3ca3a75", size = 2052578, upload-time = "2025-11-04T13:40:04.401Z" },
{ url = "https://files.pythonhosted.org/packages/00/b5/0e8e4b5b081eac6cb3dbb7e60a65907549a1ce035a724368c330112adfdd/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65840751b72fbfd82c3c640cff9284545342a4f1eb1586ad0636955b261b0b05", size = 2208504, upload-time = "2025-11-04T13:40:06.072Z" },
{ url = "https://files.pythonhosted.org/packages/77/56/87a61aad59c7c5b9dc8caad5a41a5545cba3810c3e828708b3d7404f6cef/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e536c98a7626a98feb2d3eaf75944ef6f3dbee447e1f841eae16f2f0a72d8ddc", size = 2335816, upload-time = "2025-11-04T13:40:07.835Z" },
{ url = "https://files.pythonhosted.org/packages/0d/76/941cc9f73529988688a665a5c0ecff1112b3d95ab48f81db5f7606f522d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c", size = 2075366, upload-time = "2025-11-04T13:40:09.804Z" },
{ url = "https://files.pythonhosted.org/packages/d3/43/ebef01f69baa07a482844faaa0a591bad1ef129253ffd0cdaa9d8a7f72d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d38548150c39b74aeeb0ce8ee1d8e82696f4a4e16ddc6de7b1d8823f7de4b9b5", size = 2171698, upload-time = "2025-11-04T13:40:12.004Z" },
{ url = "https://files.pythonhosted.org/packages/b1/87/41f3202e4193e3bacfc2c065fab7706ebe81af46a83d3e27605029c1f5a6/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c23e27686783f60290e36827f9c626e63154b82b116d7fe9adba1fda36da706c", size = 2132603, upload-time = "2025-11-04T13:40:13.868Z" },
{ url = "https://files.pythonhosted.org/packages/49/7d/4c00df99cb12070b6bccdef4a195255e6020a550d572768d92cc54dba91a/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:482c982f814460eabe1d3bb0adfdc583387bd4691ef00b90575ca0d2b6fe2294", size = 2329591, upload-time = "2025-11-04T13:40:15.672Z" },
{ url = "https://files.pythonhosted.org/packages/cc/6a/ebf4b1d65d458f3cda6a7335d141305dfa19bdc61140a884d165a8a1bbc7/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bfea2a5f0b4d8d43adf9d7b8bf019fb46fdd10a2e5cde477fbcb9d1fa08c68e1", size = 2319068, upload-time = "2025-11-04T13:40:17.532Z" },
{ url = "https://files.pythonhosted.org/packages/49/3b/774f2b5cd4192d5ab75870ce4381fd89cf218af999515baf07e7206753f0/pydantic_core-2.41.5-cp312-cp312-win32.whl", hash = "sha256:b74557b16e390ec12dca509bce9264c3bbd128f8a2c376eaa68003d7f327276d", size = 1985908, upload-time = "2025-11-04T13:40:19.309Z" },
{ url = "https://files.pythonhosted.org/packages/86/45/00173a033c801cacf67c190fef088789394feaf88a98a7035b0e40d53dc9/pydantic_core-2.41.5-cp312-cp312-win_amd64.whl", hash = "sha256:1962293292865bca8e54702b08a4f26da73adc83dd1fcf26fbc875b35d81c815", size = 2020145, upload-time = "2025-11-04T13:40:21.548Z" },
{ url = "https://files.pythonhosted.org/packages/f9/22/91fbc821fa6d261b376a3f73809f907cec5ca6025642c463d3488aad22fb/pydantic_core-2.41.5-cp312-cp312-win_arm64.whl", hash = "sha256:1746d4a3d9a794cacae06a5eaaccb4b8643a131d45fbc9af23e353dc0a5ba5c3", size = 1976179, upload-time = "2025-11-04T13:40:23.393Z" },
{ url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" },
{ url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" },
{ url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" },
{ url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" },
{ url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" },
{ url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" },
{ url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" },
{ url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" },
{ url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" },
{ url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" },
{ url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" },
{ url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" },
{ url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" },
{ url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" },
{ url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" },
{ url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" },
{ url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" },
{ url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" },
{ url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" },
{ url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" },
{ url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" },
{ url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" },
{ url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" },
{ url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" },
{ url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" },
{ url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" },
{ url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" },
{ url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" },
{ url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" },
{ url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" },
{ url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" },
{ url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" },
{ url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" },
{ url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" },
{ url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" },
{ url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" },
{ url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" },
{ url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" },
{ url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" },
{ url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" },
{ url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" },
{ url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" },
{ url = "https://files.pythonhosted.org/packages/11/72/90fda5ee3b97e51c494938a4a44c3a35a9c96c19bba12372fb9c634d6f57/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:b96d5f26b05d03cc60f11a7761a5ded1741da411e7fe0909e27a5e6a0cb7b034", size = 2115441, upload-time = "2025-11-04T13:42:39.557Z" },
{ url = "https://files.pythonhosted.org/packages/1f/53/8942f884fa33f50794f119012dc6a1a02ac43a56407adaac20463df8e98f/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:634e8609e89ceecea15e2d61bc9ac3718caaaa71963717bf3c8f38bfde64242c", size = 1930291, upload-time = "2025-11-04T13:42:42.169Z" },
{ url = "https://files.pythonhosted.org/packages/79/c8/ecb9ed9cd942bce09fc888ee960b52654fbdbede4ba6c2d6e0d3b1d8b49c/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:93e8740d7503eb008aa2df04d3b9735f845d43ae845e6dcd2be0b55a2da43cd2", size = 1948632, upload-time = "2025-11-04T13:42:44.564Z" },
{ url = "https://files.pythonhosted.org/packages/2e/1b/687711069de7efa6af934e74f601e2a4307365e8fdc404703afc453eab26/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15489ba13d61f670dcc96772e733aad1a6f9c429cc27574c6cdaed82d0146ad", size = 2138905, upload-time = "2025-11-04T13:42:47.156Z" },
{ url = "https://files.pythonhosted.org/packages/09/32/59b0c7e63e277fa7911c2fc70ccfb45ce4b98991e7ef37110663437005af/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:7da7087d756b19037bc2c06edc6c170eeef3c3bafcb8f532ff17d64dc427adfd", size = 2110495, upload-time = "2025-11-04T13:42:49.689Z" },
{ url = "https://files.pythonhosted.org/packages/aa/81/05e400037eaf55ad400bcd318c05bb345b57e708887f07ddb2d20e3f0e98/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:aabf5777b5c8ca26f7824cb4a120a740c9588ed58df9b2d196ce92fba42ff8dc", size = 1915388, upload-time = "2025-11-04T13:42:52.215Z" },
{ url = "https://files.pythonhosted.org/packages/6e/0d/e3549b2399f71d56476b77dbf3cf8937cec5cd70536bdc0e374a421d0599/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c007fe8a43d43b3969e8469004e9845944f1a80e6acd47c150856bb87f230c56", size = 1942879, upload-time = "2025-11-04T13:42:56.483Z" },
{ url = "https://files.pythonhosted.org/packages/f7/07/34573da085946b6a313d7c42f82f16e8920bfd730665de2d11c0c37a74b5/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76d0819de158cd855d1cbb8fcafdf6f5cf1eb8e470abe056d5d161106e38062b", size = 2139017, upload-time = "2025-11-04T13:42:59.471Z" },
{ url = "https://files.pythonhosted.org/packages/5f/9b/1b3f0e9f9305839d7e84912f9e8bfbd191ed1b1ef48083609f0dabde978c/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b2379fa7ed44ddecb5bfe4e48577d752db9fc10be00a6b7446e9663ba143de26", size = 2101980, upload-time = "2025-11-04T13:43:25.97Z" },
{ url = "https://files.pythonhosted.org/packages/a4/ed/d71fefcb4263df0da6a85b5d8a7508360f2f2e9b3bf5814be9c8bccdccc1/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:266fb4cbf5e3cbd0b53669a6d1b039c45e3ce651fd5442eff4d07c2cc8d66808", size = 1923865, upload-time = "2025-11-04T13:43:28.763Z" },
{ url = "https://files.pythonhosted.org/packages/ce/3a/626b38db460d675f873e4444b4bb030453bbe7b4ba55df821d026a0493c4/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58133647260ea01e4d0500089a8c4f07bd7aa6ce109682b1426394988d8aaacc", size = 2134256, upload-time = "2025-11-04T13:43:31.71Z" },
{ url = "https://files.pythonhosted.org/packages/83/d9/8412d7f06f616bbc053d30cb4e5f76786af3221462ad5eee1f202021eb4e/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:287dad91cfb551c363dc62899a80e9e14da1f0e2b6ebde82c806612ca2a13ef1", size = 2174762, upload-time = "2025-11-04T13:43:34.744Z" },
{ url = "https://files.pythonhosted.org/packages/55/4c/162d906b8e3ba3a99354e20faa1b49a85206c47de97a639510a0e673f5da/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:03b77d184b9eb40240ae9fd676ca364ce1085f203e1b1256f8ab9984dca80a84", size = 2143141, upload-time = "2025-11-04T13:43:37.701Z" },
{ url = "https://files.pythonhosted.org/packages/1f/f2/f11dd73284122713f5f89fc940f370d035fa8e1e078d446b3313955157fe/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:a668ce24de96165bb239160b3d854943128f4334822900534f2fe947930e5770", size = 2330317, upload-time = "2025-11-04T13:43:40.406Z" },
{ url = "https://files.pythonhosted.org/packages/88/9d/b06ca6acfe4abb296110fb1273a4d848a0bfb2ff65f3ee92127b3244e16b/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f14f8f046c14563f8eb3f45f499cc658ab8d10072961e07225e507adb700e93f", size = 2316992, upload-time = "2025-11-04T13:43:43.602Z" },
{ url = "https://files.pythonhosted.org/packages/36/c7/cfc8e811f061c841d7990b0201912c3556bfeb99cdcb7ed24adc8d6f8704/pydantic_core-2.41.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:56121965f7a4dc965bff783d70b907ddf3d57f6eba29b6d2e5dabfaf07799c51", size = 2145302, upload-time = "2025-11-04T13:43:46.64Z" },
{ url = "https://files.pythonhosted.org/packages/37/96/d83d23fc3c822326d808b8c0457d4f7afb1552e741a7c2378a974c522c63/pydantic_core-2.46.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:f0f84431981c6ae217ebb96c3eca8212f6f5edf116f62f62cc6c7d72971f826c", size = 2121938, upload-time = "2026-04-15T14:49:21.568Z" },
{ url = "https://files.pythonhosted.org/packages/11/44/94b1251825560f5d90e25ebcd457c4772e1f3e1a378f438c040fe2148f3e/pydantic_core-2.46.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a05f60b36549f59ab585924410187276ec17a94bae939273a213cea252c8471e", size = 1946541, upload-time = "2026-04-15T14:49:57.925Z" },
{ url = "https://files.pythonhosted.org/packages/d6/8f/79aff4c8bd6fb49001ffe4747c775c0f066add9da13dec180eb0023ada34/pydantic_core-2.46.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2c93fd1693afdfae7b2897f7530ed3f180d9fc92ee105df3ebdff24d5061cc8", size = 1973067, upload-time = "2026-04-15T14:51:14.765Z" },
{ url = "https://files.pythonhosted.org/packages/56/01/826ab3afb1d43cbfdc2aa592bff0f1f6f4b90f5a801478ba07bde74e706f/pydantic_core-2.46.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0c19983759394c702a776f42f33df8d7bb7883aefaa44a69ba86356a9fd67367", size = 2053146, upload-time = "2026-04-15T14:51:48.847Z" },
{ url = "https://files.pythonhosted.org/packages/6c/32/be20ec48ccbd85cac3f8d96ca0a0f87d5c14fbf1eb438da0ac733f2546f2/pydantic_core-2.46.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6e8debf586d7d800a718194417497db5126d4f4302885a2dff721e9df3f4851c", size = 2227393, upload-time = "2026-04-15T14:51:53.218Z" },
{ url = "https://files.pythonhosted.org/packages/b5/8e/1fae21c887f363ed1a5cf9f267027700c796b7435313c21723cd3e8aeeb3/pydantic_core-2.46.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:54160da754d63da7780b76e5743d44f026b9daffc6b8c9696a756368c0a298c9", size = 2296193, upload-time = "2026-04-15T14:50:31.065Z" },
{ url = "https://files.pythonhosted.org/packages/0a/29/e5637b539458ffb60ba9c204fc16c52ea36828427fa667e4f9c7d83cfea9/pydantic_core-2.46.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:74cee962c8b4df9a9b0bb63582e51986127ee2316f0c49143b2996f4b201bd9c", size = 2092156, upload-time = "2026-04-15T14:52:37.227Z" },
{ url = "https://files.pythonhosted.org/packages/bc/fa/3a453934af019c72652fb75489c504ae689de632fa2e037fec3195cd6948/pydantic_core-2.46.1-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:0ba3462872a678ebe21b15bd78eff40298b43ea50c26f230ec535c00cf93ec7e", size = 2142845, upload-time = "2026-04-15T14:51:04.847Z" },
{ url = "https://files.pythonhosted.org/packages/36/c2/71b56fa10a80b98036f4bf0fbb912833f8e9c61b15e66c236fadaf54c27c/pydantic_core-2.46.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b718873a966d91514c5252775f568985401b54a220919ab22b19a6c4edd8c053", size = 2170756, upload-time = "2026-04-15T14:50:17.16Z" },
{ url = "https://files.pythonhosted.org/packages/e1/da/a4c761dc8d982e2c53f991c0c36d37f6fe308e149bf0a101c25b0750a893/pydantic_core-2.46.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:cb1310a9fd722da8cceec1fb59875e1c86bee37f0d8a9c667220f00ee722cc8f", size = 2183579, upload-time = "2026-04-15T14:51:20.888Z" },
{ url = "https://files.pythonhosted.org/packages/e5/d4/b0a6c00622e4afd9a807b8bb05ba8f1a0b69ca068ac138d9d36700fe767b/pydantic_core-2.46.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:98e3ede76eb4b9db8e7b5efea07a3f3315135485794a5df91e3adf56c4d573b6", size = 2324516, upload-time = "2026-04-15T14:52:32.521Z" },
{ url = "https://files.pythonhosted.org/packages/45/f1/a4bace0c98b0774b02de99233882c48d94b399ba4394dd5e209665d05062/pydantic_core-2.46.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:780b8f24ff286e21fd010247011a68ea902c34b1eee7d775b598bc28f5f28ab6", size = 2367084, upload-time = "2026-04-15T14:50:37.832Z" },
{ url = "https://files.pythonhosted.org/packages/3a/54/ae827a3976b136d1c9a9a56c2299a8053605a69facaa0c7354ba167305eb/pydantic_core-2.46.1-cp311-cp311-win32.whl", hash = "sha256:1d452f4cad0f39a94414ca68cda7cc55ff4c3801b5ab0bc99818284a3d39f889", size = 1992061, upload-time = "2026-04-15T14:51:44.704Z" },
{ url = "https://files.pythonhosted.org/packages/55/ae/d85de69e0fdfafc0e87d88bd5d0c157a5443efaaef24eed152a8a8f8dfb6/pydantic_core-2.46.1-cp311-cp311-win_amd64.whl", hash = "sha256:f463fd6a67138d70200d2627676e9efbb0cee26d98a5d3042a35aa20f95ec129", size = 2065497, upload-time = "2026-04-15T14:51:17.077Z" },
{ url = "https://files.pythonhosted.org/packages/46/a7/9eb3b1038db630e1550924e81d1211b0dd70ac3740901fd95f30f5497990/pydantic_core-2.46.1-cp311-cp311-win_arm64.whl", hash = "sha256:155aec0a117140e86775eec113b574c1c299358bfd99467b2ea7b2ea26db2614", size = 2045914, upload-time = "2026-04-15T14:51:24.782Z" },
{ url = "https://files.pythonhosted.org/packages/ce/fb/caaa8ee23861c170f07dbd58fc2be3a2c02a32637693cbb23eef02e84808/pydantic_core-2.46.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:ae8c8c5eb4c796944f3166f2f0dab6c761c2c2cc5bd20e5f692128be8600b9a4", size = 2119472, upload-time = "2026-04-15T14:49:45.946Z" },
{ url = "https://files.pythonhosted.org/packages/fa/61/bcffaa52894489ff89e5e1cdde67429914bf083c0db7296bef153020f786/pydantic_core-2.46.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:daba6f5f5b986aa0682623a1a4f8d1ecb0ec00ce09cfa9ca71a3b742bc383e3a", size = 1951230, upload-time = "2026-04-15T14:52:27.646Z" },
{ url = "https://files.pythonhosted.org/packages/f8/95/80d2f43a2a1a1e3220fd329d614aa5a39e0a75d24353a3aaf226e605f1c2/pydantic_core-2.46.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0265f3a2460539ecc97817a80c7a23c458dd84191229b655522a2674f701f14e", size = 1976394, upload-time = "2026-04-15T14:50:32.742Z" },
{ url = "https://files.pythonhosted.org/packages/8d/31/2c5b1a207926b5fc1961a2d11da940129bc3841c36cc4df03014195b2966/pydantic_core-2.46.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb16c0156c4b4e94aa3719138cc43c53d30ff21126b6a3af63786dcc0757b56e", size = 2068455, upload-time = "2026-04-15T14:50:01.286Z" },
{ url = "https://files.pythonhosted.org/packages/7d/36/c6aa07274359a51ac62895895325ce90107e811c6cea39d2617a99ef10d7/pydantic_core-2.46.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1b42d80fad8e4b283e1e4138f1142f0d038c46d137aad2f9824ad9086080dd41", size = 2239049, upload-time = "2026-04-15T14:53:02.216Z" },
{ url = "https://files.pythonhosted.org/packages/0a/3f/77cdd0db8bddc714842dfd93f737c863751cf02001c993341504f6b0cd53/pydantic_core-2.46.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9cced85896d5b795293bc36b7e2fb0347a36c828551b50cbba510510d928548c", size = 2318681, upload-time = "2026-04-15T14:50:04.539Z" },
{ url = "https://files.pythonhosted.org/packages/a1/a3/09d929a40e6727274b0b500ad06e1b3f35d4f4665ae1c8ba65acbb17e9b5/pydantic_core-2.46.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a641cb1e74b44c418adaf9f5f450670dbec53511f030d8cde8d8accb66edc363", size = 2096527, upload-time = "2026-04-15T14:53:14.766Z" },
{ url = "https://files.pythonhosted.org/packages/89/ae/544c3a82456ebc254a9fcbe2715bab76c70acf9d291aaea24391147943e4/pydantic_core-2.46.1-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:191e7a122ab14eb12415fe3f92610fc06c7f1d2b4b9101d24d490d447ac92506", size = 2170407, upload-time = "2026-04-15T14:51:27.138Z" },
{ url = "https://files.pythonhosted.org/packages/9d/ce/0dfd881c7af4c522f47b325707bd9a2cdcf4f40e4f2fd30df0e9a3e8d393/pydantic_core-2.46.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4fe4ff660f7938b5d92f21529ce331b011aa35e481ab64b7cd03f52384e544bb", size = 2188578, upload-time = "2026-04-15T14:50:39.655Z" },
{ url = "https://files.pythonhosted.org/packages/a1/e9/980ea2a6d5114dd1a62ecc5f56feb3d34555f33bd11043f042e5f7f0724a/pydantic_core-2.46.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:18fcea085b3adc3868d8d19606da52d7a52d8bccd8e28652b0778dbe5e6a6660", size = 2188959, upload-time = "2026-04-15T14:52:42.243Z" },
{ url = "https://files.pythonhosted.org/packages/e7/f1/595e0f50f4bfc56cde2fe558f2b0978f29f2865da894c6226231e17464a5/pydantic_core-2.46.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:e8e589e7c9466e022d79e13c5764c2239b2e5a7993ba727822b021234f89b56b", size = 2339973, upload-time = "2026-04-15T14:52:10.642Z" },
{ url = "https://files.pythonhosted.org/packages/49/44/be9f979a6ab6b8c36865ccd92c3a38a760c66055e1f384665f35525134c4/pydantic_core-2.46.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f78eb3d4027963bdc9baccd177f02a98bf8714bc51fe17153d8b51218918b5bc", size = 2385228, upload-time = "2026-04-15T14:51:00.77Z" },
{ url = "https://files.pythonhosted.org/packages/5b/d4/c826cd711787d240219f01d0d3ca116cb55516b8b95277820aa9c85e1882/pydantic_core-2.46.1-cp312-cp312-win32.whl", hash = "sha256:54fe30c20cab03844dc63bdc6ddca67f74a2eb8482df69c1e5f68396856241be", size = 1978828, upload-time = "2026-04-15T14:50:29.362Z" },
{ url = "https://files.pythonhosted.org/packages/22/05/8a1fcf8181be4c7a9cfc34e5fbf2d9c3866edc9dfd3c48d5401806e0a523/pydantic_core-2.46.1-cp312-cp312-win_amd64.whl", hash = "sha256:aea4e22ed4c53f2774221435e39969a54d2e783f4aee902cdd6c8011415de893", size = 2070015, upload-time = "2026-04-15T14:49:47.301Z" },
{ url = "https://files.pythonhosted.org/packages/61/d5/fea36ad2882b99c174ef4ffbc7ea6523f6abe26060fbc1f77d6441670232/pydantic_core-2.46.1-cp312-cp312-win_arm64.whl", hash = "sha256:f76fb49c34b4d66aa6e552ce9e852ea97a3a06301a9f01ae82f23e449e3a55f8", size = 2030176, upload-time = "2026-04-15T14:50:47.307Z" },
{ url = "https://files.pythonhosted.org/packages/ff/d2/bda39bad2f426cb5078e6ad28076614d3926704196efe0d7a2a19a99025d/pydantic_core-2.46.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:cdc8a5762a9c4b9d86e204d555444e3227507c92daba06259ee66595834de47a", size = 2119092, upload-time = "2026-04-15T14:49:50.392Z" },
{ url = "https://files.pythonhosted.org/packages/ee/f3/69631e64d69cb3481494b2bddefe0ddd07771209f74e9106d066f9138c2a/pydantic_core-2.46.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ba381dfe9c85692c566ecb60fa5a77a697a2a8eebe274ec5e4d6ec15fafad799", size = 1951400, upload-time = "2026-04-15T14:51:06.588Z" },
{ url = "https://files.pythonhosted.org/packages/53/1c/21cb3db6ae997df31be8e91f213081f72ffa641cb45c89b8a1986832b1f9/pydantic_core-2.46.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1593d8de98207466dc070118322fef68307a0cc6a5625e7b386f6fdae57f9ab6", size = 1976864, upload-time = "2026-04-15T14:50:54.804Z" },
{ url = "https://files.pythonhosted.org/packages/91/9c/05c819f734318ce5a6ca24da300d93696c105af4adb90494ee571303afd8/pydantic_core-2.46.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8262c74a1af5b0fdf795f5537f7145785a63f9fbf9e15405f547440c30017ed8", size = 2066669, upload-time = "2026-04-15T14:51:42.346Z" },
{ url = "https://files.pythonhosted.org/packages/cb/23/fadddf1c7f2f517f58731aea9b35c914e6005250f08dac9b8e53904cdbaa/pydantic_core-2.46.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4b88949a24182e83fbbb3f7ca9b7858d0d37b735700ea91081434b7d37b3b444", size = 2238737, upload-time = "2026-04-15T14:50:45.558Z" },
{ url = "https://files.pythonhosted.org/packages/23/07/0cd4f95cb0359c8b1ec71e89c3777e7932c8dfeb9cd54740289f310aaead/pydantic_core-2.46.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8f3708cd55537aeaf3fd0ea55df0d68d0da51dcb07cbc8508745b34acc4c6e0", size = 2316258, upload-time = "2026-04-15T14:51:08.471Z" },
{ url = "https://files.pythonhosted.org/packages/0c/40/6fc24c3766a19c222a0d60d652b78f0283339d4cd4c173fab06b7ee76571/pydantic_core-2.46.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f79292435fff1d4f0c18d9cfaf214025cc88e4f5104bfaed53f173621da1c743", size = 2097474, upload-time = "2026-04-15T14:49:56.543Z" },
{ url = "https://files.pythonhosted.org/packages/4b/af/f39795d1ce549e35d0841382b9c616ae211caffb88863147369a8d74fba9/pydantic_core-2.46.1-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:a2e607aeb59cf4575bb364470288db3b9a1f0e7415d053a322e3e154c1a0802e", size = 2168383, upload-time = "2026-04-15T14:51:29.269Z" },
{ url = "https://files.pythonhosted.org/packages/e6/32/0d563f74582795779df6cc270c3fc220f49f4daf7860d74a5a6cda8491ff/pydantic_core-2.46.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ec5ca190b75878a9f6ae1fc8f5eb678497934475aef3d93204c9fa01e97370b6", size = 2186182, upload-time = "2026-04-15T14:50:19.097Z" },
{ url = "https://files.pythonhosted.org/packages/5c/07/1c10d5ce312fc4cf86d1e50bdcdbb8ef248409597b099cab1b4bb3a093f7/pydantic_core-2.46.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:1f80535259dcdd517d7b8ca588d5ca24b4f337228e583bebedf7a3adcdf5f721", size = 2187859, upload-time = "2026-04-15T14:49:22.974Z" },
{ url = "https://files.pythonhosted.org/packages/92/01/e1f62d4cb39f0913dbf5c95b9b119ef30ddba9493dff8c2b012f0cdd67dc/pydantic_core-2.46.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:24820b3c82c43df61eca30147e42853e6c127d8b868afdc0c162df829e011eb4", size = 2338372, upload-time = "2026-04-15T14:49:53.316Z" },
{ url = "https://files.pythonhosted.org/packages/44/ed/218dfeea6127fb1781a6ceca241ec6edf00e8a8933ff331af2215975a534/pydantic_core-2.46.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:f12794b1dd8ac9fb66619e0b3a0427189f5d5638e55a3de1385121a9b7bf9b39", size = 2384039, upload-time = "2026-04-15T14:53:04.929Z" },
{ url = "https://files.pythonhosted.org/packages/6c/1e/011e763cd059238249fbd5780e0f8d0b04b47f86c8925e22784f3e5fc977/pydantic_core-2.46.1-cp313-cp313-win32.whl", hash = "sha256:9bc09aed935cdf50f09e908923f9efbcca54e9244bd14a5a0e2a6c8d2c21b4e9", size = 1977943, upload-time = "2026-04-15T14:52:17.969Z" },
{ url = "https://files.pythonhosted.org/packages/8c/06/b559a490d3ed106e9b1777b8d5c8112dd8d31716243cd662616f66c1f8ea/pydantic_core-2.46.1-cp313-cp313-win_amd64.whl", hash = "sha256:fac2d6c8615b8b42bee14677861ba09d56ee076ba4a65cfb9c3c3d0cc89042f2", size = 2068729, upload-time = "2026-04-15T14:53:07.288Z" },
{ url = "https://files.pythonhosted.org/packages/9f/52/32a198946e2e19508532aa9da02a61419eb15bd2d96bab57f810f2713e31/pydantic_core-2.46.1-cp313-cp313-win_arm64.whl", hash = "sha256:f978329f12ace9f3cb814a5e44d98bbeced2e36f633132bafa06d2d71332e33e", size = 2029550, upload-time = "2026-04-15T14:52:22.707Z" },
{ url = "https://files.pythonhosted.org/packages/bd/2b/6793fe89ab66cb2d3d6e5768044eab80bba1d0fae8fd904d0a1574712e17/pydantic_core-2.46.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:9917cb61effac7ec0f448ef491ec7584526d2193be84ff981e85cbf18b68c42a", size = 2118110, upload-time = "2026-04-15T14:50:52.947Z" },
{ url = "https://files.pythonhosted.org/packages/d2/87/e9a905ddfcc2fd7bd862b340c02be6ab1f827922822d425513635d0ac774/pydantic_core-2.46.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0e749679ca9f8a9d0bff95fb7f6b57bb53f2207fa42ffcc1ec86de7e0029ab89", size = 1948645, upload-time = "2026-04-15T14:51:55.577Z" },
{ url = "https://files.pythonhosted.org/packages/15/23/26e67f86ed62ac9d6f7f3091ee5220bf14b5ac36fb811851d601365ef896/pydantic_core-2.46.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2ecacee70941e233a2dad23f7796a06f86cc10cc2fbd1c97c7dd5b5a79ffa4f", size = 1977576, upload-time = "2026-04-15T14:49:37.58Z" },
{ url = "https://files.pythonhosted.org/packages/b8/78/813c13c0de323d4de54ee2e6fdd69a0271c09ac8dd65a8a000931aa487a5/pydantic_core-2.46.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:647d0a2475b8ed471962eed92fa69145b864942f9c6daa10f95ac70676637ae7", size = 2060358, upload-time = "2026-04-15T14:51:40.087Z" },
{ url = "https://files.pythonhosted.org/packages/09/5e/4caf2a15149271fbd2b4d968899a450853c800b85152abcf54b11531417f/pydantic_core-2.46.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac9cde61965b0697fce6e6cc372df9e1ad93734828aac36e9c1c42a22ad02897", size = 2235980, upload-time = "2026-04-15T14:50:34.535Z" },
{ url = "https://files.pythonhosted.org/packages/c2/c1/a2cdabb5da6f5cb63a3558bcafffc20f790fa14ccffbefbfb1370fadc93f/pydantic_core-2.46.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0a2eb0864085f8b641fb3f54a2fb35c58aff24b175b80bc8a945050fcde03204", size = 2316800, upload-time = "2026-04-15T14:52:46.999Z" },
{ url = "https://files.pythonhosted.org/packages/76/fd/19d711e4e9331f9d77f222bffc202bf30ea0d74f6419046376bb82f244c8/pydantic_core-2.46.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b83ce9fede4bc4fb649281d9857f06d30198b8f70168f18b987518d713111572", size = 2101762, upload-time = "2026-04-15T14:49:24.278Z" },
{ url = "https://files.pythonhosted.org/packages/dc/64/ce95625448e1a4e219390a2923fd594f3fa368599c6b42ac71a5df7238c9/pydantic_core-2.46.1-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:cb33192753c60f269d2f4a1db8253c95b0df6e04f2989631a8cc1b0f4f6e2e92", size = 2167737, upload-time = "2026-04-15T14:50:41.637Z" },
{ url = "https://files.pythonhosted.org/packages/ad/31/413572d03ca3e73b408f00f54418b91a8be6401451bc791eaeff210328e5/pydantic_core-2.46.1-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:96611d51f953f87e1ae97637c01ee596a08b7f494ea00a5afb67ea6547b9f53b", size = 2185658, upload-time = "2026-04-15T14:51:46.799Z" },
{ url = "https://files.pythonhosted.org/packages/36/09/e4f581353bdf3f0c7de8a8b27afd14fc761da29d78146376315a6fedc487/pydantic_core-2.46.1-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:9b176fa55f9107db5e6c86099aa5bfd934f1d3ba6a8b43f714ddeebaed3f42b7", size = 2184154, upload-time = "2026-04-15T14:52:49.629Z" },
{ url = "https://files.pythonhosted.org/packages/1a/a4/d0d52849933f5a4bf1ad9d8da612792f96469b37e286a269e3ee9c60bbb1/pydantic_core-2.46.1-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:79a59f63a4ce4f3330e27e6f3ce281dd1099453b637350e97d7cf24c207cd120", size = 2332379, upload-time = "2026-04-15T14:49:55.009Z" },
{ url = "https://files.pythonhosted.org/packages/30/93/25bfb08fdbef419f73290e573899ce938a327628c34e8f3a4bafeea30126/pydantic_core-2.46.1-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:f200fce071808a385a314b7343f5e3688d7c45746be3d64dc71ee2d3e2a13268", size = 2377964, upload-time = "2026-04-15T14:51:59.649Z" },
{ url = "https://files.pythonhosted.org/packages/15/36/b777766ff83fef1cf97473d64764cd44f38e0d8c269ed06faace9ae17666/pydantic_core-2.46.1-cp314-cp314-win32.whl", hash = "sha256:3a07eccc0559fb9acc26d55b16bf8ebecd7f237c74a9e2c5741367db4e6d8aff", size = 1976450, upload-time = "2026-04-15T14:51:57.665Z" },
{ url = "https://files.pythonhosted.org/packages/7b/4b/4cd19d2437acfc18ca166db5a2067040334991eb862c4ecf2db098c91fbf/pydantic_core-2.46.1-cp314-cp314-win_amd64.whl", hash = "sha256:1706d270309ac7d071ffe393988c471363705feb3d009186e55d17786ada9622", size = 2067750, upload-time = "2026-04-15T14:49:38.941Z" },
{ url = "https://files.pythonhosted.org/packages/7f/a0/490751c0ef8f5b27aae81731859aed1508e72c1a9b5774c6034269db773b/pydantic_core-2.46.1-cp314-cp314-win_arm64.whl", hash = "sha256:22d4e7457ade8af06528012f382bc994a97cc2ce6e119305a70b3deff1e409d6", size = 2021109, upload-time = "2026-04-15T14:50:27.728Z" },
{ url = "https://files.pythonhosted.org/packages/36/3a/2a018968245fffd25d5f1972714121ad309ff2de19d80019ad93494844f9/pydantic_core-2.46.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:607ff9db0b7e2012e7eef78465e69f9a0d7d1c3e7c6a84cf0c4011db0fcc3feb", size = 2111548, upload-time = "2026-04-15T14:52:08.273Z" },
{ url = "https://files.pythonhosted.org/packages/77/5b/4103b6192213217e874e764e5467d2ff10d8873c1147d01fa432ac281880/pydantic_core-2.46.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:8cda3eacaea13bd02a1bea7e457cc9fc30b91c5a91245cef9b215140f80dd78c", size = 1926745, upload-time = "2026-04-15T14:50:03.045Z" },
{ url = "https://files.pythonhosted.org/packages/c3/70/602a667cf4be4bec6c3334512b12ae4ea79ce9bfe41dc51be1fd34434453/pydantic_core-2.46.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b9493279cdc7997fe19e5ed9b41f30cbc3806bd4722adb402fedb6f6d41bd72a", size = 1965922, upload-time = "2026-04-15T14:51:12.555Z" },
{ url = "https://files.pythonhosted.org/packages/a9/24/06a89ce5323e755b7d2812189f9706b87aaebe49b34d247b380502f7992c/pydantic_core-2.46.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3644e5e10059999202355b6c6616e624909e23773717d8f76deb8a6e2a72328c", size = 2043221, upload-time = "2026-04-15T14:51:18.995Z" },
{ url = "https://files.pythonhosted.org/packages/2c/6e/b1d9ad907d9d76964903903349fd2e33c87db4b993cc44713edcad0fc488/pydantic_core-2.46.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4ad6c9de57683e26c92730991960c0c3571b8053263b042de2d3e105930b2767", size = 2243655, upload-time = "2026-04-15T14:50:10.718Z" },
{ url = "https://files.pythonhosted.org/packages/ef/73/787abfaad51174641abb04c8aa125322279b40ad7ce23c495f5a69f76554/pydantic_core-2.46.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:557ebaa27c7617e7088002318c679a8ce685fa048523417cd1ca52b7f516d955", size = 2295976, upload-time = "2026-04-15T14:53:09.694Z" },
{ url = "https://files.pythonhosted.org/packages/56/0b/b7c5a631b6d5153d4a1ea4923b139aea256dc3bd99c8e6c7b312c7733146/pydantic_core-2.46.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3cd37e39b22b796ba0298fe81e9421dd7b65f97acfbb0fb19b33ffdda7b9a7b4", size = 2103439, upload-time = "2026-04-15T14:50:08.32Z" },
{ url = "https://files.pythonhosted.org/packages/2a/3f/952ee470df69e5674cdec1cbde22331adf643b5cc2ff79f4292d80146ee4/pydantic_core-2.46.1-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:6689443b59714992e67d62505cdd2f952d6cf1c14cc9fd9aeec6719befc6f23b", size = 2132871, upload-time = "2026-04-15T14:50:24.445Z" },
{ url = "https://files.pythonhosted.org/packages/e3/8b/1dea3b1e683c60c77a60f710215f90f486755962aa8939dbcb7c0f975ac3/pydantic_core-2.46.1-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6f32c41ca1e3456b5dd691827b7c1433c12d5f0058cc186afbb3615bc07d97b8", size = 2168658, upload-time = "2026-04-15T14:52:24.897Z" },
{ url = "https://files.pythonhosted.org/packages/67/97/32ae283810910d274d5ba9f48f856f5f2f612410b78b249f302d297816f5/pydantic_core-2.46.1-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:88cd1355578852db83954dc36e4f58f299646916da976147c20cf6892ba5dc43", size = 2171184, upload-time = "2026-04-15T14:52:34.854Z" },
{ url = "https://files.pythonhosted.org/packages/a2/57/c9a855527fe56c2072070640221f53095b0b19eaf651f3c77643c9cabbe3/pydantic_core-2.46.1-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:a170fefdb068279a473cc9d34848b85e61d68bfcc2668415b172c5dfc6f213bf", size = 2316573, upload-time = "2026-04-15T14:52:12.871Z" },
{ url = "https://files.pythonhosted.org/packages/37/b3/14c39ffc7399819c5448007c7bcb4e6da5669850cfb7dcbb727594290b48/pydantic_core-2.46.1-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:556a63ff1006934dba4eed7ea31b58274c227e29298ec398e4275eda4b905e95", size = 2378340, upload-time = "2026-04-15T14:51:02.619Z" },
{ url = "https://files.pythonhosted.org/packages/01/55/a37461fbb29c053ea4e62cfc5c2d56425cb5efbef8316e63f6d84ae45718/pydantic_core-2.46.1-cp314-cp314t-win32.whl", hash = "sha256:3b146d8336a995f7d7da6d36e4a779b7e7dff2719ac00a1eb8bd3ded00bec87b", size = 1960843, upload-time = "2026-04-15T14:52:06.103Z" },
{ url = "https://files.pythonhosted.org/packages/22/d7/97e1221197d17a27f768363f87ec061519eeeed15bbd315d2e9d1429ff03/pydantic_core-2.46.1-cp314-cp314t-win_amd64.whl", hash = "sha256:f1bc856c958e6fe9ec071e210afe6feb695f2e2e81fd8d2b102f558d364c4c17", size = 2048696, upload-time = "2026-04-15T14:52:52.154Z" },
{ url = "https://files.pythonhosted.org/packages/19/d5/4eac95255c7d35094b46a32ec1e4d80eac94729c694726ee1d69948bd5f0/pydantic_core-2.46.1-cp314-cp314t-win_arm64.whl", hash = "sha256:21a5bfd8a1aa4de60494cdf66b0c912b1495f26a8899896040021fbd6038d989", size = 2022343, upload-time = "2026-04-15T14:49:49.036Z" },
{ url = "https://files.pythonhosted.org/packages/44/4b/1952d38a091aa7572c13460db4439d5610a524a1a533fb131e17d8eff9c2/pydantic_core-2.46.1-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:c56887c0ffa05318128a80303c95066a9d819e5e66d75ff24311d9e0a58d6930", size = 2123089, upload-time = "2026-04-15T14:50:20.658Z" },
{ url = "https://files.pythonhosted.org/packages/90/06/f3623aa98e2d7cb4ed0ae0b164c5d8a1b86e5aca01744eba980eefcd5da4/pydantic_core-2.46.1-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:614b24b875c1072631065fa85e195b40700586afecb0b27767602007920dacf8", size = 1945481, upload-time = "2026-04-15T14:50:56.945Z" },
{ url = "https://files.pythonhosted.org/packages/69/f9/a9224203b8426893e22db2cf0da27cd930ad7d76e0a611ebd707e5e6c916/pydantic_core-2.46.1-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6382f6967c48519b6194e9e1e579e5898598b682556260eeaf05910400d827e", size = 1986294, upload-time = "2026-04-15T14:49:31.839Z" },
{ url = "https://files.pythonhosted.org/packages/96/29/954d2174db68b9f14292cef3ae8a05a25255735909adfcf45ca768023713/pydantic_core-2.46.1-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93cb8aa6c93fb833bb53f3a2841fbea6b4dc077453cd5b30c0634af3dee69369", size = 2144185, upload-time = "2026-04-15T14:52:39.449Z" },
{ url = "https://files.pythonhosted.org/packages/f4/97/95de673a1356a88b2efdaa120eb6af357a81555c35f6809a7a1423ff7aef/pydantic_core-2.46.1-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:5f9107a24a4bc00293434dfa95cf8968751ad0dd703b26ea83a75a56f7326041", size = 2107564, upload-time = "2026-04-15T14:50:49.14Z" },
{ url = "https://files.pythonhosted.org/packages/00/fc/a7c16d85211ea9accddc693b7d049f20b0c06440d9264d1e1c074394ee6c/pydantic_core-2.46.1-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:2b1801ba99876984d0a03362782819238141c4d0f3f67f69093663691332fc35", size = 1939925, upload-time = "2026-04-15T14:50:36.188Z" },
{ url = "https://files.pythonhosted.org/packages/2e/23/87841169d77820ddabeb81d82002c95dcb82163846666d74f5bdeeaec750/pydantic_core-2.46.1-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7fd82a91a20ed6d54fa8c91e7a98255b1ff45bf09b051bfe7fe04eb411e232e", size = 1995313, upload-time = "2026-04-15T14:50:22.538Z" },
{ url = "https://files.pythonhosted.org/packages/ea/96/b46609359a354fa9cd336fc5d93334f1c358b756cc81e4b397347a88fa6f/pydantic_core-2.46.1-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f135bf07c92c93def97008bc4496d16934da9efefd7204e5f22a2c92523cb1f", size = 2151197, upload-time = "2026-04-15T14:51:22.925Z" },
{ url = "https://files.pythonhosted.org/packages/f5/e7/3d1d2999ad8e78b124c752e4fc583ecd98f3bea7cc42045add2fb6e31b62/pydantic_core-2.46.1-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b44b44537efbff2df9567cd6ba51b554d6c009260a021ab25629c81e066f1683", size = 2121103, upload-time = "2026-04-15T14:52:59.537Z" },
{ url = "https://files.pythonhosted.org/packages/de/08/50a56632994007c7a58c86f782accccbe2f3bb7ca80f462533e26424cd18/pydantic_core-2.46.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:8f9ca3af687cc6a5c89aeaa00323222fcbceb4c3cdc78efdac86f46028160c04", size = 1952464, upload-time = "2026-04-15T14:52:04.001Z" },
{ url = "https://files.pythonhosted.org/packages/75/0b/3cf631e33a55b1788add3e42ac921744bd1f39279082a027b4ef6f48bd32/pydantic_core-2.46.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2678a4cbc205f00a44542dca19d15c11ccddd7440fd9df0e322e2cae55bb67a", size = 2138504, upload-time = "2026-04-15T14:52:01.812Z" },
{ url = "https://files.pythonhosted.org/packages/fa/69/f96f3dfc939450b9aeb80d3fe1943e7bc0614b14e9447d84f48d65153e0c/pydantic_core-2.46.1-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e5a98cbb03a8a7983b0fb954e0af5e7016587f612e6332c6a4453f413f1d1851", size = 2165467, upload-time = "2026-04-15T14:52:15.455Z" },
{ url = "https://files.pythonhosted.org/packages/a8/22/bb61cccddc2ce85b179cd81a580a1746e880870060fbf4bf6024dab7e8aa/pydantic_core-2.46.1-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:b2f098b08860bd149e090ad232f27fffb5ecf1bfd9377015445c8e17355ec2d1", size = 2183882, upload-time = "2026-04-15T14:51:50.868Z" },
{ url = "https://files.pythonhosted.org/packages/0e/01/b9039da255c5fd3a7fd85344fda8861c847ad6d8fdd115580fa4505b2022/pydantic_core-2.46.1-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:d2623606145b55a96efdd181b015c0356804116b2f14d3c2af4832fe4f45ed5f", size = 2323011, upload-time = "2026-04-15T14:49:40.32Z" },
{ url = "https://files.pythonhosted.org/packages/24/b1/f426b20cb72d0235718ccc4de3bc6d6c0d0c2a91a3fd2f32ae11b624bcc9/pydantic_core-2.46.1-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:420f515c42aaec607ff720867b300235bd393abd709b26b190ceacb57a9bfc17", size = 2365696, upload-time = "2026-04-15T14:49:41.936Z" },
{ url = "https://files.pythonhosted.org/packages/ef/d2/d2b0025246481aa2ce6db8ba196e29b92063343ac76e675b3a1fa478ed4d/pydantic_core-2.46.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:375cfdd2a1049910c82ba2ff24f948e93599a529e0fdb066d747975ca31fc663", size = 2190970, upload-time = "2026-04-15T14:49:33.111Z" },
]
[[package]]
@@ -2226,27 +2231,27 @@ wheels = [
[[package]]
name = "ruff"
version = "0.15.10"
version = "0.15.11"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/e7/d9/aa3f7d59a10ef6b14fe3431706f854dbf03c5976be614a9796d36326810c/ruff-0.15.10.tar.gz", hash = "sha256:d1f86e67ebfdef88e00faefa1552b5e510e1d35f3be7d423dc7e84e63788c94e", size = 4631728, upload-time = "2026-04-09T14:06:09.884Z" }
sdist = { url = "https://files.pythonhosted.org/packages/e4/8d/192f3d7103816158dfd5ea50d098ef2aec19194e6cbccd4b3485bdb2eb2d/ruff-0.15.11.tar.gz", hash = "sha256:f092b21708bf0e7437ce9ada249dfe688ff9a0954fc94abab05dcea7dcd29c33", size = 4637264, upload-time = "2026-04-16T18:46:26.58Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/eb/00/a1c2fdc9939b2c03691edbda290afcd297f1f389196172826b03d6b6a595/ruff-0.15.10-py3-none-linux_armv6l.whl", hash = "sha256:0744e31482f8f7d0d10a11fcbf897af272fefdfcb10f5af907b18c2813ff4d5f", size = 10563362, upload-time = "2026-04-09T14:06:21.189Z" },
{ url = "https://files.pythonhosted.org/packages/5c/15/006990029aea0bebe9d33c73c3e28c80c391ebdba408d1b08496f00d422d/ruff-0.15.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b1e7c16ea0ff5a53b7c2df52d947e685973049be1cdfe2b59a9c43601897b22e", size = 10951122, upload-time = "2026-04-09T14:06:02.236Z" },
{ url = "https://files.pythonhosted.org/packages/f2/c0/4ac978fe874d0618c7da647862afe697b281c2806f13ce904ad652fa87e4/ruff-0.15.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:93cc06a19e5155b4441dd72808fdf84290d84ad8a39ca3b0f994363ade4cebb1", size = 10314005, upload-time = "2026-04-09T14:06:00.026Z" },
{ url = "https://files.pythonhosted.org/packages/da/73/c209138a5c98c0d321266372fc4e33ad43d506d7e5dd817dd89b60a8548f/ruff-0.15.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:83e1dd04312997c99ea6965df66a14fb4f03ba978564574ffc68b0d61fd3989e", size = 10643450, upload-time = "2026-04-09T14:05:42.137Z" },
{ url = "https://files.pythonhosted.org/packages/ec/76/0deec355d8ec10709653635b1f90856735302cb8e149acfdf6f82a5feb70/ruff-0.15.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8154d43684e4333360fedd11aaa40b1b08a4e37d8ffa9d95fee6fa5b37b6fab1", size = 10379597, upload-time = "2026-04-09T14:05:49.984Z" },
{ url = "https://files.pythonhosted.org/packages/dc/be/86bba8fc8798c081e28a4b3bb6d143ccad3fd5f6f024f02002b8f08a9fa3/ruff-0.15.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ab88715f3a6deb6bde6c227f3a123410bec7b855c3ae331b4c006189e895cef", size = 11146645, upload-time = "2026-04-09T14:06:12.246Z" },
{ url = "https://files.pythonhosted.org/packages/a8/89/140025e65911b281c57be1d385ba1d932c2366ca88ae6663685aed8d4881/ruff-0.15.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a768ff5969b4f44c349d48edf4ab4f91eddb27fd9d77799598e130fb628aa158", size = 12030289, upload-time = "2026-04-09T14:06:04.776Z" },
{ url = "https://files.pythonhosted.org/packages/88/de/ddacca9545a5e01332567db01d44bd8cf725f2db3b3d61a80550b48308ea/ruff-0.15.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ee3ef42dab7078bda5ff6a1bcba8539e9857deb447132ad5566a038674540d0", size = 11496266, upload-time = "2026-04-09T14:05:55.485Z" },
{ url = "https://files.pythonhosted.org/packages/bc/bb/7ddb00a83760ff4a83c4e2fc231fd63937cc7317c10c82f583302e0f6586/ruff-0.15.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51cb8cc943e891ba99989dd92d61e29b1d231e14811db9be6440ecf25d5c1609", size = 11256418, upload-time = "2026-04-09T14:05:57.69Z" },
{ url = "https://files.pythonhosted.org/packages/dc/8d/55de0d35aacf6cd50b6ee91ee0f291672080021896543776f4170fc5c454/ruff-0.15.10-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:e59c9bdc056a320fb9ea1700a8d591718b8faf78af065484e801258d3a76bc3f", size = 11288416, upload-time = "2026-04-09T14:05:44.695Z" },
{ url = "https://files.pythonhosted.org/packages/68/cf/9438b1a27426ec46a80e0a718093c7f958ef72f43eb3111862949ead3cc1/ruff-0.15.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:136c00ca2f47b0018b073f28cb5c1506642a830ea941a60354b0e8bc8076b151", size = 10621053, upload-time = "2026-04-09T14:05:52.782Z" },
{ url = "https://files.pythonhosted.org/packages/4c/50/e29be6e2c135e9cd4cb15fbade49d6a2717e009dff3766dd080fcb82e251/ruff-0.15.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8b80a2f3c9c8a950d6237f2ca12b206bccff626139be9fa005f14feb881a1ae8", size = 10378302, upload-time = "2026-04-09T14:06:14.361Z" },
{ url = "https://files.pythonhosted.org/packages/18/2f/e0b36a6f99c51bb89f3a30239bc7bf97e87a37ae80aa2d6542d6e5150364/ruff-0.15.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:e3e53c588164dc025b671c9df2462429d60357ea91af7e92e9d56c565a9f1b07", size = 10850074, upload-time = "2026-04-09T14:06:16.581Z" },
{ url = "https://files.pythonhosted.org/packages/11/08/874da392558ce087a0f9b709dc6ec0d60cbc694c1c772dab8d5f31efe8cb/ruff-0.15.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b0c52744cf9f143a393e284125d2576140b68264a93c6716464e129a3e9adb48", size = 11358051, upload-time = "2026-04-09T14:06:18.948Z" },
{ url = "https://files.pythonhosted.org/packages/e4/46/602938f030adfa043e67112b73821024dc79f3ab4df5474c25fa4c1d2d14/ruff-0.15.10-py3-none-win32.whl", hash = "sha256:d4272e87e801e9a27a2e8df7b21011c909d9ddd82f4f3281d269b6ba19789ca5", size = 10588964, upload-time = "2026-04-09T14:06:07.14Z" },
{ url = "https://files.pythonhosted.org/packages/25/b6/261225b875d7a13b33a6d02508c39c28450b2041bb01d0f7f1a83d569512/ruff-0.15.10-py3-none-win_amd64.whl", hash = "sha256:28cb32d53203242d403d819fd6983152489b12e4a3ae44993543d6fe62ab42ed", size = 11745044, upload-time = "2026-04-09T14:05:39.473Z" },
{ url = "https://files.pythonhosted.org/packages/58/ed/dea90a65b7d9e69888890fb14c90d7f51bf0c1e82ad800aeb0160e4bacfd/ruff-0.15.10-py3-none-win_arm64.whl", hash = "sha256:601d1610a9e1f1c2165a4f561eeaa2e2ea1e97f3287c5aa258d3dab8b57c6188", size = 11035607, upload-time = "2026-04-09T14:05:47.593Z" },
{ url = "https://files.pythonhosted.org/packages/02/1e/6aca3427f751295ab011828e15e9bf452200ac74484f1db4be0197b8170b/ruff-0.15.11-py3-none-linux_armv6l.whl", hash = "sha256:e927cfff503135c558eb581a0c9792264aae9507904eb27809cdcff2f2c847b7", size = 10607943, upload-time = "2026-04-16T18:46:05.967Z" },
{ url = "https://files.pythonhosted.org/packages/e7/26/1341c262e74f36d4e84f3d6f4df0ac68cd53331a66bfc5080daa17c84c0b/ruff-0.15.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7a1b5b2938d8f890b76084d4fa843604d787a912541eae85fd7e233398bbb73e", size = 10988592, upload-time = "2026-04-16T18:46:00.742Z" },
{ url = "https://files.pythonhosted.org/packages/03/71/850b1d6ffa9564fbb6740429bad53df1094082fe515c8c1e74b6d8d05f18/ruff-0.15.11-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d4176f3d194afbdaee6e41b9ccb1a2c287dba8700047df474abfbe773825d1cb", size = 10338501, upload-time = "2026-04-16T18:46:03.723Z" },
{ url = "https://files.pythonhosted.org/packages/f2/11/cc1284d3e298c45a817a6aadb6c3e1d70b45c9b36d8d9cce3387b495a03a/ruff-0.15.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3b17c886fb88203ced3afe7f14e8d5ae96e9d2f4ccc0ee66aa19f2c2675a27e4", size = 10670693, upload-time = "2026-04-16T18:46:41.941Z" },
{ url = "https://files.pythonhosted.org/packages/ce/9e/f8288b034ab72b371513c13f9a41d9ba3effac54e24bfb467b007daee2ca/ruff-0.15.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:49fafa220220afe7758a487b048de4c8f9f767f37dfefad46b9dd06759d003eb", size = 10416177, upload-time = "2026-04-16T18:46:21.717Z" },
{ url = "https://files.pythonhosted.org/packages/85/71/504d79abfd3d92532ba6bbe3d1c19fada03e494332a59e37c7c2dabae427/ruff-0.15.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2ab8427e74a00d93b8bda1307b1e60970d40f304af38bccb218e056c220120d", size = 11221886, upload-time = "2026-04-16T18:46:15.086Z" },
{ url = "https://files.pythonhosted.org/packages/43/5a/947e6ab7a5ad603d65b474be15a4cbc6d29832db5d762cd142e4e3a74164/ruff-0.15.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:195072c0c8e1fc8f940652073df082e37a5d9cb43b4ab1e4d0566ab8977a13b7", size = 12075183, upload-time = "2026-04-16T18:46:07.944Z" },
{ url = "https://files.pythonhosted.org/packages/9f/a1/0b7bb6268775fdd3a0818aee8efd8f5b4e231d24dd4d528ced2534023182/ruff-0.15.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a3a0996d486af3920dec930a2e7daed4847dfc12649b537a9335585ada163e9e", size = 11516575, upload-time = "2026-04-16T18:46:31.687Z" },
{ url = "https://files.pythonhosted.org/packages/30/c3/bb5168fc4d233cc06e95f482770d0f3c87945a0cd9f614b90ea8dc2f2833/ruff-0.15.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1bef2cb556d509259f1fe440bb9cd33c756222cf0a7afe90d15edf0866702431", size = 11306537, upload-time = "2026-04-16T18:46:36.988Z" },
{ url = "https://files.pythonhosted.org/packages/e4/92/4cfae6441f3967317946f3b788136eecf093729b94d6561f963ed810c82e/ruff-0.15.11-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:030d921a836d7d4a12cf6e8d984a88b66094ccb0e0f17ddd55067c331191bf19", size = 11296813, upload-time = "2026-04-16T18:46:24.182Z" },
{ url = "https://files.pythonhosted.org/packages/43/26/972784c5dde8313acde8ac71ba8ac65475b85db4a2352a76c9934361f9bc/ruff-0.15.11-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:0e783b599b4577788dbbb66b9addcef87e9a8832f4ce0c19e34bf55543a2f890", size = 10633136, upload-time = "2026-04-16T18:46:39.802Z" },
{ url = "https://files.pythonhosted.org/packages/5b/53/3985a4f185020c2f367f2e08a103032e12564829742a1b417980ce1514a0/ruff-0.15.11-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ae90592246625ba4a34349d68ec28d4400d75182b71baa196ddb9f82db025ef5", size = 10424701, upload-time = "2026-04-16T18:46:10.381Z" },
{ url = "https://files.pythonhosted.org/packages/d3/57/bf0dfb32241b56c83bb663a826133da4bf17f682ba8c096973065f6e6a68/ruff-0.15.11-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1f111d62e3c983ed20e0ca2e800f8d77433a5b1161947df99a5c2a3fb60514f0", size = 10873887, upload-time = "2026-04-16T18:46:29.157Z" },
{ url = "https://files.pythonhosted.org/packages/02/05/e48076b2a57dc33ee8c7a957296f97c744ca891a8ffb4ffb1aaa3b3f517d/ruff-0.15.11-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:06f483d6646f59eaffba9ae30956370d3a886625f511a3108994000480621d1c", size = 11404316, upload-time = "2026-04-16T18:46:19.462Z" },
{ url = "https://files.pythonhosted.org/packages/88/27/0195d15fe7a897cbcba0904792c4b7c9fdd958456c3a17d2ea6093716a9a/ruff-0.15.11-py3-none-win32.whl", hash = "sha256:476a2aa56b7da0b73a3ee80b6b2f0e19cce544245479adde7baa65466664d5f3", size = 10655535, upload-time = "2026-04-16T18:46:12.47Z" },
{ url = "https://files.pythonhosted.org/packages/3a/5e/c927b325bd4c1d3620211a4b96f47864633199feed60fa936025ab27e090/ruff-0.15.11-py3-none-win_amd64.whl", hash = "sha256:8b6756d88d7e234fb0c98c91511aae3cd519d5e3ed271cae31b20f39cb2a12a3", size = 11779692, upload-time = "2026-04-16T18:46:17.268Z" },
{ url = "https://files.pythonhosted.org/packages/63/b6/aeadee5443e49baa2facd51131159fd6301cc4ccfc1541e4df7b021c37dd/ruff-0.15.11-py3-none-win_arm64.whl", hash = "sha256:063fed18cc1bbe0ee7393957284a6fe8b588c6a406a285af3ee3f46da2391ee4", size = 11032614, upload-time = "2026-04-16T18:46:34.487Z" },
]
[[package]]
@@ -2329,6 +2334,27 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" },
]
[[package]]
name = "slack-bolt"
version = "1.28.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "slack-sdk" },
]
sdist = { url = "https://files.pythonhosted.org/packages/5c/97/a62dde97e84027b252807f2044bed2edcda2d063a5cb0c535fb2be8d9b5d/slack_bolt-1.28.0.tar.gz", hash = "sha256:bfe367d867e8fb157a057248ebd4ac2d7f43acac6d0700fa31381db1e10f3b0f", size = 130768, upload-time = "2026-04-06T23:24:59.936Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/81/a9/697b6a92c728f09d5ef6b8e83dc6c8a87bc6d59499b2933ed067f11b7e30/slack_bolt-1.28.0-py2.py3-none-any.whl", hash = "sha256:738d1ca5e7c7039b6e18103d29267ced6e18c2517053eff18991fdd593acce5c", size = 234819, upload-time = "2026-04-06T23:24:58.278Z" },
]
[[package]]
name = "slack-sdk"
version = "3.41.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/22/35/fc009118a13187dd9731657c60138e5a7c2dea88681a7f04dc406af5da7d/slack_sdk-3.41.0.tar.gz", hash = "sha256:eb61eb12a65bebeca9cb5d36b3f799e836ed2be21b456d15df2627cfe34076ca", size = 250568, upload-time = "2026-03-12T16:10:11.381Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a1/df/2e4be347ff98281b505cc0ccf141408cdd25eb5ca9f3830deb361b2472d3/slack_sdk-3.41.0-py2.py3-none-any.whl", hash = "sha256:bb18dcdfff1413ec448e759cf807ec3324090993d8ab9111c74081623b692a89", size = 313885, upload-time = "2026-03-12T16:10:09.811Z" },
]
[[package]]
name = "sniffio"
version = "1.3.1"
@@ -2506,7 +2532,7 @@ wheels = [
[[package]]
name = "turnstone"
version = "1.4.0a3"
version = "1.4.0"
source = { editable = "." }
dependencies = [
{ name = "alembic" },
@@ -2527,6 +2553,7 @@ dependencies = [
[package.optional-dependencies]
all = [
{ name = "aiohttp" },
{ name = "anthropic" },
{ name = "croniter" },
{ name = "ddgs" },
@@ -2536,6 +2563,7 @@ all = [
{ name = "psycopg", extra = ["binary"] },
{ name = "pytest" },
{ name = "scipy" },
{ name = "slack-bolt" },
{ name = "sympy" },
]
anthropic = [
@@ -2563,10 +2591,16 @@ sandbox = [
{ name = "scipy" },
{ name = "sympy" },
]
slack = [
{ name = "aiohttp" },
{ name = "slack-bolt" },
]
test = [
{ name = "aiohttp" },
{ name = "croniter" },
{ name = "pytest" },
{ name = "pytest-cov" },
{ name = "slack-bolt" },
]
tls = [
{ name = "lacme" },
@@ -2574,6 +2608,8 @@ tls = [
[package.metadata]
requires-dist = [
{ name = "aiohttp", marker = "extra == 'slack'", specifier = ">=3.9" },
{ name = "aiohttp", marker = "extra == 'test'", specifier = ">=3.9" },
{ name = "alembic", specifier = ">=1.14" },
{ name = "anthropic", marker = "extra == 'anthropic'", specifier = ">=0.39" },
{ name = "bcrypt", specifier = ">=4.0" },
@@ -2597,15 +2633,17 @@ requires-dist = [
{ name = "python-frontmatter", specifier = ">=1.0" },
{ name = "ruff", marker = "extra == 'dev'", specifier = ">=0.9" },
{ name = "scipy", marker = "extra == 'sandbox'", specifier = ">=1.14" },
{ name = "slack-bolt", marker = "extra == 'slack'", specifier = ">=1.18" },
{ name = "slack-bolt", marker = "extra == 'test'", specifier = ">=1.18" },
{ name = "sqlalchemy", specifier = ">=2.0" },
{ name = "sse-starlette", specifier = ">=2.0" },
{ name = "starlette", specifier = ">=0.45" },
{ name = "structlog", specifier = ">=24.1" },
{ name = "sympy", marker = "extra == 'sandbox'", specifier = ">=1.13" },
{ name = "turnstone", extras = ["console", "anthropic", "postgres", "discord", "ddg", "tls", "sandbox"], marker = "extra == 'all'" },
{ name = "turnstone", extras = ["console", "anthropic", "postgres", "discord", "ddg", "tls", "sandbox", "slack"], marker = "extra == 'all'" },
{ name = "uvicorn", specifier = ">=0.34" },
]
provides-extras = ["test", "dev", "console", "anthropic", "postgres", "ddg", "discord", "tls", "sandbox", "all"]
provides-extras = ["test", "dev", "console", "anthropic", "postgres", "ddg", "discord", "tls", "sandbox", "slack", "all"]
[[package]]
name = "typing-extensions"