mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
20df7b3034
* feat: OIDC SSO authentication with PKCE, auto-provisioning, and role mapping Add OpenID Connect as a fourth authentication method, enabling single sign-on via any OIDC provider (Okta, Azure AD, Google, Keycloak). Opt-in via env vars (TURNSTONE_OIDC_ISSUER, CLIENT_ID, CLIENT_SECRET). Security: - Authorization Code Flow with PKCE (S256) - State/nonce parameters with database-backed pending store (multi-node safe) - JWKS signature validation with async fetch + key rotation retry - Algorithm allowlist from JWKS key (not token header) prevents confusion - Identity matching exclusively by (issuer, sub) — prevents account takeover - password_enabled=false enforced server-side, not just UI - Rate limiting on both authorize and callback endpoints - OIDC users get "!oidc" password sentinel (bcrypt rejects naturally) - ID token validated for iss, aud, exp, nonce Features: - Auto-provisioning with username deduplication on first login - Claim-based role mapping with IdP demotion propagation (revokes stale roles) - "Continue with [Provider]" SSO button on login page - OIDC-only mode hides password form - Setup wizard required before OIDC login (admin bootstrap) Storage: migration 018 (oidc_identities + oidc_pending_states tables), 8 new protocol methods on both SQLite and PostgreSQL backends. 66 new tests (2273 total). * fix: address PR #71 review feedback (18 items) Bugs fixed: - OIDC success redirect now fetches permissions via new /auth/whoami endpoint before completing login (fixes permission-gating in UI) - Remove double decodeURIComponent on oidc_error (URLSearchParams already decodes; extra call throws on stray %) - Authorize rate limiter returns redirect instead of JSON 429 (endpoint reached via browser navigation, not fetch) - Lazy JWKS fetch in callback when startup discovery failed (IdP recovery without restart) - Startup exception handlers now log with exc_info=True - PostgreSQL pop_oidc_pending_state uses DELETE...RETURNING for true atomicity (eliminates TOCTOU) Behavior: - New OIDC users without role mapping get builtin-viewer by default (assigned_by="oidc-default", not revoked by role sync) Documentation fixes: - Role mapping: sync semantics (add + revoke stale), not "additive only" - PASSWORD_ENABLED=false blocks ALL password logins including admin - Algorithm: asymmetric allowlist, not per-key derivation - PlantUML diagram updated for role revocation API spec fixes: - Removed error_codes=[302] from callback (302 is success redirect) - Added /auth/whoami to both server + console specs - Regenerated TypeScript SDK OpenAPI snapshots (23 + 51 paths) * fix: address PR #71 round 2 review feedback (10 items) Rate limiting: - Authorize endpoint now calls record() after check() so the rate limiter actually counts attempts (was a no-op before) OIDC resilience: - Split startup try/except: discovery failure disables OIDC, JWKS prefetch failure leaves OIDC enabled for lazy retry on first login - JWKS unavailable message changed to "temporarily unavailable" (was misleadingly "not configured") - create_oidc_pending_state raises on collision instead of OR IGNORE (prevents silent insert drop on state collision) - SQLite pop_oidc_pending_state uses BEGIN IMMEDIATE for write lock (eliminates TOCTOU race) Frontend: - OIDC error display deferred 300ms so showLogin()'s async status fetch doesn't clear it via _switchMode → _clearError API spec: - OIDC authorize/callback endpoints now declare response_code=302 - Added AuthWhoamiResponse Pydantic model for /auth/whoami - Regenerated TypeScript SDK OpenAPI snapshots Documentation: - Diagram: JWKS "cached at startup, refreshed on-demand" (was "hourly") - Added TODO(tech-debt) comments on Host header redirect_uri sites
2007 lines
50 KiB
JSON
2007 lines
50 KiB
JSON
{
|
|
"openapi": "3.1.0",
|
|
"info": {
|
|
"title": "turnstone Server API",
|
|
"version": "0.6.2",
|
|
"description": "Single-node workstream management, chat interaction, and real-time streaming."
|
|
},
|
|
"paths": {
|
|
"/v1/api/workstreams": {
|
|
"get": {
|
|
"summary": "List active workstreams",
|
|
"operationId": "v1_api_workstreams_get",
|
|
"tags": [
|
|
"Workstreams"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ListWorkstreamsResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/dashboard": {
|
|
"get": {
|
|
"summary": "Dashboard with workstream details and aggregates",
|
|
"operationId": "v1_api_dashboard_get",
|
|
"tags": [
|
|
"Workstreams"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DashboardResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/workstreams/new": {
|
|
"post": {
|
|
"summary": "Create a new workstream",
|
|
"operationId": "v1_api_workstreams_new_post",
|
|
"tags": [
|
|
"Workstreams"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CreateWorkstreamRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CreateWorkstreamResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Error 400",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/workstreams/close": {
|
|
"post": {
|
|
"summary": "Close a workstream",
|
|
"operationId": "v1_api_workstreams_close_post",
|
|
"tags": [
|
|
"Workstreams"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CloseWorkstreamRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/StatusResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Error 400",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/send": {
|
|
"post": {
|
|
"summary": "Send a user message",
|
|
"operationId": "v1_api_send_post",
|
|
"tags": [
|
|
"Chat"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SendRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SendResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Error 400",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Error 404",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/approve": {
|
|
"post": {
|
|
"summary": "Approve or deny a tool call",
|
|
"operationId": "v1_api_approve_post",
|
|
"tags": [
|
|
"Chat"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ApproveRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/StatusResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Error 404",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/plan": {
|
|
"post": {
|
|
"summary": "Respond to a plan review",
|
|
"operationId": "v1_api_plan_post",
|
|
"tags": [
|
|
"Chat"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/PlanFeedbackRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/StatusResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Error 404",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/command": {
|
|
"post": {
|
|
"summary": "Execute a slash command",
|
|
"operationId": "v1_api_command_post",
|
|
"tags": [
|
|
"Chat"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CommandRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/StatusResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Error 400",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Error 404",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/cancel": {
|
|
"post": {
|
|
"summary": "Cancel the active generation in a workstream",
|
|
"operationId": "v1_api_cancel_post",
|
|
"tags": [
|
|
"Chat"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CancelRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/StatusResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Error 400",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Error 404",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/events": {
|
|
"get": {
|
|
"summary": "Per-workstream SSE event stream",
|
|
"operationId": "v1_api_events_get",
|
|
"tags": [
|
|
"Streaming"
|
|
],
|
|
"description": "Opens a Server-Sent Events stream scoped to a single workstream. Returns text/event-stream. See API reference for event types.",
|
|
"parameters": [
|
|
{
|
|
"name": "ws_id",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Workstream identifier"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success"
|
|
},
|
|
"404": {
|
|
"description": "Error 404",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/events/global": {
|
|
"get": {
|
|
"summary": "Global SSE event stream",
|
|
"operationId": "v1_api_events_global_get",
|
|
"tags": [
|
|
"Streaming"
|
|
],
|
|
"description": "Global Server-Sent Events stream for state-change broadcasts across all workstreams. Returns text/event-stream.",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/workstreams/saved": {
|
|
"get": {
|
|
"summary": "List saved workstreams",
|
|
"operationId": "v1_api_workstreams_saved_get",
|
|
"tags": [
|
|
"Workstreams"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ListSavedWorkstreamsResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/templates": {
|
|
"get": {
|
|
"summary": "List available prompt templates (summary)",
|
|
"operationId": "v1_api_templates_get",
|
|
"tags": [
|
|
"Templates"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ListPromptTemplateSummaryResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/ws-templates": {
|
|
"get": {
|
|
"summary": "List enabled workstream templates (summary)",
|
|
"operationId": "v1_api_ws-templates_get",
|
|
"tags": [
|
|
"Templates"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ListWsTemplateSummaryResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/auth/login": {
|
|
"post": {
|
|
"summary": "Authenticate with a token",
|
|
"operationId": "v1_api_auth_login_post",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AuthLoginRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AuthLoginResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Error 401",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/auth/setup": {
|
|
"post": {
|
|
"summary": "Create first admin user",
|
|
"operationId": "v1_api_auth_setup_post",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AuthSetupRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AuthSetupResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Error 400",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Error 409",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "Error 503",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/auth/status": {
|
|
"get": {
|
|
"summary": "Return auth state",
|
|
"operationId": "v1_api_auth_status_get",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AuthStatusResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/auth/logout": {
|
|
"post": {
|
|
"summary": "Clear auth cookie",
|
|
"operationId": "v1_api_auth_logout_post",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/StatusResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/auth/oidc/authorize": {
|
|
"get": {
|
|
"summary": "Redirect to OIDC provider for SSO login",
|
|
"operationId": "v1_api_auth_oidc_authorize_get",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"302": {
|
|
"description": "Success"
|
|
},
|
|
"404": {
|
|
"description": "Error 404",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "Error 503",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/auth/oidc/callback": {
|
|
"get": {
|
|
"summary": "OIDC callback \u2014 validates code, provisions user, sets JWT cookie, redirects to app",
|
|
"operationId": "v1_api_auth_oidc_callback_get",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"302": {
|
|
"description": "Success"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/auth/whoami": {
|
|
"get": {
|
|
"summary": "Return authenticated user info and permissions",
|
|
"operationId": "v1_api_auth_whoami_get",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AuthWhoamiResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Error 401",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/memories": {
|
|
"get": {
|
|
"summary": "List structured memories",
|
|
"operationId": "v1_api_memories_get",
|
|
"tags": [
|
|
"Memories"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "type",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Filter by memory type"
|
|
},
|
|
{
|
|
"name": "scope",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Filter by scope"
|
|
},
|
|
{
|
|
"name": "scope_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Filter by scope identifier"
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"default": 100
|
|
},
|
|
"description": "Max results (default 100, max 200)"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ListMemoriesResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Save (upsert) a structured memory",
|
|
"operationId": "v1_api_memories_post",
|
|
"tags": [
|
|
"Memories"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SaveMemoryRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/MemoryInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Error 400",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/memories/search": {
|
|
"post": {
|
|
"summary": "Search structured memories by query",
|
|
"operationId": "v1_api_memories_search_post",
|
|
"tags": [
|
|
"Memories"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SearchMemoriesRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ListMemoriesResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/api/memories/{name}": {
|
|
"delete": {
|
|
"summary": "Delete a structured memory by name and scope",
|
|
"operationId": "v1_api_memories_{name}_delete",
|
|
"tags": [
|
|
"Memories"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "scope",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Scope (default: global)"
|
|
},
|
|
{
|
|
"name": "scope_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Scope identifier"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/StatusResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Error 404",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/health": {
|
|
"get": {
|
|
"summary": "Server health check",
|
|
"operationId": "health_get",
|
|
"tags": [
|
|
"Observability"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Success",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HealthResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {
|
|
"ErrorResponse": {
|
|
"description": "Standard error response body.",
|
|
"properties": {
|
|
"error": {
|
|
"description": "Error message",
|
|
"title": "Error",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"error"
|
|
],
|
|
"title": "ErrorResponse",
|
|
"type": "object"
|
|
},
|
|
"StatusResponse": {
|
|
"description": "Generic success response.",
|
|
"properties": {
|
|
"status": {
|
|
"default": "ok",
|
|
"examples": [
|
|
"ok"
|
|
],
|
|
"title": "Status",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"title": "StatusResponse",
|
|
"type": "object"
|
|
},
|
|
"AuthLoginRequest": {
|
|
"description": "POST /v1/api/auth/login request body.\n\nEither username+password or token must be provided.",
|
|
"properties": {
|
|
"username": {
|
|
"default": "",
|
|
"description": "Login username",
|
|
"title": "Username",
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"default": "",
|
|
"description": "Login password",
|
|
"title": "Password",
|
|
"type": "string"
|
|
},
|
|
"token": {
|
|
"default": "",
|
|
"description": "Legacy: bearer token to authenticate",
|
|
"title": "Token",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"title": "AuthLoginRequest",
|
|
"type": "object"
|
|
},
|
|
"AuthLoginResponse": {
|
|
"description": "POST /v1/api/auth/login success response.",
|
|
"properties": {
|
|
"status": {
|
|
"default": "ok",
|
|
"title": "Status",
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"default": "",
|
|
"description": "Authenticated user ID",
|
|
"title": "User Id",
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"description": "Legacy role",
|
|
"examples": [
|
|
"full",
|
|
"read"
|
|
],
|
|
"title": "Role",
|
|
"type": "string"
|
|
},
|
|
"scopes": {
|
|
"default": "",
|
|
"description": "Comma-separated scopes",
|
|
"examples": [
|
|
"read,write,approve"
|
|
],
|
|
"title": "Scopes",
|
|
"type": "string"
|
|
},
|
|
"jwt": {
|
|
"default": "",
|
|
"description": "JWT session token (if JWT auth is configured)",
|
|
"title": "Jwt",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"role"
|
|
],
|
|
"title": "AuthLoginResponse",
|
|
"type": "object"
|
|
},
|
|
"AuthSetupRequest": {
|
|
"description": "POST /v1/api/auth/setup request body.",
|
|
"properties": {
|
|
"username": {
|
|
"description": "Login username (1-64 ASCII characters)",
|
|
"title": "Username",
|
|
"type": "string"
|
|
},
|
|
"display_name": {
|
|
"description": "Display name",
|
|
"title": "Display Name",
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"description": "Password (minimum 8 characters)",
|
|
"title": "Password",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"username",
|
|
"display_name",
|
|
"password"
|
|
],
|
|
"title": "AuthSetupRequest",
|
|
"type": "object"
|
|
},
|
|
"AuthSetupResponse": {
|
|
"description": "POST /v1/api/auth/setup success response.",
|
|
"properties": {
|
|
"status": {
|
|
"default": "ok",
|
|
"title": "Status",
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"title": "User Id",
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"title": "Username",
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"default": "full",
|
|
"title": "Role",
|
|
"type": "string"
|
|
},
|
|
"scopes": {
|
|
"default": "approve,read,write",
|
|
"title": "Scopes",
|
|
"type": "string"
|
|
},
|
|
"jwt": {
|
|
"default": "",
|
|
"description": "JWT session token",
|
|
"title": "Jwt",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"user_id",
|
|
"username"
|
|
],
|
|
"title": "AuthSetupResponse",
|
|
"type": "object"
|
|
},
|
|
"AuthStatusResponse": {
|
|
"description": "GET /v1/api/auth/status response.",
|
|
"properties": {
|
|
"auth_enabled": {
|
|
"title": "Auth Enabled",
|
|
"type": "boolean"
|
|
},
|
|
"has_users": {
|
|
"title": "Has Users",
|
|
"type": "boolean"
|
|
},
|
|
"setup_required": {
|
|
"title": "Setup Required",
|
|
"type": "boolean"
|
|
},
|
|
"oidc_enabled": {
|
|
"default": false,
|
|
"title": "Oidc Enabled",
|
|
"type": "boolean"
|
|
},
|
|
"oidc_provider_name": {
|
|
"default": "",
|
|
"title": "Oidc Provider Name",
|
|
"type": "string"
|
|
},
|
|
"password_enabled": {
|
|
"default": true,
|
|
"title": "Password Enabled",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"auth_enabled",
|
|
"has_users",
|
|
"setup_required"
|
|
],
|
|
"title": "AuthStatusResponse",
|
|
"type": "object"
|
|
},
|
|
"SendRequest": {
|
|
"properties": {
|
|
"message": {
|
|
"description": "User message text",
|
|
"title": "Message",
|
|
"type": "string"
|
|
},
|
|
"ws_id": {
|
|
"description": "Target workstream ID",
|
|
"title": "Ws Id",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"message",
|
|
"ws_id"
|
|
],
|
|
"title": "SendRequest",
|
|
"type": "object"
|
|
},
|
|
"SendResponse": {
|
|
"properties": {
|
|
"status": {
|
|
"description": "'ok' or 'busy'",
|
|
"examples": [
|
|
"ok",
|
|
"busy"
|
|
],
|
|
"title": "Status",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
],
|
|
"title": "SendResponse",
|
|
"type": "object"
|
|
},
|
|
"ApproveRequest": {
|
|
"properties": {
|
|
"approved": {
|
|
"description": "True to approve, false to deny",
|
|
"title": "Approved",
|
|
"type": "boolean"
|
|
},
|
|
"feedback": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": null,
|
|
"description": "Optional denial reason",
|
|
"title": "Feedback"
|
|
},
|
|
"always": {
|
|
"default": false,
|
|
"description": "Enable auto-approve for this tool",
|
|
"title": "Always",
|
|
"type": "boolean"
|
|
},
|
|
"ws_id": {
|
|
"description": "Target workstream ID",
|
|
"title": "Ws Id",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"approved",
|
|
"ws_id"
|
|
],
|
|
"title": "ApproveRequest",
|
|
"type": "object"
|
|
},
|
|
"PlanFeedbackRequest": {
|
|
"properties": {
|
|
"feedback": {
|
|
"description": "Feedback text; empty string means approval",
|
|
"title": "Feedback",
|
|
"type": "string"
|
|
},
|
|
"ws_id": {
|
|
"description": "Target workstream ID",
|
|
"title": "Ws Id",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"feedback",
|
|
"ws_id"
|
|
],
|
|
"title": "PlanFeedbackRequest",
|
|
"type": "object"
|
|
},
|
|
"CommandRequest": {
|
|
"properties": {
|
|
"command": {
|
|
"description": "Slash command (e.g. /clear, /new, /resume)",
|
|
"title": "Command",
|
|
"type": "string"
|
|
},
|
|
"ws_id": {
|
|
"description": "Target workstream ID",
|
|
"title": "Ws Id",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"command",
|
|
"ws_id"
|
|
],
|
|
"title": "CommandRequest",
|
|
"type": "object"
|
|
},
|
|
"CancelRequest": {
|
|
"properties": {
|
|
"ws_id": {
|
|
"description": "Target workstream ID",
|
|
"title": "Ws Id",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"ws_id"
|
|
],
|
|
"title": "CancelRequest",
|
|
"type": "object"
|
|
},
|
|
"CreateWorkstreamRequest": {
|
|
"properties": {
|
|
"name": {
|
|
"default": "",
|
|
"description": "Workstream display name (auto-generated if empty)",
|
|
"title": "Name",
|
|
"type": "string"
|
|
},
|
|
"model": {
|
|
"default": "",
|
|
"description": "Model alias from registry",
|
|
"title": "Model",
|
|
"type": "string"
|
|
},
|
|
"auto_approve": {
|
|
"default": false,
|
|
"description": "Auto-approve all tool calls",
|
|
"title": "Auto Approve",
|
|
"type": "boolean"
|
|
},
|
|
"resume_ws": {
|
|
"default": "",
|
|
"description": "Workstream ID to resume atomically during creation (empty = fresh start)",
|
|
"title": "Resume Ws",
|
|
"type": "string"
|
|
},
|
|
"template": {
|
|
"default": "",
|
|
"description": "Prompt template name (replaces default templates)",
|
|
"title": "Template",
|
|
"type": "string"
|
|
},
|
|
"ws_template": {
|
|
"default": "",
|
|
"description": "Workstream template name to apply defaults from",
|
|
"title": "Ws Template",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"title": "CreateWorkstreamRequest",
|
|
"type": "object"
|
|
},
|
|
"CreateWorkstreamResponse": {
|
|
"properties": {
|
|
"ws_id": {
|
|
"description": "Unique ID of the new workstream",
|
|
"title": "Ws Id",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Assigned workstream name",
|
|
"title": "Name",
|
|
"type": "string"
|
|
},
|
|
"resumed": {
|
|
"default": false,
|
|
"description": "Whether a previous workstream was resumed",
|
|
"title": "Resumed",
|
|
"type": "boolean"
|
|
},
|
|
"message_count": {
|
|
"default": 0,
|
|
"description": "Number of messages in the resumed workstream",
|
|
"title": "Message Count",
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"required": [
|
|
"ws_id",
|
|
"name"
|
|
],
|
|
"title": "CreateWorkstreamResponse",
|
|
"type": "object"
|
|
},
|
|
"CloseWorkstreamRequest": {
|
|
"properties": {
|
|
"ws_id": {
|
|
"description": "Workstream ID to close",
|
|
"title": "Ws Id",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"ws_id"
|
|
],
|
|
"title": "CloseWorkstreamRequest",
|
|
"type": "object"
|
|
},
|
|
"ListWorkstreamsResponse": {
|
|
"properties": {
|
|
"workstreams": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/WorkstreamInfo"
|
|
},
|
|
"title": "Workstreams",
|
|
"type": "array"
|
|
}
|
|
},
|
|
"required": [
|
|
"workstreams"
|
|
],
|
|
"title": "ListWorkstreamsResponse",
|
|
"type": "object"
|
|
},
|
|
"WorkstreamInfo": {
|
|
"properties": {
|
|
"id": {
|
|
"title": "Id",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"title": "Name",
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"title": "State",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"state"
|
|
],
|
|
"title": "WorkstreamInfo",
|
|
"type": "object"
|
|
},
|
|
"DashboardResponse": {
|
|
"properties": {
|
|
"workstreams": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/DashboardWorkstream"
|
|
},
|
|
"title": "Workstreams",
|
|
"type": "array"
|
|
},
|
|
"aggregate": {
|
|
"$ref": "#/components/schemas/DashboardAggregate"
|
|
}
|
|
},
|
|
"required": [
|
|
"workstreams",
|
|
"aggregate"
|
|
],
|
|
"title": "DashboardResponse",
|
|
"type": "object"
|
|
},
|
|
"DashboardAggregate": {
|
|
"properties": {
|
|
"total_tokens": {
|
|
"default": 0,
|
|
"title": "Total Tokens",
|
|
"type": "integer"
|
|
},
|
|
"total_tool_calls": {
|
|
"default": 0,
|
|
"title": "Total Tool Calls",
|
|
"type": "integer"
|
|
},
|
|
"active_count": {
|
|
"default": 0,
|
|
"title": "Active Count",
|
|
"type": "integer"
|
|
},
|
|
"total_count": {
|
|
"default": 0,
|
|
"title": "Total Count",
|
|
"type": "integer"
|
|
},
|
|
"uptime_seconds": {
|
|
"default": 0,
|
|
"title": "Uptime Seconds",
|
|
"type": "integer"
|
|
},
|
|
"node": {
|
|
"default": "local",
|
|
"title": "Node",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"title": "DashboardAggregate",
|
|
"type": "object"
|
|
},
|
|
"DashboardWorkstream": {
|
|
"properties": {
|
|
"id": {
|
|
"title": "Id",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"title": "Name",
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"title": "State",
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"default": "",
|
|
"title": "Title",
|
|
"type": "string"
|
|
},
|
|
"tokens": {
|
|
"default": 0,
|
|
"title": "Tokens",
|
|
"type": "integer"
|
|
},
|
|
"context_ratio": {
|
|
"default": 0.0,
|
|
"title": "Context Ratio",
|
|
"type": "number"
|
|
},
|
|
"activity": {
|
|
"default": "",
|
|
"title": "Activity",
|
|
"type": "string"
|
|
},
|
|
"activity_state": {
|
|
"default": "",
|
|
"title": "Activity State",
|
|
"type": "string"
|
|
},
|
|
"tool_calls": {
|
|
"default": 0,
|
|
"title": "Tool Calls",
|
|
"type": "integer"
|
|
},
|
|
"node": {
|
|
"default": "",
|
|
"title": "Node",
|
|
"type": "string"
|
|
},
|
|
"model": {
|
|
"default": "",
|
|
"title": "Model",
|
|
"type": "string"
|
|
},
|
|
"model_alias": {
|
|
"default": "",
|
|
"title": "Model Alias",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"state"
|
|
],
|
|
"title": "DashboardWorkstream",
|
|
"type": "object"
|
|
},
|
|
"ListSavedWorkstreamsResponse": {
|
|
"properties": {
|
|
"workstreams": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/SavedWorkstreamInfo"
|
|
},
|
|
"title": "Workstreams",
|
|
"type": "array"
|
|
}
|
|
},
|
|
"required": [
|
|
"workstreams"
|
|
],
|
|
"title": "ListSavedWorkstreamsResponse",
|
|
"type": "object"
|
|
},
|
|
"SavedWorkstreamInfo": {
|
|
"properties": {
|
|
"ws_id": {
|
|
"title": "Ws Id",
|
|
"type": "string"
|
|
},
|
|
"alias": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": null,
|
|
"title": "Alias"
|
|
},
|
|
"title": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": null,
|
|
"title": "Title"
|
|
},
|
|
"created": {
|
|
"title": "Created",
|
|
"type": "string"
|
|
},
|
|
"updated": {
|
|
"title": "Updated",
|
|
"type": "string"
|
|
},
|
|
"message_count": {
|
|
"title": "Message Count",
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"required": [
|
|
"ws_id",
|
|
"created",
|
|
"updated",
|
|
"message_count"
|
|
],
|
|
"title": "SavedWorkstreamInfo",
|
|
"type": "object"
|
|
},
|
|
"HealthResponse": {
|
|
"properties": {
|
|
"status": {
|
|
"examples": [
|
|
"ok",
|
|
"degraded"
|
|
],
|
|
"title": "Status",
|
|
"type": "string"
|
|
},
|
|
"version": {
|
|
"default": "",
|
|
"title": "Version",
|
|
"type": "string"
|
|
},
|
|
"uptime_seconds": {
|
|
"default": 0.0,
|
|
"title": "Uptime Seconds",
|
|
"type": "number"
|
|
},
|
|
"model": {
|
|
"default": "",
|
|
"title": "Model",
|
|
"type": "string"
|
|
},
|
|
"workstreams": {
|
|
"$ref": "#/components/schemas/WorkstreamCounts",
|
|
"default": {
|
|
"total": 0,
|
|
"idle": 0,
|
|
"thinking": 0,
|
|
"running": 0,
|
|
"attention": 0,
|
|
"error": 0
|
|
}
|
|
},
|
|
"backend": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/components/schemas/BackendStatus"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": null
|
|
},
|
|
"mcp": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/components/schemas/McpStatus"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": null
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
],
|
|
"title": "HealthResponse",
|
|
"type": "object"
|
|
},
|
|
"BackendStatus": {
|
|
"properties": {
|
|
"status": {
|
|
"examples": [
|
|
"up",
|
|
"down"
|
|
],
|
|
"title": "Status",
|
|
"type": "string"
|
|
},
|
|
"circuit_state": {
|
|
"examples": [
|
|
"closed",
|
|
"open",
|
|
"half_open"
|
|
],
|
|
"title": "Circuit State",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"status",
|
|
"circuit_state"
|
|
],
|
|
"title": "BackendStatus",
|
|
"type": "object"
|
|
},
|
|
"McpStatus": {
|
|
"properties": {
|
|
"servers": {
|
|
"default": 0,
|
|
"title": "Servers",
|
|
"type": "integer"
|
|
},
|
|
"resources": {
|
|
"default": 0,
|
|
"title": "Resources",
|
|
"type": "integer"
|
|
},
|
|
"prompts": {
|
|
"default": 0,
|
|
"title": "Prompts",
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"title": "McpStatus",
|
|
"type": "object"
|
|
},
|
|
"WorkstreamCounts": {
|
|
"properties": {
|
|
"total": {
|
|
"default": 0,
|
|
"title": "Total",
|
|
"type": "integer"
|
|
},
|
|
"idle": {
|
|
"default": 0,
|
|
"title": "Idle",
|
|
"type": "integer"
|
|
},
|
|
"thinking": {
|
|
"default": 0,
|
|
"title": "Thinking",
|
|
"type": "integer"
|
|
},
|
|
"running": {
|
|
"default": 0,
|
|
"title": "Running",
|
|
"type": "integer"
|
|
},
|
|
"attention": {
|
|
"default": 0,
|
|
"title": "Attention",
|
|
"type": "integer"
|
|
},
|
|
"error": {
|
|
"default": 0,
|
|
"title": "Error",
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"title": "WorkstreamCounts",
|
|
"type": "object"
|
|
},
|
|
"SaveMemoryRequest": {
|
|
"properties": {
|
|
"name": {
|
|
"description": "Memory identifier (normalized to snake_case)",
|
|
"title": "Name",
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"description": "Memory content",
|
|
"maxLength": 65536,
|
|
"title": "Content",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"default": "",
|
|
"description": "Short description for relevance matching",
|
|
"title": "Description",
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"default": "project",
|
|
"description": "Memory type",
|
|
"enum": [
|
|
"user",
|
|
"project",
|
|
"feedback",
|
|
"reference"
|
|
],
|
|
"title": "Type",
|
|
"type": "string"
|
|
},
|
|
"scope": {
|
|
"default": "global",
|
|
"description": "Memory scope",
|
|
"enum": [
|
|
"global",
|
|
"workstream",
|
|
"user"
|
|
],
|
|
"title": "Scope",
|
|
"type": "string"
|
|
},
|
|
"scope_id": {
|
|
"default": "",
|
|
"description": "Scope identifier (ws_id for workstream, user_id for user scope)",
|
|
"title": "Scope Id",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"content"
|
|
],
|
|
"title": "SaveMemoryRequest",
|
|
"type": "object"
|
|
},
|
|
"MemoryInfo": {
|
|
"properties": {
|
|
"memory_id": {
|
|
"title": "Memory Id",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"title": "Name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"default": "",
|
|
"title": "Description",
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"user",
|
|
"project",
|
|
"feedback",
|
|
"reference"
|
|
],
|
|
"title": "Type",
|
|
"type": "string"
|
|
},
|
|
"scope": {
|
|
"enum": [
|
|
"global",
|
|
"workstream",
|
|
"user"
|
|
],
|
|
"title": "Scope",
|
|
"type": "string"
|
|
},
|
|
"scope_id": {
|
|
"default": "",
|
|
"title": "Scope Id",
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"title": "Content",
|
|
"type": "string"
|
|
},
|
|
"created": {
|
|
"title": "Created",
|
|
"type": "string"
|
|
},
|
|
"updated": {
|
|
"title": "Updated",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"memory_id",
|
|
"name",
|
|
"type",
|
|
"scope",
|
|
"content",
|
|
"created",
|
|
"updated"
|
|
],
|
|
"title": "MemoryInfo",
|
|
"type": "object"
|
|
},
|
|
"ListMemoriesResponse": {
|
|
"properties": {
|
|
"memories": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/MemoryInfo"
|
|
},
|
|
"title": "Memories",
|
|
"type": "array"
|
|
},
|
|
"total": {
|
|
"default": 0,
|
|
"title": "Total",
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"required": [
|
|
"memories"
|
|
],
|
|
"title": "ListMemoriesResponse",
|
|
"type": "object"
|
|
},
|
|
"SearchMemoriesRequest": {
|
|
"properties": {
|
|
"query": {
|
|
"description": "Search query text",
|
|
"title": "Query",
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"default": "",
|
|
"description": "Filter by memory type",
|
|
"enum": [
|
|
"",
|
|
"user",
|
|
"project",
|
|
"feedback",
|
|
"reference"
|
|
],
|
|
"title": "Type",
|
|
"type": "string"
|
|
},
|
|
"scope": {
|
|
"default": "",
|
|
"description": "Filter by scope",
|
|
"enum": [
|
|
"",
|
|
"global",
|
|
"workstream",
|
|
"user"
|
|
],
|
|
"title": "Scope",
|
|
"type": "string"
|
|
},
|
|
"scope_id": {
|
|
"default": "",
|
|
"description": "Filter by scope_id",
|
|
"title": "Scope Id",
|
|
"type": "string"
|
|
},
|
|
"limit": {
|
|
"default": 20,
|
|
"description": "Max results (1-50)",
|
|
"maximum": 50,
|
|
"minimum": 1,
|
|
"title": "Limit",
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"required": [
|
|
"query"
|
|
],
|
|
"title": "SearchMemoriesRequest",
|
|
"type": "object"
|
|
},
|
|
"PromptTemplateSummary": {
|
|
"properties": {
|
|
"name": {
|
|
"description": "Template name",
|
|
"title": "Name",
|
|
"type": "string"
|
|
},
|
|
"category": {
|
|
"default": "",
|
|
"description": "Template category",
|
|
"title": "Category",
|
|
"type": "string"
|
|
},
|
|
"is_default": {
|
|
"default": false,
|
|
"description": "Whether this template is applied by default",
|
|
"title": "Is Default",
|
|
"type": "boolean"
|
|
},
|
|
"origin": {
|
|
"default": "manual",
|
|
"description": "Template origin: manual or mcp",
|
|
"title": "Origin",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name"
|
|
],
|
|
"title": "PromptTemplateSummary",
|
|
"type": "object"
|
|
},
|
|
"ListPromptTemplateSummaryResponse": {
|
|
"properties": {
|
|
"templates": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/PromptTemplateSummary"
|
|
},
|
|
"title": "Templates",
|
|
"type": "array"
|
|
}
|
|
},
|
|
"required": [
|
|
"templates"
|
|
],
|
|
"title": "ListPromptTemplateSummaryResponse",
|
|
"type": "object"
|
|
},
|
|
"WsTemplateSummary": {
|
|
"properties": {
|
|
"name": {
|
|
"title": "Name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"title": "Description",
|
|
"type": "string"
|
|
},
|
|
"model": {
|
|
"title": "Model",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"description",
|
|
"model"
|
|
],
|
|
"title": "WsTemplateSummary",
|
|
"type": "object"
|
|
},
|
|
"ListWsTemplateSummaryResponse": {
|
|
"properties": {
|
|
"ws_templates": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/WsTemplateSummary"
|
|
},
|
|
"title": "Ws Templates",
|
|
"type": "array"
|
|
}
|
|
},
|
|
"required": [
|
|
"ws_templates"
|
|
],
|
|
"title": "ListWsTemplateSummaryResponse",
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|